Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
PositionVector Class Reference

A list of positions. More...

#include <PositionVector.h>

Inheritance diagram for PositionVector:
[legend]
Collaboration diagram for PositionVector:
[legend]

Data Structures

class  as_poly_cw_sorter
 class 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
bool almostSame (const PositionVector &v2, double maxDiv=POSITION_EPS) const
 check if the two vectors have the same length and pairwise similar positions
double angleAt2D (int pos) const
 get angle in certain position of position vector (in radians between -M_PI and M_PI)
void append (const PositionVector &v, double sameThreshold=2.0)
double area () const
 Returns the area (0 for non-closed).
bool around (const Position &p, double offset=0) const
 Returns the information whether the position vector describes a polygon lying around the given point.
double beginEndAngle () const
 returns the angle in radians of the line connecting the first and the last position
PositionVector bezier (int numPoints)
 return a bezier interpolation
void closePolygon ()
 ensures that the last position equals the first
bool crosses (const Position &p1, const Position &p2) const
 Returns whether the AbstractPoly crosses the given line.
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)
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
void ensureMinLength (int precision)
 ensure minimum length so that the geometry will not degenerate to 0-length on writing with the given precision
void extrapolate (const double val, const bool onlyFirst=false, const bool onlyLast=false)
 extrapolate position vector
void extrapolate2D (const double val, const bool onlyFirst=false)
 extrapolate position vector in two dimensions (Z is ignored)
Boundary getBoxBoundary () const
 Returns a boundary enclosing this list of lines.
Position getCentroid () const
 Returns the centroid (closes the polygon if unclosed).
Position getLineCenter () const
 get line center
double getMaxGrade (double &maxJump) const
double getMinZ () const
 return minimum z-coordinate
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)
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).
Position getPolygonCenter () const
 Returns the arithmetic of all corner points.
PositionVector getSubpart (double beginOffset, double endOffset) const
 get subpart of a position vector
PositionVector getSubpart2D (double beginOffset, double endOffset) const
 get subpart of a position vector in two dimensions (Z is ignored)
PositionVector getSubpartByIndex (int beginIndex, int count) const
 get subpart of a position vector using index and a cout
bool hasElevation () const
 return whether two positions differ in z-coordinate
int indexOfClosest (const Position &p, bool twoD=false) const
void insert_noDoublePos (const std::vector< Position >::iterator &at, const Position &p)
 insert in front a non double position
int insertAtClosest (const Position &p, bool interpolateZ)
 inserts p between the two closest positions
PositionVector interpolateZ (double zStart, double zEnd) const
 returned vector that varies z smoothly over its length
Position intersectionPosition2D (const Position &p1, const Position &p2, const double withinDist=0.) const
 Returns the position of the intersection.
Position intersectionPosition2D (const PositionVector &v1) const
 Returns the position of the intersection.
bool intersects (const Position &p1, const Position &p2) const
 Returns the information whether this list of points interesects the given line.
bool intersects (const PositionVector &v1) const
 Returns the information whether this list of points interesects one the given lines.
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.
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.
bool isClockwiseOriented (void)
bool isClosed () const
 check if PositionVector is closed
double isLeft (const Position &P0, const Position &P1, const Position &P2) const
 get left
bool isNAN () const
 check if PositionVector is NAN
double length () const
 Returns the length.
double length2D () const
 Returns the length.
void mirrorX ()
void move2side (double amount, double maxExtension=100)
 move position vector to side using certain amount
void move2sideCustom (std::vector< double > amount, double maxExtension=100)
 move position vector to side using a custom offset for each geometry point
double nearest_offset_to_point25D (const Position &p, bool perpendicular=true) const
 return the nearest offest to point 2D projected onto the 3D geometry
double nearest_offset_to_point2D (const Position &p, bool perpendicular=true) const
 return the nearest offest to point 2D
double offsetAtIndex2D (int index) const
 return the offset at the given index
void openPolygon ()
 open polygon
bool operator!= (const PositionVector &v2) const
 comparing operation
PositionVector operator+ (const PositionVector &v2) const
 adds two vectors (requires vectors of the same length)
PositionVector operator- (const PositionVector &v2) const
 subtracts two vectors (requires vectors of the same length)
bool operator== (const PositionVector &v2) const
 comparing operation
Positionoperator[] (int index)
 returns the position at the given index, negative indices are interpreted python style
const Positionoperator[] (int index) const
 returns the constant position at the given index, negative indices are interpreted python style
bool overlapsWith (const AbstractPoly &poly, double offset=0) const
 Returns the information whether the given polygon overlaps with this.
bool partialWithin (const AbstractPoly &poly, double offset=0) const
 Returns the information whether this polygon lies partially within the given polygon.
void pop_front ()
 pop first Position
Position positionAtOffset (double pos, double lateralOffset=0) const
 Returns the position at the given length.
Position positionAtOffset2D (double pos, double lateralOffset=0, bool extrapolateBeyond=false) const
 Returns the position at the given length.
 PositionVector ()
 Constructor. Creates an empty position vector.
 PositionVector (const Position &p1, const Position &p2)
 Parameter Constructor used for lines.
 PositionVector (const std::vector< Position > &v)
 Copy Constructor. Create a positionVector with the same elements as other 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.
void prepend (const PositionVector &v, double sameThreshold=2.0)
void push_back_noDoublePos (const Position &p)
 insert in back a non double position
void push_front (const Position &p)
 insert in front a Position
void push_front_noDoublePos (const Position &p)
 insert in front a non double position
int removeClosest (const Position &p)
 removes the point closest to p and return the removal index
void removeDoublePoints (double minDist=POSITION_EPS, bool assertLength=false, int beginOffset=0, int endOffset=0, bool resample=false)
 Removes positions if too near.
PositionVector resample (double maxLength, const bool adjustEnd) const
 resample shape (i.e. transform to segments, equal spacing)
PositionVector reverse () const
 reverse position vector
void rotate2D (const Position &pos, double angle)
void rotate2D (double angle)
void rotateAroundFirstElement2D (double angle)
double rotationAtOffset (double pos) const
 Returns the rotation at the given length.
double rotationDegreeAtOffset (double pos) const
 Returns the rotation at the given length.
void round (int precision, bool avoidDegeneration=true)
 round all coordinates to the given precision
void scaleAbsolute (double offset)
 enlarges/shrinks the polygon by an absolute offset based at the centroid
void scaleRelative (double factor)
 enlarges/shrinks the polygon by a factor based at the centroid
Position sidePositionAtAngle (double pos, double lateralOffset, double angle) const
PositionVector simplified () const
 return the same shape with intermediate colinear points removed
const PositionVector simplified2 (const bool closed, const double eps=NUMERICAL_EPS) const
double slopeDegreeAtOffset (double pos) const
 Returns the slope at the given length.
PositionVector smoothedZFront (double dist=std::numeric_limits< double >::max()) const
 returned vector that is smoothed at the front (within dist)
