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

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

#include "Outline.h"

Inheritance diagram for ot::Outline:
ot::Serializable

Public Member Functions

 Outline ()
 Default constructor. Creates a black fill painter.
 
 Outline (const Color &_color)
 Assignment constructor.
 
 Outline (Painter2D *_painter)
 Assignment constructor.
 
 Outline (int _width, const Color &_color)
 Assignment constructor.
 
 Outline (int _width, Painter2D *_painter)
 Assignment constructor.
 
 Outline (const Outline &_other)
 Copy constructor.
 
 ~Outline ()
 Destructor.
 
Outlineoperator= (const Outline &_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 (int _w)
 Set the line width.
 
constexpr int 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.
 
OutlineF toOutlineF (void) const
 
- Public Member Functions inherited from ot::Serializable
 Serializable ()
 
virtual ~Serializable ()
 

Detailed Description

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

Constructor & Destructor Documentation

◆ Outline() [1/6]

ot::Outline::Outline ( )

Default constructor. Creates a black fill painter.

◆ Outline() [2/6]

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

Assignment constructor.

Parameters
_colorInitial color.

◆ Outline() [3/6]

ot::Outline::Outline ( Painter2D * _painter)

Assignment constructor.

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

◆ Outline() [4/6]

ot::Outline::Outline ( int _width,
const Color & _color )

Assignment constructor.

Parameters
_widthLine width.
_colorInitial color.

◆ Outline() [5/6]

ot::Outline::Outline ( int _width,
Painter2D * _painter )

Assignment constructor.

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

◆ Outline() [6/6]

ot::Outline::Outline ( const Outline & _other)

Copy constructor.

Parameters
_otherThe other style.

◆ ~Outline()

ot::Outline::~Outline ( )

Destructor.

Member Function Documentation

◆ addToJsonObject()

void ot::Outline::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::Outline::cap ( void ) const
inlineconstexpr

Cap style.

◆ joinStyle()

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

Line join style.

◆ operator=()

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

Assignment operator.

Parameters
_otherThe other style.

◆ painter()

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

Painter.

◆ setCap()

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

Set the line cap style.

Parameters
_capCap style to set.

◆ setColor()

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

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

◆ setFromJsonObject()

void ot::Outline::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::Outline::setJoinStyle ( LineJoinStyle _join)
inlineconstexpr

Set the line join style.

Parameters
_styleJoin style to set.

◆ setPainter()

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

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

Parameters
_painterThe painter to set.

◆ setStyle()

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

Set the line style.

Parameters
_styleStyle to set.

◆ setWidth()

constexpr void ot::Outline::setWidth ( int _w)
inlineconstexpr

Set the line width.

Parameters
_wWidth to set.

◆ style()

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

Line style.

◆ takePainter()

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

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

◆ toOutlineF()

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

◆ width()

constexpr int ot::Outline::width ( void ) const
inlineconstexpr

Line width.


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