VTK-m
2.2
|
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 > | |
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 |
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 |
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.
|
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.
|
private |