void sortAsPolyCWByAngle ()
 sort as polygon CW by angle
void sortByIncreasingXY ()
 sort by increasing X-Y Positions
std::pair< PositionVector, PositionVectorsplitAt (double where, bool use2D=false) const
 Returns the two lists made when this list vector is splitted at the given point.
void sub (const Position &offset)
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
 ~PositionVector ()
 Destructor.

Static Public Member Functions

static double localAngle (const Position &from, const Position &pos, const Position &to)
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.
static Position positionAtOffset2D (const Position &p1, const Position &p2, double pos, double lateralOffset=0, bool extrapolateBeyond=false)
 Returns the position between the two given point at the specified position.
static Position sideOffset (const Position &beg, const Position &end, const double amount)
 get a side position of position vector using a offset
static Position sidePositionAtAngle (const Position &p1, const Position &p2, double pos, double lateralOffset, double angle)

Static Public Attributes

static const PositionVector EMPTY
 empty Vector

Private Types

typedef std::vector< Positionvp
 vector of position

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

Friends

std::ostream & operator<< (std::ostream &os, const PositionVector &geom)

Detailed Description

A list of positions.

Definition at line 43 of file PositionVector.h.

Member Typedef Documentation

◆ vp

typedef std::vector<Position> PositionVector::vp
private

vector of position

Definition at line 47 of file PositionVector.h.

Constructor & Destructor Documentation

◆ PositionVector() [1/4]

PositionVector::PositionVector ( )

Constructor. Creates an empty position vector.

Definition at line 53 of file PositionVector.cpp.

Referenced by added(), almostSame(), append(), area(), around(), bezier(), distances(), getCentroid(), getOrthogonal(), getOverlapWith(), getSubpart(), getSubpart2D(), getSubpartByIndex(), interpolateZ(), intersectionPosition2D(), intersects(), intersectsAtLengths2D(), move2side(), move2sideCustom(), operator!=(), operator+(), operator-(), operator<<, operator==(), prepend(), resample(), reverse(), rotate2D(), simplified(), simplified2(), smoothedZFront(), splitAt(), and transformToVectorCoordinates().

Here is the caller graph for this function:

◆ PositionVector() [2/4]

PositionVector::PositionVector ( const std::vector< Position > & v)

Copy Constructor. Create a positionVector with the same elements as other positionVector.

Parameters
[in]vThe vector to copy

Definition at line 56 of file PositionVector.cpp.

◆ PositionVector() [3/4]

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.

Parameters
[in]begThe begin iterator for copy
[in]endThe end iterator to copy

Definition at line 61 of file PositionVector.cpp.

◆ PositionVector() [4/4]

PositionVector::PositionVector ( const Position & p1,
const Position & p2 )

Parameter Constructor used for lines.

Parameters
[in]p1the first position
[in]p2the second position

Definition at line 66 of file PositionVector.cpp.

◆ ~PositionVector()

PositionVector::~PositionVector ( )

Destructor.

Definition at line 72 of file PositionVector.cpp.

Member Function Documentation

◆ add() [1/2]

void PositionVector::add ( const Position & offset)

Definition at line 691 of file PositionVector.cpp.

References add(), Position::x(), Position::y(), and Position::z().

◆ add() [2/2]

◆ added()

PositionVector PositionVector::added ( const Position & offset) const

Definition at line 697 of file PositionVector.cpp.

References PositionVector().

◆ almostSame()

bool PositionVector::almostSame ( const PositionVector & v2,
double maxDiv = POSITION_EPS ) const

check if the two vectors have the same length and pairwise similar positions

Definition at line 1586 of file PositionVector.cpp.

References PositionVector().

Referenced by NBRequest::bidiConflict(), and NIImporter_OpenDrive::computeShapes().

Here is the caller graph for this function:

◆ angleAt2D()

◆ append()

◆ area()

double PositionVector::area ( ) const

Returns the area (0 for non-closed).

Definition at line 563 of file PositionVector.cpp.

References area(), isClosed(), and PositionVector().

Referenced by area(), NBEdgeCont::formFactor(), getCentroid(), isClockwiseOriented(), and GNELane2laneConnection::updateLane2laneConnection().

Here is the caller graph for this function:

◆ around()

bool PositionVector::around ( const Position & p,
double offset = 0 ) const
virtual

Returns the information whether the position vector describes a polygon lying around the given point.

Note
The optional offset is added to the polygon's boundaries

Implements AbstractPoly.

Definition at line 76 of file PositionVector.cpp.

References GeomHelper::angle2D(), around(), M_PI, PositionVector(), scaleAbsolute(), Position::x(), and Position::y().

Referenced by MSPModel_JuPedSim::add(), around(), GUIViewObjectsHandler::checkShapeObject(), NBNode::computeNodeShape(), NBNode::getCenter(), getOverlapWith(), Triangle::intersectWithShape(), and NIVissimTL::NIVissimTLSignal::isWithin().

Here is the caller graph for this function:

◆ beginEndAngle()

double PositionVector::beginEndAngle ( ) const

◆ bezier()

PositionVector PositionVector::bezier ( int numPoints)

return a bezier interpolation

Definition at line 1991 of file PositionVector.cpp.

References PositionVector().

Referenced by NBNode::computeSmoothShape(), MSPModel_Striping::insertWalkArePaths(), GNEEdge::smoothShape(), NWWriter_OpenDrive::writeGeomSmooth(), and NWWriter_OpenDrive::writeInternalEdge().

Here is the caller graph for this function:

◆ closePolygon()

void PositionVector::closePolygon ( )

ensures that the last position equals the first

Definition at line 1372 of file PositionVector.cpp.

Referenced by NBNode::buildCrossingOutlines(), GUIGeometry::drawContourGeometry(), NBNode::getCenter(), NLHandler::openJunction(), NIVissimSingleTypeParser_Knotendefinition::parse(), NIXMLNodesHandler::processNodeType(), GNEMoveElementShape::removeGeometryPoint(), GNEShapeFrame::shapeDrawed(), GNETAZFrame::shapeDrawed(), and NBEdge::startShapeAt().

Here is the caller graph for this function:

◆ crosses()

bool PositionVector::crosses ( const Position & p1,
const Position & p2 ) const
virtual

Returns whether the AbstractPoly crosses the given line.

Implements AbstractPoly.

Definition at line 599 of file PositionVector.cpp.

References intersects().

◆ distance2D()

◆ distances()

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

Note
if perpendicular is set to true, only the perpendicular distances are returned

Definition at line 1380 of file PositionVector.cpp.

References distance2D(), GeomHelper::INVALID_OFFSET, and PositionVector().

Referenced by NBNodeShapeComputer::badIntersection(), MSLink::computeDistToDivergence(), NBEdge::guessOpposite(), NBNodeShapeComputer::isDivided(), and NWWriter_OpenDrive::mapmatchRoadObjects().

