Public Member Functions | List of all members
Circle Class Reference

A circle. More...

#include <shape_2d.hpp>

Inheritance diagram for Circle:
Inheritance graph
[legend]
Collaboration diagram for Circle:
Collaboration graph
[legend]

Public Member Functions

 Circle (Vector2D const &center, double radius)
 Class constructor. More...
 
bool operator() (const Vector2D &r) const
 Returns true is a point is inside the shape, false otherwise. More...
 
const Vector2DgetCenter (void) const
 Returns the center of the circle. More...
 
double getRadius (void) const
 Returns the radius of the circle. More...
 
void setCenter (Vector2D const &center)
 Sets a new center to the circle. More...
 
 Circle (const Circle &origin)
 Copy constructor. More...
 
- Public Member Functions inherited from Shape2D
virtual ~Shape2D (void)
 virtual destructor
 

Detailed Description

A circle.

Definition at line 27 of file shape_2d.hpp.

Constructor & Destructor Documentation

◆ Circle() [1/2]

Circle::Circle ( Vector2D const &  center,
double  radius 
)

Class constructor.

Parameters
centerPosition of the center
radiusRadius

Definition at line 6 of file shape_2d.cpp.

◆ Circle() [2/2]

Circle::Circle ( const Circle origin)

Copy constructor.

Parameters
originOriginal

Definition at line 36 of file shape_2d.cpp.

Member Function Documentation

◆ getCenter()

const Vector2D & Circle::getCenter ( void  ) const

Returns the center of the circle.

Returns
Center of the circle

Definition at line 11 of file shape_2d.cpp.

Here is the caller graph for this function:

◆ getRadius()

double Circle::getRadius ( void  ) const

Returns the radius of the circle.

Returns
Radius

Definition at line 16 of file shape_2d.cpp.

Here is the caller graph for this function:

◆ operator()()

bool Circle::operator() ( const Vector2D r) const
virtual

Returns true is a point is inside the shape, false otherwise.

Parameters
rPoint in 2d space
Returns
True if r is inside the shape

Implements Shape2D.

Definition at line 26 of file shape_2d.cpp.

Here is the call graph for this function:

◆ setCenter()

void Circle::setCenter ( Vector2D const &  center)

Sets a new center to the circle.

Parameters
centerThe center of the circle

Definition at line 21 of file shape_2d.cpp.

Here is the caller graph for this function:

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