supereight
Functions
se::octantops Namespace Reference

Functions

template<typename BlockT , se::Sort SortT = se::Sort::SmallToLarge>
std::enable_if_t< SortT==se::Sort::SmallToLargesort_blocks (std::vector< se::OctantBase *> &block_ptrs)
 Sort a vector of blocks according to its morton code from small to large. More...
 
template<typename BlockT , se::Sort SortT>
std::enable_if_t< SortT==se::Sort::LargeToSmallsort_blocks (std::vector< se::OctantBase *> &block_ptrs)
 Sort a vector of blocks according to its morton code from large to small. More...
 
int size_to_scale (const int octant_size)
 Convert the size of an octant in [voxel] to its scale in the octree. More...
 
int scale_to_size (const int octant_scale)
 Convert the scale of a octant to its size in [voxel]. More...
 
template<typename OctreeT >
int octant_to_size (const se::OctantBase *octant_ptr)
 Get the octant's size. More...
 
template<typename OctreeT >
int octant_to_scale (const se::OctantBase *octant_ptr)
 Get the octant's scale. More...
 
template<typename OctreeT >
se::key_t octant_to_key (const se::OctantBase *octant_ptr)
 Get the octant's key. More...
 

Function Documentation

◆ sort_blocks() [1/2]

template<typename BlockT , se::Sort SortT = se::Sort::SmallToLarge>
std::enable_if_t<SortT == se::Sort::SmallToLarge> se::octantops::sort_blocks ( std::vector< se::OctantBase *> &  block_ptrs)
inline

Sort a vector of blocks according to its morton code from small to large.

Template Parameters
BlockTThe type of blocks used
SortTThe sorting strategy (small to large by default)
Parameters
[in]block_ptrsThe vector of block pointers
Returns
The sorted vector of block pointers from large to small according to their morton code.

◆ sort_blocks() [2/2]

template<typename BlockT , se::Sort SortT>
std::enable_if_t<SortT == se::Sort::LargeToSmall> se::octantops::sort_blocks ( std::vector< se::OctantBase *> &  block_ptrs)
inline

Sort a vector of blocks according to its morton code from large to small.

Template Parameters
BlockTThe type of blocks used
SortTThe sorting strategy (small to large by default)
Parameters
[in]block_ptrsThe vector of block pointers
Returns
The sorted vector of block pointers from large to small according to their morton code.

◆ size_to_scale()

int se::octantops::size_to_scale ( const int  octant_size)
inline

Convert the size of an octant in [voxel] to its scale in the octree.

Parameters
[in]octant_sizeThe size of the octant in [voxel]
Returns
The scale of the octant

◆ scale_to_size()

int se::octantops::scale_to_size ( const int  octant_scale)
inline

Convert the scale of a octant to its size in [voxel].

Parameters
[in]octant_scaleThe scale of the octant
Returns
The size of the octant in [voxel]

◆ octant_to_size()

template<typename OctreeT >
int se::octantops::octant_to_size ( const se::OctantBase octant_ptr)
inline

Get the octant's size.

Template Parameters
OctreeT
Parameters
[in]octant_ptrThe pointer to the octant
Returns
The size of the octant

◆ octant_to_scale()

template<typename OctreeT >
int se::octantops::octant_to_scale ( const se::OctantBase octant_ptr)
inline

Get the octant's scale.

Template Parameters
OctreeT
Parameters
[in]octant_ptrThe pointer to the octant
Returns
The key of the octant

◆ octant_to_key()

template<typename OctreeT >
se::key_t se::octantops::octant_to_key ( const se::OctantBase octant_ptr)
inline

Get the octant's key.

Template Parameters
OctreeT
Parameters
[in]octant_ptrThe pointer to the octant
Returns
The key of the octant