OpenVDB 11.0.0

Loading...
Searching...
No Matches
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 <openvdb/tools/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.
virtual | ~LevelSetMorphing ()
void | setTarget (const GridT &targetGrid)
| Redefine the target level set.
void | setAlphaMask (const GridT &maskGrid)
| Define the alpha mask.
math::BiasedGradientScheme | getSpatialScheme () const
| Return the spatial finite-difference scheme.
void | setSpatialScheme (math::BiasedGradientScheme scheme)
| Set the spatial finite-difference scheme.
math::TemporalIntegrationScheme | getTemporalScheme () const
| Return the temporal integration scheme.
void | setTemporalScheme (math::TemporalIntegrationScheme scheme)
| Set the temporal integration scheme.
math::BiasedGradientScheme | getTrackerSpatialScheme () const
| Return the spatial finite-difference scheme.
void | setTrackerSpatialScheme (math::BiasedGradientScheme scheme)
| Set the spatial finite-difference scheme.
math::TemporalIntegrationScheme | getTrackerTemporalScheme () const
| Return the temporal integration scheme.
void | setTrackerTemporalScheme (math::TemporalIntegrationScheme scheme)
| Set the temporal integration scheme.
int | getNormCount () const
| Return the number of normalizations performed per track or normalize call.
void | setNormCount (int n)
| Set the number of normalizations performed per track or normalize call.
int | getGrainSize () const
| Return the grain size used for multithreading.
void | setGrainSize (int grainsize)
| Set the grain size used for multithreading.
ValueType | minMask () const
| Return the minimum value of the mask to be used for the derivation of a smooth alpha value.
ValueType | maxMask () const
| Return the maximum value of the mask to be used for the derivation of a smooth alpha value.
void | setMaskRange (ValueType min, ValueType max)
| Define the range for the (optional) scalar mask.
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.
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.
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.

## Detailed Description

template<typename GridT, typename InterruptT = util::NullInterrupter>
class openvdb::v11_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 = 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).

## Member Typedef Documentation

## ◆ BufferType

template<typename GridT, typename InterruptT = util::NullInterrupter>

using BufferType = typename TrackerT::BufferType

## ◆ GridType

template<typename GridT, typename InterruptT = util::NullInterrupter>

using GridType = GridT

## ◆ LeafRange

template<typename GridT, typename InterruptT = util::NullInterrupter>

using LeafRange = typename TrackerT::LeafRange

## ◆ LeafType

template<typename GridT, typename InterruptT = util::NullInterrupter>

using LeafType = typename TrackerT::LeafType

## ◆ TrackerT

template<typename GridT, typename InterruptT = util::NullInterrupter>

using TrackerT = LevelSetTracker<GridT, InterruptT>

## ◆ TreeType

template<typename GridT, typename InterruptT = util::NullInterrupter>

using TreeType = typename GridT::TreeType

## ◆ ValueType

template<typename GridT, typename InterruptT = util::NullInterrupter>

using ValueType = typename TrackerT::ValueType

## Constructor & Destructor Documentation

## ◆ LevelSetMorphing()

template<typename GridT, typename InterruptT = util::NullInterrupter>

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

Main constructor.

## ◆ ~LevelSetMorphing()

template<typename GridT, typename InterruptT = util::NullInterrupter>

virtual ~LevelSetMorphing | ( |  | ) |
| inline virtual

## Member Function Documentation

## ◆ advect()

template<typename GridT, typename InterruptT>

size_t 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

## ◆ getGrainSize()

template<typename GridT, typename InterruptT = util::NullInterrupter>

int getGrainSize | ( |  | ) | const
| inline

Return the grain size used for multithreading.

## ◆ getNormCount()

template<typename GridT, typename InterruptT = util::NullInterrupter>

int getNormCount | ( |  | ) | const
| inline

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

## ◆ getSpatialScheme()

template<typename GridT, typename InterruptT = util::NullInterrupter>

math::BiasedGradientScheme getSpatialScheme | ( |  | ) | const
| inline

Return the spatial finite-difference scheme.

## ◆ getTemporalScheme()

template<typename GridT, typename InterruptT = util::NullInterrupter>

math::TemporalIntegrationScheme getTemporalScheme | ( |  | ) | const
| inline

Return the temporal integration scheme.

## ◆ getTrackerSpatialScheme()

template<typename GridT, typename InterruptT = util::NullInterrupter>

math::BiasedGradientScheme getTrackerSpatialScheme | ( |  | ) | const
| inline

Return the spatial finite-difference scheme.

## ◆ getTrackerTemporalScheme()

template<typename GridT, typename InterruptT = util::NullInterrupter>

math::TemporalIntegrationScheme getTrackerTemporalScheme | ( |  | ) | const
| inline

Return the temporal integration scheme.

## ◆ invertMask()

template<typename GridT, typename InterruptT = util::NullInterrupter>

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.

## ◆ isMaskInverted()

template<typename GridT, typename InterruptT = util::NullInterrupter>

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.

## ◆ maxMask()

template<typename GridT, typename InterruptT = util::NullInterrupter>

ValueType maxMask | ( |  | ) | const
| inline

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

## ◆ minMask()

template<typename GridT, typename InterruptT = util::NullInterrupter>

ValueType minMask | ( |  | ) | const
| inline

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

## ◆ setAlphaMask()

template<typename GridT, typename InterruptT = util::NullInterrupter>

void setAlphaMask | ( | const GridT & | maskGrid | ) |
| inline

Define the alpha mask.

## ◆ setGrainSize()

template<typename GridT, typename InterruptT = util::NullInterrupter>

void setGrainSize | ( | int | grainsize | ) |
| inline

Set the grain size used for multithreading.

Note
  A grain size of 0 or less disables multithreading!

## ◆ setMaskRange()

template<typename GridT, typename InterruptT = util::NullInterrupter>

void setMaskRange | ( | ValueType | min,
|  | ValueType | max )
| inline

Define the range for the (optional) scalar mask.

Parameters

  min | Minimum value of the range.
  max | Maximum 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

  ValueError | if min is not smaller than max.

## ◆ setNormCount()

template<typename GridT, typename InterruptT = util::NullInterrupter>

void setNormCount | ( | int | n | ) |
| inline

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

## ◆ setSpatialScheme()

template<typename GridT, typename InterruptT = util::NullInterrupter>

void setSpatialScheme | ( | math::BiasedGradientScheme | scheme | ) |
| inline

Set the spatial finite-difference scheme.

## ◆ setTarget()

template<typename GridT, typename InterruptT = util::NullInterrupter>

void setTarget | ( | const GridT & | targetGrid | ) |
| inline

Redefine the target level set.

## ◆ setTemporalScheme()

template<typename GridT, typename InterruptT = util::NullInterrupter>

void setTemporalScheme | ( | math::TemporalIntegrationScheme | scheme | ) |
| inline

Set the temporal integration scheme.

## ◆ setTrackerSpatialScheme()

template<typename GridT, typename InterruptT = util::NullInterrupter>

void setTrackerSpatialScheme | ( | math::BiasedGradientScheme | scheme | ) |
| inline

Set the spatial finite-difference scheme.

## ◆ setTrackerTemporalScheme()

template<typename GridT, typename InterruptT = util::NullInterrupter>

void setTrackerTemporalScheme | ( | math::TemporalIntegrationScheme | scheme | ) |
| inline

Set the temporal integration scheme.