#include "Rect.h"
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 Point2DF & | getTopLeft (void) const |
void | setBottom (float _bottom) |
float | getBottom (void) const |
void | setRight (float _right) |
float | getRight (void) const |
void | setBottomRight (const Point2DF &_bottomRight) |
const Point2DF & | getBottomRight (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 () |
ot::RectF::RectF | ( | ) |
ot::RectF::RectF | ( | const RectF & | _other | ) |
|
overridevirtual |
Add the object contents to the provided JSON object.
_object | Json object reference |
_allocator | Allocator |
Implements ot::Serializable.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Returns true if top left is (0, 0) and bottom right is (0, 0).
|
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.
void ot::RectF::moveBy | ( | const Point2DF & | _distance | ) |
Moves the rect by the provided distance. The top left and bottom right will be moved.
|
inline |
void ot::RectF::moveTo | ( | const Point2DF & | _topLeft | ) |
Moves the rect to the specified location. The top left and bottom right will be moved.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
overridevirtual |
Will set the object contents from the provided JSON object.
_object | The JSON object containing the information |
Will | throw an exception if the provided object is not valid (members missing or invalid types) |
Implements ot::Serializable.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
ot::Rect ot::RectF::toRect | ( | void | ) | const |
ot::RectD ot::RectF::toRectD | ( | void | ) | const |