OpenVDB  9.0.1
Public Types | Public Member Functions | List of all members
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. More...
 
 DualGridSampler (const TreeType &sourceTree, const math::Transform &sourceXform, const math::Transform &targetXform)
 Tree and transform constructor. More...
 
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). More...
 
bool isAligned () const
 Return true if the two grids are aligned. More...
 

Detailed Description

template<typename GridOrTreeT, typename SamplerT>
class openvdb::v9_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

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

Constructor & Destructor Documentation

DualGridSampler ( const GridType sourceGrid,
const math::Transform targetXform 
)
inline

Grid and transform constructor.

Parameters
sourceGridSource grid.
targetXformTransform of the target grid.
DualGridSampler ( const TreeType sourceTree,
const math::Transform sourceXform,
const math::Transform targetXform 
)
inline

Tree and transform constructor.

Parameters
sourceTreeSource tree.
sourceXformTransform of the source grid.
targetXformTransform of the target grid.

Member Function Documentation

bool isAligned ( ) const
inline

Return true if the two grids are aligned.

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).