OpenVDB: LevelSetMeasure< GridT, InterruptT > Class Template Reference

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

## ◆ GridType

using GridType = GridT

## ◆ ManagerType

using ManagerType = typename tree::LeafManager<const TreeType>

## ◆ TreeType

using TreeType = typename GridType::TreeType

## ◆ ValueType

using ValueType = typename TreeType::ValueType

## Constructor & Destructor Documentation

## ◆ LevelSetMeasure() [1/2]

LevelSetMeasure | ( | const GridType & | grid,
|  | InterruptT * | interrupt = `nullptr`
| ) |  |
| inline

Main constructor from a grid.

Parameters

  grid | The level set to be measured.
  interrupt | Optional interrupter.

Exceptions

  RuntimeError | if the grid is not a level set.

## ◆ LevelSetMeasure() [2/2]

LevelSetMeasure | ( | ManagerType & | leafs,
|  | Real | Dx,
|  | InterruptT * | interrupt
| ) |  |
| inline

## ◆ ~LevelSetMeasure()

virtual ~LevelSetMeasure | ( |  | ) |
| inlinevirtual

Destructor.

## Member Function Documentation

## ◆ getGrainSize()

int getGrainSize | ( |  | ) | const
| inline

Returns
  the grain-size used for multi-threading

## ◆ measure() [1/2]

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.

## ◆ measure() [2/2]

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.

## ◆ reinit() [1/2]

void reinit | ( | const GridType & | grid | ) |
| inline

Re-initialize using the specified grid.

## ◆ reinit() [2/2]

void reinit | ( | ManagerType & | leafs,
|  | Real | dx
| ) |  |
| inline

Re-initialize using the specified LeafManager and voxelSize.

## ◆ setGrainSize()

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:

- LevelSetMeasure.h