public

Inheritance Graph

graph BT
	VoxelStorage
	click VoxelStorage "classGeometry_1_1VoxelStorage"

Description

The Voxelstorage is a spatial data structure for storing voxels(=arbitrary values) at integer positions. Internally, a dynamic octree is used as storage:

  • the root node is adjusted automatically

  • empty inner nodes are skipped

  • subtrees having an uniform value are represented by single nodes

Classes

   
struct Geometry::VoxelStorage::Area

Public Types

   
   
typedef _Vec3 < integer_t > Vec3_t
   
typedef _Box < integer_t > Box_t
   
typedef std::array< Voxel_t, blockSize > block_t
   
typedef std::pair< std::vector< std::tuple< Vec3_t , uinteger_t, Voxel_t > >, std::vector< std::tuple< Vec3_t , block_t > > > serializationData_t

Public Static Attributes

   
   
const uinteger_t blockSideLength
   
const uinteger_t blockMask
   
const uint32_t blockSize

Public Functions

   
   
  VoxelStorage( VoxelStorage && other)
   
  VoxelStorage(const Voxel_t & _nullVoxel)
   
void _set(const Vec3_t & pos, const Voxel_t & voxel)
Set the valuevoxelat the givenpositionwithout consolidating (combining uniform subtrees)
   
void set(const Vec3_t & pos, const Voxel_t & voxel)
Set the valuevoxelat the givenposition.
   
const Voxel_t & get(const Vec3_t & pos) const
Return the value at the givenposition. If the value has not been set, nullVoxel is returned.
   
void fill(const Box_t & fillArea, const Voxel_t & voxel)
Fill the givenareawith the given valuevoxel.
   
void clear()
Remove all values.
   
serializationData_t serialize(const Box_t & queryBox) const
   
serializationData_t serialize(const Box_t & queryBox)
   
void deserialize(const serializationData_t & data)
   
Box_t getBlockBounds() const
Get the (block aligned) bounding box around the set voxels.

Documentation

typedef
Geometry::VoxelStorage::Vec3_t

public
 
 
typedef _Vec3 < integer_t > Vec3_t

Defined in Geometry/VoxelStorage.h:41


typedef
Geometry::VoxelStorage::Box_t

public
 
 
typedef _Box < integer_t > Box_t

Defined in Geometry/VoxelStorage.h:42


typedef
Geometry::VoxelStorage::block_t

public
 
 
typedef std::array< Voxel_t, blockSize > block_t

Defined in Geometry/VoxelStorage.h:43


typedef
Geometry::VoxelStorage::serializationData_t

public
 
 
typedef std::pair< std::vector< std::tuple< Vec3_t , uinteger_t, Voxel_t > >, std::vector< std::tuple< Vec3_t , block_t > > > serializationData_t

Defined in Geometry/VoxelStorage.h:47


variable
Geometry::VoxelStorage::blockSideLength

public static
 
 
const uinteger_t blockSideLength

Defined in Geometry/VoxelStorage.h:37


variable
Geometry::VoxelStorage::blockMask

public static
 
 
const uinteger_t blockMask

Defined in Geometry/VoxelStorage.h:38


variable
Geometry::VoxelStorage::blockSize

public static
 
 
const uint32_t blockSize

Defined in Geometry/VoxelStorage.h:39


function
Geometry::VoxelStorage::VoxelStorage

public inline
     
     
VoxelStorage( VoxelStorage && other )

Defined in Geometry/VoxelStorage.h:310


function
Geometry::VoxelStorage::VoxelStorage

public inline explicit
     
     
VoxelStorage( const Voxel_t & _nullVoxel )

Defined in Geometry/VoxelStorage.h:312


function
Geometry::VoxelStorage::_set

public inline
     
     
void _set( const Vec3_t & pos,
  const Voxel_t & voxel
)    

Set the valuevoxelat the givenpositionwithout consolidating (combining uniform subtrees)

Defined in Geometry/VoxelStorage.h:316


function
Geometry::VoxelStorage::set

public inline
     
     
void set( const Vec3_t & pos,
  const Voxel_t & voxel
)    

Set the valuevoxelat the givenposition.

Defined in Geometry/VoxelStorage.h:321


function
Geometry::VoxelStorage::get

public const inline
     
     
const Voxel_t & get( const Vec3_t & pos ) const

Return the value at the givenposition. If the value has not been set, nullVoxel is returned.

Defined in Geometry/VoxelStorage.h:332


function
Geometry::VoxelStorage::fill

public inline
     
     
void fill( const Box_t & fillArea,
  const Voxel_t & voxel
)    

Fill the givenareawith the given valuevoxel.

Defined in Geometry/VoxelStorage.h:348


function
Geometry::VoxelStorage::clear

public inline
   
   
void clear( )

Remove all values.

Defined in Geometry/VoxelStorage.h:430


function
Geometry::VoxelStorage::serialize

public const inline
     
     
serializationData_t serialize( const Box_t & queryBox ) const

experimental!

Note: queryBox must be block-aligned

Defined in Geometry/VoxelStorage.h:437


function
Geometry::VoxelStorage::serialize

public inline
     
     
serializationData_t serialize( const Box_t & queryBox )

Defined in Geometry/VoxelStorage.h:440


function
Geometry::VoxelStorage::deserialize

public inline
     
     
void deserialize( const serializationData_t & data )

Defined in Geometry/VoxelStorage.h:471


function
Geometry::VoxelStorage::getBlockBounds

public const inline
   
   
Box_t getBlockBounds( ) const

Get the (block aligned) bounding box around the set voxels.

Defined in Geometry/VoxelStorage.h:483