MVE - Multi-View Environment mve-devel
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
fssr::VoxelIndex Struct Reference

The voxel index is a unique 64 bit ID for each voxel in the octree. More...

#include <voxel.h>

Public Member Functions

math::Vec3d compute_position (math::Vec3d const &center, double size) const
 Computes the position of a voxel given octree root size and center.
 
void from_path_and_corner (uint8_t level, uint64_t path, int corner)
 Computes the octree corner index given octree node path and level.
 
int32_t get_offset_x (void) const
 
int32_t get_offset_y (void) const
 
int32_t get_offset_z (void) const
 
bool operator< (VoxelIndex const &other) const
 

Public Attributes

uint64_t index
 

Detailed Description

The voxel index is a unique 64 bit ID for each voxel in the octree.

The index is designed in such a way that it is independent of the level, i.e., neighboring nodes on different levels share voxels with the same ID. The bits are assigned as follows:

 0      000...000  000...000  000...000

1 unused 21 bits 21 bits 21 bits bit z-coord y-coord x-coord

Since the maximum voxel index for level L is 2^L, this limits the maximum level to 20 with 21 bits, i.e. 2^20-1 < 2^20 < 2^21-1. Voxels at a lower level are shifted to the hightest bit to obtain the same index over different levels. For example, index I on level L is shifted I << (20 - L).

Definition at line 37 of file voxel.h.

Member Function Documentation

◆ compute_position()

math::Vec3d fssr::VoxelIndex::compute_position ( math::Vec3d const &  center,
double  size 
) const

Computes the position of a voxel given octree root size and center.

Definition at line 44 of file voxel.cc.

◆ from_path_and_corner()

void fssr::VoxelIndex::from_path_and_corner ( uint8_t  level,
uint64_t  path,
int  corner 
)

Computes the octree corner index given octree node path and level.

Definition at line 18 of file voxel.cc.

◆ get_offset_x()

int32_t fssr::VoxelIndex::get_offset_x ( void  ) const

Definition at line 54 of file voxel.cc.

◆ get_offset_y()

int32_t fssr::VoxelIndex::get_offset_y ( void  ) const

Definition at line 60 of file voxel.cc.

◆ get_offset_z()

int32_t fssr::VoxelIndex::get_offset_z ( void  ) const

Definition at line 66 of file voxel.cc.

◆ operator<()

bool fssr::VoxelIndex::operator< ( VoxelIndex const &  other) const
inline

Definition at line 92 of file voxel.h.

Member Data Documentation

◆ index

uint64_t fssr::VoxelIndex::index

Definition at line 50 of file voxel.h.


The documentation for this struct was generated from the following files: