| 108 | } |
| 109 | |
| 110 | void 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 | |
| 135 | void FeatureBuilder::AddPolygon(PointSeq && poly) |
| 136 | { |