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

The RotatedEllipse class represents a rotated ellipse. More...

#include <rotatedellipse.h>

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

Public Member Functions

 RotatedEllipse ()=default
 
 RotatedEllipse (float x, float y, float rx, float ry, float angle)
 
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...
 
float m_angle
 Rotation angle. 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 RotatedEllipse class represents a rotated ellipse.

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

Constructor & Destructor Documentation

◆ RotatedEllipse() [1/2]

geometrize::RotatedEllipse::RotatedEllipse ( )
default

◆ RotatedEllipse() [2/2]

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

Member Function Documentation

◆ clone()

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

clone Clones the shape, a virtual copy constructor.

Returns
A clone of the shape.

Reimplemented from geometrize::Shape.

21{
22 std::shared_ptr<geometrize::RotatedEllipse> ellipse{std::make_shared<geometrize::RotatedEllipse>()};
23 ellipse->m_x = m_x;
24 ellipse->m_y = m_y;
25 ellipse->m_rx = m_rx;
26 ellipse->m_ry = m_ry;
27 ellipse->m_angle = m_angle;
28 ellipse->setup = setup;
29 ellipse->mutate = mutate;
30 ellipse->rasterize = rasterize;
31 return ellipse;
32}
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::RotatedEllipse::getType ( ) const
overridevirtual

getType Gets the ShapeType of the shape.

Returns
The ShapeType of the shape.

Reimplemented from geometrize::Shape.

35{
37}
@ ROTATED_ELLIPSE
Definition: shapetypes.h:22

Member Data Documentation

◆ m_angle

float geometrize::RotatedEllipse::m_angle

Rotation angle.

◆ m_rx

float geometrize::RotatedEllipse::m_rx

x-radius.

◆ m_ry

float geometrize::RotatedEllipse::m_ry

y-radius.

◆ m_x

float geometrize::RotatedEllipse::m_x

x-coordinate.

◆ m_y

float geometrize::RotatedEllipse::m_y

y-coordinate.


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