A circle in the plane. More...
#include <Circle2D.hpp>
Public Types | |
typedef Ellipse2D | base_class |
Base class. | |
Public Member Functions | |
Circle2D () | |
Constructor for an all-zero Circle2D. | |
Circle2D (const Point2D ¢er, value_type radius) | |
Constructor with specified center point and radius. | |
Circle2D (value_type x_center, value_type y_center, value_type radius) | |
Constructor with all values given. | |
bool | containsPoint (const Point2D &point) const |
Returns true if the given Point2D is inside this ellipse or on its outline. | |
value_type | getRadius () const |
Returns the radius of this circle. | |
virtual const UINT32 | getUsedMemory () const |
void | setRadius (value_type radius) |
Sets the radius of this circle. Must be non-negative. |
A circle in the plane.
This circle is defined by its center point and its radius.
The radius argument must be non-negative.
Definition at line 21 of file Circle2D.hpp.
Base class.
Definition at line 25 of file Circle2D.hpp.
Constructor for an all-zero Circle2D.
Definition at line 14 of file Circle2D.cpp.
datatypes::Circle2D::Circle2D | ( | const Point2D & | center, |
value_type | radius | ||
) |
Constructor with specified center point and radius.
center | The center point |
radius | The radius of the circle. |
Definition at line 20 of file Circle2D.cpp.
datatypes::Circle2D::Circle2D | ( | value_type | x_center, |
value_type | y_center, | ||
value_type | radius | ||
) |
Constructor with all values given.
Constructor with all values given: x/y of center point, x/y of size (where the x coordinate of the size is in the same direction as the x axis of the coordinate system, rotated by the rotation argument; the y coordinate accordingly), and rotation.
x_center | X-coordinate of center point |
y_center | Y-coordinate of center point |
radius | The radius of the circle. Must be non-negative. |
Definition at line 26 of file Circle2D.cpp.
bool datatypes::Circle2D::containsPoint | ( | const Point2D & | point | ) | const |
Returns true if the given Point2D is inside this ellipse or on its outline.
(Note: This function is relatively cheap.)
Reimplemented from datatypes::Ellipse2D.
Definition at line 37 of file Circle2D.cpp.
value_type datatypes::Circle2D::getRadius | ( | ) | const [inline] |
Returns the radius of this circle.
Reimplemented from datatypes::Ellipse2D.
Definition at line 60 of file Circle2D.hpp.
virtual const UINT32 datatypes::Circle2D::getUsedMemory | ( | ) | const [inline, virtual] |
Reimplemented from datatypes::Ellipse2D.
Definition at line 57 of file Circle2D.hpp.
void datatypes::Circle2D::setRadius | ( | value_type | radius | ) |
Sets the radius of this circle. Must be non-negative.
Definition at line 32 of file Circle2D.cpp.