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 30 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 21 of file SimplePolygonTree.cpp.
|
virtual |
Destructor: Attention: does not destroy the polygon!
Definition at line 27 of file SimplePolygonTree.cpp.
References _children.
|
inline |
Definition at line 79 of file SimplePolygonTree.h.
References _children.
|
inline |
|
inline |
returns the number of children
Definition at line 59 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 51 of file SimplePolygonTree.cpp.
bool GeoLib::SimplePolygonTree::isPolygonInside | ( | const SimplePolygonTree * | polygon_hierarchy | ) | const |
Definition at line 40 of file SimplePolygonTree.cpp.
References _node_polygon, GeoLib::Polygon::isPolylineInPolygon(), 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 35 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 46 of file SimplePolygonTree.cpp.
References _parent.
Referenced by FileIO::GMSH::GMSHPolygonTree::createGMSHPoints(), and FileIO::GMSH::GMSHPolygonTree::markSharedSegments().
Polygon & GeoLib::SimplePolygonTree::polygon | ( | ) |
Definition at line 69 of file SimplePolygonTree.cpp.
References _node_polygon.
Polygon const & GeoLib::SimplePolygonTree::polygon | ( | ) | const |
Definition at line 73 of file SimplePolygonTree.cpp.
References _node_polygon.
Referenced by 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 71 of file SimplePolygonTree.h.
Referenced by ~SimplePolygonTree(), begin(), end(), getNumberOfChildren(), and insertSimplePolygonTree().
|
private |
the polygon this node stands for
Definition at line 65 of file SimplePolygonTree.h.
Referenced by 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 76 of file SimplePolygonTree.h.
Referenced by insertSimplePolygonTree(), isRoot(), and parent().