Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2021-04-08 21:44:54 +0300
committerHans Goudey <h.goudey@me.com>2021-04-08 21:44:54 +0300
commit57fe650b76f85538cad961b738ce6d3e4682404f (patch)
treee549421a11822e20f15d0f172cbc77c743b351d5 /source/blender/blenkernel/BKE_volume.h
parent0e2a1ef13223925a874d6dbb139e0ce9f4eecab5 (diff)
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.
Diffstat (limited to 'source/blender/blenkernel/BKE_volume.h')
-rw-r--r--source/blender/blenkernel/BKE_volume.h10
1 files changed, 7 insertions, 3 deletions
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 <openvdb/openvdb.h>
# include <openvdb/points/PointDataGrid.h>
+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);