#include <c4d_tools.h>
A class to construct a bounding box around points.
Public Member Functions | |
LMinMax () | |
LMinMax (const Vector64 &v) | |
void | Init (void) |
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 (void) const |
const Vector64 & | GetMin (void) const |
const Vector64 & | GetMax (void) const |
Vector64 | GetMp (void) const |
Vector64 | GetRad (void) 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 | ( | void | ) |
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 | ( | void | ) | const |
Checks if any points were added.
const Vector64& GetMin | ( | void | ) | const |
Gets the minimum of the bounding box.
const Vector64& GetMax | ( | void | ) | const |
Gets the maximum of the bounding box.
Vector64 GetMp | ( | void | ) | const |
Gets the middle between the minimum and maximum (the center).
Vector64 GetRad | ( | void | ) | 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 |