24 |
#include <Vertex.hpp> |
#include <Vertex.hpp> |
25 |
#include <utility> |
#include <utility> |
26 |
|
|
27 |
/*! \class Edge |
/*! |
28 |
This class provides a Edge description. |
\class Edge |
|
A Edge is defined by 2 vertices and a reference. |
|
29 |
*/ |
*/ |
30 |
|
|
31 |
|
/** |
32 |
|
* @file Edge.hpp |
33 |
|
* @author Stephane Del Pino |
34 |
|
* @date Sun Jun 15 20:15:23 2003 |
35 |
|
* |
36 |
|
* @brief This class provides a Edge description. |
37 |
|
* |
38 |
|
* This class provides a Edge description. A Edge is defined by 2 |
39 |
|
* vertices and a reference. |
40 |
|
* |
41 |
|
* @todo This class is really hugly should rework it a lot! |
42 |
|
*/ |
43 |
|
|
44 |
class Edge |
class Edge |
45 |
{ |
{ |
46 |
public: |
public: |
48 |
NumberOfVertices = 2 |
NumberOfVertices = 2 |
49 |
}; |
}; |
50 |
|
|
51 |
typedef std::pair<const Vertex*, const Vertex*> Pair; |
typedef std::pair<Vertex*, Vertex*> Pair; |
52 |
private: |
private: |
53 |
//! An edge is defined by two vertices. |
//! An edge is defined by two vertices. |
54 |
Edge::Pair vp; |
Edge::Pair vp; |
113 |
Edge(const Vertex& v1, const Vertex& v2, int r=0) |
Edge(const Vertex& v1, const Vertex& v2, int r=0) |
114 |
: ref(r) |
: ref(r) |
115 |
{ |
{ |
116 |
const Vertex* V1 = (&v1<&v2) ? &v1 : &v2; |
Vertex* V1 = const_cast<Vertex*>((&v1<&v2) ? &v1 : &v2); |
117 |
const Vertex* V2 = (&v1>&v2) ? &v1 : &v2; |
Vertex* V2 = const_cast<Vertex*>((&v1>&v2) ? &v1 : &v2); |
118 |
vp = Pair(V1, V2); |
vp = Pair(V1, V2); |
119 |
} |
} |
120 |
|
|