HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_VDBUtils.h File Reference
#include <openvdb/openvdb.h>
#include <openvdb/tools/PointIndexGrid.h>
#include <openvdb/points/PointDataGrid.h>
#include "UT_Assert.h"
#include "UT_BoundingBox.h"
#include "UT_Matrix4.h"
#include "UT_Matrix3.h"
#include "UT_Matrix2.h"
#include <SYS/SYS_Math.h>
+ Include dependency graph for UT_VDBUtils.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  UT_VDBMath< T >
 
struct  UT_VDBMath< bool >
 

Namespaces

 UT_VDBUtils
 

Macros

#define UT_VDB_CALL(GRIDT, RETURN, FNAME, GRIDBASE,...)
 
#define UT_VDB_DECL_PROCESS_TYPED_GRID(GRID_BASE_T)
 Utility function that, given a generic grid pointer, calls a functor on the fully-resolved grid. More...
 
#define UTvdbCallRealType(TYPE, FNAME, GRIDBASE,...)
 
#define UTvdbCallScalarType(TYPE, FNAME, GRIDBASE,...)
 
#define UTvdbCallVec3Type(TYPE, FNAME, GRIDBASE,...)
 
#define UTvdbCallPointType(TYPE, FNAME, GRIDBASE,...)
 
#define UTvdbCallBoolType(TYPE, FNAME, GRIDBASE,...)
 
#define UTvdbCallAllType(TYPE, FNAME, GRIDBASE,...)
 
#define UTvdbCallAllTopology(TYPE, FNAME, GRIDBASE,...)
 
#define UTvdbReturnRealType(TYPE, FNAME, GRIDBASE,...)
 
#define UTvdbReturnScalarType(TYPE, FNAME, GRIDBASE,...)
 
#define UTvdbReturnVec3Type(TYPE, FNAME, GRIDBASE,...)
 
#define UTvdbReturnPointType(TYPE, FNAME, GRIDBASE,...)
 
#define UTvdbReturnBoolType(TYPE, FNAME, GRIDBASE,...)
 
#define UTvdbReturnAllType(TYPE, FNAME, GRIDBASE,...)
 
#define UTvdbReturnAllTopology(TYPE, FNAME, GRIDBASE,...)
 

Enumerations

enum  UT_VDBType {
  UT_VDB_INVALID, UT_VDB_FLOAT, UT_VDB_DOUBLE, UT_VDB_INT32,
  UT_VDB_INT64, UT_VDB_BOOL, UT_VDB_VEC3F, UT_VDB_VEC3D,
  UT_VDB_VEC3I, UT_VDB_POINTINDEX, UT_VDB_POINTDATA
}
 

Functions

void UTvdbInitialize ()
 Calls openvdb::initialize() More...
 
UT_VDBType UTvdbGetGridType (const openvdb::GridBase &grid)
 Find the UT_VDBType from a grid. More...
 
const char * UTvdbGetGridTypeString (const openvdb::GridBase &grid)
 Return the string representation of a grid's underlying value type. More...
 
int UTvdbGetGridTupleSize (UT_VDBType type)
 Returns the tuple size of a grid given its value type. More...
 
int UTvdbGetGridTupleSize (const openvdb::GridBase &grid)
 Returns the tuple size of a grid. More...
 
template<typename GridType , typename OpType , typename GridBaseType >
void UT_VDBUtils::callTypedGrid (GridBaseType &grid, OpType &op)
 
UT_BoundingBoxD UTvdbConvert (const openvdb::CoordBBox &bbox)
 Bounding box conversion from openvdb to UT. More...
 
openvdb::math::CoordBBox UTvdbConvert (const UT_BoundingBoxI &bbox)
 Bounding box conversion from openvdb to UT. More...
 
openvdb::math::Transform::Ptr UTvdbCreateTransform (const UT_Vector3 &orig, const UT_Vector3 &voxsize)
 
template<typename T >
openvdb::math::Vec4< T > SYSabs (const openvdb::math::Vec4< T > &v1)
 
template<typename T >
openvdb::math::Vec3< T > SYSabs (const openvdb::math::Vec3< T > &v1)
 
template<typename T >
openvdb::math::Vec2< T > SYSabs (const openvdb::math::Vec2< T > &v1)
 
