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

Performs multi-threaded interface tracking of narrow band level sets. More...

#include <LevelSetTracker.h>

+ Inheritance diagram for openvdb::OPENVDB_VERSION_NAME::tools::LevelSetTracker< GridT, InterruptT >:

Classes

struct  State
 Lightweight struct that stores the state of the LevelSetTracker. More...
 

Public Types

using TrimMode = lstrack::TrimMode
 
using GridType = GridT
 
using TreeType = typename GridT::TreeType
 
using LeafType = typename TreeType::LeafNodeType
 
using ValueType = typename TreeType::ValueType
 
using LeafManagerType = typename tree::LeafManager< TreeType >
 
using LeafRange = typename LeafManagerType::LeafRange
 
using BufferType = typename LeafManagerType::BufferType
 
using MaskTreeType = typename TreeType::template ValueConverter< ValueMask >::Type
 

Public Member Functions

 LevelSetTracker (GridT &grid, InterruptT *interrupt=nullptr)
 Main constructor. More...
 
virtual ~LevelSetTracker ()
 
template<typename MaskType >
void normalize (const MaskType *mask)
 Iterative normalization, i.e. solving the Eikonal equation. More...
 
void normalize ()
 Iterative normalization, i.e. solving the Eikonal equation. More...
 
void track ()
 Track the level set interface, i.e. rebuild and normalize the narrow band of the level set. More...
 
void prune ()
 Set voxels that are outside the narrow band to the background value (if trimming is enabled) and prune the grid. More...
 
void dilate (int iterations=1)
 Fast but approximate dilation of the narrow band - one layer at a time. Normally we recommend using the resize method below which internally calls dilate (or erode) with the correct number of iterations to achieve the desired half voxel width of the narrow band (3 is recommended for most level set applications). More...
 
void erode (int iterations=1)
 Erodes the width of the narrow-band and update the background values. More...
 
bool resize (Index halfWidth=static_cast< Index >(LEVEL_SET_HALF_WIDTH))
 Resize the width of the narrow band, i.e. perform dilation and renormalization or erosion as required. More...
 
ValueType getHalfWidth () const
 Return the half width of the narrow band in floating-point voxel units. More...
 
State getState () const
 Return the state of the tracker (see struct defined above) More...
 
void setState (const State &s)
 Set the state of the tracker (see struct defined above) More...
 
math::BiasedGradientScheme getSpatialScheme () const
 
void setSpatialScheme (math::BiasedGradientScheme s)
 Set the spatial finite difference scheme. More...
 
math::TemporalIntegrationScheme getTemporalScheme () const
 
void setTemporalScheme (math::TemporalIntegrationScheme s)
 Set the spatial finite difference scheme. More...
 
int getNormCount () const
 
void setNormCount (int n)
 Set the number of normalizations performed per track or normalize call. More...
 
int getGrainSize () const
 
void setGrainSize (int grainsize)
 Set the grain-size used for multi-threading. More...
 
TrimMode trimming () const
 Return the trimming mode for voxels outside the narrow band. More...
 
void setTrimming (TrimMode mode)
 Specify whether to trim voxels outside the narrow band prior to pruning. More...
 
ValueType voxelSize () const
 
void startInterrupter (const char *msg)
 
void endInterrupter ()
 
bool checkInterrupter ()
 
const GridTypegrid () const
 
LeafManagerTypeleafs ()
 
const LeafManagerTypeleafs () const
 
template<typename MaskT >
void normalize (const MaskT *mask)
 

Detailed Description

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

Performs multi-threaded interface tracking of narrow band level sets.

Definition at line 57 of file LevelSetTracker.h.

Member Typedef Documentation

template<typename GridT , typename InterruptT = util::NullInterrupter>
using openvdb::OPENVDB_VERSION_NAME::tools::LevelSetTracker< GridT, InterruptT >::BufferType = typename LeafManagerType::BufferType

Definition at line 68 of file LevelSetTracker.h.

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

Definition at line 62 of file LevelSetTracker.h.

template<typename GridT , typename InterruptT = util::NullInterrupter>
using openvdb::OPENVDB_VERSION_NAME::tools::LevelSetTracker< GridT, InterruptT >::LeafManagerType = typename tree::LeafManager<TreeType>

Definition at line 66 of file LevelSetTracker.h.

template<typename GridT , typename InterruptT = util::NullInterrupter>
using openvdb::OPENVDB_VERSION_NAME::tools::LevelSetTracker< GridT, InterruptT >::LeafRange = typename LeafManagerType::LeafRange

Definition at line 67 of file LevelSetTracker.h.

template<typename GridT , typename InterruptT = util::NullInterrupter>
using openvdb::OPENVDB_VERSION_NAME::tools::LevelSetTracker< GridT, InterruptT >::LeafType = typename TreeType::LeafNodeType

