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

General item transformation. More...

#include "Transform.h"

Inheritance diagram for ot::Transform:
ot::Serializable

Public Types

enum  FlipState { NoFlip = 0x00 , FlipVertically = 0x01 , FlipHorizontally = 0x02 }
 Flip state. More...
 
typedef Flags< FlipStateFlipStateFlags
 

Public Member Functions

 Transform ()
 Flip state flags.
 
 Transform (double _rotationAngle, const FlipStateFlags &_flipState=FlipStateFlags(FlipState::NoFlip))
 
 Transform (const Transform &_other)
 
virtual ~Transform ()
 
Transformoperator= (const Transform &_other)
 
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
 Set the object contents from the provided JSON object.
 
void setRotation (double _angle)
 Set item rotation. The angle must be between 0 and 359 degrees.
 
double getRotation (void) const
 Item rotation. The angle must be between 0 and 359 degrees.
 
void setFlipState (FlipState _state, bool _active=true)
 
void setFlipStateFlags (const FlipStateFlags &_flags)
 
const FlipStateFlagsgetFlipStateFlags (void) const
 
bool hasTransform (void) const
 Returns true if any transformation is set.
 
- Public Member Functions inherited from ot::Serializable
 Serializable ()
 
virtual ~Serializable ()
 

Detailed Description

General item transformation.

Member Typedef Documentation

◆ FlipStateFlags

Member Enumeration Documentation

◆ FlipState

Flip state.

Enumerator
NoFlip 
FlipVertically 

Item is not flipped.

FlipHorizontally 

Item is flipped vertically.

Constructor & Destructor Documentation

◆ Transform() [1/3]

ot::Transform::Transform ( )

Flip state flags.

Default constructor. No rotation angle and no flip.

◆ Transform() [2/3]

ot::Transform::Transform ( double _rotationAngle,
const FlipStateFlags & _flipState = FlipStateFlags(FlipState::NoFlip) )

◆ Transform() [3/3]

ot::Transform::Transform ( const Transform & _other)

◆ ~Transform()

ot::Transform::~Transform ( )
virtual

Member Function Documentation

◆ addToJsonObject()

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

Add the object contents to the provided JSON object.

Parameters
_objectJson object reference to write the data to.
_allocatorAllocator.

Implements ot::Serializable.

◆ getFlipStateFlags()

const FlipStateFlags & ot::Transform::getFlipStateFlags ( void ) const
inline

◆ getRotation()

double ot::Transform::getRotation ( void ) const
inline

Item rotation. The angle must be between 0 and 359 degrees.

◆ hasTransform()

bool ot::Transform::hasTransform ( void ) const
inline

Returns true if any transformation is set.

◆ operator=()

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

◆ setFlipState()

void ot::Transform::setFlipState ( FlipState _state,
bool _active = true )
inline

◆ setFlipStateFlags()

void ot::Transform::setFlipStateFlags ( const FlipStateFlags & _flags)
inline

◆ setFromJsonObject()

void ot::Transform::setFromJsonObject ( const ot::ConstJsonObject & _object)
overridevirtual

Set the object contents from the provided JSON object.

Parameters
_objectThe JSON object containing the information.
Exceptions
Maythrow an exception if the provided object is not valid (members missing or invalid types).

Implements ot::Serializable.

◆ setRotation()

void ot::Transform::setRotation ( double _angle)
inline

Set item rotation. The angle must be between 0 and 359 degrees.


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