Here is the caller graph for this function:

◆ ensureMinLength()

void PositionVector::ensureMinLength ( int precision)

ensure minimum length so that the geometry will not degenerate to 0-length on writing with the given precision

Definition at line 1484 of file PositionVector.cpp.

References extrapolate2D(), and length2D().

Referenced by round().

Here is the caller graph for this function:

◆ extrapolate()

void PositionVector::extrapolate ( const double val,
const bool onlyFirst = false,
const bool onlyLast = false )

◆ extrapolate2D()

void PositionVector::extrapolate2D ( const double val,
const bool onlyFirst = false )

◆ getBoxBoundary()

◆ getCentroid()

Position PositionVector::getCentroid ( ) const

Returns the centroid (closes the polygon if unclosed).

Definition at line 458 of file PositionVector.cpp.

References area(), Position::INVALID, isClosed(), length(), PositionVector(), and sub().

Referenced by GNEAdditionalHandler::buildTAZ(), GNEMoveElementShape::commitMoveShape(), GUILane::drawLane2LaneConnections(), scaleAbsolute(), scaleRelative(), GNEMoveElementShape::setMoveShape(), GNETAZFrame::shapeDrawed(), GNEParkingSpace::updateGeometry(), and GNEPOI::updateGeometry().

Here is the caller graph for this function:

◆ getLineCenter()

Position PositionVector::getLineCenter ( ) const

get line center

Definition at line 527 of file PositionVector.cpp.

References length(), and positionAtOffset().

Referenced by GUIParkingArea::GUIParkingArea(), GUIChargingStation::initAppearance(), GUIBusStop::initShape(), GNEBusStop::updateGeometry(), GNEChargingStation::updateGeometry(), GNEContainerStop::updateGeometry(), GNEParkingArea::updateGeometry(), and GNETAZRelData::updateGeometry().

Here is the caller graph for this function:

◆ getMaxGrade()

double PositionVector::getMaxGrade ( double & maxJump) const

Definition at line 1963 of file PositionVector.cpp.

References Position::distanceTo2D(), MAX2(), and Position::z().

Referenced by NBEdgeCont::checkGrade().

Here is the caller graph for this function:

◆ getMinZ()

double PositionVector::getMinZ ( ) const

return minimum z-coordinate

Definition at line 1981 of file PositionVector.cpp.

References MIN2(), and Position::z().

Referenced by GUILane::drawGL().

Here is the caller graph for this function:

◆ getOrthogonal()

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)

Parameters
[in]pThe point through which to draw the orthogonal
[in]extendhow long to extend this vector for finding an orthogonal
[in]frontWhether to take the segment before or after the base point in case of ambiguity
[in]lengththe length of the orthogonal
[in]degthe rotation angle relative to the shape direction

Definition at line 1831 of file PositionVector.cpp.

References DEG2RAD, extrapolate2D(), indexOfClosest(), GeomHelper::INVALID_OFFSET, length(), nearest_offset_to_point2D(), offsetAtIndex2D(), positionAtOffset2D(), and PositionVector().

Referenced by NBNode::computeInternalLaneShape(), GUILane::debugDrawFoeIntersections(), GUIBaseVehicle::drawStopLabels(), and GNEConnection::updateGeometry().

Here is the caller graph for this function:

◆ getOverlapWith()

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 133 of file PositionVector.cpp.

References around(), distance2D(), MAX2(), nearest_offset_to_point2D(), positionAtOffset2D(), PositionVector(), and Position::z().

Referenced by NBEdgeCont::checkOverlap().

Here is the caller graph for this function:

◆ getPolygonCenter()

Position PositionVector::getPolygonCenter ( ) const

Returns the arithmetic of all corner points.

Note
: this is different from the centroid!

Definition at line 441 of file PositionVector.cpp.

References Position::INVALID, Position::x(), Position::y(), and Position::z().

Referenced by NIVissimNodeCluster::buildNBNode(), NIVissimDistrictConnection::dict_BuildDistrictNodes(), GUIPolygon::drawInnerPolygon(), GNERouteProbe::getPositionInView(), and NWWriter_OpenDrive::writeRoadObjectPoly().

Here is the caller graph for this function:

◆ getSubpart()

PositionVector PositionVector::getSubpart ( double beginOffset,
double endOffset ) const

get subpart of a position vector

Definition at line 786 of file PositionVector.cpp.

References length(), positionAtOffset(), PositionVector(), and push_back_noDoublePos().

Referenced by NBNode::computeInternalLaneShape(), NBEdge::cutAtIntersection(), NBNode::cutAtShapes(), GUIOverheadWire::drawGL(), NBNodeShapeComputer::getSmoothCorner(), GUIBusStop::initShape(), NBEdgeCont::joinTramEdges(), and NWWriter_SUMO::writeLane().

Here is the caller graph for this function:

◆ getSubpart2D()

PositionVector PositionVector::getSubpart2D ( double beginOffset,
double endOffset ) const

◆ getSubpartByIndex()

PositionVector PositionVector::getSubpartByIndex ( int beginIndex,
int count ) const

get subpart of a position vector using index and a cout

Definition at line 869 of file PositionVector.cpp.

References PositionVector().

Referenced by NBNodeShapeComputer::computeNodeShapeSmall(), and NBEdge::startShapeAt().

Here is the caller graph for this function:

◆ hasElevation()

bool PositionVector::hasElevation ( ) const

return whether two positions differ in z-coordinate

Definition at line 1601 of file PositionVector.cpp.

◆ indexOfClosest()

◆ insert_noDoublePos()

void PositionVector::insert_noDoublePos ( const std::vector< Position >::iterator & at,
const Position & p )

insert in front a non double position

Definition at line 1452 of file PositionVector.cpp.

References Position::almostSame(), push_back_noDoublePos(), and push_front_noDoublePos().

◆ insertAtClosest()

int PositionVector::insertAtClosest ( const Position & p,
bool interpolateZ )

inserts p between the two closest positions

Parameters
pposition to be inserted
interpolateZflag to enable/disable interpolation of Z Value between the two closest positions
Returns
the insertion index

Definition at line 1040 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::addOffsets(), NIImporter_OpenDrive::discretizeOffsets(), GNEMoveElement::getEditShapeOperation(), GNEMoveElementEdge::processMoveFromJunctionSelected(), GNEMoveElementEdge::processMoveToJunctionSelected(), GNEMoveElementEdge::processNoneJunctionSelected(), and NWWriter_OpenDrive::writeGeomSmooth().

Here is the caller graph for this function:

◆ interpolateZ()

PositionVector PositionVector::interpolateZ ( double zStart,
double zEnd ) const

returned vector that varies z smoothly over its length

Definition at line 1908 of file PositionVector.cpp.

References length(), length2D(), and PositionVector().

Referenced by NBNodeShapeComputer::getSmoothCorner(), and insertAtClosest().

Here is the caller graph for this function:

