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

Method IsDrawableLike

libs/indexer/classificator.cpp:286–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

284}
285
286bool ClassifObject::IsDrawableLike(feature::GeomType gt, bool emptyName) const
287{
288 ASSERT(static_cast<int>(gt) >= 0 && static_cast<int>(gt) <= 2, ());
289
290 // check the very common criterion first
291 if (!IsDrawableAny())
292 return false;
293
294 // Define which feature geom types can use which drule types for rendering.
295 static int const visible[3][drule::count_of_rules] = {
296 //{ line, area, symbol, caption, circle, pathtext, waymarker, shield }, see drule::Key::rule_type_t
297 {0, 0, 1, 1, 1, 0, 0, 0}, // fpoint
298 {1, 0, 0, 0, 0, 1, 0, 1}, // fline
299 {0, 1, 0, 0, 0, 0, 0, 0} // farea (!!! key difference with GetSuitable, see suitable_getter::add_rule())
300 };
301
302 for (auto const & k : m_drawRules)
303 {
304 ASSERT_LESS(k.m_type, drule::count_of_rules, ());
305
306 // In case when feature name is empty we don't take into account caption drawing rules.
307 if ((visible[static_cast<int>(gt)][k.m_type] == 1) &&
308 (!emptyName || (k.m_type != drule::caption && k.m_type != drule::pathtext)))
309 {
310 return true;
311 }
312 }
313
314 return false;
315}
316
317std::pair<int, int> ClassifObject::GetDrawScaleRange() const
318{

Callers 2

CanGenerateLikeFunction · 0.80
IsUsefulTypeFunction · 0.80

Calls 1

ASSERTFunction · 0.85

Tested by

no test coverage detected