Fade2.5D Documentation pages v1.86
Delaunay Features
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 // FWD
36 class Dt2;
37 class ConstraintSegment2;
38 class GeomTest;
39 class Visualizer2;
40 class Color;
41 
51 {
52 public:
54  CLASS_DECLSPEC
56  Dt2* pDt2_,
57  std::vector<ConstraintSegment2*>& vCSegments,
59  );
60 
62  CLASS_DECLSPEC
64  Dt2* pDt2_,
65  std::vector<ConstraintSegment2*>& vCSegments_,
66  std::map<std::pair<Point2*,Point2*>,bool > mPPReverse,
68  );
69 
71  void init(std::vector<ConstraintSegment2*>& vCSegments_);
72 
73 
74 
82  CLASS_DECLSPEC
83  bool isPolygon() const;
84 
91  CLASS_DECLSPEC
92  bool isOriented() const;
93 
109  CLASS_DECLSPEC
110  void getPolygonVertices(std::vector<Point2*>& vVertices_) ;
111 
112 
123  CLASS_DECLSPEC
124  ConstraintInsertionStrategy getInsertionStrategy() const;
125 
131  CLASS_DECLSPEC
132  bool isConstraint(Point2* p0,Point2* p1) const;
133 
142  CLASS_DECLSPEC
143  bool isConstraint(ConstraintSegment2* pCSeg) const;
144 
145 
149  CLASS_DECLSPEC
150  void show(const char* name);
151 
155  CLASS_DECLSPEC
156  void show(Visualizer2* pVis,const Color& color);
157 
158 
166  CLASS_DECLSPEC
167  void getOriginalConstraintSegments(std::vector<ConstraintSegment2*>& vConstraintSegments_) const;
168 
175  CLASS_DECLSPEC
176  void getChildConstraintSegments(std::vector<ConstraintSegment2*>& vConstraintSegments_) const;
177 
179 bool dbg_hasDirection(ConstraintSegment2* pCSeg) const;
180 
182 void updateSplittedConstraintSegment(
183  ConstraintSegment2* pCSeg,
184  bool bUpdateCMGR);
188  Dt2* getDt2();
198  CLASS_DECLSPEC
199  void getDirectChildren(ConstraintSegment2* pParent,ConstraintSegment2*& pChild0,ConstraintSegment2*& pChild1);
201  void getAliveConstraintChain(std::vector<ConstraintSegment2*>& vAliveCSeg) ; // For debugging
203  void setDirectionsRecursive(std::vector<ConstraintSegment2*>& vCSegments);
216  CLASS_DECLSPEC
217  bool isReverse(ConstraintSegment2* pCSeg) const;
218 
219 
243  CLASS_DECLSPEC
244  bool makeDelaunay(double minLength);
245 
246 protected:
248  bool checkAndSortPolygon(std::vector<ConstraintSegment2*>& vCSegments_);
250  bool checkAndSortPolygonSub(std::vector<ConstraintSegment2*>& vCSegments);
252  void makeSelfOwner(std::vector<ConstraintSegment2*>& vCSeg);
253 
254  // Data
255  Dt2* pDt2;
256  GeomTest* pGeomPredicates;
258  std::vector<ConstraintSegment2*> vCSegParents;
259  bool bIsPolygon;
260  std::map<ConstraintSegment2*,bool,func_ltDerefPtr<ConstraintSegment2*> > mCSegReverse;
261  std::map<Point2*,size_t> mSplitPointNum;
262  bool bIsOriented;
263 
264 private:
266  ConstraintGraph2& operator=(const ConstraintGraph2&);
267 
268 };
269 
270 } // (namespace)
GEOM_FADE25D::Color
Color for visualization.
Definition: Color.h:58
GEOM_FADE25D::ConstraintGraph2
ConstraintGraph2 is a set of Constraint Edges (ConstraintSegment2)
Definition: ConstraintGraph2.h:50
ConstraintSegment2.h
GEOM_FADE25D::ConstraintInsertionStrategy
ConstraintInsertionStrategy
Constraint Insertion Strategy determines how a constraint edge shall be inserted:
Definition: ConstraintSegment2.h:51
GEOM_FADE25D::Visualizer2
Visualizer2 is a general Postscript writer. It draws the objects Point2, Segment2,...
Definition: Visualizer2.h:54
GEOM_FADE25D::ConstraintSegment2
A ConstraintSegment2 represents a Constraint Edge.
Definition: ConstraintSegment2.h:68
GEOM_FADE25D::Point2
Point.
Definition: Point2.h:40