HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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
 

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...
 
std::bitset< 6 > intersectionMask (const ValueType &isoValue=zeroVal< ValueType >()) const
 Return true a bit-mask where the 6 bits indicates 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 mAcc
 
BufferType mValues
 
Coord mCenter
 

Detailed Description

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

Definition at line 35 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 41 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 42 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 38 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 39 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 40 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 211 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 207 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 160 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 163 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 97 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 105 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 203 of file Stencils.h.

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

Return true a bit-mask where the 6 bits indicates if the center of the stencil intersects the iso-contour specified by the isoValue.

Note
There are 2^6 = 64 different possible cases, including no intersections!

The ordering of bit mask is ( -x, +x, -y, +y, -z, +z ), so to check if there is an intersection in -y use mask.test(2) where mask is ther return value from this function. To check if there are any intersections use mask.any(), and for no intersections use mask.none(). To count the number of intersections use mask.count().

Definition at line 188 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 167 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 153 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 138 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 121 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 146 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 47 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 59 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 72 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 86 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 112 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 118 of file Stencils.h.

Member Data Documentation

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

Definition at line 220 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 222 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 219 of file Stencils.h.

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

Definition at line 221 of file Stencils.h.


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