VTK-m  2.1
Public Types | Public Member Functions | Private Types | Private Attributes | List of all members
vtkm::ImplicitFunctionMultiplexer< ImplicitFunctionTypes > Class Template Reference

Implicit function that can switch among different types. More...

#include <ImplicitFunction.h>

Inheritance diagram for vtkm::ImplicitFunctionMultiplexer< ImplicitFunctionTypes >:
vtkm::cont::ExecutionAndControlObjectBase vtkm::cont::ExecutionObjectBase

Public Types

using Scalar = typename Superclass::Scalar
 
using Vector = typename Superclass::Vector
 

Public Member Functions

 ImplicitFunctionMultiplexer ()=default
 
template<typename FunctionType >
 ImplicitFunctionMultiplexer (const vtkm::internal::ImplicitFunctionBase< FunctionType > &function)
 
Scalar Value (const Vector &point) const
 Evaluate the value of the implicit function. More...
 
Vector Gradient (const Vector &point) const
 Evaluate the gradient of the implicit function. More...
 

Private Types

using Superclass = vtkm::internal::ImplicitFunctionBase< ImplicitFunctionMultiplexer< ImplicitFunctionTypes... > >
 

Private Attributes

vtkm::exec::Variant< ImplicitFunctionTypes... > Variant
 

Detailed Description

template<typename... ImplicitFunctionTypes>
class vtkm::ImplicitFunctionMultiplexer< ImplicitFunctionTypes >

Implicit function that can switch among different types.

An ImplicitFunctionMultiplexer is a templated ImplicitFunction that takes as template arguments any number of other ImplicitFunctions that it can behave as. This allows you to decide at runtime which of these implicit functions to define and compute.

For example, let's say you want a filter that finds points either inside a sphere or inside a box. Rather than create 2 different filters, one for each type of implicit function, you can use ImplicitFunctionMultiplexer<Sphere, Box> and then set either a Sphere or a Box at runtime.

To use ImplicitFunctionMultiplexer, simply create the actual implicit function that you want to use, and then set the ImplicitFunctionMultiplexer to that concrete implicit function object.

Member Typedef Documentation

◆ Scalar

template<typename... ImplicitFunctionTypes>
using vtkm::ImplicitFunctionMultiplexer< ImplicitFunctionTypes >::Scalar = typename Superclass::Scalar

◆ Superclass

template<typename... ImplicitFunctionTypes>
using vtkm::ImplicitFunctionMultiplexer< ImplicitFunctionTypes >::Superclass = vtkm::internal::ImplicitFunctionBase<ImplicitFunctionMultiplexer<ImplicitFunctionTypes...> >
private

◆ Vector

template<typename... ImplicitFunctionTypes>
using vtkm::ImplicitFunctionMultiplexer< ImplicitFunctionTypes >::Vector = typename Superclass::Vector

Constructor & Destructor Documentation

◆ ImplicitFunctionMultiplexer() [1/2]

template<typename... ImplicitFunctionTypes>
vtkm::ImplicitFunctionMultiplexer< ImplicitFunctionTypes >::ImplicitFunctionMultiplexer ( )
default

◆ ImplicitFunctionMultiplexer() [2/2]

template<typename... ImplicitFunctionTypes>
template<typename FunctionType >
vtkm::ImplicitFunctionMultiplexer< ImplicitFunctionTypes >::ImplicitFunctionMultiplexer ( const vtkm::internal::ImplicitFunctionBase< FunctionType > &  function)
inline

Member Function Documentation

◆ Gradient()

template<typename... ImplicitFunctionTypes>
Vector vtkm::ImplicitFunctionMultiplexer< ImplicitFunctionTypes >::Gradient ( const Vector point) const
inline

Evaluate the gradient of the implicit function.

The Gradient() method for an implicit function takes a vtkm::Vec3f and returns a vtkm::Vec3f representing the pointing direction from the implicit function's shape. Gradient calculations are more object shape specific. It is advised to look at the individual shape implementations for specific implicit functions.

◆ Value()

template<typename... ImplicitFunctionTypes>
Scalar vtkm::ImplicitFunctionMultiplexer< ImplicitFunctionTypes >::Value ( const Vector point) const
inline

Evaluate the value of the implicit function.

The Value() method for an implicit function takes a vtkm::Vec3f and returns a vtkm::FloatDefault representing the orientation of the point with respect to the implicit function's shape. Negative scalar values represent vector points inside of the implicit function's shape. Positive scalar values represent vector points outside the implicit function's shape. Zero values represent vector points that lie on the surface of the implicit function.

Member Data Documentation

◆ Variant

template<typename... ImplicitFunctionTypes>
vtkm::exec::Variant<ImplicitFunctionTypes...> vtkm::ImplicitFunctionMultiplexer< ImplicitFunctionTypes >::Variant
private

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