Geometrize  1.0
C++ library for geometrizing images into geometric primitives
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | Public Attributes | List of all members
geometrize::Circle Class Reference

The Circle class represents a circle. More...

#include <circle.h>

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

Public Member Functions

 Circle ()=default
 
 Circle (float x, float y, float r)
 
virtual std::shared_ptr
< geometrize::Shape
clone () const override
 clone Clones the shape, a virtual copy constructor. More...
 
virtual geometrize::ShapeTypes getType () const override
 getType Gets the ShapeType of the shape. More...
 
- Public Member Functions inherited from geometrize::Shape
 Shape ()=default
 
virtual ~Shape ()=default
 
Shapeoperator= (const geometrize::Shape &other)=default
 
 Shape (const geometrize::Shape &other)=default
 

Public Attributes

float m_x
 x-coordinate. More...
 
float m_y
 y-coordinate. More...
 
float m_r
 Radius. More...
 
- Public Attributes inherited from geometrize::Shape
std::function< void(geometrize::Shape &)> setup
 
std::function< void(geometrize::Shape &)> mutate
 
std::function< std::vector
< geometrize::Scanline >const
geometrize::Shape &)> 
rasterize
 

Detailed Description

The Circle class represents a circle.

Author
Sam Twidale (https://samcodes.co.uk/)

Constructor & Destructor Documentation

geometrize::Circle::Circle ( )
default
geometrize::Circle::Circle ( float  x,
float  y,
float  r 
)
11  : Shape()
12 {
13  m_x = x;
14  m_y = y;
15  m_r = r;
16 }
float m_x
x-coordinate.
Definition: circle.h:24
float m_r
Radius.
Definition: circle.h:26
float m_y
y-coordinate.
Definition: circle.h:25

Member Function Documentation

std::shared_ptr< geometrize::Shape > geometrize::Circle::clone ( ) const
overridevirtual

clone Clones the shape, a virtual copy constructor.

Returns
A clone of the shape.

Reimplemented from geometrize::Shape.

19 {
20  std::shared_ptr<geometrize::Circle> circle{std::make_shared<geometrize::Circle>()};
21  circle->m_x = m_x;
22  circle->m_y = m_y;
23  circle->m_r = m_r;
24  circle->setup = setup;
25  circle->mutate = mutate;
26  circle->rasterize = rasterize;
27  return circle;
28 }
float m_x
x-coordinate.
Definition: circle.h:24
float m_r
Radius.
Definition: circle.h:26
std::function< void(geometrize::Shape &)> mutate
Definition: shape.h:26
std::function< std::vector< geometrize::Scanline >const geometrize::Shape &)> rasterize
Definition: shape.h:27
float m_y
y-coordinate.
Definition: circle.h:25
std::function< void(geometrize::Shape &)> setup
Definition: shape.h:25
geometrize::ShapeTypes geometrize::Circle::getType ( ) const
overridevirtual

getType Gets the ShapeType of the shape.

Returns
The ShapeType of the shape.

Reimplemented from geometrize::Shape.

31 {
33 }
Definition: shapetypes.h:23

Member Data Documentation

float geometrize::Circle::m_r

Radius.

float geometrize::Circle::m_x

x-coordinate.

float geometrize::Circle::m_y

y-coordinate.


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