OpenVDB  2.0.0
Classes | Namespaces | Functions
Interpolation.h File Reference
#include <cmath>
#include <boost/shared_ptr.hpp>
#include <openvdb/version.h>
#include <openvdb/Platform.h>
#include <openvdb/math/Transform.h>
#include <openvdb/Grid.h>
#include <openvdb/tree/ValueAccessor.h>

Go to the source code of this file.

Classes

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. Consider using the GridSampler below instead. More...
 
class  GridSampler< tree::ValueAccessor< TreeT >, SamplerType >
 Specialization of GridSampler for construction from a ValueAccessor type. More...
 

Namespaces

 openvdb
 
 openvdb::v2_0_0
 
 openvdb::v2_0_0::tools
 
 openvdb::v2_0_0::tools::local_util
 

Functions

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);
* };
*