21 #ifndef NBAlgorithms_h
22 #define NBAlgorithms_h
132 for (EdgeVector::const_iterator it = e.begin(); it != e.end(); ++it) {
134 result =
MIN2(result, rank);
154 const std::vector<NBEdge*>::iterator& i1,
155 const std::vector<NBEdge*>::iterator& i2);
173 angle = 360. + angle;
182 if (angle < 0.1 || angle > 359.9) {
int operator()(NBEdge *e1, NBEdge *e2) const
Sorts incoming and outgoing edges clockwise around the given node.
Sorts crossings by minimum clockwise clockwise edge angle. Use the ordering found in myAllEdges of th...
int operator()(const Combination &c1, const Combination &c2) const
The representation of a single edge during network building.
static void swapWhenReversed(const NBNode *const n, const std::vector< NBEdge * >::iterator &i1, const std::vector< NBEdge * >::iterator &i2)
Assures correct order for same-angle opposite-direction edges.
combination_by_angle_sorter()
SUMOReal getConvAngle(NBEdge *e) const
Converts the angle of the edge if it is an incoming edge.
static void sortNodesEdges(NBNodeCont &nc, bool useNodeShape=false)
Sorts a node's edges clockwise regarding driving direction.
Stores the information about the angle between an incoming ("from") and an outgoing ("to") edge...
const std::string & getID() const
Returns the id.
crossing_by_junction_angle_sorter & operator=(const crossing_by_junction_angle_sorter &s)
invalidated assignment operator
static void computeEdgePriorities(NBNodeCont &nc)
Computes edge priorities within a node.
static NBEdge * extractAndMarkFirst(NBNode &n, std::vector< NBEdge * > &s, int prio=1)
Sets the priorites in case of a priority junction.
crossing_by_junction_angle_sorter(const NBNode *node, const EdgeVector &ordering)
int operator()(const NBNode::Crossing &c1, const NBNode::Crossing &c2) const
static void computeTurnDirectionsForNode(NBNode *node, bool warn)
Computes turnaround destinations for all incoming edges of the given nodes (if any) ...
int getMinRank(const EdgeVector &e) const
retrieves the minimum index in myAllEdges
static bool samePriority(const NBEdge *const e1, const NBEdge *const e2)
Returns whether both edges have the same priority.
NBNode * myNode
The node to compute the relative angle of.
static void computeNodeTypes(NBNodeCont &nc)
Computes node types.
std::vector< NBEdge * > EdgeVector
EdgeVector edges
The edges being crossed.
Represents a single node (junction) during network building.
static void computeTurnDirections(NBNodeCont &nc, bool warn=true)
Computes turnaround destinations for all edges (if exist)
A definition of a pedestrian crossing.
Sorts "Combination"s by decreasing angle.
static void setPriorityJunctionPriorities(NBNode &n)
Sets the priorites in case of a priority junction.
Container for nodes during the netbuilding process.
edge_by_junction_angle_sorter(NBNode *n)
A storage for available types of edges.
SUMOReal getAngleAtNode(const NBNode *const node) const
Returns the angle of the edge's geometry at the given node.
NBNode * getFromNode() const
Returns the origin node of the edge.