OpenVDB 5.1.0

Types.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
31 #ifndef OPENVDB_TYPES_HAS_BEEN_INCLUDED
32 #define OPENVDB_TYPES_HAS_BEEN_INCLUDED
33
34 #include "version.h"
35 #include "Platform.h"
36 #include <OpenEXR/half.h>
37 #include <openvdb/math/Math.h>
38 #include <openvdb/math/BBox.h>
39 #include <openvdb/math/Quat.h>
40 #include <openvdb/math/Vec2.h>
41 #include <openvdb/math/Vec3.h>
42 #include <openvdb/math/Vec4.h>
43 #include <openvdb/math/Mat3.h>
44 #include <openvdb/math/Mat4.h>
45 #include <openvdb/math/Coord.h>
46 #include <memory>
47 #include <type_traits>
48 #if OPENVDB_ABI_VERSION_NUMBER <= 3
49 #include <boost/shared_ptr.hpp>
50 #include <boost/weak_ptr.hpp>
51 #endif
52
53
54 namespace openvdb {
55 OPENVDB_USE_VERSION_NAMESPACE
56 namespace OPENVDB_VERSION_NAME {
57
58 // One-dimensional scalar types
59 using Index32 = uint32_t;
60 using Index64 = uint64_t;
61 using Index = Index32;
62 using Int16 = int16_t;
63 using Int32 = int32_t;
64 using Int64 = int64_t;
65 using Int = Int32;
66 using Byte = unsigned char;
67 using Real = double;
68
69 // Two-dimensional vector types
70 using Vec2R = math::Vec2<Real>;
71 using Vec2I = math::Vec2<Index32>;
72 using Vec2f = math::Vec2<float>;
73 using Vec2H = math::Vec2<half>;
74 using math::Vec2i;
75 using math::Vec2s;
76 using math::Vec2d;
77
78 // Three-dimensional vector types
79 using Vec3R = math::Vec3<Real>;
80 using Vec3I = math::Vec3<Index32>;
81 using Vec3f = math::Vec3<float>;
82 using Vec3H = math::Vec3<half>;
83 using Vec3U8 = math::Vec3<uint8_t>;
84 using Vec3U16 = math::Vec3<uint16_t>;
85 using math::Vec3i;
86 using math::Vec3s;
87 using math::Vec3d;
88
89 using math::Coord;
90 using math::CoordBBox;
91 using BBoxd = math::BBox<Vec3d>;
92
93 // Four-dimensional vector types
94 using Vec4R = math::Vec4<Real>;
95 using Vec4I = math::Vec4<Index32>;
96 using Vec4f = math::Vec4<float>;
97 using Vec4H = math::Vec4<half>;
98 using math::Vec4i;
99 using math::Vec4s;
100 using math::Vec4d;
101
102 // Three-dimensional matrix types
103 using Mat3R = math::Mat3<Real>;
104 using math::Mat3s;
105 using math::Mat3d;
106
107 // Four-dimensional matrix types
108 using Mat4R = math::Mat4<Real>;
109 using math::Mat4s;
110 using math::Mat4d;
111
112 // Quaternions
113 using QuatR = math::Quat<Real>;
114 using math::Quats;
115 using math::Quatd;
116
117 // Dummy type for a voxel with a binary mask value, e.g. the active state
118 class ValueMask {};
119
120
121 #if OPENVDB_ABI_VERSION_NUMBER <= 3
122
123 // Use Boost shared pointers in OpenVDB 3 ABI compatibility mode.
124 template<typename T> using SharedPtr = boost::shared_ptr<T>;
125 template<typename T> using WeakPtr = boost::weak_ptr<T>;
126
127 template<typename T, typename U> inline SharedPtr<T>
128 ConstPtrCast(const SharedPtr<U>& ptr) { return boost::const_pointer_cast<T, U>(ptr); }
129
130 template<typename T, typename U> inline SharedPtr<T>
131 DynamicPtrCast(const SharedPtr<U>& ptr) { return boost::dynamic_pointer_cast<T, U>(ptr); }
132
133 template<typename T, typename U> inline SharedPtr<T>
134 StaticPtrCast(const SharedPtr<U>& ptr) { return boost::static_pointer_cast<T, U>(ptr); }
135
136 #else // if OPENVDB_ABI_VERSION_NUMBER > 3
137
138 // Use STL shared pointers from OpenVDB 4 on.
139 template<typename T> using SharedPtr = std::shared_ptr<T>;
140 template<typename T> using WeakPtr = std::weak_ptr<T>;
141
150 template<typename T, typename U> inline SharedPtr<T>
151 ConstPtrCast(const SharedPtr<U>& ptr) { return std::const_pointer_cast<T, U>(ptr); }
152
160 template<typename T, typename U> inline SharedPtr<T>
161 DynamicPtrCast(const SharedPtr<U>& ptr) { return std::dynamic_pointer_cast<T, U>(ptr); }
162
170 template<typename T, typename U> inline SharedPtr<T>
171 StaticPtrCast(const SharedPtr<U>& ptr) { return std::static_pointer_cast<T, U>(ptr); }
172
173 #endif
174
175
177
178
182 template<typename IntType_, Index Kind>
183 struct PointIndex
184 {
185 static_assert(std::is_integral<IntType_>::value, "PointIndex requires an integer value type");
186
187 using IntType = IntType_;
188
189 PointIndex(IntType i = IntType(0)): mIndex(i) {}
190
191 operator IntType() const { return mIndex; }
192
194 template<typename T>
195 PointIndex operator+(T x) { return PointIndex(mIndex + IntType(x)); }
196
197 private:
198 IntType mIndex;
199 };
200
201
202 using PointIndex32 = PointIndex<Index32, 0>;
203 using PointIndex64 = PointIndex<Index64, 0>;
204
205 using PointDataIndex32 = PointIndex<Index32, 1>;
206 using PointDataIndex64 = PointIndex<Index64, 1>;
207
208
210
211
212 template<typename T> struct VecTraits {
213 static const bool IsVec = false;
214 static const int Size = 1;
215 using ElementType = T;
216 };
217
218 template<typename T> struct VecTraits<math::Vec2<T> > {
219 static const bool IsVec = true;
220 static const int Size = 2;
221 using ElementType = T;
222 };
223
224 template<typename T> struct VecTraits<math::Vec3<T> > {
225 static const bool IsVec = true;
226 static const int Size = 3;
227 using ElementType = T;
228 };
229
230 template<typename T> struct VecTraits<math::Vec4<T> > {
231 static const bool IsVec = true;
232 static const int Size = 4;
233 using ElementType = T;
234 };
235
236
238
239
242 template<typename FromType, typename ToType>
243 struct CanConvertType { enum { value = std::is_constructible<ToType, FromType>::value }; };
244
245 // Specializations for vector types, which can be constructed from values
246 // of their own ValueTypes (or values that can be converted to their ValueTypes),
247 // but only explicitly
248 template<typename T> struct CanConvertType<T, math::Vec2<T> > { enum { value = true }; };
249 template<typename T> struct CanConvertType<T, math::Vec3<T> > { enum { value = true }; };
250 template<typename T> struct CanConvertType<T, math::Vec4<T> > { enum { value = true }; };
251 template<typename T> struct CanConvertType<math::Vec2<T>, math::Vec2<T> > { enum {value = true}; };
252 template<typename T> struct CanConvertType<math::Vec3<T>, math::Vec3<T> > { enum {value = true}; };
253 template<typename T> struct CanConvertType<math::Vec4<T>, math::Vec4<T> > { enum {value = true}; };
254 template<typename T0, typename T1>
255 struct CanConvertType<T0, math::Vec2<T1> > { enum { value = CanConvertType<T0, T1>::value }; };
256 template<typename T0, typename T1>
257 struct CanConvertType<T0, math::Vec3<T1> > { enum { value = CanConvertType<T0, T1>::value }; };
258 template<typename T0, typename T1>
259 struct CanConvertType<T0, math::Vec4<T1> > { enum { value = CanConvertType<T0, T1>::value }; };
260 template<> struct CanConvertType<PointIndex32, PointDataIndex32> { enum {value = true}; };
261 template<> struct CanConvertType<PointDataIndex32, PointIndex32> { enum {value = true}; };
262 template<typename T>
263 struct CanConvertType<T, ValueMask> { enum {value = CanConvertType<T, bool>::value}; };
264 template<typename T>
265 struct CanConvertType<ValueMask, T> { enum {value = CanConvertType<bool, T>::value}; };
266
267
269
270
271 // Add new items to the *end* of this list, and update NUM_GRID_CLASSES.
272 enum GridClass {
273 GRID_UNKNOWN = 0,
274 GRID_LEVEL_SET,
275 GRID_FOG_VOLUME,
276 GRID_STAGGERED
277 };
278 enum { NUM_GRID_CLASSES = GRID_STAGGERED + 1 };
279
280 static const Real LEVEL_SET_HALF_WIDTH = 3;
281
302 enum VecType {
303 VEC_INVARIANT = 0,
304 VEC_COVARIANT,
305 VEC_COVARIANT_NORMALIZE,
306 VEC_CONTRAVARIANT_RELATIVE,
307 VEC_CONTRAVARIANT_ABSOLUTE
308 };
309 enum { NUM_VEC_TYPES = VEC_CONTRAVARIANT_ABSOLUTE + 1 };
310
311
325 enum MergePolicy {
326 MERGE_ACTIVE_STATES = 0,
327 MERGE_NODES,
328 MERGE_ACTIVE_STATES_AND_NODES
329 };
330
331
333
334
335 template<typename T> const char* typeNameAsString() { return typeid(T).name(); }
336 template<> inline const char* typeNameAsString<bool>() { return "bool"; }
337 template<> inline const char* typeNameAsString<ValueMask>() { return "mask"; }
338 template<> inline const char* typeNameAsString<half>() { return "half"; }
339 template<> inline const char* typeNameAsString<float>() { return "float"; }
340 template<> inline const char* typeNameAsString<double>() { return "double"; }
341 template<> inline const char* typeNameAsString<uint8_t>() { return "uint8"; }
342 template<> inline const char* typeNameAsString<int16_t>() { return "int16"; }
343 template<> inline const char* typeNameAsString<uint16_t>() { return "uint16"; }
344 template<> inline const char* typeNameAsString<int32_t>() { return "int32"; }
345 template<> inline const char* typeNameAsString<uint32_t>() { return "uint32"; }
346 template<> inline const char* typeNameAsString<int64_t>() { return "int64"; }
347 template<> inline const char* typeNameAsString<Vec2i>() { return "vec2i"; }
348 template<> inline const char* typeNameAsString<Vec2s>() { return "vec2s"; }
349 template<> inline const char* typeNameAsString<Vec2d>() { return "vec2d"; }
350 template<> inline const char* typeNameAsString<Vec3U8>() { return "vec3u8"; }
351 template<> inline const char* typeNameAsString<Vec3U16>() { return "vec3u16"; }
352 template<> inline const char* typeNameAsString<Vec3i>() { return "vec3i"; }
353 template<> inline const char* typeNameAsString<Vec3f>() { return "vec3s"; }
354 template<> inline const char* typeNameAsString<Vec3d>() { return "vec3d"; }
355 template<> inline const char* typeNameAsString<std::string>() { return "string"; }
356 template<> inline const char* typeNameAsString<Mat3s>() { return "mat3s"; }
357 template<> inline const char* typeNameAsString<Mat3d>() { return "mat3d"; }
358 template<> inline const char* typeNameAsString<Mat4s>() { return "mat4s"; }
359 template<> inline const char* typeNameAsString<Mat4d>() { return "mat4d"; }
360 template<> inline const char* typeNameAsString<math::Quats>() { return "quats"; }
361 template<> inline const char* typeNameAsString<math::Quatd>() { return "quatd"; }
362 template<> inline const char* typeNameAsString<PointIndex32>() { return "ptidx32"; }
363 template<> inline const char* typeNameAsString<PointIndex64>() { return "ptidx64"; }
364 template<> inline const char* typeNameAsString<PointDataIndex32>() { return "ptdataidx32"; }
365 template<> inline const char* typeNameAsString<PointDataIndex64>() { return "ptdataidx64"; }
366
367
369
370
382 template<typename AValueType, typename BValueType = AValueType>
383 class CombineArgs
384 {
385 public:
386 using AValueT = AValueType;
387 using BValueT = BValueType;
388
389 CombineArgs()
390 : mAValPtr(nullptr)
391 , mBValPtr(nullptr)
392 , mResultValPtr(&mResultVal)
393 , mAIsActive(false)
394 , mBIsActive(false)
395 , mResultIsActive(false)
396 {
397 }
398
400 CombineArgs(const AValueType& a, const BValueType& b, AValueType& result,
401 bool aOn = false, bool bOn = false)
402 : mAValPtr(&a)
403 , mBValPtr(&b)
404 , mResultValPtr(&result)
405 , mAIsActive(aOn)
406 , mBIsActive(bOn)
407 {
408 this->updateResultActive();
409 }
410
412 CombineArgs(const AValueType& a, const BValueType& b, bool aOn = false, bool bOn = false)
413 : mAValPtr(&a)
414 , mBValPtr(&b)
415 , mResultValPtr(&mResultVal)
416 , mAIsActive(aOn)
417 , mBIsActive(bOn)
418 {
419 this->updateResultActive();
420 }
421
423 const AValueType& a() const { return *mAValPtr; }
425 const BValueType& b() const { return *mBValPtr; }
427 const AValueType& result() const { return *mResultValPtr; }
429 AValueType& result() { return *mResultValPtr; }
431
433 CombineArgs& setResult(const AValueType& val) { *mResultValPtr = val; return *this; }
434
436 CombineArgs& setARef(const AValueType& a) { mAValPtr = &a; return *this; }
438 CombineArgs& setBRef(const BValueType& b) { mBValPtr = &b; return *this; }
440 CombineArgs& setResultRef(AValueType& val) { mResultValPtr = &val; return *this; }
441
443 bool aIsActive() const { return mAIsActive; }
445 bool bIsActive() const { return mBIsActive; }
447 bool resultIsActive() const { return mResultIsActive; }
448
450 CombineArgs& setAIsActive(bool b) { mAIsActive = b; updateResultActive(); return *this; }
452 CombineArgs& setBIsActive(bool b) { mBIsActive = b; updateResultActive(); return *this; }
454 CombineArgs& setResultIsActive(bool b) { mResultIsActive = b; return *this; }
455
456 protected:
459 void updateResultActive() { mResultIsActive = mAIsActive || mBIsActive; }
460
461 const AValueType* mAValPtr; // pointer to input value from A grid
462 const BValueType* mBValPtr; // pointer to input value from B grid
463 AValueType mResultVal; // computed output value (unused if stored externally)
464 AValueType* mResultValPtr; // pointer to either mResultVal or an external value
465 bool mAIsActive, mBIsActive; // active states of A and B values
466 bool mResultIsActive; // computed active state (default: A active || B active)
467 };
468
469
473 template<typename ValueType, typename CombineOp>
474 struct SwappedCombineOp
475 {
476 SwappedCombineOp(CombineOp& _op): op(_op) {}
477
478 void operator()(CombineArgs<ValueType>& args)
479 {
480 CombineArgs<ValueType> swappedArgs(args.b(), args.a(), args.result(),
481 args.bIsActive(), args.aIsActive());
482 op(swappedArgs);
483 }
484
485 CombineOp& op;
486 };
487
488
490
491
492 #if OPENVDB_ABI_VERSION_NUMBER <= 3
493 enum CopyPolicy { CP_NEW, CP_SHARE, CP_COPY };
507 #endif
508
509
512 class ShallowCopy {};
515 class TopologyCopy {};
517 class PartialCreate {};
518
519 } // namespace OPENVDB_VERSION_NAME
520 } // namespace openvdb
521
522
523 #if defined(__ICC)
524
525 // Use these defines to bracket a region of code that has safe static accesses.
526 // Keep the region as small as possible.
527 #define OPENVDB_START_THREADSAFE_STATIC_REFERENCE __pragma(warning(disable:1710))
528 #define OPENVDB_FINISH_THREADSAFE_STATIC_REFERENCE __pragma(warning(default:1710))
529 #define OPENVDB_START_THREADSAFE_STATIC_WRITE __pragma(warning(disable:1711))
530 #define OPENVDB_FINISH_THREADSAFE_STATIC_WRITE __pragma(warning(default:1711))
531 #define OPENVDB_START_THREADSAFE_STATIC_ADDRESS __pragma(warning(disable:1712))
532 #define OPENVDB_FINISH_THREADSAFE_STATIC_ADDRESS __pragma(warning(default:1712))
533
534 // Use these defines to bracket a region of code that has unsafe static accesses.
535 // Keep the region as small as possible.
536 #define OPENVDB_START_NON_THREADSAFE_STATIC_REFERENCE __pragma(warning(disable:1710))
537 #define OPENVDB_FINISH_NON_THREADSAFE_STATIC_REFERENCE __pragma(warning(default:1710))
538 #define OPENVDB_START_NON_THREADSAFE_STATIC_WRITE __pragma(warning(disable:1711))
539 #define OPENVDB_FINISH_NON_THREADSAFE_STATIC_WRITE __pragma(warning(default:1711))
540 #define OPENVDB_START_NON_THREADSAFE_STATIC_ADDRESS __pragma(warning(disable:1712))
541 #define OPENVDB_FINISH_NON_THREADSAFE_STATIC_ADDRESS __pragma(warning(default:1712))
542
543 // Simpler version for one-line cases
544 #define OPENVDB_THREADSAFE_STATIC_REFERENCE(CODE) \
545 __pragma(warning(disable:1710)); CODE; __pragma(warning(default:1710))
546 #define OPENVDB_THREADSAFE_STATIC_WRITE(CODE) \
547 __pragma(warning(disable:1711)); CODE; __pragma(warning(default:1711))
548 #define OPENVDB_THREADSAFE_STATIC_ADDRESS(CODE) \
549 __pragma(warning(disable:1712)); CODE; __pragma(warning(default:1712))
550
551 #else // GCC does not support these compiler warnings
552
553 #define OPENVDB_START_THREADSAFE_STATIC_REFERENCE
554 #define OPENVDB_FINISH_THREADSAFE_STATIC_REFERENCE
555 #define OPENVDB_START_THREADSAFE_STATIC_WRITE
556 #define OPENVDB_FINISH_THREADSAFE_STATIC_WRITE
557 #define OPENVDB_START_THREADSAFE_STATIC_ADDRESS
558 #define OPENVDB_FINISH_THREADSAFE_STATIC_ADDRESS
559
560 #define OPENVDB_START_NON_THREADSAFE_STATIC_REFERENCE
561 #define OPENVDB_FINISH_NON_THREADSAFE_STATIC_REFERENCE
562 #define OPENVDB_START_NON_THREADSAFE_STATIC_WRITE
563 #define OPENVDB_FINISH_NON_THREADSAFE_STATIC_WRITE
564 #define OPENVDB_START_NON_THREADSAFE_STATIC_ADDRESS
565 #define OPENVDB_FINISH_NON_THREADSAFE_STATIC_ADDRESS
566
567 #define OPENVDB_THREADSAFE_STATIC_REFERENCE(CODE) CODE
568 #define OPENVDB_THREADSAFE_STATIC_WRITE(CODE) CODE
569 #define OPENVDB_THREADSAFE_STATIC_ADDRESS(CODE) CODE
570
571 #endif // defined(__ICC)
572
573 #endif // OPENVDB_TYPES_HAS_BEEN_INCLUDED
574
575 // Copyright (c) 2012-2018 DreamWorks Animation LLC
576 // All rights reserved. This software is distributed under the
577 // Mozilla Public License 2.0 ( http://www.mozilla.org/MPL/2.0/ )
openvdb::v5_1::typeNameAsString< int64_t >
const char * typeNameAsString< int64_t >()
Definition: Types.h:346
openvdb::v5_1::Index32
uint32_t Index32
Definition: Types.h:59
openvdb::v5_1::VEC_CONTRAVARIANT_RELATIVE
Definition: Types.h:306
Vec2.h
openvdb::v5_1::math::Vec4
Definition: Mat4.h:51
openvdb::v5_1::CombineArgs::setARef
CombineArgs & setARef(const AValueType &a)
Redirect the A value to a new external source.
Definition: Types.h:436
openvdb::v5_1::CombineArgs::result
const AValueType & result() const
Get the output value.
Definition: Types.h:428
openvdb::v5_1::CombineArgs::CombineArgs
CombineArgs(const AValueType &a, const BValueType &b, bool aOn=false, bool bOn=false)
Use this constructor when the result value should be stored in this struct.
Definition: Types.h:412
Vec3.h
openvdb::v5_1::PointIndex::IntType
IntType_ IntType
Definition: Types.h:187
openvdb::v5_1::typeNameAsString< Vec3d >
const char * typeNameAsString< Vec3d >()
Definition: Types.h:354
openvdb::v5_1::CombineArgs::setResultIsActive
CombineArgs & setResultIsActive(bool b)
Set the active state of the output value.
Definition: Types.h:454
openvdb::v5_1::typeNameAsString< Vec2i >
const char * typeNameAsString< Vec2i >()
Definition: Types.h:347
openvdb::v5_1::math::CoordBBox
Axis-aligned bounding box of signed integer coordinates.
Definition: Coord.h:264
Math.h
General-purpose arithmetic and comparison routines, most of which accept arbitrary value types (or at...
openvdb::v5_1::Int16
int16_t Int16
Definition: Types.h:62
openvdb::v5_1::SwappedCombineOp
Definition: Types.h:474
openvdb::v5_1::typeNameAsString< double >
const char * typeNameAsString< double >()
Definition: Types.h:340
Coord.h
openvdb::v5_1::VecTraits< math::Vec2< T > >::ElementType
T ElementType
Definition: Types.h:221
openvdb::v5_1::typeNameAsString< ValueMask >
const char * typeNameAsString< ValueMask >()
Definition: Types.h:337
openvdb::v5_1::CombineArgs::a
const AValueType & a() const
Get the A input value.
Definition: Types.h:423
openvdb::v5_1::VecTraits::ElementType
T ElementType
Definition: Types.h:215
openvdb::v5_1::typeNameAsString< uint8_t >
const char * typeNameAsString< uint8_t >()
Definition: Types.h:341
openvdb::v5_1::VecTraits< math::Vec3< T > >::ElementType
T ElementType
Definition: Types.h:227
openvdb::v5_1::CombineArgs::setBIsActive
CombineArgs & setBIsActive(bool b)
Set the active state of the B value.
Definition: Types.h:452
openvdb::v5_1::typeNameAsString< int16_t >
const char * typeNameAsString< int16_t >()
Definition: Types.h:342
openvdb::v5_1::WeakPtr
std::weak_ptr< T > WeakPtr
Definition: Types.h:140
openvdb::v5_1::Real
double Real
Definition: Types.h:67
openvdb::v5_1::CombineArgs::BValueT
BValueType BValueT
Definition: Types.h:387
openvdb::v5_1::math::Mat4< Real >
openvdb::v5_1::typeNameAsString< Vec3f >
const char * typeNameAsString< Vec3f >()
Definition: Types.h:353
openvdb::v5_1::math::Vec4i
Vec4< int32_t > Vec4i
Definition: Vec4.h:584
openvdb::v5_1::typeNameAsString< bool >
const char * typeNameAsString< bool >()
Definition: Types.h:336
Mat4.h
openvdb::v5_1::typeNameAsString< PointDataIndex64 >
const char * typeNameAsString< PointDataIndex64 >()
Definition: Types.h:365
openvdb::v5_1::NUM_VEC_TYPES
Definition: Types.h:309
openvdb::v5_1::CombineArgs::updateResultActive
void updateResultActive()
Definition: Types.h:459
openvdb::v5_1::math::Vec3< Real >
openvdb::v5_1::CombineArgs::CombineArgs
CombineArgs(const AValueType &a, const BValueType &b, AValueType &result, bool aOn=false, bool bOn=false)
Use this constructor when the result value is stored externally.
Definition: Types.h:400
openvdb::v5_1::math::Vec3i
Vec3< int32_t > Vec3i
Definition: Vec3.h:676
openvdb::v5_1::VecTraits
Definition: Types.h:212
openvdb::v5_1::VecTraits< math::Vec4< T > >::ElementType
T ElementType
Definition: Types.h:233
openvdb::v5_1::SharedPtr
std::shared_ptr< T > SharedPtr
Definition: Types.h:139
BBox.h
openvdb::v5_1::typeNameAsString< Mat3s >
const char * typeNameAsString< Mat3s >()
Definition: Types.h:356
openvdb::v5_1::math::Vec2d
Vec2< double > Vec2d
Definition: Vec2.h:559
Mat3.h
Quat.h
openvdb::v5_1::NUM_GRID_CLASSES
Definition: Types.h:278
openvdb::v5_1::GRID_STAGGERED
Definition: Types.h:276
openvdb::v5_1::TopologyCopy
Tag dispatch class that distinguishes topology copy constructors from deep copy constructors.
Definition: Types.h:515
openvdb::v5_1::VEC_INVARIANT
Definition: Types.h:303
openvdb::v5_1::typeNameAsString< Vec2s >
const char * typeNameAsString< Vec2s >()
Definition: Types.h:348
openvdb::v5_1::MERGE_ACTIVE_STATES
Definition: Types.h:326
openvdb::v5_1::PartialCreate
Tag dispatch class that distinguishes constructors during file input.
Definition: Types.h:517
openvdb::v5_1::typeNameAsString< Mat3d >
const char * typeNameAsString< Mat3d >()
Definition: Types.h:357
openvdb::v5_1::math::Quats
Quat< float > Quats
Definition: Quat.h:642
openvdb::v5_1::math::Mat3
3x3 matrix class.
Definition: Mat3.h:55
openvdb::v5_1::CanConvertType
CanConvertType<FromType, ToType>::value is true if a value of type ToType can be constructed from a v...
Definition: Types.h:243
openvdb::v5_1::typeNameAsString< Vec3U16 >
const char * typeNameAsString< Vec3U16 >()
Definition: Types.h:351
openvdb::v5_1::ValueMask
Definition: Types.h:118
openvdb::v5_1::CombineArgs::setResultRef
CombineArgs & setResultRef(AValueType &val)
Redirect the result value to a new external destination.
Definition: Types.h:440
openvdb::v5_1::math::Quat
Definition: Mat.h:196
OPENVDB_VERSION_NAME
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h:136
openvdb::v5_1::StaticPtrCast
SharedPtr< T > StaticPtrCast(const SharedPtr< U > &ptr)
Return a new shared pointer that points to the same object as the given pointer after a static_cast...
Definition: Types.h:171
openvdb::v5_1::CombineArgs::setResult
CombineArgs & setResult(const AValueType &val)
Set the output value.
Definition: Types.h:433
openvdb::v5_1::ShallowCopy
Tag dispatch class that distinguishes shallow copy constructors from deep copy constructors.
Definition: Types.h:512
openvdb::v5_1::VEC_COVARIANT_NORMALIZE
Definition: Types.h:305
openvdb::v5_1::math::Vec3d
Vec3< double > Vec3d
Definition: Vec3.h:679
openvdb::v5_1::typeNameAsString< Vec2d >
const char * typeNameAsString< Vec2d >()
Definition: Types.h:349
openvdb::v5_1::typeNameAsString< Mat4d >
const char * typeNameAsString< Mat4d >()
Definition: Types.h:359
openvdb::v5_1::math::Mat3s
Mat3< float > Mat3s
Definition: Mat3.h:842
openvdb::v5_1::CombineArgs::mAValPtr
const AValueType * mAValPtr
Definition: Types.h:461
openvdb::v5_1::Index64
uint64_t Index64
Definition: Types.h:60
openvdb::v5_1::MergePolicy
MergePolicy
Definition: Types.h:325
openvdb::v5_1::Int32
int32_t Int32
Definition: Types.h:63
openvdb::v5_1::CombineArgs::mBValPtr
const BValueType * mBValPtr
Definition: Types.h:462
openvdb
Definition: Exceptions.h:40
openvdb::v5_1::SwappedCombineOp::SwappedCombineOp
SwappedCombineOp(CombineOp &_op)
Definition: Types.h:476
openvdb::v5_1::Int64
int64_t Int64
Definition: Types.h:64
openvdb::v5_1::typeNameAsString< PointIndex64 >
const char * typeNameAsString< PointIndex64 >()
Definition: Types.h:363
openvdb::v5_1::SwappedCombineOp::operator()
void operator()(CombineArgs< ValueType > &args)
Definition: Types.h:478
openvdb::v5_1::CombineArgs::mResultIsActive
bool mResultIsActive
Definition: Types.h:466
openvdb::v5_1::DynamicPtrCast
SharedPtr< T > DynamicPtrCast(const SharedPtr< U > &ptr)
Return a new shared pointer that is either null or points to the same object as the given pointer aft...
Definition: Types.h:161
openvdb::v5_1::CombineArgs::CombineArgs
CombineArgs()
Definition: Types.h:389
openvdb::v5_1::CombineArgs::setAIsActive
CombineArgs & setAIsActive(bool b)
Set the active state of the A value.
Definition: Types.h:450
openvdb::v5_1::GRID_LEVEL_SET
Definition: Types.h:274
openvdb::v5_1::math::Mat4s
Mat4< float > Mat4s
Definition: Mat4.h:1360
openvdb::v5_1::CombineArgs::AValueT
AValueType AValueT
Definition: Types.h:386
openvdb::v5_1::CombineArgs
This struct collects both input and output arguments to "grid combiner" functors used with the tree::...
Definition: Types.h:383
openvdb::v5_1::CombineArgs::bIsActive
bool bIsActive() const
Definition: Types.h:445
openvdb::v5_1::CombineArgs::mBIsActive
bool mBIsActive
Definition: Types.h:465
openvdb::v5_1::VEC_COVARIANT
Definition: Types.h:304
openvdb::v5_1::Int
Int32 Int
Definition: Types.h:65
openvdb::v5_1::MERGE_NODES
Definition: Types.h:327
version.h
Library and file format version numbers.
openvdb::v5_1::typeNameAsString< uint32_t >
const char * typeNameAsString< uint32_t >()
Definition: Types.h:345
openvdb::v5_1::PointIndex::PointIndex
PointIndex(IntType i=IntType(0))
Definition: Types.h:189
openvdb::v5_1::typeNameAsString< PointIndex32 >
const char * typeNameAsString< PointIndex32 >()
Definition: Types.h:362
openvdb::v5_1::math::Vec3s
Vec3< float > Vec3s
Definition: Vec3.h:678
openvdb::v5_1::typeNameAsString< Vec3U8 >
const char * typeNameAsString< Vec3U8 >()
Definition: Types.h:350
openvdb::v5_1::typeNameAsString< int32_t >
const char * typeNameAsString< int32_t >()
Definition: Types.h:344
openvdb::v5_1::typeNameAsString
const char * typeNameAsString()
Definition: Types.h:335
openvdb::v5_1::CombineArgs::resultIsActive
bool resultIsActive() const
Definition: Types.h:447
openvdb::v5_1::math::Vec4s
Vec4< float > Vec4s
Definition: Vec4.h:586
openvdb::v5_1::VecType
VecType
Definition: Types.h:302
openvdb::v5_1::GRID_UNKNOWN
Definition: Types.h:273
openvdb::v5_1::MERGE_ACTIVE_STATES_AND_NODES
Definition: Types.h:328
openvdb::v5_1::typeNameAsString< uint16_t >
const char * typeNameAsString< uint16_t >()
Definition: Types.h:343
openvdb::v5_1::PointIndex
Integer wrapper, required to distinguish PointIndexGrid and PointDataGrid from Int32Grid and Int64Gri...
Definition: Types.h:183
openvdb::v5_1::math::Coord
Signed (x, y, z) 32-bit integer coordinates.
Definition: Coord.h:51
openvdb::v5_1::math::Vec2
Definition: Vec2.h:50
openvdb::v5_1::math::Quatd
Quat< double > Quatd
Definition: Quat.h:643
openvdb::v5_1::VEC_CONTRAVARIANT_ABSOLUTE
Definition: Types.h:307
openvdb::v5_1::GridClass
GridClass
Definition: Types.h:272
openvdb::v5_1::CombineArgs::setBRef
CombineArgs & setBRef(const BValueType &b)
Redirect the B value to a new external source.
Definition: Types.h:438
openvdb::v5_1::math::Mat4d
Mat4< double > Mat4d
Definition: Mat4.h:1361
openvdb::v5_1::typeNameAsString< half >
const char * typeNameAsString< half >()
Definition: Types.h:338
openvdb::v5_1::typeNameAsString< PointDataIndex32 >
const char * typeNameAsString< PointDataIndex32 >()
Definition: Types.h:364
openvdb::v5_1::CombineArgs::aIsActive
bool aIsActive() const
Definition: Types.h:443
openvdb::v5_1::math::Vec2s
Vec2< float > Vec2s
Definition: Vec2.h:558
openvdb::v5_1::ConstPtrCast
SharedPtr< T > ConstPtrCast(const SharedPtr< U > &ptr)
Return a new shared pointer that points to the same object as the given pointer but with possibly dif...
Definition: Types.h:151
openvdb::v5_1::Index
Index32 Index
Definition: Types.h:61
openvdb::v5_1::Byte
unsigned char Byte
Definition: Types.h:66
OPENVDB_USE_VERSION_NAMESPACE
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:188
openvdb::v5_1::typeNameAsString< float >
const char * typeNameAsString< float >()
Definition: Types.h:339
openvdb::v5_1::GRID_FOG_VOLUME
Definition: Types.h:275
openvdb::v5_1::PointIndex::operator+
PointIndex operator+(T x)
Needed to support the (zeroVal<PointIndex>() + val) idiom.
Definition: Types.h:195
openvdb::v5_1::typeNameAsString< Vec3i >
const char * typeNameAsString< Vec3i >()
Definition: Types.h:352
openvdb::v5_1::typeNameAsString< Mat4s >
const char * typeNameAsString< Mat4s >()
Definition: Types.h:358
openvdb::v5_1::CombineArgs::result
AValueType & result()
Get the output value.
Definition: Types.h:429
openvdb::v5_1::SwappedCombineOp::op
CombineOp & op
Definition: Types.h:485
openvdb::v5_1::math::BBox< Vec3d >
openvdb::v5_1::LEVEL_SET_HALF_WIDTH
static const Real LEVEL_SET_HALF_WIDTH
Definition: Types.h:280
openvdb::v5_1::CombineArgs::mResultValPtr
AValueType * mResultValPtr
Definition: Types.h:464
openvdb::v5_1::math::Vec4d
Vec4< double > Vec4d
Definition: Vec4.h:587
openvdb::v5_1::CombineArgs::b
const BValueType & b() const
Get the B input value.
Definition: Types.h:425
openvdb::v5_1::CombineArgs::mResultVal
AValueType mResultVal
Definition: Types.h:463
Platform.h
Vec4.h
openvdb::v5_1::math::Vec2i
Vec2< int32_t > Vec2i
Definition: Vec2.h:556
openvdb::v5_1::math::Mat3d
Mat3< double > Mat3d
Definition: Mat3.h:843