39 #ifdef CHECK_MEMORY_LEAKS 41 #endif // CHECK_MEMORY_LEAKS 53 if (from == edges.end()) {
61 if (from == edges.begin()) {
62 from = edges.end() - 1;
71 for (std::vector<bool>::const_iterator i = v.begin(); i != v.end(); i++) {
81 for (EdgeVector::const_iterator i = edges.begin(); i != edges.end(); i++) {
82 if ((*i)->getToNode() == to && (*i)->getFromNode() == from) {
93 assert(ev.size() > 0);
95 for (EdgeVector::const_iterator i = ev.begin() + 1; i != ev.end(); i++) {
97 max > (*i)->getSpeed()
98 ? max : (*i)->getSpeed();
115 return std::find(incoming.begin(), incoming.end(),
myEdge) != incoming.end();
130 return std::find(outgoing.begin(), outgoing.end(),
myEdge) != outgoing.end();
139 : myDestinationNode(dest) {}
152 if (e1 == 0 || e2 == 0) {
161 while (fabs(relAngle1 - relAngle2) < 3.0) {
174 return relAngle1 > relAngle2;
183 if (e1 == 0 || e2 == 0) {
190 const int geomIndex = myRefIncoming ? 0 : -1;
197 while (fabs(relAngle1 - relAngle2) < 3.0) {
199 const SUMOReal offset1 = myRefIncoming ? lookAhead : e1Length - lookAhead;
200 const SUMOReal offset2 = myRefIncoming ? lookAhead : e2Length - lookAhead;
205 e1->
getGeometry()[geomIndex].angleTo2D(referencePos1),
true));
207 e2->
getGeometry()[geomIndex].angleTo2D(referencePos2),
true));
209 if (lookAhead > maxLookAhead) {
214 if (fabs(relAngle1 - relAngle2) < 3.0) {
217 myReferencePos.angleTo2D(e1->
getLaneShape(0)[geomIndex]),
true));
219 myReferencePos.angleTo2D(e2->
getLaneShape(0)[geomIndex]),
true));
225 return fabs(relAngle1) < fabs(relAngle2);
234 if (e1 == 0 || e2 == 0) {
243 while (fabs(relAngle1 - relAngle2) < 3.0) {
256 return relAngle1 > relAngle2;
262 for (EdgeVector::const_iterator i = ev.begin(); i != ev.end(); i++) {
263 if (i != ev.begin()) {
276 if (edges.size() == 0) {
279 SUMOReal ret = (*(edges.begin()))->getSpeed();
280 for (EdgeVector::const_iterator i = edges.begin() + 1; i != edges.end(); i++) {
281 if ((*i)->getSpeed() > ret) {
282 ret = (*i)->getSpeed();
291 if (edges.size() == 0) {
294 SUMOReal ret = (*(edges.begin()))->getSpeed();
295 for (EdgeVector::const_iterator i = edges.begin() + 1; i != edges.end(); i++) {
296 if ((*i)->getSpeed() < ret) {
297 ret = (*i)->getSpeed();
310 const SUMOReal absDiff = fabs(angle1 - angle2);
313 if (absDiff < 2 || absDiff > (360 - 2)) {
321 if (e1Peds && !e2Peds) {
323 }
else if (!e1Peds && e2Peds) {
327 if (!e1Peds && e2Peds) {
329 }
else if (e1Peds && !e2Peds) {
340 return angle1 < angle2;
bool operator()(const NBNode *const n) const
SUMOReal getEndAngle() const
Returns the angle at the end of the edge (relative to the node shape center) The angle is computed in...
SUMOReal getStartAngle() const
Returns the angle at the start of the edge (relative to the node shape center) The angle is computed ...
node_with_outgoing_finder(const NBEdge *const e)
constructor
SUMOReal angleTo2D(const Position &other) const
returns the angle in the plane of the vector pointing from here to the other position ...
SUMOReal getShapeStartAngle() const
Returns the angle at the start of the edge.
SUMOReal length() const
Returns the length.
static SUMOReal normRelAngle(SUMOReal angle1, SUMOReal angle2)
ensure that reverse relAngles (>=179.999) always count as turnarounds (-180)
const NBEdge *const myEdge
friend std::ostream & operator<<(std::ostream &os, const EdgeVector &ev)
The representation of a single edge during network building.
int operator()(const NBEdge *e1, const NBEdge *e2) const
comparing operation
int operator()(NBEdge *e1, NBEdge *e2) const
comparing operation
static void nextCW(const EdgeVector &edges, EdgeVector::const_iterator &from)
const std::string & getID() const
Returns the id.
NBNode * myDestinationNode
const EdgeVector & getOutgoingEdges() const
Returns this node's outgoing edges.
static std::ostream & out(std::ostream &os, const std::vector< bool > &v)
static SUMOReal legacyDegree(const SUMOReal angle, const bool positive=false)
SUMOReal getShapeEndAngle() const
Returns the angle at the end of the edge.
A point in 2D or 3D with translation and scaling methods.
SUMOReal getAngleAtNodeToCenter(const NBNode *const node) const
Returns the angle of from the node shape center to where the edge meets the node shape.
static SUMOReal maxSpeed(const EdgeVector &ev)
bool operator()(const NBNode *const n) const
SUMOReal length2D() const
Returns the length.
int operator()(NBEdge *e1, NBEdge *e2) const
comparing operation
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
edge_with_destination_finder(NBNode *dest)
constructor
const PositionVector & getGeometry() const
Returns the geometry of the edge.
static SUMOReal getMaxSpeed(const EdgeVector &edges)
int operator()(NBEdge *e1, NBEdge *e2) const
comparing operation
const PositionVector & getLaneShape(int i) const
Returns the shape of the nth lane.
const EdgeVector & getIncomingEdges() const
Returns this node's incoming edges.
std::vector< NBEdge * > EdgeVector
const NBEdge *const myEdge
node_with_incoming_finder(const NBEdge *const e)
constructor
const Position & getPosition() const
Returns the position of this node.
bool operator()(NBEdge *e) const
Represents a single node (junction) during network building.
Position positionAtOffset2D(SUMOReal pos, SUMOReal lateralOffset=0) const
Returns the position at the given length.
NBNode * getFromNode() const
Returns the origin node of the edge.
static SUMOReal getMinSpeed(const EdgeVector &edges)
NBNode * getToNode() const
Returns the destination node of the edge.
static void nextCCW(const EdgeVector &edges, EdgeVector::const_iterator &from)
SUMOReal getLength() const
Returns the computed length of the edge.
static const SUMOReal ANGLE_LOOKAHEAD
the distance at which to take the default angle
static NBEdge * findConnectingEdge(const EdgeVector &edges, NBNode *from, NBNode *to)