#include <hps.h>
Public Member Functions | |
Cuboid_3D () | |
Creates an invalid cuboid. More... | |
template<typename D > | |
Cuboid_3D (Cuboid_3D< D > const &that) | |
Creates a cuboid equal to another cuboid. More... | |
Cuboid_3D (Sphere_3D< F > const &that) | |
Creates a cuboid that will fit tightly around a sphere. More... | |
Cuboid_3D (Point_3D< F > const &in_min, Point_3D< F > const &in_max) | |
Creates a cuboid based on two points, which become opposite corners of the cuboid. More... | |
Cuboid_3D (size_t count, Point_3D< F > const *points) | |
Creates a cuboid based on an array of points. More... | |
template<typename T > | |
Cuboid_3D (size_t count, T const *indices, Point_3D< F > const *points) | |
Creates a cuboid based on an array of points. More... | |
Cuboid_3D (Rectangle const &that) | |
Creates a cuboid with the same dimensions as a rectangle. More... | |
HPS_INLINE bool | IsValid () const |
Tests whether this cuboid is valid. More... | |
void | Invalidate () |
Invalidates this cuboid. More... | |
HPS_INLINE bool | operator== (Cuboid_3D const &cuboid) const |
Determines if the maximum and minimum points of this cuboid are equal to the maximum and minimum points of another cuboid. More... | |
HPS_INLINE bool | operator!= (Cuboid_3D const &cuboid) const |
Determines if the maximum and minimum points of this cuboid are not equal to the maximum and minimum points of another cuboid. More... | |
HPS_INLINE void | Generate_Cuboid_Points (Point_3D< F > *points) const |
Assigns the eight corners of the cuboid based on the points in the parameter array. More... | |
HPS_INLINE Vector_3D< F > | Diagonal () const |
Returns the diagonal vector of the cuboid. More... | |
HPS_INLINE F | Volume () const |
Returns the volume of this cuboid. More... | |
HPS_INLINE bool | Intersecting (Cuboid_3D const &cuboid) const |
Determines whether this cuboid intersects with another cuboid. More... | |
HPS_INLINE bool | Intersecting (Cuboid_3D const &cuboid, F const allowance) const |
Determines whether this cuboid intersects with another cuboid. More... | |
HPS_INLINE bool | Intersecting (int dimension, Cuboid_3D const &cuboid) const |
Returns true if this cuboid intersects with the parameter cuboid along a certain axis. More... | |
HPS_INLINE bool | Intersecting (int dimension, Cuboid_3D const &cuboid, F const allowance) const |
Returns true if this cuboid intersects with the parameter cuboid along a certain axis, and considers a tolerance value. More... | |
HPS_INLINE bool | Intersecting (Point_3D< F > const &start, Vector_3D< F > const &direction) const |
Determines whether this cuboid intersects with a ray. More... | |
HPS_INLINE bool | Intersecting (Point_3D< F > const &point1, Point_3D< F > const &point2) const |
Determines whether this cuboid intersects with an infinite line. More... | |
HPS_INLINE void | Merge (Cuboid_3D const &cuboid) |
Merges this cuboid with another cuboid. More... | |
HPS_INLINE void | Merge (Sphere_3D< F > const &sphere) |
Merges this cuboid with another cuboid created from a sphere. More... | |
HPS_INLINE void | Merge (Point_3D< F > const &point) |
Expands the cuboid to include a point. More... | |
void | Merge (size_t count, Point_3D< F > const *points) |
Expands this cuboid to include a set of points. More... | |
template<typename T > | |
void | Merge (size_t count, T const *indices, Point_3D< F > const *points) |
Expands this cuboid to include a set of indexed points. More... | |
HPS_INLINE bool | Contains (Cuboid_3D const &contained) const |
Returns true if the cuboid completely contains the parameter cuboid. More... | |
HPS_INLINE bool | Contains (Point_3D< F > const &contained) const |
Returns true if the cuboid completely contains a cuboid based on the parameter points. More... | |
HPS_INLINE bool | Contains (Point_3D< F > const &contained, F epsilon) const |
Returns true if the cuboid completely contains a cuboid based on the parameter points, with a tolerance value. More... | |
HPS_INLINE Cuboid_3D & | Intersect (Cuboid_3D const &cuboid) |
Replaces this cuboid with the intersection of this cuboid and the parameter cuboid. More... | |
HPS_INLINE Cuboid_3D & | Union (Cuboid_3D const &cuboid) |
Replaces this cuboid with the union of this cuboid and the parameter cuboid. More... | |
HPS_INLINE Cuboid_3D & | Expand (F border) |
Expands both corners of this cuboid. More... | |
HPS_INLINE Cuboid_3D & | Contract (F border) |
Contracts both corners of this cuboid. More... | |
Static Public Member Functions | |
static HPS_INLINE Cuboid_3D | Invalid () |
Creates an invalid cuboid. More... | |
Public Attributes | |
Point_3D< F > | min |
The minimum point of this cuboid. More... | |
Point_3D< F > | max |
The maximum point of this cuboid. More... | |
Private Member Functions | |
void | merge2 (Point_3D< F > const &p1, Point_3D< F > const &p2) |
bool | LineIntersecting (Point_3D< F > const &start, Vector_3D< F > const &direction, bool is_ray) const |
Static Private Member Functions | |
static HPS_INLINE Point_3D< F > | Limit_Point () |
|
inline |
Creates an invalid cuboid.
|
inlineexplicit |
Creates a cuboid equal to another cuboid.
that | The other cuboid |
HPS_INLINE HPS::Cuboid_3D< F >::Cuboid_3D | ( | Sphere_3D< F > const & | that | ) |
Creates a cuboid that will fit tightly around a sphere.
that | The sphere to fit |
|
inline |
Creates a cuboid based on two points, which become opposite corners of the cuboid.
in_min | The first point of the cuboid |
in_max | The second point of the cuboid |
|
inline |
Creates a cuboid based on an array of points.
Only the minimum and maximum points are used, which become opposite corners of the cuboid. If count is 0, then an invalid cuboid is returned.
count | The size of points |
points | An array of points |
|
inline |
Creates a cuboid based on an array of points.
Only the minimum and maximum points are used, which become opposite corners of the cuboid. If count is 0, then an invalid cuboid is returned.
count | The number of index values in indices |
indices | the index values used to select points |
points | An array of points |
|
inline |
Creates a cuboid with the same dimensions as a rectangle.
that | The rectangle to create the cuboid from |
|
inline |
Returns true if the cuboid completely contains the parameter cuboid.
contained | The other cuboid |
|
inline |
Returns true if the cuboid completely contains a cuboid based on the parameter points.
contained | The points to compare against |
|
inline |
Returns true if the cuboid completely contains a cuboid based on the parameter points, with a tolerance value.
contained | The points to compare against |
epsilon | The tolerance value |
|
inline |
Contracts both corners of this cuboid.
border | Amount to contract |
|
inline |
Returns the diagonal vector of the cuboid.
|
inline |
Expands both corners of this cuboid.
border | Amount to expand |
|
inline |
Assigns the eight corners of the cuboid based on the points in the parameter array.
The array must contain at least eight points.
points | The array which contains points |
|
inline |
Replaces this cuboid with the intersection of this cuboid and the parameter cuboid.
cuboid | The cuboid to compute intersection against |
|
inline |
Determines whether this cuboid intersects with another cuboid.
cuboid | The other cuboid |
|
inline |
Determines whether this cuboid intersects with another cuboid.
Allows for a tolerance value to be considered.
cuboid | The other cuboid |
|
inline |
Returns true if this cuboid intersects with the parameter cuboid along a certain axis.
dimension | Must be either 0, 1, or 2. Corresponds to the X, Y, and Z axes. |
cuboid | The cuboid to test against |
|
inline |
Returns true if this cuboid intersects with the parameter cuboid along a certain axis, and considers a tolerance value.
dimension | Must be 0, 1, or 2. Corresponds to the X, Y, and Z axes. |
cuboid | The cuboid to test against |
allowance | The tolerance value |
|
inline |
Determines whether this cuboid intersects with a ray.
start | The start point of the ray. |
direction | The direction of the ray. |
|
inline |
Determines whether this cuboid intersects with an infinite line.
point1 | A point on the line. |
point2 | A different point on the line. |
|
inlinestatic |
Creates an invalid cuboid.
|
inline |
Invalidates this cuboid.
|
inline |
Tests whether this cuboid is valid.
The cuboid is considered valid if the minimum point is less than or equal to the maximum point.
|
inlinestaticprivate |
|
private |
|
inline |
Merges this cuboid with another cuboid.
Only the smallest and largest values of the cuboids are retained.
cuboid | The other cuboid |
|
inline |
Merges this cuboid with another cuboid created from a sphere.
Only the smallest and largest values of the cuboids are retained.
cuboid | The other cuboid |
|
inline |
Expands the cuboid to include a point.
point | The point to include |
|
inline |
Expands this cuboid to include a set of points.
count | The number of points in points |
points | The array of points |
|
inline |
Expands this cuboid to include a set of indexed points.
count | The number of index values in indices |
indices | the index values used to select points |
points | The array of points |
|
inlineprivate |
|
inline |
Determines if the maximum and minimum points of this cuboid are not equal to the maximum and minimum points of another cuboid.
cuboid | The other cuboid |
|
inline |
Determines if the maximum and minimum points of this cuboid are equal to the maximum and minimum points of another cuboid.
cuboid | The other cuboid |
|
inline |
Replaces this cuboid with the union of this cuboid and the parameter cuboid.
cuboid | The cuboid to compute union against |
|
inline |
Returns the volume of this cuboid.
Point_3D<F> HPS::Cuboid_3D< F >::max |
The maximum point of this cuboid.
Point_3D<F> HPS::Cuboid_3D< F >::min |
The minimum point of this cuboid.