template<typename T >
openvdb::math::Vec4< T > SYSmin (const openvdb::math::Vec4< T > &v1, const openvdb::math::Vec4< T > &v2)
 
template<typename T >
openvdb::math::Vec4< T > SYSmax (const openvdb::math::Vec4< T > &v1, const openvdb::math::Vec4< T > &v2)
 
template<typename T >
openvdb::math::Vec4< T > SYSmin (const openvdb::math::Vec4< T > &v1, const openvdb::math::Vec4< T > &v2, const openvdb::math::Vec4< T > &v3)
 
template<typename T >
openvdb::math::Vec4< T > SYSmax (const openvdb::math::Vec4< T > &v1, const openvdb::math::Vec4< T > &v2, const openvdb::math::Vec4< T > &v3)
 
template<typename T >
openvdb::math::Vec3< T > SYSmin (const openvdb::math::Vec3< T > &v1, const openvdb::math::Vec3< T > &v2)
 
template<typename T >
openvdb::math::Vec3< T > SYSmax (const openvdb::math::Vec3< T > &v1, const openvdb::math::Vec3< T > &v2)
 
template<typename T >
openvdb::math::Vec3< T > SYSmin (const openvdb::math::Vec3< T > &v1, const openvdb::math::Vec3< T > &v2, const openvdb::math::Vec3< T > &v3)
 
template<typename T >
openvdb::math::Vec3< T > SYSmax (const openvdb::math::Vec3< T > &v1, const openvdb::math::Vec3< T > &v2, const openvdb::math::Vec3< T > &v3)
 
template<typename T >
openvdb::math::Vec2< T > SYSmin (const openvdb::math::Vec2< T > &v1, const openvdb::math::Vec2< T > &v2)
 
template<typename T >
openvdb::math::Vec2< T > SYSmax (const openvdb::math::Vec2< T > &v1, const openvdb::math::Vec2< T > &v2)
 
template<typename T >
openvdb::math::Vec2< T > SYSmin (const openvdb::math::Vec2< T > &v1, const openvdb::math::Vec2< T > &v2, const openvdb::math::Vec2< T > &v3)
 
template<typename T >
openvdb::math::Vec2< T > SYSmax (const openvdb::math::Vec2< T > &v1, const openvdb::math::Vec2< T > &v2, const openvdb::math::Vec2< T > &v3)
 
template<typename GridType >
const GridType * UTvdbGridCast (const openvdb::GridBase *grid)
 
template<typename GridType >
GridType * UTvdbGridCast (openvdb::GridBase *grid)
 
template<typename GridType >
const GridType & UTvdbGridCast (const openvdb::GridBase &grid)
 
template<typename GridType >
GridType & UTvdbGridCast (openvdb::GridBase &grid)
 
template<typename GridType >
GridType::ConstPtr UTvdbGridCast (openvdb::GridBase::ConstPtr grid)
 
template<typename GridType >
GridType::Ptr UTvdbGridCast (openvdb::GridBase::Ptr grid)
 
template<typename S >
UT_Matrix4T< S > UTvdbConvert (const openvdb::math::Mat4< S > &src)
 Matrix conversion from openvdb to UT. More...
 
template<typename S >
UT_Matrix3T< S > UTvdbConvert (const openvdb::math::Mat3< S > &src)
 Matrix conversion from openvdb to UT. More...
 
template<typename S >
UT_Matrix2T< S > UTvdbConvert (const openvdb::math::Mat2< S > &src)
 Matrix conversion from openvdb to UT. More...
 
template<typename S >
openvdb::math::Mat4< S > UTvdbConvert (const UT_Matrix4T< S > &src)
 Matrix conversion from UT to openvdb. More...
 
template<typename S >
openvdb::math::Mat3< S > UTvdbConvert (const UT_Matrix3T< S > &src)
 Matrix conversion from UT to openvdb. More...
 
template<typename S >
openvdb::math::Mat2< S > UTvdbConvert (const UT_Matrix2T< S > &src)
 Matrix conversion from UT to openvdb. More...
 
template<typename S >
UT_Vector4T< S > UTvdbConvert (const openvdb::math::Vec4< S > &src)
 Vector conversion from openvdb to UT. More...
 
template<typename S >
UT_Vector3T< S > UTvdbConvert (const openvdb::math::Vec3< S > &src)
 Vector conversion from openvdb to UT. More...
 
