20 #ifndef NBAlgorithms_h 21 #define NBAlgorithms_h 113 static void sortNodesEdges(
NBNodeCont& nc,
bool useNodeShape =
false);
124 return (
int)(getMinRank(c1->
edges) < getMinRank(c2->
edges));
130 int result = (int)myOrdering.size();
131 for (EdgeVector::const_iterator it = e.begin(); it != e.end(); ++it) {
132 int rank = (int)std::distance(myOrdering.begin(), std::find(myOrdering.begin(), myOrdering.end(), *it));
133 result =
MIN2(result, rank);
151 static void swapWhenReversed(
const NBNode*
const n,
152 const std::vector<NBEdge*>::iterator& i1,
153 const std::vector<NBEdge*>::iterator& i2);
163 return getConvAngle(e1) < getConvAngle(e2);
171 angle = 360. +
angle;
175 angle += (double) 180.;
176 if (angle >= (
double) 360.) {
177 angle -= (double) 360.;
180 if (angle < 0.1 || angle > 359.9) {
183 assert(angle >= 0 && angle < (
double)360);
213 static void computeSingleNodeType(
NBNode* node);
229 static void computeEdgePriorities(
NBNodeCont& nc);
234 static void computeEdgePrioritiesSingleNode(
NBNode* node);
240 static void setPriorityJunctionPriorities(
NBNode& n);
248 static NBEdge* extractAndMarkFirst(
NBNode& n, std::vector<NBEdge*>& s,
int prio = 1);
255 static bool samePriority(
const NBEdge*
const e1,
const NBEdge*
const e2);
258 static bool hasDifferentPriorities(
const EdgeVector& edges,
const NBEdge* excluded);
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 NBNode::Crossing *c1, const NBNode::Crossing *c2) const
The representation of a single edge during network building.
combination_by_angle_sorter()
const std::string & getID() const
Returns the id.
Stores the information about the angle between an incoming ("from") and an outgoing ("to") edge...
int operator()(NBEdge *e1, NBEdge *e2) const
int operator()(const Combination &c1, const Combination &c2) const
double getAngleAtNode(const NBNode *const node) const
Returns the angle of the edge's geometry at the given node.
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
container for (sorted) edges
double getConvAngle(NBEdge *e) const
Converts the angle of the edge if it is an incoming edge.
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.
NBNode * getFromNode() const
Returns the origin node of the edge.
Container for nodes during the netbuilding process.
int getMinRank(const EdgeVector &e) const
retrieves the minimum index in myAllEdges
edge_by_junction_angle_sorter(NBNode *n)