45 Boundary(
double x1,
double y1,
double x2,
double y2);
48 Boundary(
double x1,
double y1,
double z1,
double x2,
double y2,
double z2);
57 void add(
double x,
double y,
double z = 0);
105 bool around2D(
const double x,
const double y)
const;
159 void moveby(
double x,
double y,
double z = 0);
A class that stores a 2D geometrical boundary.
Position getCenter() const
Returns the center of the boundary.
bool partialWithin(const AbstractPoly &poly, double offset=0) const
Returns whether the boundary is partially within the given polygon.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
void moveby(double x, double y, double z=0)
Moves the boundary by the given amount.
void growHeight(double by)
Increases the height of the boundary (y-axis)
bool isInitialised() const
check if Boundary is Initialised
double ymin() const
Returns minimum y-coordinate.
void reset()
Resets the boundary.
double xmin() const
Returns minimum x-coordinate.
Boundary & grow(double by)
extends the boundary by the given amount
void flipY()
flips ymin and ymax
double distanceTo2D(const Position &p) const
returns the euclidean distance in the x-y-plane
double getHeight() const
Returns the height of the boundary (y-axis)
bool myWasInitialised
Information whether the boundary was initialised.
bool overlapsWith(const AbstractPoly &poly, double offset=0) const
Returns whether the boundary overlaps with the given polygon.
Boundary()
Constructor - the boundary is unset.
bool contains2D(const Boundary &b) const
return true if this boundary contains the given boundary (only X-Y)
double getWidth() const
Returns the width of the boudary (x-axis)
bool operator!=(const Boundary &b) const
Comparison operator not equal.
PositionVector getShape(const bool closeShape) const
get position vector (shape) based on this boundary
void set(double xmin, double ymin, double xmax, double ymax)
Sets the boundary to the given values.
Boundary & scale(double by)
scale the boundary by the given amount
double zmin() const
Returns minimum z-coordinate.
bool around2D(const Position &p, double offset=0) const
Returns whether the boundary contains the given 2D coordinate (position)
void growWidth(double by)
Increases the width of the boundary (x-axis)
bool crosses(const Position &p1, const Position &p2) const
Returns whether the boundary crosses the given line.
bool around(const Position &p, double offset=0) const
Returns whether the boundary contains the given coordinate.
void setOffsets(double xmin, double ymin, double xmax, double ymax)
Sets the boundary to the given values, ignoring min < max constraints.
double ymax() const
Returns maximum y-coordinate.
double myXmin
The boundaries.
double xmax() const
Returns maximum x-coordinate.
friend std::ostream & operator<<(std::ostream &os, const Boundary &b)
Output operator.
double zmax() const
Returns maximum z-coordinate.
double getZRange() const
Returns the elevation range of the boundary (z-axis)
bool overlaps2D(const Boundary &b) const
return true if at least one point of the given boundary is in boundary(only X-Y)
bool operator==(const Boundary &b) const
Comparison operator equal.
A point in 2D or 3D with translation and scaling methods.