OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
ot::Painter2D Class Referenceabstract

#include "Painter2D.h"

Inheritance diagram for ot::Painter2D:
ot::Serializable ot::CheckerboardPainter2D ot::FillPainter2D ot::GradientPainter2D ot::StyleRefPainter2D ot::LinearGradientPainter2D ot::RadialGradientPainter2D

Public Member Functions

 Painter2D ()
 
virtual ~Painter2D ()
 
virtual std::string getFactoryKey (void) const =0
 Returns the unique Painter2D type name that is used in the Painter2DFactory.
 
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 generateQss (void) const =0
 
virtual ot::Color getDefaultColor (void) const =0
 
virtual bool isEqualTo (const Painter2D *_other) const =0
 Returns true if this painter is equal to the other painter.
 
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

◆ Painter2D()

ot::Painter2D::Painter2D ( )
inline

◆ ~Painter2D()

virtual ot::Painter2D::~Painter2D ( )
inlinevirtual

Member Function Documentation

◆ addToJsonObject()

void ot::Painter2D::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 in ot::CheckerboardPainter2D, ot::FillPainter2D, ot::GradientPainter2D, ot::LinearGradientPainter2D, ot::RadialGradientPainter2D, and ot::StyleRefPainter2D.

◆ createCopy()

ot::Painter2D * ot::Painter2D::createCopy ( void ) const

Creates a copy of this painter.

◆ generateQss()

virtual std::string ot::Painter2D::generateQss ( void ) const
pure virtual

◆ getDefaultColor()

virtual ot::Color ot::Painter2D::getDefaultColor ( void ) const
pure virtual

◆ getFactoryKey()

virtual std::string ot::Painter2D::getFactoryKey ( void ) const
pure virtual

◆ isEqualTo()

virtual bool ot::Painter2D::isEqualTo ( const Painter2D * _other) const
pure virtual

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

Implemented in ot::CheckerboardPainter2D, ot::FillPainter2D, ot::GradientPainter2D, ot::LinearGradientPainter2D, ot::RadialGradientPainter2D, and ot::StyleRefPainter2D.

◆ setFromJsonObject()

void ot::Painter2D::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)

Implements ot::Serializable.

Reimplemented in ot::CheckerboardPainter2D, ot::FillPainter2D, ot::GradientPainter2D, ot::LinearGradientPainter2D, ot::RadialGradientPainter2D, and ot::StyleRefPainter2D.


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