![]() |
SUMO - Simulation of Urban MObility
|
A list of positions. More...
#include <PositionVector.h>
Data Structures | |
class | as_poly_cw_sorter |
class | increasing_x_y_sorter |
Public Member Functions | |
void | add (SUMOReal xoff, SUMOReal yoff, SUMOReal zoff) |
SUMOReal | angleAt2D (int pos) const |
void | append (const PositionVector &v, SUMOReal sameThreshold=2.0) |
SUMOReal | area () const |
Returns the area (0 for non-closed) More... | |
bool | around (const Position &p, SUMOReal offset=0) const |
Returns the information whether the position vector describes a polygon lying around the given point The optional offset is added to the polygon's boundaries. More... | |
SUMOReal | beginEndAngle () const |
returns the angle in radians of the line connecting the first and the last position More... | |
void | closePolygon () |
ensures that the last position equals the first More... | |
PositionVector | convexHull () const |
bool | crosses (const Position &p1, const Position &p2) const |
SUMOReal | distance (const Position &p, bool perpendicular=false) const |
std::vector< SUMOReal > | distances (const PositionVector &s, bool perpendicular=false) const |
void | extrapolate (const SUMOReal val, const bool onlyFirst=false) |
void | extrapolate2D (const SUMOReal val, const bool onlyFirst=false) |
Boundary | getBoxBoundary () const |
Returns a boundary enclosing this list of lines. More... | |
Position | getCentroid () const |
Returns the centroid (closes the polygon if unclosed) More... | |
Position | getLineCenter () const |
Position | getPolygonCenter () const |
Returns the arithmetic of all corner points. More... | |
PositionVector | getSubpart (SUMOReal beginOffset, SUMOReal endOffset) const |
PositionVector | getSubpart2D (SUMOReal beginOffset, SUMOReal endOffset) const |
PositionVector | getSubpartByIndex (int beginIndex, int count) const |
bool | hasElevation () const |
return whether two positions differ in z-coordinate More... | |
int | indexOfClosest (const Position &p) const |
int | insertAtClosest (const Position &p) |
Position | intersectionPosition2D (const Position &p1, const Position &p2, const SUMOReal withinDist=0.) const |
Position | intersectionPosition2D (const PositionVector &v1) const |
bool | intersects (const Position &p1, const Position &p2) const |
bool | intersects (const PositionVector &v1) const |
std::vector< SUMOReal > | intersectsAtLengths2D (const PositionVector &other) const |
For all intersections between this vector and other, return the 2D-length of the subvector from this vectors start to the intersection. More... | |
std::vector< SUMOReal > | intersectsAtLengths2D (const Position &lp1, const Position &lp2) const |
For all intersections between this vector and line, return the 2D-length of the subvector from this vectors start to the intersection. More... | |
bool | isClosed () const |
SUMOReal | isLeft (const Position &P0, const Position &P1, const Position &P2) const |
SUMOReal | length () const |
Returns the length. More... | |
SUMOReal | length2D () const |
Returns the length. More... | |
void | mirrorX () |
mirror coordinates along the x-axis More... | |
void | move2side (SUMOReal amount) |
SUMOReal | nearest_offset_to_point2D (const Position &p, bool perpendicular=true) const |
bool | operator== (const PositionVector &v2) const |
comparing operation More... | |
const Position & | operator[] (int index) const |
returns the position at the given index !!! exceptions? More... | |
Position & | operator[] (int index) |
bool | overlapsWith (const AbstractPoly &poly, SUMOReal offset=0) const |
Returns the information whether the given polygon overlaps with this Again a boundary may be specified. More... | |
bool | partialWithin (const AbstractPoly &poly, SUMOReal offset=0) const |
Returns the information whether this polygon lies partially within the given polygon. More... | |
Position | positionAtOffset (SUMOReal pos, SUMOReal lateralOffset=0) const |
Returns the position at the given length. More... | |
Position | positionAtOffset2D (SUMOReal pos, SUMOReal lateralOffset=0) const |
Returns the position at the given length. More... | |
PositionVector () | |
Constructor. More... | |
PositionVector (const std::vector< Position > &v) | |
Constructor. More... | |
PositionVector (const std::vector< Position >::const_iterator beg, const std::vector< Position >::const_iterator end) | |
Constructor. More... | |
PositionVector (const Position &p1, const Position &p2) | |
Constructor for lines. More... | |
void | push_back_noDoublePos (const Position &p) |
void | push_front_noDoublePos (const Position &p) |
void | removeDoublePoints (SUMOReal minDist=POSITION_EPS, bool assertLength=false) |
Removes positions if too near. More... | |
PositionVector | reverse () const |
SUMOReal | rotationAtOffset (SUMOReal pos) const |
Returns the rotation at the given length. More... | |
SUMOReal | rotationDegreeAtOffset (SUMOReal pos) const |
Returns the rotation at the given length. More... | |
void | scaleAbsolute (SUMOReal offset) |
enlarges/shrinks the polygon by an absolute offset based at the centroid More... | |
void | scaleRelative (SUMOReal factor) |
enlarges/shrinks the polygon by a factor based at the centroid More... | |
SUMOReal | slopeDegreeAtOffset (SUMOReal pos) const |
Returns the slope at the given length. More... | |
void | sortAsPolyCWByAngle () |
void | sortByIncreasingXY () |
std::pair< PositionVector, PositionVector > | splitAt (SUMOReal where) const |
Returns the two lists made when this list vector is splitted at the given point. More... | |
Position | transformToVectorCoordinates (const Position &p, bool extend=false) const |
return position p within the length-wise coordinate system defined by this position vector. The x value is the same as that returned by nearest_offset_to_point2D(p) and the y value is the perpendicular distance to this vector with the sign indicating the side (right is postive). if extend is true, the vector is extended on both sides and the x-coordinate of the result may be below 0 or above the length of the original vector More... | |
~PositionVector () | |
Destructor. More... | |
Static Public Member Functions | |
static Position | positionAtOffset (const Position &p1, const Position &p2, SUMOReal pos, SUMOReal lateralOffset=0.) |
Returns the position between the two given point at the specified position */. More... | |
static Position | positionAtOffset2D (const Position &p1, const Position &p2, SUMOReal pos, SUMOReal lateralOffset=0.) |
Returns the position between the two given point at the specified position */. More... | |
static Position | sideOffset (const Position &beg, const Position &end, const SUMOReal amount) |
Private Types | |
typedef std::vector< Position > | vp |
Static Private Member Functions | |
static bool | intersects (const Position &p11, const Position &p12, const Position &p21, const Position &p22, const SUMOReal withinDist=0., SUMOReal *x=0, SUMOReal *y=0, SUMOReal *mu=0) |
return whether the line segments defined by Line p11,p12 and Line p21,p22 intersect More... | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const PositionVector &geom) |
Output operator. More... | |
A list of positions.
Definition at line 52 of file PositionVector.h.
|
private |
Definition at line 55 of file PositionVector.h.
PositionVector::PositionVector | ( | ) |
PositionVector::PositionVector | ( | const std::vector< Position > & | v | ) |
PositionVector::PositionVector | ( | const std::vector< Position >::const_iterator | beg, |
const std::vector< Position >::const_iterator | end | ||
) |
Constructor.
[in] | beg | The begin iterator for copy |
[in] | end | The end iterator to copy |
Definition at line 66 of file PositionVector.cpp.
Constructor for lines.
[in] | p1 | the first position |
[in] | p2 | the second position |
Definition at line 71 of file PositionVector.cpp.
PositionVector::~PositionVector | ( | ) |
Destructor.
Definition at line 77 of file PositionVector.cpp.
Definition at line 520 of file PositionVector.cpp.
Referenced by computeSameEnd(), NBEdge::init(), GNEEdge::moveGeometry(), NBDistrict::reshiftPosition(), NBEdge::reshiftPosition(), NBNode::reshiftPosition(), and GNEEdge::updateJunctionPosition().
SUMOReal PositionVector::angleAt2D | ( | int | pos | ) | const |
void PositionVector::append | ( | const PositionVector & | v, |
SUMOReal | sameThreshold = 2.0 |
||
) |
Definition at line 581 of file PositionVector.cpp.
Referenced by NBEdge::append(), NBNode::buildWalkingAreas(), NBNode::computeInternalLaneShape(), NBNodeShapeComputer::computeNodeShapeDefault(), NBEdgeCont::formFactor(), GNENet::replaceJunctionByGeometry(), and NWWriter_OpenDrive::writeNetwork().
SUMOReal PositionVector::area | ( | ) | const |
Returns the area (0 for non-closed)
Definition at line 422 of file PositionVector.cpp.
References isClosed(), and SUMOReal.
Referenced by GNEJunction::drawGL(), NBEdgeCont::formFactor(), getCentroid(), and NBNodesEdgesSorter::sortNodesEdges().
Returns the information whether the position vector describes a polygon lying around the given point The optional offset is added to the polygon's boundaries.
Implements AbstractPoly.
Definition at line 81 of file PositionVector.cpp.
References GeomHelper::angle2D(), around(), M_PI, scaleAbsolute(), SUMOReal, Position::x(), and Position::y().
Referenced by around(), NBEdge::computeAngle(), NBNode::computeNodeShape(), NBHeightMapper::Triangle::contains(), NBNode::getCenter(), and NIVissimTL::NIVissimTLSignal::isWithin().
SUMOReal PositionVector::beginEndAngle | ( | ) | const |
returns the angle in radians of the line connecting the first and the last position
Definition at line 681 of file PositionVector.cpp.
References SUMOReal.
Referenced by NBEdge::cutAtIntersection(), NIVissimEdge::dict_checkEdges2Join(), NIVissimConnectionCluster::getIncomingContinuation(), NIVissimConnectionCluster::getIncomingContinuationGeometry(), NIVissimConnectionCluster::getOutgoingContinuation(), NIVissimConnectionCluster::getOutgoingContinuationGeometry(), NIVissimConnectionCluster::isWeakDistrictConnRealisation(), MSDevice_Battery::notifyEnter(), NIVissimConnectionCluster::same_direction_sorter::operator()(), and GUILane::setFunctionalColor().
void PositionVector::closePolygon | ( | ) |
ensures that the last position equals the first
Definition at line 940 of file PositionVector.cpp.
Referenced by GNEJunction::drawGL(), NBNode::getCenter(), GNEViewNet::onCmdNodeShape(), NLHandler::openJunction(), NIVissimSingleTypeParser_Knotendefinition::parse(), and NIXMLNodesHandler::processNodeType().
PositionVector PositionVector::convexHull | ( | ) | const |
Definition at line 573 of file PositionVector.cpp.
References simpleHull_2D(), and sortAsPolyCWByAngle().
Implements AbstractPoly.
Definition at line 455 of file PositionVector.cpp.
References intersects().
Definition at line 969 of file PositionVector.cpp.
References Position::distanceTo2D(), GeomHelper::INVALID_OFFSET, max, nearest_offset_to_point2D(), positionAtOffset2D(), and SUMOReal.
Referenced by TraCIServerAPI_Lane::StoringVisitor::add(), NBEdge::computeAngle(), NBNode::computeNodeShape(), distances(), TraCIServerAPI_Vehicle::findCloserLane(), NBNode::getCenter(), NBEdge::shiftPositionAtNode(), transformToVectorCoordinates(), and TraCIServerAPI_Vehicle::vtdMap().
std::vector< SUMOReal > PositionVector::distances | ( | const PositionVector & | s, |
bool | perpendicular = false |
||
) | const |
Definition at line 949 of file PositionVector.cpp.
References distance(), GeomHelper::INVALID_OFFSET, and SUMOReal.
Referenced by NBNodeShapeComputer::badIntersection(), and NBEdge::isNearEnough2BeJoined2().
void PositionVector::extrapolate | ( | const SUMOReal | val, |
const bool | onlyFirst = false |
||
) |
Definition at line 830 of file PositionVector.cpp.
References Position::add(), Position::distanceTo(), and Position::sub().
Referenced by NBNode::buildCrossings(), NBEdge::buildInnerEdges(), NBNode::computeSmoothShape(), GUILane::drawLinkNo(), GUILane::drawLinkRules(), GUILane::drawTLSLinkNo(), NIVissimAbstractEdge::getGeomPosition(), MSPModel_Striping::initWalkingAreaPaths(), NIImporter_SUMO::reconstructEdgeShape(), NBEdge::startShapeAt(), and transformToVectorCoordinates().
void PositionVector::extrapolate2D | ( | const SUMOReal | val, |
const bool | onlyFirst = false |
||
) |
Definition at line 849 of file PositionVector.cpp.
References Position::add(), Position::distanceTo2D(), and Position::sub().
Referenced by NBNodeShapeComputer::computeNodeShapeSmall(), computeSameEnd(), and move2side().
Boundary PositionVector::getBoxBoundary | ( | ) | const |
Returns a boundary enclosing this list of lines.
Definition at line 313 of file PositionVector.cpp.
References Boundary::add().
Referenced by NBHeightMapper::addTriangle(), TraCIServer::collectObjectsInRange(), GUIPolygon::drawGL(), MSLane::fill(), GNELane::getBoundary(), GNECrossing::getCenteringBoundary(), GNEInternalLane::getCenteringBoundary(), GUIPolygon::getCenteringBoundary(), GNELane::getCenteringBoundary(), GUIContainerStop::getCenteringBoundary(), GUIBusStop::getCenteringBoundary(), GUIChargingStation::getCenteringBoundary(), GUIJunctionWrapper::GUIJunctionWrapper(), NBEdgeCont::ignoreFilterMatch(), PCPolyContainer::insert(), NIImporter_OpenDrive::loadNetwork(), GUI_E2_ZS_Collector::MyWrapper::MyWrapper(), NIVissimConnectionCluster::recomputeBoundary(), GNEPoly::simplifyShape(), and GNEJunction::updateBoundary().
Position PositionVector::getCentroid | ( | ) | const |
Returns the centroid (closes the polygon if unclosed)
Definition at line 337 of file PositionVector.cpp.
References area(), isClosed(), length(), and SUMOReal.
Referenced by NBEdge::computeAngle(), scaleAbsolute(), and scaleRelative().
Position PositionVector::getLineCenter | ( | ) | const |
Definition at line 394 of file PositionVector.cpp.
References length(), positionAtOffset(), and SUMOReal.
Referenced by GUIBusStop::GUIBusStop(), GUIChargingStation::GUIChargingStation(), and GUIContainerStop::GUIContainerStop().
Position PositionVector::getPolygonCenter | ( | ) | const |
Returns the arithmetic of all corner points.
Definition at line 323 of file PositionVector.cpp.
References SUMOReal.
Referenced by NIVissimNodeCluster::buildNBNode(), NIVissimDistrictConnection::dict_BuildDistrictNodes(), GUIPolygon::drawGL(), and NBNode::getCenter().
PositionVector PositionVector::getSubpart | ( | SUMOReal | beginOffset, |
SUMOReal | endOffset | ||
) | const |
Definition at line 591 of file PositionVector.cpp.
References length(), POSITION_EPS, positionAtOffset(), push_back_noDoublePos(), and SUMOReal.
Referenced by NBNode::computeInternalLaneShape(), NBEdge::cutAtIntersection(), GUIBusStop::GUIBusStop(), GUIChargingStation::GUIChargingStation(), GUIContainerStop::GUIContainerStop(), GUI_E2_ZS_Collector::MyWrapper::MyWrapper(), and NWWriter_SUMO::writeLane().
PositionVector PositionVector::getSubpart2D | ( | SUMOReal | beginOffset, |
SUMOReal | endOffset | ||
) | const |
Definition at line 628 of file PositionVector.cpp.
References length2D(), POSITION_EPS, positionAtOffset2D(), push_back_noDoublePos(), and SUMOReal.
Referenced by NBNodeShapeComputer::badIntersection(), computeSameEnd(), NIImporter_OpenDrive::geomFromArc(), NIImporter_OpenDrive::geomFromPoly(), NIImporter_OpenDrive::geomFromSpiral(), NIImporter_OpenDrive::loadNetwork(), and NBEdge::startShapeAt().
PositionVector PositionVector::getSubpartByIndex | ( | int | beginIndex, |
int | count | ||
) | const |
Definition at line 665 of file PositionVector.cpp.
References SUMOReal.
Referenced by NBNode::buildWalkingAreas(), NBNodeShapeComputer::computeNodeShapeSmall(), NBEdge::getInnerGeometry(), and NBEdge::startShapeAt().
bool PositionVector::hasElevation | ( | ) | const |
return whether two positions differ in z-coordinate
Definition at line 1037 of file PositionVector.cpp.
int PositionVector::indexOfClosest | ( | const Position & | p | ) | const |
Definition at line 767 of file PositionVector.cpp.
References Position::distanceTo(), max, and SUMOReal.
Referenced by GNEEdge::changeGeometry(), GNEEdge::deleteGeometry(), GNEPoly::deleteGeometryNear(), GNEEdge::getSplitPos(), and GNEEdge::setEndpoint().
int PositionVector::insertAtClosest | ( | const Position & | p | ) |
Definition at line 784 of file PositionVector.cpp.
References Position::distanceTo2D(), length(), max, GeomHelper::nearest_offset_on_line_to_point2D(), positionAtOffset2D(), and SUMOReal.
Referenced by GNEEdge::changeGeometry().
Position PositionVector::intersectionPosition2D | ( | const Position & | p1, |
const Position & | p2, | ||
const SUMOReal | withinDist = 0. |
||
) | const |
Returns the position of the intersection
Definition at line 148 of file PositionVector.cpp.
References intersects(), Position::INVALID, and SUMOReal.
Referenced by NBNode::computeSmoothShape(), NIVissimAbstractEdge::crossesEdgeAtPoint(), GeomHelper::crossPoint(), intersectionPosition2D(), move2side(), and NIImporter_SUMO::reconstructEdgeShape().
Position PositionVector::intersectionPosition2D | ( | const PositionVector & | v1 | ) | const |
Returns the position of the intersection
Definition at line 162 of file PositionVector.cpp.
References intersectionPosition2D(), intersects(), and Position::INVALID.
Returns the information whether this list of points interesects the given line
Definition at line 120 of file PositionVector.cpp.
Referenced by NBNodeShapeComputer::badIntersection(), NBNodeShapeComputer::computeNodeShapeDefault(), computeSameEnd(), Boundary::crosses(), crosses(), NIVissimAbstractEdge::crossesEdge(), GeomHelper::crossPoint(), intersectionPosition2D(), intersects(), intersectsAtLengths2D(), NIVissimConnectionCluster::isWeakDistrictConnRealisation(), NIImporter_SUMO::reconstructEdgeShape(), and NBEdge::startShapeAt().
bool PositionVector::intersects | ( | const PositionVector & | v1 | ) | const |
Returns the information whether this list of points interesects one the given lines
Definition at line 134 of file PositionVector.cpp.
References intersects().
|
staticprivate |
return whether the line segments defined by Line p11,p12 and Line p21,p22 intersect
Definition at line 1051 of file PositionVector.cpp.
References Position::distanceTo2D(), SUMOReal, Position::x(), and Position::y().
std::vector< SUMOReal > PositionVector::intersectsAtLengths2D | ( | const PositionVector & | other | ) | const |
For all intersections between this vector and other, return the 2D-length of the subvector from this vectors start to the intersection.
Definition at line 802 of file PositionVector.cpp.
Referenced by NBNodeShapeComputer::closestIntersection(), NBNodeShapeComputer::computeNodeShapeDefault(), computeSameEnd(), NBEdge::firstIntersection(), MSLink::setRequestInformation(), and NBEdge::startShapeAt().
std::vector< SUMOReal > PositionVector::intersectsAtLengths2D | ( | const Position & | lp1, |
const Position & | lp2 | ||
) | const |
For all intersections between this vector and line, return the 2D-length of the subvector from this vectors start to the intersection.
Definition at line 813 of file PositionVector.cpp.
References Position::distanceTo2D(), intersects(), and SUMOReal.
bool PositionVector::isClosed | ( | ) | const |
Definition at line 1000 of file PositionVector.cpp.
Referenced by area(), GNEEdge::changeGeometry(), and getCentroid().
SUMOReal PositionVector::isLeft | ( | const Position & | P0, |
const Position & | P1, | ||
const Position & | P2 | ||
) | const |
Definition at line 566 of file PositionVector.cpp.
References Position::x(), and Position::y().
Referenced by transformToVectorCoordinates().
SUMOReal PositionVector::length | ( | ) | const |
Returns the length.
Definition at line 403 of file PositionVector.cpp.
References SUMOReal.
Referenced by NIXMLEdgesHandler::addSplit(), NBNodeShapeComputer::badIntersection(), NBEdge::buildInnerEdges(), NBRampsComputer::buildOffRamp(), NBRampsComputer::buildOnRamp(), NBEdge::computeAngle(), NBNodeShapeComputer::computeNodeShapeDefault(), NBEdge::cutAtIntersection(), NIVissimEdge::dict_checkEdges2Join(), GNEEdge::drawGL(), GUIEdge::drawGL(), NBEdge::firstIntersection(), getCentroid(), NBEdge::getFinalLength(), NIVissimAbstractEdge::getGeomPosition(), NWWriter_DlrNavteq::getGraphLength(), NIVissimEdge::getLength(), getLineCenter(), getSubpart(), NIVissimEdge::getToNode(), GUIBusStop::GUIBusStop(), GUIChargingStation::GUIChargingStation(), GUIContainerStop::GUIContainerStop(), GUITriggeredRerouter::GUITriggeredRerouterEdge::GUITriggeredRerouterEdge(), insertAtClosest(), NIXMLEdgesHandler::myEndElement(), NIImporter_Vissim::NIVissimXMLHandler_Streckendefinition::myEndElement(), NBContHelper::relative_incoming_edge_sorter::operator()(), NIVissimEdge::resolveSameNode(), rotationAtOffset(), splitAt(), NBEdgeCont::splitAt(), NWWriter_SUMO::writeLane(), and NWWriter_OpenDrive::writeNetwork().
SUMOReal PositionVector::length2D | ( | ) | const |
Returns the length.
Definition at line 412 of file PositionVector.cpp.
References SUMOReal.
Referenced by GNEEdge::changeGeometry(), NBEdge::computeAngle(), computeSameEnd(), NBEdgeCont::formFactor(), getSubpart2D(), NIImporter_OpenDrive::loadNetwork(), and NBEdge::startShapeAt().
void PositionVector::mirrorX | ( | ) |
mirror coordinates along the x-axis
Definition at line 528 of file PositionVector.cpp.
Referenced by NBDistrict::mirrorX(), NBEdge::mirrorX(), and NBNode::mirrorX().
void PositionVector::move2side | ( | SUMOReal | amount | ) |
Definition at line 885 of file PositionVector.cpp.
References Position::distanceTo2D(), extrapolate2D(), intersectionPosition2D(), Position::INVALID, POSITION_EPS, sideOffset(), SUMOReal, and Position::z().
Referenced by NBEdge::addRestrictedLane(), GNENet::addReversedEdge(), NBNodeShapeComputer::badIntersection(), NBNode::buildCrossings(), NBNode::buildWalkingAreas(), NBEdge::computeLaneShape(), GUIVehicle::drawBestLanes(), NBEdge::firstIntersection(), NBEdge::getCCWBoundaryLine(), NBEdge::getCWBoundaryLine(), NWWriter_OpenDrive::getLeftLaneBorder(), MSVehicle::getPosition(), GUIBusStop::GUIBusStop(), GUIChargingStation::GUIChargingStation(), GUIContainerStop::GUIContainerStop(), NBRampsComputer::moveRampRight(), NIXMLEdgesHandler::myEndElement(), NBEdge::shiftPositionAtNode(), NBSign::writeAsPOI(), and NWWriter_OpenDrive::writeNetwork().
SUMOReal PositionVector::nearest_offset_to_point2D | ( | const Position & | p, |
bool | perpendicular = true |
||
) | const |
Definition at line 687 of file PositionVector.cpp.
References Position::distanceTo2D(), GeomHelper::INVALID_OFFSET, max, GeomHelper::nearest_offset_on_line_to_point2D(), positionAtOffset2D(), and SUMOReal.
Referenced by GNEEdge::changeGeometry(), distance(), GNELane::getPopUpMenu(), GUILane::getPopUpMenu(), GUIEdge::getSegmentAtPosition(), GNEEdge::getSplitPos(), NBEdgeCont::splitAt(), GNENet::splitEdge(), and TraCIServerAPI_Vehicle::vtdMap().
bool PositionVector::operator== | ( | const PositionVector & | v2 | ) | const |
comparing operation
Definition at line 1022 of file PositionVector.cpp.
const Position & PositionVector::operator[] | ( | int | index | ) | const |
returns the position at the given index !!! exceptions?
Definition at line 173 of file PositionVector.cpp.
Position & PositionVector::operator[] | ( | int | index | ) |
Definition at line 183 of file PositionVector.cpp.
|
virtual |
Returns the information whether the given polygon overlaps with this Again a boundary may be specified.
Implements AbstractPoly.
Definition at line 109 of file PositionVector.cpp.
References AbstractPoly::around().
Referenced by NIVissimAbstractEdge::overlapsWith().
|
virtual |
Returns the information whether this polygon lies partially within the given polygon.
Implements AbstractPoly.
Definition at line 444 of file PositionVector.cpp.
References AbstractPoly::around().
Returns the position at the given length.
Definition at line 193 of file PositionVector.cpp.
References SUMOReal.
Referenced by GUIBusStop::addAccess(), NIXMLEdgesHandler::addSplit(), NBRampsComputer::buildOffRamp(), NBRampsComputer::buildOnRamp(), TraCIServerAPI_Simulation::commandPositionConversion(), NBNode::computeSmoothShape(), GNEEdge::drawGL(), GUIEdge::drawGL(), GLHelper::drawTriangleAtEnd(), MSLane::geometryPositionAtOffset(), NIVissimAbstractEdge::getGeomPosition(), MSTransportable::Stage::getLanePosition(), getLineCenter(), TraCIServerAPI_InductionLoop::getPosition(), MSPModel_Striping::PState::getPosition(), MSVehicle::getPosition(), MSVTKExport::getSpeed(), GNEEdge::getSplitPos(), getSubpart(), TraCIServerAPI_InductionLoop::getTree(), MSStoppingPlace::getWaitPosition(), GUICalibrator::GUICalibrator(), GUILaneSpeedTrigger::GUILaneSpeedTrigger(), NIImporter_OpenDrive::loadNetwork(), NIImporter_VISUM::parse_Lanes(), splitAt(), transformToVectorCoordinates(), MSBatteryExport::write(), and NBSign::writeAsPOI().
|
static |
Returns the position between the two given point at the specified position */.
Definition at line 269 of file PositionVector.cpp.
References Position::distanceTo(), Position::INVALID, sideOffset(), and SUMOReal.
Returns the position at the given length.
Definition at line 208 of file PositionVector.cpp.
References SUMOReal.
Referenced by NGRandomNetBuilder::canConnect(), GNEEdge::changeGeometry(), NBEdge::computeAngle(), NBNodeShapeComputer::computeNodeShapeDefault(), computeSameEnd(), GUIVehicle::computeSeats(), distance(), GNELane::getPopUpMenu(), GUILane::getPopUpMenu(), CState::getPosition(), GUIContainer::getPosition(), getSubpart2D(), insertAtClosest(), nearest_offset_to_point2D(), NBContHelper::relative_outgoing_edge_sorter::operator()(), NBContHelper::relative_incoming_edge_sorter::operator()(), and NBEdge::startShapeAt().
|
static |
Returns the position between the two given point at the specified position */.
Definition at line 291 of file PositionVector.cpp.
References Position::distanceTo2D(), Position::INVALID, sideOffset(), and SUMOReal.
void PositionVector::push_back_noDoublePos | ( | const Position & | p | ) |
Definition at line 984 of file PositionVector.cpp.
References Position::almostSame().
Referenced by NIVissimNodeCluster::buildNBNode(), NBNode::buildWalkingAreas(), NBNode::computeNodeShape(), NBNodeShapeComputer::computeNodeShapeDefault(), NBNodeShapeComputer::computeNodeShapeSmall(), NIImporter_OpenDrive::computeShapes(), NBEdge::getFinalLength(), NWWriter_DlrNavteq::getGraphLength(), getSubpart(), getSubpart2D(), NBEdge::init(), MSPModel_Striping::initWalkingAreaPaths(), NIImporter_OpenStreetMap::insertEdge(), PCLoaderArcView::load(), NIImporter_ArcView::load(), PCLoaderOSM::loadIfSet(), NIImporter_Vissim::NIVissimXMLHandler_Streckendefinition::myEndElement(), NIImporter_Vissim::NIVissimXMLHandler_Geschwindigkeitsverteilungsdefinition::myEndElement(), NIVissimAbstractEdge::NIVissimAbstractEdge(), NIVissimSingleTypeParser_Streckendefinition::parse(), NIVissimSingleTypeParser_Verbindungsdefinition::parse(), and simpleHull_2D().
void PositionVector::push_front_noDoublePos | ( | const Position & | p | ) |
Definition at line 992 of file PositionVector.cpp.
References Position::almostSame().
Referenced by NBNode::buildWalkingAreas(), NBNodeShapeComputer::computeNodeShapeDefault(), NBEdge::getFinalLength(), NWWriter_DlrNavteq::getGraphLength(), NBEdge::init(), and NBEdge::startShapeAt().
void PositionVector::removeDoublePoints | ( | SUMOReal | minDist = POSITION_EPS , |
bool | assertLength = false |
||
) |
Removes positions if too near.
[in] | minDist | The minimum accepted distance; default: POSITION_EPS |
[in] | assertLength | Whether the result must at least contain two points (be a line); default: false, to ensure original behaviour |
Definition at line 1006 of file PositionVector.cpp.
Referenced by NIImporter_OpenDrive::computeShapes(), NBEdge::init(), and NBEdge::reduceGeometry().
PositionVector PositionVector::reverse | ( | ) | const |
Definition at line 868 of file PositionVector.cpp.
Referenced by GNENet::addReversedEdge(), NBNodeShapeComputer::badIntersection(), NBNode::buildWalkingAreas(), NBEdge::cutAtIntersection(), GUILane::drawLinkNo(), GUILane::drawLinkRules(), GUILane::drawTLSLinkNo(), NBNodeShapeComputer::getSmoothCorner(), MSPModel_Striping::initWalkingAreaPaths(), NIImporter_OpenStreetMap::insertEdge(), NIImporter_ArcView::load(), NIImporter_OpenDrive::loadNetwork(), NIImporter_VISUM::parse_AreaSubPartElement(), NIImporter_DlrNavteq::EdgesHandler::report(), and GNENet::reverseEdge().
Returns the rotation at the given length.
Definition at line 223 of file PositionVector.cpp.
References Position::angleTo2D(), Position::distanceTo(), length(), and SUMOReal.
Referenced by MSVehicle::computeAngle(), GUIEdge::drawMesoVehicles(), MEVehicle::getAngle(), MSPModel_Striping::PState::getAngle(), and rotationDegreeAtOffset().
Returns the rotation at the given length.
Definition at line 245 of file PositionVector.cpp.
References GeomHelper::legacyDegree(), rotationAtOffset(), and SUMOReal.
Referenced by GUIE3Collector::MyWrapper::buildDefinition(), GNEEdge::drawGL(), GUIEdge::drawGL(), GUIBusStop::GUIBusStop(), GUICalibrator::GUICalibrator(), GUIChargingStation::GUIChargingStation(), GUIContainerStop::GUIContainerStop(), GUILaneSpeedTrigger::GUILaneSpeedTrigger(), GUITriggeredRerouter::GUITriggeredRerouterEdge::GUITriggeredRerouterEdge(), GUIMEInductLoop::MyWrapper::MyWrapper(), GUIInstantInductLoop::MyWrapper::MyWrapper(), GUIInductLoop::MyWrapper::MyWrapper(), and TraCIServerAPI_Vehicle::vtdMap().
void PositionVector::scaleAbsolute | ( | SUMOReal | offset | ) |
enlarges/shrinks the polygon by an absolute offset based at the centroid
Definition at line 385 of file PositionVector.cpp.
References getCentroid().
Referenced by around().
void PositionVector::scaleRelative | ( | SUMOReal | factor | ) |
enlarges/shrinks the polygon by a factor based at the centroid
Definition at line 376 of file PositionVector.cpp.
References getCentroid().
Referenced by GNEJunction::drawGL().
|
static |
Definition at line 878 of file PositionVector.cpp.
References Position::distanceTo2D(), SUMOReal, Position::x(), and Position::y().
Referenced by move2side(), positionAtOffset(), positionAtOffset2D(), and NIImporter_SUMO::reconstructEdgeShape().
Returns the slope at the given length.
Definition at line 251 of file PositionVector.cpp.
References Position::distanceTo(), Position::distanceTo2D(), RAD2DEG, SUMOReal, and Position::z().
Referenced by MEVehicle::getSlope(), and MSVehicle::getSlope().
void PositionVector::sortAsPolyCWByAngle | ( | ) |
Definition at line 514 of file PositionVector.cpp.
Referenced by convexHull().
void PositionVector::sortByIncreasingXY | ( | ) |
Definition at line 544 of file PositionVector.cpp.
std::pair< PositionVector, PositionVector > PositionVector::splitAt | ( | SUMOReal | where | ) | const |
Returns the two lists made when this list vector is splitted at the given point.
Definition at line 461 of file PositionVector.cpp.
References length(), POSITION_EPS, positionAtOffset(), SUMOReal, toString(), and WRITE_WARNING.
Referenced by NBEdge::buildInnerEdges(), NBEdgeCont::splitAt(), and GNENet::splitEdge().
Position PositionVector::transformToVectorCoordinates | ( | const Position & | p, |
bool | extend = false |
||
) | const |
return position p within the length-wise coordinate system defined by this position vector. The x value is the same as that returned by nearest_offset_to_point2D(p) and the y value is the perpendicular distance to this vector with the sign indicating the side (right is postive). if extend is true, the vector is extended on both sides and the x-coordinate of the result may be below 0 or above the length of the original vector
Definition at line 720 of file PositionVector.cpp.
References distance(), Position::distanceTo2D(), extrapolate(), Position::INVALID, GeomHelper::INVALID_OFFSET, isLeft(), max, GeomHelper::nearest_offset_on_line_to_point2D(), positionAtOffset(), sign, SUMOReal, and transformToVectorCoordinates().
Referenced by MSPModel_Striping::getNextLaneObstacles(), MSPModel_Striping::moveInDirection(), and transformToVectorCoordinates().
|
friend |
Output operator.
Definition at line 502 of file PositionVector.cpp.