21 #ifndef NBAlgorithms_h 22 #define NBAlgorithms_h 114 static void sortNodesEdges(
NBNodeCont& nc,
bool useNodeShape =
false);
125 return (
int)(getMinRank(c1.
edges) < getMinRank(c2.
edges));
131 size_t result = myOrdering.size();
132 for (EdgeVector::const_iterator it = e.begin(); it != e.end(); ++it) {
133 size_t rank = std::distance(myOrdering.begin(), std::find(myOrdering.begin(), myOrdering.end(), *it));
134 result =
MIN2(result, rank);
153 static void swapWhenReversed(
const NBNode*
const n,
154 const std::vector<NBEdge*>::iterator& i1,
155 const std::vector<NBEdge*>::iterator& i2);
165 return getConvAngle(e1) < getConvAngle(e2);
173 angle = 360. +
angle;
182 if (angle < 0.1 || angle > 359.9) {
227 static void computeEdgePriorities(
NBNodeCont& nc);
233 static void setPriorityJunctionPriorities(
NBNode& n);
241 static NBEdge* extractAndMarkFirst(
NBNode& n, std::vector<NBEdge*>& s,
int prio = 1);
248 static bool samePriority(
const NBEdge*
const e1,
const NBEdge*
const e2);
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.
combination_by_angle_sorter()
SUMOReal getConvAngle(NBEdge *e) const
Converts the angle of the edge if it is an incoming edge.
Stores the information about the angle between an incoming ("from") and an outgoing ("to") edge...
const std::string & getID() const
Returns the id.
size_t getMinRank(const EdgeVector &e) const
retrieves the minimum index in myAllEdges
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) ...
NBNode * myNode
The node to compute the relative angle of.
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.
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.