HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
openvdb::OPENVDB_VERSION_NAME::math::BaseStencil< DerivedType, GridT, IsSafe > Class Template Reference

#include <Stencils.h>

Public Types

typedef GridT GridType
 
typedef GridT::TreeType TreeType
 
typedef GridT::ValueType ValueType
 
typedef tree::ValueAccessor
< const TreeType, IsSafe > 
AccessorType
 
typedef std::vector< ValueTypeBufferType
 
typedef BufferType::iterator IterType
 

Public Member Functions

void moveTo (const Coord &ijk)
 Initialize the stencil buffer with the values of voxel (i, j, k) and its neighbors. More...
 
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...
 
template<typename IterType >
void moveTo (const IterType &iter)
 Initialize the stencil buffer with the values of voxel (x, y, z) and its neighbors. More...
 
template<typename RealType >
void moveTo (const Vec3< RealType > &xyz)
 Initialize the stencil buffer with the values of voxel (x, y, z) and its neighbors. More...
 
const ValueTypegetValue (unsigned int pos=0) const
 Return the value from the stencil buffer with linear offset pos. More...
 
template<int i, int j, int k>
const ValueTypegetValue () const
 Return the value at the specified location relative to the center of the stencil. More...
 
template<int i, int j, int k>
void setValue (const ValueType &value)
 Set the value at the specified location relative to the center of the stencil. More...
 
int size ()
 Return the size of the stencil buffer. More...
 
ValueType median () const
 Return the median value of the current stencil. More...
 
ValueType mean () const
 Return the mean value of the current stencil. More...
 
ValueType min () const
 Return the smallest value in the stencil buffer. More...
 
ValueType max () const
 Return the largest value in the stencil buffer. More...
 
const CoordgetCenterCoord () const
 Return the coordinates of the center point of the stencil. More...
 
const ValueTypegetCenterValue () const
 Return the value at the center of the stencil. More...
 
bool intersects (const ValueType &isoValue=zeroVal< ValueType >()) const
 Return true if the center of the stencil intersects the iso-contour specified by the isoValue. More...
 
const GridTypegrid () const
 Return a const reference to the grid from which this stencil was constructed. More...
 
const AccessorTypeaccessor () const
 Return a const reference to the ValueAccessor associated with this Stencil. More...
 

Protected Member Functions

 BaseStencil (const GridType &grid, int size)
 

Protected Attributes

const GridTypemGrid
 
AccessorType mCache
 
BufferType mStencil
 
Coord mCenter
 

Detailed Description

template<typename DerivedType, typename GridT, bool IsSafe>
class openvdb::OPENVDB_VERSION_NAME::math::BaseStencil< DerivedType, GridT, IsSafe >

Definition at line 60 of file Stencils.h.

Member Typedef Documentation

template<typename DerivedType, typename GridT, bool IsSafe>
typedef tree::ValueAccessor<const TreeType, IsSafe> openvdb::OPENVDB_VERSION_NAME::math::BaseStencil< DerivedType, GridT, IsSafe >::AccessorType

Definition at line 66 of file Stencils.h.

template<typename DerivedType, typename GridT, bool IsSafe>
typedef std::vector<ValueType> openvdb::OPENVDB_VERSION_NAME::math::BaseStencil< DerivedType, GridT, IsSafe >::BufferType

Definition at line 67 of file Stencils.h.

template<typename DerivedType, typename GridT, bool IsSafe>
typedef GridT openvdb::OPENVDB_VERSION_NAME::math::BaseStencil< DerivedType, GridT, IsSafe >::GridType

Definition at line 63 of file Stencils.h.

template<typename DerivedType, typename GridT, bool IsSafe>
typedef BufferType::iterator openvdb::OPENVDB_VERSION_NAME::math::BaseStencil< DerivedType, GridT, IsSafe >::IterType

Definition at line 68 of file Stencils.h.

template<typename DerivedType, typename GridT, bool IsSafe>
typedef GridT::TreeType openvdb::OPENVDB_VERSION_NAME::math::BaseStencil< DerivedType, GridT, IsSafe >::TreeType

