22 #ifndef NBContHelper_h 23 #define NBContHelper_h 61 EdgeVector::const_iterator& from);
66 EdgeVector::const_iterator& from);
73 static std::ostream&
out(std::ostream& os,
const std::vector<bool>& v);
156 myAngle = getEdgeAngleAt(e, n);
165 return getDiff(e1) > getDiff(e2);
216 : myAngle(e->getTotalAngle()) {}
312 std::pair<SUMOReal, SUMOReal> mm1 = getMinMaxRelAngles(e1);
313 std::pair<SUMOReal, SUMOReal> mm2 = getMinMaxRelAngles(e2);
314 if (mm1.first == mm2.first && mm1.second == mm2.second) {
320 (mm1.first <= mm2.first && mm1.second <= mm2.second)
322 (mm1.first >= mm2.first && mm1.second >= mm2.second));
323 return (mm1.first >= mm2.first && mm1.second >= mm2.second);
333 for (EdgeVector::const_iterator i = ev.begin(); i != ev.end(); ++i) {
336 if (min == 360 || min > angle) {
339 if (max == 360 || max < angle) {
343 return std::pair<SUMOReal, SUMOReal>(
min,
max);
354 : myReferenceEdge(edge) { }
358 myReferenceEdge->isTurningDirectionAt(e);
NBEdge * myEdge
the edge to compute the relative angle of
static SUMOReal normRelAngle(SUMOReal angle1, SUMOReal angle2)
ensure that reverse relAngles (>=179.999) always count as turnarounds (-180)
SUMOReal myAngle
the angle to find the edge with the opposite direction
const NBNode *const myNode
The related node.
const NBEdge *const myEdge
friend std::ostream & operator<<(std::ostream &os, const EdgeVector &ev)
The representation of a single edge during network building.
Class to sort edges by their angle in relation to the given edge.
opposite_finder(NBEdge *edge)
constructor
static void nextCW(const EdgeVector &edges, EdgeVector::const_iterator &from)
SUMOReal getDiff(const NBEdge *const e) const
Computes the angle difference between the related and the given edge.
static SUMOReal angleDiff(const SUMOReal angle1, const SUMOReal angle2)
Returns the difference of the second angle to the first angle in radiants.
relative_outgoing_edge_sorter(NBEdge *e)
constructor
NBNode * myDestinationNode
EdgeVector getConnectedEdges() const
Returns the list of outgoing edges unsorted.
edge_similar_direction_sorter(const NBEdge *const e)
constructor
edge_opposite_direction_sorter(const NBEdge *const e, const NBNode *const n)
Constructor.
const std::string & getID() const
Returns the id.
int operator()(NBEdge *e1, NBEdge *e2) const
comparing operation
int getPriority() const
Returns the priority of the edge.
static std::ostream & out(std::ostream &os, const std::vector< bool > &v)
int operator()(NBEdge *e1, NBEdge *e2) const
comparing operation
static SUMOReal maxSpeed(const EdgeVector &ev)
NBEdge * myEdge
the edge to compute the relative angle of
unsigned int getNumLanes() const
Returns the number of lanes.
bool isTurningDirectionAt(const NBEdge *const edge) const
Returns whether the given edge is the opposite direction to this edge.
int operator()(NBEdge *e1, NBEdge *e2) const
Comparing operation.
edge_by_angle_to_nodeShapeCentroid_sorter(const NBNode *n)
constructor
std::pair< SUMOReal, SUMOReal > getMinMaxRelAngles(NBEdge *e) const
int operator()(NBEdge *e1, NBEdge *e2) const
comparing operator
static SUMOReal getMaxSpeed(const EdgeVector &edges)
SUMOReal angleAt2D(int pos) const
same_connection_edge_sorter()
constructor
std::vector< NBEdge * > EdgeVector
const NBEdge *const myEdge
const PositionVector & getGeometry() const
Returns the geometry of the edge.
const NBNode * myNode
the edge to compute the relative angle of
static SUMOReal getMinAngleDiff(SUMOReal angle1, SUMOReal angle2)
Returns the minimum distance (clockwise/counter-clockwise) between both angles.
SUMOReal getTotalAngle() const
get the angle as measure from the start to the end of this edge
Represents a single node (junction) during network building.
SUMOReal getSpeed() const
Returns the speed allowed on this edge.
relative_incoming_edge_sorter(NBEdge *e)
constructor
bool operator()(NBEdge *e) const
static SUMOReal getMinSpeed(const EdgeVector &edges)
static void nextCCW(const EdgeVector &edges, EdgeVector::const_iterator &from)
int operator()(NBEdge *e1, NBEdge *e2) const
comparing operation
SUMOReal myAngle
The angle of the related edge at the given node.
static NBEdge * findConnectingEdge(const EdgeVector &edges, NBNode *from, NBNode *to)
SUMOReal getEdgeAngleAt(const NBEdge *const e, const NBNode *const n) const
Returns the given edge's angle at the given node.
NBNode * getFromNode() const
Returns the origin node of the edge.