48 if (from == edges.end()) {
56 if (from == edges.begin()) {
57 from = edges.end() - 1;
66 for (std::vector<bool>::const_iterator i = v.begin(); i != v.end(); i++) {
76 for (EdgeVector::const_iterator i = edges.begin(); i != edges.end(); i++) {
77 if ((*i)->getToNode() == to && (*i)->getFromNode() == from) {
88 assert(ev.size() > 0);
89 double max = (*(ev.begin()))->getSpeed();
90 for (EdgeVector::const_iterator i = ev.begin() + 1; i != ev.end(); i++) {
92 max > (*i)->getSpeed()
93 ? max : (*i)->getSpeed();
110 return std::find(incoming.begin(), incoming.end(),
myEdge) != incoming.end();
125 return std::find(outgoing.begin(), outgoing.end(),
myEdge) != outgoing.end();
134 : myDestinationNode(dest) {}
147 if (e1 == 0 || e2 == 0) {
156 while (fabs(relAngle1 - relAngle2) < 3.0) {
169 return relAngle1 > relAngle2;
178 if (e1 == 0 || e2 == 0) {
185 const int geomIndex = myRefIncoming ? 0 : -1;
190 const double maxLookAhead =
MAX2(e1Length, e2Length);
192 while (fabs(relAngle1 - relAngle2) < 3.0) {
194 const double offset1 = myRefIncoming ? lookAhead : e1Length - lookAhead;
195 const double offset2 = myRefIncoming ? lookAhead : e2Length - lookAhead;
200 e1->
getGeometry()[geomIndex].angleTo2D(referencePos1),
true));
202 e2->
getGeometry()[geomIndex].angleTo2D(referencePos2),
true));
204 if (lookAhead > maxLookAhead) {
209 if (fabs(relAngle1 - relAngle2) < 3.0) {
212 myReferencePos.angleTo2D(e1->
getLaneShape(0)[geomIndex]),
true));
214 myReferencePos.angleTo2D(e2->
getLaneShape(0)[geomIndex]),
true));
220 return fabs(relAngle1) < fabs(relAngle2);
229 if (e1 == 0 || e2 == 0) {
238 while (fabs(relAngle1 - relAngle2) < 3.0) {
251 return relAngle1 > relAngle2;
257 for (EdgeVector::const_iterator i = ev.begin(); i != ev.end(); i++) {
258 if (i != ev.begin()) {
271 if (edges.size() == 0) {
274 double ret = (*(edges.begin()))->getSpeed();
275 for (EdgeVector::const_iterator i = edges.begin() + 1; i != edges.end(); i++) {
276 if ((*i)->getSpeed() > ret) {
277 ret = (*i)->getSpeed();
286 if (edges.size() == 0) {
289 double ret = (*(edges.begin()))->getSpeed();
290 for (EdgeVector::const_iterator i = edges.begin() + 1; i != edges.end(); i++) {
291 if ((*i)->getSpeed() < ret) {
292 ret = (*i)->getSpeed();
305 const double absDiff = fabs(angle1 - angle2);
308 if (absDiff < 2 || absDiff > (360 - 2)) {
316 if (e1Peds && !e2Peds) {
318 }
else if (!e1Peds && e2Peds) {
322 if (!e1Peds && e2Peds) {
324 }
else if (e1Peds && !e2Peds) {
335 return angle1 < angle2;
double getStartAngle() const
Returns the angle at the start of the edge (relative to the node shape center) The angle is computed ...
const EdgeVector & getIncomingEdges() const
Returns this node's incoming edges (The edges which yield in this node)
node_with_outgoing_finder(const NBEdge *const e)
constructor
static double maxSpeed(const EdgeVector &ev)
double getAngleAtNodeToCenter(const NBNode *const node) const
Returns the angle of from the node shape center to where the edge meets the node shape.
static double getMinSpeed(const EdgeVector &edges)
double getEndAngle() const
Returns the angle at the end of the edge (relative to the node shape center) The angle is computed in...
static double normRelAngle(double angle1, double angle2)
ensure that reverse relAngles (>=179.999) always count as turnarounds (-180)
static const double ANGLE_LOOKAHEAD
the distance at which to take the default angle
const NBEdge *const myEdge
friend std::ostream & operator<<(std::ostream &os, const EdgeVector &ev)
The representation of a single edge during network building.
bool operator()(const NBNode *const n) const
static void nextCW(const EdgeVector &edges, EdgeVector::const_iterator &from)
int operator()(const NBEdge *e1, const NBEdge *e2) const
comparing operation
static double legacyDegree(const double angle, const bool positive=false)
NBNode * myDestinationNode
int operator()(NBEdge *e1, NBEdge *e2) const
comparing operation
const EdgeVector & getOutgoingEdges() const
Returns this node's outgoing edges (The edges which start at this node)
const std::string & getID() const
Returns the id.
double getShapeEndAngle() const
Returns the angle at the end of the edge.
const Position & getPosition() const
static std::ostream & out(std::ostream &os, const std::vector< bool > &v)
bool operator()(const NBNode *const n) const
A point in 2D or 3D with translation and scaling methods.
double length() const
Returns the length.
Position positionAtOffset2D(double pos, double lateralOffset=0) const
Returns the position at the given length.
edge_with_destination_finder(NBNode *dest)
constructor
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
NBNode * getToNode() const
Returns the destination node of the edge.
double getLength() const
Returns the computed length of the edge.
double length2D() const
Returns the length.
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
const NBEdge *const myEdge
const PositionVector & getGeometry() const
Returns the geometry of the edge.
bool operator()(NBEdge *e) const
int operator()(NBEdge *e1, NBEdge *e2) const
comparing operation
node_with_incoming_finder(const NBEdge *const e)
constructor
Represents a single node (junction) during network building.
double getShapeStartAngle() const
Returns the angle at the start of the edge.
static double getMaxSpeed(const EdgeVector &edges)
const PositionVector & getLaneShape(int i) const
Returns the shape of the nth lane.
static void nextCCW(const EdgeVector &edges, EdgeVector::const_iterator &from)
int operator()(NBEdge *e1, NBEdge *e2) const
comparing operation
double angleTo2D(const Position &other) const
returns the angle in the plane of the vector pointing from here to the other position ...
static NBEdge * findConnectingEdge(const EdgeVector &edges, NBNode *from, NBNode *to)
NBNode * getFromNode() const
Returns the origin node of the edge.