template<typename S >
UT_Vector2T< S > UTvdbConvert (const openvdb::math::Vec2< S > &src)
 Vector conversion from openvdb to UT. More...
 
template<typename S >
openvdb::math::Vec4< S > UTvdbConvert (const UT_Vector4T< S > &src)
 Vector conversion from UT to openvdb. More...
 
template<typename S >
openvdb::math::Vec3< S > UTvdbConvert (const UT_Vector3T< S > &src)
 Vector conversion from UT to openvdb. More...
 
template<typename S >
openvdb::math::Vec2< S > UTvdbConvert (const UT_Vector2T< S > &src)
 Vector conversion from UT to openvdb. More...
 

Macro Definition Documentation

#define UT_VDB_CALL (   GRIDT,
  RETURN,
  FNAME,
  GRIDBASE,
  ... 
)
Value:
{ \
RETURN FNAME <GRIDT> (UTvdbGridCast<GRIDT>(GRIDBASE), __VA_ARGS__ ); \
} \

Definition at line 354 of file UT_VDBUtils.h.

#define UT_VDB_DECL_PROCESS_TYPED_GRID (   GRID_BASE_T)

Utility function that, given a generic grid pointer, calls a functor on the fully-resolved grid.

Example:
using openvdb::Coord;
using openvdb::CoordBBox;
struct FillOp {
const CoordBBox bbox;
FillOp(const CoordBBox& b): bbox(b) {}
template<typename GridT>
void operator()(GridT& grid) const {
using ValueT = typename GridT::ValueType;
grid.fill(bbox, ValueT(1));
}
};
GU_PrimVDB* vdb = ...;
CoordBBox bbox(Coord(0,0,0), Coord(10,10,10));
UTvdbProcessTypedGrid(vdb->getStorageType(), vdb->getGrid(), FillOp(bbox));
Returns
false if the grid type is unknown or unhandled.

Definition at line 241 of file UT_VDBUtils.h.

#define UTvdbCallAllTopology (   TYPE,
  FNAME,
  GRIDBASE,
  ... 
)
Value:
UTvdbCallScalarType(TYPE, FNAME, GRIDBASE, __VA_ARGS__) \
else UTvdbCallVec3Type(TYPE, FNAME, GRIDBASE, __VA_ARGS__) \
else UTvdbCallBoolType(TYPE, FNAME, GRIDBASE, __VA_ARGS__) \
#define UTvdbCallScalarType(TYPE, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:380
#define UTvdbCallVec3Type(TYPE, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:387
#define UTvdbCallBoolType(TYPE, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:401

Macro to invoke the correct type of grid. Use like:

UTvdbCallScalarType(grid_type, myfunction, grid, parms)

to invoke

template <typename GridType>
static void
myfunction(const GridType &grid, parms)
{ }

Definition at line 409 of file UT_VDBUtils.h.

#define UTvdbCallAllType (   TYPE,
  FNAME,
  GRIDBASE,
  ... 
)
Value:
UTvdbCallScalarType(TYPE, FNAME, GRIDBASE, __VA_ARGS__) \
else UTvdbCallVec3Type(TYPE, FNAME, GRIDBASE, __VA_ARGS__); \
#define UTvdbCallScalarType(TYPE, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:380
#define UTvdbCallVec3Type(TYPE, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:387

Macro to invoke the correct type of grid. Use like:

UTvdbCallScalarType(grid_type, myfunction, grid, parms)

to invoke

template <typename GridType>
static void
myfunction(const GridType &grid, parms)
{ }

Definition at line 405 of file UT_VDBUtils.h.

#define UTvdbCallBoolType (   TYPE,
  FNAME,
  GRIDBASE,
  ... 
)
Value:
if (TYPE == UT_VDB_BOOL) \
UT_VDB_CALL(openvdb::BoolGrid,(void),FNAME,GRIDBASE,__VA_ARGS__) \
Grid< BoolTree > BoolGrid
Common grid types.
Definition: openvdb.h:70
#define UT_VDB_CALL(GRIDT, RETURN, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:354

Macro to invoke the correct type of grid. Use like:

UTvdbCallScalarType(grid_type, myfunction, grid, parms)

to invoke

