VTK-m
2.0
|
Implicit function that can switch among different types. More...
#include <ImplicitFunction.h>
Public Types | |
using | Scalar = typename Superclass::Scalar |
using | Vector = typename Superclass::Vector |
Public Member Functions | |
ImplicitFunctionMultiplexer ()=default | |
template<typename FunctionType > | |
VTKM_EXEC_CONT | ImplicitFunctionMultiplexer (const vtkm::internal::ImplicitFunctionBase< FunctionType > &function) |
VTKM_EXEC_CONT Scalar | Value (const Vector &point) const |
VTKM_EXEC_CONT Vector | Gradient (const Vector &point) const |
Private Types | |
using | Superclass = vtkm::internal::ImplicitFunctionBase< ImplicitFunctionMultiplexer< ImplicitFunctionTypes... > > |
Private Attributes | |
vtkm::exec::Variant< ImplicitFunctionTypes... > | Variant |
Implicit function that can switch among different types.
An ImplicitFunctionMultiplexer
is a templated ImplicitFunction
that takes as template arguments any number of other ImplicitFunction
s 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.
using vtkm::ImplicitFunctionMultiplexer< ImplicitFunctionTypes >::Scalar = typename Superclass::Scalar |
|
private |
using vtkm::ImplicitFunctionMultiplexer< ImplicitFunctionTypes >::Vector = typename Superclass::Vector |
|
default |
|
inline |
|
inline |
|
inline |
|
private |