A circle in the plane. More...
#include <Circle2D.hpp>
Public Types | |
typedef Ellipse2D | base_class |
Base class. More... | |
Public Types inherited from datatypes::Ellipse2D | |
typedef Point2D::value_type | value_type |
The type of the stored x, y coordinates, and the rotation. More... | |
Public Member Functions | |
Circle2D () | |
Constructor for an all-zero Circle2D. More... | |
Circle2D (const Point2D ¢er, value_type radius) | |
Constructor with specified center point and radius. More... | |
Circle2D (value_type x_center, value_type y_center, value_type radius) | |
Constructor with all values given. More... | |
bool | containsPoint (const Point2D &point) const |
Returns true if the given Point2D is inside this ellipse or on its outline. More... | |
value_type | getRadius () const |
Returns the radius of this circle. More... | |
virtual const UINT32 | getUsedMemory () const |
void | setRadius (value_type radius) |
Sets the radius of this circle. Must be non-negative. More... | |
Public Member Functions inherited from datatypes::Ellipse2D | |
Ellipse2D () | |
Constructor for an all-zero Ellipse2D. More... | |
Ellipse2D (const Point2D ¢er, const Point2D &radius, value_type rotation=0.0) | |
Constructor with specified center point, radius, and rotation. More... | |
Ellipse2D (value_type x_center, value_type y_center, value_type x_radius, value_type y_radius, value_type rotation=0.0) | |
Constructor with all values given. More... | |
std::string | toString () const |
const Point2D & | getCenter () const |
Returns the center point of this Ellipse. More... | |
const Point2D & | getRadius () const |
Returns the radius of this Ellipse. More... | |
value_type | getRotation () const |
void | setCenter (const Point2D &p) |
Sets the center point of this Ellipse2D. More... | |
void | setCenter (value_type x, value_type y) |
Sets the center point of this Ellipse2D. More... | |
void | setRadius (const Point2D &p) |
Sets the radius of this Ellipse. Must be non-negative. More... | |
void | setRadius (value_type x_length, value_type y_width) |
Sets the radius of this Ellipse2D. Must be non-negative. More... | |
void | setRotation (value_type r) |
bool | containsPoint (const Point2D &point) const |
Returns true if the given Point2D is inside this ellipse or on its outline. More... | |
Public Member Functions inherited from datatypes::BasicData | |
BasicData () | |
UINT16 | getDatatype () |
UINT16 | getSourceId () |
virtual void | setSourceId (UINT16 id) |
virtual | ~BasicData () |
Additional Inherited Members | |
Protected Attributes inherited from datatypes::Ellipse2D | |
Point2D | m_center |
Point2D | m_radius |
value_type | m_rotation |
Protected Attributes inherited from datatypes::BasicData | |
UINT16 | m_datatype |
UINT16 | m_sourceId |
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.
datatypes::Circle2D::Circle2D | ( | ) |
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.)
Definition at line 37 of file Circle2D.cpp.
|
inline |
Returns the radius of this circle.
Definition at line 60 of file Circle2D.hpp.
|
inlinevirtual |
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.