NBContHelper::edge_by_junction_angle_sorter Class Reference

#include <NBContHelper.h>


Detailed Description

edge_by_angle_sorter Class to sort edges by their angle

Definition at line 76 of file NBContHelper.h.


Public Member Functions

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

Private Member Functions

SUMOReal getConvAngle (NBEdge *e) const
 Converts the angle of the edge if it is an incoming edge.

Private Attributes

NBNodemyNode
 the edge to compute the relative angle of

Constructor & Destructor Documentation

NBContHelper::edge_by_junction_angle_sorter::edge_by_junction_angle_sorter ( NBNode n  )  [inline, explicit]

constructor

Definition at line 79 of file NBContHelper.h.

00079 : myNode(n) {}


Member Function Documentation

SUMOReal NBContHelper::edge_by_junction_angle_sorter::getConvAngle ( NBEdge e  )  const [private]

Converts the angle of the edge if it is an incoming edge.

Definition at line 113 of file NBContHelper.cpp.

References NBEdge::getFromNode(), NBEdge::getNormedAngle(), myNode, and SUMOReal.

Referenced by operator()().

00113                                                                        {
00114 
00115     SUMOReal angle;
00116     // convert angle if the edge is an outgoing edge
00117     if (e->getFromNode()==myNode) {
00118         angle = e->getNormedAngle(*myNode);
00119         angle += (SUMOReal) 180.;
00120         if (angle>=(SUMOReal) 360.) {
00121             angle -= (SUMOReal) 360.;
00122         }
00123     } else {
00124         angle = e->getNormedAngle(*myNode);
00125     }
00126     if (angle<0.1||angle>359.9) {
00127         angle = (SUMOReal) 0.;
00128     }
00129     assert(angle>=(SUMOReal)0 && angle<(SUMOReal)360);
00130     return angle;
00131 }

int NBContHelper::edge_by_junction_angle_sorter::operator() ( NBEdge e1,
NBEdge e2 
) const

comparing operation

Definition at line 106 of file NBContHelper.cpp.

References getConvAngle().

00106                                                                                   {
00107     return getConvAngle(e1) < getConvAngle(e2);
00108 }


Field Documentation

the edge to compute the relative angle of

Definition at line 90 of file NBContHelper.h.

Referenced by getConvAngle().


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

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