![]() |
Eclipse SUMO - Simulation of Urban MObility
|
A list of positions. More...
#include <PositionVector.h>
Data Structures | |
class | as_poly_cw_sorter |
clase for CW Sorter More... | |
class | increasing_x_y_sorter |
clase for increasing Sorter More... | |
Public Member Functions | |
void | add (const Position &offset) |
void | add (double xoff, double yoff, double zoff) |
PositionVector | added (const Position &offset) const |
double | angleAt2D (int pos) const |
get angle in certain position of position vector More... | |
void | append (const PositionVector &v, double sameThreshold=2.0) |
double | area () const |
Returns the area (0 for non-closed) More... | |
bool | around (const Position &p, double offset=0) const |
Returns the information whether the position vector describes a polygon lying around the given point. More... | |
double | beginEndAngle () const |
returns the angle in radians of the line connecting the first and the last position More... | |
PositionVector | bezier (int numPoints) |
return a bezier interpolation More... | |
void | closePolygon () |
ensures that the last position equals the first More... | |
bool | crosses (const Position &p1, const Position &p2) const |
Returns whether the AbstractPoly crosses the given line. More... | |
double | distance2D (const Position &p, bool perpendicular=false) const |
closest 2D-distance to point p (or -1 if perpendicular is true and the point is beyond this vector) More... | |
std::vector< double > | distances (const PositionVector &s, bool perpendicular=false) const |
distances of all my points to s and all of s points to myself More... | |
void | extrapolate (const double val, const bool onlyFirst=false, const bool onlyLast=false) |
extrapolate position vector More... | |
void | extrapolate2D (const double val, const bool onlyFirst=false) |
extrapolate position vector in two dimensions (Z is ignored) More... | |
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 |
get line center More... | |
double | getMaxGrade (double &maxJump) const |
PositionVector | getOrthogonal (const Position &p, double extend, bool before, double length=1.0, double deg=90) const |
return orthogonal through p (extending this vector if necessary) More... | |
double | getOverlapWith (const PositionVector &poly, double zThreshold) const |
Returns the maximum overlaps between this and the given polygon (when not separated by at least zThreshold) More... | |
Position | getPolygonCenter () const |
Returns the arithmetic of all corner points. More... | |
PositionVector | getSubpart (double beginOffset, double endOffset) const |
get subpart of a position vector More... | |
PositionVector | getSubpart2D (double beginOffset, double endOffset) const |
get subpart of a position vector in two dimensions (Z is ignored) More... | |
PositionVector | getSubpartByIndex (int beginIndex, int count) const |
get subpart of a position vector using index and a cout More... | |
bool | hasElevation () const |
return whether two positions differ in z-coordinate More... | |
int | indexOfClosest (const Position &p) const |
index of the closest position to p More... | |
void | insert_noDoublePos (const std::vector< Position >::iterator &at, const Position &p) |
insert in front a non double position More... | |
int | insertAtClosest (const Position &p, bool interpolateZ) |
inserts p between the two closest positions More... | |
PositionVector | interpolateZ (double zStart, double zEnd) const |
returned vector that varies z smoothly over its length More... | |
Position | intersectionPosition2D (const Position &p1, const Position &p2, const double withinDist=0.) const |
Returns the position of the intersection. More... | |
Position | intersectionPosition2D (const PositionVector &v1) const |
Returns the position of the intersection. More... | |
bool | intersects (const Position &p1, const Position &p2) const |
Returns the information whether this list of points interesects the given line. More... | |
bool | intersects (const PositionVector &v1) const |
Returns the information whether this list of points interesects one the given lines. More... | |
std::vector< double > | 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... | |
std::vector< double > | 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... | |
bool | isClosed () const |
check if PositionVector is closed More... | |
double | isLeft (const Position &P0, const Position &P1, const Position &P2) const |
get left More... | |
bool | isNAN () const |
check if PositionVector is NAN More... | |
double | length () const |
Returns the length. More... | |
double | length2D () const |
Returns the length. More... | |
void | mirrorX () |
void | move2side (double amount, double maxExtension=100) |
move position vector to side using certain ammount More... | |
void | move2side (std::vector< double > amount, double maxExtension=100) |
move position vector to side using a custom offset for each geometry point More... | |
double | nearest_offset_to_point25D (const Position &p, bool perpendicular=true) const |
return the nearest offest to point 2D projected onto the 3D geometry More... | |
double | nearest_offset_to_point2D (const Position &p, bool perpendicular=true) const |
return the nearest offest to point 2D More... | |
double | offsetAtIndex2D (int index) const |
return the offset at the given index More... | |
bool | operator!= (const PositionVector &v2) const |
comparing operation More... | |
PositionVector | operator+ (const PositionVector &v2) const |
adds two vectors (requires vectors of the same length) More... | |
PositionVector | operator- (const PositionVector &v2) const |
substracts two vectors (requires vectors of the same length) More... | |
bool | operator== (const PositionVector &v2) const |
comparing operation More... | |
Position & | operator[] (int index) |
returns the position at the given index More... | |
const Position & | operator[] (int index) const |
returns the constat position at the given index @ToDo !!! exceptions? More... | |
bool | overlapsWith (const AbstractPoly &poly, double offset=0) const |
Returns the information whether the given polygon overlaps with this. More... | |
bool | partialWithin (const AbstractPoly &poly, double offset=0) const |
Returns the information whether this polygon lies partially within the given polygon. More... | |
void | pop_front () |
pop first Position More... | |
Position | positionAtOffset (double pos, double lateralOffset=0) const |
Returns the position at the given length. More... | |
Position | positionAtOffset2D (double pos, double lateralOffset=0) const |
Returns the position at the given length. More... | |
PositionVector () | |
Constructor. Creates an empty position vector. More... | |
PositionVector (const Position &p1, const Position &p2) | |
Parameter Constructor used for lines. More... | |
PositionVector (const std::vector< Position > &v) | |
Copy Constructor. Create a positionVector with the same elements as other positionVector. More... | |
PositionVector (const std::vector< Position >::const_iterator beg, const std::vector< Position >::const_iterator end) | |
Parameter Constructor. Create a positionVector using a part of other positionVector. More... | |
void | push_back_noDoublePos (const Position &p) |
insert in back a non double position More... | |
void | push_front (const Position &p) |
insert in front a Position More... | |
void | push_front_noDoublePos (const Position &p) |
insert in front a non double position More... | |
int | removeClosest (const Position &p) |
removes the point closest to p and return the removal index More... | |
void | removeDoublePoints (double minDist=POSITION_EPS, bool assertLength=false) |
Removes positions if too near. More... | |
PositionVector | resample (double maxLength, const bool adjustEnd) const |
resample shape (i.e. transform to segments, equal spacing) More... | |
PositionVector | reverse () const |
reverse position vector More... | |
void | rotate2D (double angle) |
double | rotationAtOffset (double pos) const |
Returns the rotation at the given length. More... | |
double | rotationDegreeAtOffset (double pos) const |
Returns the rotation at the given length. More... | |
void | scaleAbsolute (double offset) |
enlarges/shrinks the polygon by an absolute offset based at the centroid More... | |
void | scaleRelative (double factor) |
enlarges/shrinks the polygon by a factor based at the centroid More... | |
PositionVector | simplified () const |
return the same shape with intermediate colinear points removed More... | |
double | slopeDegreeAtOffset (double pos) const |
Returns the slope at the given length. More... | |
PositionVector | smoothedZFront (double dist=std::numeric_limits< double >::max()) const |
returned vector that is smoothed at the front (within dist) More... | |
void | sortAsPolyCWByAngle () |
sort as polygon CW by angle More... | |
void | sortByIncreasingXY () |
sort by increasing X-Y Positions More... | |
std::pair< PositionVector, PositionVector > | splitAt (double where, bool use2D=false) const |
Returns the two lists made when this list vector is splitted at the given point. More... | |
void | sub (const Position &offset) |
void | sub (double xoff, double yoff, double zoff) |
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, double pos, double lateralOffset=0.) |
Returns the position between the two given point at the specified position. More... | |
static Position | positionAtOffset2D (const Position &p1, const Position &p2, double pos, double 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 double amount) |
get a side position of position vector using a offset More... | |
Static Public Attributes | |
static const PositionVector | EMPTY |
empty Vector More... | |
Private Types | |
typedef std::vector< Position > | vp |
vector of position More... | |
Static Private Member Functions | |
static bool | intersects (const Position &p11, const Position &p12, const Position &p21, const Position &p22, const double withinDist=0., double *x=0, double *y=0, double *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) |
A list of positions.
Definition at line 43 of file PositionVector.h.
|
private |
vector of position
Definition at line 47 of file PositionVector.h.
PositionVector::PositionVector | ( | ) |
Constructor. Creates an empty position vector.
Definition at line 50 of file PositionVector.cpp.
Referenced by getSubpart2D(), and getSubpartByIndex().
PositionVector::PositionVector | ( | const std::vector< Position > & | v | ) |
Copy Constructor. Create a positionVector with the same elements as other positionVector.
[in] | v | The vector to copy |
Definition at line 53 of file PositionVector.cpp.
PositionVector::PositionVector | ( | const std::vector< Position >::const_iterator | beg, |
const std::vector< Position >::const_iterator | end | ||
) |
Parameter Constructor. Create a positionVector using a part of other positionVector.
[in] | beg | The begin iterator for copy |
[in] | end | The end iterator to copy |
Definition at line 58 of file PositionVector.cpp.
Parameter Constructor used for lines.
[in] | p1 | the first position |
[in] | p2 | the second position |
Definition at line 63 of file PositionVector.cpp.
PositionVector::~PositionVector | ( | ) |
Destructor.
Definition at line 69 of file PositionVector.cpp.
void PositionVector::add | ( | const Position & | offset | ) |
Definition at line 647 of file PositionVector.cpp.
References add(), Position::x(), Position::y(), and Position::z().
void PositionVector::add | ( | double | xoff, |
double | yoff, | ||
double | zoff | ||
) |
Definition at line 625 of file PositionVector.cpp.
Referenced by add(), GNEMoveElement::commitMove(), computeSameEnd(), NIImporter_OpenDrive::computeShapes(), GNEGeometry::drawDottedSquaredShape(), NIImporter_OpenDrive::geomFromSpiral(), getOrthogonal(), GNEGeometry::getVertexCircleAroundPosition(), NBEdge::init(), NIImporter_OpenDrive::loadNetwork(), GeomHelper::makeCircle(), GeomHelper::makeRing(), GNEMoveElement::moveElement(), operator+(), operator-(), NBDistrict::reshiftPosition(), NBEdge::reshiftPosition(), NBNode::reshiftPosition(), GUIPolygon::setShape(), PolygonDynamics::update(), GNEEdge::updateJunctionPosition(), NWWriter_OpenDrive::writeGeomPP3(), and NWWriter_OpenDrive::writeGeomSmooth().
PositionVector PositionVector::added | ( | const Position & | offset | ) | const |
Definition at line 653 of file PositionVector.cpp.
double PositionVector::angleAt2D | ( | int | pos | ) | const |
get angle in certain position of position vector
Definition at line 1229 of file PositionVector.cpp.
References INVALID_DOUBLE.
Referenced by NBNodeShapeComputer::badIntersection(), NBNode::bezierControlPoints(), NBEdge::buildInnerEdges(), NBEdge::checkGeometry(), GUIVehicle::drawRouteHelper(), NBEdge::getAngleAtNode(), NBContHelper::edge_opposite_direction_sorter::getEdgeAngleAt(), NBNodeShapeComputer::getSmoothCorner(), NBNodeShapeComputer::joinSameDirectionEdges(), MSLane::incoming_lane_priority_sorter::operator()(), MSLane::outgoing_lane_priority_sorter::operator()(), NWWriter_OpenDrive::writeGeomLines(), NWWriter_OpenDrive::writeGeomPP3(), and NWWriter_OpenDrive::writeRoadObjects().
void PositionVector::append | ( | const PositionVector & | v, |
double | sameThreshold = 2.0 |
||
) |
Definition at line 704 of file PositionVector.cpp.
Referenced by NBEdge::append(), libsumo::Helper::applySubscriptionFilterLateralDistanceSinglePass(), NBNode::buildWalkingAreas(), NBEdgeCont::checkOverlap(), NBNode::computeInternalLaneShape(), NBNodeShapeComputer::computeNodeShapeDefault(), NBEdgeCont::formFactor(), MSVehicle::getBoundingBox(), MSTransportable::getBoundingBox(), NIImporter_OpenDrive::loadNetwork(), NBRequest::oppositeLeftTurnConflict(), GNENet::replaceJunctionByGeometry(), and GNEConnection::updateGeometry().
double PositionVector::area | ( | ) | const |
Returns the area (0 for non-closed)
Definition at line 518 of file PositionVector.cpp.
References isClosed().
Referenced by GNEJunction::drawGL(), NBEdgeCont::formFactor(), getCentroid(), and GNEGeometry::Lane2laneConnection::updateLane2laneConnection().
|
virtual |
Returns the information whether the position vector describes a polygon lying around the given point.
Implements AbstractPoly.
Definition at line 73 of file PositionVector.cpp.
References GeomHelper::angle2D(), around(), M_PI, scaleAbsolute(), Position::x(), and Position::y().
Referenced by around(), NBEdge::computeAngle(), NBNode::computeNodeShape(), GNEPoly::drawGL(), GNETAZ::drawGL(), GNEJunction::drawGL(), NBNode::getCenter(), getOverlapWith(), and NIVissimTL::NIVissimTLSignal::isWithin().
double PositionVector::beginEndAngle | ( | ) | const |
returns the angle in radians of the line connecting the first and the last position
Definition at line 816 of file PositionVector.cpp.
References INVALID_DOUBLE.
Referenced by NBEdge::cutAtIntersection(), NIVissimEdge::dict_checkEdges2Join(), NIVissimConnectionCluster::getIncomingContinuation(), NIVissimConnectionCluster::getIncomingContinuationGeometry(), NIVissimConnectionCluster::getOutgoingContinuation(), NIVissimConnectionCluster::getOutgoingContinuationGeometry(), NIVissimConnectionCluster::isWeakDistrictConnRealisation(), NIVissimConnectionCluster::same_direction_sorter::operator()(), GUILane::setFunctionalColor(), and GNELane::setFunctionalColor().
PositionVector PositionVector::bezier | ( | int | numPoints | ) |
return a bezier interpolation
Definition at line 1701 of file PositionVector.cpp.
References ISNAN(), and Position::x().
Referenced by NBNode::computeSmoothShape(), GNEEdge::smoothShape(), NWWriter_OpenDrive::writeGeomSmooth(), and NWWriter_OpenDrive::writeInternalEdge().
void PositionVector::closePolygon | ( | ) |
ensures that the last position equals the first
Definition at line 1239 of file PositionVector.cpp.
Referenced by GNEPoly::closePolygon(), GNEGeometry::DottedGeometry::DottedGeometry(), GUIJunctionWrapper::drawGL(), GNEJunction::drawGL(), NBNode::getCenter(), NLHandler::openJunction(), NIVissimSingleTypeParser_Knotendefinition::parse(), NIXMLNodesHandler::processNodeType(), GNETAZ::removeGeometryPoint(), GNEPoly::setAttribute(), GNEPolygonFrame::shapeDrawed(), GNETAZFrame::shapeDrawed(), NBEdge::startShapeAt(), and GNEGeometry::DottedGeometry::updateDottedGeometry().
Returns whether the AbstractPoly crosses the given line.
Implements AbstractPoly.
Definition at line 554 of file PositionVector.cpp.
References intersects().
double PositionVector::distance2D | ( | const Position & | p, |
bool | perpendicular = false |
||
) | const |
closest 2D-distance to point p (or -1 if perpendicular is true and the point is beyond this vector)
Definition at line 1267 of file PositionVector.cpp.
References Position::distanceTo2D(), GeomHelper::INVALID_OFFSET, nearest_offset_to_point2D(), and positionAtOffset2D().
Referenced by LaneStoringVisitor::add(), libsumo::Helper::applySubscriptionFilterLateralDistanceSinglePass(), NBNodeShapeComputer::badIntersection(), GNEViewNetHelper::MoveSingleElementValues::calculateMoveOperationShape(), NWWriter_OpenDrive::checkLaneGeometries(), NBEdge::computeAngle(), NBNode::computeNodeShape(), libsumo::Helper::convertCartesianToRoadMap(), distances(), GNEGeometry::drawMovingHint(), libsumo::Helper::findCloserLane(), NBPTLineCont::findWay(), NBNode::getCenter(), RORouteHandler::getClosestEdge(), getOverlapWith(), NBEdgeCont::joinTramEdges(), LIBSUMO_NAMESPACE::Person::moveToXY(), LIBSUMO_NAMESPACE::Vehicle::moveToXY(), libsumo::Helper::moveToXYMap(), NBPTLine::replaceEdge(), NBEdge::shiftPositionAtNode(), transformToVectorCoordinates(), and NWWriter_OpenDrive::writeRoadObjects().
std::vector< double > PositionVector::distances | ( | const PositionVector & | s, |
bool | perpendicular = false |
||
) | const |
distances of all my points to s and all of s points to myself
Definition at line 1247 of file PositionVector.cpp.
References distance2D(), and GeomHelper::INVALID_OFFSET.
Referenced by NBNodeShapeComputer::badIntersection(), MSLink::computeDistToDivergence(), NBEdgeCont::guessOpposites(), and NBEdge::isNearEnough2BeJoined2().
void PositionVector::extrapolate | ( | const double | val, |
const bool | onlyFirst = false , |
||
const bool | onlyLast = false |
||
) |
extrapolate position vector
Definition at line 1050 of file PositionVector.cpp.
References Position::add(), Position::distanceTo(), and Position::sub().
Referenced by NBNode::buildCrossings(), NBEdge::buildInnerEdges(), GUILane::debugDrawFoeIntersections(), GUILane::drawLinkNo(), GUILane::drawLinkRules(), GUILane::drawTLSLinkNo(), GNECrossing::drawTLSLinkNo(), NBEdge::extendGeometryAtNode(), NIVissimAbstractEdge::getGeomPosition(), MSPModel_Striping::initWalkingAreaPaths(), transformToVectorCoordinates(), and GNEConnection::updateGeometry().
void PositionVector::extrapolate2D | ( | const double | val, |
const bool | onlyFirst = false |
||
) |
extrapolate position vector in two dimensions (Z is ignored)
Definition at line 1072 of file PositionVector.cpp.
References Position::add(), Position::distanceTo2D(), and Position::sub().
Referenced by NBNodeShapeComputer::badIntersection(), NBNode::bezierControlPoints(), NBNodeShapeComputer::computeNodeShapeSmall(), computeSameEnd(), getOrthogonal(), move2side(), libsumo::Helper::moveToXYMap(), NBEdge::setNodeBorder(), and NBEdge::startShapeAt().
Boundary PositionVector::getBoxBoundary | ( | ) | const |
Returns a boundary enclosing this list of lines.
Definition at line 389 of file PositionVector.cpp.
References Boundary::add().
Referenced by libsumo::Polygon::add(), PCPolyContainer::add(), NBHeightMapper::addTriangle(), GUIPolygon::checkDraw(), NBEdgeCont::checkOverlap(), libsumo::Helper::collectObjectsInRange(), MSLane::fill(), GUIBusStop::getCenteringBoundary(), GUIChargingStation::getCenteringBoundary(), GUIContainerStop::getCenteringBoundary(), GUIOverheadWire::getCenteringBoundary(), GUIOverheadWireClamp::getCenteringBoundary(), GNETAZ::getCenteringBoundary(), GNEPersonStop::getCenteringBoundary(), GNEStop::getCenteringBoundary(), GUIPolygon::getCenteringBoundary(), GUIJunctionWrapper::GUIJunctionWrapper(), GUIParkingArea::GUIParkingArea(), NBEdgeCont::ignoreFilterMatch(), NIImporter_OpenDrive::loadNetwork(), GUIE2Collector::MyWrapper::MyWrapper(), GNEViewNetHelper::SelectingArea::processShapeSelection(), NIVissimConnectionCluster::recomputeBoundary(), libsumo::Polygon::remove(), GNETAZFrame::shapeDrawed(), GNEPoly::simplifyShape(), GNEAccess::updateCenteringBoundary(), GNECalibrator::updateCenteringBoundary(), GNEDetector::updateCenteringBoundary(), GNEDetectorE3::updateCenteringBoundary(), GNEPoly::updateCenteringBoundary(), GNERerouter::updateCenteringBoundary(), GNERouteProbe::updateCenteringBoundary(), GNEStoppingPlace::updateCenteringBoundary(), GNEVaporizer::updateCenteringBoundary(), GNEVariableSpeedSign::updateCenteringBoundary(), GNEConnection::updateCenteringBoundary(), GNEInternalLane::updateCenteringBoundary(), GNEJunction::updateCenteringBoundary(), GNELane::updateCenteringBoundary(), and GNEVariableSpeedSignSymbol::updateGeometry().
Position PositionVector::getCentroid | ( | ) | const |
Returns the centroid (closes the polygon if unclosed)
Definition at line 413 of file PositionVector.cpp.
References area(), Position::INVALID, isClosed(), length(), and sub().
Referenced by NBEdge::computeAngle(), GUILane::drawLane2LaneConnections(), GNETAZ::getPositionInView(), scaleAbsolute(), scaleRelative(), and GUIPolygon::setShape().
Position PositionVector::getLineCenter | ( | ) | const |
get line center
Definition at line 482 of file PositionVector.cpp.
References length(), and positionAtOffset().
Referenced by GNEBusStop::drawConnectionAccess(), GUIBusStop::GUIBusStop(), GUIChargingStation::GUIChargingStation(), GUIContainerStop::GUIContainerStop(), GUIParkingArea::GUIParkingArea(), GNEBusStop::updateGeometry(), GNEChargingStation::updateGeometry(), GNEContainerStop::updateGeometry(), and GNEParkingArea::updateGeometry().
double PositionVector::getMaxGrade | ( | double & | maxJump | ) | const |
Definition at line 1683 of file PositionVector.cpp.
References Position::distanceTo2D(), MAX2(), and Position::z().
Referenced by NBEdgeCont::checkGrade().
PositionVector PositionVector::getOrthogonal | ( | const Position & | p, |
double | extend, | ||
bool | before, | ||
double | length = 1.0 , |
||
double | deg = 90 |
||
) | const |
return orthogonal through p (extending this vector if necessary)
[in] | p | The point through which to draw the orthogonal |
[in] | extend | how long to extend this vector for finding an orthogonal |
[in] | front | Whether to take the segment before or after the base point in case of ambiguity |
[in] | length | the length of the orthogonal |
[in] | deg | the rotation angle relative to the shape direction |
Definition at line 1551 of file PositionVector.cpp.
References add(), DEG2RAD, extrapolate2D(), getSubpart2D(), indexOfClosest(), GeomHelper::INVALID_OFFSET, length(), nearest_offset_to_point2D(), offsetAtIndex2D(), positionAtOffset2D(), and rotate2D().
Referenced by NBNode::computeInternalLaneShape(), GUILane::debugDrawFoeIntersections(), NBEdge::setNodeBorder(), and GNEConnection::updateGeometry().
double PositionVector::getOverlapWith | ( | const PositionVector & | poly, |
double | zThreshold | ||
) | const |
Returns the maximum overlaps between this and the given polygon (when not separated by at least zThreshold)
Definition at line 130 of file PositionVector.cpp.
References around(), distance2D(), MAX2(), nearest_offset_to_point2D(), positionAtOffset2D(), and Position::z().
Referenced by NBEdgeCont::checkOverlap().
Position PositionVector::getPolygonCenter | ( | ) | const |
Returns the arithmetic of all corner points.
Definition at line 399 of file PositionVector.cpp.
References Position::x(), Position::y(), and Position::z().
Referenced by NIVissimNodeCluster::buildNBNode(), NIVissimDistrictConnection::dict_BuildDistrictNodes(), GUIPolygon::drawInnerPolygon(), NBNode::getCenter(), and NWWriter_OpenDrive::writeRoadObjects().
PositionVector PositionVector::getSubpart | ( | double | beginOffset, |
double | endOffset | ||
) | const |
get subpart of a position vector
Definition at line 714 of file PositionVector.cpp.
References length(), positionAtOffset(), and push_back_noDoublePos().
Referenced by NBNode::computeInternalLaneShape(), NBEdge::cutAtIntersection(), GUIOverheadWire::drawGL(), NBNodeShapeComputer::getSmoothCorner(), GUIBusStop::GUIBusStop(), GUIChargingStation::GUIChargingStation(), GUIContainerStop::GUIContainerStop(), GUIOverheadWire::GUIOverheadWire(), NBEdgeCont::joinTramEdges(), MSParkingArea::MSParkingArea(), GUIE2Collector::MyWrapper::MyWrapper(), and NWWriter_SUMO::writeLane().
PositionVector PositionVector::getSubpart2D | ( | double | beginOffset, |
double | endOffset | ||
) | const |
get subpart of a position vector in two dimensions (Z is ignored)
Definition at line 754 of file PositionVector.cpp.
References length2D(), positionAtOffset2D(), PositionVector(), and push_back_noDoublePos().
Referenced by NBNodeShapeComputer::badIntersection(), computeSameEnd(), NBEdge::extendGeometryAtNode(), NIImporter_OpenDrive::geomFromArc(), NIImporter_OpenDrive::geomFromParamPoly(), NIImporter_OpenDrive::geomFromPoly(), NIImporter_OpenDrive::geomFromSpiral(), getOrthogonal(), NBNodeShapeComputer::getSmoothCorner(), NIImporter_OpenDrive::loadNetwork(), NBEdge::shortenGeometryAtNode(), NBEdge::startShapeAt(), and NWWriter_OpenDrive::writeRoadObjects().
PositionVector PositionVector::getSubpartByIndex | ( | int | beginIndex, |
int | count | ||
) | const |
get subpart of a position vector using index and a cout
Definition at line 797 of file PositionVector.cpp.
References PositionVector().
Referenced by NBNode::buildWalkingAreas(), NBNodeShapeComputer::computeNodeShapeSmall(), NBEdge::getInnerGeometry(), NBEdge::startShapeAt(), and NWWriter_OpenDrive::writeRoadObjects().
bool PositionVector::hasElevation | ( | ) | const |
return whether two positions differ in z-coordinate
Definition at line 1413 of file PositionVector.cpp.
Referenced by NBEdge::computeEdgeShape().
int PositionVector::indexOfClosest | ( | const Position & | p | ) | const |
index of the closest position to p
Definition at line 948 of file PositionVector.cpp.
References Position::distanceTo().
Referenced by NBPTStopCont::computeCrossProductEdgePosition(), NIImporter_OpenDrive::computeShapes(), GNEPoly::deleteGeometryPoint(), GNEEdge::editEndpoint(), GNEPoly::getMoveOperation(), GNETAZ::getMoveOperation(), GNEConnection::getMoveOperation(), GNECrossing::getMoveOperation(), GNEEdge::getMoveOperation(), GNEJunction::getMoveOperation(), getOrthogonal(), GNEEdge::getSplitPos(), GNEPoly::getVertexIndex(), GNEPoly::removeGeometryPoint(), GNETAZ::removeGeometryPoint(), GNEConnection::removeGeometryPoint(), GNECrossing::removeGeometryPoint(), GNEEdge::removeGeometryPoint(), GNEJunction::removeGeometryPoint(), smoothedZFront(), and GUILane::splitAtSegments().
void PositionVector::insert_noDoublePos | ( | const std::vector< Position >::iterator & | at, |
const Position & | p | ||
) |
insert in front a non double position
Definition at line 1319 of file PositionVector.cpp.
References Position::almostSame(), push_back_noDoublePos(), and push_front_noDoublePos().
int PositionVector::insertAtClosest | ( | const Position & | p, |
bool | interpolateZ | ||
) |
inserts p between the two closest positions
p | position to be inserted |
interpolateZ | flag to enable/disable interpolation of Z Value between the two closest positions |
Definition at line 967 of file PositionVector.cpp.
References Position::distanceTo2D(), interpolateZ(), length(), GeomHelper::nearest_offset_on_line_to_point2D(), positionAtOffset2D(), Position::x(), and Position::y().
Referenced by NIImporter_OpenDrive::computeShapes(), GNEPoly::getMoveOperation(), GNETAZ::getMoveOperation(), GNEConnection::getMoveOperation(), GNECrossing::getMoveOperation(), GNEEdge::getMoveOperation(), GNEJunction::getMoveOperation(), smoothedZFront(), GUILane::splitAtSegments(), and NWWriter_OpenDrive::writeGeomSmooth().
PositionVector PositionVector::interpolateZ | ( | double | zStart, |
double | zEnd | ||
) | const |
returned vector that varies z smoothly over its length
Definition at line 1628 of file PositionVector.cpp.
References length(), and length2D().
Referenced by NBNodeShapeComputer::getSmoothCorner(), insertAtClosest(), and GNEEdge::straightenElevation().
Position PositionVector::intersectionPosition2D | ( | const Position & | p1, |
const Position & | p2, | ||
const double | withinDist = 0. |
||
) | const |
Returns the position of the intersection.
Definition at line 186 of file PositionVector.cpp.
References intersects(), and Position::INVALID.
Referenced by NBNodeShapeComputer::badIntersection(), NBNode::bezierControlPoints(), NBNodeShapeComputer::computeNodeShapeSmall(), NIVissimAbstractEdge::crossesEdgeAtPoint(), GeomHelper::crossPoint(), intersectionPosition2D(), and move2side().
Position PositionVector::intersectionPosition2D | ( | const PositionVector & | v1 | ) | const |
Returns the position of the intersection.
Definition at line 198 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 158 of file PositionVector.cpp.
Referenced by NGRandomNetBuilder::canConnect(), NBNodeShapeComputer::computeNodeShapeDefault(), NBNodeShapeComputer::computeNodeShapeSmall(), computeSameEnd(), Boundary::crosses(), crosses(), NIVissimAbstractEdge::crossesEdge(), GeomHelper::crossPoint(), NBEdgeCont::ignoreFilterMatch(), MSInternalJunction::indirectBicycleTurn(), intersectionPosition2D(), intersects(), intersectsAtLengths2D(), NIVissimConnectionCluster::isWeakDistrictConnRealisation(), and NBEdge::startShapeAt().
|
staticprivate |
return whether the line segments defined by Line p11,p12 and Line p21,p22 intersect
Definition at line 1427 of file PositionVector.cpp.
References Position::distanceTo2D(), Position::x(), and Position::y().
bool PositionVector::intersects | ( | const PositionVector & | v1 | ) | const |
Returns the information whether this list of points interesects one the given lines.
Definition at line 172 of file PositionVector.cpp.
References intersects().
std::vector< double > 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 1030 of file PositionVector.cpp.
References Position::distanceTo2D(), and intersects().
std::vector< double > 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 1016 of file PositionVector.cpp.
Referenced by NBNodeShapeComputer::closestIntersection(), NBNodeShapeComputer::computeNodeShapeDefault(), computeSameEnd(), MSLink::contIntersect(), NBEdge::firstIntersection(), MSLink::setRequestInformation(), and NBEdge::startShapeAt().
bool PositionVector::isClosed | ( | ) | const |
check if PositionVector is closed
Definition at line 1333 of file PositionVector.cpp.
Referenced by area(), GNEPoly::changeFirstGeometryPoint(), GNEPoly::closePolygon(), GNEPoly::deleteGeometryPoint(), GNEGeometry::drawGeometryPoints(), GNEPoly::drawGL(), GNETAZ::drawGL(), GNEPoly::getAttribute(), getCentroid(), GNEPoly::getMoveOperation(), GNETAZ::getMoveOperation(), GNEPoly::getPopUpMenu(), GNEPoly::isPolygonClosed(), GNEPoly::openPolygon(), and GNEPoly::simplifyShape().
double PositionVector::isLeft | ( | const Position & | P0, |
const Position & | P1, | ||
const Position & | P2 | ||
) | const |
get left
Definition at line 698 of file PositionVector.cpp.
References Position::x(), and Position::y().
Referenced by transformToVectorCoordinates().
bool PositionVector::isNAN | ( | ) | const |
check if PositionVector is NAN
Definition at line 1339 of file PositionVector.cpp.
Referenced by NBNode::buildCrossings().
double PositionVector::length | ( | ) | const |
Returns the length.
Definition at line 492 of file PositionVector.cpp.
Referenced by NIXMLEdgesHandler::addSplit(), GNEGeometry::adjustStartPosGeometricPath(), libsumo::Helper::applySubscriptionFilterLateralDistanceSinglePass(), NBEdge::assignInternalLaneLength(), NBNodeShapeComputer::badIntersection(), NBEdge::buildInnerEdges(), GNETLSEditorFrame::buildInternalLanes(), NBRampsComputer::buildOffRamp(), NBRampsComputer::buildOnRamp(), NGRandomNetBuilder::canConnect(), NBEdge::computeAngle(), NBNode::computeInternalLaneShape(), GNEGeometry::HierarchicalConnections::ConnectionGeometry::ConnectionGeometry(), NBEdge::cutAtIntersection(), GUILane::debugDrawFoeIntersections(), NIVissimEdge::dict_checkEdges2Join(), GNEGenericData::drawAttribute(), GUIVehicle::drawBestLanes(), GNEEdge::drawEdgeName(), GUIEdge::drawGL(), libsumo::Helper::findCloserLane(), NBEdge::firstIntersection(), getCentroid(), GNELane::getColorValue(), NBEdge::getFinalLength(), NIVissimAbstractEdge::getGeomPosition(), NWWriter_DlrNavteq::getGraphLength(), GNELane::getLaneShapeLength(), NBEdge::Connection::getLength(), NIVissimEdge::getLength(), GNELane::getLengthGeometryFactor(), getLineCenter(), getOrthogonal(), GNEPerson::getPositionInView(), NBEdge::getShapeEndAngle(), NBNodeShapeComputer::getSmoothCorner(), getSubpart(), NIVissimEdge::getToNode(), GUIBusStop::GUIBusStop(), GUIChargingStation::GUIChargingStation(), GUIContainerStop::GUIContainerStop(), GUILane::GUILane(), GUIOverheadWire::GUIOverheadWire(), GUIParkingArea::GUIParkingArea(), GUITriggeredRerouter::GUITriggeredRerouterEdge::GUITriggeredRerouterEdge(), NBEdge::haveIntersection(), insertAtClosest(), interpolateZ(), GNECalibrator::isValid(), NBEdgeCont::joinTramEdges(), NIVissimConnectionCluster::liesOnSameEdgesEnd(), NIImporter_Vissim::NIVissimXMLHandler_Streckendefinition::myEndElement(), NIImporter_OpenStreetMap::RelationHandler::myEndElement(), GUIE2Collector::MyWrapper::MyWrapper(), operator+(), operator-(), NBRequest::oppositeLeftTurnConflict(), NBEdgeCont::processSplits(), resample(), NIVissimEdge::resolveSameNode(), rotationAtOffset(), splitAt(), NBEdgeCont::splitAt(), GNEVehicle::updateGeometry(), GNEConnection::updateGeometry(), GNEGeometry::Geometry::updateGeometry(), and NWWriter_SUMO::writeLane().
double PositionVector::length2D | ( | ) | const |
Returns the length.
Definition at line 505 of file PositionVector.cpp.
Referenced by NBEdge::buildInnerEdges(), GNEAdditional::calculatePerpendicularLine(), NBEdge::computeAngle(), MSLink::computeDistToDivergence(), NBEdge::computeEdgeShape(), NBNode::computeInternalLaneShape(), NBNodeShapeComputer::computeNodeShapeDefault(), computeSameEnd(), GNENet::createRoundabout(), GNEAdditional::drawAdditionalID(), GNEAdditional::drawAdditionalName(), GNEGenericData::drawAttribute(), GNEDetector::drawDetectorLogo(), GNEGenericData::drawFilteredAttribute(), GNEStoppingPlace::drawLines(), GNEViewNetHelper::LockIcon::drawLockIcon(), GNEStoppingPlace::drawSign(), NBEdge::extendGeometryAtNode(), NBEdgeCont::formFactor(), NBEdge::getShapeEndAngle(), NBEdge::getShapeStartAngle(), NBNodeShapeComputer::getSmoothCorner(), getSubpart2D(), interpolateZ(), NIImporter_OpenDrive::loadNetwork(), move2side(), NBContHelper::relative_outgoing_edge_sorter::operator()(), NBContHelper::relative_incoming_edge_sorter::operator()(), NIImporter_OpenStreetMap::reconstructLayerElevation(), resample(), NBEdge::shortenGeometryAtNode(), smoothedZFront(), GNEEdge::smoothElevation(), GNEEdge::smoothShape(), splitAt(), MSLaneChangerSublane::startChangeSublane(), NBEdge::startShapeAt(), NWWriter_OpenDrive::writeGeomSmooth(), NWWriter_OpenDrive::writeInternalEdge(), and NWWriter_OpenDrive::writeRoadObjects().
void PositionVector::mirrorX | ( | ) |
Definition at line 663 of file PositionVector.cpp.
Referenced by NBDistrict::mirrorX(), NBEdge::mirrorX(), NBNode::mirrorX(), and GNEEdge::setGeometry().
void PositionVector::move2side | ( | double | amount, |
double | maxExtension = 100 |
||
) |
move position vector to side using certain ammount
Definition at line 1111 of file PositionVector.cpp.
References Position::distanceTo2D(), extrapolate2D(), intersectionPosition2D(), Position::INVALID, length2D(), removeDoublePoints(), sideOffset(), and Position::z().
Referenced by NBEdge::addRestrictedLane(), GNENet::addReversedEdge(), libsumo::Helper::applySubscriptionFilterLateralDistanceSinglePass(), NBNodeShapeComputer::badIntersection(), NBNode::buildCrossings(), GNETLSEditorFrame::buildInternalLanes(), NBNode::buildWalkingAreas(), GNEAdditional::calculatePerpendicularLine(), NBEdge::computeAngle(), NBEdge::computeLaneShape(), NBNode::displaceShapeAtWidthChange(), GUIVehicle::drawBestLanes(), GUILane::drawGL(), GNEConnection::drawGL(), GNELane::drawLaneAsRailway(), GNEViewNet::drawTemporalJunction(), NBEdge::firstIntersection(), GNEEdge::getBackDownShapePosition(), GNEEdge::getBackUpShapePosition(), MSVehicle::getBoundingBox(), MSTransportable::getBoundingBox(), MSVehicle::getBoundingPoly(), NBEdge::getCCWBoundaryLine(), NBEdge::getCWBoundaryLine(), GNEEdge::getFrontDownShapePosition(), GNEEdge::getFrontUpShapePosition(), NWWriter_OpenDrive::getLeftLaneBorder(), MSVehicle::getPosition(), GUIBusStop::GUIBusStop(), GUIChargingStation::GUIChargingStation(), GUIContainerStop::GUIContainerStop(), GUIOverheadWire::GUIOverheadWire(), GUIParkingArea::GUIParkingArea(), NIImporter_OpenDrive::loadNetwork(), NBRampsComputer::moveRampRight(), LIBSUMO_NAMESPACE::Person::moveToXY(), LIBSUMO_NAMESPACE::Vehicle::moveToXY(), MSLink::MSLink(), MSParkingArea::MSParkingArea(), NBRampsComputer::patchRampGeometry(), NBEdgeCont::processSplits(), GNEStoppingPlace::setStoppingPlaceGeometry(), NBEdge::shiftPositionAtNode(), NGNet::toNB(), GNEBusStop::updateGeometry(), GNEChargingStation::updateGeometry(), GNEContainerStop::updateGeometry(), GNEParkingArea::updateGeometry(), NBSign::writeAsPOI(), NWWriter_DlrNavteq::writeNodesUnsplitted(), and NWWriter_OpenDrive::writeRoadObjects().
void PositionVector::move2side | ( | std::vector< double > | amount, |
double | maxExtension = 100 |
||
) |
move position vector to side using a custom offset for each geometry point
Definition at line 1169 of file PositionVector.cpp.
References Position::distanceTo2D(), extrapolate2D(), intersectionPosition2D(), Position::INVALID, length2D(), sideOffset(), toString(), and Position::z().
double PositionVector::nearest_offset_to_point25D | ( | const Position & | p, |
bool | perpendicular = true |
||
) | const |
return the nearest offest to point 2D projected onto the 3D geometry
Definition at line 861 of file PositionVector.cpp.
References Position::distanceTo2D(), INVALID_DOUBLE, GeomHelper::INVALID_OFFSET, GeomHelper::nearest_offset_on_line_to_point2D(), and positionAtOffset2D().
Referenced by GUILane::getPopUpMenu(), and libsumo::Helper::moveToXYMap().
double PositionVector::nearest_offset_to_point2D | ( | const Position & | p, |
bool | perpendicular = true |
||
) | const |
return the nearest offest to point 2D
Definition at line 825 of file PositionVector.cpp.
References Position::distanceTo2D(), INVALID_DOUBLE, GeomHelper::INVALID_OFFSET, GeomHelper::nearest_offset_on_line_to_point2D(), and positionAtOffset2D().
Referenced by GNEAdditionalFrame::E2MultilaneLaneSelector::addLane(), MSParkingArea::addLotEntry(), GNEAdditionalFrame::SelectorParentLanes::addSelectedLane(), NBNode::bezierControlPoints(), GNEAdditionalFrame::buildAdditionalOverLane(), GNEViewNetHelper::MoveMultipleElementValues::calculateEdgeSelection(), GNEMoveElement::calculateMovementOverLane(), GNEViewNetHelper::MoveSingleElementValues::calculateMoveOperationShape(), NBPTStopCont::computeCrossProductEdgePosition(), distance2D(), GNEGeometry::drawGeometry(), GNEGeometry::drawLaneGeometry(), GNEGeometry::drawMovingHint(), GNEGeometry::drawSegmentGeometry(), GNEEdge::editEndpoint(), NBEdge::extendGeometryAtNode(), NBPTStop::findLaneAndComputeBusStopExtent(), GNEFrameAttributesModuls::NeteditAttributes::getNeteditAttributesAndValues(), getOrthogonal(), getOverlapWith(), GNEAdditional::getPopUpMenu(), GNELane::getPopUpMenu(), GUIEdge::getSegmentAtPosition(), NBNodeShapeComputer::getSmoothCorner(), GNEEdge::getSplitPos(), NBEdgeCont::joinTramEdges(), GNEPersonTrip::moveGeometry(), GNERide::moveGeometry(), GNEWalk::moveGeometry(), libsumo::Helper::moveToXYMap(), GNEViewNet::onCmdTransformPOI(), GNEPolygonFrame::processClick(), NBEdgeCont::splitAt(), GNENet::splitEdge(), and NWWriter_OpenDrive::writeRoadObjects().
double PositionVector::offsetAtIndex2D | ( | int | index | ) | const |
return the offset at the given index
Definition at line 1670 of file PositionVector.cpp.
References GeomHelper::INVALID_OFFSET.
Referenced by NBPTStopCont::computeCrossProductEdgePosition(), getOrthogonal(), and smoothedZFront().
bool PositionVector::operator!= | ( | const PositionVector & | v2 | ) | const |
comparing operation
Definition at line 1380 of file PositionVector.cpp.
PositionVector PositionVector::operator+ | ( | const PositionVector & | v2 | ) | const |
adds two vectors (requires vectors of the same length)
Definition at line 1399 of file PositionVector.cpp.
References add(), length(), and WRITE_ERROR.
PositionVector PositionVector::operator- | ( | const PositionVector & | v2 | ) | const |
substracts two vectors (requires vectors of the same length)
Definition at line 1385 of file PositionVector.cpp.
References add(), length(), and WRITE_ERROR.
bool PositionVector::operator== | ( | const PositionVector & | v2 | ) | const |
comparing operation
Definition at line 1374 of file PositionVector.cpp.
Position & PositionVector::operator[] | ( | int | index | ) |
returns the position at the given index
Definition at line 228 of file PositionVector.cpp.
const Position & PositionVector::operator[] | ( | int | index | ) | const |
returns the constat position at the given index @ToDo !!! exceptions?
Definition at line 209 of file PositionVector.cpp.
|
virtual |
Returns the information whether the given polygon overlaps with this.
Implements AbstractPoly.
Definition at line 107 of file PositionVector.cpp.
References AbstractPoly::crosses(), partialWithin(), and AbstractPoly::partialWithin().
Referenced by MSLane::detectCollisions(), MSLane::detectPedestrianJunctionCollision(), and NIVissimAbstractEdge::overlapsWith().
|
virtual |
Returns the information whether this polygon lies partially within the given polygon.
Implements AbstractPoly.
Definition at line 540 of file PositionVector.cpp.
References AbstractPoly::around().
Referenced by NBEdgeCont::ignoreFilterMatch(), and overlapsWith().
void PositionVector::pop_front | ( | ) |
pop first Position
Definition at line 1293 of file PositionVector.cpp.
Referenced by GNEEdge::commitMoveShape(), GNEEdge::removeGeometryPoint(), GNEEdge::setMoveShape(), and GNEEdge::setShapeStartPos().
|
static |
Returns the position between the two given point at the specified position.
Definition at line 346 of file PositionVector.cpp.
References Position::distanceTo(), Position::INVALID, and sideOffset().
Position PositionVector::positionAtOffset | ( | double | pos, |
double | lateralOffset = 0 |
||
) | const |
Returns the position at the given length.
Definition at line 247 of file PositionVector.cpp.
References Position::INVALID.
Referenced by NIXMLEdgesHandler::addSplit(), GNETLSEditorFrame::buildInternalLanes(), NBRampsComputer::buildOffRamp(), NBRampsComputer::buildOnRamp(), GNEDemandElement::calculatePersonPlanLaneStartEndPos(), GNEGeometry::HierarchicalConnections::ConnectionGeometry::ConnectionGeometry(), GNEEdge::drawEdgeName(), GUIEdge::drawGL(), GLHelper::drawTriangleAtEnd(), NBEdge::geometryPositionAtOffset(), MSLane::geometryPositionAtOffset(), NIVissimAbstractEdge::getGeomPosition(), MSStage::getLanePosition(), getLineCenter(), GUILane::getPopUpMenu(), MSVehicle::getPosition(), GNEPerson::getPositionInView(), MSVTKExport::getSpeed(), GNEEdge::getSplitPos(), getSubpart(), LIBSUMO_NAMESPACE::InductionLoop::getTree(), GUIBusStop::getWaitPosition(), MSStoppingPlace::getWaitPosition(), GUICalibrator::GUICalibrator(), GUILaneSpeedTrigger::GUILaneSpeedTrigger(), NIImporter_OpenDrive::loadNetwork(), MSParkingArea::MSParkingArea(), GNEViewNet::onCmdTransformPOI(), NIImporter_VISUM::parse_Lanes(), splitAt(), GUILane::splitAtSegments(), LIBSUMO_NAMESPACE::InductionLoop::storeShape(), transformToVectorCoordinates(), GNEConnection::updateGeometry(), GNELane::updateGeometry(), GNEGeometry::Geometry::updateGeometry(), and NBSign::writeAsPOI().
|
static |
Returns the position between the two given point at the specified position.
Definition at line 369 of file PositionVector.cpp.
References Position::distanceTo2D(), Position::INVALID, and sideOffset().
Position PositionVector::positionAtOffset2D | ( | double | pos, |
double | lateralOffset = 0 |
||
) | const |
Returns the position at the given length.
Definition at line 272 of file PositionVector.cpp.
References Position::INVALID.
Referenced by NBNode::bezierControlPoints(), GNEMoveElement::calculateMovementOverLane(), GNEAdditional::calculatePerpendicularLine(), NGRandomNetBuilder::canConnect(), NBEdge::computeAngle(), NBNodeShapeComputer::computeNodeShapeDefault(), computeSameEnd(), GUIBaseVehicle::computeSeats(), NIImporter_OpenDrive::computeShapes(), distance2D(), GNEAdditional::drawAdditionalID(), GNEAdditional::drawAdditionalName(), GNEGenericData::drawAttribute(), GNEDetector::drawDetectorLogo(), GNEGenericData::drawFilteredAttribute(), GNEGeometry::drawGeometry(), GNEGeometry::drawLaneGeometry(), GNEViewNetHelper::LockIcon::drawLockIcon(), GNEGeometry::drawMovingHint(), GNEGeometry::drawSegmentGeometry(), GNEEdge::editEndpoint(), GNEPoly::getMoveOperation(), GNETAZ::getMoveOperation(), GNEConnection::getMoveOperation(), GNECrossing::getMoveOperation(), GNEEdge::getMoveOperation(), GNEJunction::getMoveOperation(), getOrthogonal(), getOverlapWith(), GNELane::getPopUpMenu(), GUIContainer::getPosition(), MSPModel_NonInteracting::CState::getPosition(), NBEdge::getShapeEndAngle(), NBEdge::getShapeStartAngle(), getSubpart2D(), insertAtClosest(), NBEdgeCont::joinTramEdges(), NIImporter_OpenDrive::loadNetwork(), nearest_offset_to_point25D(), nearest_offset_to_point2D(), NBContHelper::relative_outgoing_edge_sorter::operator()(), NBContHelper::relative_incoming_edge_sorter::operator()(), resample(), smoothedZFront(), GNEEdge::smoothElevation(), GNEEdge::smoothShape(), splitAt(), NBEdge::startShapeAt(), NWWriter_OpenDrive::writeGeomSmooth(), and NWWriter_OpenDrive::writeRoadObjects().
void PositionVector::push_back_noDoublePos | ( | const Position & | p | ) |
insert in back a non double position
Definition at line 1303 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(), insert_noDoublePos(), NIImporter_ArcView::load(), PCLoaderArcView::load(), PCLoaderOSM::loadIfSet(), NIImporter_Vissim::NIVissimXMLHandler_Streckendefinition::myEndElement(), NIVissimAbstractEdge::NIVissimAbstractEdge(), NIVissimSingleTypeParser_Streckendefinition::parse(), NIVissimSingleTypeParser_Verbindungsdefinition::parse(), and GNENet::replaceJunctionByGeometry().
void PositionVector::push_front | ( | const Position & | p | ) |
insert in front a Position
Definition at line 1283 of file PositionVector.cpp.
Referenced by NIXMLEdgesHandler::addLane(), push_front_noDoublePos(), and GNEEdge::setShapeStartPos().
void PositionVector::push_front_noDoublePos | ( | const Position & | p | ) |
insert in front a non double position
Definition at line 1311 of file PositionVector.cpp.
References Position::almostSame(), and push_front().
Referenced by NBNode::buildWalkingAreas(), NBNodeShapeComputer::computeNodeShapeDefault(), NBEdge::getFinalLength(), NWWriter_DlrNavteq::getGraphLength(), NBEdge::init(), insert_noDoublePos(), and NBEdge::startShapeAt().
int PositionVector::removeClosest | ( | const Position & | p | ) |
removes the point closest to p and return the removal index
Definition at line 997 of file PositionVector.cpp.
References Position::distanceTo2D().
Referenced by NWWriter_OpenDrive::writeGeomSmooth().
void PositionVector::removeDoublePoints | ( | double | 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 1352 of file PositionVector.cpp.
Referenced by NIXMLEdgesHandler::addLane(), GNEMoveElement::commitMove(), NIImporter_OpenDrive::computeShapes(), NBEdge::init(), move2side(), NBEdge::reduceGeometry(), and GNEEdge::removeGeometryPoint().
PositionVector PositionVector::resample | ( | double | maxLength, |
const bool | adjustEnd | ||
) | const |
resample shape (i.e. transform to segments, equal spacing)
[in] | maxLength | lenght of every segment |
[in] | adjustEnd | enable or disable adjust end (i.e. result has the same original lenght, last segment could be short) |
Definition at line 1647 of file PositionVector.cpp.
References length(), length2D(), and positionAtOffset2D().
Referenced by GNEEdge::smoothElevation().
PositionVector PositionVector::reverse | ( | ) | const |
reverse position vector
Definition at line 1094 of file PositionVector.cpp.
Referenced by NBRailwayTopologyAnalyzer::addBidiEdge(), GNENet::addReversedEdge(), NBNodeShapeComputer::badIntersection(), GNETLSEditorFrame::buildInternalLanes(), NBNode::buildWalkingAreas(), MSLink::computeDistToDivergence(), NBEdge::computeEdgeShape(), NBNode::computeInternalLaneShape(), NBEdge::computeLaneShapes(), NBEdge::cutAtIntersection(), GUILane::drawLinkNo(), GUILane::drawLinkRules(), GUILane::drawTLSLinkNo(), GNECrossing::drawTLSLinkNo(), MSVehicle::getBoundingBox(), MSTransportable::getBoundingBox(), NBNodeShapeComputer::getSmoothCorner(), MSPModel_Striping::initWalkingAreaPaths(), NIImporter_OpenStreetMap::insertEdge(), NBEdge::isBidiRail(), NIImporter_ArcView::load(), NIImporter_OpenDrive::loadNetwork(), MSPerson::MSPersonStage_Access::MSPersonStage_Access(), NBEdge::NBEdge(), NIImporter_VISUM::parse_AreaSubPartElement(), NBEdge::reduceGeometry(), NIImporter_DlrNavteq::EdgesHandler::report(), and GNENet::reverseEdge().
void PositionVector::rotate2D | ( | double | angle | ) |
Definition at line 1511 of file PositionVector.cpp.
Referenced by GNEGeometry::drawDottedSquaredShape(), NIImporter_OpenDrive::geomFromSpiral(), getOrthogonal(), NIImporter_OpenDrive::loadNetwork(), GUIPolygon::setShape(), PolygonDynamics::update(), and NWWriter_OpenDrive::writeGeomPP3().
double PositionVector::rotationAtOffset | ( | double | pos | ) | const |
Returns the rotation at the given length.
Definition at line 293 of file PositionVector.cpp.
References Position::angleTo2D(), Position::distanceTo(), INVALID_DOUBLE, and length().
Referenced by MSDevice_SSM::classifyEncounter(), MSVehicle::computeAngle(), GNEEdge::drawEdgeName(), GUIEdge::drawGL(), GUIEdge::drawMesoVehicles(), MEVehicle::getAngle(), MSPModel_Striping::PState::getAngle(), NIImporter_OpenDrive::loadNetwork(), LIBSUMO_NAMESPACE::Person::moveToXY(), LIBSUMO_NAMESPACE::Vehicle::moveToXY(), rotationDegreeAtOffset(), MSLaneChangerSublane::startChangeSublane(), and NWWriter_OpenDrive::writeRoadObjects().
double PositionVector::rotationDegreeAtOffset | ( | double | pos | ) | const |
Returns the rotation at the given length.
Definition at line 318 of file PositionVector.cpp.
References GeomHelper::legacyDegree(), and rotationAtOffset().
Referenced by GUIE3Collector::MyWrapper::buildDefinition(), GNEGeometry::HierarchicalConnections::ConnectionGeometry::ConnectionGeometry(), GNEAdditional::drawAdditionalID(), GNEAdditional::drawAdditionalName(), GNEDetector::drawDetectorLogo(), GNEEdge::drawEdgeName(), GNEGenericData::drawFilteredAttribute(), GUIEdge::drawGL(), GNEStoppingPlace::drawLines(), GNEViewNetHelper::LockIcon::drawLockIcon(), GNEStoppingPlace::drawSign(), GUIBusStop::GUIBusStop(), GUICalibrator::GUICalibrator(), GUIChargingStation::GUIChargingStation(), GUIContainerStop::GUIContainerStop(), GUILaneSpeedTrigger::GUILaneSpeedTrigger(), GUIOverheadWire::GUIOverheadWire(), GUIParkingArea::GUIParkingArea(), GUITriggeredRerouter::GUITriggeredRerouterEdge::GUITriggeredRerouterEdge(), GUIInductLoop::MyWrapper::MyWrapper(), GUIInstantInductLoop::MyWrapper::MyWrapper(), GUIMEInductLoop::MyWrapper::MyWrapper(), GNELane::updateGeometry(), and GNEGeometry::Geometry::updateGeometry().
void PositionVector::scaleAbsolute | ( | double | offset | ) |
enlarges/shrinks the polygon by an absolute offset based at the centroid
Definition at line 473 of file PositionVector.cpp.
References getCentroid().
Referenced by around().
void PositionVector::scaleRelative | ( | double | factor | ) |
enlarges/shrinks the polygon by a factor based at the centroid
Definition at line 464 of file PositionVector.cpp.
References getCentroid().
Referenced by GNEGeometry::drawDottedContourClosedShape(), GUIJunctionWrapper::drawGL(), GNEJunction::drawGL(), and MSVehicle::getBoundingPoly().
|
static |
get a side position of position vector using a offset
Definition at line 1104 of file PositionVector.cpp.
References Position::distanceTo2D(), Position::x(), and Position::y().
Referenced by NWWriter_OpenDrive::checkLaneGeometries(), move2side(), positionAtOffset(), and positionAtOffset2D().
PositionVector PositionVector::simplified | ( | ) | const |
return the same shape with intermediate colinear points removed
Definition at line 1526 of file PositionVector.cpp.
References Position::distanceTo2D(), Position::x(), and Position::y().
Referenced by NWWriter_SUMO::writeJunction().
double PositionVector::slopeDegreeAtOffset | ( | double | pos | ) | const |
Returns the slope at the given length.
Definition at line 324 of file PositionVector.cpp.
References Position::distanceTo(), Position::distanceTo2D(), INVALID_DOUBLE, RAD2DEG, and Position::z().
Referenced by MEVehicle::getSlope(), MSVehicle::getSlope(), and LIBSUMO_NAMESPACE::Person::getSlope().
PositionVector PositionVector::smoothedZFront | ( | double | dist = std::numeric_limits<double>::max() | ) | const |
returned vector that is smoothed at the front (within dist)
Definition at line 1596 of file PositionVector.cpp.
References Position::distanceTo2D(), indexOfClosest(), insertAtClosest(), length2D(), MIN2(), offsetAtIndex2D(), and positionAtOffset2D().
Referenced by NBEdge::computeEdgeShape(), and NBNode::computeSmoothShape().
void PositionVector::sortAsPolyCWByAngle | ( | ) |
sort as polygon CW by angle
Definition at line 619 of file PositionVector.cpp.
void PositionVector::sortByIncreasingXY | ( | ) |
sort by increasing X-Y Positions
Definition at line 680 of file PositionVector.cpp.
std::pair< PositionVector, PositionVector > PositionVector::splitAt | ( | double | where, |
bool | use2D = false |
||
) | const |
Returns the two lists made when this list vector is splitted at the given point.
Definition at line 560 of file PositionVector.cpp.
References length(), length2D(), positionAtOffset(), positionAtOffset2D(), toString(), and WRITE_WARNING.
Referenced by libsumo::Helper::applySubscriptionFilterLateralDistanceSinglePass(), NBEdge::buildInnerEdges(), NBNodeShapeComputer::getSmoothCorner(), NBEdgeCont::splitAt(), GNENet::splitEdge(), and GNEGeometry::Geometry::updateGeometry().
void PositionVector::sub | ( | const Position & | offset | ) |
Definition at line 633 of file PositionVector.cpp.
References sub(), Position::x(), Position::y(), and Position::z().
void PositionVector::sub | ( | double | xoff, |
double | yoff, | ||
double | zoff | ||
) |
Definition at line 639 of file PositionVector.cpp.
Referenced by computeSameEnd(), getCentroid(), GUIPolygon::setShape(), and sub().
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 898 of file PositionVector.cpp.
References distance2D(), Position::distanceTo2D(), extrapolate(), Position::INVALID, GeomHelper::INVALID_OFFSET, isLeft(), GeomHelper::nearest_offset_on_line_to_point2D(), positionAtOffset(), and transformToVectorCoordinates().
Referenced by MSParkingArea::addLotEntry(), MSPModel_Striping::getNextLaneObstacles(), MSPModel_Striping::moveInDirection(), and transformToVectorCoordinates().
|
friend |
Definition at line 606 of file PositionVector.cpp.
|
static |
empty Vector
Definition at line 71 of file PositionVector.h.
Referenced by NIImporter_SUMO::addConnection(), NIXMLConnectionsHandler::addCrossing(), NIXMLConnectionsHandler::addWalkingArea(), GNECrossingFrame::CreateCrossing::onCmdCreateCrossing(), NIImporter_DlrNavteq::ConnectedLanesHandler::report(), and GNEEdge::smoothShape().