OpenVDB: Types.h Source File

OpenVDB 4.0.2

Types.h
Go to the documentation of this file.
1 //
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 //
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 {
51 OPENVDB_USE_VERSION_NAMESPACE
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
66 using Vec2R = math::Vec2<Real>;
67 using Vec2I = math::Vec2<Index32>;
68 using Vec2f = math::Vec2<float>;
69 using Vec2H = math::Vec2<half>;
70 using math::Vec2i;
71 using math::Vec2s;
72 using math::Vec2d;
73
74 // Three-dimensional vector types
75 using Vec3R = math::Vec3<Real>;
76 using Vec3I = math::Vec3<Index32>;
77 using Vec3f = math::Vec3<float>;
78 using Vec3H = math::Vec3<half>;
79 using Vec3U8 = math::Vec3<uint8_t>;
80 using Vec3U16 = math::Vec3<uint16_t>;
81 using math::Vec3i;
82 using math::Vec3s;
83 using math::Vec3d;
84
85 using math::Coord;
86 using math::CoordBBox;
87 using BBoxd = math::BBox<Vec3d>;
88
89 // Four-dimensional vector types
90 using Vec4R = math::Vec4<Real>;
91 using Vec4I = math::Vec4<Index32>;
92 using Vec4f = math::Vec4<float>;
93 using Vec4H = math::Vec4<half>;
94 using math::Vec4i;
95 using math::Vec4s;
96 using math::Vec4d;
97
98 // Three-dimensional matrix types
99 using Mat3R = math::Mat3<Real>;
100
101 // Four-dimensional matrix types
102 using Mat4R = math::Mat4<Real>;
103 using Mat4d = math::Mat4<double>;
104 using Mat4s = math::Mat4<float>;
105
106 // Quaternions
107 using QuatR = math::Quat<Real>;
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 = boost::shared_ptr<T>;
117
118 template<typename T, typename U> inline SharedPtr<T>
119 ConstPtrCast(const SharedPtr<U>& ptr) { return boost::const_pointer_cast<T, U>(ptr); }
120
121 template<typename T, typename U> inline SharedPtr<T>
122 DynamicPtrCast(const SharedPtr<U>& ptr) { return boost::dynamic_pointer_cast<T, U>(ptr); }
123
124 template<typename T, typename U> inline SharedPtr<T>
125 StaticPtrCast(const SharedPtr<U>& ptr) { return boost::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
140 template<typename T, typename U> inline SharedPtr<T>
141 ConstPtrCast(const SharedPtr<U>& ptr) { return std::const_pointer_cast<T, U>(ptr); }
142
150 template<typename T, typename U> inline SharedPtr<T>
151 DynamicPtrCast(const SharedPtr<U>& ptr) { return std::dynamic_pointer_cast<T, U>(ptr); }
152
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
167
168
172 template<typename IntType_, Index Kind>
173 struct PointIndex
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
184 template<typename T>
185 PointIndex operator+(T x) { return PointIndex(mIndex + IntType(x)); }
186
187 private:
188 IntType mIndex;
189 };
190
191
192 using PointIndex32 = PointIndex<Index32, 0>;
193 using PointIndex64 = PointIndex<Index64, 0>;
194
195 using PointDataIndex32 = PointIndex<Index32, 1>;
196 using PointDataIndex64 = PointIndex<Index64, 1>;
197
198
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
228
229
232 template<typename FromType, typename ToType>
233 struct CanConvertType { enum { value = std::is_constructible<ToType, FromType>::value }; };
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>
253 struct CanConvertType<T, ValueMask> { enum {value = CanConvertType<T, bool>::value}; };
254 template<typename T>
255 struct CanConvertType<ValueMask, T> { enum {value = CanConvertType<bool, T>::value}; };
256
257
259
260
261 // Add new items to the *end* of this list, and update NUM_GRID_CLASSES.
262 enum GridClass {
263 GRID_UNKNOWN = 0,
264 GRID_LEVEL_SET,
265 GRID_FOG_VOLUME,
266 GRID_STAGGERED
267 };
268 enum { NUM_GRID_CLASSES = GRID_STAGGERED + 1 };
269
270 static const Real LEVEL_SET_HALF_WIDTH = 3;
271
292 enum VecType {
293 VEC_INVARIANT = 0,
294 VEC_COVARIANT,
295 VEC_COVARIANT_NORMALIZE,
296 VEC_CONTRAVARIANT_RELATIVE,
297 VEC_CONTRAVARIANT_ABSOLUTE
298 };
299 enum { NUM_VEC_TYPES = VEC_CONTRAVARIANT_ABSOLUTE + 1 };
300
301
315 enum MergePolicy {
316 MERGE_ACTIVE_STATES = 0,
317 MERGE_NODES,
318 MERGE_ACTIVE_STATES_AND_NODES
319 };
320
321
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
357
358
370 template<typename AValueType, typename BValueType = AValueType>
371 class CombineArgs
372 {
373 public:
374 using AValueT = AValueType;
375 using BValueT = BValueType;
376
377 CombineArgs()
378 : mAValPtr(NULL)
379 , mBValPtr(NULL)
380 , mResultValPtr(&mResultVal)
381 , mAIsActive(false)
382 , mBIsActive(false)
383 , mResultIsActive(false)
384 {
385 }
386
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
400 CombineArgs(const AValueType& a, const BValueType& b, bool aOn = false, bool bOn = false)
401 : mAValPtr(&a)
402 , mBValPtr(&b)
403 , mResultValPtr(&mResultVal)
404 , mAIsActive(aOn)
405 , mBIsActive(bOn)
406 {
407 this->updateResultActive();
408 }
409
411 const AValueType& a() const { return *mAValPtr; }
413 const BValueType& b() const { return *mBValPtr; }
415 const AValueType& result() const { return *mResultValPtr; }
417 AValueType& result() { return *mResultValPtr; }
419
421 CombineArgs& setResult(const AValueType& val) { *mResultValPtr = val; return *this; }
422
424 CombineArgs& setARef(const AValueType& a) { mAValPtr = &a; return *this; }
426 CombineArgs& setBRef(const BValueType& b) { mBValPtr = &b; return *this; }
428 CombineArgs& setResultRef(AValueType& val) { mResultValPtr = &val; return *this; }
429
431 bool aIsActive() const { return mAIsActive; }
433 bool bIsActive() const { return mBIsActive; }
435 bool resultIsActive() const { return mResultIsActive; }
436
438 CombineArgs& setAIsActive(bool b) { mAIsActive = b; updateResultActive(); return *this; }
440 CombineArgs& setBIsActive(bool b) { mBIsActive = b; updateResultActive(); return *this; }
442 CombineArgs& setResultIsActive(bool b) { mResultIsActive = b; return *this; }
443
444 protected:
447 void updateResultActive() { mResultIsActive = mAIsActive || mBIsActive; }
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
461 template<typename ValueType, typename CombineOp>
462 struct SwappedCombineOp
463 {
464 SwappedCombineOp(CombineOp& _op): op(_op) {}
465
466 void operator()(CombineArgs<ValueType>& args)
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
478
479
480 #ifdef OPENVDB_3_ABI_COMPATIBLE
481 enum CopyPolicy { CP_NEW, CP_SHARE, CP_COPY };
495 #endif
496
497
500 class ShallowCopy {};
503 class TopologyCopy {};
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/ )
openvdb::v4_0_2::typeNameAsString< double >
const char * typeNameAsString< double >()
Definition: Types.h:330
openvdb::v4_0_2::math::Vec4s
Vec4< float > Vec4s
Definition: Vec4.h:587
ptr
void * ptr
Definition: LeafBuffer.h:71
openvdb::v4_0_2::CanConvertType
CanConvertType<FromType, ToType>::value is true if a value of type ToType can be constructed from a v...
Definition: Types.h:233
openvdb::v4_0_2::math::Mat4< Real >
Vec2.h
openvdb::v4_0_2::typeNameAsString< PointDataIndex64 >
const char * typeNameAsString< PointDataIndex64 >()
Definition: Types.h:353
Vec3.h
openvdb::v4_0_2::typeNameAsString< uint16_t >
const char * typeNameAsString< uint16_t >()
Definition: Types.h:333
openvdb::v4_0_2::math::Vec4
Definition: Mat4.h:51
openvdb::v4_0_2::SharedPtr
std::shared_ptr< T > SharedPtr
Definition: Types.h:130
openvdb::v4_0_2::Real
double Real
Definition: Types.h:63
openvdb::v4_0_2::MERGE_NODES
Definition: Types.h:317
openvdb::v4_0_2::typeNameAsString< PointIndex64 >
const char * typeNameAsString< PointIndex64 >()
Definition: Types.h:351
openvdb::v4_0_2::CombineArgs::setResult
CombineArgs & setResult(const AValueType &val)
Set the output value.
Definition: Types.h:421
Math.h
General-purpose arithmetic and comparison routines, most of which accept arbitrary value types (or at...
openvdb::v4_0_2::VecTraits< math::Vec3< T > >::ElementType
T ElementType
Definition: Types.h:217
openvdb::v4_0_2::CombineArgs::mResultIsActive
bool mResultIsActive
Definition: Types.h:454
Coord.h
openvdb::v4_0_2::VecTraits::ElementType
T ElementType
Definition: Types.h:205
openvdb::v4_0_2::CombineArgs::bIsActive
bool bIsActive() const
Definition: Types.h:433
openvdb::v4_0_2::VecTraits< math::Vec4< T > >::ElementType
T ElementType
Definition: Types.h:223
openvdb::v4_0_2::VecTraits< math::Vec2< T > >::ElementType
T ElementType
Definition: Types.h:211
openvdb::v4_0_2::VEC_CONTRAVARIANT_ABSOLUTE
Definition: Types.h:297
openvdb::v4_0_2::typeNameAsString< float >
const char * typeNameAsString< float >()
Definition: Types.h:329
openvdb::v4_0_2::CombineArgs::setAIsActive
CombineArgs & setAIsActive(bool b)
Set the active state of the A value.
Definition: Types.h:438
openvdb::v4_0_2::Index32
uint32_t Index32
Definition: Types.h:55
openvdb::v4_0_2::VecTraits
Definition: Types.h:202
openvdb::v4_0_2::typeNameAsString< PointDataIndex32 >
const char * typeNameAsString< PointDataIndex32 >()
Definition: Types.h:352
openvdb::v4_0_2::SwappedCombineOp::SwappedCombineOp
SwappedCombineOp(CombineOp &_op)
Definition: Types.h:464
openvdb::v4_0_2::VEC_INVARIANT
Definition: Types.h:293
i
tbb::atomic< Index32 > i
Definition: LeafBuffer.h:71
openvdb::v4_0_2::CombineArgs::mBValPtr
const BValueType * mBValPtr
Definition: Types.h:450
openvdb::v4_0_2::typeNameAsString< Vec3f >
const char * typeNameAsString< Vec3f >()
Definition: Types.h:343
openvdb::v4_0_2::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:388
Mat4.h
openvdb::v4_0_2::math::Mat3
3x3 matrix class.
Definition: Mat3.h:54
openvdb::v4_0_2::math::CoordBBox
Axis-aligned bounding box of signed integer coordinates.
Definition: Coord.h:261
openvdb::v4_0_2::typeNameAsString< uint8_t >
const char * typeNameAsString< uint8_t >()
Definition: Types.h:331
openvdb::v4_0_2::SwappedCombineOp
Definition: Types.h:462
openvdb::v4_0_2::ValueMask
Definition: Types.h:110
BBox.h
openvdb::v4_0_2::GRID_UNKNOWN
Definition: Types.h:263
openvdb::v4_0_2::math::Vec3i
Vec3< int32_t > Vec3i
Definition: Vec3.h:675
openvdb::v4_0_2::CombineArgs::updateResultActive
void updateResultActive()
Definition: Types.h:447
openvdb::v4_0_2::Index
Index32 Index
Definition: Types.h:57
openvdb::v4_0_2::typeNameAsString< Vec3U8 >
const char * typeNameAsString< Vec3U8 >()
Definition: Types.h:340
openvdb::v4_0_2::math::Vec3< Real >
openvdb::v4_0_2::Int
Int32 Int
Definition: Types.h:61
openvdb::v4_0_2::math::Vec3s
Vec3< float > Vec3s
Definition: Vec3.h:677
Mat3.h
openvdb::v4_0_2::PartialCreate
Tag dispatch class that distinguishes constructors during file input.
Definition: Types.h:505
Quat.h
openvdb::v4_0_2::NUM_VEC_TYPES
Definition: Types.h:299
openvdb::v4_0_2::CombineArgs::mBIsActive
bool mBIsActive
Definition: Types.h:453
openvdb::v4_0_2::MERGE_ACTIVE_STATES
Definition: Types.h:316
openvdb::v4_0_2::math::Vec2s
Vec2< float > Vec2s
Definition: Vec2.h:557
openvdb::v4_0_2::CombineArgs::b
const BValueType & b() const
Get the B input value.
Definition: Types.h:413
openvdb::v4_0_2::typeNameAsString< Vec2i >
const char * typeNameAsString< Vec2i >()
Definition: Types.h:337
openvdb::v4_0_2::CombineArgs::result
const AValueType & result() const
Get the output value.
Definition: Types.h:416
openvdb::v4_0_2::Index64
uint64_t Index64
Definition: Types.h:56
openvdb::v4_0_2::CombineArgs::setBIsActive
CombineArgs & setBIsActive(bool b)
Set the active state of the B value.
Definition: Types.h:440
openvdb::v4_0_2::ShallowCopy
Tag dispatch class that distinguishes shallow copy constructors from deep copy constructors.
Definition: Types.h:500
openvdb::v4_0_2::PointIndex::IntType
IntType_ IntType
Definition: Types.h:177
openvdb::v4_0_2::math::Vec4i
Vec4< int32_t > Vec4i
Definition: Vec4.h:585
OPENVDB_VERSION_NAME
#define OPENVDB_VERSION_NAME
Definition: version.h:43
openvdb::v4_0_2::CombineArgs::setBRef
CombineArgs & setBRef(const BValueType &b)
Redirect the B value to a new external source.
Definition: Types.h:426
openvdb::v4_0_2::typeNameAsString< int16_t >
const char * typeNameAsString< int16_t >()
Definition: Types.h:332
openvdb::v4_0_2::NUM_GRID_CLASSES
Definition: Types.h:268
openvdb::v4_0_2::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:400
openvdb::v4_0_2::CombineArgs::setResultIsActive
CombineArgs & setResultIsActive(bool b)
Set the active state of the output value.
Definition: Types.h:442
openvdb::v4_0_2::VEC_CONTRAVARIANT_RELATIVE
Definition: Types.h:296
openvdb::v4_0_2::Int16
int16_t Int16
Definition: Types.h:58
openvdb::v4_0_2::math::Quat
Definition: Mat.h:194
openvdb::v4_0_2::VEC_COVARIANT_NORMALIZE
Definition: Types.h:295
openvdb::v4_0_2::PointIndex::PointIndex
PointIndex(IntType i=IntType(0))
Definition: Types.h:179
openvdb::v4_0_2::CombineArgs::a
const AValueType & a() const
Get the A input value.
Definition: Types.h:411
openvdb
Definition: Exceptions.h:39
openvdb::v4_0_2::VecType
VecType
Definition: Types.h:292
openvdb::v4_0_2::CombineArgs::resultIsActive
bool resultIsActive() const
Definition: Types.h:435
openvdb::v4_0_2::CombineArgs
This struct collects both input and output arguments to "grid combiner" functors used with the tree::...
Definition: Types.h:371
openvdb::v4_0_2::VEC_COVARIANT
Definition: Types.h:294
openvdb::v4_0_2::math::Vec3d
Vec3< double > Vec3d
Definition: Vec3.h:678
openvdb::v4_0_2::CombineArgs::result
AValueType & result()
Get the output value.
Definition: Types.h:417
openvdb::v4_0_2::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:161
openvdb::v4_0_2::typeNameAsString< Vec2d >
const char * typeNameAsString< Vec2d >()
Definition: Types.h:339
openvdb::v4_0_2::CombineArgs::setARef
CombineArgs & setARef(const AValueType &a)
Redirect the A value to a new external source.
Definition: Types.h:424
openvdb::v4_0_2::Int64
int64_t Int64
Definition: Types.h:60
openvdb::v4_0_2::CombineArgs::mResultVal
AValueType mResultVal
Definition: Types.h:451
version.h
openvdb::v4_0_2::CombineArgs::aIsActive
bool aIsActive() const
Definition: Types.h:431
openvdb::v4_0_2::math::Vec2d
Vec2< double > Vec2d
Definition: Vec2.h:558
openvdb::v4_0_2::MERGE_ACTIVE_STATES_AND_NODES
Definition: Types.h:318
openvdb::v4_0_2::typeNameAsString< uint32_t >
const char * typeNameAsString< uint32_t >()
Definition: Types.h:335
openvdb::v4_0_2::typeNameAsString< int64_t >
const char * typeNameAsString< int64_t >()
Definition: Types.h:336
openvdb::v4_0_2::LEVEL_SET_HALF_WIDTH
static const Real LEVEL_SET_HALF_WIDTH
Definition: Types.h:270
openvdb::v4_0_2::typeNameAsString
const char * typeNameAsString()
Definition: Types.h:325
openvdb::v4_0_2::typeNameAsString< PointIndex32 >
const char * typeNameAsString< PointIndex32 >()
Definition: Types.h:350
openvdb::v4_0_2::SwappedCombineOp::op
CombineOp & op
Definition: Types.h:473
openvdb::v4_0_2::CombineArgs::BValueT
BValueType BValueT
Definition: Types.h:375
openvdb::v4_0_2::MergePolicy
MergePolicy
Definition: Types.h:315
openvdb::v4_0_2::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:151
openvdb::v4_0_2::typeNameAsString< Vec3i >
const char * typeNameAsString< Vec3i >()
Definition: Types.h:342
openvdb::v4_0_2::CombineArgs::CombineArgs
CombineArgs()
Definition: Types.h:377
openvdb::v4_0_2::math::Vec2
Definition: Vec2.h:49
openvdb::v4_0_2::typeNameAsString< bool >
const char * typeNameAsString< bool >()
Definition: Types.h:326
openvdb::v4_0_2::typeNameAsString< Vec2s >
const char * typeNameAsString< Vec2s >()
Definition: Types.h:338
openvdb::v4_0_2::TopologyCopy
Tag dispatch class that distinguishes topology copy constructors from deep copy constructors.
Definition: Types.h:503
openvdb::v4_0_2::typeNameAsString< ValueMask >
const char * typeNameAsString< ValueMask >()
Definition: Types.h:327
openvdb::v4_0_2::GridClass
GridClass
Definition: Types.h:262
openvdb::v4_0_2::math::Coord
Signed (x, y, z) 32-bit integer coordinates.
Definition: Coord.h:48
openvdb::v4_0_2::Int32
int32_t Int32
Definition: Types.h:59
openvdb::v4_0_2::math::Vec4d
Vec4< double > Vec4d
Definition: Vec4.h:588
openvdb::v4_0_2::typeNameAsString< int32_t >
const char * typeNameAsString< int32_t >()
Definition: Types.h:334
OPENVDB_USE_VERSION_NAMESPACE
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:71
openvdb::v4_0_2::GRID_STAGGERED
Definition: Types.h:266
openvdb::v4_0_2::typeNameAsString< Vec3d >
const char * typeNameAsString< Vec3d >()
Definition: Types.h:344
openvdb::v4_0_2::PointIndex
Integer wrapper, required to distinguish PointIndexGrid and PointDataGrid from Int32Grid and Int64Gri...
Definition: Types.h:173
openvdb::v4_0_2::PointIndex::operator+
PointIndex operator+(T x)
Needed to support the (zeroVal<PointIndex>() + val) idiom.
Definition: Types.h:185
openvdb::v4_0_2::CombineArgs::AValueT
AValueType AValueT
Definition: Types.h:374
openvdb::v4_0_2::typeNameAsString< half >
const char * typeNameAsString< half >()
Definition: Types.h:328
openvdb::v4_0_2::CombineArgs::mResultValPtr
AValueType * mResultValPtr
Definition: Types.h:452
openvdb::v4_0_2::typeNameAsString< Vec3U16 >
const char * typeNameAsString< Vec3U16 >()
Definition: Types.h:341
openvdb::v4_0_2::Byte
unsigned char Byte
Definition: Types.h:62
openvdb::v4_0_2::GRID_LEVEL_SET
Definition: Types.h:264
openvdb::v4_0_2::GRID_FOG_VOLUME
Definition: Types.h:265
openvdb::v4_0_2::typeNameAsString< Mat4s >
const char * typeNameAsString< Mat4s >()
Definition: Types.h:346
openvdb::v4_0_2::math::Vec2i
Vec2< int32_t > Vec2i
Definition: Vec2.h:555
openvdb::v4_0_2::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:141
openvdb::v4_0_2::CombineArgs::setResultRef
CombineArgs & setResultRef(AValueType &val)
Redirect the result value to a new external destination.
Definition: Types.h:428
openvdb::v4_0_2::CombineArgs::mAValPtr
const AValueType * mAValPtr
Definition: Types.h:449
openvdb::v4_0_2::math::BBox< Vec3d >
Platform.h
Vec4.h
openvdb::v4_0_2::SwappedCombineOp::operator()
void operator()(CombineArgs< ValueType > &args)
Definition: Types.h:466
openvdb::v4_0_2::typeNameAsString< Mat4d >
const char * typeNameAsString< Mat4d >()
Definition: Types.h:347