Rectangle that holds the top left and bottom right corner in double values. More...
#include "Rect.h"
Public Member Functions | |
RectD () | |
RectD (const Point2DD &_topLeft, const Point2DD &_bottomRight) | |
RectD (const Point2DD &_topLeft, const Size2DD &_size) | |
RectD (const RectD &_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 RectD &_other) |
bool | operator== (const RectD &_other) const |
bool | operator!= (const RectD &_other) const |
void | setTop (double _top) |
double | getTop (void) const |
void | setLeft (double _left) |
double | getLeft (void) const |
void | setTopLeft (const Point2DD &_topLeft) |
const Point2DD & | getTopLeft (void) const |
void | setBottom (double _bottom) |
double | getBottom (void) const |
void | setRight (double _right) |
double | getRight (void) const |
void | setBottomRight (const Point2DD &_bottomRight) |
const Point2DD & | getBottomRight (void) const |
void | setWidth (double _width) |
double | getWidth (void) const |
void | setHeight (double _height) |
double | getHeight (void) const |
void | setSize (const Size2DD &_size) |
Size2DD | getSize (void) const |
RectD | unionWith (const RectD &_other) const |
Calculates and returns the union of this Rect and the provided Rect. | |
RectD | intersectsWith (const RectD &_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 (double _ax, double _ay) |
void | moveTo (const Point2DD &_topLeft) |
Moves the rect to the specified location. The top left and bottom right will be moved. | |
void | moveBy (double _dx, double _dy) |
void | moveBy (const Point2DD &_distance) |
Moves the rect by the provided distance. The top left and bottom right will be moved. | |
Rect | toRect (void) const |
RectF | toRectF (void) const |
Public Member Functions inherited from ot::Serializable | |
Serializable () | |
virtual | ~Serializable () |
Rectangle that holds the top left and bottom right corner in double values.
ot::RectD::RectD | ( | ) |
ot::RectD::RectD | ( | const RectD & | _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::RectD::moveBy | ( | const Point2DD & | _distance | ) |
Moves the rect by the provided distance. The top left and bottom right will be moved.
|
inline |
void ot::RectD::moveTo | ( | const Point2DD & | _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::RectD::toRect | ( | void | ) | const |
ot::RectF ot::RectD::toRectF | ( | void | ) | const |