OpenVDB  7.2.1
Public Member Functions | List of all members
GridResampleOp< Sampler, TransformerType > Class Template Reference

GridResampleOp is a functor class for use with UTvdbProcessTypedGrid() that samples an input grid into an output grid of the same type through a given transform. More...

#include <UT_VDBTools.h>

Public Member Functions

 GridResampleOp (GridPtr &outGrid, const TransformerType &t)
 
template<typename GridType >
void operator() (const GridType &inGrid)
 

Detailed Description

template<typename Sampler, typename TransformerType>
class openvdb_houdini::GridResampleOp< Sampler, TransformerType >

GridResampleOp is a functor class for use with UTvdbProcessTypedGrid() that samples an input grid into an output grid of the same type through a given transform.

The output grid's transform is unchanged by this operation.

See also
GridTransformOp, GridResampleToMatchOp
Example:
namespace {
// Class that implements GridResampler's Transformer interface
struct MyXform
{
bool isAffine() const { ... }
openvdb::Vec3d transform(const openvdb::Vec3d&) const { ... }
openvdb::Vec3d invTransform(const openvdb::Vec3d&) const { ... }
};
}
const Grid& inGrid = ...; // generic reference to a grid of any type
// Create a new, empty output grid of the same (so far, unknown) type
// as the input grid and with the same transform and metadata.
GridPtr outGrid = inGrid.copyGridWithNewTree();
// Resolve the input grid's type and resample it into the output grid,
// using a trilinear sampling kernel.
GridResampleOp<openvdb::tools::BoxSampler, MyXform> op(outGrid, MyXform());

Constructor & Destructor Documentation

◆ GridResampleOp()

GridResampleOp ( GridPtr outGrid,
const TransformerType &  t 
)
inline
Parameters
outGrida generic pointer to an output grid of the same type as the grid to be resampled
tan object that implements GridResampler's Transformer interface
Note
GridResampleOp makes an internal copy of t.

Member Function Documentation

◆ operator()()

void operator() ( const GridType &  inGrid)
inline

The documentation for this class was generated from the following file:
openvdb::v7_2::math::isAffine
bool isAffine(const Mat4< T > &m)
Definition: Mat4.h:1312
openvdb::v7_2::TypeList
A list of types (not necessarily unique)
Definition: TypeList.h:366
openvdb_houdini::Grid
openvdb::GridBase Grid
Definition: openvdb_houdini/openvdb_houdini/Utils.h:33
openvdb::v7_2::math::Vec3d
Vec3< double > Vec3d
Definition: Vec3.h:662
openvdb_houdini::GridPtr
openvdb::GridBase::Ptr GridPtr
Definition: openvdb_houdini/openvdb_houdini/Utils.h:34