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 | computeContinuationNodeShape (bool simpleContinuation) |
PositionVector | computeNodeShapeByCrosses () |
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 computeContinuationNodeShape(), computeNodeShapeByCrosses(), NBNode::getIncomingEdges(), GeomHelper::getMinAngleDiff(), NBNode::getOutgoingEdges(), NBNode::isSimpleContinuation(), MAX2(), NBNode::myAllEdges, myNode, SUMOReal, and UNUSED_PARAMETER.
Referenced by NBNode::computeNodeShape().
|
private |
Definition at line 194 of file NBNodeShapeComputer.cpp.
References Position::add(), computeSameEnd(), computeUniqueDirectionList(), Line::extrapolateBy(), NBNode::getPosition(), NBNode::hasIncoming(), NBNode::hasOutgoing(), joinSameDirectionEdges(), LANESPREAD_CENTER, PositionVector::length(), MIN2(), Position::mul(), NBNode::myAllEdges, myNode, PI, 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(), NBNode::myAllEdges, myNode, Line::p1(), PI, 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 computeContinuationNodeShape().
|
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 computeContinuationNodeShape().
|
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 computeContinuationNodeShape().
|
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 computeContinuationNodeShape().
|
private |
The node to compute the geometry for.
Definition at line 116 of file NBNodeShapeComputer.h.
Referenced by compute(), computeContinuationNodeShape(), computeNodeShapeByCrosses(), computeUniqueDirectionList(), and joinSameDirectionEdges().