template <typename GridType>
static void
myfunction(const GridType &grid, parms)
{ }

Definition at line 401 of file UT_VDBUtils.h.

#define UTvdbCallPointType (   TYPE,
  FNAME,
  GRIDBASE,
  ... 
)
Value:
if (TYPE == UT_VDB_POINTINDEX) \
UT_VDB_CALL(openvdb::tools::PointIndexGrid,(void),FNAME,GRIDBASE,__VA_ARGS__) \
else if (TYPE == UT_VDB_POINTDATA) \
UT_VDB_CALL(openvdb::points::PointDataGrid,(void),FNAME,GRIDBASE,__VA_ARGS__) \
Grid< PointDataTree > PointDataGrid
Point data grid.
#define UT_VDB_CALL(GRIDT, RETURN, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:354
Grid< PointIndexTree > PointIndexGrid
Point index grid.

Macro to invoke the correct type of grid. Use like:

UTvdbCallScalarType(grid_type, myfunction, grid, parms)

to invoke

template <typename GridType>
static void
myfunction(const GridType &grid, parms)
{ }

Definition at line 395 of file UT_VDBUtils.h.

#define UTvdbCallRealType (   TYPE,
  FNAME,
  GRIDBASE,
  ... 
)
Value:
if (TYPE == UT_VDB_FLOAT) \
UT_VDB_CALL(openvdb::FloatGrid,(void),FNAME,GRIDBASE,__VA_ARGS__) \
else if (TYPE == UT_VDB_DOUBLE) \
UT_VDB_CALL(openvdb::DoubleGrid,(void),FNAME,GRIDBASE,__VA_ARGS__) \
#define UT_VDB_CALL(GRIDT, RETURN, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:354
Grid< DoubleTree > DoubleGrid
Definition: openvdb.h:71
Grid< FloatTree > FloatGrid
Definition: openvdb.h:72

Macro to invoke the correct type of grid. Use like:

UTvdbCallScalarType(grid_type, myfunction, grid, parms)

to invoke

template <typename GridType>
static void
myfunction(const GridType &grid, parms)
{ }

Definition at line 374 of file UT_VDBUtils.h.

#define UTvdbCallScalarType (   TYPE,
  FNAME,
  GRIDBASE,
  ... 
)
Value:
UTvdbCallRealType(TYPE, FNAME, GRIDBASE, __VA_ARGS__) \
else if (TYPE == UT_VDB_INT32) \
UT_VDB_CALL(openvdb::Int32Grid,(void),FNAME,GRIDBASE,__VA_ARGS__) \
else if (TYPE == UT_VDB_INT64) \
UT_VDB_CALL(openvdb::Int64Grid,(void),FNAME,GRIDBASE,__VA_ARGS__) \
Grid< Int64Tree > Int64Grid
Definition: openvdb.h:74
#define UTvdbCallRealType(TYPE, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:374
#define UT_VDB_CALL(GRIDT, RETURN, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:354
Grid< Int32Tree > Int32Grid
Definition: openvdb.h:73

Macro to invoke the correct type of grid. Use like:

UTvdbCallScalarType(grid_type, myfunction, grid, parms)

to invoke

template <typename GridType>
static void
myfunction(const GridType &grid, parms)
{ }

Definition at line 380 of file UT_VDBUtils.h.

#define UTvdbCallVec3Type (   TYPE,
  FNAME,
  GRIDBASE,
  ... 
)
Value:
if (TYPE == UT_VDB_VEC3F) \
UT_VDB_CALL(openvdb::Vec3fGrid,(void),FNAME,GRIDBASE,__VA_ARGS__) \
else if (TYPE == UT_VDB_VEC3D) \
UT_VDB_CALL(openvdb::Vec3dGrid,(void),FNAME,GRIDBASE,__VA_ARGS__) \
else if (TYPE == UT_VDB_VEC3I) \
UT_VDB_CALL(openvdb::Vec3IGrid,(void),FNAME,GRIDBASE,__VA_ARGS__) \
Grid< Vec3ITree > Vec3IGrid
Definition: openvdb.h:78
#define UT_VDB_CALL(GRIDT, RETURN, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:354

Macro to invoke the correct type of grid. Use like:

UTvdbCallScalarType(grid_type, myfunction, grid, parms)

to invoke

