OpenVDB: GridResampleOp< Sampler, TransformerType > Class Template Reference

OpenVDB 10.0.1

Loading...
Searching...
No Matches
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());
  inGrid.apply<openvdb_houdini::ScalarGridTypes>(op);
  openvdb_houdini::GridPtr
  openvdb::GridBase::Ptr GridPtr
  Definition Utils.h:35
  openvdb_houdini::Grid
  openvdb::GridBase Grid
  Definition Utils.h:34
  openvdb::v10_0::TypeList
  A list of types (not necessarily unique)
  Definition TypeList.h:484

## Constructor & Destructor Documentation

## ◆ GridResampleOp()

template<typename Sampler , typename TransformerType >

GridResampleOp | ( | GridPtr & | outGrid,
|  | const TransformerType & | t
| ) |  |
| inline

Parameters

  outGrid | a generic pointer to an output grid of the same type as the grid to be resampled
  t | an object that implements `GridResampler`'s Transformer interface

Note
  GridResampleOp makes an internal copy of t.

## Member Function Documentation

## ◆ operator()()

template<typename Sampler , typename TransformerType >
template<typename GridType >

void operator() | ( | const GridType & | inGrid | ) |
| inline