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);
219 :
myAngle(e->getTotalAngle()) {}
317 if (mm1.first == mm2.first && mm1.second == mm2.second) {
323 (mm1.first <= mm2.first && mm1.second <= mm2.second)
325 (mm1.first >= mm2.first && mm1.second >= mm2.second));
326 return (mm1.first >= mm2.first && mm1.second >= mm2.second);
336 for (EdgeVector::const_iterator i = ev.begin(); i != ev.end(); ++i) {
339 if (min == 360 || min > angle) {
342 if (max == 360 || max < angle) {
346 return std::pair<SUMOReal, SUMOReal>(
min,
max);
SUMOReal atan2DegreeAngle() const
node_with_outgoing_finder(const NBEdge *const e)
constructor
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.
edge_by_angle_to_nodeShapeCentroid_sorter(NBNode *n)
constructor
bool operator()(const NBNode *const n) const
node_with_outgoing_finder & operator=(const node_with_outgoing_finder &s)
invalidated assignment operator
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.
int operator()(const NBEdge *e1, const NBEdge *e2) const
comparing operation
bool isTurningDirectionAt(const NBNode *n, const NBEdge *const edge) const
Returns whether the given edge is the opposite direction to this edge.
relative_outgoing_edge_sorter(NBEdge *e)
constructor
opposite_finder(NBEdge *edge, const NBNode *n)
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)
bool operator()(const NBNode *const n) const
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.
int operator()(NBEdge *e1, NBEdge *e2) const
Comparing operation.
edge_with_destination_finder & operator=(const edge_with_destination_finder &s)
invalidated assignment operator
edge_with_destination_finder(NBNode *dest)
constructor
std::pair< SUMOReal, SUMOReal > getMinMaxRelAngles(NBEdge *e) const
int operator()(NBEdge *e1, NBEdge *e2) const
comparing operator
static SUMOReal getMaxSpeed(const EdgeVector &edges)
NBNode * myNode
the edge to compute the relative angle of
edge_opposite_direction_sorter & operator=(const edge_opposite_direction_sorter &s)
Invalidated assignment operator.
same_connection_edge_sorter()
constructor
std::vector< NBEdge * > EdgeVector
const NBEdge *const myEdge
const PositionVector & getGeometry() const
Returns the geometry of the edge.
static SUMOReal getMinAngleDiff(SUMOReal angle1, SUMOReal angle2)
Returns the minimum distance (clockwise/counter-clockwise) between both angles.
bool operator()(NBEdge *e) const
node_with_incoming_finder & operator=(const node_with_incoming_finder &s)
invalidated assignment operator
int operator()(NBEdge *e1, NBEdge *e2) const
comparing operation
node_with_incoming_finder(const NBEdge *const e)
constructor
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.