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

#include <shape.h>

Inheritance diagram for geometrize::Shape:
Inheritance graph
[legend]

Public Member Functions

 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

std::function< void(geometrize::Shape &)> setup
 
std::function< void(geometrize::Shape &)> mutate
 
std::function< std::vector< geometrize::Scanline >(const geometrize::Shape &)> rasterize
 

Detailed Description

Base class for shape rasterization and manipulation.

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

Constructor & Destructor Documentation

◆ Shape() [1/2]

geometrize::Shape::Shape ( )
default

◆ ~Shape()

virtual geometrize::Shape::~Shape ( )
virtualdefault

◆ Shape() [2/2]

geometrize::Shape::Shape ( const geometrize::Shape other)
default

Member Function Documentation

◆ clone()

virtual std::shared_ptr< geometrize::Shape > geometrize::Shape::clone ( ) const
inlinevirtual

clone Clones the shape, a virtual copy constructor.

Returns
A clone of the shape.

Reimplemented in geometrize::Circle, geometrize::Ellipse, geometrize::Line, geometrize::Polyline, geometrize::QuadraticBezier, geometrize::Rectangle, geometrize::RotatedEllipse, geometrize::RotatedRectangle, and geometrize::Triangle.

34 {
35 throw "Unimplemented"; // NOTE not pure virtual because it breaks simple upcast in Chaiscript (and can't see how else to do it)
36 }

◆ getType()

virtual geometrize::ShapeTypes geometrize::Shape::getType ( ) const
inlinevirtual

getType Gets the ShapeType of the shape.

Returns
The ShapeType of the shape.

Reimplemented in geometrize::Circle, geometrize::Ellipse, geometrize::Line, geometrize::Polyline, geometrize::QuadraticBezier, geometrize::Rectangle, geometrize::RotatedEllipse, geometrize::RotatedRectangle, and geometrize::Triangle.

43 {
44 throw "Unimplemented";
45 }
Here is the caller graph for this function:

◆ operator=()

Shape & geometrize::Shape::operator= ( const geometrize::Shape other)
default

Member Data Documentation

◆ mutate

std::function<void(geometrize::Shape&)> geometrize::Shape::mutate

◆ rasterize

std::function<std::vector<geometrize::Scanline>(const geometrize::Shape&)> geometrize::Shape::rasterize

◆ setup

std::function<void(geometrize::Shape&)> geometrize::Shape::setup

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