Public Types | Public Member Functions | List of all members
datatypes::Circle2D Class Reference

A circle in the plane. More...

#include <Circle2D.hpp>

Inheritance diagram for datatypes::Circle2D:
Inheritance graph
[legend]

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 &center, 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 &center, 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 Point2DgetCenter () const
 Returns the center point of this Ellipse. More...
 
const Point2DgetRadius () 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
 

Detailed Description

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.

Member Typedef Documentation

Base class.

Definition at line 25 of file Circle2D.hpp.

Constructor & Destructor Documentation

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.

Note
The radius components must be non-negative, otherwise an assertion will fail.
Parameters
centerThe center point
radiusThe 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.

Note
The radius components must be non-negative, otherwise an assertion will fail.
Parameters
x_centerX-coordinate of center point
y_centerY-coordinate of center point
radiusThe radius of the circle. Must be non-negative.

Definition at line 26 of file Circle2D.cpp.

Member Function Documentation

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.

value_type datatypes::Circle2D::getRadius ( ) const
inline

Returns the radius of this circle.

Definition at line 60 of file Circle2D.hpp.

virtual const UINT32 datatypes::Circle2D::getUsedMemory ( ) const
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.


The documentation for this class was generated from the following files:


libsick_ldmrs
Author(s): SICK AG , Martin Günther , Jochen Sprickerhof
autogenerated on Mon Oct 26 2020 03:27:30