Definition at line 64 of file Stencils.h.

template<typename DerivedType, typename GridT, bool IsSafe>
typedef GridT::ValueType openvdb::OPENVDB_VERSION_NAME::math::BaseStencil< DerivedType, GridT, IsSafe >::ValueType

Definition at line 65 of file Stencils.h.

Constructor & Destructor Documentation

template<typename DerivedType, typename GridT, bool IsSafe>
openvdb::OPENVDB_VERSION_NAME::math::BaseStencil< DerivedType, GridT, IsSafe >::BaseStencil ( const GridType grid,
int  size 
)
inlineprotected

Definition at line 208 of file Stencils.h.

Member Function Documentation

template<typename DerivedType, typename GridT, bool IsSafe>
const AccessorType& openvdb::OPENVDB_VERSION_NAME::math::BaseStencil< DerivedType, GridT, IsSafe >::accessor ( ) const
inline

Return a const reference to the ValueAccessor associated with this Stencil.

Definition at line 204 of file Stencils.h.

template<typename DerivedType, typename GridT, bool IsSafe>
const Coord& openvdb::OPENVDB_VERSION_NAME::math::BaseStencil< DerivedType, GridT, IsSafe >::getCenterCoord ( ) const
inline

Return the coordinates of the center point of the stencil.

Definition at line 180 of file Stencils.h.

template<typename DerivedType, typename GridT, bool IsSafe>
const ValueType& openvdb::OPENVDB_VERSION_NAME::math::BaseStencil< DerivedType, GridT, IsSafe >::getCenterValue ( ) const
inline

Return the value at the center of the stencil.

Definition at line 183 of file Stencils.h.

template<typename DerivedType, typename GridT, bool IsSafe>
const ValueType& openvdb::OPENVDB_VERSION_NAME::math::BaseStencil< DerivedType, GridT, IsSafe >::getValue ( unsigned int  pos = 0) const
inline

Return the value from the stencil buffer with linear offset pos.

Note
The default (pos = 0) corresponds to the first element which is typically the center point of the stencil.

Definition at line 123 of file Stencils.h.

template<typename DerivedType, typename GridT, bool IsSafe>
template<int i, int j, int k>
const ValueType& openvdb::OPENVDB_VERSION_NAME::math::BaseStencil< DerivedType, GridT, IsSafe >::getValue ( ) const
inline

Return the value at the specified location relative to the center of the stencil.

Definition at line 131 of file Stencils.h.

template<typename DerivedType, typename GridT, bool IsSafe>
const GridType& openvdb::OPENVDB_VERSION_NAME::math::BaseStencil< DerivedType, GridT, IsSafe >::grid ( ) const
inline

Return a const reference to the grid from which this stencil was constructed.

Definition at line 200 of file Stencils.h.

template<typename DerivedType, typename GridT, bool IsSafe>
bool openvdb::OPENVDB_VERSION_NAME::math::BaseStencil< DerivedType, GridT, IsSafe >::intersects ( const ValueType isoValue = zeroVal<ValueType>()) const
inline

Return true if the center of the stencil intersects the iso-contour specified by the isoValue.

Definition at line 187 of file Stencils.h.

template<typename DerivedType, typename GridT, bool IsSafe>
ValueType openvdb::OPENVDB_VERSION_NAME::math::BaseStencil< DerivedType, GridT, IsSafe >::max ( ) const
inline

Return the largest value in the stencil buffer.

Definition at line 173 of file Stencils.h.

template<typename DerivedType, typename GridT, bool IsSafe>
ValueType openvdb::OPENVDB_VERSION_NAME::math::BaseStencil< DerivedType, GridT, IsSafe >::mean ( ) const
inline

Return the mean value of the current stencil.

Definition at line 158 of file Stencils.h.

template<typename DerivedType, typename GridT, bool IsSafe>
ValueType openvdb::OPENVDB_VERSION_NAME::math::BaseStencil< DerivedType, GridT, IsSafe >::median ( ) const
inline

