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

2D Size with float values More...

#include "Size2D.h"

Inheritance diagram for ot::Size2DF:
ot::Serializable

Public Member Functions

 Size2DF ()
 
 Size2DF (float _w, float _h)
 
 Size2DF (const Size2DF &_other)
 
virtual ~Size2DF ()
 
Size2DFoperator= (const Size2DF &_other)
 
bool operator== (const Size2DF &_other) const
 
bool operator!= (const Size2DF &_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.
 
bool isValid (void) const
 Returns true if the width and height are greater or equal 0.
 
void setWidth (float _w)
 Set width.
 
float width (void) const
 Return the width.
 
void setHeight (float _h)
 Set height.
 
float height (void) const
 Return the height.
 
- 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.
 

Detailed Description

2D Size with float values

Constructor & Destructor Documentation

◆ Size2DF() [1/3]

ot::Size2DF::Size2DF ( )
inline

◆ Size2DF() [2/3]

ot::Size2DF::Size2DF ( float _w,
float _h )
inline

◆ Size2DF() [3/3]

ot::Size2DF::Size2DF ( const Size2DF & _other)
inline

◆ ~Size2DF()

virtual ot::Size2DF::~Size2DF ( )
inlinevirtual

Member Function Documentation

◆ addToJsonObject()

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

◆ height()

float ot::Size2DF::height ( void ) const
inline

Return the height.

◆ isValid()

bool ot::Size2DF::isValid ( void ) const
inline

Returns true if the width and height are greater or equal 0.

◆ operator!=()

bool ot::Size2DF::operator!= ( const Size2DF & _other) const
inline

◆ operator=()

Size2DF & ot::Size2DF::operator= ( const Size2DF & _other)
inline

◆ operator==()

bool ot::Size2DF::operator== ( const Size2DF & _other) const
inline

◆ setFromJsonObject()

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

◆ setHeight()

void ot::Size2DF::setHeight ( float _h)
inline

Set height.

Parameters
_hHeight to set

◆ setWidth()

void ot::Size2DF::setWidth ( float _w)
inline

Set width.

Parameters
_wWidth to set

◆ width()

float ot::Size2DF::width ( void ) const
inline

Return the width.


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