Geom Software - C++ Programming and Geometry Libraries
Fade2D Documentation pages v1.52
ConstraintGraph2.h
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 // not clear to you.
14 //
15 // Author: Bernhard Kornberger, bkorn (at) geom.at
16 // http://www.geom.at
17 
18 
19 #pragma once
20 #include "Segment2.h"
21 #include "ConstraintSegment2.h"
22 #include "Edge2.h"
23 #include <map>
24 
25 
26 #include "common.h"
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 class Dt2; // Forward
36 class ConstraintSegment2; // Forward
37 class GeomTest; // Forward
38 
39 
48 {
49 public:
54  CLASS_DECLSPEC
56  Dt2* pDt2_,
57  std::vector<ConstraintSegment2*>& vCSegments,
58  ConstraintInsertionStrategy
59  );
60 
66  CLASS_DECLSPEC
67  ConstraintGraph2(
68  Dt2* pDt2_,
69  std::vector<ConstraintSegment2*>& vCSegments_,
70  std::map<std::pair<Point2*,Point2*>,bool > mPPReverse,
71  ConstraintInsertionStrategy cis_
72  );
73 
78 void init(std::vector<ConstraintSegment2*>& vCSegments_);
79 
80 
86  CLASS_DECLSPEC
87  bool isPolygon() const;
88 
95  CLASS_DECLSPEC
96  bool isOriented() const;
97 
112  CLASS_DECLSPEC
113  void getPolygonVertices(std::vector<Point2*>& vTriangulationPoints_) ;
114 
125  CLASS_DECLSPEC
126  ConstraintInsertionStrategy getInsertionStrategy() const;
127 
132  CLASS_DECLSPEC
133  bool isConstraint(Point2* p0,Point2* p1) const;
134 
135 
136 
140  CLASS_DECLSPEC
141  void show(const std::string& name);
142 
143 
144 
152  CLASS_DECLSPEC
153  void getOriginalConstraintSegments(std::vector<ConstraintSegment2*>& vConstraintSegments_) const;
154 
161  CLASS_DECLSPEC
162  void getChildConstraintSegments(std::vector<ConstraintSegment2*>& vConstraintSegments_) const;
163 
164 
168  void updateSplittedConstraintSegment(
169  ConstraintSegment2* pCSeg,
170  bool bDirChange0,
171  bool bDirChange1,
172  ConstraintSegment2* pChild0,
173  ConstraintSegment2* pChild1,
174  bool bUpdateCMGR);
178  Dt2* getDt2();
179  void getAliveConstraintChain(std::vector<ConstraintSegment2*>& vAliveCSeg) ; // For debugging
180 protected:
181  bool isReverse(ConstraintSegment2* pCSeg) const;
182  bool checkAndSortPolygon(std::vector<ConstraintSegment2*>& vCSegments_);
183 
184 
185  // Data
186  Dt2* pDt2;
187  GeomTest* pGeomPredicates;
188  ConstraintInsertionStrategy cis;
189  std::vector<ConstraintSegment2*> vCSegParents;
190  bool bIsPolygon;
191  std::map<ConstraintSegment2*,bool,func_ltDerefPtr<ConstraintSegment2*> > mCSegReverse;
192  std::map<Point2*,size_t> mSplitPointNum;
193  bool bIsOriented;
194 };
195 
196 } // (namespace)
Point.
Definition: Point2.h:39
ConstraintGraph2 is a set of enforced edges.
Definition: ConstraintGraph2.h:47
Constraint segment.
Definition: ConstraintSegment2.h:70
Definition: Bbox2.h:25