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

Method ProcessRule

libs/drape_frontend/apply_feature_functors.cpp:843–874  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

841}
842
843void ApplyAreaFeature::ProcessRule(AreaRuleProto const & areaRule, double areaDepth, bool isHatching)
844{
845 AreaViewParams params;
846 params.m_tileCenter = m_tileRect.Center();
847 params.m_depth = PriorityToDepth(areaRule.priority(), drule::area, areaDepth);
848 params.m_color = ToDrapeColor(areaRule.color());
849 params.m_rank = m_f.GetRank();
850 params.m_minPosZ = m_minPosZ;
851 params.m_posZ = m_posZ;
852 params.m_hatching = isHatching;
853 params.m_baseGtoPScale = m_currentScaleGtoP;
854
855 BuildingOutline outline;
856 if (m_isBuilding && !isHatching)
857 {
858 /// @todo Make borders work for non-building areas too.
859 outline.m_generateOutline =
860 areaRule.has_border() && areaRule.color() != areaRule.border().color() && areaRule.border().width() > 0.0;
861 if (outline.m_generateOutline)
862 params.m_outlineColor = ToDrapeColor(areaRule.border().color());
863
864 bool const calculateNormals = m_posZ > 0.0;
865 if (calculateNormals || outline.m_generateOutline)
866 CalculateBuildingOutline(calculateNormals, outline);
867
868 params.m_is3D = !outline.m_indices.empty() && calculateNormals;
869 }
870
871 // see ProcessAreaRules: isHatching first, - !isHatching last.
872 m_insertShape(
873 make_unique_dp<AreaShape>(!isHatching ? std::move(m_triangles) : m_triangles, std::move(outline), params));
874}
875
876ApplyLineFeatureGeometry::ApplyLineFeatureGeometry(TileKey const & tileKey, TInsertShapeFn const & insertShape,
877 FeatureType & f, double currentScaleGtoP)

Callers

nothing calls this directly

Calls 14

ToDrapeColorFunction · 0.85
ExtractLineParamsFunction · 0.85
GetVisualScaleMethod · 0.80
priorityMethod · 0.60
has_borderMethod · 0.60
has_pathsymMethod · 0.60
offsetMethod · 0.60
stepMethod · 0.60
CenterMethod · 0.45
colorMethod · 0.45
GetRankMethod · 0.45
widthMethod · 0.45

Tested by

no test coverage detected