HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
openvdb::OPENVDB_VERSION_NAME::tools::GridSampler< GridOrTreeType, SamplerType > Class Template Reference

Class that provides the interface for continuous sampling of values in a tree. More...

#include <Interpolation.h>

Public Types

using Ptr = SharedPtr< GridSampler >
 
using ValueType = typename GridOrTreeType::ValueType
 
using GridType = typename TreeAdapter< GridOrTreeType >::GridType
 
using TreeType = typename TreeAdapter< GridOrTreeType >::TreeType
 
using AccessorType = typename TreeAdapter< GridOrTreeType >::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::OPENVDB_VERSION_NAME::tools::GridSampler< GridOrTreeType, SamplerType >

Class that provides the interface for continuous sampling of values in a tree.

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 it is normally advisable to use the template specialization below that employs a ValueAccessor. However, care must be taken when dealing with multi-threading (see warning below).

Definition at line 310 of file Interpolation.h.

Member Typedef Documentation

template<typename GridOrTreeType , typename SamplerType >
using openvdb::OPENVDB_VERSION_NAME::tools::GridSampler< GridOrTreeType, SamplerType >::AccessorType = typename TreeAdapter<GridOrTreeType>::AccessorType

Definition at line 317 of file Interpolation.h.

template<typename GridOrTreeType , typename SamplerType >
using openvdb::OPENVDB_VERSION_NAME::tools::GridSampler< GridOrTreeType, SamplerType >::GridType = typename TreeAdapter<GridOrTreeType>::GridType

Definition at line 315 of file Interpolation.h.

template<typename GridOrTreeType , typename SamplerType >
using openvdb::OPENVDB_VERSION_NAME::tools::GridSampler< GridOrTreeType, SamplerType >::Ptr = SharedPtr<GridSampler>

Definition at line 313 of file Interpolation.h.

template<typename GridOrTreeType , typename SamplerType >
using openvdb::OPENVDB_VERSION_NAME::tools::GridSampler< GridOrTreeType, SamplerType >::TreeType = typename TreeAdapter<GridOrTreeType>::TreeType

Definition at line 316 of file Interpolation.h.

template<typename GridOrTreeType , typename SamplerType >
using openvdb::OPENVDB_VERSION_NAME::tools::GridSampler< GridOrTreeType, SamplerType >::ValueType = typename GridOrTreeType::ValueType

Definition at line 314 of file Interpolation.h.

Constructor & Destructor Documentation

template<typename GridOrTreeType , typename SamplerType >
openvdb::OPENVDB_VERSION_NAME::tools::GridSampler< GridOrTreeType, SamplerType >::GridSampler ( const GridType grid)
inlineexplicit
Parameters
grida grid to be sampled

Definition at line 320 of file Interpolation.h.

template<typename GridOrTreeType , typename SamplerType >
openvdb::OPENVDB_VERSION_NAME::tools::GridSampler< GridOrTreeType, SamplerType >::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.

Definition at line 325 of file Interpolation.h.

Member Function Documentation

template<typename GridOrTreeType , typename SamplerType >
ValueType openvdb::OPENVDB_VERSION_NAME::tools::GridSampler< GridOrTreeType, SamplerType >::isSample ( const Coord &  ijk) const
inline

Sample value in integer index space.

Parameters
ijkthe location in index space

Definition at line 353 of file Interpolation.h.

template<typename GridOrTreeType , typename SamplerType >
ValueType openvdb::OPENVDB_VERSION_NAME::tools::GridSampler< GridOrTreeType, SamplerType >::isSample ( const Vec3d &  ispoint) const
inline

Sample in fractional index space.

Parameters
ispointthe location in index space

Definition at line 357 of file Interpolation.h.

template<typename GridOrTreeType , typename SamplerType >
template<typename RealType >
ValueType openvdb::OPENVDB_VERSION_NAME::tools::GridSampler< GridOrTreeType, SamplerType >::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

Definition at line 335 of file Interpolation.h.

template<typename GridOrTreeType , typename SamplerType >
ValueType openvdb::OPENVDB_VERSION_NAME::tools::GridSampler< GridOrTreeType, SamplerType >::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

Definition at line 344 of file Interpolation.h.

template<typename GridOrTreeType , typename SamplerType >
const math::Transform& openvdb::OPENVDB_VERSION_NAME::tools::GridSampler< GridOrTreeType, SamplerType >::transform ( ) const
inline

Definition at line 328 of file Interpolation.h.

template<typename GridOrTreeType , typename SamplerType >
ValueType openvdb::OPENVDB_VERSION_NAME::tools::GridSampler< GridOrTreeType, SamplerType >::wsSample ( const Vec3d &  wspoint) const
inline

Sample in world space.

Parameters
wspointthe location in world space

Definition at line 366 of file Interpolation.h.


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