VTK: vtkAffineImplicitBackend< ValueType > Struct Template Reference

| VTK 9.3.1

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. More...
ValueType | operator() (int index) const
| The main call method for the backend. More...

## Public Attributes
ValueType | Slope
| The slope of the affine function on the indeces. More...
ValueType | Intercept
| The value of the affine function at index 0. More...

## 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;
vtkNew<vtkImplicitArray<vtkAffineImplicitBackend<double>>> affineArray;
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);
vtkNew
Allocate and hold a VTK object.
Definition: vtkNew.h:60
vtkX3D::value
@ value
Definition: vtkX3D.h:220
vtkAffineImplicitBackend
A utility structure serving as a backend for affine (as a function of the index) implicit arrays.
Definition: vtkAffineImplicitBackend.h:36

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

  slope | the slope of the affine function
  intercept | the 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

  index | the 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 indeces.

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:

- Common/Core/vtkAffineImplicitBackend.h