OpenVDB  2.1.0
Public Types | Public Member Functions | List of all members
GridSampler< GridOrTreeType, SamplerType > Class Template Reference

Class that provides the interface for continuous sampling of values in a tree. Consider using the GridSampler below instead. More...

#include <Interpolation.h>

Public Types

typedef boost::shared_ptr
< GridSampler
Ptr
 
typedef GridOrTreeType::ValueType ValueType
 
typedef TreeAdapter
< GridOrTreeType >::GridType 
GridType
 
typedef TreeAdapter
< GridOrTreeType >::TreeType 
TreeType
 
typedef TreeAdapter
< GridOrTreeType >
::AccessorType 
AccessorType
 

Public Member Functions

 GridSampler (const GridType &grid)
 
 GridSampler (const TreeType &tree, const math::Transform &transform)
 
const math::Transformtransform () const
 
template<typename RealType >
ValueType sampleVoxel (const RealType &x, const RealType &y, const RealType &z) const
 Sample a point in index space in the grid. More...
 
ValueType sampleVoxel (typename Coord::ValueType i, typename Coord::ValueType j, typename Coord::ValueType k) const
 Sample value in integer index space. More...
 
ValueType isSample (const Coord &ijk) const
 Sample value in integer index space. More...
 
ValueType isSample (const Vec3d &ispoint) const
 Sample in fractional index space. More...
 
ValueType wsSample (const Vec3d &wspoint) const
 Sample in world space. More...
 

Detailed Description

template<typename GridOrTreeType, typename SamplerType>
class openvdb::v2_1_0::tools::GridSampler< GridOrTreeType, SamplerType >

Class that provides the interface for continuous sampling of values in a tree. Consider using the GridSampler below instead.

Since trees support only discrete voxel sampling, TreeSampler must be used to sample arbitrary continuous points in (world or index) space.

Warning
This implementation of the GridSampler stores a pointer to a Tree for value access. While this is thread-safe it is uncached and hence slow compared to using a ValueAccessor. Consequently is it normally advisable to use the template specialization below that employs a ValueAccessor. However case must be taken when dealing with multi-threading (see warning below).

Member Typedef Documentation

typedef TreeAdapter<GridOrTreeType>::AccessorType AccessorType
typedef TreeAdapter<GridOrTreeType>::GridType GridType
typedef boost::shared_ptr<GridSampler> Ptr
typedef TreeAdapter<GridOrTreeType>::TreeType TreeType
typedef GridOrTreeType::ValueType ValueType

Constructor & Destructor Documentation

GridSampler ( const GridType grid)
inlineexplicit
Parameters
grida grid to be sampled
GridSampler ( const TreeType tree,
const math::Transform transform 
)
inline
Parameters
treea tree to be sampled, or a ValueAccessor for the tree
transformis used when sampling world space locations.

Member Function Documentation

ValueType isSample ( const Coord &  ijk) const
inline

Sample value in integer index space.

Parameters
ijkthe location in index space
ValueType isSample ( const Vec3d &  ispoint) const
inline

Sample in fractional index space.

Parameters
ispointthe location in index space
ValueType sampleVoxel ( const RealType &  x,
const RealType &  y,
const RealType &  z 
) const
inline

Sample a point in index space in the grid.

Parameters
xFractional x-coordinate of point in index-coordinates of grid
yFractional y-coordinate of point in index-coordinates of grid
zFractional z-coordinate of point in index-coordinates of grid
ValueType sampleVoxel ( typename Coord::ValueType  i,
typename Coord::ValueType  j,
typename Coord::ValueType  k 
) const
inline

Sample value in integer index space.

Parameters
iInteger x-coordinate in index space
jInteger y-coordinate in index space
kInteger x-coordinate in index space
const math::Transform& transform ( ) const
inline
ValueType wsSample ( const Vec3d &  wspoint) const
inline

Sample in world space.

Parameters
wspointthe location in world space

The documentation for this class was generated from the following file: