22 #ifndef PositionVector_h
23 #define PositionVector_h
56 typedef std::vector<Position>
vp;
76 using vp::const_iterator;
77 using vp::const_reference;
201 std::pair<PositionVector, PositionVector>
splitAt(
SUMOReal where)
const;
void removeColinearPoints()
void pruneFromBeginAt(const Position &p)
SUMOReal nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
PositionVector getSubpart2D(SUMOReal beginOffset, SUMOReal endOffset) const
Position positionAtOffset(SUMOReal pos) const
Returns the position at the given length.
void sortAsPolyCWByAngle()
void replaceAt(int index, const Position &by)
void insertAt(int index, const Position &p)
friend std::ostream & operator<<(std::ostream &os, const PositionVector &geom)
Output operator.
std::vector< SUMOReal > distances(const PositionVector &s) const
Position getCentroid() const
Returns the centroid (closes the polygon if unclosed)
bool intersects(const Position &p1, const Position &p2) const
bool partialWithin(const AbstractPoly &poly, SUMOReal offset=0) const
Returns the information whether this polygon lies partially within the given polygon.
bool around(const Position &p, SUMOReal offset=0) const
Returns the information whether the position vector describes a polygon lying around the given point ...
SUMOReal beginEndAngle() const
const Position & operator[](int index) const
returns the position at the given index !!! exceptions?
A class that stores a 2D geometrical boundary.
PositionVector reverse() const
SUMOReal slopeDegreeAtOffset(SUMOReal pos) const
Returns the slope at the given length.
PositionVector convexHull() const
~PositionVector()
Destructor.
SUMOReal length2D() const
Returns the length.
void scaleSize(SUMOReal factor)
enlarges/shrinks the polygon based at the centroid
Line lineAt(int pos) const
void push_front_noDoublePos(const Position &p)
void reshiftRotate(SUMOReal xoff, SUMOReal yoff, SUMOReal rot)
A point in 2D or 3D with translation and scaling methods.
Position pop_front()
Removes and returns the position at the fron of the list.
std::vector< Position > vp
void add(SUMOReal xoff, SUMOReal yoff, SUMOReal zoff)
int indexOfClosest(const Position &p) const
int operator()(const Position &p1, const Position &p2) const
comparing operation
void push_front(const Position &p)
Puts the given position at the front of the list.
SUMOReal distance(const Position &p) const
int insertAtClosest(const Position &p)
as_poly_cw_sorter()
constructor
void sortByIncreasingXY()
Position intersectsAtPoint(const Position &p1, const Position &p2) const
bool operator==(const PositionVector &v2) const
comparing operation
std::pair< PositionVector, PositionVector > splitAt(SUMOReal where) const
Returns the two lists made when this list vector is splitted at the given point.
void extrapolate(SUMOReal val)
PositionVector()
Constructor.
SUMOReal length() const
Returns the length.
SUMOReal rotationDegreeAtOffset(SUMOReal pos) const
Returns the rotation at the given length.
void push_back(const PositionVector &p)
Appends all positions from the given vector.
void removeDoublePoints(SUMOReal minDist=POSITION_EPS, bool assertLength=false)
Removes positions if too near.
PositionVector intersectionPoints2D(const Line &line) const
int appendWithCrossingPoint(const PositionVector &v)
Position positionAtOffset2D(SUMOReal pos) const
Returns the position at the given length.
bool overlapsWith(const AbstractPoly &poly, SUMOReal offset=0) const
Returns the information whether the given polygon overlaps with this Again a boundary may be specifie...
void pruneFromEndAt(const Position &p)
Position getLineCenter() const
void move2side(SUMOReal amount)
void push_back_noDoublePos(const Position &p)
int operator()(const Position &p1, const Position &p2) const
comparing operation
Position getPolygonCenter() const
Returns the arithmetic of all corner points.
SUMOReal area() const
Returns the area (0 for non-closed)
std::vector< SUMOReal > intersectsAtLengths2D(const PositionVector &other) const
For all intersections between this vector and other, return the 2D-length of the subvector from this ...
void closePolygon()
ensures that the last position equals the first
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
void append(const PositionVector &v)
increasing_x_y_sorter()
constructor
bool crosses(const Position &p1, const Position &p2) const
PositionVector getSubpart(SUMOReal beginOffset, SUMOReal endOffset) const
SUMOReal isLeft(const Position &P0, const Position &P1, const Position &P2) const