OpenVDB 5.1.0

version.h
Go to the documentation of this file.
1 //
3 // Copyright (c) 2012-2018 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
77 #define OPENVDB_PREPROC_STRINGIFY_(x) #x
78 #define OPENVDB_PREPROC_STRINGIFY(x) OPENVDB_PREPROC_STRINGIFY_(x)
83
85 #define OPENVDB_PREPROC_CONCAT_(x, y) x ## y
86 #define OPENVDB_PREPROC_CONCAT(x, y) OPENVDB_PREPROC_CONCAT_(x, y)
91
93
94 // Library major, minor and patch version numbers
95 #define OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER 5
96 #define OPENVDB_LIBRARY_MINOR_VERSION_NUMBER 1
97 #define OPENVDB_LIBRARY_PATCH_VERSION_NUMBER 0
98
99 // If OPENVDB_ABI_VERSION_NUMBER is already defined (e.g., via -DOPENVDB_ABI_VERSION_NUMBER=N)
100 // use that ABI version. Otherwise, use this library version's default ABI.
101 #ifdef OPENVDB_ABI_VERSION_NUMBER
102 #if OPENVDB_ABI_VERSION_NUMBER > OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER
103 #error expected OPENVDB_ABI_VERSION_NUMBER <= OPENVDB_LIBRARY_MAJOR VERSION_NUMBER
104 #endif
105 #else
106 // Older versions of the library used the macros OPENVDB_2_ABI_COMPATIBLE
107 // and OPENVDB_3_ABI_COMPATIBLE. For now, continue to support them.
108 #if defined OPENVDB_2_ABI_COMPATIBLE
109 #define OPENVDB_ABI_VERSION_NUMBER 2
110 #elif defined OPENVDB_3_ABI_COMPATIBLE
111 #define OPENVDB_ABI_VERSION_NUMBER 3
112 #else
113 #define OPENVDB_ABI_VERSION_NUMBER OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER
114 #endif
115 #endif
116
117 #if OPENVDB_ABI_VERSION_NUMBER == OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER
118 #define OPENVDB_VERSION_NAME \
137 OPENVDB_PREPROC_CONCAT(v, \
138 OPENVDB_PREPROC_CONCAT(OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER, \
139 OPENVDB_PREPROC_CONCAT(_, OPENVDB_LIBRARY_MINOR_VERSION_NUMBER)))
140 #else
141 // This duplication of code is necessary to avoid issues with recursive macro expansion.
142 #define OPENVDB_VERSION_NAME \
143 OPENVDB_PREPROC_CONCAT(v, \
144 OPENVDB_PREPROC_CONCAT(OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER, \
145 OPENVDB_PREPROC_CONCAT(_, \
146 OPENVDB_PREPROC_CONCAT(OPENVDB_LIBRARY_MINOR_VERSION_NUMBER, \
147 OPENVDB_PREPROC_CONCAT(abi, OPENVDB_ABI_VERSION_NUMBER)))))
148 #endif
149
155 #define OPENVDB_LIBRARY_VERSION_STRING \
156 OPENVDB_PREPROC_STRINGIFY(OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER) "." \
157 OPENVDB_PREPROC_STRINGIFY(OPENVDB_LIBRARY_MINOR_VERSION_NUMBER) "." \
158 OPENVDB_PREPROC_STRINGIFY(OPENVDB_LIBRARY_PATCH_VERSION_NUMBER)
159
165 #define OPENVDB_LIBRARY_ABI_VERSION_STRING \
166 OPENVDB_LIBRARY_VERSION_STRING "abi" OPENVDB_PREPROC_STRINGIFY(OPENVDB_ABI_VERSION_NUMBER)
167
169 #define OPENVDB_LIBRARY_VERSION_NUMBER \
170 ((OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER << 24) | \
171 ((OPENVDB_LIBRARY_MINOR_VERSION_NUMBER & 0xFF) << 16) | \
172 (OPENVDB_LIBRARY_PATCH_VERSION_NUMBER & 0xFFFF))
173
174
183 #ifdef OPENVDB_REQUIRE_VERSION_NAME
184 #define OPENVDB_USE_VERSION_NAMESPACE
185 #else
186 // The empty namespace clause below ensures that OPENVDB_VERSION_NAME
187 // is recognized as a namespace name.
188 #define OPENVDB_USE_VERSION_NAMESPACE \
189 namespace OPENVDB_VERSION_NAME {} \
190 using namespace OPENVDB_VERSION_NAME;
191 #endif
192
193
194 namespace openvdb {
195 OPENVDB_USE_VERSION_NAMESPACE
196 namespace OPENVDB_VERSION_NAME {
197
200 const int32_t OPENVDB_MAGIC = 0x56444220;
201
202 // Library major, minor and patch version numbers
203 const uint32_t
204 OPENVDB_LIBRARY_MAJOR_VERSION = OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER,
205 OPENVDB_LIBRARY_MINOR_VERSION = OPENVDB_LIBRARY_MINOR_VERSION_NUMBER,
206 OPENVDB_LIBRARY_PATCH_VERSION = OPENVDB_LIBRARY_PATCH_VERSION_NUMBER;
208 const uint32_t OPENVDB_LIBRARY_VERSION = OPENVDB_LIBRARY_VERSION_NUMBER;
209 // ABI version number
210 const uint32_t OPENVDB_ABI_VERSION = OPENVDB_ABI_VERSION_NUMBER;
211
215 const uint32_t OPENVDB_FILE_VERSION = 224;
216
218 enum {
219 OPENVDB_FILE_VERSION_ROOTNODE_MAP = 213,
220 OPENVDB_FILE_VERSION_INTERNALNODE_COMPRESSION = 214,
221 OPENVDB_FILE_VERSION_SIMPLIFIED_GRID_TYPENAME = 215,
222 OPENVDB_FILE_VERSION_GRID_INSTANCING = 216,
223 OPENVDB_FILE_VERSION_BOOL_LEAF_OPTIMIZATION = 217,
224 OPENVDB_FILE_VERSION_BOOST_UUID = 218,
225 OPENVDB_FILE_VERSION_NO_GRIDMAP = 219,
226 OPENVDB_FILE_VERSION_NEW_TRANSFORM = 219,
227 OPENVDB_FILE_VERSION_SELECTIVE_COMPRESSION = 220,
228 OPENVDB_FILE_VERSION_FLOAT_FRUSTUM_BBOX = 221,
229 OPENVDB_FILE_VERSION_NODE_MASK_COMPRESSION = 222,
230 OPENVDB_FILE_VERSION_BLOSC_COMPRESSION = 223,
231 OPENVDB_FILE_VERSION_POINT_INDEX_GRID = 223,
232 OPENVDB_FILE_VERSION_MULTIPASS_IO = 224
233 };
234
235
237 inline constexpr const char* getLibraryVersionString() { return OPENVDB_LIBRARY_VERSION_STRING; }
239 inline constexpr const char* getLibraryAbiVersionString() {
240 return OPENVDB_LIBRARY_ABI_VERSION_STRING;
241 }
242
243
244 struct VersionId {
245 uint32_t first, second;
246 VersionId(): first(0), second(0) {}
247 VersionId(uint32_t major, uint32_t minor): first(major), second(minor) {}
248 };
249
250 } // namespace OPENVDB_VERSION_NAME
251 } // namespace openvdb
252
253 #endif // OPENVDB_VERSION_HAS_BEEN_INCLUDED
254
255 // Copyright (c) 2012-2018 DreamWorks Animation LLC
256 // All rights reserved. This software is distributed under the
257 // Mozilla Public License 2.0 ( http://www.mozilla.org/MPL/2.0/ )
openvdb::v5_1::OPENVDB_FILE_VERSION_SELECTIVE_COMPRESSION
Definition: version.h:227
openvdb::v5_1::OPENVDB_FILE_VERSION_INTERNALNODE_COMPRESSION
Definition: version.h:220
openvdb::v5_1::VersionId
Definition: version.h:244
openvdb::v5_1::OPENVDB_ABI_VERSION
const uint32_t OPENVDB_ABI_VERSION
Definition: version.h:210
OPENVDB_LIBRARY_VERSION_STRING
#define OPENVDB_LIBRARY_VERSION_STRING
Library version number string of the form "<major>.<minor>.<patch>".
Definition: version.h:155
openvdb::v5_1::OPENVDB_FILE_VERSION_BOOST_UUID
Definition: version.h:224
openvdb::v5_1::OPENVDB_FILE_VERSION_ROOTNODE_MAP
Definition: version.h:219
openvdb::v5_1::getLibraryVersionString
constexpr const char * getLibraryVersionString()
Return a library version number string of the form "<major>.<minor>.<patch>".
Definition: version.h:237
openvdb::v5_1::OPENVDB_FILE_VERSION_BOOL_LEAF_OPTIMIZATION
Definition: version.h:223
openvdb::v5_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:208
openvdb::v5_1::OPENVDB_FILE_VERSION_MULTIPASS_IO
Definition: version.h:232
openvdb::v5_1::VersionId::VersionId
VersionId()
Definition: version.h:246
openvdb::v5_1::OPENVDB_FILE_VERSION_GRID_INSTANCING
Definition: version.h:222
openvdb::v5_1::OPENVDB_LIBRARY_MINOR_VERSION
const uint32_t OPENVDB_LIBRARY_MINOR_VERSION
Definition: version.h:205
OPENVDB_VERSION_NAME
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h:136
openvdb::v5_1::OPENVDB_FILE_VERSION_BLOSC_COMPRESSION
Definition: version.h:230
openvdb
Definition: Exceptions.h:40
openvdb::v5_1::OPENVDB_FILE_VERSION_NO_GRIDMAP
Definition: version.h:225
openvdb::v5_1::OPENVDB_FILE_VERSION_POINT_INDEX_GRID
Definition: version.h:231
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:169
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:165
openvdb::v5_1::OPENVDB_FILE_VERSION_FLOAT_FRUSTUM_BBOX
Definition: version.h:228
openvdb::v5_1::OPENVDB_LIBRARY_PATCH_VERSION
const uint32_t OPENVDB_LIBRARY_PATCH_VERSION
Definition: version.h:206
openvdb::v5_1::OPENVDB_FILE_VERSION_SIMPLIFIED_GRID_TYPENAME
Definition: version.h:221
openvdb::v5_1::VersionId::second
uint32_t second
Definition: version.h:245
openvdb::v5_1::OPENVDB_LIBRARY_MAJOR_VERSION
const uint32_t OPENVDB_LIBRARY_MAJOR_VERSION
Definition: version.h:204
openvdb::v5_1::VersionId::VersionId
VersionId(uint32_t major, uint32_t minor)
Definition: version.h:247
openvdb::v5_1::getLibraryAbiVersionString
constexpr const char * getLibraryAbiVersionString()
Return a library version number string of the form "<major>.<minor>.<patch>abi<abi>".
Definition: version.h:239
OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER
#define OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER
Definition: version.h:95
OPENVDB_USE_VERSION_NAMESPACE
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:188
OPENVDB_LIBRARY_MINOR_VERSION_NUMBER
#define OPENVDB_LIBRARY_MINOR_VERSION_NUMBER
Definition: version.h:96
openvdb::v5_1::OPENVDB_FILE_VERSION
const uint32_t OPENVDB_FILE_VERSION
The current version number of the VDB file format.
Definition: version.h:215
openvdb::v5_1::OPENVDB_FILE_VERSION_NEW_TRANSFORM
Definition: version.h:226
openvdb::v5_1::OPENVDB_FILE_VERSION_NODE_MASK_COMPRESSION
Definition: version.h:229
openvdb::v5_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:200
OPENVDB_LIBRARY_PATCH_VERSION_NUMBER
#define OPENVDB_LIBRARY_PATCH_VERSION_NUMBER
Definition: version.h:97
Platform.h