Geom Software - C++ Programming and Geometry Libraries
Fade2D Documentation pages v1.58
ConstraintSegment2.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 #pragma once
19 #include <set>
20 
21 #include "common.h"
22 #if GEOM_PSEUDO3D==GEOM_TRUE
23  namespace GEOM_FADE25D {
24 #elif GEOM_PSEUDO3D==GEOM_FALSE
25  namespace GEOM_FADE2D {
26 #else
27  #error GEOM_PSEUDO3D is not defined
28 #endif
29 
30 class Point2; // FWD
31 class ConstraintGraph2; // FWD
32 
33 
57 enum ConstraintInsertionStrategy
58 {
59  CIS_CONFORMING_DELAUNAY=0,
60  CIS_CONSTRAINED_DELAUNAY=1,
61 #if GEOM_PSEUDO3D==GEOM_TRUE
62  CIS_CONFORMING_DELAUNAY_SEGMENT_LEVEL=2,
63 #endif
64  CIS_KEEP_DELAUNAY=0, // Deprecated name
65  CIS_IGNORE_DELAUNAY=1 // Deprecated name
66 };
67 
75 {
76 public:
77  ConstraintSegment2(Point2* p0_,Point2* p1_,ConstraintInsertionStrategy cis_);
82  CLASS_DECLSPEC
83  Point2* getSrc() const;
87  CLASS_DECLSPEC
88  Point2* getTrg() const;
90  void kill();
91 
93  bool dbg_hasDirection();
94 
95 // Reanimate a constraint segment
97  void unkill();
98 
102  CLASS_DECLSPEC
103  bool isAlive() const;
104 
109  ConstraintInsertionStrategy getCIS() const;
110 
111 
115  CLASS_DECLSPEC
116  bool operator<(const ConstraintSegment2& pOther) const;
117 
132  CLASS_DECLSPEC
133  Point2* insertAndSplit(const Point2& splitPoint);
134 
139  CLASS_DECLSPEC
140  bool split_combinatorialOnly(Point2* pSplit);
141 
142 
143 //*
144 //* internal use. Deprecated!
145 //*/
146  CLASS_DECLSPEC
147  bool splitAndRemovePrev(const Point2& split);
148  //bool splitAndRemovePrev_deprecated(Point2* pSplit);
149 
150 //Sets a specific ConstraintGraph2 as owner of the current ConstraintSegment2.
152  void addOwnerRecursive(ConstraintGraph2* pOwner);
153 
154 // Removes a specific ConstraintGraph2 as owner of the current ConstraintSegment2.
156  void removeOwner(ConstraintGraph2* pOwner);
157  CLASS_DECLSPEC
161  void getChildrenRec(std::vector<ConstraintSegment2*>& vChildConstraintSegments);
162  CLASS_DECLSPEC
166  void getChildrenAndSplitPoint(ConstraintSegment2*& pCSeg0,ConstraintSegment2*& pCSeg1,Point2*& pSplitPoint);
167  CLASS_DECLSPEC
168  friend std::ostream &operator<<(std::ostream &stream, const ConstraintSegment2& cSeg);
169 
171  CLASS_DECLSPEC
172  size_t getNumberOfOwners() const;
173 
174 
175 
176 //* A customer specific method, not thought for public use. If the
177 //* current constraint segment is a border segment, then the area of
178 //* the (non-existing) outside triangle can manually be deposited
179 //* here. This value is used by the extended meshing method when a
180 //* grow factor is given or ignored if not set.
182  CLASS_DECLSPEC
183  void setAdjacentArea(double adjacentArea_);
184 
185 
186 
187 //* A customer specific method, not thought for public use. Returns
188 //* a previously via setAdjacentArea(double adjacentArea_) deposited
189 //* value. If not explicitly set, DBL_MAX is returned.
191  CLASS_DECLSPEC
192  double getAdjacentArea() const;
193 
194  // temporarily public
196  std::set<ConstraintGraph2*> sOwners;
197 
198  int label;
199 protected:
200 
201  Point2 *p0,*p1;
202  ConstraintInsertionStrategy cis;
203  bool bAlive;
204 
205  std::vector<ConstraintSegment2*> vChildren;
207  double adjacentArea;
208 
209  static int runningLabel;
210 };
211 
212 } // NAMESPACE
Point.
Definition: Point2.h:39
ConstraintGraph2 is a set of Constraint Edges to be enforced. These are ConstraintSegment2 objects...
Definition: ConstraintGraph2.h:49
A ConstraintSegment2 represents a Constraint Edge.
Definition: ConstraintSegment2.h:74
Definition: Bbox2.h:25