Definition at line 64 of file LevelSetTracker.h.

template<typename GridT , typename InterruptT = util::NullInterrupter>
using openvdb::OPENVDB_VERSION_NAME::tools::LevelSetTracker< GridT, InterruptT >::MaskTreeType = typename TreeType::template ValueConverter<ValueMask>::Type

Definition at line 69 of file LevelSetTracker.h.

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

Definition at line 63 of file LevelSetTracker.h.

template<typename GridT , typename InterruptT = util::NullInterrupter>
using openvdb::OPENVDB_VERSION_NAME::tools::LevelSetTracker< GridT, InterruptT >::TrimMode = lstrack::TrimMode

Definition at line 60 of file LevelSetTracker.h.

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

Definition at line 65 of file LevelSetTracker.h.

Constructor & Destructor Documentation

template<typename GridT , typename InterruptT >
openvdb::OPENVDB_VERSION_NAME::tools::LevelSetTracker< GridT, InterruptT >::LevelSetTracker ( GridT &  grid,
InterruptT *  interrupt = nullptr 
)

Main constructor.

Exceptions
RuntimeErrorif the grid is not a level set

Definition at line 260 of file LevelSetTracker.h.

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

Definition at line 89 of file LevelSetTracker.h.

Member Function Documentation

template<typename GridT , typename InterruptT >
bool openvdb::OPENVDB_VERSION_NAME::tools::LevelSetTracker< GridT, InterruptT >::checkInterrupter ( )
inline
Returns
false if the process was interrupted

Definition at line 385 of file LevelSetTracker.h.

template<typename GridT , typename InterruptT >
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetTracker< GridT, InterruptT >::dilate ( int  iterations = 1)

Fast but approximate dilation of the narrow band - one layer at a time. Normally we recommend using the resize method below which internally calls dilate (or erode) with the correct number of iterations to achieve the desired half voxel width of the narrow band (3 is recommended for most level set applications).

Note
Since many level set applications perform interface-tracking, which in turn rebuilds the narrow-band accurately, this dilate method can often be used with a single iterations of low-order re-normalization. This effectively allows very narrow bands to be created from points or polygons (e.g. with a half voxel width of 1), followed by a fast but approximate dilation (typically with a half voxel width of 3). This can be significantly faster than generating the final width of the narrow band from points or polygons.

Definition at line 320 of file LevelSetTracker.h.

template<typename GridT , typename InterruptT >
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetTracker< GridT, InterruptT >::endInterrupter ( )
inline

Definition at line 377 of file LevelSetTracker.h.

template<typename GridT , typename InterruptT >
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetTracker< GridT, InterruptT >::erode ( int  iterations = 1)

Erodes the width of the narrow-band and update the background values.

Exceptions
ValueErrorif iterations is larger than the current half-width.

Definition at line 342 of file LevelSetTracker.h.

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

Definition at line 164 of file LevelSetTracker.h.

template<typename GridT , typename InterruptT = util::NullInterrupter>
ValueType openvdb::OPENVDB_VERSION_NAME::tools::LevelSetTracker< GridT, InterruptT >::getHalfWidth ( ) const
inline

Return the half width of the narrow band in floating-point voxel units.

Definition at line 135 of file LevelSetTracker.h.

template<typename GridT , typename InterruptT = util::NullInterrupter>
int openvdb::OPENVDB_VERSION_NAME::tools::LevelSetTracker< GridT, InterruptT >::getNormCount ( ) const
inline
Returns
The number of normalizations performed per track or normalize call.

Definition at line 157 of file LevelSetTracker.h.

template<typename GridT , typename InterruptT = util::NullInterrupter>
math::BiasedGradientScheme openvdb::OPENVDB_VERSION_NAME::tools::LevelSetTracker< GridT, InterruptT >::getSpatialScheme ( ) const
inline
Returns
the spatial finite difference scheme

Definition at line 144 of file LevelSetTracker.h.

template<typename GridT , typename InterruptT = util::NullInterrupter>
State openvdb::OPENVDB_VERSION_NAME::tools::LevelSetTracker< GridT, InterruptT >::getState ( ) const
inline

Return the state of the tracker (see struct defined above)

Definition at line 138 of file LevelSetTracker.h.

template<typename GridT , typename InterruptT = util::NullInterrupter>
math::TemporalIntegrationScheme openvdb::OPENVDB_VERSION_NAME::tools::LevelSetTracker< GridT, InterruptT >::getTemporalScheme ( ) const
inline
Returns
the temporal integration scheme

Definition at line 150 of file LevelSetTracker.h.

