Fade2D Documentation pages v1.97
Delaunay Features
ConstraintSegment2.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 // not clear to you.
14 //
15 // Author: Bernhard Kornberger, bkorn (at) geom.at
16 // http://www.geom.at
17 
19 #pragma once
20 #include <set>
21 
22 #include "common.h"
23 #if GEOM_PSEUDO3D==GEOM_TRUE
24  namespace GEOM_FADE25D {
25 #elif GEOM_PSEUDO3D==GEOM_FALSE
26  namespace GEOM_FADE2D {
27 #else
28  #error GEOM_PSEUDO3D is not defined
29 #endif
30 
31 class Point2; // FWD
32 class ConstraintGraph2; // FWD
33 class ConstraintMgr; // FWD
34 
52 {
53  CIS_CONFORMING_DELAUNAY=0,
55 #if GEOM_PSEUDO3D==GEOM_TRUE
56  CIS_CONFORMING_DELAUNAY_SEGMENT_LEVEL=2,
57 #endif
60 };
61 
69 {
70 private:
71  // ConstraintSegment2 objects are only made by ConstraintMgr/ConstraintGraph2
73  friend class ConstraintMgr;
74  friend class ConstraintGraph2;
75 public:
80  CLASS_DECLSPEC
81  Point2* getSrc() const;
85  CLASS_DECLSPEC
86  Point2* getTrg() const;
88  void kill();
89 
91  bool dbg_hasDirection();
92 
93 // Reanimate a constraint segment
95  void unkill();
96 
101  CLASS_DECLSPEC
102  bool isAlive() const;
103 
109 
110 
114  CLASS_DECLSPEC
115  bool operator<(const ConstraintSegment2& pOther) const;
116 
131  CLASS_DECLSPEC
132  Point2* insertAndSplit(const Point2& splitPoint);
133 
138  CLASS_DECLSPEC
140 //*
141 //* internal use. Deprecated!
142 //*/
144  CLASS_DECLSPEC
145  bool splitAndRemovePrev(const Point2& split);
146 
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
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 
193  int label;
194 protected:
196  std::set<ConstraintGraph2*> sOwners;
197 
198  Point2 *p0,*p1;
200  bool bAlive;
201 
202  std::vector<ConstraintSegment2*> vChildren;
204  double adjacentArea;
205 
206  static int runningLabel;
207 };
208 
209 } // NAMESPACE
std::ostream & operator<<(std::ostream &stream, const Bbox2 &pC)
Print the box.
Definition: Bbox2.h:450
ConstraintInsertionStrategy
Constraint Insertion Strategy determines how a constraint edge shall be inserted:
Definition: ConstraintSegment2.h:52
@ CIS_KEEP_DELAUNAY
Deprecated name.
Definition: ConstraintSegment2.h:58
@ CIS_CONSTRAINED_DELAUNAY
Deprecated.
Definition: ConstraintSegment2.h:54
@ CIS_IGNORE_DELAUNAY
Deprecated.
Definition: ConstraintSegment2.h:59
ConstraintGraph2 is a set of Constraint Edges (ConstraintSegment2)
Definition: ConstraintGraph2.h:52
A ConstraintSegment2 represents a Constraint Edge.
Definition: ConstraintSegment2.h:69
Point2 * getTrg() const
Get the second endpoint.
bool operator<(const ConstraintSegment2 &pOther) const
operator<(..) Compares the vertex pointers of the endpoints, not the length
void getChildrenAndSplitPoint(ConstraintSegment2 *&pCSeg0, ConstraintSegment2 *&pCSeg1, Point2 *&pSplitPoint)
Get the children and the split point Retrieve the two direct children of the current ConstraintSegmen...
Point2 * getSrc() const
Get the first endpoint.
bool isAlive() const
Check if the present ConstraintSegment2 is alive.
Point2 * insertAndSplit(const Point2 &splitPoint)
Split a constraint segment.
bool split_combinatorialOnly(Point2 *pSplit)
Split a constraint segment.
ConstraintInsertionStrategy getCIS() const
Get the Constraint Insertion Strategy (CIS)
void getChildrenRec(std::vector< ConstraintSegment2 * > &vChildConstraintSegments)
Get all children Recursively retrieve all children of the current ConstraintSegment2.
Point.
Definition: Point2.h:43