template <typename GridType>
static void
myfunction(const GridType &grid, parms)
{ }

Definition at line 387 of file UT_VDBUtils.h.

#define UTvdbReturnAllTopology (   TYPE,
  FNAME,
  GRIDBASE,
  ... 
)
Value:
UTvdbReturnScalarType(TYPE, FNAME, GRIDBASE, __VA_ARGS__) \
else UTvdbReturnVec3Type(TYPE, FNAME, GRIDBASE, __VA_ARGS__) \
else UTvdbReturnBoolType(TYPE, FNAME, GRIDBASE, __VA_ARGS__) \
#define UTvdbReturnScalarType(TYPE, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:440
#define UTvdbReturnBoolType(TYPE, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:461
#define UTvdbReturnVec3Type(TYPE, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:447

Macro to invoke the correct type of grid. Use like:

UTvdbReturnScalarType(grid_type, myfunction, grid, parms)

to invoke

return myfunction(grid, parms);

via:

template <typename GridType>
static RESULT
myfunction(const GridType &grid, parms)
{ }

Definition at line 469 of file UT_VDBUtils.h.

#define UTvdbReturnAllType (   TYPE,
  FNAME,
  GRIDBASE,
  ... 
)
Value:
UTvdbReturnScalarType(TYPE, FNAME, GRIDBASE, __VA_ARGS__) \
else UTvdbReturnVec3Type(TYPE, FNAME, GRIDBASE, __VA_ARGS__); \
#define UTvdbReturnScalarType(TYPE, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:440
#define UTvdbReturnVec3Type(TYPE, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:447

Macro to invoke the correct type of grid. Use like:

UTvdbReturnScalarType(grid_type, myfunction, grid, parms)

to invoke

return myfunction(grid, parms);

via:

template <typename GridType>
static RESULT
myfunction(const GridType &grid, parms)
{ }

Definition at line 465 of file UT_VDBUtils.h.

#define UTvdbReturnBoolType (   TYPE,
  FNAME,
  GRIDBASE,
  ... 
)
Value:
if (TYPE == UT_VDB_BOOL) \
UT_VDB_CALL(openvdb::BoolGrid,return,FNAME,GRIDBASE,__VA_ARGS__) \
Grid< BoolTree > BoolGrid
Common grid types.
Definition: openvdb.h:70
#define UT_VDB_CALL(GRIDT, RETURN, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:354

Macro to invoke the correct type of grid. Use like:

UTvdbReturnScalarType(grid_type, myfunction, grid, parms)

to invoke

return myfunction(grid, parms);

via:

template <typename GridType>
static RESULT
myfunction(const GridType &grid, parms)
{ }

Definition at line 461 of file UT_VDBUtils.h.

#define UTvdbReturnPointType (   TYPE,
  FNAME,
  GRIDBASE,
  ... 
)
Value:
if (TYPE == UT_VDB_POINTINDEX) \
UT_VDB_CALL(openvdb::tools::PointIndexGrid,return,FNAME,GRIDBASE,__VA_ARGS__) \
else if (TYPE == UT_VDB_POINTDATA) \
UT_VDB_CALL(openvdb::points::PointDataGrid,return,FNAME,GRIDBASE,__VA_ARGS__) \
Grid< PointDataTree > PointDataGrid
Point data grid.
#define UT_VDB_CALL(GRIDT, RETURN, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:354
Grid< PointIndexTree > PointIndexGrid
Point index grid.

Macro to invoke the correct type of grid. Use like:

UTvdbReturnScalarType(grid_type, myfunction, grid, parms)

to invoke

return myfunction(grid, parms);

via:

template <typename GridType>
static RESULT
myfunction(const GridType &grid, parms)
{ }

Definition at line 455 of file UT_VDBUtils.h.

#define UTvdbReturnRealType (   TYPE,
  FNAME,
  GRIDBASE,
  ... 
)
Value:
if (TYPE == UT_VDB_FLOAT) \
UT_VDB_CALL(openvdb::FloatGrid,return,FNAME,GRIDBASE,__VA_ARGS__) \
else if (TYPE == UT_VDB_DOUBLE) \
UT_VDB_CALL(openvdb::DoubleGrid,return,FNAME,GRIDBASE,__VA_ARGS__) \
#define UT_VDB_CALL(GRIDT, RETURN, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:354
Grid< DoubleTree > DoubleGrid
Definition: openvdb.h:71
Grid< FloatTree > FloatGrid
Definition: openvdb.h:72

