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

Method AddRule

libs/indexer/drawing_rules.cpp:261–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259
260 template <class TRule, class TProtoRule>
261 void AddRule(ClassifObject * p, int scale, TypeT type, TProtoRule const & rule, vector<string> const & apply_if)
262 {
263 unique_ptr<ISelector> selector;
264 if (!apply_if.empty())
265 {
266 selector = ParseSelector(apply_if);
267 if (selector == nullptr)
268 {
269 LOG(LERROR, ("Runtime selector has not been created:", apply_if));
270 return;
271 }
272 }
273
274 BaseRule * obj = new TRule(rule);
275 obj->SetSelector(std::move(selector));
276 Key k = m_holder.AddRule(scale, type, obj);
277 p->SetVisibilityOnScale(true, scale);
278 k.SetPriority(rule.priority());
279 p->AddDrawRule(k);
280 }
281
282 static void DrawElementGetApplyIf(DrawElementProto const & de, vector<string> & apply_if)
283 {

Callers

nothing calls this directly

Calls 8

SetSelectorMethod · 0.80
SetVisibilityOnScaleMethod · 0.80
AddDrawRuleMethod · 0.80
ParseSelectorFunction · 0.70
priorityMethod · 0.60
emptyMethod · 0.45
AddRuleMethod · 0.45
SetPriorityMethod · 0.45

Tested by

no test coverage detected