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::Polyline Class Reference

The Polyline class represents a polyline. More...

#include <polyline.h>

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

Public Member Functions

 Polyline ()=default
 
 Polyline (const std::vector< std::pair< float, float >> &points)
 
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

std::vector< std::pair< float,
float > > 
m_points
 The points on the polyline. 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 Polyline class represents a polyline.

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

Constructor & Destructor Documentation

geometrize::Polyline::Polyline ( )
default
geometrize::Polyline::Polyline ( const std::vector< std::pair< float, float >> &  points)
13  : Shape()
14 {
15  m_points = points;
16 }
std::vector< std::pair< float, float > > m_points
The points on the polyline.
Definition: polyline.h:26

Member Function Documentation

std::shared_ptr< geometrize::Shape > geometrize::Polyline::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::Polyline> polyline{std::make_shared<geometrize::Polyline>()};
21  polyline->m_points = m_points;
22  polyline->setup = setup;
23  polyline->mutate = mutate;
24  polyline->rasterize = rasterize;
25  return polyline;
26 }
std::vector< std::pair< float, float > > m_points
The points on the polyline.
Definition: polyline.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
std::function< void(geometrize::Shape &)> setup
Definition: shape.h:25
geometrize::ShapeTypes geometrize::Polyline::getType ( ) const
overridevirtual

getType Gets the ShapeType of the shape.

Returns
The ShapeType of the shape.

Reimplemented from geometrize::Shape.

29 {
31 }
Definition: shapetypes.h:26

Member Data Documentation

std::vector<std::pair<float, float> > geometrize::Polyline::m_points

The points on the polyline.


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