18 #ifndef NBAlgorithms_h 19 #define NBAlgorithms_h 107 static void sortNodesEdges(
NBNodeCont& nc,
bool useNodeShape =
false);
118 const int r1 = getMinRank(c1->
edges);
119 const int r2 = getMinRank(c2->
edges);
123 return (
int)(r1 < r2);
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);
216 static bool isRailwayNode(
const NBNode* n);
232 static void computeEdgePriorities(
NBNodeCont& nc);
238 static void setPriorityJunctionPriorities(
NBNode& n);
249 static NBEdge* extractAndMarkFirst(
NBNode& n, std::vector<NBEdge*>& s,
int prio = 1);
256 static bool samePriority(
const NBEdge*
const e1,
const NBEdge*
const e2);
259 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...
A container for traffic light definitions and built programs.
int operator()(const NBNode::Crossing *c1, const NBNode::Crossing *c2) const
The representation of a single edge during network building.
combination_by_angle_sorter()
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
const std::string & getID() 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)