◆ intersectionPosition2D() [1/2]

Position PositionVector::intersectionPosition2D ( const Position & p1,
const Position & p2,
const double withinDist = 0. ) const

Returns the position of the intersection.

Definition at line 189 of file PositionVector.cpp.

References intersects(), and Position::INVALID.

Referenced by NBNodeShapeComputer::badIntersection(), NBNode::bezierControlPoints(), NBNodeShapeComputer::computeNodeShapeSmall(), GeomHelper::crossPoint(), NBNode::indirectLeftShape(), intersectionPosition2D(), move2side(), and move2sideCustom().

Here is the caller graph for this function:

◆ intersectionPosition2D() [2/2]

Position PositionVector::intersectionPosition2D ( const PositionVector & v1) const

Returns the position of the intersection.

Definition at line 201 of file PositionVector.cpp.

References intersectionPosition2D(), intersects(), Position::INVALID, and PositionVector().

◆ intersects() [1/3]

bool PositionVector::intersects ( const Position & p1,
const Position & p2 ) const

Returns the information whether this list of points interesects the given line.

Definition at line 161 of file PositionVector.cpp.

References intersects().

Referenced by NBNodeShapeComputer::computeNodeShapeDefault(), NBNodeShapeComputer::computeNodeShapeSmall(), NBNodeShapeComputer::computeSameEnd(), Boundary::crosses(), crosses(), GeomHelper::crossPoint(), NBEdgeCont::ignoreFilterMatch(), MSInternalJunction::indirectBicycleTurn(), intersectionPosition2D(), intersectionPosition2D(), intersects(), intersects(), intersectsAtLengths2D(), NIVissimConnectionCluster::isWeakDistrictConnRealisation(), and NBEdge::startShapeAt().

Here is the caller graph for this function:

◆ intersects() [2/3]

bool PositionVector::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 )
staticprivate

return whether the line segments defined by Line p11,p12 and Line p21,p22 intersect

Definition at line 1615 of file PositionVector.cpp.

References Position::distanceTo2D(), Position::x(), and Position::y().

◆ intersects() [3/3]

bool PositionVector::intersects ( const PositionVector & v1) const

Returns the information whether this list of points interesects one the given lines.

Definition at line 175 of file PositionVector.cpp.

References intersects(), and PositionVector().

◆ intersectsAtLengths2D() [1/2]

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 1103 of file PositionVector.cpp.

References Position::distanceTo2D(), and intersects().

◆ intersectsAtLengths2D() [2/2]

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 1089 of file PositionVector.cpp.

References intersectsAtLengths2D(), and PositionVector().

Referenced by NBNodeShapeComputer::closestIntersection(), NBNodeShapeComputer::computeNodeShapeDefault(), NBNodeShapeComputer::computeSameEnd(), MSLink::contIntersect(), NBNode::cutAtShapes(), NBEdge::firstIntersection(), intersectsAtLengths2D(), MSLink::recheckSetRequestInformation(), MSLink::setRequestInformation(), and NBEdge::startShapeAt().

Here is the caller graph for this function:

◆ isClockwiseOriented()

bool PositionVector::isClockwiseOriented ( void )

Definition at line 2033 of file PositionVector.cpp.

References add(), area(), Position::x(), and Position::y().

◆ isClosed()

bool PositionVector::isClosed ( ) const

check if PositionVector is closed

Definition at line 1466 of file PositionVector.cpp.

Referenced by area(), getCentroid(), GNENetworkElement::getShapeEditedPopUpMenu(), and NWWriter_OpenDrive::writeRoadObjectPoly().

Here is the caller graph for this function:

◆ isLeft()

double PositionVector::isLeft ( const Position & P0,
const Position & P1,
const Position & P2 ) const

get left

Note
previously marked with "!!!"

Definition at line 760 of file PositionVector.cpp.

References Position::x(), and Position::y().

Referenced by transformToVectorCoordinates().

Here is the caller graph for this function:

◆ isNAN()

bool PositionVector::isNAN ( ) const

check if PositionVector is NAN

Definition at line 1472 of file PositionVector.cpp.

Referenced by NBNode::buildCrossings().

Here is the caller graph for this function:

◆ length()

double PositionVector::length ( ) const

Returns the length.

Definition at line 537 of file PositionVector.cpp.

Referenced by MSPModel_JuPedSim::addWaitingSet(), GUIGeometry::adjustStartPosGeometricPath(), libsumo::Helper::applySubscriptionFilterLateralDistanceSinglePass(), NBEdge::assignInternalLaneLength(), NBNodeShapeComputer::badIntersection(), NBEdge::buildInnerEdges(), GNETLSEditorFrame::buildInternalLanes(), NBRampsComputer::buildOffRamp(), NBRampsComputer::buildOnRamp(), NBEdge::computeAngle(), NBNode::computeInternalLaneShape(), NBEdge::cutAtIntersection(), GUILane::debugDrawFoeIntersections(), NIVissimEdge::dict_checkEdges2Join(), GNEGenericData::drawAttribute(), GUIVehicle::drawBestLanes(), GNELaneAreaDetector::drawE2PartialJunction(), GNEEdge::drawEdgeName(), GUIEdge::drawGL(), GNERoute::drawRoutePartialJunction(), NBEdge::firstIntersection(), getCentroid(), NBTurningDirectionsComputer::getFarAngleAtNode(), NBEdge::getFinalLength(), NWWriter_DlrNavteq::getGraphLength(), getLineCenter(), getOrthogonal(), NBNodeShapeComputer::getSmoothCorner(), getSubpart(), GUILane::GUILane(), GUIOverheadWire::GUIOverheadWire(), GUIParkingArea::GUIParkingArea(), GUITriggeredRerouter::GUITriggeredRerouterEdge::GUITriggeredRerouterEdge(), NBEdge::haveIntersection(), GUIChargingStation::initAppearance(), GUIBusStop::initShape(), insertAtClosest(), MSPModel_Striping::insertWalkArePaths(), interpolateZ(), GNECalibrator::isValid(), NBEdgeCont::joinTramEdges(), NIVissimConnectionCluster::liesOnSameEdgesEnd(), move2side(), MSPModel_Striping::PState::moveTo(), NIImporter_OpenStreetMap::RelationHandler::myEndElement(), NIImporter_Vissim::NIVissimXMLHandler_Streckendefinition::myEndElement(), operator+(), operator-(), NBRequest::oppositeLeftTurnConflict(), resample(), rotationAtOffset(), NBEdgeCont::splitAt(), NBEdgeCont::splitAt(), splitAt(), GNENet::splitEdge(), GNEConnection::updateGeometry(), GNETAZRelData::updateGeometry(), and NWWriter_SUMO::writeLane().

◆ length2D()

double PositionVector::length2D ( ) const

Returns the length.

Definition at line 550 of file PositionVector.cpp.

