NBContHelper::edge_opposite_direction_sorter Class Reference

#include <NBContHelper.h>


Detailed Description

edge_opposite_direction_sorter Class to sort edges by their angle in relation to the given edge The resulting list should have the edge in the most opposite direction to the given edge as her first entry

Definition at line 155 of file NBContHelper.h.


Public Member Functions

 edge_opposite_direction_sorter (NBEdge *e)
 constructor
SUMOReal getDiff (NBEdge *e) const
int operator() (NBEdge *e1, NBEdge *e2) const
 comparing operation

Private Attributes

SUMOReal myAngle
 the angle to find the edge with the opposite direction
NBEdgemyEdge
 the edge - to avoid comparison of an edge with itself

Constructor & Destructor Documentation

NBContHelper::edge_opposite_direction_sorter::edge_opposite_direction_sorter ( NBEdge e  )  [inline, explicit]

constructor

Definition at line 158 of file NBContHelper.h.

00159                 : myAngle(e->getAngle()), myEdge(e) {}


Member Function Documentation

SUMOReal NBContHelper::edge_opposite_direction_sorter::getDiff ( NBEdge e  )  const [inline]

helping method for the computation of the absolut difference between the edges' angles

Definition at line 172 of file NBContHelper.h.

References NBEdge::getAngle(), GeomHelper::getMinAngleDiff(), myAngle, and SUMOReal.

Referenced by operator()().

00172                                           {
00173             SUMOReal d = e->getAngle()+180;
00174             if (d>=360) {
00175                 d -= 360;
00176             }
00177             return GeomHelper::getMinAngleDiff(d, myAngle);
00178         }

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

comparing operation

Definition at line 163 of file NBContHelper.h.

References getDiff(), and SUMOReal.

00163                                                      {
00164             SUMOReal d1 = getDiff(e1);
00165             SUMOReal d2 = getDiff(e2);
00166             return d1 < d2;
00167         }


Field Documentation

the angle to find the edge with the opposite direction

Definition at line 182 of file NBContHelper.h.

Referenced by getDiff().

the edge - to avoid comparison of an edge with itself

Definition at line 185 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