NiHu
2.0
|
multidimensional square bounding box More...
#include <bounding_box.hpp>
Public Types | |
using | scalar_t = Scalar |
template argument as nested type | |
using | location_t = Eigen::Matrix< scalar_t, dimension, 1 > |
the location type in the bounding box | |
Public Member Functions | |
bounding_box (location_t const ¢er=location_t::Zero(), scalar_t diameter=2.0) | |
constructor from center and diameter More... | |
template<class NodesDerived > | |
bounding_box (Eigen::DenseBase< NodesDerived > const &nodes) | |
constructor from a set of contained nodes More... | |
const location_t & | get_center (void) const |
return center More... | |
void | set_center (location_t const &c) |
set the center More... | |
scalar_t | get_diameter (void) const |
return diameter More... | |
void | set_diameter (scalar_t const &d) |
set the diameter More... | |
bounding_box | get_child (size_t idx) const |
get a child box More... | |
bool | is_adjacent (bounding_box const &other, double tol=1e-3) const |
determine if a box is adjacent More... | |
void | print_debug (std::ostream &os=std::cout) const |
print debug information to an output stream More... | |
Static Public Member Functions | |
static unsigned | dist2idx (location_t const &child, location_t const &parent) |
convert parent-to-child direction to child index More... | |
static location_t | idx2dist (size_t idx) |
convert child index to parent-to-child direction More... | |
Static Public Attributes | |
static const size_t | dimension = Dim |
template parameter as nested constant | |
multidimensional square bounding box
Dim | the space dimension |
Scalar | scalar type of coordinates |
A bounding_box is a squared box aligned to the coordinate directions, defined by a center and a diameter. bounding_box is the main building block component of the fmm cluster and the cluster_tree.
Definition at line 30 of file bounding_box.hpp.
|
inline |
constructor from center and diameter
[in] | center | the box center |
[in] | diameter | the box diameter (edge length) |
Definition at line 44 of file bounding_box.hpp.
|
inlineexplicit |
constructor from a set of contained nodes
NodesDerived | Eigen derived class of Nodes |
[in] | nodes | matrix containing the enclosed nodes in its columns |
The bounding_box is composed so that tightly wraps all the nodes.
Definition at line 60 of file bounding_box.hpp.
|
inlinestatic |
convert parent-to-child direction to child index
[in] | child | location of the child |
[in] | parent | location of the parent |
Definition at line 139 of file bounding_box.hpp.
|
inline |
|
inline |
get a child box
[in] | idx | the child index |
Definition at line 108 of file bounding_box.hpp.
|
inline |
|
inlinestatic |
convert child index to parent-to-child direction
[in] | idx | the child index |
Definition at line 152 of file bounding_box.hpp.
|
inline |
determine if a box is adjacent
[in] | other | an other bounding_box |
[in] | tol | the relative tolerance of distance measurement |
[in] | (optional) | relative tolerance for distance checking |
Two boxes are adjacent if the distance of their centres is not larger than the sum of the diameters. This condition is checked for each coordinate direction.
Definition at line 124 of file bounding_box.hpp.
|
inline |
print debug information to an output stream
[in] | os | the output stream |
Definition at line 166 of file bounding_box.hpp.
|
inline |
|
inline |