OpenVDB 13.0.0

Loading...
Searching...
No Matches
GridResampler Class Reference

`#include <openvdb/tools/GridTransformer.h>`

Inheritance diagram for GridResampler:

## Public Types
using | Ptr = SharedPtr<GridResampler>
using | InterruptFunc = std::function<bool (void)>

## Public Member Functions
| GridResampler ()
virtual | ~GridResampler ()
| GridResampler (const GridResampler &)=default
GridResampler & | operator= (const GridResampler &)=default
void | setThreaded (bool b)
| Enable or disable threading. (Threading is enabled by default.).
bool | threaded () const
| Return `true` if threading is enabled.
void | setTransformTiles (bool b)
| Enable or disable processing of tiles. (Enabled by default, except for level set grids.).
bool | transformTiles () const
| Return `true` if tile processing is enabled.
template<typename InterrupterType>
void | setInterrupter (InterrupterType &)
| Allow processing to be aborted by providing an interrupter object. The interrupter will be queried periodically during processing.
template<typename Sampler, typename GridT, typename Transformer>
void | transformGrid (const Transformer &, const GridT &inGrid, GridT &outGrid) const

## Protected Member Functions
template<typename Sampler, typename GridT, typename Transformer>
void | applyTransform (const Transformer &, const GridT &inGrid, GridT &outGrid) const
bool | interrupt () const

## Detailed Description

A GridResampler applies a geometric transformation to an input grid using one of several sampling schemes, and stores the result in an output grid.

Usage:

GridResampler resampler();
resampler.transformGrid<BoxSampler>(xform, inGrid, outGrid);
openvdb::v13_0::tools::GridResampler::GridResampler
GridResampler()
Definition GridTransformer.h:168
openvdb::v13_0::tools::outGrid
OutGridT & outGrid
Definition ValueTransformer.h:139
openvdb::v13_0::tools::BoxSampler
Definition Interpolation.h:121

where `xform` is a functor that implements the following methods:

bool isAffine() const
openvdb::Vec3d transform(const openvdb::Vec3d&) const
openvdb::Vec3d invTransform(const openvdb::Vec3d&) const
openvdb::v13_0::math::Vec3d
Vec3< double > Vec3d
Definition Vec3.h:665
openvdb
Definition Exceptions.h:13

Note
  When the transform is affine and can be expressed as a 4 x 4 matrix, a GridTransformer is much more efficient than a GridResampler.

## Member Typedef Documentation

## ◆ InterruptFunc

using InterruptFunc = std::function<bool (void)>

## ◆ Ptr

using Ptr = SharedPtr<GridResampler>

## Constructor & Destructor Documentation

## ◆ GridResampler() [1/2]

GridResampler | ( |  | ) |
| inline

## ◆ ~GridResampler()

virtual ~GridResampler | ( |  | ) |
| inline virtual

## ◆ GridResampler() [2/2]

GridResampler | ( | const GridResampler & |  | ) |
| default

## Member Function Documentation

## ◆ applyTransform()

template<class Sampler, class GridT, typename Transformer>

void applyTransform | ( | const Transformer & | xform,
|  | const GridT & | inGrid,
|  | GridT & | outGrid ) const
| protected

## ◆ interrupt()

bool interrupt | ( |  | ) | const
| inline protected

## ◆ operator=()

GridResampler & operator= | ( | const GridResampler & |  | ) |
| default

## ◆ setInterrupter()

template<typename InterrupterType>

void setInterrupter | ( | InterrupterType & | interrupter | ) |

Allow processing to be aborted by providing an interrupter object. The interrupter will be queried periodically during processing.

See also
  util/NullInterrupter.h for interrupter interface requirements.

## ◆ setThreaded()

void setThreaded | ( | bool | b | ) |
| inline

Enable or disable threading. (Threading is enabled by default.).

## ◆ setTransformTiles()

void setTransformTiles | ( | bool | b | ) |
| inline

Enable or disable processing of tiles. (Enabled by default, except for level set grids.).

## ◆ threaded()

bool threaded | ( |  | ) | const
| inline

Return `true` if threading is enabled.

## ◆ transformGrid()

template<typename Sampler, typename GridT, typename Transformer>

void transformGrid | ( | const Transformer & | xform,
|  | const GridT & | inGrid,
|  | GridT & | outGrid ) const

## ◆ transformTiles()

bool transformTiles | ( |  | ) | const
| inline

Return `true` if tile processing is enabled.