Fade2.5D Documentation pages v2.16.8
Delaunay Features
PolygonTree.h
Go to the documentation of this file.
1 // Copyright (C) Geom Software e.U, Bernhard Kornberger, Graz/Austria
2 //
3 // This file is part of the Fade2D library. The student license is free
4 // of charge and covers personal, non-commercial research. Licensees
5 // holding a commercial license may use this file in accordance with
6 // the Commercial License Agreement.
7 //
8 // This software is provided AS IS with NO WARRANTY OF ANY KIND,
9 // INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS
10 // FOR A PARTICULAR PURPOSE.
11 //
12 // Please contact the author if any conditions of this licensing are
13 // unclear to you.
14 //
15 // Support: https://www.geom.at/contact/
16 // Project: https://www.geom.at/fade2d/html/
17 
18 
20 #pragma once
21 
22 #include "common.h"
23 #include "Segment2.h"
24 #include "Edge2.h"
25 #include "VertexPair2.h"
26 
27 #if GEOM_PSEUDO3D==GEOM_TRUE
28  namespace GEOM_FADE25D {
29 #elif GEOM_PSEUDO3D==GEOM_FALSE
30  namespace GEOM_FADE2D {
31 #else
32  #error GEOM_PSEUDO3D is not defined
33 #endif
34 
35 
36 
52 class CLASS_DECLSPEC PolygonTree
53 {
54 public:
62  explicit PolygonTree(int layer_);
63 
65  ~PolygonTree();
66  int getLayer() const;
88  std::vector<PolygonTree*>& getChildren();
89 
98  void getChildrenRecursive(std::vector<PolygonTree*>& vChildNodesRec);
99 
117  void getSegments_regionOriented(std::vector<Segment2>& vSegments) const;
118 
132  void getSegments_CCW(std::vector<Segment2>& vSegments) const;
133 
142  void getSegments_CW(std::vector<Segment2>& vSegments) const;
143 
145  void setGeometrySortedPairs(std::vector<VertexPair2>& vGeometrySortedCW);
147  void getPointerSortedPairs(std::vector<VertexPair2>& vFromCW_sorted) const;
148 private:
150  // const std::vector<VertexPair2>& getGeometrySortedPairsCW();
151  explicit PolygonTree(const PolygonTree&);
152  PolygonTree& operator=(const PolygonTree&);
153  // DATA
154  struct Impl;
155  Impl* pImpl;
156 
157 };
158 
159 
160 
161 } // (namespace)
Represents the possibly nested layers of a polygon as a hierarchical structure.
Definition: PolygonTree.h:53
void getSegments_CW(std::vector< Segment2 > &vSegments) const
Retrieves clockwise ordered and oriented segments.
void getSegments_regionOriented(std::vector< Segment2 > &vSegments) const
Retrieves region-oriented segments.
void getChildrenRecursive(std::vector< PolygonTree * > &vChildNodesRec)
Retrieves all child nodes recursively.
std::vector< PolygonTree * > & getChildren()
Retrieves the direct child nodes of this PolygonTree node.
void getSegments_CCW(std::vector< Segment2 > &vSegments) const
Retrieves globally counter-clockwise ordered and oriented segments.