QUGaR 0.0.4
|
Class representing a dim
-dimensional Cartesian product bounding box.
More...
#include <bbox.hpp>
Public Member Functions | |
Query methods | |
real | min (int dir) const |
Gets the minimum value of the box along direction dir . | |
real | max (int dir) const |
Gets the maximum value of the box along direction dir . | |
template<int dim_aux = dim> requires Is1D<dim_aux, dim> | |
real | min () const |
Gets the minimum value of the box for 1D boxes. | |
template<int dim_aux = dim> requires Is1D<dim_aux, dim> | |
real | max () const |
Gets the maxnimum value of the box for 1D boxes. | |
const Point< dim > & | min_corner () const |
Gets the minimum bounds along all the directions. | |
const Point< dim > & | max_corner () const |
Gets the maximum bounds along all the directions. | |
BoundBox< dim > | extend (real delta) const |
Extends the current bounding box by a given +/- delta on each side. | |
::algoim::HyperRectangle< real, dim > | to_hyperrectangle () const |
Converts the current object to an Algoim's hyperrectangle. | |
Point< dim > | get_lengths () const |
Retrieves the lengths of the bounding box along each dimension. | |
real | length (int dir) const |
Gets the box length along the given direction. | |
template<int dim_aux = dim> requires Is1D<dim_aux, dim> | |
real | length () const |
Gets the box length for 1D boxes. | |
real | volume () const |
Computes the box volume. | |
Point< dim > | mid_point () const |
Gets the mid point of the box. | |
Point< dim > | scale_to_new_domain (const BoundBox< dim > &new_domain, const Point< dim > &point) const |
Scales the given point from the current domain to the new_domain . | |
Point< dim > | scale_to_0_1 (const Point< dim > &point) const |
Scales the given point from the current domain to the [0,1]^dim domain. | |
Point< dim > | scale_from_0_1 (const Point< dim > &point_01) const |
Scales the given point from the [0,1]^dim domain to the current domain. | |
template<int dim_aux = dim> requires (dim_aux == dim && dim > 1) | |
BoundBox< dim - 1 > | slice (const int const_dir) const |
Performs a slice of the domain reduding it by one dimension. | |
Constructors | |
Point< dim > | min_ |
Lower box bound. | |
Point< dim > | max_ |
Upper box bound. | |
BoundBox () | |
Construct a new default BoundBox. Initializes the box to the unit_ domain [0, 1]. | |
BoundBox (const std::array< real, static_cast< std::size_t >(dim)> &min, const std::array< real, static_cast< std::size_t >(dim)> &max) | |
Construct a new BoundBox object from the max and min coordinates. | |
BoundBox (const real min, const real max) | |
Construct a new BoundBox object from the max and min coordinates. | |
BoundBox (const Point< dim > &min, const Point< dim > &max) | |
Construct a new BoundBox object from the max and min coordinates. | |
BoundBox (const ::algoim::HyperRectangle< real, dim > &rectangle) | |
Constructs a BoundBox from a given Algoim's hyperrectangle. | |
void | set (const Point< dim > &min, const Point< dim > &max) |
Sets the bounds of the domain. | |
void | extend (const Point< dim > &point) |
Expands the current bounding box such that it contains the given point . | |
Class representing a dim
-dimensional Cartesian product bounding box.
dim | Dimension of the domain. |
qugar::BoundBox< dim >::BoundBox | ( | ) |
Construct a new default BoundBox. Initializes the box to the unit_ domain [0, 1].
qugar::BoundBox< dim >::BoundBox | ( | const std::array< real, static_cast< std::size_t >(dim)> & | min, |
const std::array< real, static_cast< std::size_t >(dim)> & | max ) |
Construct a new BoundBox object from the max and min coordinates.
min | Minimum coordinates of the box. |
max | Maximum coordinates of the box. |
qugar::BoundBox< dim >::BoundBox | ( | const real | min, |
const real | max ) |
Construct a new BoundBox object from the max and min coordinates.
min | Minimum coordinates of the box in all directions. |
max | Maximum coordinates of the box in all directions. |
qugar::BoundBox< dim >::BoundBox | ( | const Point< dim > & | min, |
const Point< dim > & | max ) |
Construct a new BoundBox object from the max and min coordinates.
min | Minimum coordinates of the box. |
max | Maximum coordinates of the box. |
|
explicit |
Constructs a BoundBox from a given Algoim's hyperrectangle.
This constructor initializes a BoundBox object using the provided hyperrectangle from the Algoim library. The hyperrectangle is templated on the type real
and the dimension dim
.
rectangle | A constant reference to an algoim::hyperrectangle object representing the bounding box dimensions and coordinates. |
void qugar::BoundBox< dim >::extend | ( | const Point< dim > & | point | ) |
Expands the current bounding box such that it contains the given point
.
point | Point that the expanded box must contain. |
|
nodiscard |
Extends the current bounding box by a given +/- delta on each side.
delta | Amount by which the box is extended. |
|
nodiscard |
Retrieves the lengths of the bounding box along each dimension.
This function returns a Point object representing the lengths of the bounding box along each dimension.
|
nodiscard |
Gets the box length for 1D boxes.
|
nodiscard |
Gets the box length along the given direction.
dir | Direction along which the length is computed. |
dir
.
|
nodiscard |
Gets the maxnimum value of the box for 1D boxes.
|
nodiscard |
Gets the maximum value of the box along direction dir
.
dir | Direction along which the maximum value is retrieved. |
dir
.
|
nodiscard |
Gets the maximum bounds along all the directions.
dim
directions.
|
nodiscard |
Gets the mid point of the box.
|
nodiscard |
Gets the minimum value of the box for 1D boxes.
|
nodiscard |
Gets the minimum value of the box along direction dir
.
dir | Direction along which the minimum value is retrieved. |
dir
.
|
nodiscard |
Gets the minimum bounds along all the directions.
dim
directions.
|
nodiscard |
Scales the given point from the [0,1]^dim domain to the current domain.
point_01 | Point to be scaled. |
|
nodiscard |
Scales the given point from the current domain to the [0,1]^dim domain.
point | Point to be scaled. |
|
nodiscard |
Scales the given point from the current domain to the new_domain
.
new_domain | New domain to which the point is scaled to. |
point | Point to be scaled. |
void qugar::BoundBox< dim >::set | ( | const Point< dim > & | min, |
const Point< dim > & | max ) |
Sets the bounds of the domain.
min | Minimum coordinates of the box. |
max | Maximum coordinates of the box. |
|
inlinenodiscard |
Performs a slice of the domain reduding it by one dimension.
::algoim::HyperRectangle< real, dim > qugar::BoundBox< dim >::to_hyperrectangle | ( | ) | const |
Converts the current object to an Algoim's hyperrectangle.
This function transforms the current object into an instance of algoim::hyperrectangle with the specified real type and dimension.
|
nodiscard |
Computes the box volume.
|
private |
Upper box bound.
|
private |
Lower box bound.