Blender V5.0
util/nanovdb.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: Contributors to the OpenVDB Project
2 * SPDX-FileCopyrightText: 2025 Blender Foundation
3 *
4 * SPDX-License-Identifier: Apache-2.0 */
5
6#pragma once
7
8#ifdef WITH_NANOVDB
9
10# include <openvdb/openvdb.h>
11
12# define NANOVDB_USE_OPENVDB
13# define NANOVDB_USE_TBB
14
15# include <nanovdb/NanoVDB.h> // manages and streams the raw memory buffer of a NanoVDB grid.
16
17# if NANOVDB_MAJOR_VERSION_NUMBER > 32 || \
18 (NANOVDB_MAJOR_VERSION_NUMBER == 32 && NANOVDB_MINOR_VERSION_NUMBER >= 7)
19# include <nanovdb/GridHandle.h>
20# else
21# include <nanovdb/util/GridHandle.h>
22# endif
23
25
26/* Convert NanoVDB to OpenVDB mask grid that represents just the topology. */
27openvdb::MaskGrid::Ptr nanovdb_to_openvdb_mask(const nanovdb::GridHandle<> &handle);
28
29/* Convert OpenVDB to NanoVDB grid. */
30nanovdb::GridHandle<> openvdb_to_nanovdb(const openvdb::GridBase::ConstPtr &grid,
31 const int precision,
32 const float clipping);
33
35
36#endif
#define CCL_NAMESPACE_END