diff --git a/GeoLib/SimplePolygonTree.h b/GeoLib/SimplePolygonTree.h index a937ef3b5420099af44f5a3751f51a0df6f9946c..f05c8845dd81de05b386c88329e2e5b845ee8c09 100644 --- a/GeoLib/SimplePolygonTree.h +++ b/GeoLib/SimplePolygonTree.h @@ -24,15 +24,28 @@ namespace GeoLib { /** * \brief This class computes and stores the topological relations between - * polygons. Every node of the SimplePolygonTree represents a polygon. + * polygons. Every node of the SimplePolygonTree represents a polygon. A + * child node c of a parent node p mean that the polygon represented by c + * is contained in the polygon represented by p. */ class SimplePolygonTree { public: + /** Creates a node of a tree containing a simple polygon. + * @param polygon the polygon represented by this tree node + * @param parent pointer to the parent node within the tree or nullptr + * (if SimplePolygonTree node is the root node of the tree) + */ SimplePolygonTree(Polygon* polygon, SimplePolygonTree* parent); + /** Destructor: Attention: does not destroy the polygon! */ virtual ~SimplePolygonTree(); - + /** Checks if the polygon represented by the given polygon tree node + * is inside this node polygon. + */ bool isPolygonInside (const SimplePolygonTree* polygon_tree) const; + /** Either insert the given SimplePolygonTree in one of the existing + * childs or as a new child. + */ void insertSimplePolygonTree (SimplePolygonTree* polygon_tree); /**