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

Method AssignArea

generator/feature_builder.cpp:110–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108}
109
110void FeatureBuilder::AssignArea(PointSeq && outline, Geometry const & holes)
111{
112 AssignPoints(std::move(outline));
113
114 if (holes.empty())
115 return;
116
117 PointSeq const & poly = GetOuterGeometry();
118 m2::Region<m2::PointD> rgn(poly.begin(), poly.end());
119
120 for (PointSeq const & points : holes)
121 {
122 ASSERT(!points.empty(), (*this));
123
124 size_t j = 0;
125 size_t const count = points.size();
126 for (; j < count; ++j)
127 if (!rgn.Contains(points[j]))
128 break;
129
130 if (j == count)
131 m_polygons.push_back(points);
132 }
133}
134
135void FeatureBuilder::AddPolygon(PointSeq && poly)
136{

Callers 2

BuildFromRelationMethod · 0.80
UNIT_CLASS_TESTFunction · 0.80

Calls 7

ASSERTFunction · 0.85
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45
ContainsMethod · 0.45
push_backMethod · 0.45

Tested by 1

UNIT_CLASS_TESTFunction · 0.64