From 57fe650b76f85538cad961b738ce6d3e4682404f Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Thu, 8 Apr 2021 13:44:54 -0500 Subject: BKE: Refactor volume bounding box code This commit splits of the function that generates a bounding box for a volume into a new function, so that the min and max coordinate can be retrieved from volume data without an object. Also some cleanup: using the float3 type. --- source/blender/blenkernel/BKE_volume.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'source/blender/blenkernel/BKE_volume.h') diff --git a/source/blender/blenkernel/BKE_volume.h b/source/blender/blenkernel/BKE_volume.h index 5d32dd3e91e..cf755827a6c 100644 --- a/source/blender/blenkernel/BKE_volume.h +++ b/source/blender/blenkernel/BKE_volume.h @@ -120,9 +120,6 @@ VolumeGridType BKE_volume_grid_type(const struct VolumeGrid *grid); int BKE_volume_grid_channels(const struct VolumeGrid *grid); void BKE_volume_grid_transform_matrix(const struct VolumeGrid *grid, float mat[4][4]); -/* Bounds */ -bool BKE_volume_grid_bounds(const struct VolumeGrid *grid, float min[3], float max[3]); - /* Volume Editing * * These are intended for modifiers to use on evaluated datablocks. @@ -161,12 +158,19 @@ bool BKE_volume_save(const struct Volume *volume, * file or copy shared grids to make them writeable. */ #ifdef __cplusplus +# include "BLI_float3.hh" # include "BLI_float4x4.hh" +bool BKE_volume_min_max(const Volume *volume, blender::float3 &r_min, blender::float3 &r_max); + # ifdef WITH_OPENVDB # include # include +bool BKE_volume_grid_bounds(openvdb::GridBase::ConstPtr grid, + blender::float3 &r_min, + blender::float3 &r_max); + openvdb::GridBase::ConstPtr BKE_volume_grid_shallow_transform(openvdb::GridBase::ConstPtr grid, const blender::float4x4 &transform); -- cgit v1.2.3