The function p3d_graph *p3d_create_graph(void)
allocates and
initializes a graph structure p3d_graph (cf Annex ), stores it
as the current graph, and returns it as an output.
The function p3d_add_node(p3d_graph *G, double *q)
allocates
a node structure p3d_node (cf Annex )
corresponding to the configuration q. This function initializes
the new node, adds it to the graph G and updates the number of
nodes of this graph. It also stores this node as the current node and
returns it as an output.
The function void p3d_create_compco(p3d_graph *G, p3d_node
*N) creates a new connected component of the graph G containing
the node N. It allocates a connected componant structure
p3d_compco (cf Annex ), initializes it, adds it to
the graph G and updates the number of connected componant of this
graph.
The function void p3d_create_edges(p3d_rob *rob, p3d_graph
*G, p3d_node *N1, p3d_node *N2, double dist)
adds the edges
[N1,N2] and [N2,N1] of lenght dist to the graph G of the robot rob
(Move3D only deals with symmetrical local methods so when the edge
[N1,N2] exists, the edge [N2,N1] exists too). This function
allocates two edges structures p3d_edges (cf Annex
), initializes them (with N1 et N2 as end nodes),
adds them to the graph, as egdes coming from and going to N1 and
N2 and updates the number of edges of the graph G.
The function void p3d_add_neighbour(p3d_graph *G, p3d_node *N1, p3d_node *N2) adds the node N2 to the list of neighbours of the node N1.
The function int p3d_linked(p3d_rob *rob, p3d_graph *G, p3d_node *N1, p3d _node *N2, double *dist) indicates if the nodes N1 and N2 are linked by a collision free path built by the current local method of the robot rob. The function int p3d_link_node_comp(p3d_rob *rob,p3d_graph *G, p3d_node *N,p3d_compco *comp) does exactly the same for the node N and the connected componant comp.
The function void p3d_merge(p3d_graph *G,p3d_compco *c1, p3d_compco *c2) merges the connected componant c2 of the graph G in the connected componant c1 of G.