VTK  9.5.20250913
Public Member Functions | List of all members
vtkStridedImplicitBackend< ValueType > Class Template Referencefinal

A backend for the vtkImplicitArray framework to give a strided view on a buffer. More...

#include <vtkStridedImplicitBackend.h>

Public Member Functions

 ~vtkStridedImplicitBackend ()
 
ValueType operator() (vtkIdType idx) const
 Return the value at the given flat idx.
 
void mapTuple (vtkIdType tupleIdx, ValueType *tuple) const
 Fill tuple with the content of the tupleIdx of the array.
 
ValueType mapComponent (vtkIdType tupleIdx, int compIdx) const
 Return the specified component value.
 
 vtkStridedImplicitBackend (const ValueType *buffer, vtkIdType stride, int components, vtkIdType offset)
 Constructors.
 
 vtkStridedImplicitBackend (const ValueType *buffer, vtkIdType stride, int components)
 Constructors.
 
 vtkStridedImplicitBackend (const ValueType *buffer, vtkIdType stride)
 Constructors.
 

Detailed Description

template<typename ValueType>
class vtkStridedImplicitBackend< ValueType >

A backend for the vtkImplicitArray framework to give a strided view on a buffer.

Warning
The buffer is not owned by the backend: do not try to use the vtkImplicitArray after the buffer memory is released.

See vtkStridedArray for an example of usage.

See also
vtkImplicitArray, vtkStridedArray

Definition at line 27 of file vtkStridedImplicitBackend.h.

Constructor & Destructor Documentation

◆ vtkStridedImplicitBackend() [1/3]

template<typename ValueType >
vtkStridedImplicitBackend< ValueType >::vtkStridedImplicitBackend ( const ValueType *  buffer,
vtkIdType  stride,
int  components,
vtkIdType  offset 
)

Constructors.

  • stride is the number of values in a buffer tuple.
  • components is the number of components of the resulting array, usually less than stride.
  • offset is the the number of buffer values to skip to get the first array value. In other words:
  • the constructed array starts at buffer[offset].
  • the component "i" of first tuple is at buffer[offset + i]
  • the tuple "n" starts at buffer[stride * n + offset]
  • so the component "i" of the tuple "n" is at buffer[stride * n + offset + i]

◆ vtkStridedImplicitBackend() [2/3]

template<typename ValueType >
vtkStridedImplicitBackend< ValueType >::vtkStridedImplicitBackend ( const ValueType *  buffer,
vtkIdType  stride,
int  components 
)

Constructors.

  • stride is the number of values in a buffer tuple.
  • components is the number of components of the resulting array, usually less than stride.
  • offset is the the number of buffer values to skip to get the first array value. In other words:
  • the constructed array starts at buffer[offset].
  • the component "i" of first tuple is at buffer[offset + i]
  • the tuple "n" starts at buffer[stride * n + offset]
  • so the component "i" of the tuple "n" is at buffer[stride * n + offset + i]

◆ vtkStridedImplicitBackend() [3/3]

template<typename ValueType >
vtkStridedImplicitBackend< ValueType >::vtkStridedImplicitBackend ( const ValueType *  buffer,
vtkIdType  stride 
)

Constructors.

  • stride is the number of values in a buffer tuple.
  • components is the number of components of the resulting array, usually less than stride.
  • offset is the the number of buffer values to skip to get the first array value. In other words:
  • the constructed array starts at buffer[offset].
  • the component "i" of first tuple is at buffer[offset + i]
  • the tuple "n" starts at buffer[stride * n + offset]
  • so the component "i" of the tuple "n" is at buffer[stride * n + offset + i]

◆ ~vtkStridedImplicitBackend()

template<typename ValueType >
vtkStridedImplicitBackend< ValueType >::~vtkStridedImplicitBackend ( )

Member Function Documentation

◆ operator()()

template<typename ValueType >
ValueType vtkStridedImplicitBackend< ValueType >::operator() ( vtkIdType  idx) const

Return the value at the given flat idx.

This is equivalent to mapComponent(tupleIdx, compIdx) where idx = tupleIdx * NumberOfComponents + compIdx

◆ mapTuple()

template<typename ValueType >
void vtkStridedImplicitBackend< ValueType >::mapTuple ( vtkIdType  tupleIdx,
ValueType *  tuple 
) const

Fill tuple with the content of the tupleIdx of the array.

In the buffer, this is buffer[this->Stride * tupleIdx + this->Offset].

◆ mapComponent()

template<typename ValueType >
ValueType vtkStridedImplicitBackend< ValueType >::mapComponent ( vtkIdType  tupleIdx,
int  compIdx 
) const

Return the specified component value.

It is at buffer[this->Stride * tupleIdx + compIdx + this->Offset]


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