Geometrize 1.0
C++ library for geometrizing images into geometric primitives
Public Member Functions | Public Attributes | List of all members
geometrize::Ellipse Class Reference

The Ellipse class represents an ellipse. More...

#include <ellipse.h>

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

Public Member Functions

 Ellipse ()=default
 
 Ellipse (float x, float y, float rx, float ry)
 
virtual std::shared_ptr< geometrize::Shapeclone () 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
 
virtual std::shared_ptr< geometrize::Shapeclone () const
 clone Clones the shape, a virtual copy constructor. More...
 
virtual geometrize::ShapeTypes getType () const
 getType Gets the ShapeType of the shape. More...
 

Public Attributes

float m_x
 x-coordinate. More...
 
float m_y
 y-coordinate. More...
 
float m_rx
 x-radius. More...
 
float m_ry
 y-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 Ellipse class represents an ellipse.

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

Constructor & Destructor Documentation

◆ Ellipse() [1/2]

geometrize::Ellipse::Ellipse ( )
default

◆ Ellipse() [2/2]

geometrize::Ellipse::Ellipse ( float  x,
float  y,
float  rx,
float  ry 
)
11 : Shape()
12{
13 m_x = x;
14 m_y = y;
15 m_rx = rx;
16 m_ry = ry;
17}
float m_rx
x-radius.
Definition: ellipse.h:26
float m_y
y-coordinate.
Definition: ellipse.h:25
float m_ry
y-radius.
Definition: ellipse.h:27
float m_x
x-coordinate.
Definition: ellipse.h:24

Member Function Documentation

◆ clone()

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

clone Clones the shape, a virtual copy constructor.

Returns
A clone of the shape.

Reimplemented from geometrize::Shape.

20{
21 std::shared_ptr<geometrize::Ellipse> ellipse{std::make_shared<geometrize::Ellipse>()};
22 ellipse->m_x = m_x;
23 ellipse->m_y = m_y;
24 ellipse->m_rx = m_rx;
25 ellipse->m_ry = m_ry;
26 ellipse->setup = setup;
27 ellipse->mutate = mutate;
28 ellipse->rasterize = rasterize;
29 return ellipse;
30}
std::function< std::vector< geometrize::Scanline >(const geometrize::Shape &)> rasterize
Definition: shape.h:27
std::function< void(geometrize::Shape &)> setup
Definition: shape.h:25
std::function< void(geometrize::Shape &)> mutate
Definition: shape.h:26

◆ getType()

geometrize::ShapeTypes geometrize::Ellipse::getType ( ) const
overridevirtual

getType Gets the ShapeType of the shape.

Returns
The ShapeType of the shape.

Reimplemented from geometrize::Shape.

33{
35}
@ ELLIPSE
Definition: shapetypes.h:21

Member Data Documentation

◆ m_rx

float geometrize::Ellipse::m_rx

x-radius.

◆ m_ry

float geometrize::Ellipse::m_ry

y-radius.

◆ m_x

float geometrize::Ellipse::m_x

x-coordinate.

◆ m_y

float geometrize::Ellipse::m_y

y-coordinate.


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