HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
openvdb::OPENVDB_VERSION_NAME::tools::CheckLevelSet< GridType > Class Template Reference

Class that performs various types of checks on narrow-band level sets. More...

#include <Diagnostics.h>

Public Types

using ValueType = typename GridType::ValueType
 
using MaskType = typename GridType::template ValueConverter< bool >::Type
 

Public Member Functions

 CheckLevelSet (const GridType &grid)
 
Index64 valueCount () const
 Return the number of values (i.e. background, tiles or voxels) that have failed one or more checks. More...
 
Index64 failureCount () const
 Return total number of failed checks. More...
 
const GridType & grid () const
 Return a const reference to the grid. More...
 
void clear ()
 Clear the mask and error counter. More...
 
std::string checkClassType () const
 Return message if the grid's class is a level set. More...
 
std::string checkTransform () const
 Return a nonempty message if the grid's transform does not have uniform scaling. More...
 
std::string checkBackground (Real halfWidth=LEVEL_SET_HALF_WIDTH) const
 Return a nonempty message if the background value is larger than or equal to the halfWidth*voxelSize. More...
 
std::string checkTiles () const
 Return a nonempty message if the grid has no active tile values. More...
 
std::string checkFinite (bool updateMask=false)
 Return a nonempty message if any of the values are not finite. i.e. NaN or inf. More...
 
std::string checkRange (bool updateMask=false)
 Return a nonempty message if the active voxel values are out-of-range. More...
 
std::string checkInactiveValues (bool updateMask=false)
 Return a nonempty message if the the inactive values do not have a magnitude equal to the background value. More...
 
std::string checkEikonal (bool updateMask=false, ValueType minV=0.5, ValueType maxV=1.5)
 Return a nonempty message if the norm of the gradient of the active voxels is out of the range minV to maxV. More...
 
std::string check (size_t n=9, bool updateMask=false)
 Return a nonempty message if an error or issue is detected. Only runs tests with a number lower than or equal to n, where: More...
 
MaskType::ConstPtr mask () const
 Return a boolean mask of all the values (i.e. tiles and/or voxels) that have failed one or more checks. More...
 
MaskType::Ptr mask ()
 Return a boolean mask of all the values (i.e. tiles and/or voxels) that have failed one or more checks. More...
 

Static Public Member Functions

static std::string checkValueType ()
 Return a nonempty message if the grid's value type is a floating point. More...
 

Detailed Description

template<class GridType>
class openvdb::OPENVDB_VERSION_NAME::tools::CheckLevelSet< GridType >

Class that performs various types of checks on narrow-band level sets.

Note
The most common usage is to simply call CheckLevelSet::check()

Definition at line 786 of file Diagnostics.h.

Member Typedef Documentation

template<class GridType>
using openvdb::OPENVDB_VERSION_NAME::tools::CheckLevelSet< GridType >::MaskType = typename GridType::template ValueConverter<bool>::Type

Definition at line 790 of file Diagnostics.h.

template<class GridType>
using openvdb::OPENVDB_VERSION_NAME::tools::CheckLevelSet< GridType >::ValueType = typename GridType::ValueType

Definition at line 789 of file Diagnostics.h.

Constructor & Destructor Documentation

template<class GridType>
openvdb::OPENVDB_VERSION_NAME::tools::CheckLevelSet< GridType >::CheckLevelSet ( const GridType &  grid)
inline

Definition at line 792 of file Diagnostics.h.

Member Function Documentation

template<class GridType>
std::string openvdb::OPENVDB_VERSION_NAME::tools::CheckLevelSet< GridType >::check ( size_t  n = 9,
bool  updateMask = false 
)
inline

Return a nonempty message if an error or issue is detected. Only runs tests with a number lower than or equal to n, where:

Fast checks 1: value type is floating point 2: has level set class type 3: has uniform scale 4: background value is positive and n*dx

Slower checks 5: no active tiles 6: all the values are finite, i.e not NaN or infinite 7: active values in range between +-background 8: abs of inactive values = background, i.e. assuming a symmetric narrow band!

Relatively slow check (however multi-threaded) 9: norm of gradient at zero-crossings is one, i.e. satisfied the Eikonal equation.

Definition at line 925 of file Diagnostics.h.

template<class GridType>
std::string openvdb::OPENVDB_VERSION_NAME::tools::CheckLevelSet< GridType >::checkBackground ( Real  halfWidth = LEVEL_SET_HALF_WIDTH) const
inline

