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

#include "GradientPainter2D.h"

Inheritance diagram for ot::GradientPainter2D:
ot::Painter2D ot::Serializable ot::LinearGradientPainter2D ot::RadialGradientPainter2D

Public Member Functions

 GradientPainter2D ()
 
 GradientPainter2D (const std::vector< GradientPainterStop2D > &_stops)
 
virtual ~GradientPainter2D ()
 
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 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 addStop (double _pos, const ot::Color &_color)
 
void addStop (const GradientPainterStop2D &_stop)
 
void addStops (const std::vector< GradientPainterStop2D > &_stops)
 
void setStops (const std::vector< GradientPainterStop2D > &_stops)
 
const std::vector< GradientPainterStop2D > & getStops (void) const
 
void setSpread (GradientSpread _spread)
 
GradientSpread getSpread (void) const
 
- Public Member Functions inherited from ot::Painter2D
 Painter2D ()
 
virtual ~Painter2D ()
 
virtual std::string getFactoryKey (void) const =0
 Returns the unique Painter2D type name that is used in the Painter2DFactory.
 
virtual std::string generateQss (void) const =0
 
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.
 

Protected Member Functions

void addStopsAndSpreadToQss (std::string &_targetString) const
 

Constructor & Destructor Documentation

◆ GradientPainter2D() [1/2]

ot::GradientPainter2D::GradientPainter2D ( )

◆ GradientPainter2D() [2/2]

ot::GradientPainter2D::GradientPainter2D ( const std::vector< GradientPainterStop2D > & _stops)

◆ ~GradientPainter2D()

ot::GradientPainter2D::~GradientPainter2D ( )
virtual

Member Function Documentation

◆ addStop() [1/2]

void ot::GradientPainter2D::addStop ( const GradientPainterStop2D & _stop)

◆ addStop() [2/2]

void ot::GradientPainter2D::addStop ( double _pos,
const ot::Color & _color )
inline

◆ addStops()

void ot::GradientPainter2D::addStops ( const std::vector< GradientPainterStop2D > & _stops)

◆ addStopsAndSpreadToQss()

void ot::GradientPainter2D::addStopsAndSpreadToQss ( std::string & _targetString) const
protected

◆ addToJsonObject()

void ot::GradientPainter2D::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.

Reimplemented in ot::LinearGradientPainter2D, and ot::RadialGradientPainter2D.

◆ getDefaultColor()

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

Implements ot::Painter2D.

◆ getSpread()

GradientSpread ot::GradientPainter2D::getSpread ( void ) const
inline

◆ getStops()

const std::vector< GradientPainterStop2D > & ot::GradientPainter2D::getStops ( void ) const
inline

◆ isEqualTo()

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

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

Implements ot::Painter2D.

Reimplemented in ot::LinearGradientPainter2D, and ot::RadialGradientPainter2D.

◆ setFromJsonObject()

void ot::GradientPainter2D::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.

Reimplemented in ot::LinearGradientPainter2D, and ot::RadialGradientPainter2D.

◆ setSpread()

void ot::GradientPainter2D::setSpread ( GradientSpread _spread)
inline

◆ setStops()

void ot::GradientPainter2D::setStops ( const std::vector< GradientPainterStop2D > & _stops)
inline

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