libmove3d-planners
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Groups Pages
edge.hpp
1 #ifndef EDGE_HPP
2 #define EDGE_HPP
3 
4 #include "API/Roadmap/node.hpp"
5 #include "API/ConfigSpace/localpath.hpp"
6 
7 class Graph;
8 
9 #ifndef _ROADMAP_H
10 struct edge;
11 #endif
12 
24 class Edge
25 {
26 public:
27  //contructor and destructor
28  Edge(Graph* G, unsigned int i, unsigned j);
29 
35  Edge(Graph* G, edge* E);
36 
37 
43  // Edge(cpp_Graph* G, p3d_edge* E);
44 
52  Edge(Graph* G, Node* N1, Node* N2, bool compute_length, double& length, bool compute_cost, double& cost );
53 
55  Edge(Node * source, Node * target, localPathPtr_t path);
56 
60  ~Edge();
61 
62  //Accessors
67  edge* getEdgeStruct();
68 
73  Graph* getGraph();
74 
79  Robot* getRobot();
80 
85  double longueur();
86 
91  Node* getSource();
92 
97  Node* getTarget();
98 
99  Edge * getOppositeEdge() const { return oppositeEdge; }
100 
101  void setOppositeEdge(Edge * edge) { oppositeEdge = edge; }
102 
106  double cost();
107 
108  void setCost(double cost);
109 
114  std::tr1::shared_ptr<LocalPath> getLocalPath();
115 
116 
121  void setLocalPath(std::tr1::shared_ptr<LocalPath> pathPtr);
122 
123  //--------------------------------------
124  // BGL
125  BGL_Edge getDescriptor();
126 
127  void setDescriptor(const BGL_Edge& E) {
128  m_is_BGL_Descriptor_Valid = true;
129  m_BGL_Descriptor = E;
130  }
131 
132  void unSetDescriptor() {
133  m_is_BGL_Descriptor_Valid = false;
134  }
135 
136 private:
137  edge* m_Edge;
138 
139  bool m_is_cost_computed;
140 
141  Node* m_Source;
142  Node* m_Target;
143 
144  Edge * oppositeEdge;
145 
146  Graph* m_Graph;
147  Robot* m_Robot;
148 
149  double m_Long;
150 
151 
152  BGL_Edge m_BGL_Descriptor;
153  bool m_is_BGL_Descriptor_Valid;
154 
155  std::tr1::shared_ptr<LocalPath> m_path;
156  bool m_is_LocalPath_Computed;
157 
158 
159 
160 };
161 
162 #endif
163 
164 
Node * getSource()
obtient le Node initial de l'Edge
Definition: edge.cpp:187
Node * getTarget()
obtient le Node final de l'Edge
Definition: edge.cpp:192
void setLocalPath(std::tr1::shared_ptr< LocalPath > pathPtr)
Set the LocalPath associated with the edge.
Definition: edge.cpp:234
Classe représentant un Node d'un Graph.
Definition: node.hpp:39
std::tr1::shared_ptr< LocalPath > getLocalPath()
Get the LocalPath associated with the edge.
Definition: edge.cpp:221
Robot * getRobot()
obtient le Robot pour lequel l'Edge est créée
Definition: edge.cpp:177
Definition: graph.hpp:28
Classe représentant une Edge d'un Graph.
Definition: edge.hpp:24
This class holds a the robot represented by a kinematic chain.
Definition: robot.hpp:42
double cost()
Computes the edge cost and returns it.
Definition: edge.cpp:197
edge * getEdgeStruct()
obtient la structure p3d_edge stockée
Definition: edge.cpp:167
Graph * getGraph()
obtient le Graph pour lequel l'Edge est créée
Definition: edge.cpp:172
double longueur()
obtient la longueur de l'Edge
Definition: edge.cpp:182
~Edge()
Destructeur de la classe.
Definition: edge.cpp:157