|
SUMO - Simulation of Urban MObility
|
This class computes shapes of junctions. More...
#include <NBNodeShapeComputer.h>
Public Member Functions | |
| PositionVector | compute (bool leftHand) |
| Computes the shape of the assigned junction. More... | |
| NBNodeShapeComputer (const NBNode &node) | |
| Constructor. More... | |
| ~NBNodeShapeComputer () | |
| Destructor. More... | |
Private Member Functions | |
| PositionVector | computeNodeShapeDefault (bool simpleContinuation) |
| Computes the node geometry Edges with the same direction are grouped. Then the node geometry is built from intersection between the borders of adjacent edge groups. More... | |
| PositionVector | computeNodeShapeSmall () |
| Computes the node geometry using normals. More... | |
| 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. More... | |
| void | joinSameDirectionEdges (std::map< NBEdge *, EdgeVector > &same, std::map< NBEdge *, PositionVector > &geomsCCW, std::map< NBEdge *, PositionVector > &geomsCW) |
| Joins edges and computes ccw/cw boundaries. More... | |
| NBNodeShapeComputer & | operator= (const NBNodeShapeComputer &s) |
| Invalidated assignment operator. More... | |
| 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. More... | |
This class computes shapes of junctions.
Definition at line 52 of file NBNodeShapeComputer.h.
| NBNodeShapeComputer::NBNodeShapeComputer | ( | const NBNode & | node | ) |
Constructor.
Definition at line 53 of file NBNodeShapeComputer.cpp.
| NBNodeShapeComputer::~NBNodeShapeComputer | ( | ) |
Destructor.
Definition at line 57 of file NBNodeShapeComputer.cpp.
| PositionVector NBNodeShapeComputer::compute | ( | bool | leftHand | ) |
Computes the shape of the assigned junction.
Definition at line 61 of file NBNodeShapeComputer.cpp.
References computeNodeShapeDefault(), computeNodeShapeSmall(), NBNode::getIncomingEdges(), GeomHelper::getMinAngleDiff(), NBNode::getOutgoingEdges(), NBNode::isSimpleContinuation(), MAX2(), NBNode::myAllEdges, myNode, SUMOReal, and UNUSED_PARAMETER.
Referenced by NBNode::computeNodeShape().
|
private |
Computes the node geometry Edges with the same direction are grouped. Then the node geometry is built from intersection between the borders of adjacent edge groups.
Definition at line 194 of file NBNodeShapeComputer.cpp.
References Position::add(), computeSameEnd(), computeUniqueDirectionList(), DEG2RAD, Line::extrapolateBy(), NBNode::getPosition(), NBNode::hasIncoming(), NBNode::hasOutgoing(), joinSameDirectionEdges(), LANESPREAD_CENTER, PositionVector::length(), M_PI, MIN2(), Position::mul(), NBNode::myAllEdges, myNode, POSITION_EPS, PositionVector::positionAtOffset2D(), PositionVector::push_back_noDoublePos(), PositionVector::push_front_noDoublePos(), replaceFirstChecking(), replaceLastChecking(), PositionVector::reverse(), Position::set(), SUMO_const_halfLaneWidth, SUMOReal, Position::x(), Position::y(), and Position::z().
Referenced by compute().
|
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 723 of file NBNodeShapeComputer.cpp.
References Line::add(), Line::extrapolateBy(), NBNode::getPosition(), Line::intersects(), Line::intersectsAt(), M_PI, NBNode::myAllEdges, myNode, Line::p1(), PositionVector::push_back_noDoublePos(), Line::rotateAtP1(), Position::set(), SUMO_const_halfLaneWidth, Position::x(), Position::y(), and Position::z().
Referenced by compute().
|
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 675 of file NBNodeShapeComputer.cpp.
References computeSameEnd(), NBNode::hasIncoming(), NBNode::myAllEdges, and myNode.
Referenced by computeNodeShapeDefault().
|
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 610 of file NBNodeShapeComputer.cpp.
References Line::atan2DegreeAngle(), Line::extrapolateBy(), NBNode::hasIncoming(), PositionVector::lineAt(), NBNode::myAllEdges, myNode, Line::p1(), SUMO_const_halfLaneWidth, and WRITE_WARNING.
Referenced by computeNodeShapeDefault().
|
private |
Invalidated assignment operator.
|
private |
Definition at line 166 of file NBNodeShapeComputer.cpp.
References PositionVector::extrapolate(), Line::move2side(), PositionVector::nearest_offset_to_point2D(), Line::p1(), PositionVector::positionAtOffset2D(), PositionVector::push_front_noDoublePos(), PositionVector::replaceAt(), SUMO_const_halfLaneAndOffset, SUMO_const_laneWidth, SUMO_const_laneWidthAndOffset, and SUMOReal.
Referenced by computeNodeShapeDefault().
|
private |
Definition at line 139 of file NBNodeShapeComputer.cpp.
References PositionVector::extrapolate(), Line::move2side(), PositionVector::nearest_offset_to_point2D(), Line::p2(), PositionVector::positionAtOffset2D(), PositionVector::push_back_noDoublePos(), PositionVector::replaceAt(), SUMO_const_halfLaneAndOffset, SUMO_const_laneWidth, SUMO_const_laneWidthAndOffset, and SUMOReal.
Referenced by computeNodeShapeDefault().
|
private |
The node to compute the geometry for.
Definition at line 124 of file NBNodeShapeComputer.h.
Referenced by compute(), computeNodeShapeDefault(), computeNodeShapeSmall(), computeUniqueDirectionList(), and joinSameDirectionEdges().