Macro to invoke the correct type of grid. Use like:

UTvdbReturnScalarType(grid_type, myfunction, grid, parms)

to invoke

return myfunction(grid, parms);

via:

template <typename GridType>
static RESULT
myfunction(const GridType &grid, parms)
{ }

Definition at line 434 of file UT_VDBUtils.h.

#define UTvdbReturnScalarType (   TYPE,
  FNAME,
  GRIDBASE,
  ... 
)
Value:
UTvdbReturnRealType(TYPE, FNAME, GRIDBASE, __VA_ARGS__) \
else if (TYPE == UT_VDB_INT32) \
UT_VDB_CALL(openvdb::Int32Grid,return,FNAME,GRIDBASE,__VA_ARGS__) \
else if (TYPE == UT_VDB_INT64) \
UT_VDB_CALL(openvdb::Int64Grid,return,FNAME,GRIDBASE,__VA_ARGS__) \
Grid< Int64Tree > Int64Grid
Definition: openvdb.h:74
#define UTvdbReturnRealType(TYPE, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:434
#define UT_VDB_CALL(GRIDT, RETURN, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:354
Grid< Int32Tree > Int32Grid
Definition: openvdb.h:73

Macro to invoke the correct type of grid. Use like:

UTvdbReturnScalarType(grid_type, myfunction, grid, parms)

to invoke

return myfunction(grid, parms);

via:

template <typename GridType>
static RESULT
myfunction(const GridType &grid, parms)
{ }

Definition at line 440 of file UT_VDBUtils.h.

#define UTvdbReturnVec3Type (   TYPE,
  FNAME,
  GRIDBASE,
  ... 
)
Value:
if (TYPE == UT_VDB_VEC3F) \
UT_VDB_CALL(openvdb::Vec3fGrid,return,FNAME,GRIDBASE,__VA_ARGS__) \
else if (TYPE == UT_VDB_VEC3D) \
UT_VDB_CALL(openvdb::Vec3dGrid,return,FNAME,GRIDBASE,__VA_ARGS__) \
else if (TYPE == UT_VDB_VEC3I) \
UT_VDB_CALL(openvdb::Vec3IGrid,return,FNAME,GRIDBASE,__VA_ARGS__) \
Grid< Vec3ITree > Vec3IGrid
Definition: openvdb.h:78
#define UT_VDB_CALL(GRIDT, RETURN, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:354

Macro to invoke the correct type of grid. Use like:

UTvdbReturnScalarType(grid_type, myfunction, grid, parms)

to invoke

return myfunction(grid, parms);

via:

template <typename GridType>
static RESULT
myfunction(const GridType &grid, parms)
{ }

Definition at line 447 of file UT_VDBUtils.h.

Enumeration Type Documentation

enum UT_VDBType
Enumerator
UT_VDB_INVALID 
UT_VDB_FLOAT 
UT_VDB_DOUBLE 
UT_VDB_INT32 
UT_VDB_INT64 
UT_VDB_BOOL 
UT_VDB_VEC3F 
UT_VDB_VEC3D 
UT_VDB_VEC3I 
UT_VDB_POINTINDEX 
UT_VDB_POINTDATA 

Definition at line 11 of file UT_VDBUtils.h.

Function Documentation

template<typename T >
openvdb::math::Vec4<T> SYSabs ( const openvdb::math::Vec4< T > &  v1)
inline

Definition at line 616 of file UT_VDBUtils.h.

template<typename T >
openvdb::math::Vec3<T> SYSabs ( const openvdb::math::Vec3< T > &  v1)
inline

Definition at line 624 of file UT_VDBUtils.h.

template<typename T >
openvdb::math::Vec2<T> SYSabs ( const openvdb::math::Vec2< T > &  v1)
inline

Definition at line 631 of file UT_VDBUtils.h.

template<typename T >
openvdb::math::Vec4<T> SYSmax ( const openvdb::math::Vec4< T > &  v1,
const openvdb::math::Vec4< T > &  v2 
)
inline

Definition at line 646 of file UT_VDBUtils.h.

