OpenVDB 11.0.0
Loading...
Searching...
No Matches
openvdb.h
Go to the documentation of this file.
1// Copyright Contributors to the OpenVDB Project
2// SPDX-License-Identifier: MPL-2.0
3
4#ifndef OPENVDB_OPENVDB_HAS_BEEN_INCLUDED
5#define OPENVDB_OPENVDB_HAS_BEEN_INCLUDED
6
7#include "Platform.h"
8#include "Types.h"
9#include "TypeList.h"
10#include "Metadata.h"
11#include "math/Maps.h"
12#include "math/Transform.h"
13#include "Grid.h"
14#include "tree/Tree.h"
16#include "io/File.h"
17
18
19namespace openvdb {
21namespace OPENVDB_VERSION_NAME {
22
23/// @brief Global registration of native Grid, Transform, Metadata and Point
24/// attribute types. Also initializes blosc (if enabled).
25/// @details Calling this methods registers factory callbacks for the set of
26/// native grid, transform, metadata and point attribute types that OpenVDB
27/// supports by default. For most types, calling openvdb::initialize is only
28/// required for serialization support. However, openvdb::initialize must be
29/// called for PointDataGrid attribute usage as these callbacks are used in
30/// various tools.
31/// @note This method is thread safe - it can be concurrently called multiple
32/// times, early exiting if it has already been called so long as
33/// openvdb::uninitialize() has not been called.
35
36/// @brief Global deregistration of native Grid, Transform, Metadata and Point
37/// attribute types.
38/// @details Clears all registered factory callbacks. This includes everything
39/// registered by openvdb::initialize() but will also include any manually
40/// registered types.
41/// @note This method is thread safe - it can be concurrently called multiple
42/// times.
43/// @warning This method does *not* uninitialize blosc. This is to avoid
44/// changing program states should another library also be using blosc. If
45/// blosc is enabled, consider calling blosc_destroy() in your application.
47
48
49// foward declare some default types
50namespace io { class DelayedLoadMetadata; }
51
52/// Common tree types
71
72/// Common grid types
87
88/// @name Lists of native Grid Types
89/// @{
90/// The floating point Grid types which OpenVDB will register by default.
92/// The integer Grid types which OpenVDB will register by default.
94/// The scalar Grid types which OpenVDB will register by default. This is a
95/// combination of native floating point and integer grid types. Note that
96/// this list does not include Bool or Mask Grids.
98/// The Vec3 Grid types which OpenVDB will register by default.
100
101/// The Grid types which OpenVDB will register by default.
103 NumericGridTypes::
104 Append<Vec3GridTypes>::
105 Append<tools::PointIndexGrid>::
106 // #define unfortunately required for one of the tests that removes this alias
107#ifndef OPENVDB_DISABLE_POINT_DATA_TREE_ALIAS
108 Append<points::PointDataGrid>::
109#endif
110 Append<BoolGrid, MaskGrid>;
111/// @}
112
113
114namespace internal {
115template <typename T> using ToTreeType = typename T::TreeType;
116}
117/// @name Lists of native Tree Types
118/// @{
121using NumericTreeTypes = NumericGridTypes::Transform<internal::ToTreeType>;
123using TreeTypes = GridTypes::Transform<internal::ToTreeType>;
124/// @}
125
126
127/// @name Lists of native TypedAttributeArray Types (for PointDataGrids)
128/// @{
129/// The floating point attribute array types which OpenVDB will register by default.
136 >;
137/// The integer attribute array types which OpenVDB will register by default.
143 >;
144/// The scalar attribute array types which OpenVDB will register by default.
145/// This is a combination of native floating point and integer array types.
146/// Note that this list does not include bool arrays.
149/// The Vec3 attribute array types which OpenVDB will register by default.
160 >;
161/// The Mat3 attribute array types which OpenVDB will register by default.
165 >;
166/// The Mat4 attribute array types which OpenVDB will register by default.
170 >;
171/// The Quat attribute array types which OpenVDB will register by default.
175 >;
176
177/// The attribute array types which OpenVDB will register by default.
179 NumericAttributeTypes::
180 Append<Vec3AttributeTypes>::
181 Append<Mat3AttributeTypes>::
182 Append<Mat4AttributeTypes>::
183 Append<QuatAttributeTypes>::
184 Append<points::GroupAttributeArray>::
185 Append<points::StringAttributeArray>::
186 Append<points::TypedAttributeArray<bool>>;
187/// @}
188
189
190/// The Map types which OpenVDB will register by default.
200
201
202/// The Metadata types which OpenVDB will register by default.
222
223
224} // namespace OPENVDB_VERSION_NAME
225} // namespace openvdb
226
227#endif // OPENVDB_OPENVDB_HAS_BEEN_INCLUDED
#define OPENVDB_API
Definition Platform.h:274
Attribute-owned data structure for points. Point attributes are stored in leaf nodes and ordered by v...
A TypeList provides a compile time sequence of heterogeneous types which can be accessed,...
Container class that associates a tree with a transform and metadata.
Definition Grid.h:571
Templated metadata class to hold specific types.
Definition Metadata.h:122
Store a buffer of data that can be optionally used during reading for faster delayed-load I/O perform...
Definition DelayedLoadMetadata.h:22
A general linear transform using homogeneous coordinates to perform rotation, scaling,...
Definition Maps.h:296
This map is composed of three steps. First it will take a box of size (Lx X Ly X Lz) defined by a mem...
Definition Maps.h:1892
A specialized Affine transform that scales along the principal axis the scaling need not be uniform i...
Definition Maps.h:656
A specialized Affine transform that scales along the principal axis the scaling need not be uniform i...
Definition Maps.h:1163
A specialized linear transform that performs a translation.
Definition Maps.h:978
A specialized Affine transform that scales along the principal axis the scaling is uniform in the thr...
Definition Maps.h:906
A specialized Affine transform that uniformaly scales along the principal axis and then translates th...
Definition Maps.h:1479
A specialized linear transform that performs a unitary maping i.e. rotation and or reflection.
Definition Maps.h:1621
Typed class for storing attribute data.
Definition AttributeArray.h:545
Definition Tree.h:178
typename T::TreeType ToTreeType
Definition openvdb.h:115
GridTypes::Transform< internal::ToTreeType > TreeTypes
Definition openvdb.h:123
IntegerGridTypes::Transform< internal::ToTreeType > IntegerTreeTypes
Definition openvdb.h:120
RealGridTypes::Transform< internal::ToTreeType > RealTreeTypes
Definition openvdb.h:119
RealGridTypes::Append< IntegerGridTypes > NumericGridTypes
Definition openvdb.h:97
OPENVDB_IMPORT void initialize()
Global registration of native Grid, Transform, Metadata and Point attribute types....
Vec3GridTypes::Transform< internal::ToTreeType > Vec3TreeTypes
Definition openvdb.h:122
NumericGridTypes:: Append< Vec3GridTypes >:: Append< tools::PointIndexGrid >:: Append< points::PointDataGrid >:: Append< BoolGrid, MaskGrid > GridTypes
The Grid types which OpenVDB will register by default.
Definition openvdb.h:102
OPENVDB_IMPORT void uninitialize()
Global deregistration of native Grid, Transform, Metadata and Point attribute types.
NumericAttributeTypes:: Append< Vec3AttributeTypes >:: Append< Mat3AttributeTypes >:: Append< Mat4AttributeTypes >:: Append< QuatAttributeTypes >:: Append< points::GroupAttributeArray >:: Append< points::StringAttributeArray >:: Append< points::TypedAttributeArray< bool > > AttributeTypes
The attribute array types which OpenVDB will register by default.
Definition openvdb.h:178
NumericGridTypes::Transform< internal::ToTreeType > NumericTreeTypes
Definition openvdb.h:121
RealAttributeTypes::Append< IntegerAttributeTypes > NumericAttributeTypes
Definition openvdb.h:147
Definition Exceptions.h:13
A list of types (not necessarily unique)
Definition TypeList.h:578
typename typelist_internal::TSTranformImpl< OpT, Ts... >::type Transform
Transform each type of this TypeList, rebuiling a new list of converted types. This method instantiat...
Definition TypeList.h:736
typename typelist_internal::TSAppendImpl< Self, TypesToAppend... >::type Append
Append types, or the members of another TypeList, to this list.
Definition TypeList.h:656
Definition AttributeArray.h:511
Definition AttributeArray.h:481
Definition AttributeArray.h:526
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition version.h.in:121
#define OPENVDB_USE_VERSION_NAMESPACE
Definition version.h.in:212