Blender V5.0
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 527 of file volume_grid.cc.

References clear_tree(), and UNUSED_VARS.

Referenced by clear_tree(), and blender::geometry::transform_volume().

◆ count_memory()

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

Definition at line 548 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 568 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 487 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 508 of file volume_grid.cc.

References get_transform_matrix(), blender::MatBase< float, 4, 4 >::identity(), and UNUSED_VARS.

Referenced by get_transform_matrix(), and blender::geometry::transform_volume().

◆ get_type()

◆ 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 538 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 557 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 518 of file volume_grid.cc.

References set_transform_matrix(), and UNUSED_VARS.

Referenced by blender::nodes::node_geo_set_grid_transform::node_geo_exec(), set_transform_matrix(), and blender::geometry::transform_volume().

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, e.g. false for float or GVolumeGrid and true for 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.