template<typename T >
openvdb::math::Vec4<T> SYSmax ( const openvdb::math::Vec4< T > &  v1,
const openvdb::math::Vec4< T > &  v2,
const openvdb::math::Vec4< T > &  v3 
)
inline

Definition at line 662 of file UT_VDBUtils.h.

template<typename T >
openvdb::math::Vec3<T> SYSmax ( const openvdb::math::Vec3< T > &  v1,
const openvdb::math::Vec3< T > &  v2 
)
inline

Definition at line 677 of file UT_VDBUtils.h.

template<typename T >
openvdb::math::Vec3<T> SYSmax ( const openvdb::math::Vec3< T > &  v1,
const openvdb::math::Vec3< T > &  v2,
const openvdb::math::Vec3< T > &  v3 
)
inline

Definition at line 691 of file UT_VDBUtils.h.

template<typename T >
openvdb::math::Vec2<T> SYSmax ( const openvdb::math::Vec2< T > &  v1,
const openvdb::math::Vec2< T > &  v2 
)
inline

Definition at line 704 of file UT_VDBUtils.h.

template<typename T >
openvdb::math::Vec2<T> SYSmax ( const openvdb::math::Vec2< T > &  v1,
const openvdb::math::Vec2< T > &  v2,
const openvdb::math::Vec2< T > &  v3 
)
inline

Definition at line 716 of file UT_VDBUtils.h.

template<typename T >
openvdb::math::Vec4<T> SYSmin ( const openvdb::math::Vec4< T > &  v1,
const openvdb::math::Vec4< T > &  v2 
)
inline

Definition at line 638 of file UT_VDBUtils.h.

template<typename T >
openvdb::math::Vec4<T> SYSmin ( const openvdb::math::Vec4< T > &  v1,
const openvdb::math::Vec4< T > &  v2,
const openvdb::math::Vec4< T > &  v3 
)
inline

Definition at line 654 of file UT_VDBUtils.h.

template<typename T >
openvdb::math::Vec3<T> SYSmin ( const openvdb::math::Vec3< T > &  v1,
const openvdb::math::Vec3< T > &  v2 
)
inline

Definition at line 670 of file UT_VDBUtils.h.

template<typename T >
openvdb::math::Vec3<T> SYSmin ( const openvdb::math::Vec3< T > &  v1,
const openvdb::math::Vec3< T > &  v2,
const openvdb::math::Vec3< T > &  v3 
)
inline

Definition at line 684 of file UT_VDBUtils.h.

template<typename T >
openvdb::math::Vec2<T> SYSmin ( const openvdb::math::Vec2< T > &  v1,
const openvdb::math::Vec2< T > &  v2 
)
inline

Definition at line 698 of file UT_VDBUtils.h.

template<typename T >
openvdb::math::Vec2<T> SYSmin ( const openvdb::math::Vec2< T > &  v1,
const openvdb::math::Vec2< T > &  v2,
const openvdb::math::Vec2< T > &  v3 
)
inline

Definition at line 710 of file UT_VDBUtils.h.

template<typename S >
UT_Matrix4T<S> UTvdbConvert ( const openvdb::math::Mat4< S > &  src)

Matrix conversion from openvdb to UT.

Definition at line 484 of file UT_VDBUtils.h.

template<typename S >
UT_Matrix3T<S> UTvdbConvert ( const openvdb::math::Mat3< S > &  src)

Matrix conversion from openvdb to UT.

Definition at line 494 of file UT_VDBUtils.h.

template<typename S >
UT_Matrix2T<S> UTvdbConvert ( const openvdb::math::Mat2< S > &  src)

Matrix conversion from openvdb to UT.

Definition at line 503 of file UT_VDBUtils.h.

template<typename S >
openvdb::math::Mat4<S> UTvdbConvert ( const UT_Matrix4T< S > &  src)

Matrix conversion from UT to openvdb.

Definition at line 514 of file UT_VDBUtils.h.

template<typename S >
openvdb::math::Mat3<S> UTvdbConvert ( const UT_Matrix3T< S > &  src)

Matrix conversion from UT to openvdb.

Definition at line 523 of file UT_VDBUtils.h.

template<typename S >
openvdb::math::Mat2<S> UTvdbConvert ( const UT_Matrix2T< S > &  src)

Matrix conversion from UT to openvdb.

