QUGaR 0.0.4
Loading...
Searching...
No Matches
qugar::BoundBox< dim > Class Template Reference

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.
 

Detailed Description

template<int dim>
class qugar::BoundBox< dim >

Class representing a dim-dimensional Cartesian product bounding box.

Template Parameters
dimDimension of the domain.

Constructor & Destructor Documentation

◆ BoundBox() [1/5]

template<int dim>
qugar::BoundBox< dim >::BoundBox ( )

Construct a new default BoundBox. Initializes the box to the unit_ domain [0, 1].

◆ BoundBox() [2/5]

template<int dim>
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.

Parameters
minMinimum coordinates of the box.
maxMaximum coordinates of the box.

◆ BoundBox() [3/5]

template<int dim>
qugar::BoundBox< dim >::BoundBox ( const real min,
const real max )

Construct a new BoundBox object from the max and min coordinates.

Parameters
minMinimum coordinates of the box in all directions.
maxMaximum coordinates of the box in all directions.

◆ BoundBox() [4/5]

template<int dim>
qugar::BoundBox< dim >::BoundBox ( const Point< dim > & min,
const Point< dim > & max )

Construct a new BoundBox object from the max and min coordinates.

Parameters
minMinimum coordinates of the box.
maxMaximum coordinates of the box.

◆ BoundBox() [5/5]

template<int dim>
qugar::BoundBox< dim >::BoundBox ( const ::algoim::HyperRectangle< real, dim > & rectangle)
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.

Parameters
rectangleA constant reference to an algoim::hyperrectangle object representing the bounding box dimensions and coordinates.

Member Function Documentation

◆ extend() [1/2]

template<int dim>
void qugar::BoundBox< dim >::extend ( const Point< dim > & point)

Expands the current bounding box such that it contains the given point.

Parameters
pointPoint that the expanded box must contain.

◆ extend() [2/2]

template<int dim>
BoundBox< dim > qugar::BoundBox< dim >::extend ( real delta) const
nodiscard

Extends the current bounding box by a given +/- delta on each side.

Parameters
deltaAmount by which the box is extended.
Returns
Extended bounding box.

◆ get_lengths()

template<int dim>
Point< dim > qugar::BoundBox< dim >::get_lengths ( ) const
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.

Returns
A Point object containing the lengths of the bounding box along each dimension.

◆ length() [1/2]

template<int dim>
template<int dim_aux = dim>
requires Is1D<dim_aux, dim>
real qugar::BoundBox< dim >::length ( ) const
nodiscard

Gets the box length for 1D boxes.

Returns
Box's length.

◆ length() [2/2]

template<int dim>
real qugar::BoundBox< dim >::length ( int dir) const
nodiscard

Gets the box length along the given direction.

Parameters
dirDirection along which the length is computed.
Returns
Box's length along dir.

◆ max() [1/2]

template<int dim>
template<int dim_aux = dim>
requires Is1D<dim_aux, dim>
real qugar::BoundBox< dim >::max ( ) const
nodiscard

Gets the maxnimum value of the box for 1D boxes.

Returns
Maximum value.
Here is the caller graph for this function:

◆ max() [2/2]

template<int dim>
real qugar::BoundBox< dim >::max ( int dir) const
nodiscard

Gets the maximum value of the box along direction dir.

Parameters
dirDirection along which the maximum value is retrieved.
Returns
Maximum value along dir.

◆ max_corner()

template<int dim>
const Point< dim > & qugar::BoundBox< dim >::max_corner ( ) const
nodiscard

Gets the maximum bounds along all the directions.

Returns
Maximum bounds along all dim directions.

◆ mid_point()

template<int dim>
Point< dim > qugar::BoundBox< dim >::mid_point ( ) const
nodiscard

Gets the mid point of the box.

Returns
Box's mid point.

◆ min() [1/2]

template<int dim>
template<int dim_aux = dim>
requires Is1D<dim_aux, dim>
real qugar::BoundBox< dim >::min ( ) const
nodiscard

Gets the minimum value of the box for 1D boxes.

Returns
Minimum value.
Here is the caller graph for this function:

◆ min() [2/2]

template<int dim>
real qugar::BoundBox< dim >::min ( int dir) const
nodiscard

Gets the minimum value of the box along direction dir.

Parameters
dirDirection along which the minimum value is retrieved.
Returns
Minimum value along dir.

◆ min_corner()

template<int dim>
const Point< dim > & qugar::BoundBox< dim >::min_corner ( ) const
nodiscard

Gets the minimum bounds along all the directions.

Returns
Minimum bounds along all dim directions.

◆ scale_from_0_1()

template<int dim>
Point< dim > qugar::BoundBox< dim >::scale_from_0_1 ( const Point< dim > & point_01) const
nodiscard

Scales the given point from the [0,1]^dim domain to the current domain.

Parameters
point_01Point to be scaled.
Returns
Scaled point.

◆ scale_to_0_1()

template<int dim>
Point< dim > qugar::BoundBox< dim >::scale_to_0_1 ( const Point< dim > & point) const
nodiscard

Scales the given point from the current domain to the [0,1]^dim domain.

Parameters
pointPoint to be scaled.
Returns
Scaled point.

◆ scale_to_new_domain()

template<int dim>
Point< dim > qugar::BoundBox< dim >::scale_to_new_domain ( const BoundBox< dim > & new_domain,
const Point< dim > & point ) const
nodiscard

Scales the given point from the current domain to the new_domain.

Parameters
new_domainNew domain to which the point is scaled to.
pointPoint to be scaled.
Returns
Scaledd point.

◆ set()

template<int dim>
void qugar::BoundBox< dim >::set ( const Point< dim > & min,
const Point< dim > & max )

Sets the bounds of the domain.

Parameters
minMinimum coordinates of the box.
maxMaximum coordinates of the box.

◆ slice()

template<int dim>
template<int dim_aux = dim>
requires (dim_aux == dim && dim > 1)
BoundBox< dim - 1 > qugar::BoundBox< dim >::slice ( const int const_dir) const
inlinenodiscard

Performs a slice of the domain reduding it by one dimension.

Returns
Dim-1 dimensional domain.
Here is the call graph for this function:

◆ to_hyperrectangle()

template<int dim>
::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.

Returns
An instance of algoim::hyperrectangle<real, dim> representing the current object as a hyperrectangle.

◆ volume()

template<int dim>
real qugar::BoundBox< dim >::volume ( ) const
nodiscard

Computes the box volume.

Returns
Box's volume.

Member Data Documentation

◆ max_

template<int dim>
Point<dim> qugar::BoundBox< dim >::max_
private

Upper box bound.

◆ min_

template<int dim>
Point<dim> qugar::BoundBox< dim >::min_
private

Lower box bound.


The documentation for this class was generated from the following file: