OpenVDB: version.h Source File

OpenVDB 7.1.0

version.h
Go to the documentation of this file.
1 // Copyright Contributors to the OpenVDB Project
2 // SPDX-License-Identifier: MPL-2.0
3
41
42 #ifndef OPENVDB_VERSION_HAS_BEEN_INCLUDED
43 #define OPENVDB_VERSION_HAS_BEEN_INCLUDED
44
45 #include "Platform.h"
46 #include <cstdint> // uint32_t
47
48
49 // Library major, minor and patch version numbers
50 #define OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER 7
51 #define OPENVDB_LIBRARY_MINOR_VERSION_NUMBER 1
52 #define OPENVDB_LIBRARY_PATCH_VERSION_NUMBER 0
53
54 // If OPENVDB_ABI_VERSION_NUMBER is already defined (e.g., via -DOPENVDB_ABI_VERSION_NUMBER=N)
55 // use that ABI version. Otherwise, use this library version's default ABI.
56 #ifdef OPENVDB_ABI_VERSION_NUMBER
57 #if OPENVDB_ABI_VERSION_NUMBER > OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER
58 #error expected OPENVDB_ABI_VERSION_NUMBER <= OPENVDB_LIBRARY_MAJOR VERSION_NUMBER
59 #endif
60 #else
61 #define OPENVDB_ABI_VERSION_NUMBER OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER
62 #endif
63
64 // If using an OPENVDB_ABI_VERSION_NUMBER that has been deprecated, issue a message
65 // directive. Note that an error is also set in openvdb.cc which enforces stricter
66 // behavior during compilation of the library. Both can be optionally suppressed
67 // by defining OPENVDB_USE_DEPRECATED_ABI_<VERSION>.
68 #ifndef OPENVDB_USE_DEPRECATED_ABI_5
69 #if OPENVDB_ABI_VERSION_NUMBER == 5
70 PRAGMA(message("NOTE: ABI = 5 is deprecated, CMake option OPENVDB_USE_DEPRECATED_ABI_5 "
71 "suppresses this message"))
72 #endif
73 #endif
74
75 #if OPENVDB_ABI_VERSION_NUMBER == OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER
76 #define OPENVDB_VERSION_NAME \
95 OPENVDB_PREPROC_CONCAT(v, \
96 OPENVDB_PREPROC_CONCAT(OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER, \
97 OPENVDB_PREPROC_CONCAT(_, OPENVDB_LIBRARY_MINOR_VERSION_NUMBER)))
98 #else
99 // This duplication of code is necessary to avoid issues with recursive macro expansion.
100 #define OPENVDB_VERSION_NAME \
101 OPENVDB_PREPROC_CONCAT(v, \
102 OPENVDB_PREPROC_CONCAT(OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER, \
103 OPENVDB_PREPROC_CONCAT(_, \
104 OPENVDB_PREPROC_CONCAT(OPENVDB_LIBRARY_MINOR_VERSION_NUMBER, \
105 OPENVDB_PREPROC_CONCAT(abi, OPENVDB_ABI_VERSION_NUMBER)))))
106 #endif
107
113 #define OPENVDB_LIBRARY_VERSION_STRING \
114 OPENVDB_PREPROC_STRINGIFY(OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER) "." \
115 OPENVDB_PREPROC_STRINGIFY(OPENVDB_LIBRARY_MINOR_VERSION_NUMBER) "." \
116 OPENVDB_PREPROC_STRINGIFY(OPENVDB_LIBRARY_PATCH_VERSION_NUMBER)
117
123 #define OPENVDB_LIBRARY_ABI_VERSION_STRING \
124 OPENVDB_LIBRARY_VERSION_STRING "abi" OPENVDB_PREPROC_STRINGIFY(OPENVDB_ABI_VERSION_NUMBER)
125
127 #define OPENVDB_LIBRARY_VERSION_NUMBER \
128 ((OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER << 24) | \
129 ((OPENVDB_LIBRARY_MINOR_VERSION_NUMBER & 0xFF) << 16) | \
130 (OPENVDB_LIBRARY_PATCH_VERSION_NUMBER & 0xFFFF))
131
132
141 #ifdef OPENVDB_REQUIRE_VERSION_NAME
142 #define OPENVDB_USE_VERSION_NAMESPACE
143 #else
144 // The empty namespace clause below ensures that OPENVDB_VERSION_NAME
145 // is recognized as a namespace name.
146 #define OPENVDB_USE_VERSION_NAMESPACE \
147 namespace OPENVDB_VERSION_NAME {} \
148 using namespace OPENVDB_VERSION_NAME;
149 #endif
150
151
152 namespace openvdb {
153 OPENVDB_USE_VERSION_NAMESPACE
154 namespace OPENVDB_VERSION_NAME {
155
158 const int32_t OPENVDB_MAGIC = 0x56444220;
159
160 // Library major, minor and patch version numbers
161 const uint32_t
162 OPENVDB_LIBRARY_MAJOR_VERSION = OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER,
163 OPENVDB_LIBRARY_MINOR_VERSION = OPENVDB_LIBRARY_MINOR_VERSION_NUMBER,
164 OPENVDB_LIBRARY_PATCH_VERSION = OPENVDB_LIBRARY_PATCH_VERSION_NUMBER;
166 const uint32_t OPENVDB_LIBRARY_VERSION = OPENVDB_LIBRARY_VERSION_NUMBER;
167 // ABI version number
168 const uint32_t OPENVDB_ABI_VERSION = OPENVDB_ABI_VERSION_NUMBER;
169
173 const uint32_t OPENVDB_FILE_VERSION = 224;
174
176 enum {
177 OPENVDB_FILE_VERSION_ROOTNODE_MAP = 213,
178 OPENVDB_FILE_VERSION_INTERNALNODE_COMPRESSION = 214,
179 OPENVDB_FILE_VERSION_SIMPLIFIED_GRID_TYPENAME = 215,
180 OPENVDB_FILE_VERSION_GRID_INSTANCING = 216,
181 OPENVDB_FILE_VERSION_BOOL_LEAF_OPTIMIZATION = 217,
182 OPENVDB_FILE_VERSION_BOOST_UUID = 218,
183 OPENVDB_FILE_VERSION_NO_GRIDMAP = 219,
184 OPENVDB_FILE_VERSION_NEW_TRANSFORM = 219,
185 OPENVDB_FILE_VERSION_SELECTIVE_COMPRESSION = 220,
186 OPENVDB_FILE_VERSION_FLOAT_FRUSTUM_BBOX = 221,
187 OPENVDB_FILE_VERSION_NODE_MASK_COMPRESSION = 222,
188 OPENVDB_FILE_VERSION_BLOSC_COMPRESSION = 223,
189 OPENVDB_FILE_VERSION_POINT_INDEX_GRID = 223,
190 OPENVDB_FILE_VERSION_MULTIPASS_IO = 224
191 };
192
193
195 inline constexpr const char* getLibraryVersionString() { return OPENVDB_LIBRARY_VERSION_STRING; }
197 inline constexpr const char* getLibraryAbiVersionString() {
198 return OPENVDB_LIBRARY_ABI_VERSION_STRING;
199 }
200
201
202 struct VersionId {
203 uint32_t first, second;
204 VersionId(): first(0), second(0) {}
205 VersionId(uint32_t major, uint32_t minor): first(major), second(minor) {}
206 };
207
208 } // namespace OPENVDB_VERSION_NAME
209 } // namespace openvdb
210
211 #endif // OPENVDB_VERSION_HAS_BEEN_INCLUDED
openvdb::v7_1::VersionId::second
uint32_t second
Definition: version.h:203
openvdb::v7_1::VersionId::VersionId
VersionId()
Definition: version.h:204
PRAGMA
#define PRAGMA(x)
Definition: Platform.h:11
OPENVDB_LIBRARY_VERSION_STRING
#define OPENVDB_LIBRARY_VERSION_STRING
Library version number string of the form "<major>.<minor>.<patch>".
Definition: version.h:113
openvdb::v7_1::OPENVDB_LIBRARY_MINOR_VERSION
const uint32_t OPENVDB_LIBRARY_MINOR_VERSION
Definition: version.h:163
openvdb::v7_1::OPENVDB_FILE_VERSION_ROOTNODE_MAP
@ OPENVDB_FILE_VERSION_ROOTNODE_MAP
Definition: version.h:177
OPENVDB_LIBRARY_PATCH_VERSION_NUMBER
#define OPENVDB_LIBRARY_PATCH_VERSION_NUMBER
Definition: version.h:52
openvdb::v7_1::getLibraryVersionString
constexpr const char * getLibraryVersionString()
Return a library version number string of the form "<major>.<minor>.<patch>".
Definition: version.h:195
openvdb::v7_1::OPENVDB_FILE_VERSION_NO_GRIDMAP
@ OPENVDB_FILE_VERSION_NO_GRIDMAP
Definition: version.h:183
openvdb::v7_1::OPENVDB_FILE_VERSION
const uint32_t OPENVDB_FILE_VERSION
The current version number of the VDB file format.
Definition: version.h:173
openvdb::v7_1::OPENVDB_FILE_VERSION_NODE_MASK_COMPRESSION
@ OPENVDB_FILE_VERSION_NODE_MASK_COMPRESSION
Definition: version.h:187
OPENVDB_LIBRARY_ABI_VERSION_STRING
#define OPENVDB_LIBRARY_ABI_VERSION_STRING
Library version number string of the form "<major>.<minor>.<patch>abi<abi>".
Definition: version.h:123
openvdb::v7_1::OPENVDB_FILE_VERSION_BOOL_LEAF_OPTIMIZATION
@ OPENVDB_FILE_VERSION_BOOL_LEAF_OPTIMIZATION
Definition: version.h:181
openvdb::v7_1::OPENVDB_FILE_VERSION_FLOAT_FRUSTUM_BBOX
@ OPENVDB_FILE_VERSION_FLOAT_FRUSTUM_BBOX
Definition: version.h:186
Platform.h
OPENVDB_LIBRARY_VERSION_NUMBER
#define OPENVDB_LIBRARY_VERSION_NUMBER
Library version number as a packed integer ("%02x%02x%04x", major, minor, patch)
Definition: version.h:127
openvdb::v7_1::OPENVDB_LIBRARY_VERSION
const uint32_t OPENVDB_LIBRARY_VERSION
Library version number as a packed integer ("%02x%02x%04x", major, minor, patch)
Definition: version.h:166
openvdb::v7_1::OPENVDB_FILE_VERSION_MULTIPASS_IO
@ OPENVDB_FILE_VERSION_MULTIPASS_IO
Definition: version.h:190
openvdb::v7_1::OPENVDB_FILE_VERSION_BOOST_UUID
@ OPENVDB_FILE_VERSION_BOOST_UUID
Definition: version.h:182
OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER
#define OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER
Definition: version.h:50
OPENVDB_USE_VERSION_NAMESPACE
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:146
openvdb::v7_1::OPENVDB_LIBRARY_MAJOR_VERSION
const uint32_t OPENVDB_LIBRARY_MAJOR_VERSION
Definition: version.h:162
openvdb::v7_1::VersionId
Definition: version.h:202
openvdb::v7_1::OPENVDB_LIBRARY_PATCH_VERSION
const uint32_t OPENVDB_LIBRARY_PATCH_VERSION
Definition: version.h:164
openvdb::v7_1::VersionId::VersionId
VersionId(uint32_t major, uint32_t minor)
Definition: version.h:205
openvdb::v7_1::OPENVDB_FILE_VERSION_POINT_INDEX_GRID
@ OPENVDB_FILE_VERSION_POINT_INDEX_GRID
Definition: version.h:189
openvdb::v7_1::OPENVDB_FILE_VERSION_INTERNALNODE_COMPRESSION
@ OPENVDB_FILE_VERSION_INTERNALNODE_COMPRESSION
Definition: version.h:178
openvdb::v7_1::OPENVDB_FILE_VERSION_BLOSC_COMPRESSION
@ OPENVDB_FILE_VERSION_BLOSC_COMPRESSION
Definition: version.h:188
OPENVDB_VERSION_NAME
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h:94
OPENVDB_LIBRARY_MINOR_VERSION_NUMBER
#define OPENVDB_LIBRARY_MINOR_VERSION_NUMBER
Definition: version.h:51
openvdb::v7_1::OPENVDB_MAGIC
const int32_t OPENVDB_MAGIC
The magic number is stored in the first four bytes of every VDB file.
Definition: version.h:158
openvdb::v7_1::OPENVDB_FILE_VERSION_SIMPLIFIED_GRID_TYPENAME
@ OPENVDB_FILE_VERSION_SIMPLIFIED_GRID_TYPENAME
Definition: version.h:179
openvdb::v7_1::OPENVDB_FILE_VERSION_NEW_TRANSFORM
@ OPENVDB_FILE_VERSION_NEW_TRANSFORM
Definition: version.h:184
openvdb
Definition: Exceptions.h:13
openvdb::v7_1::OPENVDB_FILE_VERSION_GRID_INSTANCING
@ OPENVDB_FILE_VERSION_GRID_INSTANCING
Definition: version.h:180
openvdb::v7_1::getLibraryAbiVersionString
constexpr const char * getLibraryAbiVersionString()
Return a library version number string of the form "<major>.<minor>.<patch>abi<abi>".
Definition: version.h:197
openvdb::v7_1::OPENVDB_FILE_VERSION_SELECTIVE_COMPRESSION
@ OPENVDB_FILE_VERSION_SELECTIVE_COMPRESSION
Definition: version.h:185
openvdb::v7_1::OPENVDB_ABI_VERSION
const uint32_t OPENVDB_ABI_VERSION
Definition: version.h:168