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

Method GetGeometry

generator/pygen/pygen.cpp:107–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105 GeomType GetGeomType() { return m_feature->GetGeomType(); }
106
107 bp::list GetGeometry()
108 {
109 bp::list geometry;
110 switch (m_feature->GetGeomType())
111 {
112 case GeomType::Point:
113 case GeomType::Line:
114 {
115 m_feature->ForEachPoint([&](auto const & p) { geometry.append(p); }, FeatureType::BEST_GEOMETRY);
116 }
117 break;
118 case GeomType::Area:
119 {
120 m_feature->ForEachTriangle([&](auto const & p1, auto const & p2, auto const & p3)
121 { geometry.append(m2::TriangleD(p1, p2, p3)); }, FeatureType::BEST_GEOMETRY);
122 }
123 break;
124 case GeomType::Undefined: break;
125 default: UNREACHABLE();
126 }
127
128 return geometry;
129 }
130
131 m2::PointD GetCenter() { return feature::GetCenter(*m_feature); }
132

Callers 4

operator()Method · 0.45
CollectMethod · 0.45
operator()Method · 0.45
BuildCoastsMethod · 0.45

Calls 4

GetGeomTypeMethod · 0.45
ForEachPointMethod · 0.45
appendMethod · 0.45
ForEachTriangleMethod · 0.45

Tested by 2

operator()Method · 0.36
BuildCoastsMethod · 0.36