#include <c4d_tools.h>
A class to construct a bounding box around points.
Public Member Functions | |
LMinMax () | |
LMinMax (const Vector64 &v) | |
void | Init () |
void | Init (const Vector64 &v) |
void | AddPoint (const Vector64 &p) |
void | AddPoints (const Vector64 &a, const Vector64 &b) |
void | Set (const Vector64 &a, const Vector64 &b) |
Bool | IsPopulated () const |
const Vector64 & | GetMin () const |
const Vector64 & | GetMax () const |
Vector64 | GetMp () const |
Vector64 | GetRad () const |
void | GetMpRad (Vector64 *mp, Vector64 *rad) const |
Private Attributes | |
Vector64 | min |
Vector64 | max |
Bool | used |
LMinMax | ( | ) |
Default constructor.
Constructs with vector v set for both the minimum and maximum.
[in] | v | The vector for minimum and maximum. |
void Init | ( | ) |
Resets the minimum and maximum to the largest values possible.
void Init | ( | const Vector64 & | v | ) |
Initializes the minimum and maximum with vector v.
[in] | v | The value to initialize minimum and maximum. |
void AddPoint | ( | const Vector64 & | p | ) |
Adds point p and recalculates the minimum and maximum.
[in] | p | The point to add into the bounds. |
Adds points a and b and recalculates the minimum and maximum.
[in] | a | The minimum point to add into the bounds. |
[in] | b | The maximum point to add into the bounds. |
Sets the minimum and maximum of the bounding box.
[in] | a | The minimum. |
[in] | b | The maximum. |
Bool IsPopulated | ( | ) | const |
Checks if any points were added.
const Vector64& GetMin | ( | ) | const |
Gets the minimum of the bounding box.
const Vector64& GetMax | ( | ) | const |
Gets the maximum of the bounding box.
Vector64 GetMp | ( | ) | const |
Gets the middle between the minimum and maximum (the center).
Vector64 GetRad | ( | ) | const |
Gets half the distance between the minimum and the maximum (the size).
Gets both the center and size of the bounding box.
[out] | mp | Assigned the center of the bounds. |
[out] | rad | Assigned the size of the bounds. |
|
private |
|
private |
|
private |