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

Shape morphology of level sets. Morphing from a source narrow-band level sets to a target narrow-band level set. More...

#include <LevelSetMorph.h>

Public Types

using GridType = GridT
 
using TreeType = typename GridT::TreeType
 
using TrackerT = LevelSetTracker< GridT, InterruptT >
 
using LeafRange = typename TrackerT::LeafRange
 
using LeafType = typename TrackerT::LeafType
 
using BufferType = typename TrackerT::BufferType
 
using ValueType = typename TrackerT::ValueType
 

Public Member Functions

 LevelSetMorphing (GridT &sourceGrid, const GridT &targetGrid, InterruptT *interrupt=nullptr)
 Main constructor. More...
 
virtual ~LevelSetMorphing ()
 
void setTarget (const GridT &targetGrid)
 Redefine the target level set. More...
 
void setAlphaMask (const GridT &maskGrid)
 Define the alpha mask. More...
 
math::BiasedGradientScheme getSpatialScheme () const
 Return the spatial finite-difference scheme. More...
 
void setSpatialScheme (math::BiasedGradientScheme scheme)
 Set the spatial finite-difference scheme. More...
 
math::TemporalIntegrationScheme getTemporalScheme () const
 Return the temporal integration scheme. More...
 
void setTemporalScheme (math::TemporalIntegrationScheme scheme)
 Set the temporal integration scheme. More...
 
math::BiasedGradientScheme getTrackerSpatialScheme () const
 Return the spatial finite-difference scheme. More...
 
void setTrackerSpatialScheme (math::BiasedGradientScheme scheme)
 Set the spatial finite-difference scheme. More...
 
math::TemporalIntegrationScheme getTrackerTemporalScheme () const
 Return the temporal integration scheme. More...
 
void setTrackerTemporalScheme (math::TemporalIntegrationScheme scheme)
 Set the temporal integration scheme. More...
 
int getNormCount () const
 Return the number of normalizations performed per track or normalize call. More...
 
void setNormCount (int n)
 Set the number of normalizations performed per track or normalize call. More...
 
int getGrainSize () const
 Return the grain size used for multithreading. More...
 
void setGrainSize (int grainsize)
 Set the grain size used for multithreading. More...
 
ValueType minMask () const
 Return the minimum value of the mask to be used for the derivation of a smooth alpha value. More...
 
ValueType maxMask () const
 Return the maximum value of the mask to be used for the derivation of a smooth alpha value. More...
 
void setMaskRange (ValueType min, ValueType max)
 Define the range for the (optional) scalar mask. More...
 
bool isMaskInverted () const
 Return true if the mask is inverted, i.e. min->max in the original mask maps to 1->0 in the inverted alpha mask. More...
 
void invertMask (bool invert=true)
 Invert the optional mask, i.e. min->max in the original mask maps to 1->0 in the inverted alpha mask. More...
 
size_t advect (ValueType time0, ValueType time1)
 Advect the level set from its current time, time0, to its final time, time1. If time0 > time1, perform backward advection. More...
 

Detailed Description

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

Shape morphology of level sets. Morphing from a source narrow-band level sets to a target narrow-band level set.

The InterruptType template argument below refers to any class with the following interface:

class Interrupter {
...
public:
void start(const char* name = nullptr) // called when computations begin
void end() // called when computations end
bool wasInterrupted(int percent=-1) // return true to break computation
};
Note
If no template argument is provided for this InterruptType, the util::NullInterrupter is used, which implies that all interrupter calls are no-ops (i.e., they incur no computational overhead).

Definition at line 47 of file LevelSetMorph.h.

Member Typedef Documentation

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

Definition at line 55 of file LevelSetMorph.h.

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

Definition at line 50 of file LevelSetMorph.h.

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

Definition at line 53 of file LevelSetMorph.h.

template<typename GridT, typename InterruptT = util::NullInterrupter>
using openvdb::OPENVDB_VERSION_NAME::tools::LevelSetMorphing< GridT, InterruptT >::LeafType = typename TrackerT::LeafType

Definition at line 54 of file LevelSetMorph.h.

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

Definition at line 52 of file LevelSetMorph.h.

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

Definition at line 51 of file LevelSetMorph.h.

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

Definition at line 56 of file LevelSetMorph.h.

Constructor & Destructor Documentation

template<typename GridT, typename InterruptT = util::NullInterrupter>
openvdb::OPENVDB_VERSION_NAME::tools::LevelSetMorphing< GridT, InterruptT >::LevelSetMorphing ( GridT &  sourceGrid,
const GridT &  targetGrid,
InterruptT *  interrupt = nullptr 
)
inline

Main constructor.

Definition at line 59 of file LevelSetMorph.h.

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

Definition at line 71 of file LevelSetMorph.h.

Member Function Documentation

template<typename GridT , typename InterruptT >
size_t openvdb::OPENVDB_VERSION_NAME::tools::LevelSetMorphing< GridT, InterruptT >::advect ( ValueType  time0,
ValueType  time1 
)
inline

Advect the level set from its current time, time0, to its final time, time1. If time0 > time1, perform backward advection.

