VTK  9.3.20240424
Public Member Functions | Public Attributes | List of all members
vtkAffineImplicitBackend< ValueType > Struct Template Referencefinal

A utility structure serving as a backend for affine (as a function of the index) implicit arrays. More...

#include <vtkAffineImplicitBackend.h>

Public Member Functions

 vtkAffineImplicitBackend (ValueType slope, ValueType intercept)
 A non-trivially constructible constructor.
 
ValueType operator() (int index) const
 The main call method for the backend.
 

Public Attributes

ValueType Slope
 The slope of the affine function on the indices.
 
ValueType Intercept
 The value of the affine function at index 0.
 

Detailed Description

template<typename ValueType>
struct vtkAffineImplicitBackend< ValueType >

A utility structure serving as a backend for affine (as a function of the index) implicit arrays.

This structure can be classified as a closure and can be called using syntax similar to a function call.

At construction it takes two parameters: the slope of the map and the intercept. It returns a value calculated as:

value = slope * index + intercept

An example of potential usage in a vtkImplicitArray

double slope = some_number;
double intercept = some_other_number;
affineArray->SetBackend(std::make_shared<vtkAffineImplicitBackend<double>>(slope, intercept));
affineArray->SetNumberOfTuples(however_many_you_want);
affineArray->SetNumberOfComponents(whatever_youd_like);
double value = affineArray->GetTypedComponent(index_in_tuple_range, index_in_component_range);
Allocate and hold a VTK object.
Definition vtkNew.h:160
A utility structure serving as a backend for affine (as a function of the index) implicit arrays.

Definition at line 35 of file vtkAffineImplicitBackend.h.

Constructor & Destructor Documentation

◆ vtkAffineImplicitBackend()

template<typename ValueType >
vtkAffineImplicitBackend< ValueType >::vtkAffineImplicitBackend ( ValueType  slope,
ValueType  intercept 
)

A non-trivially constructible constructor.

Parameters
slopethe slope of the affine function
interceptthe intercept value at the origin (i.e. the value at 0)

Member Function Documentation

◆ operator()()

template<typename ValueType >
ValueType vtkAffineImplicitBackend< ValueType >::operator() ( int  index) const

The main call method for the backend.

Parameters
indexthe index at which one wished to evaluate the backend
Returns
the affinely computed value

Member Data Documentation

◆ Slope

template<typename ValueType >
ValueType vtkAffineImplicitBackend< ValueType >::Slope

The slope of the affine function on the indices.

Definition at line 56 of file vtkAffineImplicitBackend.h.

◆ Intercept

template<typename ValueType >
ValueType vtkAffineImplicitBackend< ValueType >::Intercept

The value of the affine function at index 0.

Definition at line 60 of file vtkAffineImplicitBackend.h.


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