OpenVDB 7.0.0

Types.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_TYPES_HAS_BEEN_INCLUDED
5 #define OPENVDB_TYPES_HAS_BEEN_INCLUDED
6
7 #include "version.h"
8 #include "Platform.h"
9 #include <OpenEXR/half.h>
10 #include <openvdb/math/Math.h>
11 #include <openvdb/math/BBox.h>
12 #include <openvdb/math/Quat.h>
13 #include <openvdb/math/Vec2.h>
14 #include <openvdb/math/Vec3.h>
15 #include <openvdb/math/Vec4.h>
16 #include <openvdb/math/Mat3.h>
17 #include <openvdb/math/Mat4.h>
18 #include <openvdb/math/Coord.h>
19 #include <cstdint>
20 #include <memory>
21 #include <type_traits>
22
23
24 namespace openvdb {
25 OPENVDB_USE_VERSION_NAMESPACE
26 namespace OPENVDB_VERSION_NAME {
27
28 // One-dimensional scalar types
29 using Index32 = uint32_t;
30 using Index64 = uint64_t;
31 using Index = Index32;
32 using Int16 = int16_t;
33 using Int32 = int32_t;
34 using Int64 = int64_t;
35 using Int = Int32;
36 using Byte = unsigned char;
37 using Real = double;
38
39 // Two-dimensional vector types
40 using Vec2R = math::Vec2<Real>;
41 using Vec2I = math::Vec2<Index32>;
42 using Vec2f = math::Vec2<float>;
43 using Vec2H = math::Vec2<half>;
44 using math::Vec2i;
45 using math::Vec2s;
46 using math::Vec2d;
47
48 // Three-dimensional vector types
49 using Vec3R = math::Vec3<Real>;
50 using Vec3I = math::Vec3<Index32>;
51 using Vec3f = math::Vec3<float>;
52 using Vec3H = math::Vec3<half>;
53 using Vec3U8 = math::Vec3<uint8_t>;
54 using Vec3U16 = math::Vec3<uint16_t>;
55 using math::Vec3i;
56 using math::Vec3s;
57 using math::Vec3d;
58
59 using math::Coord;
60 using math::CoordBBox;
61 using BBoxd = math::BBox<Vec3d>;
62
63 // Four-dimensional vector types
64 using Vec4R = math::Vec4<Real>;
65 using Vec4I = math::Vec4<Index32>;
66 using Vec4f = math::Vec4<float>;
67 using Vec4H = math::Vec4<half>;
68 using math::Vec4i;
69 using math::Vec4s;
70 using math::Vec4d;
71
72 // Three-dimensional matrix types
73 using Mat3R = math::Mat3<Real>;
74 using math::Mat3s;
75 using math::Mat3d;
76
77 // Four-dimensional matrix types
78 using Mat4R = math::Mat4<Real>;
79 using math::Mat4s;
80 using math::Mat4d;
81
82 // Quaternions
83 using QuatR = math::Quat<Real>;
84 using math::Quats;
85 using math::Quatd;
86
87 // Dummy type for a voxel with a binary mask value, e.g. the active state
88 class ValueMask {};
89
90 // Use STL shared pointers from OpenVDB 4 on.
91 template<typename T> using SharedPtr = std::shared_ptr<T>;
92 template<typename T> using WeakPtr = std::weak_ptr<T>;
93
102 template<typename T, typename U> inline SharedPtr<T>
103 ConstPtrCast(const SharedPtr<U>& ptr) { return std::const_pointer_cast<T, U>(ptr); }
104
112 template<typename T, typename U> inline SharedPtr<T>
113 DynamicPtrCast(const SharedPtr<U>& ptr) { return std::dynamic_pointer_cast<T, U>(ptr); }
114
122 template<typename T, typename U> inline SharedPtr<T>
123 StaticPtrCast(const SharedPtr<U>& ptr) { return std::static_pointer_cast<T, U>(ptr); }
124
125
127
128
132 template<typename IntType_, Index Kind>
133 struct PointIndex
134 {
135 static_assert(std::is_integral<IntType_>::value, "PointIndex requires an integer value type");
136
137 using IntType = IntType_;
138
139 PointIndex(IntType i = IntType(0)): mIndex(i) {}
140
142 template<typename T> explicit PointIndex(T i): mIndex(static_cast<IntType>(i)) {}
143
144 operator IntType() const { return mIndex; }
145
147 template<typename T>
148 PointIndex operator+(T x) { return PointIndex(mIndex + IntType(x)); }
149
150 private:
151 IntType mIndex;
152 };
153
154
155 using PointIndex32 = PointIndex<Index32, 0>;
156 using PointIndex64 = PointIndex<Index64, 0>;
157
158 using PointDataIndex32 = PointIndex<Index32, 1>;
159 using PointDataIndex64 = PointIndex<Index64, 1>;
160
161
163
164
168 template <typename T, template <typename...> class Template>
169 struct IsSpecializationOf: public std::false_type {};
170
171 template <typename... Args, template <typename...> class Template>
172 struct IsSpecializationOf<Template<Args...>, Template>: public std::true_type {};
173
174
176
177
178 template<typename T, bool = IsSpecializationOf<T, math::Vec2>::value ||
179 IsSpecializationOf<T, math::Vec3>::value ||
180 IsSpecializationOf<T, math::Vec4>::value>
181 struct VecTraits
182 {
183 static const bool IsVec = true;
184 static const int Size = T::size;
185 using ElementType = typename T::ValueType;
186 };
187
188 template<typename T>
189 struct VecTraits<T, false>
190 {
191 static const bool IsVec = false;
192 static const int Size = 1;
193 using ElementType = T;
194 };
195
196 template<typename T, bool = IsSpecializationOf<T, math::Quat>::value>
197 struct QuatTraits
198 {
199 static const bool IsQuat = true;
200 static const int Size = T::size;
201 using ElementType = typename T::ValueType;
202 };
203
204 template<typename T>
205 struct QuatTraits<T, false>
206 {
207 static const bool IsQuat = false;
208 static const int Size = 1;
209 using ElementType = T;
210 };
211
212 template<typename T, bool = IsSpecializationOf<T, math::Mat3>::value ||
213 IsSpecializationOf<T, math::Mat4>::value>
214 struct MatTraits
215 {
216 static const bool IsMat = true;
217 static const int Size = T::size;
218 using ElementType = typename T::ValueType;
219 };
220
221 template<typename T>
222 struct MatTraits<T, false>
223 {
224 static const bool IsMat = false;
225 static const int Size = 1;
226 using ElementType = T;
227 };
228
229 template<typename T, bool = VecTraits<T>::IsVec ||
230 QuatTraits<T>::IsQuat ||
231 MatTraits<T>::IsMat>
232 struct ValueTraits
233 {
234 static const bool IsVec = VecTraits<T>::IsVec;
235 static const bool IsQuat = QuatTraits<T>::IsQuat;
236 static const bool IsMat = MatTraits<T>::IsMat;
237 static const bool IsScalar = false;
238 static const int Size = T::size;
239 static const int Elements = IsMat ? Size*Size : Size;
240 using ElementType = typename T::ValueType;
241 };
242
243 template<typename T>
244 struct ValueTraits<T, false>
245 {
246 static const bool IsVec = false;
247 static const bool IsQuat = false;
248 static const bool IsMat = false;
249 static const bool IsScalar = true;
250 static const int Size = 1;
251 static const int Elements = 1;
252 using ElementType = T;
253 };
254
255
257
258
261 template<typename FromType, typename ToType>
262 struct CanConvertType { enum { value = std::is_constructible<ToType, FromType>::value }; };
263
264 // Specializations for vector types, which can be constructed from values
265 // of their own ValueTypes (or values that can be converted to their ValueTypes),
266 // but only explicitly
267 template<typename T> struct CanConvertType<T, math::Vec2<T> > { enum { value = true }; };
268 template<typename T> struct CanConvertType<T, math::Vec3<T> > { enum { value = true }; };
269 template<typename T> struct CanConvertType<T, math::Vec4<T> > { enum { value = true }; };
270 template<typename T> struct CanConvertType<math::Vec2<T>, math::Vec2<T> > { enum {value = true}; };
271 template<typename T> struct CanConvertType<math::Vec3<T>, math::Vec3<T> > { enum {value = true}; };
272 template<typename T> struct CanConvertType<math::Vec4<T>, math::Vec4<T> > { enum {value = true}; };
273 template<typename T0, typename T1>
274 struct CanConvertType<T0, math::Vec2<T1> > { enum { value = CanConvertType<T0, T1>::value }; };
275 template<typename T0, typename T1>
276 struct CanConvertType<T0, math::Vec3<T1> > { enum { value = CanConvertType<T0, T1>::value }; };
277 template<typename T0, typename T1>
278 struct CanConvertType<T0, math::Vec4<T1> > { enum { value = CanConvertType<T0, T1>::value }; };
279 template<> struct CanConvertType<PointIndex32, PointDataIndex32> { enum {value = true}; };
280 template<> struct CanConvertType<PointDataIndex32, PointIndex32> { enum {value = true}; };
281 template<typename T>
282 struct CanConvertType<T, ValueMask> { enum {value = CanConvertType<T, bool>::value}; };
283 template<typename T>
284 struct CanConvertType<ValueMask, T> { enum {value = CanConvertType<bool, T>::value}; };
285
286
288
289
297 template<typename FromType, typename ToType> struct CopyConstness {
298 using Type = typename std::remove_const<ToType>::type;
299 };
300
302 template<typename FromType, typename ToType> struct CopyConstness<const FromType, ToType> {
303 using Type = const ToType;
304 };
306
307
309
310
312
313 template<typename... Ts> struct TypeList; // forward declaration
314
315 namespace internal {
316
317 // Implementation details of TypeList
318
319 template<typename ListT, typename... Ts> struct TSAppendImpl;
320
321 // Append zero or more types.
322 template<typename... Ts, typename... OtherTs>
323 struct TSAppendImpl<TypeList<Ts...>, OtherTs...> {
324 using type = TypeList<Ts..., OtherTs...>;
325 };
326
327 // Append another TypeList's members.
328 template<typename... Ts, typename... OtherTs>
329 struct TSAppendImpl<TypeList<Ts...>, TypeList<OtherTs...>> {
330 using type = TypeList<Ts..., OtherTs...>;
331 };
332
333
334 // Remove all occurrences of type T.
335 template<typename ListT, typename T> struct TSEraseImpl;
336
337 // TypeList<>::Erase<int> = TypeList<>
338 template<typename T>
339 struct TSEraseImpl<TypeList<>, T> { using type = TypeList<>; };
340
341 // TypeList<int, char, ...>::Erase<int> = TypeList<char, ...>::Erase<int>
342 template<typename... Ts, typename T>
343 struct TSEraseImpl<TypeList<T, Ts...>, T> {
344 using type = typename TSEraseImpl<TypeList<Ts...>, T>::type;
345 };
346
347 // TypeList<float, int, char...>::Erase<int> =
348 // TypeList<float>::Append<TypeList<int, char...>::Erase<int>>
349 template<typename T2, typename... Ts, typename T>
350 struct TSEraseImpl<TypeList<T2, Ts...>, T> {
351 using type = typename TSAppendImpl<TypeList<T2>,
352 typename TSEraseImpl<TypeList<Ts...>, T>::type>::type;
353 };
354
355
356 template<typename ListT, typename... Ts> struct TSRemoveImpl;
357
358 template<typename ListT>
359 struct TSRemoveImpl<ListT> { using type = ListT; };
360
361 // Remove one or more types.
362 template<typename ListT, typename T, typename... Ts>
363 struct TSRemoveImpl<ListT, T, Ts...> {
364 using type = typename TSRemoveImpl<typename TSEraseImpl<ListT, T>::type, Ts...>::type;
365 };
366
367 // Remove the members of another TypeList.
368 template<typename ListT, typename... Ts>
369 struct TSRemoveImpl<ListT, TypeList<Ts...>> {
370 using type = typename TSRemoveImpl<ListT, Ts...>::type;
371 };
372
373
374 template<typename OpT> inline void TSForEachImpl(OpT) {}
375 template<typename OpT, typename T, typename... Ts>
376 inline void TSForEachImpl(OpT op) { op(T()); TSForEachImpl<OpT, Ts...>(op); }
377
378 } // namespace internal
379
381
382
388 template<typename... Ts>
389 struct TypeList
390 {
392 using Self = TypeList;
393
407 template<typename... TypesToAppend>
408 using Append = typename internal::TSAppendImpl<Self, TypesToAppend...>::type;
409
420 template<typename... TypesToRemove>
421 using Remove = typename internal::TSRemoveImpl<Self, TypesToRemove...>::type;
422
443 template<typename OpT>
444 static void foreach(OpT op) { internal::TSForEachImpl<OpT, Ts...>(op); }
445 };
446
447
449
450
451 // Add new items to the *end* of this list, and update NUM_GRID_CLASSES.
452 enum GridClass {
453 GRID_UNKNOWN = 0,
454 GRID_LEVEL_SET,
455 GRID_FOG_VOLUME,
456 GRID_STAGGERED
457 };
458 enum { NUM_GRID_CLASSES = GRID_STAGGERED + 1 };
459
460 static const Real LEVEL_SET_HALF_WIDTH = 3;
461
482 enum VecType {
483 VEC_INVARIANT = 0,
484 VEC_COVARIANT,
485 VEC_COVARIANT_NORMALIZE,
486 VEC_CONTRAVARIANT_RELATIVE,
487 VEC_CONTRAVARIANT_ABSOLUTE
488 };
489 enum { NUM_VEC_TYPES = VEC_CONTRAVARIANT_ABSOLUTE + 1 };
490
491
505 enum MergePolicy {
506 MERGE_ACTIVE_STATES = 0,
507 MERGE_NODES,
508 MERGE_ACTIVE_STATES_AND_NODES
509 };
510
511
513
514
515 template<typename T> const char* typeNameAsString() { return typeid(T).name(); }
516 template<> inline const char* typeNameAsString<bool>() { return "bool"; }
517 template<> inline const char* typeNameAsString<ValueMask>() { return "mask"; }
518 template<> inline const char* typeNameAsString<half>() { return "half"; }
519 template<> inline const char* typeNameAsString<float>() { return "float"; }
520 template<> inline const char* typeNameAsString<double>() { return "double"; }
521 template<> inline const char* typeNameAsString<int8_t>() { return "int8"; }
522 template<> inline const char* typeNameAsString<uint8_t>() { return "uint8"; }
523 template<> inline const char* typeNameAsString<int16_t>() { return "int16"; }
524 template<> inline const char* typeNameAsString<uint16_t>() { return "uint16"; }
525 template<> inline const char* typeNameAsString<int32_t>() { return "int32"; }
526 template<> inline const char* typeNameAsString<uint32_t>() { return "uint32"; }
527 template<> inline const char* typeNameAsString<int64_t>() { return "int64"; }
528 template<> inline const char* typeNameAsString<Vec2i>() { return "vec2i"; }
529 template<> inline const char* typeNameAsString<Vec2s>() { return "vec2s"; }
530 template<> inline const char* typeNameAsString<Vec2d>() { return "vec2d"; }
531 template<> inline const char* typeNameAsString<Vec3U8>() { return "vec3u8"; }
532 template<> inline const char* typeNameAsString<Vec3U16>() { return "vec3u16"; }
533 template<> inline const char* typeNameAsString<Vec3i>() { return "vec3i"; }
534 template<> inline const char* typeNameAsString<Vec3f>() { return "vec3s"; }
535 template<> inline const char* typeNameAsString<Vec3d>() { return "vec3d"; }
536 template<> inline const char* typeNameAsString<Vec4i>() { return "vec4i"; }
537 template<> inline const char* typeNameAsString<Vec4f>() { return "vec4s"; }
538 template<> inline const char* typeNameAsString<Vec4d>() { return "vec4d"; }
539 template<> inline const char* typeNameAsString<std::string>() { return "string"; }
540 template<> inline const char* typeNameAsString<Mat3s>() { return "mat3s"; }
541 template<> inline const char* typeNameAsString<Mat3d>() { return "mat3d"; }
542 template<> inline const char* typeNameAsString<Mat4s>() { return "mat4s"; }
543 template<> inline const char* typeNameAsString<Mat4d>() { return "mat4d"; }
544 template<> inline const char* typeNameAsString<math::Quats>() { return "quats"; }
545 template<> inline const char* typeNameAsString<math::Quatd>() { return "quatd"; }
546 template<> inline const char* typeNameAsString<PointIndex32>() { return "ptidx32"; }
547 template<> inline const char* typeNameAsString<PointIndex64>() { return "ptidx64"; }
548 template<> inline const char* typeNameAsString<PointDataIndex32>() { return "ptdataidx32"; }
549 template<> inline const char* typeNameAsString<PointDataIndex64>() { return "ptdataidx64"; }
550
551
553
554
566 template<typename AValueType, typename BValueType = AValueType>
567 class CombineArgs
568 {
569 public:
570 using AValueT = AValueType;
571 using BValueT = BValueType;
572
573 CombineArgs()
574 : mAValPtr(nullptr)
575 , mBValPtr(nullptr)
576 , mResultValPtr(&mResultVal)
577 , mAIsActive(false)
578 , mBIsActive(false)
579 , mResultIsActive(false)
580 {
581 }
582
584 CombineArgs(const AValueType& a, const BValueType& b, AValueType& result,
585 bool aOn = false, bool bOn = false)
586 : mAValPtr(&a)
587 , mBValPtr(&b)
588 , mResultValPtr(&result)
589 , mAIsActive(aOn)
590 , mBIsActive(bOn)
591 {
592 this->updateResultActive();
593 }
594
596 CombineArgs(const AValueType& a, const BValueType& b, bool aOn = false, bool bOn = false)
597 : mAValPtr(&a)
598 , mBValPtr(&b)
599 , mResultValPtr(&mResultVal)
600 , mAIsActive(aOn)
601 , mBIsActive(bOn)
602 {
603 this->updateResultActive();
604 }
605
607 const AValueType& a() const { return *mAValPtr; }
609 const BValueType& b() const { return *mBValPtr; }
611 const AValueType& result() const { return *mResultValPtr; }
613 AValueType& result() { return *mResultValPtr; }
615
617 CombineArgs& setResult(const AValueType& val) { *mResultValPtr = val; return *this; }
618
620 CombineArgs& setARef(const AValueType& a) { mAValPtr = &a; return *this; }
622 CombineArgs& setBRef(const BValueType& b) { mBValPtr = &b; return *this; }
624 CombineArgs& setResultRef(AValueType& val) { mResultValPtr = &val; return *this; }
625
627 bool aIsActive() const { return mAIsActive; }
629 bool bIsActive() const { return mBIsActive; }
631 bool resultIsActive() const { return mResultIsActive; }
632
634 CombineArgs& setAIsActive(bool b) { mAIsActive = b; updateResultActive(); return *this; }
636 CombineArgs& setBIsActive(bool b) { mBIsActive = b; updateResultActive(); return *this; }
638 CombineArgs& setResultIsActive(bool b) { mResultIsActive = b; return *this; }
639
640 protected:
643 void updateResultActive() { mResultIsActive = mAIsActive || mBIsActive; }
644
645 const AValueType* mAValPtr; // pointer to input value from A grid
646 const BValueType* mBValPtr; // pointer to input value from B grid
647 AValueType mResultVal; // computed output value (unused if stored externally)
648 AValueType* mResultValPtr; // pointer to either mResultVal or an external value
649 bool mAIsActive, mBIsActive; // active states of A and B values
650 bool mResultIsActive; // computed active state (default: A active || B active)
651 };
652
653
657 template<typename ValueType, typename CombineOp>
658 struct SwappedCombineOp
659 {
660 SwappedCombineOp(CombineOp& _op): op(_op) {}
661
662 void operator()(CombineArgs<ValueType>& args)
663 {
664 CombineArgs<ValueType> swappedArgs(args.b(), args.a(), args.result(),
665 args.bIsActive(), args.aIsActive());
666 op(swappedArgs);
667 }
668
669 CombineOp& op;
670 };
671
672
674
675
678 class ShallowCopy {};
681 class TopologyCopy {};
683 class PartialCreate {};
684
685 } // namespace OPENVDB_VERSION_NAME
686 } // namespace openvdb
687
688
689 #if defined(__ICC)
690
691 // Use these defines to bracket a region of code that has safe static accesses.
692 // Keep the region as small as possible.
693 #define OPENVDB_START_THREADSAFE_STATIC_REFERENCE __pragma(warning(disable:1710))
694 #define OPENVDB_FINISH_THREADSAFE_STATIC_REFERENCE __pragma(warning(default:1710))
695 #define OPENVDB_START_THREADSAFE_STATIC_WRITE __pragma(warning(disable:1711))
696 #define OPENVDB_FINISH_THREADSAFE_STATIC_WRITE __pragma(warning(default:1711))
697 #define OPENVDB_START_THREADSAFE_STATIC_ADDRESS __pragma(warning(disable:1712))
698 #define OPENVDB_FINISH_THREADSAFE_STATIC_ADDRESS __pragma(warning(default:1712))
699
700 // Use these defines to bracket a region of code that has unsafe static accesses.
701 // Keep the region as small as possible.
702 #define OPENVDB_START_NON_THREADSAFE_STATIC_REFERENCE __pragma(warning(disable:1710))
703 #define OPENVDB_FINISH_NON_THREADSAFE_STATIC_REFERENCE __pragma(warning(default:1710))
704 #define OPENVDB_START_NON_THREADSAFE_STATIC_WRITE __pragma(warning(disable:1711))
705 #define OPENVDB_FINISH_NON_THREADSAFE_STATIC_WRITE __pragma(warning(default:1711))
706 #define OPENVDB_START_NON_THREADSAFE_STATIC_ADDRESS __pragma(warning(disable:1712))
707 #define OPENVDB_FINISH_NON_THREADSAFE_STATIC_ADDRESS __pragma(warning(default:1712))
708
709 // Simpler version for one-line cases
710 #define OPENVDB_THREADSAFE_STATIC_REFERENCE(CODE) \
711 __pragma(warning(disable:1710)); CODE; __pragma(warning(default:1710))
712 #define OPENVDB_THREADSAFE_STATIC_WRITE(CODE) \
713 __pragma(warning(disable:1711)); CODE; __pragma(warning(default:1711))
714 #define OPENVDB_THREADSAFE_STATIC_ADDRESS(CODE) \
715 __pragma(warning(disable:1712)); CODE; __pragma(warning(default:1712))
716
717 #else // GCC does not support these compiler warnings
718
719 #define OPENVDB_START_THREADSAFE_STATIC_REFERENCE
720 #define OPENVDB_FINISH_THREADSAFE_STATIC_REFERENCE
721 #define OPENVDB_START_THREADSAFE_STATIC_WRITE
722 #define OPENVDB_FINISH_THREADSAFE_STATIC_WRITE
723 #define OPENVDB_START_THREADSAFE_STATIC_ADDRESS
724 #define OPENVDB_FINISH_THREADSAFE_STATIC_ADDRESS
725
726 #define OPENVDB_START_NON_THREADSAFE_STATIC_REFERENCE
727 #define OPENVDB_FINISH_NON_THREADSAFE_STATIC_REFERENCE
728 #define OPENVDB_START_NON_THREADSAFE_STATIC_WRITE
729 #define OPENVDB_FINISH_NON_THREADSAFE_STATIC_WRITE
730 #define OPENVDB_START_NON_THREADSAFE_STATIC_ADDRESS
731 #define OPENVDB_FINISH_NON_THREADSAFE_STATIC_ADDRESS
732
733 #define OPENVDB_THREADSAFE_STATIC_REFERENCE(CODE) CODE
734 #define OPENVDB_THREADSAFE_STATIC_WRITE(CODE) CODE
735 #define OPENVDB_THREADSAFE_STATIC_ADDRESS(CODE) CODE
736
737 #endif // defined(__ICC)
738
739 #endif // OPENVDB_TYPES_HAS_BEEN_INCLUDED
openvdb::v7_0::CanConvertType
CanConvertType<FromType, ToType>::value is true if a value of type ToType can be constructed from a v...
Definition: Types.h:262
openvdb::v7_0::CombineArgs::AValueT
AValueType AValueT
Definition: Types.h:570
openvdb::v7_0::typeNameAsString< Vec3U8 >
const char * typeNameAsString< Vec3U8 >()
Definition: Types.h:531
openvdb::v7_0::QuatTraits::ElementType
typename T::ValueType ElementType
Definition: Types.h:201
openvdb::v7_0::MatTraits
Definition: Types.h:214
openvdb::v7_0::VecType
VecType
Definition: Types.h:482
openvdb::v7_0::MERGE_NODES
Definition: Types.h:507
openvdb::v7_0::CombineArgs::mAValPtr
const AValueType * mAValPtr
Definition: Types.h:645
openvdb::v7_0::QuatTraits
Definition: Types.h:197
openvdb::v7_0::math::Quats
Quat< float > Quats
Definition: Quat.h:619
openvdb::v7_0::typeNameAsString< Vec4d >
const char * typeNameAsString< Vec4d >()
Definition: Types.h:538
openvdb::v7_0::math::Vec3i
Vec3< int32_t > Vec3i
Definition: Vec3.h:659
openvdb::v7_0::math::Vec2
Definition: Vec2.h:23
openvdb::v7_0::VEC_CONTRAVARIANT_ABSOLUTE
Definition: Types.h:487
openvdb::v7_0::typeNameAsString
const char * typeNameAsString()
Definition: Types.h:515
openvdb::v7_0::math::BBox< Vec3d >
openvdb::v7_0::Int16
int16_t Int16
Definition: Types.h:32
openvdb::v7_0::VEC_INVARIANT
Definition: Types.h:483
openvdb::v7_0::typeNameAsString< double >
const char * typeNameAsString< double >()
Definition: Types.h:520
openvdb::v7_0::math::Mat4d
Mat4< double > Mat4d
Definition: Mat4.h:1334
openvdb::v7_0::math::Coord
Signed (x, y, z) 32-bit integer coordinates.
Definition: Coord.h:25
openvdb::v7_0::typeNameAsString< Vec4f >
const char * typeNameAsString< Vec4f >()
Definition: Types.h:537
openvdb::v7_0::ValueTraits::ElementType
typename T::ValueType ElementType
Definition: Types.h:240
openvdb::v7_0::math::Mat3d
Mat3< double > Mat3d
Definition: Mat3.h:816
openvdb::v7_0::GRID_STAGGERED
Definition: Types.h:456
openvdb::v7_0::typeNameAsString< Mat3d >
const char * typeNameAsString< Mat3d >()
Definition: Types.h:541
openvdb::v7_0::math::Quat
Definition: Mat.h:169
openvdb::v7_0::TypeList::Remove
typename internal::TSRemoveImpl< Self, TypesToRemove... >::type Remove
Remove all occurrences of one or more types, or the members of another TypeList, from this list.
Definition: Types.h:421
openvdb::v7_0::CombineArgs::mResultVal
AValueType mResultVal
Definition: Types.h:647
openvdb::v7_0::Int
Int32 Int
Definition: Types.h:35
openvdb::v7_0::CombineArgs::setAIsActive
CombineArgs & setAIsActive(bool b)
Set the active state of the A value.
Definition: Types.h:634
openvdb::v7_0::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:113
openvdb::v7_0::CombineArgs::CombineArgs
CombineArgs()
Definition: Types.h:573
openvdb::v7_0::CombineArgs::setARef
CombineArgs & setARef(const AValueType &a)
Redirect the A value to a new external source.
Definition: Types.h:620
openvdb::v7_0::typeNameAsString< PointDataIndex32 >
const char * typeNameAsString< PointDataIndex32 >()
Definition: Types.h:548
openvdb::v7_0::MergePolicy
MergePolicy
Definition: Types.h:505
version.h
Library and file format version numbers.
openvdb::v7_0::GRID_FOG_VOLUME
Definition: Types.h:455
openvdb::v7_0::math::Vec4i
Vec4< int32_t > Vec4i
Definition: Vec4.h:557
openvdb::v7_0::SwappedCombineOp::SwappedCombineOp
SwappedCombineOp(CombineOp &_op)
Definition: Types.h:660
openvdb::v7_0::math::Vec4s
Vec4< float > Vec4s
Definition: Vec4.h:559
openvdb::v7_0::typeNameAsString< uint32_t >
const char * typeNameAsString< uint32_t >()
Definition: Types.h:526
openvdb::v7_0::WeakPtr
std::weak_ptr< T > WeakPtr
Definition: Types.h:92
openvdb::v7_0::MatTraits::ElementType
typename T::ValueType ElementType
Definition: Types.h:218
Platform.h
openvdb::v7_0::SharedPtr
std::shared_ptr< T > SharedPtr
Definition: Types.h:91
openvdb::v7_0::Real
double Real
Definition: Types.h:37
openvdb::v7_0::CombineArgs::resultIsActive
bool resultIsActive() const
Definition: Types.h:631
openvdb::v7_0::math::Vec4d
Vec4< double > Vec4d
Definition: Vec4.h:560
Vec4.h
openvdb::v7_0::CombineArgs::a
const AValueType & a() const
Get the A input value.
Definition: Types.h:607
openvdb::v7_0::NUM_GRID_CLASSES
Definition: Types.h:458
openvdb::v7_0::math::Vec4
Definition: Mat4.h:24
openvdb::v7_0::math::CoordBBox
Axis-aligned bounding box of signed integer coordinates.
Definition: Coord.h:248
openvdb::v7_0::math::Vec2d
Vec2< double > Vec2d
Definition: Vec2.h:532
openvdb::v7_0::math::Vec3d
Vec3< double > Vec3d
Definition: Vec3.h:662
openvdb::v7_0::typeNameAsString< bool >
const char * typeNameAsString< bool >()
Definition: Types.h:516
openvdb::v7_0::typeNameAsString< Vec2i >
const char * typeNameAsString< Vec2i >()
Definition: Types.h:528
openvdb::v7_0::typeNameAsString< uint16_t >
const char * typeNameAsString< uint16_t >()
Definition: Types.h:524
Vec2.h
openvdb::v7_0::NUM_VEC_TYPES
Definition: Types.h:489
openvdb::v7_0::CombineArgs::setResultRef
CombineArgs & setResultRef(AValueType &val)
Redirect the result value to a new external destination.
Definition: Types.h:624
Vec3.h
openvdb::v7_0::MatTraits< T, false >::ElementType
T ElementType
Definition: Types.h:226
openvdb::v7_0::math::Mat4< Real >
openvdb::v7_0::typeNameAsString< int64_t >
const char * typeNameAsString< int64_t >()
Definition: Types.h:527
openvdb::v7_0::CombineArgs::mBIsActive
bool mBIsActive
Definition: Types.h:649
openvdb::v7_0::VEC_CONTRAVARIANT_RELATIVE
Definition: Types.h:486
openvdb::v7_0::typeNameAsString< PointDataIndex64 >
const char * typeNameAsString< PointDataIndex64 >()
Definition: Types.h:549
openvdb::v7_0::typeNameAsString< Vec3f >
const char * typeNameAsString< Vec3f >()
Definition: Types.h:534
Math.h
General-purpose arithmetic and comparison routines, most of which accept arbitrary value types (or at...
openvdb::v7_0::typeNameAsString< PointIndex32 >
const char * typeNameAsString< PointIndex32 >()
Definition: Types.h:546
openvdb::v7_0::typeNameAsString< ValueMask >
const char * typeNameAsString< ValueMask >()
Definition: Types.h:517
openvdb::v7_0::LEVEL_SET_HALF_WIDTH
static const Real LEVEL_SET_HALF_WIDTH
Definition: Types.h:460
openvdb::v7_0::VecTraits< T, false >::ElementType
T ElementType
Definition: Types.h:193
openvdb::v7_0::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:103
openvdb::v7_0::IsSpecializationOf
Helper metafunction used to determine if the first template parameter is a specialization of the clas...
Definition: Types.h:169
openvdb::v7_0::typeNameAsString< uint8_t >
const char * typeNameAsString< uint8_t >()
Definition: Types.h:522
openvdb::v7_0::math::Quatd
Quat< double > Quatd
Definition: Quat.h:620
openvdb::v7_0::CombineArgs::mBValPtr
const BValueType * mBValPtr
Definition: Types.h:646
openvdb::v7_0::PointIndex::PointIndex
PointIndex(IntType i=IntType(0))
Definition: Types.h:139
openvdb::v7_0::PointIndex::operator+
PointIndex operator+(T x)
Needed to support the (zeroVal<PointIndex>() + val) idiom.
Definition: Types.h:148
openvdb::v7_0::CombineArgs::result
AValueType & result()
Definition: Types.h:613
openvdb::v7_0::VEC_COVARIANT_NORMALIZE
Definition: Types.h:485
openvdb::v7_0::CombineArgs::bIsActive
bool bIsActive() const
Definition: Types.h:629
openvdb::v7_0::SwappedCombineOp::operator()
void operator()(CombineArgs< ValueType > &args)
Definition: Types.h:662
openvdb::v7_0::CombineArgs::mResultIsActive
bool mResultIsActive
Definition: Types.h:650
openvdb::v7_0::typeNameAsString< Mat3s >
const char * typeNameAsString< Mat3s >()
Definition: Types.h:540
openvdb::v7_0::TopologyCopy
Tag dispatch class that distinguishes topology copy constructors from deep copy constructors.
Definition: Types.h:681
openvdb::v7_0::ValueTraits< T, false >::ElementType
T ElementType
Definition: Types.h:252
openvdb::v7_0::CombineArgs::b
const BValueType & b() const
Get the B input value.
Definition: Types.h:609
openvdb::v7_0::typeNameAsString< Vec3U16 >
const char * typeNameAsString< Vec3U16 >()
Definition: Types.h:532
openvdb::v7_0::GRID_UNKNOWN
Definition: Types.h:453
openvdb::v7_0::math::Vec3< Real >
Mat4.h
openvdb::v7_0::typeNameAsString< Vec2d >
const char * typeNameAsString< Vec2d >()
Definition: Types.h:530
openvdb::v7_0::CombineArgs::setBIsActive
CombineArgs & setBIsActive(bool b)
Set the active state of the B value.
Definition: Types.h:636
openvdb::v7_0::typeNameAsString< half >
const char * typeNameAsString< half >()
Definition: Types.h:518
openvdb::v7_0::typeNameAsString< float >
const char * typeNameAsString< float >()
Definition: Types.h:519
openvdb::v7_0::CopyConstness
CopyConstness<T1, T2>::Type is either const T2 or T2 with no const qualifier, depending on whether T1...
Definition: Types.h:297
openvdb::v7_0::PointIndex::PointIndex
PointIndex(T i)
Explicit type conversion constructor.
Definition: Types.h:142
openvdb::v7_0::CombineArgs::setResultIsActive
CombineArgs & setResultIsActive(bool b)
Set the active state of the output value.
Definition: Types.h:638
openvdb::v7_0::typeNameAsString< int16_t >
const char * typeNameAsString< int16_t >()
Definition: Types.h:523
openvdb::v7_0::CombineArgs
This struct collects both input and output arguments to "grid combiner" functors used with the tree::...
Definition: Types.h:567
openvdb::v7_0::CombineArgs::BValueT
BValueType BValueT
Definition: Types.h:571
openvdb::v7_0::math::Mat3
3x3 matrix class.
Definition: Mat3.h:28
openvdb::v7_0::typeNameAsString< Mat4d >
const char * typeNameAsString< Mat4d >()
Definition: Types.h:543
openvdb::v7_0::VecTraits::ElementType
typename T::ValueType ElementType
Definition: Types.h:185
OPENVDB_USE_VERSION_NAMESPACE
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:154
openvdb::v7_0::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:584
Mat3.h
Quat.h
openvdb::v7_0::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:596
openvdb::v7_0::typeNameAsString< Vec3i >
const char * typeNameAsString< Vec3i >()
Definition: Types.h:533
openvdb::v7_0::CombineArgs::setResult
CombineArgs & setResult(const AValueType &val)
Set the output value.
Definition: Types.h:617
openvdb::v7_0::typeNameAsString< Vec2s >
const char * typeNameAsString< Vec2s >()
Definition: Types.h:529
openvdb::v7_0::TypeList::Append
typename internal::TSAppendImpl< Self, TypesToAppend... >::type Append
Append types, or the members of another TypeList, to this list.
Definition: Types.h:408
openvdb::v7_0::CombineArgs::mResultValPtr
AValueType * mResultValPtr
Definition: Types.h:648
openvdb::v7_0::CombineArgs::aIsActive
bool aIsActive() const
Definition: Types.h:627
openvdb::v7_0::typeNameAsString< Vec3d >
const char * typeNameAsString< Vec3d >()
Definition: Types.h:535
openvdb::v7_0::typeNameAsString< PointIndex64 >
const char * typeNameAsString< PointIndex64 >()
Definition: Types.h:547
openvdb::v7_0::VEC_COVARIANT
Definition: Types.h:484
openvdb::v7_0::Index
Index32 Index
Definition: Types.h:31
openvdb::v7_0::PointIndex
Integer wrapper, required to distinguish PointIndexGrid and PointDataGrid from Int32Grid and Int64Gri...
Definition: Types.h:133
openvdb::v7_0::math::Vec2i
Vec2< int32_t > Vec2i
Definition: Vec2.h:529
openvdb::v7_0::ValueTraits
Definition: Types.h:232
openvdb::v7_0::Int64
int64_t Int64
Definition: Types.h:34
openvdb::v7_0::math::Vec3s
Vec3< float > Vec3s
Definition: Vec3.h:661
openvdb::v7_0::SwappedCombineOp
Definition: Types.h:658
openvdb::v7_0::CopyConstness::Type
typename std::remove_const< ToType >::type Type
Definition: Types.h:298
openvdb::v7_0::TypeList
A list of types (not necessarily unique)
Definition: Types.h:389
OPENVDB_VERSION_NAME
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h:102
openvdb::v7_0::MERGE_ACTIVE_STATES_AND_NODES
Definition: Types.h:508
openvdb::v7_0::VecTraits
Definition: Types.h:181
openvdb::v7_0::math::Vec2s
Vec2< float > Vec2s
Definition: Vec2.h:531
openvdb::v7_0::CombineArgs::result
const AValueType & result() const
Get the output value.
Definition: Types.h:612
openvdb::v7_0::Index32
uint32_t Index32
Definition: Types.h:29
BBox.h
openvdb::v7_0::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:123
openvdb::v7_0::CombineArgs::updateResultActive
void updateResultActive()
Definition: Types.h:643
openvdb::v7_0::PartialCreate
Tag dispatch class that distinguishes constructors during file input.
Definition: Types.h:683
openvdb::v7_0::GridClass
GridClass
Definition: Types.h:452
openvdb::v7_0::typeNameAsString< Mat4s >
const char * typeNameAsString< Mat4s >()
Definition: Types.h:542
openvdb::v7_0::GRID_LEVEL_SET
Definition: Types.h:454
openvdb::v7_0::typeNameAsString< int32_t >
const char * typeNameAsString< int32_t >()
Definition: Types.h:525
openvdb::v7_0::math::Mat4s
Mat4< float > Mat4s
Definition: Mat4.h:1333
openvdb
Definition: Exceptions.h:13
openvdb::v7_0::Int32
int32_t Int32
Definition: Types.h:33
openvdb::v7_0::ValueMask
Definition: Types.h:88
openvdb::v7_0::Index64
uint64_t Index64
Definition: Types.h:30
openvdb::v7_0::MERGE_ACTIVE_STATES
Definition: Types.h:506
openvdb::v7_0::math::Mat3s
Mat3< float > Mat3s
Definition: Mat3.h:815
openvdb::v7_0::PointIndex::IntType
IntType_ IntType
Definition: Types.h:137
openvdb::v7_0::typeNameAsString< int8_t >
const char * typeNameAsString< int8_t >()
Definition: Types.h:521
openvdb::v7_0::ShallowCopy
Tag dispatch class that distinguishes shallow copy constructors from deep copy constructors.
Definition: Types.h:678
openvdb::v7_0::CombineArgs::setBRef
CombineArgs & setBRef(const BValueType &b)
Redirect the B value to a new external source.
Definition: Types.h:622
openvdb::v7_0::typeNameAsString< Vec4i >
const char * typeNameAsString< Vec4i >()
Definition: Types.h:536
openvdb::v7_0::Byte
unsigned char Byte
Definition: Types.h:36
openvdb::v7_0::QuatTraits< T, false >::ElementType
T ElementType
Definition: Types.h:209
Coord.h
openvdb::v7_0::SwappedCombineOp::op
CombineOp & op
Definition: Types.h:669