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

The OutlineF class is used to describe how a outline should look like. More...

#include "Outline.h"

Inheritance diagram for ot::OutlineF:
ot::Serializable

Public Member Functions

 OutlineF ()
 Default constructor. Creates a black fill painter.
 
 OutlineF (const Color &_color)
 Assignment constructor.
 
 OutlineF (Painter2D *_painter)
 Assignment constructor.
 
 OutlineF (double _width, const Color &_color)
 Assignment constructor.
 
 OutlineF (double _width, Painter2D *_painter)
 Assignment constructor.
 
 OutlineF (const OutlineF &_other)
 Copy constructor.
 
 ~OutlineF ()
 Destructor.
 
OutlineFoperator= (const OutlineF &_other)
 Assignment operator.
 
virtual void addToJsonObject (ot::JsonValue &_object, ot::JsonAllocator &_allocator) const override
 Add the object contents to the provided JSON object.
 
virtual void setFromJsonObject (const ot::ConstJsonObject &_object) override
 Will set the object contents from the provided JSON object.
 
void setColor (const Color &_color)
 Set the color. The current painter will be replaced by a FillPainter2D.
 
void setPainter (Painter2D *_painter)
 Set the painter. The outline takes ownership of the painter.
 
constexpr const Painter2Dpainter (void) const
 Painter.
 
Painter2DtakePainter (void)
 Replaces the current painter with a default painter and returns the old painter. The caller takes ownership of the painter.
 
constexpr void setWidth (double _w)
 Set the line width.
 
constexpr double width (void) const
 Line width.
 
constexpr void setStyle (LineStyle _style)
 Set the line style.
 
constexpr LineStyle style (void) const
 Line style.
 
constexpr void setCap (LineCapStyle _cap)
 Set the line cap style.
 
constexpr LineCapStyle cap (void) const
 Cap style.
 
constexpr void setJoinStyle (LineJoinStyle _join)
 Set the line join style.
 
constexpr LineJoinStyle joinStyle (void) const
 Line join style.
 
Outline toOutline (void) const
 
- Public Member Functions inherited from ot::Serializable
 Serializable ()
 
virtual ~Serializable ()
 

Detailed Description

The OutlineF class is used to describe how a outline should look like.

Constructor & Destructor Documentation

◆ OutlineF() [1/6]

ot::OutlineF::OutlineF ( )

Default constructor. Creates a black fill painter.

◆ OutlineF() [2/6]

ot::OutlineF::OutlineF ( const Color & _color)

Assignment constructor.

Parameters
_colorInitial color.

◆ OutlineF() [3/6]

ot::OutlineF::OutlineF ( Painter2D * _painter)

Assignment constructor.

Parameters
_painterInitial painter (if 0, default painter will be set [/ref OutlineF() "See default constructor"]).

◆ OutlineF() [4/6]

ot::OutlineF::OutlineF ( double _width,
const Color & _color )

Assignment constructor.

Parameters
_widthLine width.
_colorInitial color.

◆ OutlineF() [5/6]

ot::OutlineF::OutlineF ( double _width,
Painter2D * _painter )

Assignment constructor.

Parameters
_widthLine width
_painterInitial painter (if 0, default painter will be set [/ref OutlineF() "See default constructor"]).

◆ OutlineF() [6/6]

ot::OutlineF::OutlineF ( const OutlineF & _other)

Copy constructor.

Parameters
_otherThe other style.

◆ ~OutlineF()

ot::OutlineF::~OutlineF ( )

Destructor.

Member Function Documentation

◆ addToJsonObject()

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

Add the object contents to the provided JSON object.

Parameters
_objectJson object reference
_allocatorAllocator

Implements ot::Serializable.

◆ cap()

constexpr LineCapStyle ot::OutlineF::cap ( void ) const
inlineconstexpr

Cap style.

◆ joinStyle()

constexpr LineJoinStyle ot::OutlineF::joinStyle ( void ) const
inlineconstexpr

Line join style.

◆ operator=()

ot::OutlineF & ot::OutlineF::operator= ( const OutlineF & _other)

Assignment operator.

Parameters
_otherThe other style.

◆ painter()

constexpr const Painter2D * ot::OutlineF::painter ( void ) const
inlineconstexpr

Painter.

◆ setCap()

constexpr void ot::OutlineF::setCap ( LineCapStyle _cap)
inlineconstexpr

Set the line cap style.

Parameters
_capCap style to set.

◆ setColor()

void ot::OutlineF::setColor ( const Color & _color)

Set the color. The current painter will be replaced by a FillPainter2D.

◆ setFromJsonObject()

void ot::OutlineF::setFromJsonObject ( const ot::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.

◆ setJoinStyle()

constexpr void ot::OutlineF::setJoinStyle ( LineJoinStyle _join)
inlineconstexpr

Set the line join style.

Parameters
_styleJoin style to set.

◆ setPainter()

void ot::OutlineF::setPainter ( Painter2D * _painter)

Set the painter. The outline takes ownership of the painter.

Parameters
_painterThe painter to set.

◆ setStyle()

constexpr void ot::OutlineF::setStyle ( LineStyle _style)
inlineconstexpr

Set the line style.

Parameters
_styleStyle to set.

◆ setWidth()

constexpr void ot::OutlineF::setWidth ( double _w)
inlineconstexpr

Set the line width.

Parameters
_wWidth to set.

◆ style()

constexpr LineStyle ot::OutlineF::style ( void ) const
inlineconstexpr

Line style.

◆ takePainter()

ot::Painter2D * ot::OutlineF::takePainter ( void )

Replaces the current painter with a default painter and returns the old painter. The caller takes ownership of the painter.

◆ toOutline()

ot::Outline ot::OutlineF::toOutline ( void ) const

◆ width()

constexpr double ot::OutlineF::width ( void ) const
inlineconstexpr

Line width.


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