10 #include "../BasicDatatypes.hpp" 82 Box2D(value_type x_center, value_type y_center, value_type x_size, value_type y_size, value_type rotation = 0.0);
157 void setSize(value_type x_length, value_type y_width);
221 const std::vector<Point2D>::const_iterator& end)
const;
241 static Box2D orientatedBox(value_type orientation_rad,
const std::vector<Point2D>& points);
253 const std::vector<Point2D>::const_iterator& begin,
254 const std::vector<Point2D>::const_iterator& end);
value_type getRotation() const
std::string toString() const
const Point2D & getCenter() const
Returns the center point of this Box.
friend bool operator!=(const Box2D &, const Box2D &)
const Point2D & getSize() const
Returns the size of this Box.
A rotated 2-dimensional box in the plane.
void setSize(const Point2D &p)
Sets the size of this Box. Must be non-negative.
std::pair< value_type, value_type > getBoundingAngles() const
Returns boundary angles for this box.
Box2D movedBy(const Point2D ¢erMovement) const
Returns a Box that is copied from this one but with its center point moved.
Polygon2D toPolygon() const
Converts this Box2D to a closed polygon.
static Box2D orientatedBox(value_type orientation_rad, const Polygon2D &poly)
Returns an orientated bounding box for the given list of points.
Point2D::value_type distanceFromOutline(const Point2D &point) const
Returns the distance from the outline of this Box2D to the given point.
Point2D::value_type value_type
The type of the stored x, y coordinates, and the rotation.
friend bool operator==(const Box2D &, const Box2D &)
void setRotation(value_type r)
Sets the rotation angle of this Box in [radians], counter clock wise.
void setCenter(value_type x, value_type y)
Sets the center point of this Box2D.
void setCenter(const Point2D &p)
Sets the center point of this Box2D.
void setXY(value_type x, value_type y)
Box2D toBoundingBox() const
Returns a Box in parallel to the coordinate system that bounds this box.
Box2D()
Constructor for an all-zero Box2D.
double value_type
The type of the stored x and y coordinates.
bool containsPoint(const Point2D &point) const
Returns true if the given Point2D is inside this box or on its outline.
virtual const UINT32 getUsedMemory() const
void moveBy(const Point2D ¢erMovement)
Move the center point of this box by the given point values.
void verifyNumericRanges()