6 #ifndef OPENVDB_TOOLS_VECTORTRANSFORMER_HAS_BEEN_INCLUDED
7 #define OPENVDB_TOOLS_VECTORTRANSFORMER_HAS_BEEN_INCLUDED
14 #include <type_traits>
25 template<
typename Gr
idType>
39 template<
typename TreeIterT>
void operator()(
const TreeIterT& it)
const
42 it.setValue(
mat.transformH(v));
50 template<
typename TreeIterT>
54 it.setValue(
mat.transform3x3(v));
62 template<
typename TreeIterT>
66 v =
mat.transform3x3(v);
77 template<
typename Gr
idType>
inline
78 typename std::enable_if<!VecTraits<typename GridType::ValueType>::IsVec,
void>
::type
81 OPENVDB_THROW(TypeError,
"tools::transformVectors() requires a vector-valued grid");
85 template<
typename Gr
idType>
inline
86 typename std::enable_if<VecTraits<typename GridType::ValueType>::IsVec,
void>
::type
89 if (!grid.isInWorldSpace())
return;
91 const VecType vecType = grid.getVectorType();
100 foreach(grid.beginValueAll(), MatMulNormalize(invmat));
102 foreach(grid.beginValueAll(), MatMul(invmat));
108 foreach(grid.beginValueAll(), MatMul(mat));
112 foreach(grid.beginValueAll(), HomogeneousMatMul(mat));
124 template<
typename Gr
idType>
128 doTransformVectors<GridType>(grid, mat);
137 #ifdef OPENVDB_USE_EXPLICIT_INSTANTIATION
139 #ifdef OPENVDB_INSTANTIATE_VECTORTRANSFORMER
143 #define _FUNCTION(TreeT) \
144 void transformVectors(Grid<TreeT>&, const Mat4d&)
148 #endif // OPENVDB_USE_EXPLICIT_INSTANTIATION
155 #endif // OPENVDB_TOOLS_VECTORTRANSFORMER_HAS_BEEN_INCLUDED
GridType
List of types that are currently supported by NanoVDB.
#define OPENVDB_USE_VERSION_NAMESPACE
#define OPENVDB_VEC3_TREE_INSTANTIATE(Function)
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Mat4 inverse(T tolerance=0) const
#define OPENVDB_THROW(exception, message)