Marbellous
Marbellous, a WebApp to generate paper marbling patterns.
Public Member Functions | List of all members
Scene Class Reference

Contains a vector of polygons and is iterable. More...

#include <Scene.hpp>

Collaboration diagram for Scene:
Collaboration graph

Public Member Functions

const auto & getDisplacements () const
 vector of all displacements More...
 
unsigned getGeneration () const
 Get the generation of the scene. More...
 
int addPolygon (Polygon const &pol)
 
Polygonoperator[] (size_t const index)
 
Polygon const & operator[] (size_t const index) const
 
size_t getPolygonCount () const
 
void clear ()
 Clear the scene by deleting all polygons. More...
 
std::vector< Polygon >::iterator begin ()
 
std::vector< Polygon >::const_iterator begin () const
 
std::vector< Polygon >::const_reverse_iterator rbegin () const
 
std::vector< Polygon >::iterator end ()
 
std::vector< Polygon >::const_iterator end () const
 
std::vector< Polygon >::const_reverse_iterator rend () const
 
void applyDisplacement (size_t _canvasSize)
 Apply the current stored displacement. More...
 
void addDisplacement (Point p, float newRadius)
 
void setDisplacementRadius (float rad)
 

Detailed Description

Contains a vector of polygons and is iterable.

Displacement of polygons can be done at a leter time.

Member Function Documentation

◆ addDisplacement()

void Scene::addDisplacement ( Point  p,
float  newRadius 
)
inline
Here is the caller graph for this function:

◆ addPolygon()

int Scene::addPolygon ( Polygon const &  pol)
inline

Add a new Polygon to the Scene.

Parameters
polPolygon that will be added to the scene
Returns
Index of the saved polygon in the scene
Here is the caller graph for this function:

◆ applyDisplacement()

void Scene::applyDisplacement ( size_t  _canvasSize)
inline

Apply the current stored displacement.

The generation will increase by one.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ begin() [1/2]

std::vector<Polygon>::iterator Scene::begin ( )
inline
Returns
Begin iterator over the polygons in the scene
Here is the caller graph for this function:

◆ begin() [2/2]

std::vector<Polygon>::const_iterator Scene::begin ( ) const
inline
Returns
Begin const_iterator over the polygons in the scene

◆ clear()

void Scene::clear ( )
inline

Clear the scene by deleting all polygons.

Here is the caller graph for this function:

◆ end() [1/2]

std::vector<Polygon>::iterator Scene::end ( )
inline
Returns
End iterator over the polygons in the scene
Here is the caller graph for this function:

◆ end() [2/2]

std::vector<Polygon>::const_iterator Scene::end ( ) const
inline
Returns
End const_iterator over the polygons in the scene

◆ getDisplacements()

const auto& Scene::getDisplacements ( ) const
inline

vector of all displacements

Get the currently saved displacements.

Returns
Displacement vector
Here is the caller graph for this function:

◆ getGeneration()

unsigned Scene::getGeneration ( ) const
inline

Get the generation of the scene.

Here is the caller graph for this function:

◆ getPolygonCount()

size_t Scene::getPolygonCount ( ) const
inline
Returns
Number of polygons in the scene

◆ operator[]() [1/2]

Polygon& Scene::operator[] ( size_t const  index)
inline

Get or set the polygon at index, might throw std::out_of_range

Parameters
indexIndex of the polygon you want to access
Returns
Reference to the requested polygon

◆ operator[]() [2/2]

Polygon const& Scene::operator[] ( size_t const  index) const
inline

Get the polygon at index, might throw std::out_of_range

Parameters
indexIndex of the polygon you want to read
Returns
Reference to the requested polygon

◆ rbegin()

std::vector<Polygon>::const_reverse_iterator Scene::rbegin ( ) const
inline
Returns
Begin reverse const_iterator over polygons in the scene

◆ rend()

std::vector<Polygon>::const_reverse_iterator Scene::rend ( ) const
inline
Returns
End const_reverse_iterator over polygons in the scene.

◆ setDisplacementRadius()

void Scene::setDisplacementRadius ( float  rad)
inline
Here is the caller graph for this function:

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