HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Types.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////
2 //
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 //
29 ///////////////////////////////////////////////////////////////////////////
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 <hboost/shared_ptr.hpp>
50 #include <hboost/weak_ptr.hpp>
51 #endif
52 
53 
54 namespace openvdb {
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
74 using math::Vec2i;
75 using math::Vec2s;
76 using math::Vec2d;
77 
78 // Three-dimensional vector types
85 using math::Vec3i;
86 using math::Vec3s;
87 using math::Vec3d;
88 
89 using math::Coord;
90 using math::CoordBBox;
92 
93 // Four-dimensional vector types
98 using math::Vec4i;
99 using math::Vec4s;
100 using math::Vec4d;
101 
102 // Three-dimensional matrix types
104 using math::Mat3s;
105 using math::Mat3d;
106 
107 // Four-dimensional matrix types
109 using math::Mat4s;
110 using math::Mat4d;
111 
112 // Quaternions
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 = hboost::shared_ptr<T>;
125 template<typename T> using WeakPtr = hboost::weak_ptr<T>;
126 
127 template<typename T, typename U> inline SharedPtr<T>
128 ConstPtrCast(const SharedPtr<U>& ptr) { return hboost::const_pointer_cast<T, U>(ptr); }
129 
130 template<typename T, typename U> inline SharedPtr<T>
131 DynamicPtrCast(const SharedPtr<U>& ptr) { return hboost::dynamic_pointer_cast<T, U>(ptr); }
132 
133 template<typename T, typename U> inline SharedPtr<T>
134 StaticPtrCast(const SharedPtr<U>& ptr) { return hboost::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 
142 /// @brief Return a new shared pointer that points to the same object
143 /// as the given pointer but with possibly different <TT>const</TT>-ness.
144 /// @par Example:
145 /// @code
146 /// FloatGrid::ConstPtr grid = ...;
147 /// FloatGrid::Ptr nonConstGrid = ConstPtrCast<FloatGrid>(grid);
148 /// FloatGrid::ConstPtr constGrid = ConstPtrCast<const FloatGrid>(nonConstGrid);
149 /// @endcode
150 template<typename T, typename U> inline SharedPtr<T>
151 ConstPtrCast(const SharedPtr<U>& ptr) { return std::const_pointer_cast<T, U>(ptr); }
152 
153 /// @brief Return a new shared pointer that is either null or points to
154 /// the same object as the given pointer after a @c dynamic_cast.
155 /// @par Example:
156 /// @code
157 /// GridBase::ConstPtr grid = ...;
158 /// FloatGrid::ConstPtr floatGrid = DynamicPtrCast<const FloatGrid>(grid);
159 /// @endcode
160 template<typename T, typename U> inline SharedPtr<T>
161 DynamicPtrCast(const SharedPtr<U>& ptr) { return std::dynamic_pointer_cast<T, U>(ptr); }
162 
163 /// @brief Return a new shared pointer that points to the same object
164 /// as the given pointer after a @c static_cast.
165 /// @par Example:
166 /// @code
167 /// FloatGrid::Ptr floatGrid = ...;
168 /// GridBase::Ptr grid = StaticPtrCast<GridBase>(floatGrid);
169 /// @endcode
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 
176 ////////////////////////////////////////
177 
178 
179 /// @brief Integer wrapper, required to distinguish PointIndexGrid and
180 /// PointDataGrid from Int32Grid and Int64Grid
181 /// @note @c Kind is a dummy parameter used to create distinct types.
182 template<typename IntType_, Index Kind>
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  /// Explicit type conversion constructor
192  template<typename T> explicit PointIndex(T i): mIndex(static_cast<IntType>(i)) {}
193 
194  operator IntType() const { return mIndex; }
195 
196  /// Needed to support the <tt>(zeroVal<PointIndex>() + val)</tt> idiom.
197  template<typename T>
198  PointIndex operator+(T x) { return PointIndex(mIndex + IntType(x)); }
199 
200 private:
201  IntType mIndex;
202 };
203 
204 
207 
210 
211 
212 ////////////////////////////////////////
213 
214 
215 template<typename T> struct VecTraits {
216  static const bool IsVec = false;
217  static const int Size = 1;
218  using ElementType = T;
219 };
220 
221 template<typename T> struct VecTraits<math::Vec2<T> > {
222  static const bool IsVec = true;
223  static const int Size = 2;
224  using ElementType = T;
225 };
226 
227 template<typename T> struct VecTraits<math::Vec3<T> > {
228  static const bool IsVec = true;
229  static const int Size = 3;
230  using ElementType = T;
231 };
232 
233 template<typename T> struct VecTraits<math::Vec4<T> > {
234  static const bool IsVec = true;
235  static const int Size = 4;
236  using ElementType = T;
237 };
238 
239 
240 ////////////////////////////////////////
241 
242 
243 /// @brief CanConvertType<FromType, ToType>::value is @c true if a value
244 /// of type @a ToType can be constructed from a value of type @a FromType.
245 template<typename FromType, typename ToType>
247 
248 // Specializations for vector types, which can be constructed from values
249 // of their own ValueTypes (or values that can be converted to their ValueTypes),
250 // but only explicitly
251 template<typename T> struct CanConvertType<T, math::Vec2<T> > { enum { value = true }; };
252 template<typename T> struct CanConvertType<T, math::Vec3<T> > { enum { value = true }; };
253 template<typename T> struct CanConvertType<T, math::Vec4<T> > { enum { value = true }; };
254 template<typename T> struct CanConvertType<math::Vec2<T>, math::Vec2<T> > { enum {value = true}; };
255 template<typename T> struct CanConvertType<math::Vec3<T>, math::Vec3<T> > { enum {value = true}; };
256 template<typename T> struct CanConvertType<math::Vec4<T>, math::Vec4<T> > { enum {value = true}; };
257 template<typename T0, typename T1>
258 struct CanConvertType<T0, math::Vec2<T1> > { enum { value = CanConvertType<T0, T1>::value }; };
259 template<typename T0, typename T1>
260 struct CanConvertType<T0, math::Vec3<T1> > { enum { value = CanConvertType<T0, T1>::value }; };
261 template<typename T0, typename T1>
262 struct CanConvertType<T0, math::Vec4<T1> > { enum { value = CanConvertType<T0, T1>::value }; };
263 template<> struct CanConvertType<PointIndex32, PointDataIndex32> { enum {value = true}; };
264 template<> struct CanConvertType<PointDataIndex32, PointIndex32> { enum {value = true}; };
265 template<typename T>
267 template<typename T>
269 
270 
271 ////////////////////////////////////////
272 
273 
274 // Add new items to the *end* of this list, and update NUM_GRID_CLASSES.
275 enum GridClass {
280 };
282 
283 static const Real LEVEL_SET_HALF_WIDTH = 3;
284 
285 /// The type of a vector determines how transforms are applied to it:
286 /// <dl>
287 /// <dt><b>Invariant</b>
288 /// <dd>Does not transform (e.g., tuple, uvw, color)
289 ///
290 /// <dt><b>Covariant</b>
291 /// <dd>Apply inverse-transpose transformation: @e w = 0, ignores translation
292 /// (e.g., gradient/normal)
293 ///
294 /// <dt><b>Covariant Normalize</b>
295 /// <dd>Apply inverse-transpose transformation: @e w = 0, ignores translation,
296 /// vectors are renormalized (e.g., unit normal)
297 ///
298 /// <dt><b>Contravariant Relative</b>
299 /// <dd>Apply "regular" transformation: @e w = 0, ignores translation
300 /// (e.g., displacement, velocity, acceleration)
301 ///
302 /// <dt><b>Contravariant Absolute</b>
303 /// <dd>Apply "regular" transformation: @e w = 1, vector translates (e.g., position)
304 /// </dl>
305 enum VecType {
311 };
313 
314 
315 /// Specify how grids should be merged during certain (typically multithreaded) operations.
316 /// <dl>
317 /// <dt><b>MERGE_ACTIVE_STATES</b>
318 /// <dd>The output grid is active wherever any of the input grids is active.
319 ///
320 /// <dt><b>MERGE_NODES</b>
321 /// <dd>The output grid's tree has a node wherever any of the input grids' trees
322 /// has a node, regardless of any active states.
323 ///
324 /// <dt><b>MERGE_ACTIVE_STATES_AND_NODES</b>
325 /// <dd>The output grid is active wherever any of the input grids is active,
326 /// and its tree has a node wherever any of the input grids' trees has a node.
327 /// </dl>
332 };
333 
334 
335 ////////////////////////////////////////
336 
337 
338 template<typename T> const char* typeNameAsString() { return typeid(T).name(); }
339 template<> inline const char* typeNameAsString<bool>() { return "bool"; }
340 template<> inline const char* typeNameAsString<ValueMask>() { return "mask"; }
341 template<> inline const char* typeNameAsString<half>() { return "half"; }
342 template<> inline const char* typeNameAsString<float>() { return "float"; }
343 template<> inline const char* typeNameAsString<double>() { return "double"; }
344 template<> inline const char* typeNameAsString<uint8_t>() { return "uint8"; }
345 template<> inline const char* typeNameAsString<int16_t>() { return "int16"; }
346 template<> inline const char* typeNameAsString<uint16_t>() { return "uint16"; }
347 template<> inline const char* typeNameAsString<int32_t>() { return "int32"; }
348 template<> inline const char* typeNameAsString<uint32_t>() { return "uint32"; }
349 template<> inline const char* typeNameAsString<int64_t>() { return "int64"; }
350 template<> inline const char* typeNameAsString<Vec2i>() { return "vec2i"; }
351 template<> inline const char* typeNameAsString<Vec2s>() { return "vec2s"; }
352 template<> inline const char* typeNameAsString<Vec2d>() { return "vec2d"; }
353 template<> inline const char* typeNameAsString<Vec3U8>() { return "vec3u8"; }
354 template<> inline const char* typeNameAsString<Vec3U16>() { return "vec3u16"; }
355 template<> inline const char* typeNameAsString<Vec3i>() { return "vec3i"; }
356 template<> inline const char* typeNameAsString<Vec3f>() { return "vec3s"; }
357 template<> inline const char* typeNameAsString<Vec3d>() { return "vec3d"; }
358 template<> inline const char* typeNameAsString<std::string>() { return "string"; }
359 template<> inline const char* typeNameAsString<Mat3s>() { return "mat3s"; }
360 template<> inline const char* typeNameAsString<Mat3d>() { return "mat3d"; }
361 template<> inline const char* typeNameAsString<Mat4s>() { return "mat4s"; }
362 template<> inline const char* typeNameAsString<Mat4d>() { return "mat4d"; }
363 template<> inline const char* typeNameAsString<math::Quats>() { return "quats"; }
364 template<> inline const char* typeNameAsString<math::Quatd>() { return "quatd"; }
365 template<> inline const char* typeNameAsString<PointIndex32>() { return "ptidx32"; }
366 template<> inline const char* typeNameAsString<PointIndex64>() { return "ptidx64"; }
367 template<> inline const char* typeNameAsString<PointDataIndex32>() { return "ptdataidx32"; }
368 template<> inline const char* typeNameAsString<PointDataIndex64>() { return "ptdataidx64"; }
369 
370 
371 ////////////////////////////////////////
372 
373 
374 /// @brief This struct collects both input and output arguments to "grid combiner" functors
375 /// used with the tree::TypedGrid::combineExtended() and combine2Extended() methods.
376 /// AValueType and BValueType are the value types of the two grids being combined.
377 ///
378 /// @see openvdb/tree/Tree.h for usage information.
379 ///
380 /// Setter methods return references to this object, to facilitate the following usage:
381 /// @code
382 /// CombineArgs<float> args;
383 /// myCombineOp(args.setARef(aVal).setBRef(bVal).setAIsActive(true).setBIsActive(false));
384 /// @endcode
385 template<typename AValueType, typename BValueType = AValueType>
387 {
388 public:
389  using AValueT = AValueType;
390  using BValueT = BValueType;
391 
393  : mAValPtr(nullptr)
394  , mBValPtr(nullptr)
396  , mAIsActive(false)
397  , mBIsActive(false)
398  , mResultIsActive(false)
399  {
400  }
401 
402  /// Use this constructor when the result value is stored externally.
403  CombineArgs(const AValueType& a, const BValueType& b, AValueType& result,
404  bool aOn = false, bool bOn = false)
405  : mAValPtr(&a)
406  , mBValPtr(&b)
407  , mResultValPtr(&result)
408  , mAIsActive(aOn)
409  , mBIsActive(bOn)
410  {
411  this->updateResultActive();
412  }
413 
414  /// Use this constructor when the result value should be stored in this struct.
415  CombineArgs(const AValueType& a, const BValueType& b, bool aOn = false, bool bOn = false)
416  : mAValPtr(&a)
417  , mBValPtr(&b)
419  , mAIsActive(aOn)
420  , mBIsActive(bOn)
421  {
422  this->updateResultActive();
423  }
424 
425  /// Get the A input value.
426  const AValueType& a() const { return *mAValPtr; }
427  /// Get the B input value.
428  const BValueType& b() const { return *mBValPtr; }
429  //@{
430  /// Get the output value.
431  const AValueType& result() const { return *mResultValPtr; }
432  AValueType& result() { return *mResultValPtr; }
433  //@}
434 
435  /// Set the output value.
436  CombineArgs& setResult(const AValueType& val) { *mResultValPtr = val; return *this; }
437 
438  /// Redirect the A value to a new external source.
439  CombineArgs& setARef(const AValueType& a) { mAValPtr = &a; return *this; }
440  /// Redirect the B value to a new external source.
441  CombineArgs& setBRef(const BValueType& b) { mBValPtr = &b; return *this; }
442  /// Redirect the result value to a new external destination.
443  CombineArgs& setResultRef(AValueType& val) { mResultValPtr = &val; return *this; }
444 
445  /// @return true if the A value is active
446  bool aIsActive() const { return mAIsActive; }
447  /// @return true if the B value is active
448  bool bIsActive() const { return mBIsActive; }
449  /// @return true if the output value is active
450  bool resultIsActive() const { return mResultIsActive; }
451 
452  /// Set the active state of the A value.
453  CombineArgs& setAIsActive(bool b) { mAIsActive = b; updateResultActive(); return *this; }
454  /// Set the active state of the B value.
455  CombineArgs& setBIsActive(bool b) { mBIsActive = b; updateResultActive(); return *this; }
456  /// Set the active state of the output value.
457  CombineArgs& setResultIsActive(bool b) { mResultIsActive = b; return *this; }
458 
459 protected:
460  /// By default, the result value is active if either of the input values is active,
461  /// but this behavior can be overridden by calling setResultIsActive().
463 
464  const AValueType* mAValPtr; // pointer to input value from A grid
465  const BValueType* mBValPtr; // pointer to input value from B grid
466  AValueType mResultVal; // computed output value (unused if stored externally)
467  AValueType* mResultValPtr; // pointer to either mResultVal or an external value
468  bool mAIsActive, mBIsActive; // active states of A and B values
469  bool mResultIsActive; // computed active state (default: A active || B active)
470 };
471 
472 
473 /// This struct adapts a "grid combiner" functor to swap the A and B grid values
474 /// (e.g., so that if the original functor computes a + 2 * b, the adapted functor
475 /// will compute b + 2 * a).
476 template<typename ValueType, typename CombineOp>
478 {
479  SwappedCombineOp(CombineOp& _op): op(_op) {}
480 
482  {
483  CombineArgs<ValueType> swappedArgs(args.b(), args.a(), args.result(),
484  args.bIsActive(), args.aIsActive());
485  op(swappedArgs);
486  }
487 
488  CombineOp& op;
489 };
490 
491 
492 ////////////////////////////////////////
493 
494 
495 #if OPENVDB_ABI_VERSION_NUMBER <= 3
496 /// In copy constructors, members stored as shared pointers can be handled
497 /// in several ways:
498 /// <dl>
499 /// <dt><b>CP_NEW</b>
500 /// <dd>Don't copy the member; default construct a new member object instead.
501 ///
502 /// <dt><b>CP_SHARE</b>
503 /// <dd>Copy the shared pointer, so that the original and new objects share
504 /// the same member.
505 ///
506 /// <dt><b>CP_COPY</b>
507 /// <dd>Create a deep copy of the member.
508 /// </dl>
509 enum CopyPolicy { CP_NEW, CP_SHARE, CP_COPY };
510 #endif
511 
512 
513 /// @brief Tag dispatch class that distinguishes shallow copy constructors
514 /// from deep copy constructors
515 class ShallowCopy {};
516 /// @brief Tag dispatch class that distinguishes topology copy constructors
517 /// from deep copy constructors
518 class TopologyCopy {};
519 /// @brief Tag dispatch class that distinguishes constructors during file input
520 class PartialCreate {};
521 
522 } // namespace OPENVDB_VERSION_NAME
523 } // namespace openvdb
524 
525 
526 #if defined(__ICC)
527 
528 // Use these defines to bracket a region of code that has safe static accesses.
529 // Keep the region as small as possible.
530 #define OPENVDB_START_THREADSAFE_STATIC_REFERENCE __pragma(warning(disable:1710))
531 #define OPENVDB_FINISH_THREADSAFE_STATIC_REFERENCE __pragma(warning(default:1710))
532 #define OPENVDB_START_THREADSAFE_STATIC_WRITE __pragma(warning(disable:1711))
533 #define OPENVDB_FINISH_THREADSAFE_STATIC_WRITE __pragma(warning(default:1711))
534 #define OPENVDB_START_THREADSAFE_STATIC_ADDRESS __pragma(warning(disable:1712))
535 #define OPENVDB_FINISH_THREADSAFE_STATIC_ADDRESS __pragma(warning(default:1712))
536 
537 // Use these defines to bracket a region of code that has unsafe static accesses.
538 // Keep the region as small as possible.
539 #define OPENVDB_START_NON_THREADSAFE_STATIC_REFERENCE __pragma(warning(disable:1710))
540 #define OPENVDB_FINISH_NON_THREADSAFE_STATIC_REFERENCE __pragma(warning(default:1710))
541 #define OPENVDB_START_NON_THREADSAFE_STATIC_WRITE __pragma(warning(disable:1711))
542 #define OPENVDB_FINISH_NON_THREADSAFE_STATIC_WRITE __pragma(warning(default:1711))
543 #define OPENVDB_START_NON_THREADSAFE_STATIC_ADDRESS __pragma(warning(disable:1712))
544 #define OPENVDB_FINISH_NON_THREADSAFE_STATIC_ADDRESS __pragma(warning(default:1712))
545 
546 // Simpler version for one-line cases
547 #define OPENVDB_THREADSAFE_STATIC_REFERENCE(CODE) \
548  __pragma(warning(disable:1710)); CODE; __pragma(warning(default:1710))
549 #define OPENVDB_THREADSAFE_STATIC_WRITE(CODE) \
550  __pragma(warning(disable:1711)); CODE; __pragma(warning(default:1711))
551 #define OPENVDB_THREADSAFE_STATIC_ADDRESS(CODE) \
552  __pragma(warning(disable:1712)); CODE; __pragma(warning(default:1712))
553 
554 #else // GCC does not support these compiler warnings
555 
556 #define OPENVDB_START_THREADSAFE_STATIC_REFERENCE
557 #define OPENVDB_FINISH_THREADSAFE_STATIC_REFERENCE
558 #define OPENVDB_START_THREADSAFE_STATIC_WRITE
559 #define OPENVDB_FINISH_THREADSAFE_STATIC_WRITE
560 #define OPENVDB_START_THREADSAFE_STATIC_ADDRESS
561 #define OPENVDB_FINISH_THREADSAFE_STATIC_ADDRESS
562 
563 #define OPENVDB_START_NON_THREADSAFE_STATIC_REFERENCE
564 #define OPENVDB_FINISH_NON_THREADSAFE_STATIC_REFERENCE
565 #define OPENVDB_START_NON_THREADSAFE_STATIC_WRITE
566 #define OPENVDB_FINISH_NON_THREADSAFE_STATIC_WRITE
567 #define OPENVDB_START_NON_THREADSAFE_STATIC_ADDRESS
568 #define OPENVDB_FINISH_NON_THREADSAFE_STATIC_ADDRESS
569 
570 #define OPENVDB_THREADSAFE_STATIC_REFERENCE(CODE) CODE
571 #define OPENVDB_THREADSAFE_STATIC_WRITE(CODE) CODE
572 #define OPENVDB_THREADSAFE_STATIC_ADDRESS(CODE) CODE
573 
574 #endif // defined(__ICC)
575 
576 #endif // OPENVDB_TYPES_HAS_BEEN_INCLUDED
577 
578 // Copyright (c) 2012-2018 DreamWorks Animation LLC
579 // All rights reserved. This software is distributed under the
580 // Mozilla Public License 2.0 ( http://www.mozilla.org/MPL/2.0/ )
const AValueType & result() const
Get the output value.
Definition: Types.h:431
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
PointIndex operator+(T x)
Needed to support the (zeroVal<PointIndex>() + val) idiom.
Definition: Types.h:198
const char * typeNameAsString< ValueMask >()
Definition: Types.h:340
This struct collects both input and output arguments to "grid combiner" functors used with the tree::...
Definition: Types.h:386
Tag dispatch class that distinguishes shallow copy constructors from deep copy constructors.
Definition: Types.h:515
const char * typeNameAsString< PointIndex32 >()
Definition: Types.h:365
const char * typeNameAsString< int32_t >()
Definition: Types.h:347
const char * typeNameAsString< Vec3i >()
Definition: Types.h:355
const char * typeNameAsString< uint16_t >()
Definition: Types.h:346
png_voidp ptr
Definition: png.h:2145
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:415
CombineArgs & setBIsActive(bool b)
Set the active state of the B value.
Definition: Types.h:455
const char * typeNameAsString< int16_t >()
Definition: Types.h:345
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1221
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:189
const char * typeNameAsString< Mat3s >()
Definition: Types.h:359
const char * typeNameAsString< half >()
Definition: Types.h:341
Signed (x, y, z) 32-bit integer coordinates.
Definition: Coord.h:51
png_uint_32 i
Definition: png.h:2877
Tag dispatch class that distinguishes constructors during file input.
Definition: Types.h:520
const char * typeNameAsString< PointIndex64 >()
Definition: Types.h:366
const char * typeNameAsString< Vec3d >()
Definition: Types.h:357
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
const char * typeNameAsString< Mat4s >()
Definition: Types.h:361
std::shared_ptr< T > SharedPtr
Definition: Types.h:139
const AValueType & a() const
Get the A input value.
Definition: Types.h:426
const char * typeNameAsString< Vec3U16 >()
Definition: Types.h:354
const char * typeNameAsString< Vec3f >()
Definition: Types.h:356
const char * typeNameAsString< PointDataIndex32 >()
Definition: Types.h:367
const char * typeNameAsString< uint32_t >()
Definition: Types.h:348
std::weak_ptr< T > WeakPtr
Definition: Types.h:140
PointIndex(T i)
Explicit type conversion constructor.
Definition: Types.h:192
const char * typeNameAsString< uint8_t >()
Definition: Types.h:344
const char * typeNameAsString< float >()
Definition: Types.h:342
const char * typeNameAsString< Vec2i >()
Definition: Types.h:350
General-purpose arithmetic and comparison routines, most of which accept arbitrary value types (or at...
CombineArgs & setAIsActive(bool b)
Set the active state of the A value.
Definition: Types.h:453
const char * typeNameAsString()
Definition: Types.h:338
const char * typeNameAsString< int64_t >()
Definition: Types.h:349
Axis-aligned bounding box of signed integer coordinates.
Definition: Coord.h:264
GLuint const GLchar * name
Definition: glcorearb.h:785
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1221
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:403
CombineArgs & setResultIsActive(bool b)
Set the active state of the output value.
Definition: Types.h:457
const char * typeNameAsString< double >()
Definition: Types.h:343
CanConvertType<FromType, ToType>::value is true if a value of type ToType can be constructed from a v...
Definition: Types.h:246
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
GLsizei const GLfloat * value
Definition: glcorearb.h:823
const char * typeNameAsString< bool >()
Definition: Types.h:339
AValueType & result()
Get the output value.
Definition: Types.h:432
CombineArgs & setBRef(const BValueType &b)
Redirect the B value to a new external source.
Definition: Types.h:441
const char * typeNameAsString< Mat4d >()
Definition: Types.h:362
CombineArgs & setResultRef(AValueType &val)
Redirect the result value to a new external destination.
Definition: Types.h:443
const char * typeNameAsString< Vec3U8 >()
Definition: Types.h:353
const char * typeNameAsString< Vec2d >()
Definition: Types.h:352
GLint GLenum GLint x
Definition: glcorearb.h:408
GLuint GLfloat * val
Definition: glcorearb.h:1607
void operator()(CombineArgs< ValueType > &args)
Definition: Types.h:481
unsigned char Byte
Definition: Types.h:66
CombineArgs & setARef(const AValueType &a)
Redirect the A value to a new external source.
Definition: Types.h:439
Integer wrapper, required to distinguish PointIndexGrid and PointDataGrid from Int32Grid and Int64Gri...
Definition: Types.h:183
Tag dispatch class that distinguishes topology copy constructors from deep copy constructors.
Definition: Types.h:518
const BValueType & b() const
Get the B input value.
Definition: Types.h:428
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h:135
const char * typeNameAsString< PointDataIndex64 >()
Definition: Types.h:368
CombineArgs & setResult(const AValueType &val)
Set the output value.
Definition: Types.h:436
const char * typeNameAsString< Vec2s >()
Definition: Types.h:351
PointIndex(IntType i=IntType(0))
Definition: Types.h:189
const char * typeNameAsString< Mat3d >()
Definition: Types.h:360