21 #if GEOM_PSEUDO3D==GEOM_TRUE
22 namespace GEOM_FADE25D {
23 #elif GEOM_PSEUDO3D==GEOM_FALSE
24 namespace GEOM_FADE2D {
26 #error GEOM_PSEUDO3D is not defined
94 if(pT<e.pT)
return true;
95 if(pT>e.pT)
return false;
96 if(oppIdx<e.oppIdx)
return true;
110 return(pT==e.pT && oppIdx==e.oppIdx);
124 return((pT!=e.pT || oppIdx!=e.oppIdx));
160 #if GEOM_PSEUDO3D==GEOM_TRUE
207 struct Func_ltUndirected
209 bool operator()(
const Edge2& eA,
const Edge2& eB)
const
211 Point2 *pA1,*pA2,*pB1,*pB2;
214 if(pA1>pA2) std::swap(pA1,pA2);
215 if(pB1>pB2) std::swap(pB1,pB2);
217 if(pA1<pB1)
return true;
218 if(pA1>pB1)
return false;
223 inline bool sameEdge(
const Edge2& eA,
const Edge2& eB)
225 return ( (eA.getSrc()==eB.getSrc() && eA.getTrg()==eB.getTrg()) ||
226 (eA.getSrc()==eB.getTrg() && eA.getTrg()==eB.getSrc()) );
233 bool operator()(
const Edge2& e0,
const Edge2& e1)
const
235 if(e0.getLength2D()<e1.getLength2D())
return true;
243 bool operator()(
const Edge2& e0,
const Edge2& e1)
const
245 if(e0.getLength2D()>e1.getLength2D())
return true;
251 #if GEOM_PSEUDO3D==GEOM_TRUE
254 struct Func_ltEdge25D
256 bool operator()(
const Edge2& e0,
const Edge2& e1)
const
258 if(e0.getLength25D()<e1.getLength25D())
return true;
Represents a directed edge in a triangulation.
Definition: Edge2.h:46
bool operator==(const Edge2 &e) const
Equality operator for edges.
Definition: Edge2.h:108
Point2 * getSrc() const
Get the source point of the edge.
friend std::ostream & operator<<(std::ostream &stream, const Edge2 &e)
Stream output for Edge2.
Edge2 & operator=(const Edge2 &other)
Assignment operator.
void getPoints(Point2 *&p1, Point2 *&p2) const
Get both endpoints of the edge.
void getTriangles(Triangle2 *&pT0, Triangle2 *&pT1, int &idx0, int &idx1) const
Get the two adjacent triangles of the edge.
bool operator<(const Edge2 &e) const
Comparison operator for ordering edges (does not compare the lengths)
Definition: Edge2.h:92
double getLength2D() const
Get the 2D length of the edge.
Edge2(const Edge2 &e)
Copy constructor.
Edge2(Triangle2 *pT, int oppIdx_)
Constructs an Edge2 from a Triangle2 and an intra-triangle-index.
double getLength25D() const
Get the 2.5D length of the edge.
bool operator!=(const Edge2 &e) const
Inequality operator for edges.
Definition: Edge2.h:122
int getIndex() const
Get the intra-triangle-index of the edge.
Triangle2 * getTriangle() const
Get the Triangle2 associated with the edge.
Edge2()
Default constructor.
Point2 * getTrg() const
Get the target point of the edge.
Represents a 2.5D point.
Definition: Point2.h:61
Represents a triangle in a triangulation.
Definition: Triangle2.h:59