SUMO - Simulation of Urban MObility

NBNodeShapeComputer Class Reference

This class computes shapes of junctions. More...

#include <NBNodeShapeComputer.h>

Public Member Functions

PositionVector compute (bool leftHand)
 Computes the shape of the assigned junction.
 NBNodeShapeComputer (const NBNode &node)
 Constructor.
 ~NBNodeShapeComputer ()
 Destructor.

Private Member Functions

PositionVector computeContinuationNodeShape (bool simpleContinuation)
PositionVector computeNodeShapeByCrosses ()
 Computes the node geometry using normals.
EdgeVector computeUniqueDirectionList (const std::map< NBEdge *, EdgeVector > &same, std::map< NBEdge *, PositionVector > &geomsCCW, std::map< NBEdge *, PositionVector > &geomsCW, std::map< NBEdge *, NBEdge * > &ccwBoundary, std::map< NBEdge *, NBEdge * > &cwBoundary)
 Joins edges and computes ccw/cw boundaries.
void joinSameDirectionEdges (std::map< NBEdge *, EdgeVector > &same, std::map< NBEdge *, PositionVector > &geomsCCW, std::map< NBEdge *, PositionVector > &geomsCW)
 Joins edges and computes ccw/cw boundaries.
void replaceFirstChecking (PositionVector &g, bool decenter, PositionVector counter, size_t counterLanes, SUMOReal counterDist, int laneDiff)
void replaceLastChecking (PositionVector &g, bool decenter, PositionVector counter, size_t counterLanes, SUMOReal counterDist, int laneDiff)

Private Attributes

const NBNode & myNode
 The node to compute the geometry for.

Detailed Description

This class computes shapes of junctions.

Definition at line 52 of file NBNodeShapeComputer.h.


Constructor & Destructor Documentation

NBNodeShapeComputer::NBNodeShapeComputer ( const NBNode &  node)

Constructor.

Definition at line 52 of file NBNodeShapeComputer.cpp.

NBNodeShapeComputer::~NBNodeShapeComputer ( )

Destructor.

Definition at line 56 of file NBNodeShapeComputer.cpp.


Member Function Documentation

PositionVector NBNodeShapeComputer::computeNodeShapeByCrosses ( ) [private]

Computes the node geometry using normals.

In the case the other method does not work, this method computes the geometry of a node by adding points to the polygon which are computed by building the normals of participating edges' geometry boundaries (cw/ccw) at the node's height (the length of the edge the edge would cross the node point).

Definition at line 710 of file NBNodeShapeComputer.cpp.

References Line::add(), Line::extrapolateBy(), NBNode::getPosition(), Line::intersects(), Line::intersectsAt(), NBNode::myAllEdges, myNode, Line::p1(), PI, PositionVector::push_back_noDoublePos(), Line::rotateAtP1(), and SUMO_const_halfLaneWidth.

Referenced by compute().

EdgeVector NBNodeShapeComputer::computeUniqueDirectionList ( const std::map< NBEdge *, EdgeVector > &  same,
std::map< NBEdge *, PositionVector > &  geomsCCW,
std::map< NBEdge *, PositionVector > &  geomsCW,
std::map< NBEdge *, NBEdge * > &  ccwBoundary,
std::map< NBEdge *, NBEdge * > &  cwBoundary 
) [private]

Joins edges and computes ccw/cw boundaries.

This methods joins edges which are in marked as being "same" in the means as given by joinSameDirectionEdges. The result (list of so-to-say "directions" is returned; additionally, the boundaries of these directions are stored in ccwBoundary/cwBoundary.

Definition at line 662 of file NBNodeShapeComputer.cpp.

References computeSameEnd(), NBNode::hasIncoming(), NBNode::myAllEdges, and myNode.

Referenced by computeContinuationNodeShape().

void NBNodeShapeComputer::joinSameDirectionEdges ( std::map< NBEdge *, EdgeVector > &  same,
std::map< NBEdge *, PositionVector > &  geomsCCW,
std::map< NBEdge *, PositionVector > &  geomsCW 
) [private]

Joins edges and computes ccw/cw boundaries.

This method goes through all edges and stores each edge's ccw and cw boundary in geomsCCW/geomsCW. This boundary is extrapolated by 100m at the node's position. In addition, "same" is filled so that this map contains a list of all edges within the value-vector which direction at the node differs less than 1 from the key-edge's direction.

Definition at line 607 of file NBNodeShapeComputer.cpp.

References Line::atan2DegreeAngle(), Line::extrapolateBy(), NBNode::hasIncoming(), PositionVector::lineAt(), NBNode::myAllEdges, myNode, Line::p1(), and SUMO_const_halfLaneWidth.

Referenced by computeContinuationNodeShape().


Field Documentation


The documentation for this class was generated from the following files:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines