OpenVDB  3.0.0
Classes | Public Types | Public Member Functions | List of all members
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

typedef GridT GridType
 
typedef GridT::TreeType TreeType
 
typedef LevelSetTracker< GridT, InterruptT > TrackerT
 
typedef TrackerT::LeafRange LeafRange
 
typedef TrackerT::LeafType LeafType
 
typedef TrackerT::BufferType BufferType
 
typedef TrackerT::ValueType ScalarType
 

Public Member Functions

 LevelSetMorphing (GridT &sourceGrid, const GridT &targetGrid, InterruptT *interrupt=NULL)
 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...
 
ScalarType minMask () const
 Return the minimum value of the mask to be used for the derivation of a smooth alpha value. More...
 
ScalarType maxMask () const
 Return the maximum value of the mask to be used for the derivation of a smooth alpha value. More...
 
void setMaskRange (ScalarType min, ScalarType 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 (ScalarType time0, ScalarType 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::v3_0_0::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 = NULL)// 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).

Member Typedef Documentation

typedef GridT GridType
typedef LevelSetTracker<GridT, InterruptT> TrackerT
typedef GridT::TreeType TreeType

Constructor & Destructor Documentation

LevelSetMorphing ( GridT &  sourceGrid,
const GridT &  targetGrid,
InterruptT *  interrupt = NULL 
)
inline

Main constructor.

virtual ~LevelSetMorphing ( )
inlinevirtual

Member Function Documentation

size_t advect ( ScalarType  time0,
ScalarType  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
int getGrainSize ( ) const
inline

Return the grain size used for multithreading.

int getNormCount ( ) const
inline

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

math::BiasedGradientScheme getSpatialScheme ( ) const
inline

Return the spatial finite-difference scheme.

math::TemporalIntegrationScheme getTemporalScheme ( ) const
inline

Return the temporal integration scheme.

math::BiasedGradientScheme getTrackerSpatialScheme ( ) const
inline

Return the spatial finite-difference scheme.

math::TemporalIntegrationScheme getTrackerTemporalScheme ( ) const
inline

Return the temporal integration scheme.

void 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.

bool 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.

ScalarType maxMask ( ) const
inline

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

ScalarType minMask ( ) const
inline

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

void setAlphaMask ( const GridT &  maskGrid)
inline

Define the alpha mask.

void setGrainSize ( int  grainsize)
inline

Set the grain size used for multithreading.

Note
A grain size of 0 or less disables multithreading!
void setMaskRange ( ScalarType  min,
ScalarType  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 then max.
void setNormCount ( int  n)
inline

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

void setSpatialScheme ( math::BiasedGradientScheme  scheme)
inline

Set the spatial finite-difference scheme.

void setTarget ( const GridT &  targetGrid)
inline

Redefine the target level set.

void setTemporalScheme ( math::TemporalIntegrationScheme  scheme)
inline

Set the temporal integration scheme.

void setTrackerSpatialScheme ( math::BiasedGradientScheme  scheme)
inline

Set the spatial finite-difference scheme.

void setTrackerTemporalScheme ( math::TemporalIntegrationScheme  scheme)
inline

Set the temporal integration scheme.


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