Referenced by NBEdge::buildInnerEdges(), GNEAdditionalHandler::buildRerouter(), NBNode::buildWalkingAreas(), GNEMoveElement::calculateExtrapolatedVector(), GNEMoveElement::calculateLaneOffset(), GNEMoveElement::calculateLanePositions(), GNEAdditional::calculatePerpendicularLine(), GNEMoveElementViewResizable::commitMoveShape(), NBEdge::computeAngle(), MSLink::computeDistToDivergence(), NBEdge::computeEdge2Edges(), NBEdge::computeEdgeShape(), NBNode::computeInternalLaneShape(), NBNodeShapeComputer::computeNodeShapeDefault(), NBNodeShapeComputer::computeSameEnd(), NBNode::cutAtShapes(), GNEGenericData::drawAttribute(), GNEGenericData::drawFilteredAttribute(), GNEVehicle::drawLanePartialGL(), ensureMinLength(), NBPTStop::findLaneAndComputeBusStopExtent(), NBEdgeCont::formFactor(), GNEStop::getAttributePosition(), GNEVehicle::getAttributePosition(), GNEMoveElementVehicle::getMoveOperation(), NBNodeShapeComputer::getSmoothCorner(), getSubpart2D(), NBEdgeCont::guessRoundabouts(), interpolateZ(), NIImporter_OpenDrive::loadNetwork(), move2side(), move2sideCustom(), NBContHelper::relative_incoming_edge_sorter::operator()(), NBContHelper::relative_outgoing_edge_sorter::operator()(), GNEMoveElementEdge::processNoneJunctionSelected(), NIImporter_OpenStreetMap::reconstructLayerElevation(), resample(), smoothedZFront(), GNEEdge::smoothElevation(), GNEEdge::smoothShape(), splitAt(), NBEdge::startShapeAt(), GUIGeometry::updateGeometry(), NWWriter_OpenDrive::writeGeomSmooth(), NWWriter_OpenDrive::writeInternalEdge(), NWWriter_OpenDrive::writeRoadObjectPOI(), and NWWriter_OpenDrive::writeRoadObjectPoly().

Here is the caller graph for this function:

◆ localAngle()

double PositionVector::localAngle ( const Position & from,
const Position & pos,
const Position & to )
static

Definition at line 1350 of file PositionVector.cpp.

References GeomHelper::angleDiff(), and Position::angleTo2D().

Referenced by move2side().

Here is the caller graph for this function:

◆ mirrorX()

void PositionVector::mirrorX ( )

Definition at line 707 of file PositionVector.cpp.

Referenced by GNEEdge::setGeometry().

Here is the caller graph for this function:

◆ move2side()

void PositionVector::move2side ( double amount,
double maxExtension = 100 )

move position vector to side using certain amount

Definition at line 1184 of file PositionVector.cpp.

References Position::distanceTo2D(), extrapolate2D(), gDebugFlag1, intersectionPosition2D(), Position::INVALID, length(), length2D(), localAngle(), move2side(), PositionVector(), RAD2DEG, removeDoublePoints(), sideOffset(), and Position::z().

Referenced by GNENet::addReversedEdge(), MSPModel_JuPedSim::addWaitingSet(), libsumo::Helper::applySubscriptionFilterLateralDistanceSinglePass(), NBNodeShapeComputer::badIntersection(), NBNode::buildCrossingOutlines(), NBNode::buildCrossings(), GNETLSEditorFrame::buildInternalLanes(), GNEAdditionalHandler::buildRerouter(), NBNode::buildWalkingAreas(), GNEAdditional::calculatePerpendicularLine(), MSLink::checkWalkingAreaFoe(), NBEdge::computeAngle(), NBEdge::computeLaneShape(), NBNode::displaceShapeAtWidthChange(), GUIVehicle::drawBestLanes(), GUIGeometry::drawContourGeometry(), GNEEdge::drawEdgeShape(), GNEConnection::drawGL(), GUILane::drawGL(), GNEViewNet::drawTemporalJunction(), NBEdge::firstIntersection(), GNEEdge::getBackDownShapePosition(), GNEEdge::getBackUpShapePosition(), MEVehicle::getBoundingBox(), MSTransportable::getBoundingBox(), MSVehicle::getBoundingBox(), MSVehicle::getBoundingPoly(), NBEdge::getCCWBoundaryLine(), NBEdge::getCWBoundaryLine(), GNEEdge::getFrontDownShapePosition(), GNEEdge::getFrontUpShapePosition(), MSVehicle::getPosition(), GUIMEVehicle::getVisualPosition(), GUIVehicle::getVisualPosition(), GUIOverheadWire::GUIOverheadWire(), GUIParkingArea::GUIParkingArea(), GUIChargingStation::initAppearance(), GUIBusStop::initShape(), NIImporter_OpenDrive::loadNetwork(), move2side(), MSPModel_Striping::moveInDirection(), NBRampsComputer::moveRampRight(), LIBSUMO_NAMESPACE::Person::moveToXY(), LIBSUMO_NAMESPACE::Vehicle::moveToXY(), MSLink::MSLink(), GNEMoveFrame::ShiftEdgeSelectedGeometry::onCmdShiftEdgeGeometry(), NBRampsComputer::patchRampGeometry(), NBEdgeCont::processSplits(), GNEStoppingPlace::setStoppingPlaceGeometry(), NBEdge::shiftPositionAtNode(), NGNet::toNB(), GNEBusStop::updateGeometry(), GNEChargingStation::updateGeometry(), GNEConnection::updateGeometry(), GNEContainerStop::updateGeometry(), GNEParkingArea::updateGeometry(), GNEParkingSpace::updateGeometry(), GNEPOI::updateGeometry(), GNETAZRelData::updateGeometry(), NBSign::writeAsPOI(), NWWriter_OpenDrive::writeNetwork(), NWWriter_DlrNavteq::writeNodesUnsplitted(), NWWriter_OpenDrive::writeRoadObjectPOI(), NWWriter_OpenDrive::writeRoadObjectPoly(), and NIImporter_OpenDrive::writeRoadObjects().

◆ move2sideCustom()

void PositionVector::move2sideCustom ( std::vector< double > amount,
double maxExtension = 100 )

move position vector to side using a custom offset for each geometry point

Definition at line 1290 of file PositionVector.cpp.

References Position::distanceTo2D(), extrapolate2D(), intersectionPosition2D(), Position::INVALID, length2D(), PositionVector(), sideOffset(), toString(), and Position::z().

Referenced by NIImporter_OpenDrive::loadNetwork().

Here is the caller graph for this function:

◆ nearest_offset_to_point25D()

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 933 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(), libsumo::Helper::moveToXYMap(), MSDevice_FCDReplay::FCDHandler::myStartElement(), and libsumo::Helper::patchShapeDistance().

Here is the caller graph for this function:

◆ nearest_offset_to_point2D()

double PositionVector::nearest_offset_to_point2D ( const Position & p,
bool perpendicular = true ) const

return the nearest offest to point 2D

