39 #ifdef CHECK_MEMORY_LEAKS 41 #endif // CHECK_MEMORY_LEAKS 48 : myXmin(10000000000.0), myXmax(-10000000000.0),
49 myYmin(10000000000.0), myYmax(-10000000000.0),
50 myWasInitialised(false) {}
SUMOReal myXmin
The boundaries.
SUMOReal getHeight() const
Returns the height of the boundary.
void growWidth(SUMOReal by)
SUMOReal getWidth() const
Returns the width of the boudary.
Position getCenter() const
Returns the center of the boundary.
bool around(const Position &p, SUMOReal offset=0) const
Returns whether the boundary contains the given coordinate.
virtual bool partialWithin(const AbstractPoly &poly, SUMOReal offset=0) const =0
SUMOReal ymin() const
Returns minimum y-coordinate.
bool partialWithin(const AbstractPoly &poly, SUMOReal offset=0) const
Returns whether the boundary is partially within the given polygon.
SUMOReal xmin() const
Returns minimum x-coordinate.
bool intersects(const Position &p1, const Position &p2) const
Returns the information whether this list of points interesects the given line.
virtual bool crosses(const Position &p1, const Position &p2) const =0
friend std::ostream & operator<<(std::ostream &os, const Boundary &b)
Output operator.
SUMOReal x() const
Returns the x-position.
SUMOReal xmax() const
Returns maximum x-coordinate.
A class that stores a 2D geometrical boundary.
void set(SUMOReal xmin, SUMOReal ymin, SUMOReal xmax, SUMOReal ymax)
Sets the boundary to the given values.
bool overlapsWith(const AbstractPoly &poly, SUMOReal offset=0) const
Returns whether the boundary overlaps with the given polygon.
A point in 2D or 3D with translation and scaling methods.
bool myWasInitialised
Information whether the boundary was initialised.
virtual bool around(const Position &p, SUMOReal offset=0) const =0
void add(SUMOReal x, SUMOReal y)
Makes the boundary include the given coordinate.
void reset()
Resets the boundary.
Boundary & grow(SUMOReal by)
extends the boundary by the given amount
void flipY()
flips ymin and ymax
SUMOReal y() const
Returns the y-position.
SUMOReal ymax() const
Returns maximum y-coordinate.
void growHeight(SUMOReal by)
void moveby(SUMOReal x, SUMOReal y)
Moves the boundary by the given amount.
bool crosses(const Position &p1, const Position &p2) const
Returns whether the boundary crosses the given line.
Boundary()
Constructor - the boundary is unset.