Eclipse SUMO - Simulation of Urban MObility
|
A list of positions. More...
#include <PositionVector.h>
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 | 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 | |
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 | |
Position & | operator[] (int index) |
returns the position at the given index, negative indices are interpreted python style | |
const Position & | operator[] (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) 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 (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 | 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, PositionVector > | splitAt (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.) |
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< Position > | vp |
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) |
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 53 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 56 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 61 of file PositionVector.cpp.
Parameter Constructor used for lines.
[in] | p1 | the first position |
[in] | p2 | the second position |
Definition at line 66 of file PositionVector.cpp.
PositionVector::~PositionVector | ( | ) |
Destructor.
Definition at line 72 of file PositionVector.cpp.
void PositionVector::add | ( | const Position & | offset | ) |
Definition at line 685 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 671 of file PositionVector.cpp.
Referenced by add(), GNEContour::buildContourRectangle(), GNEMoveElement::commitMove(), NBNodeShapeComputer::computeSameEnd(), NIImporter_OpenDrive::computeShapes(), NIImporter_OpenDrive::geomFromSpiral(), getOrthogonal(), GUIGeometry::getVertexCircleAroundPosition(), NBEdge::init(), isClockwiseOriented(), GeomHelper::makeCircle(), GeomHelper::makeRing(), GNEMoveElement::moveElement(), GNEMoveFrame::ChangeZInSelection::onCmdApplyZ(), GNEMoveFrame::ShiftShapeGeometry::onCmdShiftShapeGeometry(), operator+(), operator-(), NBDistrict::reshiftPosition(), NBEdge::reshiftPosition(), NBNode::reshiftPosition(), rotateAroundFirstElement2D(), NBEdge::setGeometry(), GUIPolygon::setShape(), sortAsPolyCWByAngle(), sub(), PolygonDynamics::update(), GNEParkingSpace::updateGeometry(), GNETAZRelData::updateGeometry(), GNEPOI::updateGeometry(), GNEEdge::updateJunctionPosition(), NWWriter_OpenDrive::writeGeomPP3(), NWWriter_OpenDrive::writeGeomSmooth(), and NIImporter_OpenDrive::writeRoadObjects().
PositionVector PositionVector::added | ( | const Position & | offset | ) | const |
Definition at line 691 of file PositionVector.cpp.
Referenced by GNEJunction::commitMoveShape().
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 1554 of file PositionVector.cpp.
Referenced by NBRequest::bidiConflict(), NIImporter_OpenDrive::computeShapes(), and NBEdge::hasDefaultGeometryEndpoints().
double PositionVector::angleAt2D | ( | int | pos | ) | const |
get angle in certain position of position vector (in radians between -M_PI and M_PI)
Definition at line 1349 of file PositionVector.cpp.
References INVALID_DOUBLE.
Referenced by NBNodeShapeComputer::badIntersection(), NBNode::bezierControlPoints(), NBEdge::buildInnerEdges(), NBNode::buildWalkingAreas(), NBEdge::checkGeometry(), NBNodeShapeComputer::computeNodeShapeDefault(), GUIVehicle::drawRouteHelper(), GUIMEVehicle::drawRouteHelper(), NBEdge::getAngleAtNode(), NBEdge::getAngleAtNodeNormalized(), NBContHelper::edge_opposite_direction_sorter::getEdgeAngleAt(), NBNodeShapeComputer::getSmoothCorner(), MSPModel_Striping::insertWalkArePaths(), NBNodeShapeComputer::joinSameDirectionEdges(), MSLane::incoming_lane_priority_sorter::operator()(), MSLane::outgoing_lane_priority_sorter::operator()(), MSLink::setRequestInformation(), NWWriter_OpenDrive::writeGeomLines(), and NWWriter_OpenDrive::writeGeomPP3().
void PositionVector::append | ( | const PositionVector & | v, |
double | sameThreshold = 2.0 |
||
) |
Definition at line 760 of file PositionVector.cpp.
Referenced by NBEdge::append(), libsumo::Helper::applySubscriptionFilterLateralDistanceSinglePass(), NBNode::buildCrossingOutlines(), GNETLSEditorFrame::buildInternalLanes(), NBNode::buildWalkingAreas(), NBEdgeCont::checkOverlap(), NBNode::computeInternalLaneShape(), NBNodeShapeComputer::computeNodeShapeDefault(), GUIGeometry::drawContourGeometry(), NBEdgeCont::formFactor(), MSTransportable::getBoundingBox(), MEVehicle::getBoundingBox(), MSVehicle::getBoundingBox(), NBRequest::oppositeLeftTurnConflict(), GNENet::replaceJunctionByGeometry(), GNEConnection::updateGeometry(), NWWriter_OpenDrive::writeNetwork(), and NIImporter_OpenDrive::writeRoadObjects().
double PositionVector::area | ( | ) | const |
Returns the area (0 for non-closed)
Definition at line 557 of file PositionVector.cpp.
References area(), and isClosed().
Referenced by area(), GNEJunction::checkDrawToContour(), GNEJunction::drawGL(), GNEWalkingArea::drawGL(), NBEdgeCont::formFactor(), getCentroid(), isClockwiseOriented(), and GNELane2laneConnection::updateLane2laneConnection().
|
virtual |
Returns the information whether the position vector describes a polygon lying around the given point.
Implements AbstractPoly.
Definition at line 76 of file PositionVector.cpp.
References GeomHelper::angle2D(), around(), M_PI, scaleAbsolute(), Position::x(), and Position::y().
Referenced by MSPModel_JuPedSim::add(), around(), GNEContour::calculateContourEdgeGeometryPoints(), GNEJunction::checkDrawToContour(), GUIViewObjectsHandler::checkShapeObject(), NBEdge::computeAngle(), NBNode::computeNodeShape(), NBNode::getCenter(), GUIPerson::getGUIPosition(), getOverlapWith(), GNENetHelper::AttributeCarriers::isNetworkElementAroundShape(), 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 882 of file PositionVector.cpp.
References INVALID_DOUBLE.
Referenced by NBEdge::cutAtIntersection(), NIVissimEdge::dict_checkEdges2Join(), GUILane::getColorValueWithFunctional(), 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 1949 of file PositionVector.cpp.
Referenced by NBNode::computeSmoothShape(), MSPModel_Striping::insertWalkArePaths(), GNEEdge::smoothShape(), NWWriter_OpenDrive::writeGeomSmooth(), and NWWriter_OpenDrive::writeInternalEdge().
void PositionVector::closePolygon | ( | ) |
ensures that the last position equals the first
Definition at line 1358 of file PositionVector.cpp.
Referenced by GNEContour::buildContourClosedShape(), NBNode::buildCrossingOutlines(), GNEPoly::closePolygon(), GUIGeometry::drawContourGeometry(), GUIJunctionWrapper::drawGL(), GNEContour::drawInnenContourClosed(), GNEJunction::drawJunctionAsShape(), GNEWalkingArea::drawWalkingArea(), NBNode::getCenter(), GUIDottedGeometry::GUIDottedGeometry(), GUIJunctionWrapper::GUIJunctionWrapper(), NLHandler::openJunction(), NIVissimSingleTypeParser_Knotendefinition::parse(), NIXMLNodesHandler::processNodeType(), GNETAZ::removeGeometryPoint(), GNEPoly::setAttribute(), GNETAZ::setMoveShape(), GNEShapeFrame::shapeDrawed(), GNETAZFrame::shapeDrawed(), NBEdge::startShapeAt(), and GUIDottedGeometry::updateDottedGeometry().
Returns whether the AbstractPoly crosses the given line.
Implements AbstractPoly.
Definition at line 593 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 1386 of file PositionVector.cpp.
References Position::distanceTo2D(), GeomHelper::INVALID_OFFSET, nearest_offset_to_point2D(), and positionAtOffset2D().
Referenced by MSLane::StoringVisitor::add(), libsumo::Helper::applySubscriptionFilterLateralDistanceSinglePass(), NBNodeShapeComputer::badIntersection(), NWWriter_OpenDrive::checkLaneGeometries(), libsumo::Helper::collectObjectsInRange(), NBEdge::computeAngle(), NBNode::computeNodeShape(), libsumo::Helper::convertCartesianToRoadMap(), NBNode::cutAtShapes(), distances(), NBPTLineCont::findWay(), NBNode::getCenter(), getOverlapWith(), MSLink::isInFront(), NBEdgeCont::joinTramEdges(), NWWriter_OpenDrive::mapmatchRoadObjects(), LIBSUMO_NAMESPACE::Person::moveToXY(), LIBSUMO_NAMESPACE::Vehicle::moveToXY(), libsumo::Helper::moveToXYMap(), NBPTStop::replaceEdge(), NBEdge::shiftPositionAtNode(), transformToVectorCoordinates(), GNEStopPlan::updateGeometry(), NWWriter_OpenDrive::writeRoadObjectPOI(), and NWWriter_OpenDrive::writeRoadObjectPoly().
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 1366 of file PositionVector.cpp.
References distance2D(), and GeomHelper::INVALID_OFFSET.
Referenced by NBNodeShapeComputer::badIntersection(), MSLink::computeDistToDivergence(), NBEdge::guessOpposite(), NBNodeShapeComputer::isDivided(), NBEdge::isNearEnough2BeJoined2(), and NWWriter_OpenDrive::mapmatchRoadObjects().
void PositionVector::extrapolate | ( | const double | val, |
const bool | onlyFirst = false , |
||
const bool | onlyLast = false |
||
) |
extrapolate position vector
Definition at line 1117 of file PositionVector.cpp.
References Position::add(), Position::distanceTo(), and Position::sub().
Referenced by NBNode::buildCrossingOutlines(), NBNode::buildCrossings(), NBEdge::buildInnerEdges(), GUILane::debugDrawFoeIntersections(), GUILane::drawLinkNo(), GUILane::drawLinkRules(), GUILane::drawTLSLinkNo(), GNECrossing::drawTLSLinkNo(), NBEdge::extendGeometryAtNode(), NIVissimAbstractEdge::getGeomPosition(), MSPModel_Striping::insertWalkArePaths(), transformToVectorCoordinates(), GNETAZRelData::updateGeometry(), GNEStopPlan::updateGeometry(), 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 1139 of file PositionVector.cpp.
References Position::add(), Position::distanceTo2D(), and Position::sub().
Referenced by MSPModel_JuPedSim::addWaitingSet(), NBNodeShapeComputer::badIntersection(), NBNode::bezierControlPoints(), GNEMoveElement::calculateExtrapolatedVector(), NBNodeShapeComputer::computeNodeShapeSmall(), NBNodeShapeComputer::computeSameEnd(), MEVehicle::getBoundingBox(), MSVehicle::getBoundingBox(), MSVehicle::getBoundingPoly(), getOrthogonal(), NBNode::indirectLeftShape(), move2side(), move2sideCustom(), libsumo::Helper::moveToXYMap(), NBEdge::setNodeBorder(), and NBEdge::startShapeAt().
Boundary PositionVector::getBoxBoundary | ( | ) | const |
Returns a boundary enclosing this list of lines.
Definition at line 425 of file PositionVector.cpp.
References Boundary::add().
Referenced by LIBSUMO_NAMESPACE::Polygon::add(), MSPModel_JuPedSim::add(), PCPolyContainer::add(), NBHeightMapper::addTriangle(), NBPTStopCont::assignEdgeForFloatingStops(), GNEContour::buildContourCircle(), GNEContour::buildContourClosedShape(), GNEContour::buildContourEdge(), GNEContour::buildContourExtrudedShape(), GNEContour::buildContourRectangle(), GUIPolygon::checkDraw(), NBEdgeCont::checkOverlap(), libsumo::Helper::collectObjectsInRange(), MSLane::fill(), GUIBusStop::getCenteringBoundary(), GUIChargingStation::getCenteringBoundary(), GUIOverheadWire::getCenteringBoundary(), GUIOverheadWireClamp::getCenteringBoundary(), GNEAdditional::getCenteringBoundary(), GNETAZRelData::getCenteringBoundary(), GNEStop::getCenteringBoundary(), GUIPolygon::getCenteringBoundary(), LIBSUMO_NAMESPACE::Junction::getTree(), LIBSUMO_NAMESPACE::LaneArea::getTree(), LIBSUMO_NAMESPACE::Polygon::getTree(), GUIJunctionWrapper::GUIJunctionWrapper(), GUIParkingArea::GUIParkingArea(), NBEdgeCont::ignoreFilterMatch(), GUINet::initGUIStructures(), MSDevice_FCDReplay::FCDHandler::initLaneTree(), MSRouteHandler::initLaneTree(), RORouteHandler::initLaneTree(), NIImporter_OpenDrive::loadNetwork(), NWWriter_OpenDrive::mapmatchRoadObjects(), GUIE2Collector::MyWrapper::MyWrapper(), GNEViewNet::onCmdSelectPolygonElements(), NIVissimConnectionCluster::recomputeBoundary(), LIBSUMO_NAMESPACE::Polygon::remove(), GNETAZFrame::shapeDrawed(), GNEPoly::simplifyShape(), GNEMultiEntryExitDetector::updateCenteringBoundary(), GNERerouter::updateCenteringBoundary(), GNETAZ::updateCenteringBoundary(), GNETractionSubstation::updateCenteringBoundary(), GNEVariableSpeedSign::updateCenteringBoundary(), GNEEdge::updateCenteringBoundary(), GNEJunction::updateCenteringBoundary(), GNEPoly::updateCenteringBoundary(), and GNEDemandElementPlan::updatePlanCenteringBoundary().
Position PositionVector::getCentroid | ( | ) | const |
Returns the centroid (closes the polygon if unclosed)
Definition at line 452 of file PositionVector.cpp.
References area(), Position::INVALID, isClosed(), length(), and sub().
Referenced by GNEAdditionalHandler::buildTAZ(), GNETAZ::commitMoveShape(), NBEdge::computeAngle(), GNEBusStop::drawGL(), GNEChargingStation::drawGL(), GNEContainerStop::drawGL(), GNEEntryExitDetector::drawGL(), GNEInductionLoopDetector::drawGL(), GNEInstantInductionLoopDetector::drawGL(), GNELaneAreaDetector::drawGL(), GNECrossing::drawGL(), GUILane::drawLane2LaneConnections(), GNETAZ::getAttribute(), GNETAZ::getAttributePosition(), GUIPerson::getGUIPosition(), GNETAZ::getPositionInView(), GNEVariableSpeedSignSymbol::getPositionInView(), scaleAbsolute(), scaleRelative(), GNETAZ::setAttribute(), GNETAZ::setMoveShape(), GUIPolygon::setShape(), GNETAZFrame::shapeDrawed(), GNEParkingSpace::updateGeometry(), GNEPOI::updateGeometry(), and GNETAZ::writeAdditional().
Position PositionVector::getLineCenter | ( | ) | const |
get line center
Definition at line 521 of file PositionVector.cpp.
References length(), and positionAtOffset().
Referenced by GNEInternalLane::drawGL(), GUIParkingArea::GUIParkingArea(), GUIChargingStation::initAppearance(), GUIBusStop::initShape(), GNEBusStop::updateGeometry(), GNEChargingStation::updateGeometry(), GNEContainerStop::updateGeometry(), GNEParkingArea::updateGeometry(), and GNETAZRelData::updateGeometry().
double PositionVector::getMaxGrade | ( | double & | maxJump | ) | const |
Definition at line 1921 of file PositionVector.cpp.
References Position::distanceTo2D(), MAX2(), and Position::z().
Referenced by NBEdgeCont::checkGrade().
double PositionVector::getMinZ | ( | ) | const |
return minimum z-coordinate
Definition at line 1939 of file PositionVector.cpp.
References MIN2().
Referenced by GUILane::drawGL().
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 1789 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(), GUIBaseVehicle::drawStopLabels(), 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 133 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 435 of file PositionVector.cpp.
References Position::INVALID, and Position::x().
Referenced by NIVissimNodeCluster::buildNBNode(), NIVissimDistrictConnection::dict_BuildDistrictNodes(), GNEParkingSpace::drawGL(), GNETAZ::drawGL(), GUIPolygon::drawInnerPolygon(), GNEPoly::drawPolygonNameAndType(), NBNode::getCenter(), GNEAccess::getPositionInView(), GNECalibrator::getPositionInView(), GNEDetector::getPositionInView(), GNEOverheadWire::getPositionInView(), GNERerouterSymbol::getPositionInView(), GNERouteProbe::getPositionInView(), GNEStoppingPlace::getPositionInView(), GNEVaporizer::getPositionInView(), and NWWriter_OpenDrive::writeRoadObjectPoly().
PositionVector PositionVector::getSubpart | ( | double | beginOffset, |
double | endOffset | ||
) | const |
get subpart of a position vector
Definition at line 780 of file PositionVector.cpp.
References length(), positionAtOffset(), and push_back_noDoublePos().
Referenced by NBNode::computeInternalLaneShape(), NBEdge::cutAtIntersection(), NBNode::cutAtShapes(), GUIOverheadWire::drawGL(), NBNodeShapeComputer::getSmoothCorner(), GUIOverheadWire::GUIOverheadWire(), GUIChargingStation::initAppearance(), GUIBusStop::initShape(), NBEdgeCont::joinTramEdges(), MSParkingArea::MSParkingArea(), GUIE2Collector::MyWrapper::MyWrapper(), GUIInductLoop::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 820 of file PositionVector.cpp.
References length2D(), positionAtOffset2D(), PositionVector(), and push_back_noDoublePos().
Referenced by NBNodeShapeComputer::badIntersection(), NBNodeShapeComputer::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(), GUIGeometry::updateGeometry(), GUIGeometry::updateGeometry(), NWWriter_OpenDrive::writeRoadObjectPOI(), and NWWriter_OpenDrive::writeRoadObjectPoly().
PositionVector PositionVector::getSubpartByIndex | ( | int | beginIndex, |
int | count | ||
) | const |
get subpart of a position vector using index and a cout
Definition at line 863 of file PositionVector.cpp.
References PositionVector().
Referenced by NBNodeShapeComputer::computeNodeShapeSmall(), NBEdge::getInnerGeometry(), and NBEdge::startShapeAt().
bool PositionVector::hasElevation | ( | ) | const |
return whether two positions differ in z-coordinate
Definition at line 1569 of file PositionVector.cpp.
Referenced by NBEdge::computeEdgeShape().
int PositionVector::indexOfClosest | ( | const Position & | p, |
bool | twoD = false |
||
) | const |
Definition at line 1014 of file PositionVector.cpp.
References Position::distanceTo(), and Position::distanceTo2D().
Referenced by NIImporter_OpenDrive::addOffsets(), GNEMoveElement::calculateMoveShapeOperation(), NBPTStopCont::computeCrossProductEdgePosition(), GNEPoly::deleteGeometryPoint(), NIImporter_OpenDrive::discretizeOffsets(), GNEEdge::editEndpoint(), getOrthogonal(), GNEEdge::getSplitPos(), GNENetworkElement::getVertexIndex(), GNEPoly::getVertexIndex(), GNETAZ::getVertexIndex(), GNEViewNet::onCmdSetCustomGeometryPoint(), GNEEdge::processMoveFromJunctionSelected(), GNEEdge::processMoveToJunctionSelected(), GNEEdge::processNoneJunctionSelected(), GNETAZ::removeGeometryPoint(), GNEConnection::removeGeometryPoint(), GNECrossing::removeGeometryPoint(), GNEEdge::removeGeometryPoint(), GNEJunction::removeGeometryPoint(), GNELane::removeGeometryPoint(), GNEPoly::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 1438 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 1034 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(), GNEMoveElement::calculateMoveShapeOperation(), NIImporter_OpenDrive::discretizeOffsets(), GNEEdge::processMoveFromJunctionSelected(), GNEEdge::processMoveToJunctionSelected(), GNEEdge::processNoneJunctionSelected(), 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 1866 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 189 of file PositionVector.cpp.
References intersects(), and Position::INVALID.
Referenced by NBNodeShapeComputer::badIntersection(), NBNode::bezierControlPoints(), NBNodeShapeComputer::computeNodeShapeSmall(), NIVissimAbstractEdge::crossesEdgeAtPoint(), GeomHelper::crossPoint(), NBNode::indirectLeftShape(), intersectionPosition2D(), move2side(), and move2sideCustom().
Position PositionVector::intersectionPosition2D | ( | const PositionVector & | v1 | ) | const |
Returns the position of the intersection.
Definition at line 201 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 161 of file PositionVector.cpp.
References intersects().
Referenced by NGRandomNetBuilder::canConnect(), NBNodeShapeComputer::computeNodeShapeDefault(), NBNodeShapeComputer::computeNodeShapeSmall(), NBNodeShapeComputer::computeSameEnd(), Boundary::crosses(), crosses(), NIVissimAbstractEdge::crossesEdge(), GeomHelper::crossPoint(), NBEdgeCont::ignoreFilterMatch(), MSInternalJunction::indirectBicycleTurn(), intersectionPosition2D(), intersectionPosition2D(), intersects(), 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 1583 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 175 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 1097 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 1083 of file PositionVector.cpp.
References intersectsAtLengths2D().
Referenced by NBNodeShapeComputer::closestIntersection(), NBNodeShapeComputer::computeNodeShapeDefault(), NBNodeShapeComputer::computeSameEnd(), MSLink::contIntersect(), NBNode::cutAtShapes(), NBEdge::firstIntersection(), intersectsAtLengths2D(), MSLink::recheckSetRequestInformation(), MSLink::setRequestInformation(), and NBEdge::startShapeAt().
bool PositionVector::isClockwiseOriented | ( | void | ) |
Definition at line 1991 of file PositionVector.cpp.
References add(), area(), Position::x(), and Position::y().
bool PositionVector::isClosed | ( | ) | const |
check if PositionVector is closed
Definition at line 1452 of file PositionVector.cpp.
Referenced by area(), GNEPoly::changeFirstGeometryPoint(), GNEPoly::closePolygon(), GNEPoly::deleteGeometryPoint(), GNEPoly::getAttribute(), getCentroid(), GNEPoly::getPopUpMenu(), GNENetworkElement::getShapeEditedPopUpMenu(), GNEPoly::isPolygonClosed(), GNEPoly::openPolygon(), GNEPoly::simplifyShape(), and NWWriter_OpenDrive::writeRoadObjectPoly().
double PositionVector::isLeft | ( | const Position & | P0, |
const Position & | P1, | ||
const Position & | P2 | ||
) | const |
get left
Definition at line 754 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 1458 of file PositionVector.cpp.
Referenced by NBNode::buildCrossings().
double PositionVector::length | ( | ) | const |
Returns the length.
Definition at line 531 of file PositionVector.cpp.
Referenced by GUILane::addSecondaryShape(), NIXMLEdgesHandler::addSplit(), MSPModel_JuPedSim::addWaitingSet(), GUIGeometry::adjustStartPosGeometricPath(), libsumo::Helper::applySubscriptionFilterLateralDistanceSinglePass(), NBEdge::assignInternalLaneLength(), NBNodeShapeComputer::badIntersection(), NBEdge::buildInnerEdges(), GNETLSEditorFrame::buildInternalLanes(), NBRampsComputer::buildOffRamp(), NBRampsComputer::buildOnRamp(), NGRandomNetBuilder::canConnect(), 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(), GNELane::getColorValue(), NBTurningDirectionsComputer::getFarAngleAtNode(), NBEdge::getFinalLength(), NIVissimAbstractEdge::getGeomPosition(), NWWriter_DlrNavteq::getGraphLength(), GNELane::getLaneShapeLength(), NBEdge::Connection::getLength(), NIVissimEdge::getLength(), getLineCenter(), getOrthogonal(), NBNodeShapeComputer::getSmoothCorner(), getSubpart(), NIVissimEdge::getToNode(), GUILane::GUILane(), GUIOverheadWire::GUIOverheadWire(), GUIParkingArea::GUIParkingArea(), GUITriggeredRerouter::GUITriggeredRerouterEdge::GUITriggeredRerouterEdge(), NBEdge::haveIntersection(), NBEdge::init(), GUIChargingStation::initAppearance(), GUIBusStop::initShape(), insertAtClosest(), MSPModel_Striping::insertWalkArePaths(), interpolateZ(), GNECalibrator::isValid(), NBEdgeCont::joinTramEdges(), NIVissimConnectionCluster::liesOnSameEdgesEnd(), move2side(), MSPModel_Striping::PState::moveTo(), NIImporter_Vissim::NIVissimXMLHandler_Streckendefinition::myEndElement(), NIImporter_OpenStreetMap::RelationHandler::myEndElement(), GUIE2Collector::MyWrapper::MyWrapper(), operator+(), operator-(), NBRequest::oppositeLeftTurnConflict(), resample(), NIVissimEdge::resolveSameNode(), rotationAtOffset(), NBEdge::setGeometry(), splitAt(), NBEdgeCont::splitAt(), NBEdgeCont::splitAt(), GNENet::splitEdge(), GNETAZRelData::updateGeometry(), GNEConnection::updateGeometry(), GUIGeometry::updateGeometry(), and NWWriter_SUMO::writeLane().
double PositionVector::length2D | ( | ) | const |
Returns the length.
Definition at line 544 of file PositionVector.cpp.
Referenced by NBEdge::buildInnerEdges(), GNEAdditionalHandler::buildRerouter(), NBNode::buildWalkingAreas(), GNEMoveElement::calculateExtrapolatedVector(), GNEMoveElement::calculateLaneOffset(), GNEMoveElement::calculateMoveResult(), GNEMoveElement::calculateMoveResult(), GNEAdditional::calculatePerpendicularLine(), GNEParkingSpace::commitMoveShape(), GNEPOI::commitMoveShape(), NBEdge::computeAngle(), MSVehicle::computeAngle(), MSLink::computeDistToDivergence(), NBEdge::computeEdge2Edges(), NBEdge::computeEdgeShape(), NBNode::computeInternalLaneShape(), NBNodeShapeComputer::computeNodeShapeDefault(), NBNodeShapeComputer::computeSameEnd(), NBNode::cutAtShapes(), GNEAdditional::drawAdditionalID(), GNEAdditional::drawAdditionalName(), GNEGenericData::drawAttribute(), GNEDetector::drawE2DetectorLogo(), GNELaneAreaDetector::drawE2PartialLane(), GNEGenericData::drawFilteredAttribute(), GNEParkingSpace::drawGL(), GNELane::drawGL(), GNEVehicle::drawLanePartialGL(), GNENeteditAttributes::drawLaneReference(), GNEStoppingPlace::drawLines(), GNELane::drawOverlappedRoutes(), GNEPOI::drawPOI(), GNEStoppingPlace::drawSign(), NBEdge::extendGeometryAtNode(), NBPTStop::findLaneAndComputeBusStopExtent(), NBEdgeCont::formFactor(), GNEStop::getAttributePosition(), GNEVehicle::getAttributePosition(), GNEVehicle::getMoveOperation(), GNENeteditAttributes::getNeteditAttributesAndValues(), NBEdge::getShapeEndAngle(), NBEdge::getShapeStartAngle(), NBNodeShapeComputer::getSmoothCorner(), getSubpart2D(), GUIDottedGeometry::GUIDottedGeometry(), interpolateZ(), NIImporter_OpenDrive::loadNetwork(), move2side(), move2sideCustom(), NBContHelper::relative_outgoing_edge_sorter::operator()(), NBContHelper::relative_incoming_edge_sorter::operator()(), GNEEdge::processNoneJunctionSelected(), NIImporter_OpenStreetMap::reconstructLayerElevation(), resample(), MSLink::setRequestInformation(), NBEdge::shortenGeometryAtNode(), smoothedZFront(), GNEEdge::smoothElevation(), GNEEdge::smoothShape(), splitAt(), NBEdge::startShapeAt(), GNEParkingSpace::updateCenteringBoundary(), GUIGeometry::updateGeometry(), GUIGeometry::updateGeometry(), NWWriter_OpenDrive::writeGeomSmooth(), NWWriter_OpenDrive::writeInternalEdge(), NWWriter_OpenDrive::writeRoadObjectPOI(), and NWWriter_OpenDrive::writeRoadObjectPoly().
|
static |
Definition at line 1344 of file PositionVector.cpp.
References GeomHelper::angleDiff(), and Position::angleTo2D().
Referenced by move2side().
void PositionVector::mirrorX | ( | ) |
Definition at line 701 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 amount
Definition at line 1178 of file PositionVector.cpp.
References Position::distanceTo2D(), extrapolate2D(), gDebugFlag1, intersectionPosition2D(), Position::INVALID, length(), length2D(), localAngle(), move2side(), RAD2DEG, removeDoublePoints(), sideOffset(), and Position::z().
Referenced by NBEdge::addRestrictedLane(), 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(), MSTransportable::getBoundingBox(), MEVehicle::getBoundingBox(), MSVehicle::getBoundingBox(), MSVehicle::getBoundingPoly(), NBEdge::getCCWBoundaryLine(), NBEdge::getCWBoundaryLine(), GNEEdge::getFrontDownShapePosition(), GNEEdge::getFrontUpShapePosition(), NWWriter_OpenDrive::getInnerLaneBorder(), MSVehicle::getPosition(), GUIVehicle::getVisualPosition(), GUIOverheadWire::GUIOverheadWire(), GUIParkingArea::GUIParkingArea(), GUIChargingStation::initAppearance(), GUIBusStop::initShape(), NIImporter_OpenDrive::loadNetwork(), move2side(), GUIGeometry::moveGeometryToSide(), MSPModel_Striping::moveInDirection(), NBRampsComputer::moveRampRight(), GUIDottedGeometry::moveShapeToSide(), LIBSUMO_NAMESPACE::Person::moveToXY(), LIBSUMO_NAMESPACE::Vehicle::moveToXY(), MSLink::MSLink(), MSParkingArea::MSParkingArea(), GNEMoveFrame::ShiftEdgeSelectedGeometry::onCmdShiftEdgeGeometry(), NBRampsComputer::patchRampGeometry(), NBEdgeCont::processSplits(), GNEStoppingPlace::setStoppingPlaceGeometry(), NBEdge::shiftPositionAtNode(), NGNet::toNB(), GNEBusStop::updateGeometry(), GNEChargingStation::updateGeometry(), GNEContainerStop::updateGeometry(), GNEParkingArea::updateGeometry(), GNEParkingSpace::updateGeometry(), GNETAZRelData::updateGeometry(), GNEConnection::updateGeometry(), GNEPOI::updateGeometry(), GUIGeometry::updateGeometry(), NBSign::writeAsPOI(), NWWriter_OpenDrive::writeNetwork(), NWWriter_DlrNavteq::writeNodesUnsplitted(), NWWriter_OpenDrive::writeRoadObjectPOI(), NWWriter_OpenDrive::writeRoadObjectPoly(), and NIImporter_OpenDrive::writeRoadObjects().
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 1284 of file PositionVector.cpp.
References Position::distanceTo2D(), extrapolate2D(), intersectionPosition2D(), Position::INVALID, length2D(), sideOffset(), toString(), and Position::z().
Referenced by NIImporter_OpenDrive::loadNetwork().
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 927 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(), and MSDevice_FCDReplay::FCDHandler::myStartElement().
double PositionVector::nearest_offset_to_point2D | ( | const Position & | p, |
bool | perpendicular = true |
||
) | const |
return the nearest offest to point 2D
Definition at line 891 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(), GNEAdditionalFrame::buildAdditionalOverLane(), GNEContour::calculateContourEdgeGeometryPoints(), GNEViewNetHelper::MoveMultipleElementModul::calculateEdgeSelection(), GNEMoveElement::calculateExtrapolatedVector(), GNEMoveElement::calculateLaneOffset(), GNEMoveElement::calculateNewLaneChange(), MSPerson::checkAccess(), GUIViewObjectsHandler::checkPositionOverShape(), NBPTStopCont::computeCrossProductEdgePosition(), NBNode::cutAtShapes(), distance2D(), GNENeteditAttributes::drawLaneReference(), GNEEdge::editEndpoint(), NBEdge::extendGeometryAtNode(), NBPTStop::findLaneAndComputeBusStopExtent(), GNENeteditAttributes::getNeteditAttributesAndValues(), getOrthogonal(), getOverlapWith(), GNEAdditional::getPopUpMenu(), GNELane::getPopUpMenu(), GUIEdge::getSegmentAtPosition(), NBNodeShapeComputer::getSmoothCorner(), GNEEdge::getSplitPos(), NBEdgeCont::joinTramEdges(), libsumo::Helper::moveToXYMap(), GNEViewNet::onCmdTransformPOI(), GNEShapeFrame::processClickPOILanes(), GNEEdge::processMoveFromJunctionSelected(), GNEEdge::processMoveToJunctionSelected(), MSStageDriving::setArrived(), NBEdgeCont::splitAt(), GNENet::splitEdge(), GNETAZRelData::updateGeometry(), NWWriter_OpenDrive::writeRoadObjectPOI(), NWWriter_OpenDrive::writeRoadObjectPoly(), and NWWriter_OpenDrive::writeSignals().
double PositionVector::offsetAtIndex2D | ( | int | index | ) | const |
return the offset at the given index
Definition at line 1908 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 1521 of file PositionVector.cpp.
PositionVector PositionVector::operator+ | ( | const PositionVector & | v2 | ) | const |
adds two vectors (requires vectors of the same length)
Definition at line 1540 of file PositionVector.cpp.
References add(), length(), TL, and WRITE_ERROR.
PositionVector PositionVector::operator- | ( | const PositionVector & | v2 | ) | const |
subtracts two vectors (requires vectors of the same length)
Definition at line 1526 of file PositionVector.cpp.
References add(), length(), TL, and WRITE_ERROR.
bool PositionVector::operator== | ( | const PositionVector & | v2 | ) | const |
comparing operation
Definition at line 1515 of file PositionVector.cpp.
Position & PositionVector::operator[] | ( | int | index | ) |
returns the position at the given index, negative indices are interpreted python style
OutOfBoundsException | if index >= size or index < -size |
Definition at line 231 of file PositionVector.cpp.
const Position & PositionVector::operator[] | ( | int | index | ) | const |
returns the constant position at the given index, negative indices are interpreted python style
OutOfBoundsException | if index >= size or index < -size |
Definition at line 212 of file PositionVector.cpp.
|
virtual |
Returns the information whether the given polygon overlaps with this.
Implements AbstractPoly.
Definition at line 110 of file PositionVector.cpp.
References AbstractPoly::crosses(), partialWithin(), and AbstractPoly::partialWithin().
Referenced by MSLane::detectCollisions(), MSLane::detectPedestrianJunctionCollision(), GNENetHelper::AttributeCarriers::isNetworkElementAroundShape(), and NIVissimAbstractEdge::overlapsWith().
|
virtual |
Returns the information whether this polygon lies partially within the given polygon.
Implements AbstractPoly.
Definition at line 579 of file PositionVector.cpp.
References AbstractPoly::around().
Referenced by NBEdgeCont::ignoreFilterMatch(), and overlapsWith().
void PositionVector::pop_front | ( | ) |
pop first Position
Definition at line 1412 of file PositionVector.cpp.
Referenced by GNEEdge::commitMoveShape(), GNEViewNet::onCmdSetCustomGeometryPoint(), GNEMoveFrame::ShiftEdgeSelectedGeometry::onCmdShiftEdgeGeometry(), GNEEdge::removeGeometryPoint(), GNEEdge::setMoveShape(), and GNEEdge::setShapeStartPos().
|
static |
Returns the position between the two given point at the specified position.
Definition at line 370 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 250 of file PositionVector.cpp.
References Position::INVALID, and positionAtOffset().
Referenced by MSPModel_JuPedSim::add(), NIXMLEdgesHandler::addSplit(), MSPModel_JuPedSim::addWaitingSet(), GNETLSEditorFrame::buildInternalLanes(), NBRampsComputer::buildOffRamp(), NBRampsComputer::buildOnRamp(), GeomHelper::calculateLotSpaceAngle(), GeomHelper::calculateLotSpacePosition(), MSTrainHelper::computeCarriages(), GNEEdge::drawEdgeName(), GUIEdge::drawGL(), GLHelper::drawTriangleAtEnd(), libsumo::Helper::findObjectShape(), NBEdge::geometryPositionAtOffset(), MSLane::geometryPositionAtOffset(), ROLane::geometryPositionAtOffset(), MSStoppingPlace::getCenterPos(), NBTurningDirectionsComputer::getFarAngleAtNode(), NIVissimAbstractEdge::getGeomPosition(), MSStage::getLanePosition(), getLineCenter(), GUILane::getPopUpMenu(), MSVehicle::getPosition(), MSVTKExport::getSpeed(), GNEEdge::getSplitPos(), getSubpart(), LIBSUMO_NAMESPACE::InductionLoop::getTree(), GUIVehicle::getVisualPosition(), MSStoppingPlace::getWaitPosition(), GUICalibrator::GUICalibrator(), GUILaneSpeedTrigger::GUILaneSpeedTrigger(), GUITriggeredRerouter::GUITriggeredRerouterEdge::GUITriggeredRerouterEdge(), NIImporter_OpenDrive::loadNetwork(), MSPModel_Striping::PState::moveTo(), GNEViewNet::onCmdTransformPOI(), NIImporter_VISUM::parse_Lanes(), NIImporter_VISUM::parse_stopPoints(), positionAtOffset(), removeDoublePoints(), splitAt(), GUILane::splitAtSegments(), LIBSUMO_NAMESPACE::InductionLoop::storeShape(), transformToVectorCoordinates(), GNELane::updateGeometry(), GUIGeometry::updateGeometry(), and NBSign::writeAsPOI().
|
static |
Returns the position between the two given point at the specified position.
Definition at line 405 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 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(), NBNodeShapeComputer::computeNodeShapeDefault(), NBNodeShapeComputer::computeSameEnd(), GUIBaseVehicle::computeSeats(), NIImporter_OpenDrive::discretizeOffsets(), distance2D(), GNEAdditional::drawAdditionalID(), GNEAdditional::drawAdditionalName(), GNEGenericData::drawAttribute(), GUIGeometry::drawChildLine(), GNEDetector::drawE2DetectorLogo(), GNELaneAreaDetector::drawE2PartialLane(), GNEGenericData::drawFilteredAttribute(), GNELane::drawOverlappedRoutes(), GUIGeometry::drawParentLine(), GNEEdge::editEndpoint(), GNEStop::getAttributePosition(), GNEVehicle::getAttributePosition(), getOrthogonal(), getOverlapWith(), GUIContainer::getPosition(), MSPModel_NonInteracting::CState::getPosition(), GNELane::getPositionInView(), NBEdge::getShapeEndAngle(), NBEdge::getShapeStartAngle(), getSubpart2D(), insertAtClosest(), NBEdgeCont::joinTramEdges(), nearest_offset_to_point25D(), nearest_offset_to_point2D(), NBContHelper::relative_outgoing_edge_sorter::operator()(), NBContHelper::relative_incoming_edge_sorter::operator()(), positionAtOffset2D(), GNEEdge::processMoveFromJunctionSelected(), GNEEdge::processMoveToJunctionSelected(), GNEEdge::processNoneJunctionSelected(), resample(), smoothedZFront(), GNEEdge::smoothElevation(), GNEEdge::smoothShape(), splitAt(), NBEdge::startShapeAt(), GNETAZRelData::updateGeometry(), GNEStopPlan::updateGeometry(), NWWriter_OpenDrive::writeGeomSmooth(), NWWriter_OpenDrive::writeRoadObjectPOI(), NWWriter_OpenDrive::writeRoadObjectPoly(), and NIImporter_OpenDrive::writeRoadObjects().
void PositionVector::prepend | ( | const PositionVector & | v, |
double | sameThreshold = 2.0 |
||
) |
Definition at line 770 of file PositionVector.cpp.
Referenced by libsumo::Helper::applySubscriptionFilterLateralDistanceSinglePass().
void PositionVector::push_back_noDoublePos | ( | const Position & | p | ) |
insert in back a non double position
Definition at line 1422 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(), insert_noDoublePos(), MSPModel_Striping::insertWalkArePaths(), NIImporter_ArcView::load(), PCLoaderOSM::loadIfSet(), NIImporter_Vissim::NIVissimXMLHandler_Streckendefinition::myEndElement(), NIVissimAbstractEdge::NIVissimAbstractEdge(), NIVissimSingleTypeParser_Streckendefinition::parse(), NIVissimSingleTypeParser_Verbindungsdefinition::parse(), GNENet::replaceJunctionByGeometry(), and GUIGeometry::updateGeometry().
void PositionVector::push_front | ( | const Position & | p | ) |
insert in front a Position
Definition at line 1402 of file PositionVector.cpp.
Referenced by NIXMLEdgesHandler::addLane(), push_front_noDoublePos(), GNEEdge::setShapeStartPos(), and GNENetworkElement::straigthenShapeEdited().
void PositionVector::push_front_noDoublePos | ( | const Position & | p | ) |
insert in front a non double position
Definition at line 1430 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(), NBEdge::startShapeAt(), and GUIGeometry::updateGeometry().
int PositionVector::removeClosest | ( | const Position & | p | ) |
removes the point closest to p and return the removal index
Definition at line 1064 of file PositionVector.cpp.
References Position::distanceTo2D().
Referenced by NWWriter_OpenDrive::writeGeomSmooth().
void PositionVector::removeDoublePoints | ( | double | minDist = POSITION_EPS , |
bool | assertLength = false , |
||
int | beginOffset = 0 , |
||
int | endOffset = 0 , |
||
bool | resample = 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 1471 of file PositionVector.cpp.
References positionAtOffset(), and resample().
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 | length of every segment |
[in] | adjustEnd | enable or disable adjust end (i.e. result has the same original length, last segment could be short) |
Definition at line 1885 of file PositionVector.cpp.
References length(), length2D(), and positionAtOffset2D().
Referenced by removeDoublePoints(), GNEEdge::smoothElevation(), and GUIDottedGeometry::updateDottedGeometry().
PositionVector PositionVector::reverse | ( | ) | const |
reverse position vector
Definition at line 1161 of file PositionVector.cpp.
Referenced by NBRailwayTopologyAnalyzer::addBidiEdge(), GNENet::addReversedEdge(), NBNodeShapeComputer::badIntersection(), NBRequest::bidiConflict(), NIImporter_OpenDrive::buildConnectionsToOuter(), GNEContour::buildContourEdge(), GNEContour::buildContourExtrudedShape(), NBNode::buildCrossingOutlines(), GNETLSEditorFrame::buildInternalLanes(), NBNode::buildWalkingAreas(), GNEMoveElement::calculateExtrapolatedVector(), NBEdge::checkGeometry(), MSLink::computeDistToDivergence(), NBEdge::computeEdgeShape(), NBNode::computeInternalLaneShape(), NBEdge::computeLaneShapes(), NBEdge::cutAtIntersection(), GUIGeometry::drawContourGeometry(), GUILane::drawLinkNo(), GUILane::drawLinkRules(), GUILane::drawTLSLinkNo(), GNECrossing::drawTLSLinkNo(), MSTransportable::getBoundingBox(), MEVehicle::getBoundingBox(), MSVehicle::getBoundingBox(), NBEdge::getCCWBoundaryLine(), NBEdge::getCWBoundaryLine(), NWWriter_SUMO::getInternalBidi(), NBNodeShapeComputer::getSmoothCorner(), NBEdge::init(), NIImporter_OpenStreetMap::insertEdge(), MSPModel_Striping::insertWalkArePaths(), NBEdge::isBidiEdge(), NBEdge::isBidiRail(), NIImporter_ArcView::load(), NIImporter_OpenDrive::loadNetwork(), NBEdge::NBEdge(), NIImporter_VISUM::parse_AreaSubPartElement(), NBEdgeCont::recheckLanes(), NBEdge::reduceGeometry(), NIImporter_DlrNavteq::EdgesHandler::report(), GNENet::reverseEdge(), GNEEdge::setAttribute(), NWWriter_OpenDrive::writeNetwork(), and NIImporter_OpenDrive::writeRoadObjects().
void PositionVector::rotate2D | ( | double | angle | ) |
Definition at line 1667 of file PositionVector.cpp.
Referenced by GNEContour::buildContourRectangle(), NIImporter_OpenDrive::geomFromSpiral(), getOrthogonal(), rotateAroundFirstElement2D(), GUIPolygon::setShape(), PolygonDynamics::update(), GNEParkingSpace::updateGeometry(), NWWriter_OpenDrive::writeGeomPP3(), NWWriter_OpenDrive::writeRoadObjectPoly(), and NIImporter_OpenDrive::writeRoadObjects().
void PositionVector::rotateAroundFirstElement2D | ( | double | angle | ) |
Definition at line 1682 of file PositionVector.cpp.
References add(), rotate2D(), and sub().
Referenced by GNEStopPlan::updateGeometry().
double PositionVector::rotationAtOffset | ( | double | pos | ) | const |
Returns the rotation at the given length.
Definition at line 317 of file PositionVector.cpp.
References Position::angleTo2D(), Position::distanceTo(), INVALID_DOUBLE, and length().
Referenced by MSPModel_JuPedSim::add(), MSDevice_SSM::classifyEncounter(), MSVehicle::computeAngle(), GNEEdge::drawEdgeName(), GUIEdge::drawGL(), GUIEdge::drawMesoVehicles(), MEVehicle::getAngle(), MSPModel_Striping::PState::getAngle(), LIBSUMO_NAMESPACE::Lane::getAngle(), GUIVehicle::getVisualAngle(), LIBSUMO_NAMESPACE::Person::moveToXY(), LIBSUMO_NAMESPACE::Vehicle::moveToXY(), rotationDegreeAtOffset(), MSLink::setRequestInformation(), NBSign::writeAsPOI(), NWWriter_OpenDrive::writeRoadObjectPoly(), and NIImporter_OpenDrive::writeRoadObjects().
double PositionVector::rotationDegreeAtOffset | ( | double | pos | ) | const |
Returns the rotation at the given length.
Definition at line 342 of file PositionVector.cpp.
References GeomHelper::legacyDegree(), and rotationAtOffset().
Referenced by GUIE3Collector::MyWrapper::buildDefinition(), GNEAdditional::drawAdditionalID(), GNEAdditional::drawAdditionalName(), GNEDetector::drawE2DetectorLogo(), GNELaneAreaDetector::drawE2PartialLane(), GNEEdge::drawEdgeName(), GNEGenericData::drawFilteredAttribute(), GUIEdge::drawGL(), GNEStoppingPlace::drawLines(), GNELane::drawOverlappedRoutes(), GNEStoppingPlace::drawSign(), GUICalibrator::GUICalibrator(), GUILaneSpeedTrigger::GUILaneSpeedTrigger(), GUIOverheadWire::GUIOverheadWire(), GUIParkingArea::GUIParkingArea(), GUITriggeredRerouter::GUITriggeredRerouterEdge::GUITriggeredRerouterEdge(), GUIChargingStation::initAppearance(), GUIBusStop::initShape(), GUIInductLoop::MyWrapper::MyWrapper(), GUIInstantInductLoop::MyWrapper::MyWrapper(), GUIMEInductLoop::MyWrapper::MyWrapper(), GNELane::updateGeometry(), and GUIGeometry::updateGeometry().
void PositionVector::scaleAbsolute | ( | double | offset | ) |
enlarges/shrinks the polygon by an absolute offset based at the centroid
Definition at line 512 of file PositionVector.cpp.
References getCentroid().
Referenced by around(), and GNEParkingSpace::drawSpace().
void PositionVector::scaleRelative | ( | double | factor | ) |
enlarges/shrinks the polygon by a factor based at the centroid
Definition at line 503 of file PositionVector.cpp.
References getCentroid().
Referenced by GNEContour::buildContourClosedShape(), GNEContour::buildContourRectangle(), GUIJunctionWrapper::drawGL(), GNEContour::drawInnenContourClosed(), GNEJunction::drawJunctionAsShape(), GNEWalkingArea::drawWalkingArea(), MSVehicle::getBoundingPoly(), and GUIGeometry::scaleGeometry().
|
static |
get a side position of position vector using a offset
Definition at line 1171 of file PositionVector.cpp.
References Position::distanceTo2D(), Position::x(), and Position::y().
Referenced by NWWriter_OpenDrive::checkLaneGeometries(), move2side(), move2sideCustom(), positionAtOffset(), and positionAtOffset2D().
|
static |
Definition at line 393 of file PositionVector.cpp.
References DEG2RAD, Position::distanceTo(), and Position::INVALID.
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().
PositionVector PositionVector::simplified | ( | ) | const |
return the same shape with intermediate colinear points removed
Definition at line 1694 of file PositionVector.cpp.
References Position::distanceTo2D(), Position::x(), and Position::y().
Referenced by NWWriter_SUMO::writeJunction().
const PositionVector PositionVector::simplified2 | ( | const bool | closed, |
const double | eps = NUMERICAL_EPS |
||
) | const |
Definition at line 1719 of file PositionVector.cpp.
References Position::distanceTo(), Position::length(), and MIN2().
Referenced by NIImporter_OpenDrive::computeShapes(), and NIImporter_OpenDrive::loadNetwork().
double PositionVector::slopeDegreeAtOffset | ( | double | pos | ) | const |
Returns the slope at the given length.
Definition at line 348 of file PositionVector.cpp.
References Position::distanceTo(), INVALID_DOUBLE, RAD2DEG, and Position::slopeTo2D().
Referenced by GeomHelper::calculateLotSpaceSlope(), 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 1834 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 658 of file PositionVector.cpp.
void PositionVector::sortByIncreasingXY | ( | ) |
sort by increasing X-Y Positions
Definition at line 736 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 599 of file PositionVector.cpp.
References length(), length2D(), positionAtOffset(), positionAtOffset2D(), TL, toString(), and WRITE_WARNINGF.
Referenced by libsumo::Helper::applySubscriptionFilterLateralDistanceSinglePass(), NBEdge::buildInnerEdges(), NBNodeShapeComputer::getSmoothCorner(), NBEdgeCont::splitAt(), and GNENet::splitEdge().
void PositionVector::sub | ( | const Position & | offset | ) |
Definition at line 679 of file PositionVector.cpp.
References add(), Position::x(), Position::y(), and Position::z().
Referenced by NBNodeShapeComputer::computeSameEnd(), getCentroid(), rotateAroundFirstElement2D(), GUIPolygon::setShape(), sortAsPolyCWByAngle(), and NWWriter_OpenDrive::writeRoadObjectPoly().
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 964 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(), MSPerson::checkAccess(), MSPModel_Striping::getNextLaneObstacles(), MSPModel_Striping::moveInDirection(), MSStageDriving::setArrived(), and transformToVectorCoordinates().
|
friend |
Definition at line 645 of file PositionVector.cpp.
|
static |
empty Vector
Definition at line 71 of file PositionVector.h.
Referenced by NIImporter_SUMO::addConnection(), NIXMLConnectionsHandler::addCrossing(), NIXMLConnectionsHandler::addWalkingArea(), NBEdge::applyTurnSigns(), GNECrossingFrame::CreateCrossing::onCmdCreateCrossing(), NIImporter_DlrNavteq::ConnectedLanesHandler::report(), and GNEEdge::smoothShape().