11#ifndef QUGAR_LIBRARY_BBOX_HPP
13#define QUGAR_LIBRARY_BBOX_HPP
27#include <algoim/hyperrectangle.hpp>
51 const std::array<
real,
static_cast<std::size_t
>(dim)> &
max);
71 explicit BoundBox(const ::algoim::HyperRectangle<real, dim> &rectangle);
107 template<
int dim_aux = dim>
113 template<
int dim_aux = dim>
154 template<
int dim_aux = dim>
184 template<
int dim_aux = dim>
185 requires(dim_aux == dim && dim > 1)
188 Point<dim - 1> _min_corner;
189 Point<dim - 1> _max_corner;
190 for (
int dir = 0, dir2 = 0; dir < dim; ++dir) {
191 if (dir != const_dir) {
192 _min_corner(dir2) = this->
min(dir);
193 _max_corner(dir2) = this->
max(dir);
197 return BoundBox<dim - 1>(_min_corner, _max_corner);
Class representing a dim-dimensional Cartesian product bounding box.
Definition bbox.hpp:38
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.
real max() const
Gets the maxnimum value of the box for 1D boxes.
real length(int dir) const
Gets the box length along the given direction.
real max(int dir) const
Gets the maximum value of the box along direction dir.
Point< dim > get_lengths() const
Retrieves the lengths of the bounding box along each dimension.
BoundBox()
Construct a new default BoundBox. Initializes the box to the unit_ domain [0, 1].
Point< dim > mid_point() const
Gets the mid point of the box.
BoundBox(const ::algoim::HyperRectangle< real, dim > &rectangle)
Constructs a BoundBox from a given Algoim's hyperrectangle.
Point< dim > max_
Upper box bound.
Definition bbox.hpp:80
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.
BoundBox(const Point< dim > &min, const Point< dim > &max)
Construct a new BoundBox object from the max and min coordinates.
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.
BoundBox< dim - 1 > slice(const int const_dir) const
Performs a slice of the domain reduding it by one dimension.
Definition bbox.hpp:186
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.
Point< dim > min_
Lower box bound.
Definition bbox.hpp:77
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.
real volume() const
Computes the box volume.
real length() const
Gets the box length for 1D boxes.
void extend(const Point< dim > &point)
Expands the current bounding box such that it contains the given point.
real min() const
Gets the minimum value of the box for 1D boxes.
const Point< dim > & max_corner() const
Gets the maximum bounds along all the directions.
const Point< dim > & min_corner() const
Gets the minimum bounds along all the directions.
BoundBox(const real min, const real max)
Construct a new BoundBox object from the max and min coordinates.
real min(int dir) const
Gets the minimum value of the box along direction dir.
void set(const Point< dim > &min, const Point< dim > &max)
Sets the bounds of the domain.
Checks if the given dimension is 1.
Definition concepts.hpp:19
QUGaR's main namespace.
Definition affine_transf.hpp:28
double real
Definition types.hpp:18
Vector< T, dim > Point
Class representing a dim-dimensional Point.
Definition point.hpp:34
Definition and implementation of Point class.