Blender V4.3
blender::bke::volume_grid Namespace Reference

Classes

class  VolumeGrid
 

Functions

std::string get_name (const VolumeGridData &grid)
 
VolumeGridType get_type (const VolumeGridData &grid)
 
int get_channels_num (VolumeGridType type)
 
float4x4 get_transform_matrix (const VolumeGridData &grid)
 
void set_transform_matrix (VolumeGridData &grid, const float4x4 &matrix)
 
void clear_tree (VolumeGridData &grid)
 
void load (const VolumeGridData &grid)
 
std::string error_message_from_load (const VolumeGridData &grid)
 
bool is_loaded (const VolumeGridData &grid)
 
void count_memory (const VolumeGridData &grid, MemoryCounter &memory)
 

Variables

template<typename T >
static constexpr bool is_VolumeGrid_v = false
 
template<typename T >
static constexpr bool is_VolumeGrid_v< VolumeGrid< T > > = true
 

Detailed Description

This header gives contains declarations for dealing with volume grids without requiring including any OpenVDB headers (which can have a significant impact on compile times).

These functions are available even if WITH_OPENVDB is false, but they may just be empty.

Function Documentation

◆ clear_tree()

void blender::bke::volume_grid::clear_tree ( VolumeGridData & grid)

Clears the tree data in the grid, but keeps meta-data and the transform intact.

Definition at line 475 of file volume_grid.cc.

References clear_tree(), and UNUSED_VARS.

Referenced by clear_tree().

◆ count_memory()

void blender::bke::volume_grid::count_memory ( const VolumeGridData & grid,
MemoryCounter & memory )

Definition at line 495 of file volume_grid.cc.

References count_memory(), and UNUSED_VARS.

Referenced by count_memory().

◆ error_message_from_load()

std::string blender::bke::volume_grid::error_message_from_load ( const VolumeGridData & grid)

Returns a non-empty string if there was some error when the grid was loaded.

Definition at line 515 of file volume_grid.cc.

References error_message_from_load(), and UNUSED_VARS.

Referenced by error_message_from_load().

◆ get_channels_num()

int blender::bke::volume_grid::get_channels_num ( VolumeGridType type)

Get the number of primitive values stored per voxel. For example, for a float-grid this is 1 and for a vector-grid it is 3 (for x, y and z).

Definition at line 415 of file volume_grid.cc.

References get_channels_num(), VOLUME_GRID_BOOLEAN, VOLUME_GRID_DOUBLE, VOLUME_GRID_FLOAT, VOLUME_GRID_INT, VOLUME_GRID_INT64, VOLUME_GRID_MASK, VOLUME_GRID_POINTS, VOLUME_GRID_UNKNOWN, VOLUME_GRID_VECTOR_DOUBLE, VOLUME_GRID_VECTOR_FLOAT, and VOLUME_GRID_VECTOR_INT.

Referenced by BKE_volume_grid_dense_floats(), get_channels_num(), and blender::draw::volume_grid_cache_get().

◆ get_name()

std::string blender::bke::volume_grid::get_name ( const VolumeGridData & grid)

◆ get_transform_matrix()

float4x4 blender::bke::volume_grid::get_transform_matrix ( const VolumeGridData & grid)

Get the transform of the grid as an affine matrix.

Definition at line 436 of file volume_grid.cc.

References col, get_transform_matrix(), result, and UNUSED_VARS.

Referenced by get_transform_matrix().

◆ get_type()

VolumeGridType blender::bke::volume_grid::get_type ( const VolumeGridData & grid)

◆ is_loaded()

bool blender::bke::volume_grid::is_loaded ( const VolumeGridData & grid)

True if the full grid (including meta-data, transform and the tree) is already available and does not have to be loaded lazily anymore.

Definition at line 485 of file volume_grid.cc.

References is_loaded(), and UNUSED_VARS.

Referenced by is_loaded().

◆ load()

void blender::bke::volume_grid::load ( const VolumeGridData & grid)

Makes sure that the volume grid is loaded afterwards. This is necessary to call this for correctness, because the grid will be loaded on demand anyway. Sometimes it may be beneficial for performance to load the grid eagerly though.

Definition at line 504 of file volume_grid.cc.

References load(), and UNUSED_VARS.

Referenced by load().

◆ set_transform_matrix()

void blender::bke::volume_grid::set_transform_matrix ( VolumeGridData & grid,
const float4x4 & matrix )

Replaces the transform matrix with the given one.

Definition at line 458 of file volume_grid.cc.

References col, set_transform_matrix(), and UNUSED_VARS.

Referenced by set_transform_matrix().

Variable Documentation

◆ is_VolumeGrid_v

template<typename T >
bool blender::bke::volume_grid::is_VolumeGrid_v = false
staticconstexpr

Compile time check to see of a type is a #VolumeGrid. This is false for e.g. float or GVolumeGrid and true for e.g. VolumeGrid<int> and VolumeGrid<float>.

Definition at line 52 of file BKE_volume_grid_fwd.hh.

◆ is_VolumeGrid_v< VolumeGrid< T > >

template<typename T >
bool blender::bke::volume_grid::is_VolumeGrid_v< VolumeGrid< T > > = true
staticconstexpr

Definition at line 53 of file BKE_volume_grid_fwd.hh.