VoxelTools
The collection of tools in VoxelTools is designed for voxel-processing.
Voxels are assumed to be stored in 3-dimensional matrices such as
Matrix or boost's multi_array.
Interface
template <typename voxel_type>
void cover(Matrix_t<voxel_type, 3u> & matrix,
const voxel_type layerValue,
const voxel_type insideValue = 1,
const voxel_type outsideValue = 0,
const bool replaceOutside = true) |
Given a 3D matrix of voxels, cover the structure with a
layer of at least one cell thick of voxels with value layerValue.
If replaceOutside is true (default), then cells with
outsideValue are replaced with layerValue where
appropriate and the number of cells with insideValue remains the
same; if replaceOutside is false, then cells with
insideValue are replaced.
|
template <template <typename Tm, std::size_t Dm, typename Aux>
class Matrix_t,
typename T, std::size_t D, typename A>
bool expand( const DTree<T, D> & node,
Matrix_t<T, D, A> &matrix,
const std::size_t depth = 0) |
Convert a D-dimensional tree into a D-dimensional matrix of any type
supported by matrix-traits. The matrix will automatically be
resized. An optional parameter depth can be supplied if you wish to force the matrix
to be of a size corresponding to the size of a tree with the given depth. |
template <template Vtypename Tm, std::size_t Dm, typename Aux>
class Matrix_t,
typename T, std::size_t D, typename A>
bool expand( const DTree<T, D>::DNode & node,
Matrix_t<T, D, A> &matrix,
const std::size_t depth = 0) |
As the previous function, but operate on any node instead of the root node
of the tree. |
|
|