OpenVDB 5.1.0

Public Types | Public Member Functions | List of all members
GridSampler< tree::ValueAccessor< TreeT >, SamplerType > Class Template Reference

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

`#include <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 >

## Public Member Functions
| GridSampler (const AccessorType &acc, const math::Transform &transform)
const math::Transform & | transform () 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 TreeT, typename SamplerType>
class openvdb::v5_1::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

using AccessorType = typename tree::ValueAccessor<TreeT>

## ◆ GridType

using GridType = Grid<TreeType>

## ◆ Ptr

using Ptr = SharedPtr<GridSampler>

## ◆ TreeType

using TreeType = TreeT

## ◆ ValueType

using ValueType = typename TreeT::ValueType

## Constructor & Destructor Documentation

## ◆ GridSampler()

GridSampler | ( | const AccessorType & | acc,
|  | const math::Transform & | transform
| ) |  |
| inline

Parameters

  acc | a ValueAccessor to be sampled
  transform | is used when sampling world space locations.

## Member Function Documentation

## ◆ isSample() [1/2]

ValueType isSample | ( | const Coord & | ijk | ) | const
| inline

Sample value in integer index space.

Parameters

  ijk | the location in index space

## ◆ isSample() [2/2]

ValueType isSample | ( | const Vec3d & | ispoint | ) | const
| inline

Sample in fractional index space.

Parameters

  ispoint | the location in index space

## ◆ sampleVoxel() [1/2]

ValueType sampleVoxel | ( | const RealType & | x,
|  | const RealType & | y,
|  | const RealType & | z
| ) |  | const
| inline

Sample a point in index space in the grid.

Parameters

  x | Fractional x-coordinate of point in index-coordinates of grid
  y | Fractional y-coordinate of point in index-coordinates of grid
  z | Fractional z-coordinate of point in index-coordinates of grid

## ◆ sampleVoxel() [2/2]

ValueType sampleVoxel | ( | typename Coord::ValueType | i,
|  | typename Coord::ValueType | j,
|  | typename Coord::ValueType | k
| ) |  | const
| inline

Sample value in integer index space.

Parameters

  i | Integer x-coordinate in index space
  j | Integer y-coordinate in index space
  k | Integer x-coordinate in index space

## ◆ transform()

const math::Transform& transform | ( |  | ) | const
| inline

## ◆ wsSample()

ValueType wsSample | ( | const Vec3d & | wspoint | ) | const
| inline

Sample in world space.

Parameters

  wspoint | the location in world space

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

- Interpolation.h