OpenVDB: GridResampleOp< Sampler, TransformerType > Class Template Reference

OpenVDB 12.1.1

Loading...
Searching...
No Matches
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::GridResampleOp::GridResampleOp
  GridResampleOp(GridPtr &outGrid, const TransformerType &t)
  Definition UT_VDBTools.h:108
  openvdb::v12_1::math::Vec3d
  Vec3< double > Vec3d
  Definition Vec3.h:665
  openvdb::v12_1::tools::op
  OutGridT XformOp & op
  Definition ValueTransformer.h:140
  openvdb::v12_1::tools::outGrid
  OutGridT & outGrid
  Definition ValueTransformer.h:139
  openvdb_houdini::ScalarGridTypes
  openvdb::TypeList< openvdb::BoolGrid, openvdb::FloatGrid, openvdb::DoubleGrid, openvdb::Int32Grid, openvdb::Int64Grid > ScalarGridTypes
  Definition Utils.h:326
  openvdb_houdini::GridPtr
  openvdb::GridBase::Ptr GridPtr
  Definition Utils.h:44
  openvdb_houdini::Grid
  openvdb::GridBase Grid
  Definition Utils.h:43

## 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