HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nanovdb::BoxStencil< GridT > Class Template Reference

#include <Stencils.h>

+ Inheritance diagram for nanovdb::BoxStencil< GridT >:

Public Types

using GridType = GridT
 
using TreeType = typename GridT::TreeType
 
using ValueType = typename GridT::ValueType
 
- Public Types inherited from nanovdb::BaseStencil< BoxStencil< GridT >, 8, GridT >
using ValueType = typename GridT::ValueType
 
using GridType = GridT
 
using TreeType = typename GridT::TreeType
 
using AccessorType = typename GridT::AccessorType
 

Public Member Functions

__hostdev__ BoxStencil (const GridType &grid)
 
template<int i, int j, int k>
__hostdev__ unsigned int pos () const
 Return linear offset for the specified stencil point relative to its center. More...
 
__hostdev__ bool intersects (ValueType isoValue=ValueType(0)) const
 Return true if the center of the stencil intersects the. More...
 
__hostdev__ ValueType interpolation (const Vec3< ValueType > &xyz) const
 Return the trilinear interpolation at the normalized position. More...
 
__hostdev__ Vec3< ValueTypegradient (const Vec3< ValueType > &xyz) const
 Return the gradient in world space of the trilinear interpolation kernel. More...
 
- Public Member Functions inherited from nanovdb::BaseStencil< BoxStencil< GridT >, 8, GridT >
__hostdev__ void moveTo (const Coord &ijk)
 Initialize the stencil buffer with the values of voxel (i, j, k) and its neighbors. More...
 
__hostdev__ void moveTo (const Coord &ijk, const ValueType &centerValue)
 Initialize the stencil buffer with the values of voxel (i, j, k) and its neighbors. The method also takes a value of the center element of the stencil, assuming it is already known. More...
 
__hostdev__ void moveTo (const IterType &iter)
 Initialize the stencil buffer with the values of voxel (x, y, z) and its neighbors. More...
 
__hostdev__ void moveTo (const Vec3< RealType > &xyz)
 Initialize the stencil buffer with the values of voxel (x, y, z) and its neighbors. More...
 
__hostdev__ const ValueTypegetValue (unsigned int pos=0) const
 Return the value from the stencil buffer with linear offset pos. More...
 
__hostdev__ const ValueTypegetValue () const
 Return the value at the specified location relative to the center of the stencil. More...
 
__hostdev__ void setValue (const ValueType &value)
 Set the value at the specified location relative to the center of the stencil. More...
 
__hostdev__ ValueType mean () const
 Return the mean value of the current stencil. More...
 
__hostdev__ ValueType min () const
 Return the smallest value in the stencil buffer. More...
 
__hostdev__ ValueType max () const
 Return the largest value in the stencil buffer. More...
 
__hostdev__ const CoordgetCenterCoord () const
 Return the coordinates of the center point of the stencil. More...
 
__hostdev__ const ValueTypegetCenterValue () const
 Return the value at the center of the stencil. More...
 
__hostdev__ bool intersects (const ValueType &isoValue=ValueType(0)) const
 Return true if the center of the stencil intersects the iso-contour specified by the isoValue. More...
 
__hostdev__ Mask intersectionMask (ValueType isoValue=ValueType(0)) const
 Return true a bit-mask where the 6 lower bits indicates if the center of the stencil intersects the iso-contour specified by the isoValue. More...
 
__hostdev__ const GridTypegrid () const
 Return a const reference to the grid from which this stencil was constructed. More...
 
__hostdev__ const AccessorTypeaccessor () const
 Return a const reference to the ValueAccessor associated with this Stencil. More...
 

Static Public Attributes

static constexpr int SIZE = 8
 

Friends

template<typename , int , typename >
class BaseStencil
 

Additional Inherited Members

- Static Public Member Functions inherited from nanovdb::BaseStencil< BoxStencil< GridT >, 8, GridT >
static __hostdev__ int size ()
 Return the size of the stencil buffer. More...
 
- Protected Member Functions inherited from nanovdb::BaseStencil< BoxStencil< GridT >, 8, GridT >
__hostdev__ BaseStencil (const GridType &grid)
 
- Protected Attributes inherited from nanovdb::BaseStencil< BoxStencil< GridT >, 8, GridT >
const GridTypemGrid
 
AccessorType mAcc
 
ValueType mValues [SIZE]
 
Coord mCenter
 

Detailed Description

template<typename GridT>
class nanovdb::BoxStencil< GridT >

Definition at line 304 of file Stencils.h.

Member Typedef Documentation

template<typename GridT >
using nanovdb::BoxStencil< GridT >::GridType = GridT

Definition at line 309 of file Stencils.h.

template<typename GridT >
using nanovdb::BoxStencil< GridT >::TreeType = typename GridT::TreeType

Definition at line 310 of file Stencils.h.

template<typename GridT >
using nanovdb::BoxStencil< GridT >::ValueType = typename GridT::ValueType

Definition at line 311 of file Stencils.h.

Constructor & Destructor Documentation

template<typename GridT >
__hostdev__ nanovdb::BoxStencil< GridT >::BoxStencil ( const GridType grid)
inline

Definition at line 315 of file Stencils.h.

Member Function Documentation

template<typename GridT >
__hostdev__ Vec3<ValueType> nanovdb::BoxStencil< GridT >::gradient ( const Vec3< ValueType > &  xyz) const
inline

Return the gradient in world space of the trilinear interpolation kernel.

Parameters
xyzFloating point coordinate position.
Warning
It is assumed that the stencil has already been moved to the relevant voxel position, e.g. using moveTo(xyz).
Note
Computed as partial derivatives of the trilinear interpolation kernel: v000 (1-u)(1-v)(1-w) + v001 (1-u)(1-v)w + v010 (1-u)v(1-w) + v011 (1-u)vw
  • v100 u(1-v)(1-w) + v101 u(1-v)w + v110 uv(1-w) + v111 uvw

Definition at line 374 of file Stencils.h.

template<typename GridT >
__hostdev__ ValueType nanovdb::BoxStencil< GridT >::interpolation ( const Vec3< ValueType > &  xyz) const
inline

Return the trilinear interpolation at the normalized position.

Parameters
xyzFloating point coordinate position. Index space and NOT world space.
Warning
It is assumed that the stencil has already been moved to the relevant voxel position, e.g. using moveTo(xyz).
Note
Trilinear interpolation kernal reads as: v000 (1-u)(1-v)(1-w) + v001 (1-u)(1-v)w + v010 (1-u)v(1-w) + v011 (1-u)vw
  • v100 u(1-v)(1-w) + v101 u(1-v)w + v110 uv(1-w) + v111 uvw

Definition at line 342 of file Stencils.h.

template<typename GridT >
__hostdev__ bool nanovdb::BoxStencil< GridT >::intersects ( ValueType  isoValue = ValueType(0)) const
inline

Return true if the center of the stencil intersects the.

iso-contour specified by the isoValue

Definition at line 323 of file Stencils.h.

template<typename GridT >
template<int i, int j, int k>
__hostdev__ unsigned int nanovdb::BoxStencil< GridT >::pos ( ) const
inline

Return linear offset for the specified stencil point relative to its center.

Definition at line 319 of file Stencils.h.

Friends And Related Function Documentation

template<typename GridT >
template<typename , int , typename >
friend class BaseStencil
friend

Definition at line 426 of file Stencils.h.

Member Data Documentation

template<typename GridT >
constexpr int nanovdb::BoxStencil< GridT >::SIZE = 8
static

Definition at line 313 of file Stencils.h.


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