HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
openvdb::OPENVDB_VERSION_NAME::tools::LevelSetMeasure< GridT, InterruptT > Class Template Reference

Multi-threaded computation of surface area, volume and average mean-curvature for narrow band level sets. More...

#include <LevelSetMeasure.h>

Public Types

using GridType = GridT
 
using TreeType = typename GridType::TreeType
 
using ValueType = typename TreeType::ValueType
 
using ManagerType = typename tree::LeafManager< const TreeType >
 

Public Member Functions

 LevelSetMeasure (const GridType &grid, InterruptT *interrupt=nullptr)
 Main constructor from a grid. More...
 
 LevelSetMeasure (ManagerType &leafs, Real Dx, InterruptT *interrupt)
 
void reinit (const GridType &grid)
 Re-initialize using the specified grid. More...
 
void reinit (ManagerType &leafs, Real dx)
 Re-initialize using the specified LeafManager and voxelSize. More...
 
virtual ~LevelSetMeasure ()
 Destructor. More...
 
int getGrainSize () const
 
void setGrainSize (int grainsize)
 Set the grain-size used for multi-threading. More...
 
void measure (Real &area, Real &volume, bool useWorldUnits=true)
 Compute the surface area and volume of the level set. Use the last argument to specify the result in world or voxel units. More...
 
void measure (Real &area, Real &volume, Real &avgMeanCurvature, bool useWorldUnits=true)
 Compute the surface area, volume, and average mean-curvature of the level set. Use the last argument to specify the result in world or voxel units. More...
 

Detailed Description

template<typename GridT, typename InterruptT = util::NullInterrupter>
class openvdb::OPENVDB_VERSION_NAME::tools::LevelSetMeasure< GridT, InterruptT >

Multi-threaded computation of surface area, volume and average mean-curvature for narrow band level sets.

To reduce the risk of round-off errors (primarily due to catastrophic cancellation) and guarantee determinism during multi-threading this class is implemented using parallel_for, and delayed reduction of a sorted list.

Definition at line 131 of file LevelSetMeasure.h.

Member Typedef Documentation

template<typename GridT , typename InterruptT = util::NullInterrupter>
using openvdb::OPENVDB_VERSION_NAME::tools::LevelSetMeasure< GridT, InterruptT >::GridType = GridT

Definition at line 134 of file LevelSetMeasure.h.

template<typename GridT , typename InterruptT = util::NullInterrupter>
using openvdb::OPENVDB_VERSION_NAME::tools::LevelSetMeasure< GridT, InterruptT >::ManagerType = typename tree::LeafManager<const TreeType>

Definition at line 137 of file LevelSetMeasure.h.

template<typename GridT , typename InterruptT = util::NullInterrupter>
using openvdb::OPENVDB_VERSION_NAME::tools::LevelSetMeasure< GridT, InterruptT >::TreeType = typename GridType::TreeType

Definition at line 135 of file LevelSetMeasure.h.

template<typename GridT , typename InterruptT = util::NullInterrupter>
using openvdb::OPENVDB_VERSION_NAME::tools::LevelSetMeasure< GridT, InterruptT >::ValueType = typename TreeType::ValueType

Definition at line 136 of file LevelSetMeasure.h.

Constructor & Destructor Documentation

template<typename GridT , typename InterruptT >
openvdb::OPENVDB_VERSION_NAME::tools::LevelSetMeasure< GridT, InterruptT >::LevelSetMeasure ( const GridType grid,
InterruptT *  interrupt = nullptr 
)
inline

Main constructor from a grid.

Parameters
gridThe level set to be measured.
interruptOptional interrupter.
Exceptions
RuntimeErrorif the grid is not a level set.

Definition at line 243 of file LevelSetMeasure.h.

template<typename GridT , typename InterruptT >
openvdb::OPENVDB_VERSION_NAME::tools::LevelSetMeasure< GridT, InterruptT >::LevelSetMeasure ( ManagerType leafs,
Real  Dx,
InterruptT *  interrupt 
)
inline

Definition at line 265 of file LevelSetMeasure.h.

template<typename GridT , typename InterruptT = util::NullInterrupter>
virtual openvdb::OPENVDB_VERSION_NAME::tools::LevelSetMeasure< GridT, InterruptT >::~LevelSetMeasure ( )
inlinevirtual

Destructor.

Definition at line 156 of file LevelSetMeasure.h.

Member Function Documentation

template<typename GridT , typename InterruptT = util::NullInterrupter>
int openvdb::OPENVDB_VERSION_NAME::tools::LevelSetMeasure< GridT, InterruptT >::getGrainSize ( ) const
inline
Returns
the grain-size used for multi-threading

Definition at line 159 of file LevelSetMeasure.h.

template<typename GridT , typename InterruptT >
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetMeasure< GridT, InterruptT >::measure ( Real area,
Real volume,
bool  useWorldUnits = true 
)
inline

Compute the surface area and volume of the level set. Use the last argument to specify the result in world or voxel units.

Note
This method is faster (about 3x) then the measure method below that also computes the average mean-curvature.

Definition at line 309 of file LevelSetMeasure.h.

template<typename GridT , typename InterruptT >
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetMeasure< GridT, InterruptT >::measure ( Real area,
Real volume,
Real avgMeanCurvature,
bool  useWorldUnits = true 
)
inline

Compute the surface area, volume, and average mean-curvature of the level set. Use the last argument to specify the result in world or voxel units.

Note
This method is slower (about 3x) then the measure method above that only computes the area and volume.

Definition at line 341 of file LevelSetMeasure.h.

template<typename GridT , typename InterruptT >
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetMeasure< GridT, InterruptT >::reinit ( const GridType grid)
inline

Re-initialize using the specified grid.

Definition at line 278 of file LevelSetMeasure.h.

template<typename GridT , typename InterruptT >
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetMeasure< GridT, InterruptT >::reinit ( ManagerType leafs,
Real  dx 
)
inline

Re-initialize using the specified LeafManager and voxelSize.

Definition at line 297 of file LevelSetMeasure.h.

template<typename GridT , typename InterruptT = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetMeasure< GridT, InterruptT >::setGrainSize ( int  grainsize)
inline

Set the grain-size used for multi-threading.

Note
A grain size of 0 or less disables multi-threading!

Definition at line 163 of file LevelSetMeasure.h.


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