Loading...
Searching...
No Matches
DualGridSampler< GridOrTreeT, SamplerT > Class Template Reference

This is a simple convenience class that allows for sampling from a source grid into the index space of a target grid. At construction the source and target grids are checked for alignment which potentially renders interpolation unnecessary. Else interpolation is performed according to the templated Sampler type. More...

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

## Public Types

using | ValueType = typename GridOrTreeT::ValueType
using | GridType = typename TreeAdapter< GridOrTreeT >::GridType
using | TreeType = typename TreeAdapter< GridOrTreeT >::TreeType
using | AccessorType = typename TreeAdapter< GridType >::AccessorType

## Public Member Functions

| DualGridSampler (const GridType &sourceGrid, const math::Transform &targetXform)
| Grid and transform constructor.
| DualGridSampler (const TreeType &sourceTree, const math::Transform &sourceXform, const math::Transform &targetXform)
| Tree and transform constructor.
ValueType | operator() (const Coord &ijk) const
| Return the value of the source grid at the index coordinates, ijk, relative to the target grid (or its tranform).
bool | isAligned () const
| Return true if the two grids are aligned.

## Detailed Description

template<typename GridOrTreeT, typename SamplerT>
class openvdb::v11_0::tools::DualGridSampler< GridOrTreeT, SamplerT >

This is a simple convenience class that allows for sampling from a source grid into the index space of a target grid. At construction the source and target grids are checked for alignment which potentially renders interpolation unnecessary. Else interpolation is performed according to the templated Sampler type.

Warning
  For performance reasons the check for alignment of the two grids is only performed at construction time!

## Member Typedef Documentation

## AccessorType

template<typename GridOrTreeT , typename SamplerT >

using AccessorType = typename TreeAdapter<GridType>::AccessorType

## GridType

template<typename GridOrTreeT , typename SamplerT >

using GridType = typename TreeAdapter<GridOrTreeT>::GridType

## TreeType

template<typename GridOrTreeT , typename SamplerT >

using TreeType = typename TreeAdapter<GridOrTreeT>::TreeType

## ValueType

template<typename GridOrTreeT , typename SamplerT >

using ValueType = typename GridOrTreeT::ValueType

## Constructor & Destructor Documentation

## DualGridSampler() [1/2]

template<typename GridOrTreeT , typename SamplerT >

DualGridSampler | ( | const GridType & | sourceGrid,
|  | const math::Transform & | targetXform
| ) |  |

inline

Grid and transform constructor.

Parameters

  sourceGrid | Source grid.
  targetXform | Transform of the target grid.

## DualGridSampler() [2/2]

template<typename GridOrTreeT , typename SamplerT >

DualGridSampler | ( | const TreeType & | sourceTree,
|  | const math::Transform & | sourceXform,
|  | const math::Transform & | targetXform
| ) |  |

inline

Tree and transform constructor.

Parameters

  sourceTree | Source tree.
  sourceXform | Transform of the source grid.
  targetXform | Transform of the target grid.

## Member Function Documentation

## isAligned()

template<typename GridOrTreeT , typename SamplerT >

bool isAligned | ( |  | ) | const

inline

Return true if the two grids are aligned.

## operator()()

template<typename GridOrTreeT , typename SamplerT >

ValueType operator() | ( | const Coord & | ijk | ) | const

inline

Return the value of the source grid at the index coordinates, ijk, relative to the target grid (or its tranform).