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

#include "GraphicsConnectionCfg.h"

Inheritance diagram for ot::GraphicsConnectionCfg:
ot::Serializable Connection

Public Types

enum class  ConnectionShape {
  DirectLine , SmoothLine , XYLine , YXLine ,
  AutoXYLine
}
 

Public Member Functions

 GraphicsConnectionCfg ()
 
 GraphicsConnectionCfg (const ot::UID &_originUid, const std::string &_originConnectableName, const ot::UID &_destinationUid, const std::string &_destinationName)
 
 GraphicsConnectionCfg (const GraphicsConnectionCfg &_other)
 
virtual ~GraphicsConnectionCfg ()
 
GraphicsConnectionCfgoperator= (const GraphicsConnectionCfg &_other)
 
bool operator== (const GraphicsConnectionCfg &_other) const
 
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.
 
GraphicsConnectionCfg getReversedConnection (void) const
 Create a copy of this connection but the origin an destination are swapped.
 
void setOriginUid (const ot::UID &_uid)
 
const ot::UIDgetOriginUid (void) const
 
void setOriginConnectable (const std::string &_name)
 
const std::string & getOriginConnectable (void) const
 
void setDestUid (const ot::UID &_uid)
 
const ot::UIDgetDestinationUid (void) const
 
void setDestConnectable (const std::string &_name)
 
const std::string & getDestConnectable (void) const
 
void setUid (const ot::UID &_uid)
 
const ot::UIDgetUid (void) const
 
void setLineShape (ConnectionShape _shape)
 
ConnectionShape getLineShape (void) const
 
void setLineWidth (double _width)
 
double getLineWidth (void) const
 
void setLineColor (const ot::Color &_color)
 
void setLinePainter (ot::Painter2D *_painter)
 Set the line painter. The item takes ownership of the painter.
 
const ot::Painter2DgetLinePainter (void) const
 Returns the current painter. The item keeps ownership of the painter.
 
void setLineStyle (LineStyle _style)
 
void setLineStyle (const OutlineF &_style)
 
const OutlineFgetLineStyle (void) const
 
std::string createConnectionKey (void) const
 
std::string createConnectionKeyReverse (void) const
 
void setHandlesState (bool _handleState)
 
bool getHandleState (void) const
 
- 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.
 

Static Public Member Functions

static std::string shapeToString (ConnectionShape _shape)
 
static ConnectionShape stringToShape (const std::string _shape)
 

Member Enumeration Documentation

◆ ConnectionShape

Enumerator
DirectLine 
SmoothLine 
XYLine 
YXLine 
AutoXYLine 

Constructor & Destructor Documentation

◆ GraphicsConnectionCfg() [1/3]

ot::GraphicsConnectionCfg::GraphicsConnectionCfg ( )

◆ GraphicsConnectionCfg() [2/3]

ot::GraphicsConnectionCfg::GraphicsConnectionCfg ( const ot::UID & _originUid,
const std::string & _originConnectableName,
const ot::UID & _destinationUid,
const std::string & _destinationName )

◆ GraphicsConnectionCfg() [3/3]

ot::GraphicsConnectionCfg::GraphicsConnectionCfg ( const GraphicsConnectionCfg & _other)

◆ ~GraphicsConnectionCfg()

ot::GraphicsConnectionCfg::~GraphicsConnectionCfg ( )
virtual

Member Function Documentation

◆ addToJsonObject()

void ot::GraphicsConnectionCfg::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

◆ createConnectionKey()

std::string ot::GraphicsConnectionCfg::createConnectionKey ( void ) const

◆ createConnectionKeyReverse()

std::string ot::GraphicsConnectionCfg::createConnectionKeyReverse ( void ) const

◆ getDestConnectable()

const std::string & ot::GraphicsConnectionCfg::getDestConnectable ( void ) const
inline

◆ getDestinationUid()

const ot::UID & ot::GraphicsConnectionCfg::getDestinationUid ( void ) const
inline

◆ getHandleState()

bool ot::GraphicsConnectionCfg::getHandleState ( void ) const
inline

◆ getLinePainter()

const ot::Painter2D * ot::GraphicsConnectionCfg::getLinePainter ( void ) const
inline

Returns the current painter. The item keeps ownership of the painter.

◆ getLineShape()

ConnectionShape ot::GraphicsConnectionCfg::getLineShape ( void ) const
inline

◆ getLineStyle()

const OutlineF & ot::GraphicsConnectionCfg::getLineStyle ( void ) const
inline

◆ getLineWidth()

double ot::GraphicsConnectionCfg::getLineWidth ( void ) const
inline

◆ getOriginConnectable()

const std::string & ot::GraphicsConnectionCfg::getOriginConnectable ( void ) const
inline

◆ getOriginUid()

const ot::UID & ot::GraphicsConnectionCfg::getOriginUid ( void ) const
inline

◆ getReversedConnection()

ot::GraphicsConnectionCfg ot::GraphicsConnectionCfg::getReversedConnection ( void ) const

Create a copy of this connection but the origin an destination are swapped.

◆ getUid()

const ot::UID & ot::GraphicsConnectionCfg::getUid ( void ) const
inline

◆ operator=()

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

◆ operator==()

bool ot::GraphicsConnectionCfg::operator== ( const GraphicsConnectionCfg & _other) const

◆ setDestConnectable()

void ot::GraphicsConnectionCfg::setDestConnectable ( const std::string & _name)
inline

◆ setDestUid()

void ot::GraphicsConnectionCfg::setDestUid ( const ot::UID & _uid)
inline

◆ setFromJsonObject()

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

◆ setHandlesState()

void ot::GraphicsConnectionCfg::setHandlesState ( bool _handleState)
inline

◆ setLineColor()

void ot::GraphicsConnectionCfg::setLineColor ( const ot::Color & _color)
inline

◆ setLinePainter()

void ot::GraphicsConnectionCfg::setLinePainter ( ot::Painter2D * _painter)
inline

Set the line painter. The item takes ownership of the painter.

◆ setLineShape()

void ot::GraphicsConnectionCfg::setLineShape ( ConnectionShape _shape)
inline

◆ setLineStyle() [1/2]

void ot::GraphicsConnectionCfg::setLineStyle ( const OutlineF & _style)
inline

◆ setLineStyle() [2/2]

void ot::GraphicsConnectionCfg::setLineStyle ( LineStyle _style)
inline

◆ setLineWidth()

void ot::GraphicsConnectionCfg::setLineWidth ( double _width)
inline

◆ setOriginConnectable()

void ot::GraphicsConnectionCfg::setOriginConnectable ( const std::string & _name)
inline

◆ setOriginUid()

void ot::GraphicsConnectionCfg::setOriginUid ( const ot::UID & _uid)
inline

◆ setUid()

void ot::GraphicsConnectionCfg::setUid ( const ot::UID & _uid)
inline

◆ shapeToString()

std::string ot::GraphicsConnectionCfg::shapeToString ( ConnectionShape _shape)
static

◆ stringToShape()

ot::GraphicsConnectionCfg::ConnectionShape ot::GraphicsConnectionCfg::stringToShape ( const std::string _shape)
static

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