Returns
the number of CFL iterations used to advect from time0 to time1

Definition at line 241 of file LevelSetMorph.h.

template<typename GridT, typename InterruptT = util::NullInterrupter>
int openvdb::OPENVDB_VERSION_NAME::tools::LevelSetMorphing< GridT, InterruptT >::getGrainSize ( ) const
inline

Return the grain size used for multithreading.

Definition at line 115 of file LevelSetMorph.h.

template<typename GridT, typename InterruptT = util::NullInterrupter>
int openvdb::OPENVDB_VERSION_NAME::tools::LevelSetMorphing< GridT, InterruptT >::getNormCount ( ) const
inline

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

Definition at line 110 of file LevelSetMorph.h.

template<typename GridT, typename InterruptT = util::NullInterrupter>
math::BiasedGradientScheme openvdb::OPENVDB_VERSION_NAME::tools::LevelSetMorphing< GridT, InterruptT >::getSpatialScheme ( ) const
inline

Return the spatial finite-difference scheme.

Definition at line 80 of file LevelSetMorph.h.

template<typename GridT, typename InterruptT = util::NullInterrupter>
math::TemporalIntegrationScheme openvdb::OPENVDB_VERSION_NAME::tools::LevelSetMorphing< GridT, InterruptT >::getTemporalScheme ( ) const
inline

Return the temporal integration scheme.

Definition at line 85 of file LevelSetMorph.h.

template<typename GridT, typename InterruptT = util::NullInterrupter>
math::BiasedGradientScheme openvdb::OPENVDB_VERSION_NAME::tools::LevelSetMorphing< GridT, InterruptT >::getTrackerSpatialScheme ( ) const
inline

Return the spatial finite-difference scheme.

Definition at line 90 of file LevelSetMorph.h.

template<typename GridT, typename InterruptT = util::NullInterrupter>
math::TemporalIntegrationScheme openvdb::OPENVDB_VERSION_NAME::tools::LevelSetMorphing< GridT, InterruptT >::getTrackerTemporalScheme ( ) const
inline

Return the temporal integration scheme.

Definition at line 100 of file LevelSetMorph.h.

template<typename GridT, typename InterruptT = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetMorphing< GridT, InterruptT >::invertMask ( bool  invert = true)
inline

Invert the optional mask, i.e. min->max in the original mask maps to 1->0 in the inverted alpha mask.

Definition at line 147 of file LevelSetMorph.h.

template<typename GridT, typename InterruptT = util::NullInterrupter>
bool openvdb::OPENVDB_VERSION_NAME::tools::LevelSetMorphing< GridT, InterruptT >::isMaskInverted ( ) const
inline

Return true if the mask is inverted, i.e. min->max in the original mask maps to 1->0 in the inverted alpha mask.

Definition at line 144 of file LevelSetMorph.h.

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

Return the maximum value of the mask to be used for the derivation of a smooth alpha value.

Definition at line 126 of file LevelSetMorph.h.

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

Return the minimum value of the mask to be used for the derivation of a smooth alpha value.

Definition at line 122 of file LevelSetMorph.h.

template<typename GridT, typename InterruptT = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetMorphing< GridT, InterruptT >::setAlphaMask ( const GridT &  maskGrid)
inline

Define the alpha mask.

Definition at line 77 of file LevelSetMorph.h.

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

Set the grain size used for multithreading.

Note
A grain size of 0 or less disables multithreading!

Definition at line 118 of file LevelSetMorph.h.

template<typename GridT, typename InterruptT = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetMorphing< GridT, InterruptT >::setMaskRange ( ValueType  min,
ValueType  max 
)
inline

Define the range for the (optional) scalar mask.

Parameters
minMinimum value of the range.
maxMaximum value of the range.

Mask values outside the range maps to alpha values of respectfully zero and one, and values inside the range maps smoothly to 0->1 (unless of course the mask is inverted).

Exceptions
ValueErrorif min is not smaller than max.

Definition at line 135 of file LevelSetMorph.h.

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

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

Definition at line 112 of file LevelSetMorph.h.

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

Set the spatial finite-difference scheme.

Definition at line 82 of file LevelSetMorph.h.

template<typename GridT, typename InterruptT = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetMorphing< GridT, InterruptT >::setTarget ( const GridT &  targetGrid)
inline

Redefine the target level set.

Definition at line 74 of file LevelSetMorph.h.

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

Set the temporal integration scheme.

Definition at line 87 of file LevelSetMorph.h.

template<typename GridT, typename InterruptT = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetMorphing< GridT, InterruptT >::setTrackerSpatialScheme ( math::BiasedGradientScheme  scheme)
inline

Set the spatial finite-difference scheme.

Definition at line 95 of file LevelSetMorph.h.

template<typename GridT, typename InterruptT = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::LevelSetMorphing< GridT, InterruptT >::setTrackerTemporalScheme ( math::TemporalIntegrationScheme  scheme)
inline

Set the temporal integration scheme.

Definition at line 105 of file LevelSetMorph.h.


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