|
CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
|
2D/3D extent (width, height, optional depth) stored as doubles. More...
#include <MathClasses.h>
Public Member Functions | |
| Size () | |
| Zero size. | |
| Size (double width, double height, double depth=0) | |
| From explicit dimensions. | |
| virtual | ~Size () |
| bool | equals (const Size &size) const |
| Exact component equality. | |
| bool | operator== (const Size &p) const |
| Same as equals(). | |
| Size | operator* (const Vector2D &v) const |
| Scale w by v.x and h by v.y. | |
| double | getHeight () const |
| double | getWidth () const |
| double | getDepth () const |
| bool | setHeight (double height) |
| Set height. | |
| bool | setWidth (double width) |
| Set width. | |
| bool | setDepth (double depth) |
| Set depth. | |
| bool | isNonZero () const |
| double | getArea () const |
| double | getDiagonalLenth () const |
| std::string | print () |
| Human-readable representation for debugging. | |
Public Attributes | |
| double | w |
| Width. | |
| double | h |
| Height. | |
| double | d |
| Depth (0 for 2D use). | |
2D/3D extent (width, height, optional depth) stored as doubles.
Definition at line 334 of file MathClasses.h.
| cmlabs::Size::Size | ( | ) |
Zero size.
Definition at line 15 of file MathClasses.cpp.
Referenced by equals(), operator*(), and operator==().
| cmlabs::Size::Size | ( | double | width, |
| double | height, | ||
| double | depth = 0 ) |
|
virtual |
Definition at line 17 of file MathClasses.cpp.
| bool cmlabs::Size::equals | ( | const Size & | size | ) | const |
Exact component equality.
Definition at line 19 of file MathClasses.cpp.
References d, h, Size(), and w.
Referenced by _wrap_Size_equals(), and operator==().
| double cmlabs::Size::getArea | ( | ) | const |
Definition at line 50 of file MathClasses.cpp.
References getHeight(), and getWidth().
Referenced by _wrap_Size_getArea(), cmlabs::MathClasses_UnitTest(), and cmlabs::Box::percentOverlap().
| double cmlabs::Size::getDepth | ( | ) | const |
Definition at line 40 of file MathClasses.cpp.
References d.
Referenced by _wrap_Size_getDepth().
| double cmlabs::Size::getDiagonalLenth | ( | ) | const |
Definition at line 54 of file MathClasses.cpp.
References getHeight(), and getWidth().
Referenced by _wrap_Size_getDiagonalLenth(), and cmlabs::MathClasses_UnitTest().
| double cmlabs::Size::getHeight | ( | ) | const |
Definition at line 38 of file MathClasses.cpp.
References h.
Referenced by _wrap_Size_getHeight(), getArea(), getDiagonalLenth(), and cmlabs::MathClasses_UnitTest().
| double cmlabs::Size::getWidth | ( | ) | const |
Definition at line 39 of file MathClasses.cpp.
References w.
Referenced by _wrap_Size_getWidth(), getArea(), getDiagonalLenth(), and cmlabs::MathClasses_UnitTest().
| bool cmlabs::Size::isNonZero | ( | ) | const |
Definition at line 46 of file MathClasses.cpp.
Referenced by _wrap_Size_isNonZero(), cmlabs::MathClasses_UnitTest(), and cmlabs::Box::percentOverlap().
Scale w by v.x and h by v.y.
Definition at line 30 of file MathClasses.cpp.
References h, Size(), w, cmlabs::Vector2D::x, and cmlabs::Vector2D::y.
| bool cmlabs::Size::operator== | ( | const Size & | p | ) | const |
| std::string cmlabs::Size::print | ( | ) |
Human-readable representation for debugging.
Definition at line 58 of file MathClasses.cpp.
References d, h, cmlabs::utils::StringFormat(), and w.
| bool cmlabs::Size::setDepth | ( | double | depth | ) |
| bool cmlabs::Size::setHeight | ( | double | height | ) |
| bool cmlabs::Size::setWidth | ( | double | width | ) |
| double cmlabs::Size::d |
Depth (0 for 2D use).
Definition at line 343 of file MathClasses.h.
Referenced by equals(), getDepth(), isNonZero(), print(), setDepth(), Size(), and Size().
| double cmlabs::Size::h |
Height.
Definition at line 342 of file MathClasses.h.
Referenced by cmlabs::Box::constrainTo(), equals(), cmlabs::Bitmap::getCopy(), cmlabs::Box::getDoubleSizeSameCenter(), getHeight(), isNonZero(), operator*(), print(), setHeight(), Size(), and Size().
| double cmlabs::Size::w |
Width.
Definition at line 341 of file MathClasses.h.
Referenced by cmlabs::Box::constrainTo(), equals(), cmlabs::Bitmap::getCopy(), cmlabs::Box::getDoubleSizeSameCenter(), getWidth(), isNonZero(), operator*(), print(), setWidth(), Size(), and Size().