Geometrize 1.0
C++ library for geometrizing images into geometric primitives
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::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

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

◆ Polyline() [1/2]

geometrize::Polyline::Polyline ( )
default

◆ Polyline() [2/2]

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

◆ clone()

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::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::Polyline::getType ( ) const
overridevirtual

getType Gets the ShapeType of the shape.

Returns
The ShapeType of the shape.

Reimplemented from geometrize::Shape.

29{
31}
@ POLYLINE
Definition: shapetypes.h:26

Member Data Documentation

◆ m_points

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: