Loading...
Searching...
No Matches
GridTransformOp< Sampler > Class Template Reference

GridTransformOp is a functor class for use with GridBase::apply() that samples an input grid into an output grid of the same type through a given affine transform. More...

`#include <openvdb_houdini/UT_VDBTools.h>`

## Public Member Functions

| GridTransformOp (GridPtr &outGrid, const openvdb::tools::GridTransformer &t)
template<typename GridType>
void | operator() (const GridType &inGrid)

## Detailed Description

template<typename Sampler>
class openvdb_houdini::GridTransformOp< Sampler >

GridTransformOp is a functor class for use with GridBase::apply() that samples an input grid into an output grid of the same type through a given affine transform.

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

See also
  GridResampleOp, GridResampleToMatchOp

Example:
  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();
  // Initialize a GridTransformer with the parameters of an affine transform.
  openvdb::tools::GridTransformer xform(pivot, scale, rotate, ...);
  // Resolve the input grid's type and resample it into the output grid,
  // using a second-order sampling kernel.
  GridTransformOp<openvdb::tools::QuadraticSampler> op(outGrid, xform);
  inGrid.apply<openvdb_houdini::ScalarGridTypes>(op);
  openvdb::v10_0::GridBase::copyGridWithNewTree
  virtual GridBase::Ptr copyGridWithNewTree() const =0
  Return a new grid of the same type as this grid whose metadata and transform are deep copies of this ...
  openvdb::v10_0::GridBase::apply
  bool apply(OpT &) const
  If this grid resolves to one of the listed grid types, invoke the given functor on the resolved grid.
  Definition Grid.h:1768
  openvdb_houdini::GridTransformOp::GridTransformOp
  GridTransformOp(GridPtr &outGrid, const openvdb::tools::GridTransformer &t)
  Definition UT_VDBTools.h:48
  openvdb_houdini::GridPtr
  openvdb::GridBase::Ptr GridPtr
  Definition Utils.h:35
  openvdb_houdini::Grid
  openvdb::GridBase Grid
  Definition Utils.h:34
  openvdb_houdini::ScalarGridTypes
  openvdb::TypeList< openvdb::BoolGrid, openvdb::FloatGrid, openvdb::DoubleGrid, openvdb::Int32Grid, openvdb::Int64Grid > ScalarGridTypes
  Definition Utils.h:317

## Constructor & Destructor Documentation

## GridTransformOp()

template<typename Sampler>

GridTransformOp | ( | GridPtr & | outGrid,
|  | const openvdb::tools::GridTransformer & | t )

inline

Parameters

  outGrid | a generic pointer to an output grid of the same type as the grid to be resampled
  t | a `GridTransformer` that defines an affine transform

Note
  GridTransformOp makes an internal copy of the `GridTransformer` and supplies the copy with a default Interrupter that replaces any existing interrupter.

## Member Function Documentation

## operator()()

template<typename Sampler>
template<typename GridType>

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

inline