51 EdgeVector::const_iterator& from);
56 EdgeVector::const_iterator& from);
63 static std::ostream&
out(std::ostream& os,
const std::vector<bool>& v);
220 myAngle(outgoing ? e->getShapeEndAngle() : e->getShapeStartAngle())
227 if (fabs(fabs(d1) - fabs(d2)) < NUMERICAL_EPS) {
228 if (fabs(d1 - d2) > NUMERICAL_EPS) {
234 return fabs(d1) < fabs(d2);
238 double angleDiff(
const double angle1,
const double angle2)
const {
239 double d = angle2 - angle1;
332 if (mm1.first == mm2.first && mm1.second == mm2.second) {
338 (mm1.first <= mm2.first && mm1.second <= mm2.second)
340 (mm1.first >= mm2.first && mm1.second >= mm2.second));
341 return (mm1.first >= mm2.first && mm1.second >= mm2.second);
351 for (EdgeVector::const_iterator i = ev.begin(); i != ev.end(); ++i) {
354 if (min == 360 || min > angle) {
357 if (max == 360 || max < angle) {
361 return std::pair<double, double>(min, max);
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
static double angleDiff(const double angle1, const double angle2)
Returns the difference of the second angle to the first angle in radiants.
bool operator()(const NBEdge *e1, const NBEdge *e2) const
comparing operation
const NBNode * myNode
the edge to compute the relative angle of
edge_by_angle_to_nodeShapeCentroid_sorter(const NBNode *n)
constructor
int operator()(NBEdge *e1, NBEdge *e2) const
comparing operator
Class to sort edges by their angle in relation to the given edge.
double getEdgeAngleAt(const NBEdge *const e, const NBNode *const n) const
Returns the given edge's angle at the given node.
bool myRegardPriority
Whether edge priority may override closer angles.
double getDiff(const NBEdge *const e) const
Computes the angle difference between the related and the given edge.
const NBNode *const myNode
The related node.
const NBEdge *const myEdge
the reference edge
double myAngle
The angle of the related edge at the given node.
edge_opposite_direction_sorter(const NBEdge *const e, const NBNode *const n, bool regardPriority)
Constructor.
int operator()(NBEdge *e1, NBEdge *e2) const
Comparing operation.
double angleDiff(const double angle1, const double angle2) const
bool myCompareOutgoing
the angle to find the edge with the opposite direction
int operator()(const NBEdge *e1, const NBEdge *e2) const
comparing operation
edge_similar_direction_sorter(const NBEdge *const e, bool outgoing=true)
constructor
edge_with_destination_finder & operator=(const edge_with_destination_finder &s)
invalidated assignment operator
NBNode * myDestinationNode
bool operator()(NBEdge *e) const
const NBEdge *const myEdge
bool operator()(const NBNode *const n) const
bool operator()(const NBNode *const n) const
const NBEdge *const myEdge
opposite_finder(NBEdge *edge)
constructor
bool operator()(NBEdge *e) const
relative_incoming_edge_sorter(NBEdge *e)
constructor
bool operator()(const NBEdge *e1, const NBEdge *e2) const
comparing operation
double myAngle
the reference angle to compare edges agains
relative_incoming_edge_sorter(double angle)
constructor
bool operator()(const NBEdge *e1, const NBEdge *e2) const
comparing operation
relative_outgoing_edge_sorter(double angle)
constructor
double myAngle
the reference angle to compare edges agains
relative_outgoing_edge_sorter(NBEdge *e)
constructor
int operator()(NBEdge *e1, NBEdge *e2) const
comparing operation
same_connection_edge_sorter()
constructor
std::pair< double, double > getMinMaxRelAngles(NBEdge *e) const
static NBEdge * findConnectingEdge(const EdgeVector &edges, NBNode *from, NBNode *to)
static double getMaxSpeed(const EdgeVector &edges)
static void nextCCW(const EdgeVector &edges, EdgeVector::const_iterator &from)
static void nextCW(const EdgeVector &edges, EdgeVector::const_iterator &from)
static double getMinSpeed(const EdgeVector &edges)
static double maxSpeed(const EdgeVector &ev)
static std::ostream & out(std::ostream &os, const std::vector< bool > &v)
friend std::ostream & operator<<(std::ostream &os, const EdgeVector &ev)
The representation of a single edge during network building.
double getShapeStartAngle() const
Returns the angle at the start of the edge.
const PositionVector & getGeometry() const
Returns the geometry of the edge.
int getNumericalID() const
Returns the index (numeric id) of the edge.
double getSpeed() const
Returns the speed allowed on this edge.
const std::string & getID() const
bool isTurningDirectionAt(const NBEdge *const edge) const
Returns whether the given edge is the opposite direction to this edge.
int getNumLanes() const
Returns the number of lanes.
EdgeVector getConnectedEdges() const
Returns the list of outgoing edges unsorted.
NBNode * getFromNode() const
Returns the origin node of the edge.
double getTotalAngle() const
Returns the angle at the start of the edge.
int getPriority() const
Returns the priority of the edge.
double getShapeEndAngle() const
Returns the angle at the end of the edge.
static double normRelAngle(double angle1, double angle2)
ensure that reverse relAngles (>=179.999) always count as turnarounds (-180)
Represents a single node (junction) during network building.
double angleAt2D(int pos) const
get angle in certain position of position vector (in radians between -M_PI and M_PI)