OpenVDB  12.0.0
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 <openvdb_houdini/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 ( 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

void operator() ( const GridType &  inGrid)
inline