Definition at line 531 of file UT_VDBUtils.h.

template<typename S >
UT_Vector4T<S> UTvdbConvert ( const openvdb::math::Vec4< S > &  src)

Vector conversion from openvdb to UT.

Definition at line 542 of file UT_VDBUtils.h.

template<typename S >
UT_Vector3T<S> UTvdbConvert ( const openvdb::math::Vec3< S > &  src)

Vector conversion from openvdb to UT.

Definition at line 548 of file UT_VDBUtils.h.

template<typename S >
UT_Vector2T<S> UTvdbConvert ( const openvdb::math::Vec2< S > &  src)

Vector conversion from openvdb to UT.

Definition at line 554 of file UT_VDBUtils.h.

template<typename S >
openvdb::math::Vec4<S> UTvdbConvert ( const UT_Vector4T< S > &  src)

Vector conversion from UT to openvdb.

Definition at line 564 of file UT_VDBUtils.h.

template<typename S >
openvdb::math::Vec3<S> UTvdbConvert ( const UT_Vector3T< S > &  src)

Vector conversion from UT to openvdb.

Definition at line 570 of file UT_VDBUtils.h.

template<typename S >
openvdb::math::Vec2<S> UTvdbConvert ( const UT_Vector2T< S > &  src)

Vector conversion from UT to openvdb.

Definition at line 576 of file UT_VDBUtils.h.

UT_BoundingBoxD UTvdbConvert ( const openvdb::CoordBBox &  bbox)
inline

Bounding box conversion from openvdb to UT.

Definition at line 585 of file UT_VDBUtils.h.

openvdb::math::CoordBBox UTvdbConvert ( const UT_BoundingBoxI bbox)
inline

Bounding box conversion from openvdb to UT.

Definition at line 593 of file UT_VDBUtils.h.

openvdb::math::Transform::Ptr UTvdbCreateTransform ( const UT_Vector3 orig,
const UT_Vector3 voxsize 
)
inline

Utility method to construct a Transform that lines up with a cell-centered Houdini volume with specified origin and voxel size.

Definition at line 603 of file UT_VDBUtils.h.

int UTvdbGetGridTupleSize ( UT_VDBType  type)
inline

Returns the tuple size of a grid given its value type.

Definition at line 108 of file UT_VDBUtils.h.

int UTvdbGetGridTupleSize ( const openvdb::GridBase &  grid)
inline

Returns the tuple size of a grid.

Definition at line 136 of file UT_VDBUtils.h.

UT_VDBType UTvdbGetGridType ( const openvdb::GridBase &  grid)
inline

Find the UT_VDBType from a grid.

Definition at line 43 of file UT_VDBUtils.h.

const char* UTvdbGetGridTypeString ( const openvdb::GridBase &  grid)
inline

Return the string representation of a grid's underlying value type.

Definition at line 77 of file UT_VDBUtils.h.

template<typename GridType >
const GridType* UTvdbGridCast ( const openvdb::GridBase *  grid)
inline

Helpers for downcasting to a specific grid type

Definition at line 161 of file UT_VDBUtils.h.

template<typename GridType >
GridType* UTvdbGridCast ( openvdb::GridBase *  grid)
inline

Helpers for downcasting to a specific grid type

Definition at line 166 of file UT_VDBUtils.h.

template<typename GridType >
const GridType& UTvdbGridCast ( const openvdb::GridBase &  grid)
inline

Helpers for downcasting to a specific grid type

Definition at line 171 of file UT_VDBUtils.h.

template<typename GridType >
GridType& UTvdbGridCast ( openvdb::GridBase &  grid)
inline

Helpers for downcasting to a specific grid type

Definition at line 176 of file UT_VDBUtils.h.

template<typename GridType >
GridType::ConstPtr UTvdbGridCast ( openvdb::GridBase::ConstPtr  grid)
inline

Helpers for downcasting to a specific grid type

Definition at line 181 of file UT_VDBUtils.h.

template<typename GridType >
GridType::Ptr UTvdbGridCast ( openvdb::GridBase::Ptr  grid)
inline

Helpers for downcasting to a specific grid type

Definition at line 186 of file UT_VDBUtils.h.

void UTvdbInitialize ( )
inline

Calls openvdb::initialize()

Definition at line 39 of file UT_VDBUtils.h.