OpenVDB  11.0.0
Classes | Namespaces | Functions
Interpolation.h File Reference
#include <openvdb/version.h>
#include <openvdb/Platform.h>
#include <openvdb/math/Math.h>
#include <openvdb/math/Transform.h>
#include <openvdb/Grid.h>
#include <openvdb/tree/ValueAccessor.h>
#include <cmath>
#include <type_traits>

Go to the source code of this file.


struct  Sampler< Order, Staggered >
 Provises a unified interface for sampling, i.e. interpolation. More...
struct  PointSampler
struct  BoxSampler
struct  QuadraticSampler
struct  StaggeredPointSampler
struct  StaggeredBoxSampler
struct  StaggeredQuadraticSampler
class  GridSampler< GridOrTreeType, SamplerType >
 Class that provides the interface for continuous sampling of values in a tree. More...
class  GridSampler< tree::ValueAccessor< TreeT >, SamplerType >
 Specialization of GridSampler for construction from a ValueAccessor type. More...
class  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. More...
class  DualGridSampler< tree::ValueAccessor< TreeT >, SamplerT >
 Specialization of DualGridSampler for construction from a ValueAccessor type. More...
class  AlphaMask< GridT, MaskT, SamplerT, FloatT >
struct  Sampler< 0, false >
struct  Sampler< 1, false >
struct  Sampler< 2, false >
struct  Sampler< 0, true >
struct  Sampler< 1, true >
struct  Sampler< 2, true >




Vec3i floorVec3 (const Vec3R &v)
Vec3i ceilVec3 (const Vec3R &v)
Vec3i roundVec3 (const Vec3R &v)

Detailed Description

Sampler classes such as PointSampler and BoxSampler that are intended for use with tools::GridTransformer should operate in voxel space and must adhere to the interface described in the example below:

struct MySampler
// Return a short name that can be used to identify this sampler
// in error messages and elsewhere.
const char* name() { return "mysampler"; }
// Return the radius of the sampling kernel in voxels, not including
// the center voxel. This is the number of voxels of padding that
// are added to all sides of a volume as a result of resampling.
int radius() { return 2; }
// Return true if scaling by a factor smaller than 0.5 (along any axis)
// should be handled via a mipmapping-like scheme of successive halvings
// of a grid's resolution, until the remaining scale factor is
// greater than or equal to 1/2. Set this to false only when high-quality
// scaling is not required.
bool mipmap() { return true; }
// Specify if sampling at a location that is collocated with a grid point
// is guaranteed to return the exact value at that grid point.
// For most sampling kernels, this should be false.
bool consistent() { return false; }
// Sample the tree at the given coordinates and return the result in val.
// Return true if the sampled value is active.
template<class TreeT>
bool sample(const TreeT& tree, const Vec3R& coord, typename TreeT::ValueType& val);