diff options
author | Jacques Lucke <jacques@blender.org> | 2021-06-14 13:44:13 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-06-14 13:44:13 +0300 |
commit | dddcf1e9bbf4a6d1f4ff03eaf0cb7e9228b18ec5 (patch) | |
tree | c20defa7efd54c933d20a296abefe567909bb6c0 /source/blender/blenkernel/BKE_volume.h | |
parent | 3b162b7c185d089e93d892169a458d552196b7b6 (diff) | |
parent | c9dc55301cd7903b7ef7c045d337ada29aa809a1 (diff) |
Merge branch 'master' into temp-compact-node-prototypetemp-compact-node-prototype
Diffstat (limited to 'source/blender/blenkernel/BKE_volume.h')
-rw-r--r-- | source/blender/blenkernel/BKE_volume.h | 42 |
1 files changed, 27 insertions, 15 deletions
diff --git a/source/blender/blenkernel/BKE_volume.h b/source/blender/blenkernel/BKE_volume.h index 53626dbeb1b..cf755827a6c 100644 --- a/source/blender/blenkernel/BKE_volume.h +++ b/source/blender/blenkernel/BKE_volume.h @@ -78,16 +78,17 @@ extern void (*BKE_volume_batch_cache_free_cb)(struct Volume *volume); typedef struct VolumeGrid VolumeGrid; -bool BKE_volume_load(struct Volume *volume, struct Main *bmain); +bool BKE_volume_load(const struct Volume *volume, const struct Main *bmain); void BKE_volume_unload(struct Volume *volume); bool BKE_volume_is_loaded(const struct Volume *volume); int BKE_volume_num_grids(const struct Volume *volume); const char *BKE_volume_grids_error_msg(const struct Volume *volume); const char *BKE_volume_grids_frame_filepath(const struct Volume *volume); -VolumeGrid *BKE_volume_grid_get(const struct Volume *volume, int grid_index); -VolumeGrid *BKE_volume_grid_active_get(const struct Volume *volume); -VolumeGrid *BKE_volume_grid_find(const struct Volume *volume, const char *name); +const VolumeGrid *BKE_volume_grid_get_for_read(const struct Volume *volume, int grid_index); +VolumeGrid *BKE_volume_grid_get_for_write(struct Volume *volume, int grid_index); +const VolumeGrid *BKE_volume_grid_active_get_for_read(const struct Volume *volume); +const VolumeGrid *BKE_volume_grid_find_for_read(const struct Volume *volume, const char *name); /* Grid * @@ -109,8 +110,8 @@ typedef enum VolumeGridType { VOLUME_GRID_POINTS, } VolumeGridType; -bool BKE_volume_grid_load(const struct Volume *volume, struct VolumeGrid *grid); -void BKE_volume_grid_unload(const struct Volume *volume, struct VolumeGrid *grid); +bool BKE_volume_grid_load(const struct Volume *volume, const struct VolumeGrid *grid); +void BKE_volume_grid_unload(const struct Volume *volume, const struct VolumeGrid *grid); bool BKE_volume_grid_is_loaded(const struct VolumeGrid *grid); /* Metadata */ @@ -119,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. @@ -145,8 +143,8 @@ int BKE_volume_simplify_level(const struct Depsgraph *depsgraph); float BKE_volume_simplify_factor(const struct Depsgraph *depsgraph); /* File Save */ -bool BKE_volume_save(struct Volume *volume, - struct Main *bmain, +bool BKE_volume_save(const struct Volume *volume, + const struct Main *bmain, struct ReportList *reports, const char *filepath); @@ -159,13 +157,26 @@ bool BKE_volume_save(struct Volume *volume, * Access to OpenVDB grid for C++. These will automatically load grids from * file or copy shared grids to make them writeable. */ -#if defined(__cplusplus) && defined(WITH_OPENVDB) -# include <openvdb/openvdb.h> -# include <openvdb/points/PointDataGrid.h> +#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); openvdb::GridBase::ConstPtr BKE_volume_grid_openvdb_for_metadata(const struct VolumeGrid *grid); openvdb::GridBase::ConstPtr BKE_volume_grid_openvdb_for_read(const struct Volume *volume, - struct VolumeGrid *grid); + const struct VolumeGrid *grid); openvdb::GridBase::Ptr BKE_volume_grid_openvdb_for_write(const struct Volume *volume, struct VolumeGrid *grid, const bool clear); @@ -212,4 +223,5 @@ openvdb::GridBase::Ptr BKE_volume_grid_create_with_changed_resolution( const openvdb::GridBase &old_grid, const float resolution_factor); +# endif #endif |