Return a nonempty message if the background value is larger than or equal to the halfWidth*voxelSize.

Note
Small run-time overhead

Definition at line 847 of file Diagnostics.h.

template<class GridType>
std::string openvdb::OPENVDB_VERSION_NAME::tools::CheckLevelSet< GridType >::checkClassType ( ) const
inline

Return message if the grid's class is a level set.

Note
Small run-time overhead

Definition at line 829 of file Diagnostics.h.

template<class GridType>
std::string openvdb::OPENVDB_VERSION_NAME::tools::CheckLevelSet< GridType >::checkEikonal ( bool  updateMask = false,
ValueType  minV = 0.5,
ValueType  maxV = 1.5 
)
inline

Return a nonempty message if the norm of the gradient of the active voxels is out of the range minV to maxV.

Note
Significant run-time overhead

Definition at line 902 of file Diagnostics.h.

template<class GridType>
std::string openvdb::OPENVDB_VERSION_NAME::tools::CheckLevelSet< GridType >::checkFinite ( bool  updateMask = false)
inline

Return a nonempty message if any of the values are not finite. i.e. NaN or inf.

Note
Medium run-time overhead

Definition at line 871 of file Diagnostics.h.

template<class GridType>
std::string openvdb::OPENVDB_VERSION_NAME::tools::CheckLevelSet< GridType >::checkInactiveValues ( bool  updateMask = false)
inline

Return a nonempty message if the the inactive values do not have a magnitude equal to the background value.

Note
Medium run-time overhead

Definition at line 891 of file Diagnostics.h.

template<class GridType>
std::string openvdb::OPENVDB_VERSION_NAME::tools::CheckLevelSet< GridType >::checkRange ( bool  updateMask = false)
inline

Return a nonempty message if the active voxel values are out-of-range.

Note
Medium run-time overhead

Definition at line 880 of file Diagnostics.h.

template<class GridType>
std::string openvdb::OPENVDB_VERSION_NAME::tools::CheckLevelSet< GridType >::checkTiles ( ) const
inline

Return a nonempty message if the grid has no active tile values.

Note
Medium run-time overhead

Definition at line 862 of file Diagnostics.h.

template<class GridType>
std::string openvdb::OPENVDB_VERSION_NAME::tools::CheckLevelSet< GridType >::checkTransform ( ) const
inline

Return a nonempty message if the grid's transform does not have uniform scaling.

Note
Small run-time overhead

Definition at line 838 of file Diagnostics.h.

template<class GridType>
static std::string openvdb::OPENVDB_VERSION_NAME::tools::CheckLevelSet< GridType >::checkValueType ( )
inlinestatic

Return a nonempty message if the grid's value type is a floating point.

Note
No run-time overhead

Definition at line 820 of file Diagnostics.h.

template<class GridType>
void openvdb::OPENVDB_VERSION_NAME::tools::CheckLevelSet< GridType >::clear ( void  )
inline

Clear the mask and error counter.

Definition at line 815 of file Diagnostics.h.

template<class GridType>
Index64 openvdb::OPENVDB_VERSION_NAME::tools::CheckLevelSet< GridType >::failureCount ( ) const
inline

Return total number of failed checks.

Note
If only one check was performed and the mask was updated failureCount equals valueCount.

Definition at line 809 of file Diagnostics.h.

template<class GridType>
const GridType& openvdb::OPENVDB_VERSION_NAME::tools::CheckLevelSet< GridType >::grid ( ) const
inline

Return a const reference to the grid.

Definition at line 812 of file Diagnostics.h.

template<class GridType>
MaskType::ConstPtr openvdb::OPENVDB_VERSION_NAME::tools::CheckLevelSet< GridType >::mask ( ) const
inline

Return a boolean mask of all the values (i.e. tiles and/or voxels) that have failed one or more checks.

Definition at line 798 of file Diagnostics.h.

template<class GridType>
MaskType::Ptr openvdb::OPENVDB_VERSION_NAME::tools::CheckLevelSet< GridType >::mask ( )
inline

Return a boolean mask of all the values (i.e. tiles and/or voxels) that have failed one or more checks.

Definition at line 799 of file Diagnostics.h.

template<class GridType>
Index64 openvdb::OPENVDB_VERSION_NAME::tools::CheckLevelSet< GridType >::valueCount ( ) const
inline

Return the number of values (i.e. background, tiles or voxels) that have failed one or more checks.

Definition at line 804 of file Diagnostics.h.


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