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 {
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
44 using math::Vec2i;
45 using math::Vec2s;
46 using math::Vec2d;
47 
48 // Three-dimensional vector types
55 using math::Vec3i;
56 using math::Vec3s;
57 using math::Vec3d;
58 
59 using math::Coord;
60 using math::CoordBBox;
62 
63 // Four-dimensional vector types
68 using math::Vec4i;
69 using math::Vec4s;
70 using math::Vec4d;
71 
72 // Three-dimensional matrix types
74 using math::Mat3s;
75 using math::Mat3d;
76 
77 // Four-dimensional matrix types
79 using math::Mat4s;
80 using math::Mat4d;
81 
82 // Quaternions
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>
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 
157 
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 ||
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>
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 ||
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 ||
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>
283 template<typename T>
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 {
457 };
459 
460 static const Real LEVEL_SET_HALF_WIDTH = 3;
461 
482 enum VecType {
488 };
490 
491 
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>
568 {
569 public:
570  using AValueT = AValueType;
571  using BValueT = BValueType;
572 
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>
659 {
660  SwappedCombineOp(CombineOp& _op): op(_op) {}
661 
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
const char * typeNameAsString< uint32_t >()
Definition: Types.h:526
const char * typeNameAsString< Mat3d >()
Definition: Types.h:541
BValueType BValueT
Definition: Types.h:571
const char * typeNameAsString< PointDataIndex64 >()
Definition: Types.h:549
const char * typeNameAsString< uint8_t >()
Definition: Types.h:522
Integer wrapper, required to distinguish PointIndexGrid and PointDataGrid from Int32Grid and Int64Gri...
Definition: Types.h:133
const char * typeNameAsString< float >()
Definition: Types.h:519
static const Real LEVEL_SET_HALF_WIDTH
Definition: Types.h:460
const char * typeNameAsString< Mat4s >()
Definition: Types.h:542
const char * typeNameAsString< half >()
Definition: Types.h:518
Definition: Types.h:507
Definition: Types.h:506
Mat4< double > Mat4d
Definition: Mat4.h:1334
Quat< float > Quats
Definition: Quat.h:619
General-purpose arithmetic and comparison routines, most of which accept arbitrary value types (or at...
AValueType & result()
Get the output value.
Definition: Types.h:613
Vec3< int32_t > Vec3i
Definition: Vec3.h:659
Vec2< float > Vec2s
Definition: Vec2.h:531
Vec3< double > Vec3d
Definition: Vec3.h:662
PointIndex(T i)
Explicit type conversion constructor.
Definition: Types.h:142
PointIndex(IntType i=IntType(0))
Definition: Types.h:139
Definition: Mat.h:169
PointIndex operator+(T x)
Needed to support the (zeroVal<PointIndex>() + val) idiom.
Definition: Types.h:148
bool mResultIsActive
Definition: Types.h:650
bool resultIsActive() const
Definition: Types.h:631
uint32_t Index32
Definition: Types.h:29
Definition: Types.h:483
const char * typeNameAsString< Vec3U16 >()
Definition: Types.h:532
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
const char * typeNameAsString< Vec3d >()
Definition: Types.h:535
std::shared_ptr< T > SharedPtr
Definition: Types.h:91
Mat3< double > Mat3d
Definition: Mat3.h:816
const char * typeNameAsString< Vec4i >()
Definition: Types.h:536
const AValueType & result() const
Get the output value.
Definition: Types.h:612
CanConvertType<FromType, ToType>::value is true if a value of type ToType can be constructed from a v...
Definition: Types.h:262
const AValueType * mAValPtr
Definition: Types.h:645
Definition: Types.h:489
Definition: Vec2.h:23
CombineArgs & setARef(const AValueType &a)
Redirect the A value to a new external source.
Definition: Types.h:620
CombineArgs & setResultRef(AValueType &val)
Redirect the result value to a new external destination.
Definition: Types.h:624
Signed (x, y, z) 32-bit integer coordinates.
Definition: Coord.h:25
AValueType * mResultValPtr
Definition: Types.h:648
double Real
Definition: Types.h:37
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
Vec4< double > Vec4d
Definition: Vec4.h:560
Definition: Types.h:456
Definition: Types.h:88
CombineArgs & setResult(const AValueType &val)
Set the output value.
Definition: Types.h:617
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
CopyConstness<T1, T2>::Type is either const T2 or T2 with no const qualifier, depending on whether T1...
Definition: Types.h:297
const char * typeNameAsString< Vec2i >()
Definition: Types.h:528
void operator()(CombineArgs< ValueType > &args)
Definition: Types.h:662
const char * typeNameAsString< int8_t >()
Definition: Types.h:521
T ElementType
Definition: Types.h:252
const char * typeNameAsString< Vec3i >()
Definition: Types.h:533
typename T::ValueType ElementType
Definition: Types.h:185
Definition: Types.h:458
Vec4< int32_t > Vec4i
Definition: Vec4.h:557
int16_t Int16
Definition: Types.h:32
typename std::remove_const< ToType >::type Type
Definition: Types.h:298
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
int64_t Int64
Definition: Types.h:34
typename T::ValueType ElementType
Definition: Types.h:201
Definition: Types.h:455
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h:102
const char * typeNameAsString< PointIndex32 >()
Definition: Types.h:546
const char * typeNameAsString< PointIndex64 >()
Definition: Types.h:547
int32_t Int32
Definition: Types.h:33
Helper metafunction used to determine if the first template parameter is a specialization of the clas...
Definition: Types.h:169
Quat< double > Quatd
Definition: Quat.h:620
Vec2< double > Vec2d
Definition: Vec2.h:532
Vec2< int32_t > Vec2i
Definition: Vec2.h:529
const char * typeNameAsString< Vec4d >()
Definition: Types.h:538
Definition: Types.h:232
Definition: Mat4.h:24
Definition: Types.h:181
Definition: Exceptions.h:13
Vec4< float > Vec4s
Definition: Vec4.h:559
const char * typeNameAsString< ValueMask >()
Definition: Types.h:517
CombineArgs & setBRef(const BValueType &b)
Redirect the B value to a new external source.
Definition: Types.h:622
typename internal::TSAppendImpl< Self, TypesToAppend... >::type Append
Append types, or the members of another TypeList, to this list.
Definition: Types.h:408
MergePolicy
Definition: Types.h:505
T ElementType
Definition: Types.h:226
AValueType AValueT
Definition: Types.h:570
const char * typeNameAsString< PointDataIndex32 >()
Definition: Types.h:548
VecType
Definition: Types.h:482
Definition: Types.h:484
const char * typeNameAsString< Vec3f >()
Definition: Types.h:534
const char * typeNameAsString< Vec2s >()
Definition: Types.h:529
Definition: Types.h:453
CombineArgs & setAIsActive(bool b)
Set the active state of the A value.
Definition: Types.h:634
Tag dispatch class that distinguishes topology copy constructors from deep copy constructors.
Definition: Types.h:681
CombineArgs & setResultIsActive(bool b)
Set the active state of the output value.
Definition: Types.h:638
const char * typeNameAsString< Mat3s >()
Definition: Types.h:540
CombineArgs()
Definition: Types.h:573
Library and file format version numbers.
const char * typeNameAsString< double >()
Definition: Types.h:520
const char * typeNameAsString< int32_t >()
Definition: Types.h:525
T ElementType
Definition: Types.h:193
SwappedCombineOp(CombineOp &_op)
Definition: Types.h:660
const char * typeNameAsString()
Definition: Types.h:515
void updateResultActive()
Definition: Types.h:643
const char * typeNameAsString< uint16_t >()
Definition: Types.h:524
Int32 Int
Definition: Types.h:35
IntType_ IntType
Definition: Types.h:137
3x3 matrix class.
Definition: Mat3.h:28
const char * typeNameAsString< Vec4f >()
Definition: Types.h:537
Index32 Index
Definition: Types.h:31
const BValueType & b() const
Get the B input value.
Definition: Types.h:609
Vec3< float > Vec3s
Definition: Vec3.h:661
AValueType mResultVal
Definition: Types.h:647
Axis-aligned bounding box of signed integer coordinates.
Definition: Coord.h:248
A list of types (not necessarily unique)
Definition: Types.h:389
Definition: Types.h:214
typename T::ValueType ElementType
Definition: Types.h:240
typename T::ValueType ElementType
Definition: Types.h:218
Definition: Types.h:658
Tag dispatch class that distinguishes constructors during file input.
Definition: Types.h:683
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
const char * typeNameAsString< Vec3U8 >()
Definition: Types.h:531
const AValueType & a() const
Get the A input value.
Definition: Types.h:607
const char * typeNameAsString< bool >()
Definition: Types.h:516
T ElementType
Definition: Types.h:209
uint64_t Index64
Definition: Types.h:30
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
Definition: Types.h:197
GridClass
Definition: Types.h:452
bool mBIsActive
Definition: Types.h:649
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:154
This struct collects both input and output arguments to "grid combiner" functors used with the tree::...
Definition: Types.h:567
const char * typeNameAsString< Mat4d >()
Definition: Types.h:543
std::weak_ptr< T > WeakPtr
Definition: Types.h:92
Mat4< float > Mat4s
Definition: Mat4.h:1333
const BValueType * mBValPtr
Definition: Types.h:646
const char * typeNameAsString< Vec2d >()
Definition: Types.h:530
Mat3< float > Mat3s
Definition: Mat3.h:815
const char * typeNameAsString< int16_t >()
Definition: Types.h:523
unsigned char Byte
Definition: Types.h:36
Definition: Types.h:454
CombineArgs & setBIsActive(bool b)
Set the active state of the B value.
Definition: Types.h:636
Tag dispatch class that distinguishes shallow copy constructors from deep copy constructors.
Definition: Types.h:678
bool aIsActive() const
Definition: Types.h:627
bool bIsActive() const
Definition: Types.h:629
CombineOp & op
Definition: Types.h:669
const char * typeNameAsString< int64_t >()
Definition: Types.h:527