OpenVDB 12.0.0
 
Loading...
Searching...
No Matches
GridSampler< tree::ValueAccessor< TreeT >, SamplerType > Class Template Reference

Specialization of GridSampler for construction from a ValueAccessor type. More...

#include <openvdb/tools/Interpolation.h>

Public Types

using Ptr = SharedPtr<GridSampler>
 
using ValueType = typename TreeT::ValueType
 
using TreeType = TreeT
 
using GridType = Grid<TreeType>
 
using AccessorType = typename tree::ValueAccessor<TreeT>
 
using Ptr
 
using ValueType
 
using GridType
 
using TreeType
 
using AccessorType
 

Public Member Functions

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

Detailed Description

template<typename TreeT, typename SamplerType>
class openvdb::v12_0::tools::GridSampler< tree::ValueAccessor< TreeT >, SamplerType >

Specialization of GridSampler for construction from a ValueAccessor type.

Note
This version should normally be favored over the one above that takes a Grid or Tree. The reason is this version uses a ValueAccessor that performs fast (cached) access where the tree-based flavor performs slower (uncached) access.
Warning
Since this version stores a pointer to an (externally allocated) value accessor it is not threadsafe. Hence each thread should have its own instance of a GridSampler constructed from a local ValueAccessor. Alternatively the Grid/Tree-based GridSampler is threadsafe, but also slower.

Member Typedef Documentation

◆ AccessorType [1/2]

using AccessorType

◆ AccessorType [2/2]

template<typename TreeT, typename SamplerType>
using AccessorType = typename tree::ValueAccessor<TreeT>

◆ GridType [1/2]

using GridType

◆ GridType [2/2]

template<typename TreeT, typename SamplerType>
using GridType = Grid<TreeType>

◆ Ptr [1/2]

using Ptr

◆ Ptr [2/2]

template<typename TreeT, typename SamplerType>
using Ptr = SharedPtr<GridSampler>

◆ TreeType [1/2]

using TreeType

◆ TreeType [2/2]

template<typename TreeT, typename SamplerType>
using TreeType = TreeT

◆ ValueType [1/2]

using ValueType

◆ ValueType [2/2]

template<typename TreeT, typename SamplerType>
using ValueType = typename TreeT::ValueType

Constructor & Destructor Documentation

◆ GridSampler() [1/3]

template<typename TreeT, typename SamplerType>
GridSampler ( const AccessorType & acc,
const math::Transform & transform )
inline
Parameters
acca ValueAccessor to be sampled
transformis used when sampling world space locations.

◆ GridSampler() [2/3]

GridSampler ( const GridType & grid)
inlineexplicit
Parameters
grida grid to be sampled

◆ GridSampler() [3/3]

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

◆ isSample() [1/4]

ValueType isSample ( const Coord & ijk) const
inline

Sample value in integer index space.

Parameters
ijkthe location in index space

◆ isSample() [2/4]

template<typename TreeT, typename SamplerType>
ValueType isSample ( const Coord & ijk) const
inline

Sample value in integer index space.

Parameters
ijkthe location in index space

◆ isSample() [3/4]

ValueType isSample ( const Vec3d & ispoint) const
inline

Sample in fractional index space.

Parameters
ispointthe location in index space

◆ isSample() [4/4]

template<typename TreeT, typename SamplerType>
ValueType isSample ( const Vec3d & ispoint) const
inline

Sample in fractional index space.

Parameters
ispointthe location in index space

◆ sampleVoxel() [1/4]

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

◆ sampleVoxel() [2/4]

template<typename TreeT, typename SamplerType>
template<typename RealType>
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

◆ sampleVoxel() [3/4]

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

◆ sampleVoxel() [4/4]

template<typename TreeT, typename SamplerType>
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

◆ transform() [1/2]

const math::Transform & transform ( ) const
inline

◆ transform() [2/2]

template<typename TreeT, typename SamplerType>
const math::Transform & transform ( ) const
inline

◆ wsSample() [1/2]

ValueType wsSample ( const Vec3d & wspoint) const
inline

Sample in world space.

Parameters
wspointthe location in world space

◆ wsSample() [2/2]

template<typename TreeT, typename SamplerType>
ValueType wsSample ( const Vec3d & wspoint) const
inline

Sample in world space.

Parameters
wspointthe location in world space