GenericBox represents the bounding box of shapes.
More...
#include <easy3d/core/box.h>
|
typedef Vec< DIM, FT > | Point |
| Point type.
|
|
typedef Vec< DIM, FT > | Vector |
| Vector type.
|
|
typedef GenericBox< DIM, FT > | thisclass |
| This class.
|
|
|
| GenericBox () |
| Construct a box uninitialized (which is invalid).
|
|
| GenericBox (const Point &pmin, const Point &pmax) |
| Construct a box from its diagonal corners.
|
|
| GenericBox (const Point &c, FT r) |
| Construct a box from its center and radius.
|
|
bool | is_valid () const |
| Check if the box is valid.
|
|
void | clear () |
| Invalidate the box.
|
|
const Point & | min_point () const |
| Return the coordinates of the min corner (const version).
|
|
Point & | min_point () |
| Return the coordinates of the min corner.
|
|
const Point & | max_point () const |
| Return the coordinates of the max corner (const version).
|
|
Point & | max_point () |
| Return the coordinates of the max corner.
|
|
FT | min_coord (unsigned int axis) const |
| Return a component of the coordinates of the min corner.
|
|
FT | max_coord (unsigned int axis) const |
| Return a component of the coordinates of the max corner.
|
|
FT | range (unsigned int axis) const |
| Return the range of the box along the axis.
|
|
FT | max_range () const |
| Return the max range.
|
|
FT | min_range () const |
| Return the min range.
|
|
unsigned int | max_range_axis () const |
| Return the axis index of the max range of the box.
|
|
unsigned int | min_range_axis () const |
| Return the axis index of the min range of the box.
|
|
Point | center () const |
| Return the center of the box.
|
|
Vector | diagonal_vector () const |
| Return the diagonal vector of the box.
|
|
FT | diagonal_length () const |
| Return the length of the diagonal of the box.
|
|
FT | radius () const |
| Return the radius of the box (i.e., half of its diagonal length).
|
|
FT | surface_area () const |
| Return the surface area of the box.
|
|
void | grow (const Point &p) |
| Add a point to this box. This will compute its new extent.
|
|
void | grow (const thisclass &b) |
| Add a box to this box. This will compute its new extent.
|
|
thisclass | operator+ (const thisclass &b) const |
| Return the bounding box of 'this' and another box b .
|
|
thisclass & | operator+= (const thisclass &b) |
| Modify this box by adding another box b .
|
|
bool | contains (Point const &p) const |
| Check if this box contains a point p .
|
|
bool | contains (thisclass const &b) const |
| Check if this box contains another box b .
|
|
bool | intersects (thisclass const &b) const |
| Check if this box intersects another box b .
|
|
template<int DIM, typename FT>
class easy3d::GenericBox< DIM, FT >
GenericBox represents the bounding box of shapes.
- Template Parameters
-
DIM | The dimension (i.e., 2 or 3). |
FT | The type of the floating point number (i.e., float or double). |
◆ GenericBox() [1/2]
template<int DIM, typename FT>
Construct a box from its diagonal corners.
- Parameters
-
pmin | The minimum corner point. |
pmax | The maximum corner point. |
◆ GenericBox() [2/2]
template<int DIM, typename FT>
Construct a box from its center and radius.
- Parameters
-
c | The center point. |
r | The radius. |
◆ center()
template<int DIM, typename FT>
Return the center of the box.
- Returns
- The center point.
◆ contains() [1/2]
template<int DIM, typename FT>
bool contains |
( |
Point const & | p | ) |
const |
|
inline |
Check if this box contains a point p
.
- Parameters
-
- Returns
- True if the box contains the point, false otherwise.
◆ contains() [2/2]
template<int DIM, typename FT>
Check if this box contains another box b
.
- Parameters
-
- Returns
- True if the box contains the other box, false otherwise.
◆ diagonal_length()
template<int DIM, typename FT>
FT diagonal_length |
( |
| ) |
const |
|
inline |
Return the length of the diagonal of the box.
- Returns
- The diagonal length.
◆ diagonal_vector()
template<int DIM, typename FT>
Vector diagonal_vector |
( |
| ) |
const |
|
inline |
Return the diagonal vector of the box.
- Returns
- The diagonal vector.
◆ grow() [1/2]
template<int DIM, typename FT>
void grow |
( |
const Point & | p | ) |
|
|
inline |
Add a point to this box. This will compute its new extent.
- Parameters
-
◆ grow() [2/2]
template<int DIM, typename FT>
Add a box to this box. This will compute its new extent.
- Parameters
-
◆ intersects()
template<int DIM, typename FT>
Check if this box intersects another box b
.
- Parameters
-
- Returns
- True if the boxes intersect, false otherwise.
◆ is_valid()
template<int DIM, typename FT>
Check if the box is valid.
- Returns
- True if the box is valid, false otherwise.
◆ max_coord()
template<int DIM, typename FT>
FT max_coord |
( |
unsigned int | axis | ) |
const |
|
inline |
Return a component of the coordinates of the max corner.
- Parameters
-
axis | The axis index, which must be in the range [0, DIM). |
- Returns
- The coordinate value.
◆ max_point() [1/2]
template<int DIM, typename FT>
Return the coordinates of the max corner.
- Returns
- The coordinates of the max corner.
◆ max_point() [2/2]
template<int DIM, typename FT>
const Point & max_point |
( |
| ) |
const |
|
inline |
Return the coordinates of the max corner (const version).
- Returns
- The coordinates of the max corner.
◆ max_range()
template<int DIM, typename FT>
Return the max range.
- Returns
- The max range value.
◆ max_range_axis()
template<int DIM, typename FT>
unsigned int max_range_axis |
( |
| ) |
const |
|
inline |
Return the axis index of the max range of the box.
- Returns
- The axis index.
◆ min_coord()
template<int DIM, typename FT>
FT min_coord |
( |
unsigned int | axis | ) |
const |
|
inline |
Return a component of the coordinates of the min corner.
- Parameters
-
axis | The axis index, which must be in the range [0, DIM). |
- Returns
- The coordinate value.
◆ min_point() [1/2]
template<int DIM, typename FT>
Return the coordinates of the min corner.
- Returns
- The coordinates of the min corner.
◆ min_point() [2/2]
template<int DIM, typename FT>
const Point & min_point |
( |
| ) |
const |
|
inline |
Return the coordinates of the min corner (const version).
- Returns
- The coordinates of the min corner.
◆ min_range()
template<int DIM, typename FT>
Return the min range.
- Returns
- The min range value.
◆ min_range_axis()
template<int DIM, typename FT>
unsigned int min_range_axis |
( |
| ) |
const |
|
inline |
Return the axis index of the min range of the box.
- Returns
- The axis index.
◆ operator+()
template<int DIM, typename FT>
Return the bounding box of 'this' and another box b
.
- Parameters
-
- Returns
- The resulting bounding box.
◆ operator+=()
template<int DIM, typename FT>
Modify this box by adding another box b
.
- Parameters
-
- Returns
- A reference to this box.
◆ radius()
template<int DIM, typename FT>
Return the radius of the box (i.e., half of its diagonal length).
- Returns
- The radius.
◆ range()
template<int DIM, typename FT>
FT range |
( |
unsigned int | axis | ) |
const |
|
inline |
Return the range of the box along the axis.
- Parameters
-
axis | The axis index, which must be in the range [0, DIM). |
- Returns
- The range value.
◆ surface_area()
template<int DIM, typename FT>
FT surface_area |
( |
| ) |
const |
|
inline |
Return the surface area of the box.
- Returns
- The surface area.
The documentation for this class was generated from the following file:
- G:/3_code/Easy3D/easy3d/core/box.h