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