MCPcopy Create free account
hub / github.com/comaps/comaps / TypeAlwaysExists

Function TypeAlwaysExists

libs/indexer/feature_visibility.cpp:132–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130}
131
132bool TypeAlwaysExists(uint32_t type, GeomType geomType = GeomType::Undefined)
133{
134 auto const & cl = classif();
135 if (!cl.IsTypeValid(type))
136 return false;
137
138 if (IsUsefulStandaloneType(type, geomType))
139 return true;
140
141 if (ftypes::Subtypes::Instance().IsTypeWithSubtypesOrSubtype(type))
142 return true;
143
144 uint8_t const typeLevel = ftype::GetLevel(type);
145 ftype::TruncValue(type, 1);
146
147 if (geomType != GeomType::Line)
148 {
149 static uint32_t const arrTypes[] = {
150 cl.GetTypeByPath({"internet_access"}),
151 cl.GetTypeByPath({"toilets"}),
152 cl.GetTypeByPath({"drinking_water"}),
153 };
154 if (base::IsExist(arrTypes, type))
155 return true;
156
157 // Exclude generic 1-arity types like [organic].
158 if (typeLevel >= 2)
159 {
160 static uint32_t const arrTypes[] = {
161 cl.GetTypeByPath({"organic"}),
162 cl.GetTypeByPath({"wheelchair"}),
163 };
164 if (base::IsExist(arrTypes, type))
165 return true;
166 }
167 }
168
169 static uint32_t const complexEntry = cl.GetTypeByPath({"complex_entry"});
170 return (type == complexEntry);
171}
172
173bool IsUsefulNondrawableType(uint32_t type, GeomType geomType = GeomType::Undefined)
174{

Callers 3

IsUsefulNondrawableTypeFunction · 0.85
IsVisibleInRangeFunction · 0.85

Calls 7

IsUsefulStandaloneTypeFunction · 0.85
GetLevelFunction · 0.85
TruncValueFunction · 0.85
IsExistFunction · 0.85
IsTypeValidMethod · 0.80
GetTypeByPathMethod · 0.80

Tested by

no test coverage detected