template<typename GridT , typename InterruptT = util::NullInterrupter>
const GridType& openvdb::OPENVDB_VERSION_NAME::tools::LevelSetTracker< GridT, InterruptT >::grid ( ) const
inline

Definition at line 187 of file LevelSetTracker.h.

template<typename GridT , typename InterruptT = util::NullInterrupter>
LeafManagerType& openvdb::OPENVDB_VERSION_NAME::tools::LevelSetTracker< GridT, InterruptT >::leafs ( )
inline

Definition at line 189 of file LevelSetTracker.h.

template<typename GridT , typename InterruptT = util::NullInterrupter>
const LeafManagerType& openvdb::OPENVDB_VERSION_NAME::tools::LevelSetTracker< GridT, InterruptT >::leafs ( ) const
inline

Definition at line 191 of file LevelSetTracker.h.

template<typename GridT , typename InterruptT = util::NullInterrupter>
template<typename MaskType >
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetTracker< GridT, InterruptT >::normalize ( const MaskType *  mask)

Iterative normalization, i.e. solving the Eikonal equation.

Note
The mask it optional and by default it is ignored.
template<typename GridT , typename InterruptT = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetTracker< GridT, InterruptT >::normalize ( )
inline

Iterative normalization, i.e. solving the Eikonal equation.

Definition at line 97 of file LevelSetTracker.h.

template<typename GridT , typename InterruptT = util::NullInterrupter>
template<typename MaskT >
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetTracker< GridT, InterruptT >::normalize ( const MaskT *  mask)

Definition at line 398 of file LevelSetTracker.h.

template<typename GridT , typename InterruptT >
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetTracker< GridT, InterruptT >::prune ( )

Set voxels that are outside the narrow band to the background value (if trimming is enabled) and prune the grid.

Pruning is done automatically as a step in tracking.

See Also
setTrimming, trimming

Definition at line 282 of file LevelSetTracker.h.

template<typename GridT , typename InterruptT >
bool openvdb::OPENVDB_VERSION_NAME::tools::LevelSetTracker< GridT, InterruptT >::resize ( Index  halfWidth = static_cast<Index>(LEVEL_SET_HALF_WIDTH))

Resize the width of the narrow band, i.e. perform dilation and renormalization or erosion as required.

Definition at line 354 of file LevelSetTracker.h.

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

Set the grain-size used for multi-threading.

Note
A grainsize of 0 or less disables multi-threading!

Definition at line 168 of file LevelSetTracker.h.

template<typename GridT , typename InterruptT = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetTracker< GridT, InterruptT >::setNormCount ( int  n)
inline

Set the number of normalizations performed per track or normalize call.

Definition at line 161 of file LevelSetTracker.h.

template<typename GridT , typename InterruptT = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetTracker< GridT, InterruptT >::setSpatialScheme ( math::BiasedGradientScheme  s)
inline

Set the spatial finite difference scheme.

Definition at line 147 of file LevelSetTracker.h.

template<typename GridT , typename InterruptT = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetTracker< GridT, InterruptT >::setState ( const State s)
inline

Set the state of the tracker (see struct defined above)

Definition at line 141 of file LevelSetTracker.h.

template<typename GridT , typename InterruptT = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetTracker< GridT, InterruptT >::setTemporalScheme ( math::TemporalIntegrationScheme  s)
inline

Set the spatial finite difference scheme.

Definition at line 153 of file LevelSetTracker.h.

template<typename GridT , typename InterruptT = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetTracker< GridT, InterruptT >::setTrimming ( TrimMode  mode)
inline

Specify whether to trim voxels outside the narrow band prior to pruning.

See Also
trimming, prune

Definition at line 176 of file LevelSetTracker.h.

template<typename GridT , typename InterruptT >
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetTracker< GridT, InterruptT >::startInterrupter ( const char *  msg)
inline

Definition at line 369 of file LevelSetTracker.h.

template<typename GridT , typename InterruptT >
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetTracker< GridT, InterruptT >::track ( )

Track the level set interface, i.e. rebuild and normalize the narrow band of the level set.

Definition at line 305 of file LevelSetTracker.h.

template<typename GridT , typename InterruptT = util::NullInterrupter>
TrimMode openvdb::OPENVDB_VERSION_NAME::tools::LevelSetTracker< GridT, InterruptT >::trimming ( ) const
inline

Return the trimming mode for voxels outside the narrow band.

Trimming is enabled by default and is applied automatically prior to pruning.

See Also
setTrimming, prune

Definition at line 173 of file LevelSetTracker.h.

template<typename GridT , typename InterruptT = util::NullInterrupter>
ValueType openvdb::OPENVDB_VERSION_NAME::tools::LevelSetTracker< GridT, InterruptT >::voxelSize ( ) const
inline

Definition at line 178 of file LevelSetTracker.h.


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