Geom Software - C++ Programming and Geometry Libraries
Fade2D Documentation pages v1.55
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 
92 
93 // Reanimate a constraint segment
95  void unkill();
96 
100  CLASS_DECLSPEC
101  bool isAlive() const;
102 
107  ConstraintInsertionStrategy getCIS() const;
108 
109 
113  CLASS_DECLSPEC
114  bool operator<(const ConstraintSegment2& pOther) const;
115 
130  CLASS_DECLSPEC
131  Point2* insertAndSplit(const Point2& splitPoint);
132 
137  CLASS_DECLSPEC
138  bool split_combinatorialOnly(Point2* pSplit);
139 
140 
141 //*
142 //* internal use. Deprecated!
143 //*/
144  CLASS_DECLSPEC
145  bool splitAndRemovePrev(const Point2& split);
146  //bool splitAndRemovePrev_deprecated(Point2* pSplit);
147 
148 //Sets a specific ConstraintGraph2 as owner of the current ConstraintSegment2.
150  void addOwnerRecursive(ConstraintGraph2* pOwner);
151 
152 // Removes a specific ConstraintGraph2 as owner of the current ConstraintSegment2.
154  void removeOwner(ConstraintGraph2* pOwner);
155  CLASS_DECLSPEC
159  void getChildrenRec(std::vector<ConstraintSegment2*>& vChildConstraintSegments);
160  CLASS_DECLSPEC
164  void getChildrenAndSplitPoint(ConstraintSegment2*& pCSeg0,ConstraintSegment2*& pCSeg1,Point2*& pSplitPoint);
165  CLASS_DECLSPEC
166  friend std::ostream &operator<<(std::ostream &stream, const ConstraintSegment2& cSeg);
167 
169  CLASS_DECLSPEC
170  size_t getNumberOfOwners() const;
171 
172 
173 
174 //* A customer specific method, not thought for public use. If the
175 //* current constraint segment is a border segment, then the area of
176 //* the (non-existing) outside triangle can manually be deposited
177 //* here. This value is used by the extended meshing method when a
178 //* grow factor is given or ignored if not set.
180  CLASS_DECLSPEC
181  void setAdjacentArea(double adjacentArea_);
182 
183 
184 
185 //* A customer specific method, not thought for public use. Returns
186 //* a previously via setAdjacentArea(double adjacentArea_) deposited
187 //* value. If not explicitly set, DBL_MAX is returned.
189  CLASS_DECLSPEC
190  double getAdjacentArea() const;
191 
192  // temporarily public
194  std::set<ConstraintGraph2*> sOwners;
195 protected:
196 
197  Point2 *p0,*p1;
198  ConstraintInsertionStrategy cis;
199  bool bAlive;
200 
201  std::vector<ConstraintSegment2*> vChildren;
203  double adjacentArea;
204 
205 };
206 
207 } // 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