7 #include "../BasicDatatypes.hpp" 76 Polygon2D(
const std::string& polygonAsString);
89 static Polygon2D fromEllipse(
const Point2D& center,
const floatingpoint_type a,
const floatingpoint_type b,
const floatingpoint_type angle,
const UINT32 samplingPoints = 32 );
123 const floatingpoint_type startAngle,
const floatingpoint_type endAngle,
124 const UINT32 samplingPoints,
const bool clockwise);
170 const floatingpoint_type startAngle,
const floatingpoint_type endAngle,
171 const UINT32 samplingPoints = 32);
bool isColliding(const Polygon2D &p2) const
Returns true if the given polygon collides with this polygon.
static Polygon2D createRectangle(const Point2D &lowerLeft, const Point2D &upperRight)
std::string toString() const
Text output for debugging.
bool containsPoint(const Point2D &point) const
Returns true if the given Point2D is inside this polygon.
A rotated 2-dimensional box in the plane.
Point2D getCenterOfGravity() const
Returns the center of gravity of this polygon.
Box2D getBoundingBox() const
Returns a Box in parallel to the coordinate system that bounds this polygon.
Polygon2D getSimplified() const
Returns a polygon with potentially less edge points.
Point2D::value_type floatingpoint_type
Polygon2D()
Constructor for an empty polygon.
std::pair< floatingpoint_type, floatingpoint_type > getBoundingAngles() const
static Polygon2D rhombus(const Point2D ¢er, const floatingpoint_type radius)
Static function to create a rhombus.
Polygon2D & append(const Polygon2D &other)
Appends the points of the other polygon to this polygon.
bool isClosed() const
Returns true if this is explicitly a closed polygon.
static Polygon2D fromArc(const Ellipse2D &ellipse, const floatingpoint_type startAngle, const floatingpoint_type endAngle, const UINT32 samplingPoints, const bool clockwise)
(DEPRECATED) Create a Polygon2D approximation of the arc of an ellipse
base_class isIntersecting(const Line2D &other) const
Calculates all intersection points between a line and this polygon.
A line in the two-dimensional plane, composed out of two points.
double value_type
The type of the stored x and y coordinates.
static Polygon2D fromEllipse(const Point2D ¢er, const floatingpoint_type a, const floatingpoint_type b, const floatingpoint_type angle, const UINT32 samplingPoints=32)
Static function to create a Polygon2D from ellipse parameters.
static Polygon2D fromCircle(const Point2D ¢er, const floatingpoint_type radius, const UINT32 samplingPoints=32)
Static function to get Polygon2D from circle parameters.
A rotated 2-dimensional ellipse in the plane.
static const char * getSeparatorCharacters()
virtual const UINT32 getUsedMemory() const
Point2D::value_type distanceToPoint(const Point2D &point) const
Returns the distance of a point to this polyon.
std::vector< Point2D > base_class
The base type. (Naming according to boost convention.)
double getArea() const
Returns the area enclosed by this polygon.
std::ostream & operator<<(std::ostream &os, const EvalCaseResult &result)