diff --git a/GeoLib/SimplePolygonTree.cpp b/GeoLib/SimplePolygonTree.cpp index d0e5835226b254e4d890cc76f7dc0de48ac55e7f..198c5aa0d3bac0d4701e31037720bd4ddf9e976c 100644 --- a/GeoLib/SimplePolygonTree.cpp +++ b/GeoLib/SimplePolygonTree.cpp @@ -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)