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 350 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;
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 237 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:376
#define UTvdbCallVec3Type(TYPE, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:383
#define UTvdbCallBoolType(TYPE, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:397

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 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:376
#define UTvdbCallVec3Type(TYPE, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:383

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)
{ }
Examples:
SIM/GAS_NetVDBSliceExchange.C.

Definition at line 401 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__) \
#define UT_VDB_CALL(GRIDT, RETURN, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:350
Grid< BoolTree > BoolGrid
Definition: NanoVDB.h:6504

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 397 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:350
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 391 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__) \
Grid< DoubleTree > DoubleGrid
Definition: NanoVDB.h:6494
Grid< FloatTree > FloatGrid
Definition: NanoVDB.h:6489
#define UT_VDB_CALL(GRIDT, RETURN, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:350

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 370 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: NanoVDB.h:6497
#define UTvdbCallRealType(TYPE, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:370
#define UT_VDB_CALL(GRIDT, RETURN, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:350
Grid< Int32Tree > Int32Grid
Definition: NanoVDB.h:6495

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 376 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< Vec3fTree > Vec3fGrid
Definition: NanoVDB.h:6498
Grid< Vec3ITree > Vec3IGrid
Definition: NanoVDB.h:6502
#define UT_VDB_CALL(GRIDT, RETURN, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:350
Grid< Vec3dTree > Vec3dGrid
Definition: NanoVDB.h:6499

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 383 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:436
#define UTvdbReturnBoolType(TYPE, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:457
#define UTvdbReturnVec3Type(TYPE, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:443

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 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:436
#define UTvdbReturnVec3Type(TYPE, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:443

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 UTvdbReturnBoolType (   TYPE,
  FNAME,
  GRIDBASE,
  ... 
)
Value:
if (TYPE == UT_VDB_BOOL) \
UT_VDB_CALL(openvdb::BoolGrid,return,FNAME,GRIDBASE,__VA_ARGS__) \
#define UT_VDB_CALL(GRIDT, RETURN, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:350
Grid< BoolTree > BoolGrid
Definition: NanoVDB.h:6504

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 457 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:350
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 451 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__) \
Grid< DoubleTree > DoubleGrid
Definition: NanoVDB.h:6494
Grid< FloatTree > FloatGrid
Definition: NanoVDB.h:6489
#define UT_VDB_CALL(GRIDT, RETURN, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:350

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 430 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: NanoVDB.h:6497
#define UTvdbReturnRealType(TYPE, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:430
#define UT_VDB_CALL(GRIDT, RETURN, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:350
Grid< Int32Tree > Int32Grid
Definition: NanoVDB.h:6495

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 436 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< Vec3fTree > Vec3fGrid
Definition: NanoVDB.h:6498
Grid< Vec3ITree > Vec3IGrid
Definition: NanoVDB.h:6502
#define UT_VDB_CALL(GRIDT, RETURN, FNAME, GRIDBASE,...)
Definition: UT_VDBUtils.h:350
Grid< Vec3dTree > Vec3dGrid
Definition: NanoVDB.h:6499

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 443 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 
Examples:
SIM/GAS_NetVDBSliceExchange.C.

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 612 of file UT_VDBUtils.h.

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

Definition at line 620 of file UT_VDBUtils.h.

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

Definition at line 627 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 642 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 658 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 673 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 687 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 700 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 712 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 634 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 650 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 666 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 680 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 694 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 706 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 480 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 490 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 499 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 510 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 519 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 527 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 538 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 544 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 550 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 560 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 566 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 572 of file UT_VDBUtils.h.

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

Bounding box conversion from openvdb to UT.

Definition at line 581 of file UT_VDBUtils.h.

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

Bounding box conversion from openvdb to UT.

Definition at line 589 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 599 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.