General item transformation. More...
#include "Transform.h"
Public Types | |
| enum | FlipState { NoFlip = 0x00 , FlipVertically = 0x01 , FlipHorizontally = 0x02 } |
| Flip state. More... | |
| typedef Flags< FlipState > | FlipStateFlags |
Public Member Functions | |
| Transform () | |
| Flip state flags. | |
| Transform (double _rotationAngle, const FlipStateFlags &_flipState=FlipStateFlags(FlipState::NoFlip)) | |
| Transform (const Transform &_other) | |
| virtual | ~Transform () |
| Transform & | operator= (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 FlipStateFlags & | getFlipStateFlags (void) const |
| bool | hasTransform (void) const |
| Returns true if any transformation is set. | |
Public Member Functions inherited from ot::Serializable | |
| Serializable () | |
| virtual | ~Serializable () |
General item transformation.
| typedef Flags<FlipState> ot::Transform::FlipStateFlags |
| ot::Transform::Transform | ( | ) |
Flip state flags.
Default constructor. No rotation angle and no flip.
| ot::Transform::Transform | ( | double | _rotationAngle, |
| const FlipStateFlags & | _flipState = FlipStateFlags(FlipState::NoFlip) ) |
| ot::Transform::Transform | ( | const Transform & | _other | ) |
|
virtual |
|
overridevirtual |
Add the object contents to the provided JSON object.
| _object | Json object reference to write the data to. |
| _allocator | Allocator. |
Implements ot::Serializable.
|
inline |
|
inline |
Item rotation. The angle must be between 0 and 359 degrees.
|
inline |
Returns true if any transformation is set.
| ot::Transform & ot::Transform::operator= | ( | const Transform & | _other | ) |
|
inline |
|
inline |
|
overridevirtual |
Set the object contents from the provided JSON object.
| _object | The JSON object containing the information. |
| May | throw an exception if the provided object is not valid (members missing or invalid types). |
Implements ot::Serializable.
|
inline |
Set item rotation. The angle must be between 0 and 359 degrees.