31 #ifndef OPENVDB_TYPES_HAS_BEEN_INCLUDED
32 #define OPENVDB_TYPES_HAS_BEEN_INCLUDED
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 <openvdb/math/Hermite.h>
61 typedef unsigned char Byte;
114 static const bool IsVec =
false;
115 static const int Size = 1;
118 static const bool IsVec =
true;
119 static const int Size = 2;
122 static const bool IsVec =
true;
123 static const int Size = 3;
126 static const bool IsVec =
true;
127 static const int Size = 4;
212 template<>
inline const char* typeNameAsString<std::string>() {
return "string"; }
231 template<
typename ValueType>
238 mAValPtr(NULL), mBValPtr(NULL), mResultValPtr(&mResultVal),
239 mAIsActive(false), mBIsActive(false), mResultIsActive(false)
243 CombineArgs(
const ValueType& a,
const ValueType& b, ValueType& result,
244 bool aOn =
false,
bool bOn =
false):
245 mAValPtr(&a), mBValPtr(&b), mResultValPtr(&result),
246 mAIsActive(aOn), mBIsActive(bOn)
247 { updateResultActive(); }
250 CombineArgs(
const ValueType& a,
const ValueType& b,
bool aOn =
false,
bool bOn =
false):
251 mAValPtr(&a), mBValPtr(&b), mResultValPtr(&mResultVal),
252 mAIsActive(aOn), mBIsActive(bOn)
253 { updateResultActive(); }
256 const ValueType&
a()
const {
return *mAValPtr; }
258 const ValueType&
b()
const {
return *mBValPtr; }
260 const ValueType& result()
const {
return *mResultValPtr; }
262 ValueType&
result() {
return *mResultValPtr; }
306 template<
typename ValueType,
typename CombineOp>
356 #define OPENVDB_START_THREADSAFE_STATIC_REFERENCE __pragma(warning(disable:1710))
357 #define OPENVDB_FINISH_THREADSAFE_STATIC_REFERENCE __pragma(warning(default:1710))
358 #define OPENVDB_START_THREADSAFE_STATIC_WRITE __pragma(warning(disable:1711))
359 #define OPENVDB_FINISH_THREADSAFE_STATIC_WRITE __pragma(warning(default:1711))
360 #define OPENVDB_START_THREADSAFE_STATIC_ADDRESS __pragma(warning(disable:1712))
361 #define OPENVDB_FINISH_THREADSAFE_STATIC_ADDRESS __pragma(warning(default:1712))
365 #define OPENVDB_START_NON_THREADSAFE_STATIC_REFERENCE __pragma(warning(disable:1710))
366 #define OPENVDB_FINISH_NON_THREADSAFE_STATIC_REFERENCE __pragma(warning(default:1710))
367 #define OPENVDB_START_NON_THREADSAFE_STATIC_WRITE __pragma(warning(disable:1711))
368 #define OPENVDB_FINISH_NON_THREADSAFE_STATIC_WRITE __pragma(warning(default:1711))
369 #define OPENVDB_START_NON_THREADSAFE_STATIC_ADDRESS __pragma(warning(disable:1712))
370 #define OPENVDB_FINISH_NON_THREADSAFE_STATIC_ADDRESS __pragma(warning(default:1712))
373 #define OPENVDB_THREADSAFE_STATIC_REFERENCE(CODE) \
374 __pragma(warning(disable:1710)); CODE; __pragma(warning(default:1710))
375 #define OPENVDB_THREADSAFE_STATIC_WRITE(CODE) \
376 __pragma(warning(disable:1711)); CODE; __pragma(warning(default:1711))
377 #define OPENVDB_THREADSAFE_STATIC_ADDRESS(CODE) \
378 __pragma(warning(disable:1712)); CODE; __pragma(warning(default:1712))
380 #else // GCC does not support these compiler warnings
382 #define OPENVDB_START_THREADSAFE_STATIC_REFERENCE
383 #define OPENVDB_FINISH_THREADSAFE_STATIC_REFERENCE
384 #define OPENVDB_START_THREADSAFE_STATIC_WRITE
385 #define OPENVDB_FINISH_THREADSAFE_STATIC_WRITE
386 #define OPENVDB_START_THREADSAFE_STATIC_ADDRESS
387 #define OPENVDB_FINISH_THREADSAFE_STATIC_ADDRESS
389 #define OPENVDB_START_NON_THREADSAFE_STATIC_REFERENCE
390 #define OPENVDB_FINISH_NON_THREADSAFE_STATIC_REFERENCE
391 #define OPENVDB_START_NON_THREADSAFE_STATIC_WRITE
392 #define OPENVDB_FINISH_NON_THREADSAFE_STATIC_WRITE
393 #define OPENVDB_START_NON_THREADSAFE_STATIC_ADDRESS
394 #define OPENVDB_FINISH_NON_THREADSAFE_STATIC_ADDRESS
396 #define OPENVDB_THREADSAFE_STATIC_REFERENCE(CODE) CODE
397 #define OPENVDB_THREADSAFE_STATIC_WRITE(CODE) CODE
398 #define OPENVDB_THREADSAFE_STATIC_ADDRESS(CODE) CODE
400 #endif // defined(__ICC)
402 #endif // OPENVDB_TYPES_HAS_BEEN_INCLUDED
bool mResultIsActive
Definition: Types.h:299
math::Vec3< Index32 > Vec3I
Definition: Types.h:75
const char * typeNameAsString< int64_t >()
Definition: Types.h:204
ValueType mResultVal
Definition: Types.h:296
ValueType ValueT
Definition: Types.h:235
math::Vec4< half > Vec4H
Definition: Types.h:90
CombineArgs(const ValueType &a, const ValueType &b, bool aOn=false, bool bOn=false)
Use this constructor when the result value should be stored in this struct.
Definition: Types.h:250
const char * typeNameAsString< Vec2d >()
Definition: Types.h:208
CombineArgs(const ValueType &a, const ValueType &b, ValueType &result, bool aOn=false, bool bOn=false)
Use this constructor when the result value is stored externally.
Definition: Types.h:243
const char * typeNameAsString< double >()
Definition: Types.h:201
CombineArgs & setAIsActive(bool b)
Set the active state of the A value.
Definition: Types.h:283
math::Vec4< float > Vec4f
Definition: Types.h:89
math::Vec2< float > Vec2f
Definition: Types.h:67
int16_t Int16
Definition: Types.h:57
math::Vec2< half > Vec2H
Definition: Types.h:68
math::Vec3< Real > Vec3R
Definition: Types.h:74
ValueType & result()
Get the output value.
Definition: Types.h:262
3x3 matrix class.
Definition: Mat3.h:54
static const Real LEVEL_SET_HALF_WIDTH
Definition: Types.h:143
const ValueType & a() const
Get the A input value.
Definition: Types.h:256
Quantized Hermite data object that stores compressed intersection information (offsets and normlas) f...
Definition: Hermite.h:66
math::BBox< Vec3d > BBoxd
Definition: Types.h:84
VecType
Definition: Types.h:165
const ValueType * mBValPtr
Definition: Types.h:295
const char * typeNameAsString()
Definition: Types.h:198
math::Vec2< Real > Vec2R
Definition: Types.h:65
math::Vec2< Index32 > Vec2I
Definition: Types.h:66
CombineArgs & setResultIsActive(bool b)
Set the active state of the output value.
Definition: Types.h:287
void updateResultActive()
Definition: Types.h:292
bool mBIsActive
Definition: Types.h:298
CombineArgs & setBIsActive(bool b)
Set the active state of the B value.
Definition: Types.h:285
Index32 Index
Definition: Types.h:56
const char * typeNameAsString< float >()
Definition: Types.h:200
const ValueType & b() const
Get the B input value.
Definition: Types.h:258
void operator()(CombineArgs< ValueType > &args)
Definition: Types.h:311
MergePolicy
Definition: Types.h:188
const char * typeNameAsString< Hermite >()
Definition: Types.h:205
Vec3< int32_t > Vec3i
Definition: Vec3.h:602
const char * typeNameAsString< Vec3d >()
Definition: Types.h:211
Vec3< float > Vec3s
Definition: Vec3.h:604
math::Mat4< double > Mat4d
Definition: Types.h:100
const char * typeNameAsString< Vec2i >()
Definition: Types.h:206
const char * typeNameAsString< Mat4d >()
Definition: Types.h:214
CombineArgs & setBRef(const ValueType &b)
Redirect the B value to a new external source.
Definition: Types.h:271
Vec2< float > Vec2s
Definition: Vec2.h:501
This struct collects both input and output arguments to "grid combiner" functors used with the tree::...
Definition: Types.h:232
math::Quat< Real > QuatR
Definition: Types.h:107
CombineOp & op
Definition: Types.h:318
GridClass
Definition: Types.h:135
Axis-aligned bounding box of signed integer coordinates.
Definition: Coord.h:229
#define OPENVDB_VERSION_NAME
Definition: version.h:45
Signed (x, y, z) 32-bit integer coordinates.
Definition: Coord.h:47
Vec4< int32_t > Vec4i
Definition: Vec4.h:521
const char * typeNameAsString< Vec3f >()
Definition: Types.h:210
bool aIsActive() const
Definition: Types.h:276
CombineArgs & setResultRef(ValueType &val)
Redirect the result value to a new external destination.
Definition: Types.h:273
unsigned char Byte
Definition: Types.h:61
math::Mat4< Real > Mat4R
Definition: Types.h:99
ValueType * mResultValPtr
Definition: Types.h:297
uint32_t Index32
Definition: Types.h:54
uint64_t Index64
Definition: Types.h:55
int32_t Int32
Definition: Types.h:58
CopyPolicy
Definition: Types.h:338
math::Hermite Hermite
Definition: Types.h:104
CombineArgs & setARef(const ValueType &a)
Redirect the A value to a new external source.
Definition: Types.h:269
int64_t Int64
Definition: Types.h:59
const ValueType * mAValPtr
Definition: Types.h:294
Vec3< double > Vec3d
Definition: Vec3.h:605
const char * typeNameAsString< Vec2s >()
Definition: Types.h:207
double Real
Definition: Types.h:62
Vec2< double > Vec2d
Definition: Vec2.h:502
const ValueType & result() const
Get the output value.
Definition: Types.h:261
math::Mat4< float > Mat4s
Definition: Types.h:101
math::Vec4< Index32 > Vec4I
Definition: Types.h:88
const char * typeNameAsString< int32_t >()
Definition: Types.h:202
math::Vec3< half > Vec3H
Definition: Types.h:77
const char * typeNameAsString< Mat4s >()
Definition: Types.h:213
math::Vec4< Real > Vec4R
Definition: Types.h:87
SwappedCombineOp(CombineOp &op)
Definition: Types.h:309
bool resultIsActive() const
Definition: Types.h:280
CombineArgs()
Definition: Types.h:237
math::Mat3< Real > Mat3R
Definition: Types.h:96
bool bIsActive() const
Definition: Types.h:278
const char * typeNameAsString< bool >()
Definition: Types.h:199
const char * typeNameAsString< Vec3i >()
Definition: Types.h:209
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:67
CombineArgs & setResult(const ValueType &val)
Set the output value.
Definition: Types.h:266
Vec4< double > Vec4d
Definition: Vec4.h:524
Int32 Int
Definition: Types.h:60
math::Vec3< float > Vec3f
Definition: Types.h:76
const char * typeNameAsString< uint32_t >()
Definition: Types.h:203
Vec2< int32_t > Vec2i
Definition: Vec2.h:499
Vec4< float > Vec4s
Definition: Vec4.h:523