Definition at line 897 of file PositionVector.cpp.

References Position::distanceSquaredTo2D(), INVALID_DOUBLE, GeomHelper::INVALID_OFFSET, GeomHelper::nearest_offset_on_line_to_point2D(), and positionAtOffset2D().

Referenced by GNEConsecutiveSelector::addLane(), MSParkingArea::addLotEntry(), GNEPlanCreator::addSingleEdge(), NBNode::bezierControlPoints(), GNEMoveElement::calculateExtrapolatedVector(), GNEMoveElement::calculateLaneOffset(), GNEMoveElement::calculateNewLaneChange(), MSPerson::checkAccess(), GUIViewObjectsHandler::checkPositionOverShape(), NBPTStopCont::computeCrossProductEdgePosition(), NBNode::cutAtShapes(), distance2D(), NBPTStop::findLaneAndComputeBusStopExtent(), getOrthogonal(), getOverlapWith(), GNEAdditional::getPopUpMenu(), GUIEdge::getSegmentAtPosition(), NBNodeShapeComputer::getSmoothCorner(), GNEEdge::getSplitPos(), GNEStopFrame::getStopParameter(), GNEAdditionalFrame::initBaseAdditionalObject(), NBEdgeCont::joinTramEdges(), libsumo::Helper::moveToXYMap(), GNEViewNet::onCmdAttachPOI(), NBNode::patchOffset_pathAcrossStreet(), GNEShapeFrame::processClickPOILanes(), GNEMoveElementEdge::processMoveFromJunctionSelected(), GNEMoveElementEdge::processMoveToJunctionSelected(), MSStageDriving::setArrived(), MSLink::setRequestInformation(), NBEdgeCont::splitAt(), GNENet::splitEdge(), GNETAZRelData::updateGeometry(), NWWriter_OpenDrive::writeRoadObjectPOI(), NWWriter_OpenDrive::writeRoadObjectPoly(), and NWWriter_OpenDrive::writeSignals().

Here is the caller graph for this function:

◆ offsetAtIndex2D()

double PositionVector::offsetAtIndex2D ( int index) const

return the offset at the given index

Definition at line 1950 of file PositionVector.cpp.

References GeomHelper::INVALID_OFFSET.

Referenced by NBPTStopCont::computeCrossProductEdgePosition(), and getOrthogonal().

Here is the caller graph for this function:

◆ openPolygon()

void PositionVector::openPolygon ( )

open polygon

Definition at line 1364 of file PositionVector.cpp.

Referenced by Triangle::triangulate().

Here is the caller graph for this function:

◆ operator!=()

bool PositionVector::operator!= ( const PositionVector & v2) const

comparing operation

Definition at line 1553 of file PositionVector.cpp.

References PositionVector().

◆ operator+()

PositionVector PositionVector::operator+ ( const PositionVector & v2) const

adds two vectors (requires vectors of the same length)

Definition at line 1572 of file PositionVector.cpp.

References add(), length(), PositionVector(), TL, and WRITE_ERROR.

◆ operator-()

PositionVector PositionVector::operator- ( const PositionVector & v2) const

subtracts two vectors (requires vectors of the same length)

Definition at line 1558 of file PositionVector.cpp.

References add(), length(), PositionVector(), TL, and WRITE_ERROR.

◆ operator==()

bool PositionVector::operator== ( const PositionVector & v2) const

comparing operation

Definition at line 1547 of file PositionVector.cpp.

References PositionVector().

◆ operator[]() [1/2]

Position & PositionVector::operator[] ( int index)

returns the position at the given index, negative indices are interpreted python style

Exceptions
OutOfBoundsExceptionif index >= size or index < -size

Definition at line 231 of file PositionVector.cpp.

◆ operator[]() [2/2]

const Position & PositionVector::operator[] ( int index) const

returns the constant position at the given index, negative indices are interpreted python style

Exceptions
OutOfBoundsExceptionif index >= size or index < -size

Definition at line 212 of file PositionVector.cpp.

◆ overlapsWith()

bool PositionVector::overlapsWith ( const AbstractPoly & poly,
double offset = 0 ) const
virtual

Returns the information whether the given polygon overlaps with this.

Note
Again a boundary may be specified

Implements AbstractPoly.

Definition at line 110 of file PositionVector.cpp.

References AbstractPoly::crosses(), AbstractPoly::partialWithin(), and partialWithin().

Referenced by MSLane::detectCollisions(), and MSLane::detectPedestrianJunctionCollision().

Here is the caller graph for this function:

◆ partialWithin()

bool PositionVector::partialWithin ( const AbstractPoly & poly,
double offset = 0 ) const
virtual

Returns the information whether this polygon lies partially within the given polygon.

Implements AbstractPoly.

Definition at line 585 of file PositionVector.cpp.

References AbstractPoly::around().

Referenced by NBEdgeCont::ignoreFilterMatch(), and overlapsWith().

Here is the caller graph for this function:

◆ pop_front()

void PositionVector::pop_front ( )

pop first Position

Definition at line 1426 of file PositionVector.cpp.

Referenced by GNEMoveElementEdge::commitMoveShape(), GNEMoveFrame::ShiftEdgeSelectedGeometry::onCmdShiftEdgeGeometry(), GNEMoveElementEdge::removeGeometryPoint(), GNEMoveElementEdge::setMoveShape(), and GNEEdge::setShapeStartPos().

Here is the caller graph for this function:

◆ positionAtOffset() [1/2]

Position PositionVector::positionAtOffset ( const Position & p1,
const Position & p2,
double pos,
double lateralOffset = 0. )
static

Returns the position between the two given point at the specified position.

Definition at line 373 of file PositionVector.cpp.

References Position::distanceTo(), Position::INVALID, and sideOffset().

◆ positionAtOffset() [2/2]

Position PositionVector::positionAtOffset ( double pos,
double lateralOffset = 0 ) const

◆ positionAtOffset2D() [1/2]

Position PositionVector::positionAtOffset2D ( const Position & p1,
const Position & p2,
double pos,
double lateralOffset = 0,
bool extrapolateBeyond = false )
static

Returns the position between the two given point at the specified position.

Definition at line 408 of file PositionVector.cpp.

References Position::distanceTo2D(), Position::INVALID, and sideOffset().

◆ positionAtOffset2D() [2/2]

Position PositionVector::positionAtOffset2D ( double pos,
double lateralOffset = 0,
bool extrapolateBeyond = false ) const

Returns the position at the given length.

Definition at line 296 of file PositionVector.cpp.

References Position::INVALID, and positionAtOffset2D().

