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);
108 myReferencePos(e->getLaneShape(0).back()),
109 myReferenceAngle(e->getShapeEndAngle()) {
179 myAngle = getEdgeAngleAt(e, n);
188 return getDiff(e1) > getDiff(e2);
239 : myAngle(e->getTotalAngle()) {}
335 std::pair<SUMOReal, SUMOReal> mm1 = getMinMaxRelAngles(e1);
336 std::pair<SUMOReal, SUMOReal> mm2 = getMinMaxRelAngles(e2);
337 if (mm1.first == mm2.first && mm1.second == mm2.second) {
343 (mm1.first <= mm2.first && mm1.second <= mm2.second)
345 (mm1.first >= mm2.first && mm1.second >= mm2.second));
346 return (mm1.first >= mm2.first && mm1.second >= mm2.second);
356 for (EdgeVector::const_iterator i = ev.begin(); i != ev.end(); ++i) {
359 if (min == 360 || min > angle) {
362 if (max == 360 || max < angle) {
366 return std::pair<SUMOReal, SUMOReal>(
min,
max);
377 : myReferenceEdge(edge) { }
381 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
straightness_sorter(NBEdge *e)
constructor
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
A point in 2D or 3D with translation and scaling methods.
SUMOReal myReferenceAngle
static SUMOReal maxSpeed(const EdgeVector &ev)
NBEdge * myEdge
the edge to compute the relative angle of
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
get angle in certain position of position vector
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.