OpenVDB  5.2.0
Classes | Public Types | Public Member Functions | List of all members
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::v5_2::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.

Member Typedef Documentation

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

Constructor & Destructor Documentation

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.
LevelSetMeasure ( ManagerType leafs,
Real  Dx,
InterruptT *  interrupt 
)
inline
virtual ~LevelSetMeasure ( )
inlinevirtual

Destructor.

Member Function Documentation

int getGrainSize ( ) const
inline
Returns
the grain-size used for multi-threading
void 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.
void 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.
void reinit ( const GridType grid)
inline

Re-initialize using the specified grid.

void reinit ( ManagerType leafs,
Real  dx 
)
inline

Re-initialize using the specified LeafManager and voxelSize.

void setGrainSize ( int  grainsize)
inline

Set the grain-size used for multi-threading.

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

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