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

Method ProcessKey

libs/drape_frontend/stylist.cpp:110–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108}
109
110void Stylist::ProcessKey(FeatureType & f, drule::Key const & key)
111{
112 drule::BaseRule const * const dRule = drule::rules().Find(key);
113#ifdef DEBUG
114 using feature::GeomType;
115 auto const geomType = f.GetGeomType();
116#endif // DEBUG
117 switch (key.m_type)
118 {
119 case drule::symbol:
120 ASSERT(dRule->GetSymbol() && !m_symbolRule && (geomType == GeomType::Point || geomType == GeomType::Area),
121 (m_symbolRule == nullptr, geomType, f.DebugString()));
122 m_symbolRule = dRule->GetSymbol();
123 break;
124 case drule::caption:
125 ASSERT(dRule->GetCaption() && dRule->GetCaption()->has_primary() && !m_captionRule &&
126 (geomType == GeomType::Point || geomType == GeomType::Area),
127 (m_captionRule == nullptr, f.DebugString()));
128 m_captionRule = dRule->GetCaption();
129 break;
130 case drule::pathtext:
131 ASSERT(dRule->GetPathtext() && dRule->GetPathtext()->has_primary() && !m_pathtextRule && geomType == GeomType::Line,
132 (m_pathtextRule == nullptr, geomType, f.DebugString()));
133 m_pathtextRule = dRule->GetPathtext();
134 break;
135 case drule::shield:
136 ASSERT(dRule->GetShield() && !m_shieldRule && geomType == GeomType::Line,
137 (m_shieldRule == nullptr, geomType, f.DebugString()));
138 m_shieldRule = dRule->GetShield();
139 break;
140 case drule::line:
141 ASSERT(dRule->GetLine() && geomType == GeomType::Line, (geomType, f.DebugString()));
142 m_lineRules.push_back(dRule->GetLine());
143 break;
144 case drule::area:
145 ASSERT(dRule->GetArea() && geomType == GeomType::Area, (geomType, f.DebugString()));
146 if (key.m_hatching)
147 {
148 ASSERT(!m_hatchingRule, (f.DebugString()));
149 m_hatchingRule = dRule->GetArea();
150 }
151 else
152 {
153 ASSERT(!m_areaRule, (f.DebugString()));
154 m_areaRule = dRule->GetArea();
155 }
156 break;
157 // TODO(pastk) : check if circle/waymarker support exists still (not used in styles ATM).
158 case drule::circle:
159 case drule::waymarker:
160 default: ASSERT(false, (key.m_type, f.DebugString())); return;
161 }
162}
163
164Stylist::Stylist(FeatureType & f, uint8_t zoomLevel, int8_t deviceLang)
165{

Callers

nothing calls this directly

Calls 12

ASSERTFunction · 0.85
has_primaryMethod · 0.60
FindMethod · 0.45
GetGeomTypeMethod · 0.45
GetSymbolMethod · 0.45
DebugStringMethod · 0.45
GetCaptionMethod · 0.45
GetPathtextMethod · 0.45
GetShieldMethod · 0.45
GetLineMethod · 0.45
push_backMethod · 0.45
GetAreaMethod · 0.45

Tested by

no test coverage detected