Referenced by NIImporter_OpenDrive::addOffsets(), NBNode::bezierControlPoints(), GNEAdditionalHandler::buildRerouter(), GNEMoveElement::calculateLaneOffset(), GNEMoveElement::calculateNewLaneChange(), GNEAdditional::calculatePerpendicularLine(), NGRandomNetBuilder::canConnect(), GUIViewObjectsHandler::checkPositionOverShape(), NBEdge::computeAngle(), MSTrainHelper::computeCarriages(), NBNodeShapeComputer::computeNodeShapeDefault(), NBNodeShapeComputer::computeSameEnd(), GUIBaseVehicle::computeSeats(), NIImporter_OpenDrive::discretizeOffsets(), distance2D(), GNEGenericData::drawAttribute(), GUIGeometry::drawChildLine(), GNELaneAreaDetector::drawE2PartialLane(), GNEGenericData::drawFilteredAttribute(), GUIGeometry::drawParentLine(), GNEEdge::editEndpoint(), GNEStop::getAttributePosition(), GNEVehicle::getAttributePosition(), getOrthogonal(), getOverlapWith(), GUIContainer::getPosition(), MSPModel_NonInteracting::CState::getPosition(), GNELane::getPositionInView(), getSubpart2D(), insertAtClosest(), NBEdgeCont::joinTramEdges(), nearest_offset_to_point25D(), nearest_offset_to_point2D(), NBContHelper::relative_incoming_edge_sorter::operator()(), NBContHelper::relative_outgoing_edge_sorter::operator()(), NBNode::patchOffset_pathAcrossStreet(), positionAtOffset2D(), GNEMoveElementEdge::processMoveFromJunctionSelected(), GNEMoveElementEdge::processMoveToJunctionSelected(), resample(), smoothedZFront(), GNEEdge::smoothElevation(), GNEEdge::smoothShape(), splitAt(), NBEdge::startShapeAt(), GNEStopPlan::updateGeometry(), GNETAZRelData::updateGeometry(), GUIGeometry::updateGeometry(), NWWriter_OpenDrive::writeGeomSmooth(), NWWriter_OpenDrive::writeRoadObjectPOI(), NWWriter_OpenDrive::writeRoadObjectPoly(), and NIImporter_OpenDrive::writeRoadObjects().

◆ prepend()

void PositionVector::prepend ( const PositionVector & v,
double sameThreshold = 2.0 )

Definition at line 776 of file PositionVector.cpp.

References PositionVector().

Referenced by libsumo::Helper::applySubscriptionFilterLateralDistanceSinglePass().

Here is the caller graph for this function:

◆ push_back_noDoublePos()

◆ push_front()

void PositionVector::push_front ( const Position & p)

insert in front a Position

Definition at line 1416 of file PositionVector.cpp.

Referenced by NIXMLEdgesHandler::addLane(), push_front_noDoublePos(), GNEEdge::setShapeStartPos(), and GNENetworkElement::straigthenShapeEdited().

Here is the caller graph for this function:

◆ push_front_noDoublePos()

void PositionVector::push_front_noDoublePos ( const Position & p)

insert in front a non double position

Definition at line 1444 of file PositionVector.cpp.

References Position::almostSame(), and push_front().

Referenced by NBNode::buildWalkingAreas(), NBNodeShapeComputer::computeNodeShapeDefault(), NBEdge::getFinalLength(), NWWriter_DlrNavteq::getGraphLength(), and insert_noDoublePos().

Here is the caller graph for this function:

◆ removeClosest()

int PositionVector::removeClosest ( const Position & p)

removes the point closest to p and return the removal index

Definition at line 1070 of file PositionVector.cpp.

References Position::distanceTo2D().

Referenced by NWWriter_OpenDrive::writeGeomSmooth().

Here is the caller graph for this function:

◆ removeDoublePoints()

void PositionVector::removeDoublePoints ( double minDist = POSITION_EPS,
bool assertLength = false,
int beginOffset = 0,
int endOffset = 0,
bool resample = false )

Removes positions if too near.

Parameters
[in]minDistThe minimum accepted distance; default: POSITION_EPS
[in]assertLengthWhether the result must at least contain two points (be a line); default: false, to ensure original behaviour

Definition at line 1503 of file PositionVector.cpp.

References positionAtOffset(), and resample().

Referenced by NIXMLEdgesHandler::addLane(), GNEMoveElement::commitMove(), NIImporter_OpenDrive::computeShapes(), NBEdge::init(), move2side(), NBEdge::reduceGeometry(), and GNEMoveElementEdge::removeGeometryPoint().

Here is the caller graph for this function:

◆ resample()

PositionVector PositionVector::resample ( double maxLength,
const bool adjustEnd ) const

resample shape (i.e. transform to segments, equal spacing)

Parameters
[in]maxLengthlength of every segment
[in]adjustEndenable or disable adjust end (i.e. result has the same original length, last segment could be short)

Definition at line 1927 of file PositionVector.cpp.

References length(), length2D(), positionAtOffset2D(), and PositionVector().

Referenced by removeDoublePoints(), and GNEEdge::smoothElevation().

Here is the caller graph for this function:

◆ reverse()

PositionVector PositionVector::reverse ( ) const

reverse position vector

Definition at line 1167 of file PositionVector.cpp.

References PositionVector().

Referenced by NBRailwayTopologyAnalyzer::addBidiEdge(), GNENet::addReversedEdge(), NBNodeShapeComputer::badIntersection(), NBRequest::bidiConflict(), GNEContour::buildContourEdge(), GNEContour::buildContourExtrudedShape(), NBNode::buildCrossingOutlines(), GNETLSEditorFrame::buildInternalLanes(), NBNode::buildWalkingAreas(), GNEMoveElement::calculateExtrapolatedVector(), MSLink::computeDistToDivergence(), NBEdge::computeEdgeShape(), NBNode::computeInternalLaneShape(), NBEdge::cutAtIntersection(), GUIGeometry::drawContourGeometry(), GUILane::drawLinkNo(), GUILane::drawLinkRules(), GNECrossing::drawTLSLinkNo(), GUILane::drawTLSLinkNo(), MEVehicle::getBoundingBox(), MSTransportable::getBoundingBox(), MSVehicle::getBoundingBox(), NWWriter_SUMO::getInternalBidi(), NBNodeShapeComputer::getSmoothCorner(), NBEdge::init(), NIImporter_OpenStreetMap::insertEdge(), MSPModel_Striping::insertWalkArePaths(), NIImporter_ArcView::load(), NIImporter_OpenDrive::loadNetwork(), NBEdge::NBEdge(), NIImporter_VISUM::parse_AreaSubPartElement(), NBEdge::recheckOpposite(), NBEdge::reduceGeometry(), NIImporter_DlrNavteq::EdgesHandler::report(), GNENet::reverseEdge(), GNEEdge::setAttribute(), NWWriter_OpenDrive::writeNetwork(), and NIImporter_OpenDrive::writeRoadObjects().

Here is the caller graph for this function:

◆ rotate2D() [1/2]

void PositionVector::rotate2D ( const Position & pos,
double angle )

Definition at line 1714 of file PositionVector.cpp.

References add(), PositionVector(), rotate2D(), and sub().

