![]() |
Eclipse SUMO - Simulation of Urban MObility
|
Class to sort edges by their angle in relation to the given edge. More...
#include <NBContHelper.h>
Public Member Functions | |
| edge_opposite_direction_sorter (const NBEdge *const e, const NBNode *const n, bool regardPriority) | |
| Constructor. | |
| int | operator() (NBEdge *e1, NBEdge *e2) const |
| Comparing operation. | |
Protected Member Functions | |
| double | getDiff (const NBEdge *const e) const |
| Computes the angle difference between the related and the given edge. | |
| double | getEdgeAngleAt (const NBEdge *const e, const NBNode *const n) const |
| Returns the given edge's angle at the given node. | |
Private Attributes | |
| double | myAngle |
| The angle of the related edge at the given node. | |
| const NBEdge *const | myEdge |
| the reference edge | |
| const NBNode *const | myNode |
| The related node. | |
| bool | myRegardPriority |
| Whether edge priority may override closer angles. | |
Class to sort edges by their angle in relation to the given edge.
The resulting sorted list has the edge in the most opposite direction to the given edge as her first entry.
Definition at line 146 of file NBContHelper.h.
|
inlineexplicit |
Constructor.
| [in] | e | The edge to which the sorting relates |
| [in] | n | The node to consider |
Definition at line 152 of file NBContHelper.h.
References getEdgeAngleAt(), myAngle, myEdge, myNode, myRegardPriority, and n.
|
inlineprotected |
Computes the angle difference between the related and the given edge.
| [in] | e | The edge to compare the angle difference of |
Definition at line 177 of file NBContHelper.h.
References GeomHelper::angleDiff(), getEdgeAngleAt(), myAngle, and myNode.
Referenced by operator()().
|
inlineprotected |
Returns the given edge's angle at the given node.
Please note that we always consider the "outgoing direction".
| [in] | e | The edge to which the sorting relates |
| [in] | n | The node to consider |
Definition at line 187 of file NBContHelper.h.
References PositionVector::angleAt2D(), NBEdge::getFromNode(), NBEdge::getGeometry(), and n.
Referenced by edge_opposite_direction_sorter(), and getDiff().
|
inline |
Comparing operation.
| [in] | e1 | The first edge to compare |
| [in] | e2 | The second edge to compare |
Definition at line 164 of file NBContHelper.h.
References getDiff(), NBEdge::getPriority(), myEdge, and myRegardPriority.
|
private |
The angle of the related edge at the given node.
Definition at line 204 of file NBContHelper.h.
Referenced by edge_opposite_direction_sorter(), and getDiff().
|
private |
the reference edge
Definition at line 201 of file NBContHelper.h.
Referenced by edge_opposite_direction_sorter(), and operator()().
|
private |
The related node.
Definition at line 198 of file NBContHelper.h.
Referenced by edge_opposite_direction_sorter(), and getDiff().
|
private |
Whether edge priority may override closer angles.
Definition at line 207 of file NBContHelper.h.
Referenced by edge_opposite_direction_sorter(), and operator()().