OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
ot::CheckerboardPainter2D Class Reference

#include "CheckerboardPainter2D.h"

Inheritance diagram for ot::CheckerboardPainter2D:
ot::Painter2D ot::Serializable

Public Member Functions

 CheckerboardPainter2D ()
 
 CheckerboardPainter2D (ot::DefaultColor _primaryColor, ot::DefaultColor _secondaryColor, const Size2D &_cellSize=Size2D(10, 10))
 
 CheckerboardPainter2D (const ot::Color &_primaryColor, const ot::Color &_secondaryColor, const Size2D &_cellSize=Size2D(10, 10))
 
 CheckerboardPainter2D (Painter2D *_primaryPainter, Painter2D *_secondaryPainter, const Size2D &_cellSize=Size2D(10, 10))
 Assignment constructor. The object takes ownership of the provided painter.
 
virtual ~CheckerboardPainter2D ()
 
virtual void addToJsonObject (JsonValue &_object, JsonAllocator &_allocator) const override
 Add the object contents to the provided JSON object.
 
virtual void setFromJsonObject (const ConstJsonObject &_object) override
 Will set the object contents from the provided JSON object.
 
virtual std::string getFactoryKey (void) const override
 Returns the key that is used to create an instance of this class in the simple factory.
 
virtual std::string generateQss (void) const override
 
virtual ot::Color getDefaultColor (void) const override
 
virtual bool isEqualTo (const Painter2D *_other) const override
 Returns true if this painter is equal to the other painter.
 
void setPrimaryPainter (Painter2D *_painter)
 Sets the primary painter. The object takes ownership of the provided painter. The current painter will be destroyed.
 
const Painter2DgetPrimaryPainter (void) const
 
void setSecondaryPainter (Painter2D *_painter)
 Sets the secondary painter. The object takes ownership of the provided painter. The current painter will be destroyed.
 
const Painter2DgetSecondaryPainter (void) const
 
void setCellSize (int _size)
 
void setCellSize (int _width, int _height)
 
void setCellSize (const Size2D &_size)
 
const Size2DgetCellSize (void) const
 
- Public Member Functions inherited from ot::Painter2D
 Painter2D ()
 
virtual ~Painter2D ()
 
Painter2DcreateCopy (void) const
 Creates a copy of this painter.
 
- Public Member Functions inherited from ot::Serializable
 Serializable ()
 
virtual ~Serializable ()
 
virtual void addToJsonObject (ot::JsonValue &_object, ot::JsonAllocator &_allocator) const =0
 Add the object contents to the provided JSON object.
 

Constructor & Destructor Documentation

◆ CheckerboardPainter2D() [1/4]

ot::CheckerboardPainter2D::CheckerboardPainter2D ( )

◆ CheckerboardPainter2D() [2/4]

ot::CheckerboardPainter2D::CheckerboardPainter2D ( ot::DefaultColor _primaryColor,
ot::DefaultColor _secondaryColor,
const Size2D & _cellSize = Size2D(10, 10) )

◆ CheckerboardPainter2D() [3/4]

ot::CheckerboardPainter2D::CheckerboardPainter2D ( const ot::Color & _primaryColor,
const ot::Color & _secondaryColor,
const Size2D & _cellSize = Size2D(10, 10) )

◆ CheckerboardPainter2D() [4/4]

ot::CheckerboardPainter2D::CheckerboardPainter2D ( Painter2D * _primaryPainter,
Painter2D * _secondaryPainter,
const Size2D & _cellSize = Size2D(10, 10) )

Assignment constructor. The object takes ownership of the provided painter.

◆ ~CheckerboardPainter2D()

ot::CheckerboardPainter2D::~CheckerboardPainter2D ( )
virtual

Member Function Documentation

◆ addToJsonObject()

void ot::CheckerboardPainter2D::addToJsonObject ( JsonValue & _object,
JsonAllocator & _allocator ) const
overridevirtual

Add the object contents to the provided JSON object.

Parameters
_documentThe JSON document (used to get the allocator)
_objectThe JSON object to add the contents to

Reimplemented from ot::Painter2D.

◆ generateQss()

std::string ot::CheckerboardPainter2D::generateQss ( void ) const
overridevirtual

Implements ot::Painter2D.

◆ getCellSize()

const Size2D & ot::CheckerboardPainter2D::getCellSize ( void ) const
inline

◆ getDefaultColor()

ot::Color ot::CheckerboardPainter2D::getDefaultColor ( void ) const
overridevirtual

Implements ot::Painter2D.

◆ getFactoryKey()

virtual std::string ot::CheckerboardPainter2D::getFactoryKey ( void ) const
inlineoverridevirtual

Returns the key that is used to create an instance of this class in the simple factory.

Implements ot::Painter2D.

◆ getPrimaryPainter()

const Painter2D * ot::CheckerboardPainter2D::getPrimaryPainter ( void ) const
inline

◆ getSecondaryPainter()

const Painter2D * ot::CheckerboardPainter2D::getSecondaryPainter ( void ) const
inline

◆ isEqualTo()

bool ot::CheckerboardPainter2D::isEqualTo ( const Painter2D * _other) const
overridevirtual

Returns true if this painter is equal to the other painter.

Implements ot::Painter2D.

◆ setCellSize() [1/3]

void ot::CheckerboardPainter2D::setCellSize ( const Size2D & _size)
inline

◆ setCellSize() [2/3]

void ot::CheckerboardPainter2D::setCellSize ( int _size)

◆ setCellSize() [3/3]

void ot::CheckerboardPainter2D::setCellSize ( int _width,
int _height )

◆ setFromJsonObject()

void ot::CheckerboardPainter2D::setFromJsonObject ( const ConstJsonObject & _object)
overridevirtual

Will set the object contents from the provided JSON object.

Parameters
_objectThe JSON object containing the information
Exceptions
Willthrow an exception if the provided object is not valid (members missing or invalid types)

Reimplemented from ot::Painter2D.

◆ setPrimaryPainter()

void ot::CheckerboardPainter2D::setPrimaryPainter ( Painter2D * _painter)

Sets the primary painter. The object takes ownership of the provided painter. The current painter will be destroyed.

Note
Note that the primary and secondary painter must be different objects.

◆ setSecondaryPainter()

void ot::CheckerboardPainter2D::setSecondaryPainter ( Painter2D * _painter)

Sets the secondary painter. The object takes ownership of the provided painter. The current painter will be destroyed.

Note
Note that the primary and secondary painter must be different objects.

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