◆ rotate2D() [2/2]

void PositionVector::rotate2D ( double angle)

Definition at line 1699 of file PositionVector.cpp.

Referenced by NIImporter_OpenDrive::geomFromSpiral(), rotate2D(), rotateAroundFirstElement2D(), PolygonDynamics::update(), NWWriter_OpenDrive::writeGeomPP3(), NWWriter_OpenDrive::writeRoadObjectPoly(), and NIImporter_OpenDrive::writeRoadObjects().

Here is the caller graph for this function:

◆ rotateAroundFirstElement2D()

void PositionVector::rotateAroundFirstElement2D ( double angle)

Definition at line 1724 of file PositionVector.cpp.

References add(), rotate2D(), and sub().

Referenced by GNEStopPlan::updateGeometry().

Here is the caller graph for this function:

◆ rotationAtOffset()

◆ rotationDegreeAtOffset()

double PositionVector::rotationDegreeAtOffset ( double pos) const

◆ round()

void PositionVector::round ( int precision,
bool avoidDegeneration = true )

round all coordinates to the given precision

Definition at line 1492 of file PositionVector.cpp.

References ensureMinLength().

Referenced by NBEdge::shiftPositionAtNode().

Here is the caller graph for this function:

◆ scaleAbsolute()

void PositionVector::scaleAbsolute ( double offset)

enlarges/shrinks the polygon by an absolute offset based at the centroid

Definition at line 518 of file PositionVector.cpp.

References getCentroid().

Referenced by around(), and GNEParkingSpace::drawSpace().

Here is the caller graph for this function:

◆ scaleRelative()

void PositionVector::scaleRelative ( double factor)

enlarges/shrinks the polygon by a factor based at the centroid

Definition at line 509 of file PositionVector.cpp.

References getCentroid().

Referenced by GNEJunction::drawJunctionAsShape(), and MSVehicle::getBoundingPoly().

Here is the caller graph for this function:

◆ sideOffset()

Position PositionVector::sideOffset ( const Position & beg,
const Position & end,
const double amount )
static

get a side position of position vector using a offset

Definition at line 1177 of file PositionVector.cpp.

References Position::distanceTo2D(), Position::x(), and Position::y().

Referenced by NWWriter_OpenDrive::checkLaneGeometries(), move2side(), move2sideCustom(), positionAtOffset(), and positionAtOffset2D().

Here is the caller graph for this function:

◆ sidePositionAtAngle() [1/2]

Position PositionVector::sidePositionAtAngle ( const Position & p1,
const Position & p2,
double pos,
double lateralOffset,
double angle )
static

Definition at line 396 of file PositionVector.cpp.

References DEG2RAD, Position::distanceTo(), and Position::INVALID.

◆ sidePositionAtAngle() [2/2]

Position PositionVector::sidePositionAtAngle ( double pos,
double lateralOffset,
double angle ) const

Definition at line 275 of file PositionVector.cpp.

References Position::INVALID, and sidePositionAtAngle().

Referenced by sidePositionAtAngle().

Here is the caller graph for this function:

◆ simplified()

PositionVector PositionVector::simplified ( ) const

return the same shape with intermediate colinear points removed

Definition at line 1736 of file PositionVector.cpp.

References Position::distanceTo2D(), PositionVector(), Position::x(), and Position::y().

◆ simplified2()

const PositionVector PositionVector::simplified2 ( const bool closed,
const double eps = NUMERICAL_EPS ) const

Definition at line 1761 of file PositionVector.cpp.

References Position::length(), MIN2(), and PositionVector().

Referenced by NIImporter_OpenDrive::computeShapes(), and NIImporter_OpenDrive::loadNetwork().

Here is the caller graph for this function:

◆ slopeDegreeAtOffset()

double PositionVector::slopeDegreeAtOffset ( double pos) const

Returns the slope at the given length.

Definition at line 351 of file PositionVector.cpp.

References Position::distanceTo(), INVALID_DOUBLE, RAD2DEG, and Position::slopeTo2D().

Referenced by GeomHelper::calculateLotSpaceSlope(), LIBSUMO_NAMESPACE::Person::getSlope(), and MEVehicle::getSlope().

Here is the caller graph for this function:

◆ smoothedZFront()

PositionVector PositionVector::smoothedZFront ( double dist = std::numeric_limits<double>::max()) const

returned vector that is smoothed at the front (within dist)

Definition at line 1876 of file PositionVector.cpp.

References Position::distanceTo2D(), indexOfClosest(), length2D(), MIN2(), positionAtOffset2D(), and PositionVector().

Referenced by NBEdge::computeEdgeShape(), and NBNode::computeSmoothShape().

Here is the caller graph for this function:

◆ sortAsPolyCWByAngle()

void PositionVector::sortAsPolyCWByAngle ( )

sort as polygon CW by angle

Remarks
this function works for non-convex polygons but won't possibly yield the desired polygon

Definition at line 664 of file PositionVector.cpp.

References add(), and sub().

◆ sortByIncreasingXY()

void PositionVector::sortByIncreasingXY ( )

sort by increasing X-Y Positions

Definition at line 742 of file PositionVector.cpp.

◆ splitAt()

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 605 of file PositionVector.cpp.

References length(), length2D(), positionAtOffset(), positionAtOffset2D(), PositionVector(), TL, toString(), and WRITE_WARNINGF.

Referenced by libsumo::Helper::applySubscriptionFilterLateralDistanceSinglePass(), NBEdge::buildInnerEdges(), NBNodeShapeComputer::getSmoothCorner(), NBEdgeCont::splitAt(), and GNENet::splitEdge().

Here is the caller graph for this function:

◆ sub()

void PositionVector::sub ( const Position & offset)

Definition at line 685 of file PositionVector.cpp.

References add(), Position::x(), Position::y(), and Position::z().

Referenced by NBNodeShapeComputer::computeSameEnd(), getCentroid(), rotate2D(), rotateAroundFirstElement2D(), sortAsPolyCWByAngle(), and NWWriter_OpenDrive::writeRoadObjectPoly().

Here is the caller graph for this function:

◆ transformToVectorCoordinates()

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 970 of file PositionVector.cpp.

References distance2D(), Position::distanceTo2D(), extrapolate(), Position::INVALID, GeomHelper::INVALID_OFFSET, isLeft(), GeomHelper::nearest_offset_on_line_to_point2D(), positionAtOffset(), PositionVector(), and transformToVectorCoordinates().

Referenced by MSParkingArea::addLotEntry(), MSPerson::checkAccess(), MSPModel_Striping::getNextLaneObstacles(), MSPModel_Striping::moveInDirection(), MSStageDriving::setArrived(), and transformToVectorCoordinates().

Here is the caller graph for this function:

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
const PositionVector & geom )
friend

Definition at line 651 of file PositionVector.cpp.

References PositionVector().

Field Documentation

◆ EMPTY


The documentation for this class was generated from the following files: