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

#include "Rect.h"

Inheritance diagram for ot::RectF:
ot::Serializable

Public Member Functions

 RectF ()
 
 RectF (const Point2DF &_topLeft, const Point2DF &_bottomRight)
 
 RectF (const Point2DF &_topLeft, const Size2DF &_size)
 
 RectF (const RectF &_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
 Will set the object contents from the provided JSON object.
 
bool operator= (const RectF &_other)
 
bool operator== (const RectF &_other) const
 
bool operator!= (const RectF &_other) const
 
void setTop (float _top)
 
float getTop (void) const
 
void setLeft (float _left)
 
float getLeft (void) const
 
void setTopLeft (const Point2DF &_topLeft)
 
const Point2DFgetTopLeft (void) const
 
void setBottom (float _bottom)
 
float getBottom (void) const
 
void setRight (float _right)
 
float getRight (void) const
 
void setBottomRight (const Point2DF &_bottomRight)
 
const Point2DFgetBottomRight (void) const
 
void setWidth (float _width)
 
float getWidth (void) const
 
void setHeight (float _height)
 
float getHeight (void) const
 
void setSize (const Size2DF &_size)
 
Size2DF getSize (void) const
 
RectF unionWith (const RectF &_other) const
 Calculates and returns the union of this Rect and the provided Rect.
 
RectF intersectsWith (const RectF &_other) const
 Calclates and returns the intersection of this Rect and the provided Rect.
 
bool isAllZero (void) const
 Returns true if top left is (0, 0) and bottom right is (0, 0).
 
bool isValid (void) const
 Returns true if the top left and bottom right points are set correctly. If the left value is bigger than the right value or the bottom value bigger than the top value false is returned.
 
void moveTo (float _ax, float _ay)
 
void moveTo (const Point2DF &_topLeft)
 Moves the rect to the specified location. The top left and bottom right will be moved.
 
void moveBy (float _dx, float _dy)
 
void moveBy (const Point2DF &_distance)
 Moves the rect by the provided distance. The top left and bottom right will be moved.
 
Rect toRect (void) const
 
RectD toRectD (void) const
 
- Public Member Functions inherited from ot::Serializable
 Serializable ()
 
virtual ~Serializable ()
 

Constructor & Destructor Documentation

◆ RectF() [1/4]

ot::RectF::RectF ( )

◆ RectF() [2/4]

ot::RectF::RectF ( const Point2DF & _topLeft,
const Point2DF & _bottomRight )

◆ RectF() [3/4]

ot::RectF::RectF ( const Point2DF & _topLeft,
const Size2DF & _size )

◆ RectF() [4/4]

ot::RectF::RectF ( const RectF & _other)

Member Function Documentation

◆ addToJsonObject()

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

◆ getBottom()

float ot::RectF::getBottom ( void ) const
inline

◆ getBottomRight()

const Point2DF & ot::RectF::getBottomRight ( void ) const
inline

◆ getHeight()

float ot::RectF::getHeight ( void ) const
inline

◆ getLeft()

float ot::RectF::getLeft ( void ) const
inline

◆ getRight()

float ot::RectF::getRight ( void ) const
inline

◆ getSize()

Size2DF ot::RectF::getSize ( void ) const
inline

◆ getTop()

float ot::RectF::getTop ( void ) const
inline

◆ getTopLeft()

const Point2DF & ot::RectF::getTopLeft ( void ) const
inline

◆ getWidth()

float ot::RectF::getWidth ( void ) const
inline

◆ intersectsWith()

ot::RectF ot::RectF::intersectsWith ( const RectF & _other) const

Calclates and returns the intersection of this Rect and the provided Rect.

◆ isAllZero()

bool ot::RectF::isAllZero ( void ) const
inline

Returns true if top left is (0, 0) and bottom right is (0, 0).

◆ isValid()

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

Returns true if the top left and bottom right points are set correctly. If the left value is bigger than the right value or the bottom value bigger than the top value false is returned.

◆ moveBy() [1/2]

void ot::RectF::moveBy ( const Point2DF & _distance)

Moves the rect by the provided distance. The top left and bottom right will be moved.

◆ moveBy() [2/2]

void ot::RectF::moveBy ( float _dx,
float _dy )
inline

◆ moveTo() [1/2]

void ot::RectF::moveTo ( const Point2DF & _topLeft)

Moves the rect to the specified location. The top left and bottom right will be moved.

◆ moveTo() [2/2]

void ot::RectF::moveTo ( float _ax,
float _ay )
inline

◆ operator!=()

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

◆ operator=()

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

◆ operator==()

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

◆ setBottom()

void ot::RectF::setBottom ( float _bottom)
inline

◆ setBottomRight()

void ot::RectF::setBottomRight ( const Point2DF & _bottomRight)
inline

◆ setFromJsonObject()

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

◆ setHeight()

void ot::RectF::setHeight ( float _height)
inline

◆ setLeft()

void ot::RectF::setLeft ( float _left)
inline

◆ setRight()

void ot::RectF::setRight ( float _right)
inline

◆ setSize()

void ot::RectF::setSize ( const Size2DF & _size)
inline

◆ setTop()

void ot::RectF::setTop ( float _top)
inline

◆ setTopLeft()

void ot::RectF::setTopLeft ( const Point2DF & _topLeft)
inline

◆ setWidth()

void ot::RectF::setWidth ( float _width)
inline

◆ toRect()

ot::Rect ot::RectF::toRect ( void ) const

◆ toRectD()

ot::RectD ot::RectF::toRectD ( void ) const

◆ unionWith()

ot::RectF ot::RectF::unionWith ( const RectF & _other) const

Calculates and returns the union of this Rect and the provided Rect.


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