Return the median value of the current stencil.

Definition at line 147 of file Stencils.h.

template<typename DerivedType, typename GridT, bool IsSafe>
ValueType openvdb::OPENVDB_VERSION_NAME::math::BaseStencil< DerivedType, GridT, IsSafe >::min ( ) const
inline

Return the smallest value in the stencil buffer.

Definition at line 166 of file Stencils.h.

template<typename DerivedType, typename GridT, bool IsSafe>
void openvdb::OPENVDB_VERSION_NAME::math::BaseStencil< DerivedType, GridT, IsSafe >::moveTo ( const Coord ijk)
inline

Initialize the stencil buffer with the values of voxel (i, j, k) and its neighbors.

Parameters
ijkIndex coordinates of stencil center

Definition at line 73 of file Stencils.h.

template<typename DerivedType, typename GridT, bool IsSafe>
void openvdb::OPENVDB_VERSION_NAME::math::BaseStencil< DerivedType, GridT, IsSafe >::moveTo ( const Coord ijk,
const ValueType centerValue 
)
inline

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.

Parameters
ijkIndex coordinates of stnecil center
centerValueValue of the center element of the stencil

Definition at line 85 of file Stencils.h.

template<typename DerivedType, typename GridT, bool IsSafe>
template<typename IterType >
void openvdb::OPENVDB_VERSION_NAME::math::BaseStencil< DerivedType, GridT, IsSafe >::moveTo ( const IterType iter)
inline

Initialize the stencil buffer with the values of voxel (x, y, z) and its neighbors.

Note
This version is slightly faster than the one above, since the center voxel's value is read directly from the iterator.

Definition at line 98 of file Stencils.h.

template<typename DerivedType, typename GridT, bool IsSafe>
template<typename RealType >
void openvdb::OPENVDB_VERSION_NAME::math::BaseStencil< DerivedType, GridT, IsSafe >::moveTo ( const Vec3< RealType > &  xyz)
inline

Initialize the stencil buffer with the values of voxel (x, y, z) and its neighbors.

Parameters
xyzFloating point voxel coordinates of stencil center

This method will check to see if it is necessary to update the stencil based on the cached index coordinates of the center point.

Definition at line 112 of file Stencils.h.

template<typename DerivedType, typename GridT, bool IsSafe>
template<int i, int j, int k>
void openvdb::OPENVDB_VERSION_NAME::math::BaseStencil< DerivedType, GridT, IsSafe >::setValue ( const ValueType value)
inline

Set the value at the specified location relative to the center of the stencil.

Definition at line 138 of file Stencils.h.

template<typename DerivedType, typename GridT, bool IsSafe>
int openvdb::OPENVDB_VERSION_NAME::math::BaseStencil< DerivedType, GridT, IsSafe >::size ( void  )
inline

Return the size of the stencil buffer.

Definition at line 144 of file Stencils.h.

Member Data Documentation

template<typename DerivedType, typename GridT, bool IsSafe>
AccessorType openvdb::OPENVDB_VERSION_NAME::math::BaseStencil< DerivedType, GridT, IsSafe >::mCache
protected

Definition at line 217 of file Stencils.h.

template<typename DerivedType, typename GridT, bool IsSafe>
Coord openvdb::OPENVDB_VERSION_NAME::math::BaseStencil< DerivedType, GridT, IsSafe >::mCenter
protected

Definition at line 219 of file Stencils.h.

template<typename DerivedType, typename GridT, bool IsSafe>
const GridType* openvdb::OPENVDB_VERSION_NAME::math::BaseStencil< DerivedType, GridT, IsSafe >::mGrid
protected

Definition at line 216 of file Stencils.h.

template<typename DerivedType, typename GridT, bool IsSafe>
BufferType openvdb::OPENVDB_VERSION_NAME::math::BaseStencil< DerivedType, GridT, IsSafe >::mStencil
protected

Definition at line 218 of file Stencils.h.


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