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

Function IsUsefulNondrawableType

libs/indexer/feature_visibility.cpp:173–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171}
172
173bool IsUsefulNondrawableType(uint32_t type, GeomType geomType = GeomType::Undefined)
174{
175 auto const & cl = classif();
176 if (!cl.IsTypeValid(type))
177 return false;
178
179 if (TypeAlwaysExists(type, geomType))
180 return true;
181
182 // Exclude generic 1-arity types like [wheelchair].
183 if (ftype::GetLevel(type) < 2)
184 return false;
185
186 static uint32_t const hwtag = cl.GetTypeByPath({"hwtag"});
187 static uint32_t const psurface = cl.GetTypeByPath({"psurface"});
188
189 /// @todo "roundabout" type itself has caption drawing rules (for point junctions?).
190 if ((geomType == GeomType::Line || geomType == GeomType::Undefined) && ftypes::IsRoundAboutChecker::Instance()(type))
191 return true;
192
193 ftype::TruncValue(type, 1);
194 if (geomType == GeomType::Line || geomType == GeomType::Undefined)
195 {
196 if (type == hwtag || type == psurface)
197 return true;
198 }
199
200 static uint32_t const arrTypes[] = {
201 cl.GetTypeByPath({"fee"}),
202 };
203 return base::IsExist(arrTypes, type);
204}
205/// @}
206} // namespace
207

Callers 1

IsUsefulTypeFunction · 0.85

Calls 6

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

Tested by

no test coverage detected