|
CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
|
Floating-point 3D point with an optional attached Size; float counterpart of Point. More...
#include <MathClasses.h>
Public Member Functions | |
| PointFloat () | |
| Origin (0,0,0). | |
| PointFloat (double px, double py, double pz=0, Size psize=Size()) | |
| From coordinates and optional size. | |
| virtual | ~PointFloat () |
| operator Point () const | |
| Conversion to the integer variant (truncates). | |
| double | operator[] (int n) const |
| Component access: 0=x, 1=y, 2=z. | |
| bool | operator== (const Point &p) const |
| Equality against an integer point. | |
| bool | operator== (const PointFloat &p) const |
| Coordinate equality. | |
| PointFloat | operator- (const Point &p) const |
| Element-wise difference. | |
| PointFloat | operator- (const PointFloat &p) const |
| Element-wise difference. | |
| PointFloat | operator+ (const Point &p) const |
| Element-wise sum. | |
| PointFloat | operator+ (const PointFloat &p) const |
| Element-wise sum. | |
| PointFloat | operator+ (const Vector2D &v) const |
| Translate by a 2D vector. | |
| PointFloat | operator+ (const Vector3D &v) const |
| Translate by a 3D vector. | |
| PointFloat | operator* (const Point &p) const |
| Element-wise product. | |
| PointFloat | operator* (const PointFloat &p) const |
| Element-wise product. | |
| PointFloat | operator- (double a) const |
| Subtract scalar from each coordinate. | |
| PointFloat | operator+ (double a) const |
| Add scalar to each coordinate. | |
| PointFloat | operator* (double a) const |
| Scale each coordinate. | |
| double | getX () const |
| double | getY () const |
| double | getZ () const |
| Size | getSize () const |
| bool | set (double x, double y, double z=0) |
| Set all coordinates. | |
| bool | setX (double v) |
| Set x. | |
| bool | setY (double v) |
| Set y. | |
| bool | setZ (double v) |
| Set z. | |
| bool | setSize (Size s) |
| Set the attached size. | |
| double | getDistanceTo (const Point &p) const |
| Euclidean distance to an integer point. | |
| double | getDistanceTo (const PointFloat &p) const |
| Euclidean distance to a float point. | |
| std::string | print () |
| Human-readable representation for debugging. | |
Public Attributes | |
| double | x |
| double | y |
| double | z |
| Size | size |
Floating-point 3D point with an optional attached Size; float counterpart of Point.
Arithmetic operators are element-wise; operator[] indexes x=0, y=1, z=2.
Definition at line 438 of file MathClasses.h.
| cmlabs::PointFloat::PointFloat | ( | ) |
Origin (0,0,0).
Definition at line 216 of file MathClasses.cpp.
Referenced by getDistanceTo(), operator*(), operator*(), operator*(), operator+(), operator+(), operator+(), operator+(), operator+(), operator-(), operator-(), operator-(), and operator==().
|
virtual |
Definition at line 218 of file MathClasses.cpp.
| double cmlabs::PointFloat::getDistanceTo | ( | const Point & | p | ) | const |
Euclidean distance to an integer point.
Definition at line 345 of file MathClasses.cpp.
References cmlabs::Point::getX(), and getX().
| double cmlabs::PointFloat::getDistanceTo | ( | const PointFloat & | p | ) | const |
Euclidean distance to a float point.
Definition at line 348 of file MathClasses.cpp.
References getX(), and PointFloat().
| Size cmlabs::PointFloat::getSize | ( | ) | const |
| double cmlabs::PointFloat::getX | ( | ) | const |
Definition at line 334 of file MathClasses.cpp.
References x.
Referenced by cmlabs::Box::Box(), cmlabs::Box::getCMX(), cmlabs::Point::getDistanceTo(), getDistanceTo(), getDistanceTo(), cmlabs::Box::isPointWithin(), and cmlabs::MathClasses_UnitTest().
| double cmlabs::PointFloat::getY | ( | ) | const |
Definition at line 335 of file MathClasses.cpp.
References y.
Referenced by cmlabs::Box::Box(), cmlabs::Box::getCMY(), cmlabs::Point::getDistanceTo(), cmlabs::Box::isPointWithin(), and cmlabs::MathClasses_UnitTest().
| double cmlabs::PointFloat::getZ | ( | ) | const |
| cmlabs::PointFloat::operator Point | ( | ) | const |
Conversion to the integer variant (truncates).
Definition at line 220 of file MathClasses.cpp.
References cmlabs::Point::setSize(), cmlabs::Point::setX(), cmlabs::Point::setY(), cmlabs::Point::setZ(), size, x, y, and z.
| PointFloat cmlabs::PointFloat::operator* | ( | const Point & | p | ) | const |
Element-wise product.
Definition at line 298 of file MathClasses.cpp.
References PointFloat(), cmlabs::Point::x, x, cmlabs::Point::y, y, cmlabs::Point::z, and z.
| PointFloat cmlabs::PointFloat::operator* | ( | const PointFloat & | p | ) | const |
Element-wise product.
Definition at line 305 of file MathClasses.cpp.
References PointFloat(), x, y, and z.
| PointFloat cmlabs::PointFloat::operator* | ( | double | a | ) | const |
Scale each coordinate.
Definition at line 326 of file MathClasses.cpp.
References PointFloat(), x, y, and z.
| PointFloat cmlabs::PointFloat::operator+ | ( | const Point & | p | ) | const |
Element-wise sum.
Definition at line 271 of file MathClasses.cpp.
References PointFloat(), cmlabs::Point::x, x, cmlabs::Point::y, y, cmlabs::Point::z, and z.
| PointFloat cmlabs::PointFloat::operator+ | ( | const PointFloat & | p | ) | const |
Element-wise sum.
Definition at line 278 of file MathClasses.cpp.
References PointFloat(), x, y, and z.
| PointFloat cmlabs::PointFloat::operator+ | ( | const Vector2D & | v | ) | const |
Translate by a 2D vector.
Definition at line 285 of file MathClasses.cpp.
References PointFloat(), x, cmlabs::Vector2D::x, y, and cmlabs::Vector2D::y.
| PointFloat cmlabs::PointFloat::operator+ | ( | const Vector3D & | v | ) | const |
Translate by a 3D vector.
Definition at line 291 of file MathClasses.cpp.
References PointFloat(), x, cmlabs::Vector3D::x, y, cmlabs::Vector3D::y, z, and cmlabs::Vector3D::z.
| PointFloat cmlabs::PointFloat::operator+ | ( | double | a | ) | const |
Add scalar to each coordinate.
Definition at line 319 of file MathClasses.cpp.
References PointFloat(), x, y, and z.
| PointFloat cmlabs::PointFloat::operator- | ( | const Point & | p | ) | const |
Element-wise difference.
Definition at line 257 of file MathClasses.cpp.
References PointFloat(), cmlabs::Point::x, x, cmlabs::Point::y, y, cmlabs::Point::z, and z.
| PointFloat cmlabs::PointFloat::operator- | ( | const PointFloat & | p | ) | const |
Element-wise difference.
Definition at line 264 of file MathClasses.cpp.
References PointFloat(), x, y, and z.
| PointFloat cmlabs::PointFloat::operator- | ( | double | a | ) | const |
Subtract scalar from each coordinate.
Definition at line 312 of file MathClasses.cpp.
References PointFloat(), x, y, and z.
| bool cmlabs::PointFloat::operator== | ( | const Point & | p | ) | const |
Equality against an integer point.
Definition at line 241 of file MathClasses.cpp.
References cmlabs::Point::size, cmlabs::Point::x, x, cmlabs::Point::y, and cmlabs::Point::z.
| bool cmlabs::PointFloat::operator== | ( | const PointFloat & | p | ) | const |
Coordinate equality.
Definition at line 249 of file MathClasses.cpp.
References PointFloat(), size, x, y, and z.
| double cmlabs::PointFloat::operator[] | ( | int | n | ) | const |
Component access: 0=x, 1=y, 2=z.
Definition at line 229 of file MathClasses.cpp.
| std::string cmlabs::PointFloat::print | ( | ) |
Human-readable representation for debugging.
Definition at line 352 of file MathClasses.cpp.
References size, cmlabs::utils::StringFormat(), x, y, and z.
| bool cmlabs::PointFloat::set | ( | double | x, |
| double | y, | ||
| double | z = 0 ) |
| bool cmlabs::PointFloat::setSize | ( | Size | s | ) |
Set the attached size.
Definition at line 343 of file MathClasses.cpp.
References size.
Referenced by cmlabs::Point::operator PointFloat().
| bool cmlabs::PointFloat::setX | ( | double | v | ) |
Set x.
Definition at line 340 of file MathClasses.cpp.
References x.
Referenced by cmlabs::Point::operator PointFloat().
| bool cmlabs::PointFloat::setY | ( | double | v | ) |
Set y.
Definition at line 341 of file MathClasses.cpp.
References y.
Referenced by cmlabs::Point::operator PointFloat().
| bool cmlabs::PointFloat::setZ | ( | double | v | ) |
Set z.
Definition at line 342 of file MathClasses.cpp.
References z.
Referenced by cmlabs::Point::operator PointFloat().
| Size cmlabs::PointFloat::size |
Definition at line 450 of file MathClasses.h.
Referenced by getSize(), operator Point(), cmlabs::Point::operator==(), operator==(), PointFloat(), print(), and setSize().
| double cmlabs::PointFloat::x |
Definition at line 447 of file MathClasses.h.
Referenced by cmlabs::Box::constrainTo(), cmlabs::Bitmap::drawLine(), cmlabs::RandomPathGenerator::generateNextPoint(), cmlabs::Bitmap::getCopy(), cmlabs::Box::getDoubleSizeSameCenter(), getX(), operator Point(), cmlabs::Point::operator*(), operator*(), operator*(), operator*(), cmlabs::Point::operator+(), cmlabs::Point::operator+(), cmlabs::Point::operator+(), operator+(), operator+(), operator+(), operator+(), operator+(), cmlabs::Point::operator-(), operator-(), operator-(), operator-(), cmlabs::Point::operator==(), operator==(), operator==(), operator[](), PointFloat(), PointFloat(), print(), set(), cmlabs::Vector2D::set(), cmlabs::Vector3D::set(), and setX().
| double cmlabs::PointFloat::y |
Definition at line 448 of file MathClasses.h.
Referenced by cmlabs::Box::constrainTo(), cmlabs::Bitmap::drawLine(), cmlabs::RandomPathGenerator::generateNextPoint(), cmlabs::Bitmap::getCopy(), cmlabs::Box::getDoubleSizeSameCenter(), getY(), operator Point(), cmlabs::Point::operator*(), operator*(), operator*(), operator*(), cmlabs::Point::operator+(), cmlabs::Point::operator+(), cmlabs::Point::operator+(), operator+(), operator+(), operator+(), operator+(), operator+(), cmlabs::Point::operator-(), operator-(), operator-(), operator-(), cmlabs::Point::operator==(), operator==(), operator[](), PointFloat(), PointFloat(), print(), set(), cmlabs::Vector2D::set(), cmlabs::Vector3D::set(), and setY().
| double cmlabs::PointFloat::z |
Definition at line 449 of file MathClasses.h.
Referenced by getZ(), operator Point(), cmlabs::Point::operator*(), operator*(), operator*(), operator*(), cmlabs::Point::operator+(), cmlabs::Point::operator+(), operator+(), operator+(), operator+(), operator+(), cmlabs::Point::operator-(), operator-(), operator-(), operator-(), cmlabs::Point::operator==(), operator==(), operator[](), PointFloat(), PointFloat(), print(), set(), cmlabs::Vector3D::set(), and setZ().