libmove3d-planners
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Groups Pages
graphConverter.hpp
1 //
2 // graphConverter.hpp
3 // libmove3d-motion
4 //
5 // Created by Jim Mainprice on 19/01/12.
6 // Copyright (c) 2012 LAAS-CNRS. All rights reserved.
7 //
8 
9 #ifndef P3D_GRAPH_CONVERTER_HPP
10 #define P3D_GRAPH_CONVERTER_HPP
11 
12 #include "API/Roadmap/graph.hpp"
13 
14 #include "P3d-pkg.h"
15 
16 #include <map>
17 
19 
20 public:
21  GraphConverter() {}
22  ~GraphConverter() {}
23 
24  graph* convert(const Graph& g, bool deleteGraphStruct = true ) const;
25  graph* exportGraphStruct(const Graph& g) const;
26 
27  Graph* convert(graph* g) const;
28 
29 private:
30 
31  p3d_list_node* copyNodeList(std::map<p3d_node*,p3d_node*>& NodeMap, p3d_list_node* ln, p3d_list_node* end = NULL) const;
32  p3d_list_edge* copyEdgeList(std::map<p3d_edge*,p3d_edge*>& EdgeMap, p3d_list_edge* le, p3d_list_edge* end = NULL) const;
33 
34  p3d_list_edge* createEdgeList(std::map<Edge*,p3d_edge*>& EdgeMap, const std::vector<Edge*>& edges, p3d_list_edge* end = NULL) const;
35  p3d_list_node* createNodeList(std::map<Node*,p3d_node*>& NodeMap, const std::vector<Node*>& nodes, p3d_list_node* end = NULL) const;
36 };
37 
38 #endif
graph * exportGraphStruct(const Graph &g) const
Fonction exports a copy of the p3d_graph contained in the Graph class suposing that it is valid regar...
Definition: graphConverter.cpp:76
Definition: graphConverter.hpp:18
Definition: graph.hpp:28
graph * convert(const Graph &g, bool deleteGraphStruct=true) const
Updates the list of connected components from the p3d_graph structure.
Definition: graphConverter.cpp:393