45 #define djnode(xtmp) ((DJNode*)xtmp->GetUserData(50))
49 for (Graph::MapNodesById::iterator itNode = graphNodes.begin();
50 itNode != graphNodes.end();
53 Node * n = itNode->second;
64 if (__G->
GetNode(source->
Id()) != source || __G->
GetNode(destination->
Id()) != destination )
69 typedef std::pair < double, DJNode * > DJElement;
70 std::set < DJElement > Q;
71 std::set < DJElement >::iterator itQ;
74 Q.insert(DJElement(djSource->
d,djSource));
78 struct DJNode * current = NULL;
80 DJElement top = *Q.begin();
84 if ( current == NULL )
89 for ( Node::MultimapArcsById::iterator itArc1 = current->
n->
IncidentArcs().begin();
93 Arc * arc = itArc1->second;
94 for ( Arc::MultimapNodesById::iterator itNode = arc->
Nodes().begin();
95 itNode != arc->
Nodes().end();
98 Node * child = itNode->second;
99 if (child == current->
n)
103 double dist_child = distanceFunc(child, current->
n, arc);
105 if ( sDJNodeChild->
d > current->
d + dist_child)
107 if (sDJNodeChild->
d < 1E100) {
108 itQ = Q.find(DJElement(sDJNodeChild->
d,sDJNodeChild));
113 sDJNodeChild->
d = current->
d + dist_child;
117 Q.insert(DJElement(sDJNodeChild->
d,sDJNodeChild));
123 struct DJNode *
n = djDestination;
124 double length =
n->d;
126 int nb_node = __G->
GetNodes().size();
128 for (i=0; i<nb_node ; i++)
130 path.insert(path.begin(),
n->n);
132 pathArcs.insert(pathArcs.begin(),
n->prevArc);
133 if (
n->n == source )
146 for (Graph::MapNodesById::iterator itNode = graphNodes.begin();
147 itNode != graphNodes.end();
153 node->SetUserData(50,0);