Skip to content
Snippets Groups Projects
Commit c0acae1d authored by Tom Fischer's avatar Tom Fischer
Browse files

[GeoLib::SimplePolygonTree] Using isPolylineInPolygon().

The until now implementation is not correct. Using
Polygon::isPolylineInPolygon(), which is tested already.
parent 96eadc7d
No related branches found
No related tags found
No related merge requests found
......@@ -31,20 +31,7 @@ SimplePolygonTree::~SimplePolygonTree()
bool SimplePolygonTree::isPolygonInside (const SimplePolygonTree* polygon_hierarchy) const
{
const Polygon* polygon (polygon_hierarchy->getPolygon());
// check *all* points of polygon
size_t n_pnts_polygon (polygon->getNumberOfPoints() - 1), cnt(0);
for (size_t k(0); k < n_pnts_polygon && cnt == k; k++) {
if (_node_polygon->isPntInPolygon (*(polygon->getPoint(k)))) {
cnt++;
}
}
// all points of the given polygon are contained in the
if (cnt == n_pnts_polygon)
return true;
else
return false;
return _node_polygon->isPolylineInPolygon(*(polygon_hierarchy->getPolygon()));
}
void SimplePolygonTree::insertSimplePolygonTree (SimplePolygonTree* polygon_hierarchy)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment