 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
19 #ifndef NBContHelper_h
20 #define NBContHelper_h
54 EdgeVector::const_iterator& from);
59 EdgeVector::const_iterator& from);
66 static std::ostream&
out(std::ostream& os,
const std::vector<bool>& v);
222 :
myAngle(e->getShapeEndAngle()) {}
235 return fabs(d1) < fabs(d2);
239 double angleDiff(
const double angle1,
const double angle2)
const {
240 double d = angle2 - angle1;
340 if (mm1.first == mm2.first && mm1.second == mm2.second) {
346 (mm1.first <= mm2.first && mm1.second <= mm2.second)
348 (mm1.first >= mm2.first && mm1.second >= mm2.second));
349 return (mm1.first >= mm2.first && mm1.second >= mm2.second);
359 for (EdgeVector::const_iterator i = ev.begin(); i != ev.end(); ++i) {
362 if (min == 360 || min > angle) {
365 if (max == 360 || max < angle) {
369 return std::pair<double, double>(min, max);
int operator()(NBEdge *e1, NBEdge *e2) const
Comparing operation.
node_with_incoming_finder & operator=(const node_with_incoming_finder &s)
invalidated assignment operator
edge_opposite_direction_sorter(const NBEdge *const e, const NBNode *const n, bool regardPriority)
Constructor.
edge_by_angle_to_nodeShapeCentroid_sorter(const NBNode *n)
constructor
static double angleDiff(const double angle1, const double angle2)
Returns the difference of the second angle to the first angle in radiants.
int getNumericalID() const
Returns the index (numeric id) of the edge.
bool operator()(const NBNode *const n) const
relative_incoming_edge_sorter(NBEdge *e)
constructor
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
bool isTurningDirectionAt(const NBEdge *const edge) const
Returns whether the given edge is the opposite direction to this edge.
static double normRelAngle(double angle1, double angle2)
ensure that reverse relAngles (>=179.999) always count as turnarounds (-180)
same_connection_edge_sorter()
constructor
int getPriority() const
Returns the priority of the edge.
bool operator()(NBEdge *e) const
NBEdge * myEdge
the edge to compute the relative angle of
double getShapeStartAngle() const
Returns the angle at the start of the edge.
const NBNode *const myNode
The related node.
bool operator()(const NBNode *const n) const
int operator()(NBEdge *e1, NBEdge *e2) const
comparing operation
double angleAt2D(int pos) const
get angle in certain position of position vector
The representation of a single edge during network building.
static NBEdge * findConnectingEdge(const EdgeVector &edges, NBNode *from, NBNode *to)
double getDiff(const NBEdge *const e) const
Computes the angle difference between the related and the given edge.
NBEdge * myEdge
the edge to compute the relative angle of
static double getMaxSpeed(const EdgeVector &edges)
const PositionVector & getGeometry() const
Returns the geometry of the edge.
static double getMinSpeed(const EdgeVector &edges)
node_with_outgoing_finder & operator=(const node_with_outgoing_finder &s)
invalidated assignment operator
bool operator()(NBEdge *e) const
edge_opposite_direction_sorter & operator=(const edge_opposite_direction_sorter &s)
Invalidated assignment operator.
const NBNode * myNode
the edge to compute the relative angle of
int getNumLanes() const
Returns the number of lanes.
static void nextCCW(const EdgeVector &edges, EdgeVector::const_iterator &from)
double myAngle
the angle to find the edge with the opposite direction
const NBEdge *const myEdge
static double maxSpeed(const EdgeVector &ev)
int operator()(NBEdge *e1, NBEdge *e2) const
comparing operation
opposite_finder(NBEdge *edge)
constructor
int operator()(const NBEdge *e1, const NBEdge *e2) const
comparing operation
std::pair< double, double > getMinMaxRelAngles(NBEdge *e) const
node_with_outgoing_finder(const NBEdge *const e)
constructor
node_with_incoming_finder(const NBEdge *const e)
constructor
const NBEdge *const myEdge
the reference edge
double getSpeed() const
Returns the speed allowed on this edge.
edge_with_destination_finder(NBNode *dest)
constructor
edge_similar_direction_sorter(const NBEdge *const e)
constructor
int operator()(const NBEdge *e1, const NBEdge *e2) const
comparing operation
friend std::ostream & operator<<(std::ostream &os, const EdgeVector &ev)
bool myRegardPriority
Whether edge priority may override closer angles.
Class to sort edges by their angle in relation to the given edge.
static void nextCW(const EdgeVector &edges, EdgeVector::const_iterator &from)
EdgeVector getConnectedEdges() const
Returns the list of outgoing edges unsorted.
NBNode * myDestinationNode
const NBEdge *const myEdge
Represents a single node (junction) during network building.
static std::ostream & out(std::ostream &os, const std::vector< bool > &v)
NBNode * getFromNode() const
Returns the origin node of the edge.
double getTotalAngle() const
Returns the angle at the start of the edge.
int operator()(NBEdge *e1, NBEdge *e2) const
comparing operator
relative_outgoing_edge_sorter(NBEdge *e)
constructor
double getEdgeAngleAt(const NBEdge *const e, const NBNode *const n) const
Returns the given edge's angle at the given node.
double myAngle
The angle of the related edge at the given node.
edge_with_destination_finder & operator=(const edge_with_destination_finder &s)
invalidated assignment operator
int operator()(NBEdge *e1, NBEdge *e2) const
comparing operation
double angleDiff(const double angle1, const double angle2) const
const std::string & getID() const