NBContHelper::relative_edge_sorter Class Reference

#include <NBContHelper.h>


Detailed Description

relative_edge_sorter Class to sort edges by their angle in relation to the node the edge using this class is incoming into. This is normally done to sort edges outgoing from the node the using edge is incoming in by their angle in relation to the using edge's angle (this angle is the reference angle).

Definition at line 102 of file NBContHelper.h.


Public Member Functions

int operator() (NBEdge *e1, NBEdge *e2) const
 comparing operation
 relative_edge_sorter (NBEdge *e, NBNode *n)
 constructor

Private Attributes

NBEdgemyEdge
 the edge to compute the relative angle of
NBNodemyNode
 the node to use

Constructor & Destructor Documentation

NBContHelper::relative_edge_sorter::relative_edge_sorter ( NBEdge e,
NBNode n 
) [inline, explicit]

constructor

Definition at line 105 of file NBContHelper.h.

00106                 : myEdge(e), myNode(n) {}


Member Function Documentation

int NBContHelper::relative_edge_sorter::operator() ( NBEdge e1,
NBEdge e2 
) const [inline]

comparing operation

Definition at line 110 of file NBContHelper.h.

References NBEdge::getAngle(), myEdge, NBHelpers::normRelAngle(), and SUMOReal.

00110                                                      {
00111             if (e1==0||e2==0) {
00112                 return -1;
00113             }
00114             SUMOReal relAngle1 = NBHelpers::normRelAngle(
00115                                      myEdge->getAngle(), e1->getAngle());
00116             SUMOReal relAngle2 = NBHelpers::normRelAngle(
00117                                      myEdge->getAngle(), e2->getAngle());
00118             return relAngle1 > relAngle2;
00119         }


Field Documentation

the edge to compute the relative angle of

Definition at line 123 of file NBContHelper.h.

Referenced by operator()().

the node to use

Definition at line 126 of file NBContHelper.h.


The documentation for this class was generated from the following file:

Generated on Wed May 5 00:06:51 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6