OpenVDB: version.h Source File

OpenVDB 6.1.0

version.h
Go to the documentation of this file.
1 //
3 // Copyright (c) 2012-2019 DreamWorks Animation LLC
4 //
5 // All rights reserved. This software is distributed under the
6 // Mozilla Public License 2.0 ( http://www.mozilla.org/MPL/2.0/ )
7 //
8 // Redistributions of source code must retain the above copyright
9 // and license notice and the following restrictions and disclaimer.
10 //
11 // * Neither the name of DreamWorks Animation nor the names of
12 // its contributors may be used to endorse or promote products derived
13 // from this software without specific prior written permission.
14 //
15 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY INDIRECT, INCIDENTAL,
20 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 // IN NO EVENT SHALL THE COPYRIGHT HOLDERS' AND CONTRIBUTORS' AGGREGATE
27 // LIABILITY FOR ALL CLAIMS REGARDLESS OF THEIR BASIS EXCEED US$250.00.
28 //
30
68
69 #ifndef OPENVDB_VERSION_HAS_BEEN_INCLUDED
70 #define OPENVDB_VERSION_HAS_BEEN_INCLUDED
71
72 #include "Platform.h"
73
74
75 // Library major, minor and patch version numbers
76 #define OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER 6
77 #define OPENVDB_LIBRARY_MINOR_VERSION_NUMBER 1
78 #define OPENVDB_LIBRARY_PATCH_VERSION_NUMBER 0
79
80 // If OPENVDB_ABI_VERSION_NUMBER is already defined (e.g., via -DOPENVDB_ABI_VERSION_NUMBER=N)
81 // use that ABI version. Otherwise, use this library version's default ABI.
82 #ifdef OPENVDB_ABI_VERSION_NUMBER
83 #if OPENVDB_ABI_VERSION_NUMBER > OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER
84 #error expected OPENVDB_ABI_VERSION_NUMBER <= OPENVDB_LIBRARY_MAJOR VERSION_NUMBER
85 #endif
86 #else
87 // Older versions of the library used the macros OPENVDB_2_ABI_COMPATIBLE
88 // and OPENVDB_3_ABI_COMPATIBLE. For now, continue to support them.
89 #if defined OPENVDB_2_ABI_COMPATIBLE
90 #define OPENVDB_ABI_VERSION_NUMBER 2
91 #elif defined OPENVDB_3_ABI_COMPATIBLE
92 #define OPENVDB_ABI_VERSION_NUMBER 3
93 #else
94 #define OPENVDB_ABI_VERSION_NUMBER OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER
95 #endif
96 #endif
97
98 // If using an OPENVDB_ABI_VERSION_NUMBER that has been deprecated, issue an error
99 // directive. This can be optionally suppressed by defining OPENVDB_USE_DEPRECATED_ABI.
100 #ifndef OPENVDB_USE_DEPRECATED_ABI
101 #if OPENVDB_ABI_VERSION_NUMBER <= 3
102 #error ABI <= 3 is deprecated, define OPENVDB_USE_DEPRECATED_ABI to suppress this error
103 #endif
104 #endif
105
106 #if OPENVDB_ABI_VERSION_NUMBER == OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER
107 #define OPENVDB_VERSION_NAME \
126 OPENVDB_PREPROC_CONCAT(v, \
127 OPENVDB_PREPROC_CONCAT(OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER, \
128 OPENVDB_PREPROC_CONCAT(_, OPENVDB_LIBRARY_MINOR_VERSION_NUMBER)))
129 #else
130 // This duplication of code is necessary to avoid issues with recursive macro expansion.
131 #define OPENVDB_VERSION_NAME \
132 OPENVDB_PREPROC_CONCAT(v, \
133 OPENVDB_PREPROC_CONCAT(OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER, \
134 OPENVDB_PREPROC_CONCAT(_, \
135 OPENVDB_PREPROC_CONCAT(OPENVDB_LIBRARY_MINOR_VERSION_NUMBER, \
136 OPENVDB_PREPROC_CONCAT(abi, OPENVDB_ABI_VERSION_NUMBER)))))
137 #endif
138
144 #define OPENVDB_LIBRARY_VERSION_STRING \
145 OPENVDB_PREPROC_STRINGIFY(OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER) "." \
146 OPENVDB_PREPROC_STRINGIFY(OPENVDB_LIBRARY_MINOR_VERSION_NUMBER) "." \
147 OPENVDB_PREPROC_STRINGIFY(OPENVDB_LIBRARY_PATCH_VERSION_NUMBER)
148
154 #define OPENVDB_LIBRARY_ABI_VERSION_STRING \
155 OPENVDB_LIBRARY_VERSION_STRING "abi" OPENVDB_PREPROC_STRINGIFY(OPENVDB_ABI_VERSION_NUMBER)
156
158 #define OPENVDB_LIBRARY_VERSION_NUMBER \
159 ((OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER << 24) | \
160 ((OPENVDB_LIBRARY_MINOR_VERSION_NUMBER & 0xFF) << 16) | \
161 (OPENVDB_LIBRARY_PATCH_VERSION_NUMBER & 0xFFFF))
162
163
172 #ifdef OPENVDB_REQUIRE_VERSION_NAME
173 #define OPENVDB_USE_VERSION_NAMESPACE
174 #else
175 // The empty namespace clause below ensures that OPENVDB_VERSION_NAME
176 // is recognized as a namespace name.
177 #define OPENVDB_USE_VERSION_NAMESPACE \
178 namespace OPENVDB_VERSION_NAME {} \
179 using namespace OPENVDB_VERSION_NAME;
180 #endif
181
182
183 namespace openvdb {
184 OPENVDB_USE_VERSION_NAMESPACE
185 namespace OPENVDB_VERSION_NAME {
186
189 const int32_t OPENVDB_MAGIC = 0x56444220;
190
191 // Library major, minor and patch version numbers
192 const uint32_t
193 OPENVDB_LIBRARY_MAJOR_VERSION = OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER,
194 OPENVDB_LIBRARY_MINOR_VERSION = OPENVDB_LIBRARY_MINOR_VERSION_NUMBER,
195 OPENVDB_LIBRARY_PATCH_VERSION = OPENVDB_LIBRARY_PATCH_VERSION_NUMBER;
197 const uint32_t OPENVDB_LIBRARY_VERSION = OPENVDB_LIBRARY_VERSION_NUMBER;
198 // ABI version number
199 const uint32_t OPENVDB_ABI_VERSION = OPENVDB_ABI_VERSION_NUMBER;
200
204 const uint32_t OPENVDB_FILE_VERSION = 224;
205
207 enum {
208 OPENVDB_FILE_VERSION_ROOTNODE_MAP = 213,
209 OPENVDB_FILE_VERSION_INTERNALNODE_COMPRESSION = 214,
210 OPENVDB_FILE_VERSION_SIMPLIFIED_GRID_TYPENAME = 215,
211 OPENVDB_FILE_VERSION_GRID_INSTANCING = 216,
212 OPENVDB_FILE_VERSION_BOOL_LEAF_OPTIMIZATION = 217,
213 OPENVDB_FILE_VERSION_BOOST_UUID = 218,
214 OPENVDB_FILE_VERSION_NO_GRIDMAP = 219,
215 OPENVDB_FILE_VERSION_NEW_TRANSFORM = 219,
216 OPENVDB_FILE_VERSION_SELECTIVE_COMPRESSION = 220,
217 OPENVDB_FILE_VERSION_FLOAT_FRUSTUM_BBOX = 221,
218 OPENVDB_FILE_VERSION_NODE_MASK_COMPRESSION = 222,
219 OPENVDB_FILE_VERSION_BLOSC_COMPRESSION = 223,
220 OPENVDB_FILE_VERSION_POINT_INDEX_GRID = 223,
221 OPENVDB_FILE_VERSION_MULTIPASS_IO = 224
222 };
223
224
226 inline constexpr const char* getLibraryVersionString() { return OPENVDB_LIBRARY_VERSION_STRING; }
228 inline constexpr const char* getLibraryAbiVersionString() {
229 return OPENVDB_LIBRARY_ABI_VERSION_STRING;
230 }
231
232
233 struct VersionId {
234 uint32_t first, second;
235 VersionId(): first(0), second(0) {}
236 VersionId(uint32_t major, uint32_t minor): first(major), second(minor) {}
237 };
238
239 } // namespace OPENVDB_VERSION_NAME
240 } // namespace openvdb
241
242 #endif // OPENVDB_VERSION_HAS_BEEN_INCLUDED
243
244 // Copyright (c) 2012-2019 DreamWorks Animation LLC
245 // All rights reserved. This software is distributed under the
246 // Mozilla Public License 2.0 ( http://www.mozilla.org/MPL/2.0/ )
openvdb::v6_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:189
openvdb::v6_1::OPENVDB_FILE_VERSION_INTERNALNODE_COMPRESSION
Definition: version.h:209
openvdb::v6_1::OPENVDB_FILE_VERSION_NEW_TRANSFORM
Definition: version.h:215
openvdb::v6_1::OPENVDB_FILE_VERSION_FLOAT_FRUSTUM_BBOX
Definition: version.h:217
openvdb::v6_1::OPENVDB_FILE_VERSION_SELECTIVE_COMPRESSION
Definition: version.h:216
OPENVDB_LIBRARY_VERSION_STRING
#define OPENVDB_LIBRARY_VERSION_STRING
Library version number string of the form "<major>.<minor>.<patch>".
Definition: version.h:144
openvdb::v6_1::VersionId
Definition: version.h:233
openvdb::v6_1::OPENVDB_FILE_VERSION_BOOL_LEAF_OPTIMIZATION
Definition: version.h:212
openvdb::v6_1::OPENVDB_FILE_VERSION
const uint32_t OPENVDB_FILE_VERSION
The current version number of the VDB file format.
Definition: version.h:204
openvdb::v6_1::OPENVDB_FILE_VERSION_NODE_MASK_COMPRESSION
Definition: version.h:218
openvdb::v6_1::OPENVDB_FILE_VERSION_GRID_INSTANCING
Definition: version.h:211
openvdb::v6_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:197
openvdb::v6_1::VersionId::VersionId
VersionId()
Definition: version.h:235
openvdb::v6_1::OPENVDB_FILE_VERSION_ROOTNODE_MAP
Definition: version.h:208
openvdb::v6_1::getLibraryAbiVersionString
constexpr const char * getLibraryAbiVersionString()
Return a library version number string of the form "<major>.<minor>.<patch>abi<abi>".
Definition: version.h:228
openvdb::v6_1::OPENVDB_FILE_VERSION_POINT_INDEX_GRID
Definition: version.h:220
openvdb::v6_1::OPENVDB_FILE_VERSION_BLOSC_COMPRESSION
Definition: version.h:219
OPENVDB_VERSION_NAME
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h:125
openvdb::v6_1::OPENVDB_FILE_VERSION_MULTIPASS_IO
Definition: version.h:221
openvdb::v6_1::OPENVDB_LIBRARY_PATCH_VERSION
const uint32_t OPENVDB_LIBRARY_PATCH_VERSION
Definition: version.h:195
openvdb::v6_1::getLibraryVersionString
constexpr const char * getLibraryVersionString()
Return a library version number string of the form "<major>.<minor>.<patch>".
Definition: version.h:226
openvdb
Definition: Exceptions.h:40
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:158
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:154
openvdb::v6_1::OPENVDB_LIBRARY_MAJOR_VERSION
const uint32_t OPENVDB_LIBRARY_MAJOR_VERSION
Definition: version.h:193
openvdb::v6_1::OPENVDB_FILE_VERSION_BOOST_UUID
Definition: version.h:213
openvdb::v6_1::OPENVDB_LIBRARY_MINOR_VERSION
const uint32_t OPENVDB_LIBRARY_MINOR_VERSION
Definition: version.h:194
openvdb::v6_1::OPENVDB_FILE_VERSION_SIMPLIFIED_GRID_TYPENAME
Definition: version.h:210
openvdb::v6_1::VersionId::second
uint32_t second
Definition: version.h:234
openvdb::v6_1::VersionId::VersionId
VersionId(uint32_t major, uint32_t minor)
Definition: version.h:236
OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER
#define OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER
Definition: version.h:76
openvdb::v6_1::OPENVDB_ABI_VERSION
const uint32_t OPENVDB_ABI_VERSION
Definition: version.h:199
OPENVDB_USE_VERSION_NAMESPACE
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:177
OPENVDB_LIBRARY_MINOR_VERSION_NUMBER
#define OPENVDB_LIBRARY_MINOR_VERSION_NUMBER
Definition: version.h:77
OPENVDB_LIBRARY_PATCH_VERSION_NUMBER
#define OPENVDB_LIBRARY_PATCH_VERSION_NUMBER
Definition: version.h:78
openvdb::v6_1::OPENVDB_FILE_VERSION_NO_GRIDMAP
Definition: version.h:214
Platform.h