![]() |
OGS
|
|
This class computes and stores the topological relations between 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.
Definition at line 19 of file SimplePolygonTree.h.
#include <SimplePolygonTree.h>
Public Member Functions | |
| SimplePolygonTree (Polygon *polygon, SimplePolygonTree *parent) | |
| virtual | ~SimplePolygonTree () |
| bool | isRoot () const |
| bool | isPolygonInside (const SimplePolygonTree *polygon_hierarchy) const |
| void | insertSimplePolygonTree (SimplePolygonTree *polygon_hierarchy) |
| Polygon const & | polygon () const |
| Polygon & | polygon () |
| const SimplePolygonTree * | parent () const |
| std::size_t | getNumberOfChildren () const |
| decltype(_children) ::const_iterator | begin () const |
| decltype(_children) ::const_iterator | end () const |
Private Attributes | |
| Polygon * | _node_polygon |
| std::list< SimplePolygonTree * > | _children |
| SimplePolygonTree * | _parent |
| GeoLib::SimplePolygonTree::SimplePolygonTree | ( | Polygon * | polygon, |
| SimplePolygonTree * | parent ) |
Creates a node of a tree containing a simple polygon.
| polygon | the polygon represented by this tree node |
| parent | pointer to the parent node within the tree or nullptr (if SimplePolygonTree node is the root node of the tree) |
Definition at line 10 of file SimplePolygonTree.cpp.
References SimplePolygonTree(), _node_polygon, _parent, parent(), and polygon().
Referenced by FileIO::GMSH::GMSHPolygonTree::GMSHPolygonTree(), SimplePolygonTree(), insertSimplePolygonTree(), isPolygonInside(), and parent().
|
virtual |
Destructor: Attention: does not destroy the polygon!
Definition at line 16 of file SimplePolygonTree.cpp.
References _children.
|
inline |
Definition at line 68 of file SimplePolygonTree.h.
References _children.
|
inline |
|
inline |
returns the number of children
Definition at line 48 of file SimplePolygonTree.h.
References _children.
| void GeoLib::SimplePolygonTree::insertSimplePolygonTree | ( | SimplePolygonTree * | polygon_hierarchy | ) |
Either insert the given SimplePolygonTree in one of the existing children or as a new child.
Definition at line 40 of file SimplePolygonTree.cpp.
References SimplePolygonTree(), _children, _parent, and polygon().
| bool GeoLib::SimplePolygonTree::isPolygonInside | ( | const SimplePolygonTree * | polygon_hierarchy | ) | const |
Definition at line 29 of file SimplePolygonTree.cpp.
References SimplePolygonTree(), _node_polygon, and polygon().
| bool GeoLib::SimplePolygonTree::isRoot | ( | ) | const |
Checks if the polygon represented by the given polygon tree node is inside this node polygon.
Definition at line 24 of file SimplePolygonTree.cpp.
References _parent.
Referenced by FileIO::GMSH::GMSHPolygonTree::~GMSHPolygonTree(), FileIO::GMSH::GMSHPolygonTree::markSharedSegments(), and FileIO::GMSH::GMSHPolygonTree::writeSubPolygonsAsLineConstraints().
| const SimplePolygonTree * GeoLib::SimplePolygonTree::parent | ( | ) | const |
Definition at line 35 of file SimplePolygonTree.cpp.
References SimplePolygonTree(), and _parent.
Referenced by FileIO::GMSH::GMSHPolygonTree::GMSHPolygonTree(), SimplePolygonTree(), FileIO::GMSH::GMSHPolygonTree::createGMSHPoints(), and FileIO::GMSH::GMSHPolygonTree::markSharedSegments().
| Polygon & GeoLib::SimplePolygonTree::polygon | ( | ) |
Definition at line 58 of file SimplePolygonTree.cpp.
References _node_polygon.
| Polygon const & GeoLib::SimplePolygonTree::polygon | ( | ) | const |
Definition at line 62 of file SimplePolygonTree.cpp.
References _node_polygon.
Referenced by FileIO::GMSH::GMSHPolygonTree::GMSHPolygonTree(), SimplePolygonTree(), FileIO::GMSH::GMSHPolygonTree::createGMSHPoints(), FileIO::GMSH::GMSHPolygonTree::initMeshDensityStrategy(), FileIO::GMSH::GMSHPolygonTree::insertPolyline(), insertSimplePolygonTree(), FileIO::GMSH::GMSHPolygonTree::insertStation(), isPolygonInside(), FileIO::GMSH::GMSHPolygonTree::markSharedSegments(), FileIO::GMSH::GMSHPolygonTree::writeAdditionalPointData(), FileIO::GMSH::GMSHPolygonTree::writeLineConstraints(), FileIO::GMSH::GMSHPolygonTree::writeLineLoop(), and FileIO::GMSH::GMSHPolygonTree::writeSubPolygonsAsLineConstraints().
|
private |
list of polygons (represented by SimplePolygonTree nodes) contained in the _node_polygon
Definition at line 60 of file SimplePolygonTree.h.
Referenced by ~SimplePolygonTree(), begin(), end(), getNumberOfChildren(), and insertSimplePolygonTree().
|
private |
the polygon this node stands for
Definition at line 54 of file SimplePolygonTree.h.
Referenced by SimplePolygonTree(), isPolygonInside(), polygon(), and polygon().
|
private |
the polygon represented by this node is contained in the polygon represented by the parent node in the tree
Definition at line 65 of file SimplePolygonTree.h.
Referenced by SimplePolygonTree(), insertSimplePolygonTree(), isRoot(), and parent().