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

#include "LinearGradientPainter2D.h"

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

Public Member Functions

 LinearGradientPainter2D ()
 
 LinearGradientPainter2D (const std::vector< GradientPainterStop2D > &_stops)
 
virtual ~LinearGradientPainter2D ()
 
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 bool isEqualTo (const Painter2D *_other) const override
 Returns true if this painter is equal to the other painter.
 
void setStart (const ot::Point2DD &_start)
 Set the starting point for the gradient. The painted area is between 0.0 and 1.0.
 
const ot::Point2DDgetStart (void) const
 
void setFinalStop (const ot::Point2DD &_finalStop)
 Set the final stop point for the gradient. The painted area is between 0.0 and 1.0.
 
const ot::Point2DDgetFinalStop (void) const
 
- Public Member Functions inherited from ot::GradientPainter2D
 GradientPainter2D ()
 
 GradientPainter2D (const std::vector< GradientPainterStop2D > &_stops)
 
virtual ~GradientPainter2D ()
 
virtual ot::Color getDefaultColor (void) const override
 
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 ()
 
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.
 

Additional Inherited Members

- Protected Member Functions inherited from ot::GradientPainter2D
void addStopsAndSpreadToQss (std::string &_targetString) const
 

Constructor & Destructor Documentation

◆ LinearGradientPainter2D() [1/2]

ot::LinearGradientPainter2D::LinearGradientPainter2D ( )

◆ LinearGradientPainter2D() [2/2]

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

◆ ~LinearGradientPainter2D()

ot::LinearGradientPainter2D::~LinearGradientPainter2D ( )
virtual

Member Function Documentation

◆ addToJsonObject()

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

◆ generateQss()

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

Implements ot::Painter2D.

◆ getFactoryKey()

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

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

Implements ot::Painter2D.

◆ getFinalStop()

const ot::Point2DD & ot::LinearGradientPainter2D::getFinalStop ( void ) const
inline

◆ getStart()

const ot::Point2DD & ot::LinearGradientPainter2D::getStart ( void ) const
inline

◆ isEqualTo()

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

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

Reimplemented from ot::GradientPainter2D.

◆ setFinalStop()

void ot::LinearGradientPainter2D::setFinalStop ( const ot::Point2DD & _finalStop)
inline

Set the final stop point for the gradient. The painted area is between 0.0 and 1.0.

◆ setFromJsonObject()

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

◆ setStart()

void ot::LinearGradientPainter2D::setStart ( const ot::Point2DD & _start)
inline

Set the starting point for the gradient. The painted area is between 0.0 and 1.0.


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