4#ifndef vtkImplicitArray_h 
    5#define vtkImplicitArray_h 
    7#include "vtkCommonCoreModule.h"  
  145#define vtkImplicitArrayTypeMacro(thisClass, superclass)                                           \ 
  146  vtkAbstractTypeMacroWithNewInstanceType(thisClass, superclass,                                   \ 
  147    vtkAOSDataArrayTemplate<typename thisClass::ValueType>, typeid(thisClass).name());             \ 
  150  vtkObjectBase* NewInstanceInternal() const override                                              \ 
  152    return vtkAOSDataArrayTemplate<typename thisClass::ValueType>::New();                          \ 
  158VTK_ABI_NAMESPACE_BEGIN
 
  159template <
class BackendT, 
int ArrayType = vtkArrayTypes::VTK_IMPLICIT_ARRAY>
 
  162      typename vtk::detail::implicit_array_traits<BackendT>::rtype, ArrayType>
 
  166    "Supplied backend type does not have mandatory read trait. Must implement either map() const " 
  167    "or operator() const.");
 
  177  using typename Superclass::ValueType;
 
  201    this->GetTypedTupleImpl<BackendT>(idx, tuple);
 
  214    return this->GetTypedComponentImpl<BackendT>(idx, comp);
 
  238  template <
typename... Params>
 
  241    this->
SetBackend(std::make_shared<BackendT>(std::forward<Params>(params)...));
 
  265    this->Initialize<BackendT>();
 
  281    return this->GetActualMemorySizeImpl<BackendT>();
 
  296  template <
typename OtherBackend, 
int OtherArrayType>
 
  299    static_assert(std::is_same_v<BackendT, OtherBackend>,
 
  300      "Cannot copy implicit array with one type of backend to an implicit array with a different " 
  302    static_assert(ArrayTypeTag::value == OtherArrayType,
 
  303      "Cannot copy implicit array with one array type to an implicit array with a different " 
  309  using vtkDataArray::DeepCopy;
 
  312    if (da == 
nullptr || da == 
this)
 
  367  template <
typename U>
 
  368  typename std::enable_if<vtk::detail::has_map_trait<U>::value, 
ValueType>::type GetValueImpl(
 
  371    return this->Backend->map(idx);
 
  379  template <
typename U>
 
  380  typename std::enable_if<vtk::detail::is_closure_trait<U>::value, 
ValueType>::type GetValueImpl(
 
  383    return (*this->Backend)(idx);
 
  391  template <
typename U>
 
  392  typename std::enable_if<vtk::detail::implicit_array_traits<U>::default_constructible, 
void>::type
 
  395    this->Backend = std::make_shared<BackendT>();
 
  403  template <
typename U>
 
  404  typename std::enable_if<!vtk::detail::implicit_array_traits<U>::default_constructible, 
void>::type
 
  407    this->Backend = 
nullptr;
 
  415  template <
typename U>
 
  416  typename std::enable_if<vtk::detail::implicit_array_traits<U>::can_direct_read_tuple, 
void>::type
 
  420      std::is_same<typename vtk::detail::can_map_tuple_trait<U>::rtype, 
ValueType>::value,
 
  421      "Tuple type should be the same as the return type of the mapTuple");
 
  422    this->Backend->mapTuple(idx, tuple);
 
  430  template <
typename U>
 
  431  typename std::enable_if<!vtk::detail::implicit_array_traits<U>::can_direct_read_tuple &&
 
  445  template <
typename U>
 
  446  typename std::enable_if<!vtk::detail::implicit_array_traits<U>::can_direct_read_tuple &&
 
  454      tuple[comp] = this->
GetValue(tupIdx + comp);
 
  463  template <
typename U>
 
  464  typename std::enable_if<vtk::detail::implicit_array_traits<U>::can_direct_read_component,
 
  466  GetTypedComponentImpl(
vtkIdType idx, 
int comp)
 const 
  469      std::is_same<typename vtk::detail::can_map_component_trait<U>::rtype, 
ValueType>::value,
 
  470      "Component return type should be the same as the return type of the mapComponent");
 
  471    return this->Backend->mapComponent(idx, comp);
 
  479  template <
typename U>
 
  480  typename std::enable_if<!vtk::detail::implicit_array_traits<U>::can_direct_read_component,
 
  482  GetTypedComponentImpl(
vtkIdType idx, 
int comp)
 const 
  484    return this->
GetValue(idx * this->NumberOfComponents + comp);
 
  492  template <
typename U>
 
  493  typename std::enable_if<vtk::detail::implicit_array_traits<U>::can_get_memory_size,
 
  495  GetActualMemorySizeImpl()
 const 
  497    return this->Backend->getMemorySize();
 
  504  template <
typename U>
 
  505  typename std::enable_if<!vtk::detail::implicit_array_traits<U>::can_get_memory_size,
 
  507  GetActualMemorySizeImpl()
 const 
  520#include "vtkImplicitArray.txx" 
  522#define vtkCreateReadOnlyWrappedArrayInterface(T)                                                  \ 
  523  int GetDataType() const override;                                                                \ 
  524  T GetDataTypeValueMin() const;                                                                   \ 
  525  T GetDataTypeValueMax() const;                                                                   \ 
  526  void GetTypedTuple(vtkIdType i, T* tuple) VTK_EXPECTS(0 <= i && i < GetNumberOfTuples());        \ 
  527  T GetValue(vtkIdType id) const VTK_EXPECTS(0 <= id && id < GetNumberOfValues());                 \ 
  528  T* GetValueRange(int comp) VTK_SIZEHINT(2);                                                      \ 
  529  T* GetValueRange() VTK_SIZEHINT(2); 
  533#define VTK_WRAP_TEMPLATE(...) __VA_ARGS__ 
  535#ifdef VTK_USE_EXTERN_TEMPLATE 
  537#ifndef VTK_IMPLICIT_TEMPLATE_EXTERN 
  538#define VTK_IMPLICIT_TEMPLATE_EXTERN 
  543#pragma warning(disable : 4910)  
  546VTK_ABI_NAMESPACE_BEGIN
 
  547template <typename ValueType>
 
  549template <typename ValueType>
 
  551template <typename ValueType>
 
  553template <typename ValueType>
 
  555template <typename ValueType>
 
  562VTK_ABI_NAMESPACE_BEGIN
 
  563template <
typename A, 
typename R, 
typename T>
 
  564VTKCOMMONCORE_EXPORT 
bool DoComputeScalarRange(
 
  565  A*, R*, T, 
const unsigned char* ghosts, 
unsigned char ghostsToSkip);
 
  566template <
typename A, 
typename R>
 
  567VTKCOMMONCORE_EXPORT 
bool DoComputeVectorRange(
 
  568  A*, R[2], AllValues, 
const unsigned char* ghosts, 
unsigned char ghostsToSkip);
 
  569template <
typename A, 
typename R>
 
  570VTKCOMMONCORE_EXPORT 
bool DoComputeVectorRange(
 
  571  A*, R[2], FiniteValues, 
const unsigned char* ghosts, 
unsigned char ghostsToSkip);
 
  575#define VTK_DECLARE_VALUERANGE_IMPLICIT_BACKENDTYPE(BackendT, ArrayTypeValue)                      \ 
  576  VTK_DECLARE_VALUERANGE_ARRAYTYPE(                                                                \ 
  577    VTK_WRAP_TEMPLATE(vtkImplicitArray<BackendT<float>, ArrayTypeValue>), double)                  \ 
  578  VTK_DECLARE_VALUERANGE_ARRAYTYPE(                                                                \ 
  579    VTK_WRAP_TEMPLATE(vtkImplicitArray<BackendT<double>, ArrayTypeValue>), double)                 \ 
  580  VTK_DECLARE_VALUERANGE_ARRAYTYPE(                                                                \ 
  581    VTK_WRAP_TEMPLATE(vtkImplicitArray<BackendT<char>, ArrayTypeValue>), double)                   \ 
  582  VTK_DECLARE_VALUERANGE_ARRAYTYPE(                                                                \ 
  583    VTK_WRAP_TEMPLATE(vtkImplicitArray<BackendT<signed char>, ArrayTypeValue>), double)            \ 
  584  VTK_DECLARE_VALUERANGE_ARRAYTYPE(                                                                \ 
  585    VTK_WRAP_TEMPLATE(vtkImplicitArray<BackendT<unsigned char>, ArrayTypeValue>), double)          \ 
  586  VTK_DECLARE_VALUERANGE_ARRAYTYPE(                                                                \ 
  587    VTK_WRAP_TEMPLATE(vtkImplicitArray<BackendT<short>, ArrayTypeValue>), double)                  \ 
  588  VTK_DECLARE_VALUERANGE_ARRAYTYPE(                                                                \ 
  589    VTK_WRAP_TEMPLATE(vtkImplicitArray<BackendT<unsigned short>, ArrayTypeValue>), double)         \ 
  590  VTK_DECLARE_VALUERANGE_ARRAYTYPE(                                                                \ 
  591    VTK_WRAP_TEMPLATE(vtkImplicitArray<BackendT<int>, ArrayTypeValue>), double)                    \ 
  592  VTK_DECLARE_VALUERANGE_ARRAYTYPE(                                                                \ 
  593    VTK_WRAP_TEMPLATE(vtkImplicitArray<BackendT<unsigned int>, ArrayTypeValue>), double)           \ 
  594  VTK_DECLARE_VALUERANGE_ARRAYTYPE(                                                                \ 
  595    VTK_WRAP_TEMPLATE(vtkImplicitArray<BackendT<long>, ArrayTypeValue>), double)                   \ 
  596  VTK_DECLARE_VALUERANGE_ARRAYTYPE(                                                                \ 
  597    VTK_WRAP_TEMPLATE(vtkImplicitArray<BackendT<unsigned long>, ArrayTypeValue>), double)          \ 
  598  VTK_DECLARE_VALUERANGE_ARRAYTYPE(                                                                \ 
  599    VTK_WRAP_TEMPLATE(vtkImplicitArray<BackendT<long long>, ArrayTypeValue>), double)              \ 
  600  VTK_DECLARE_VALUERANGE_ARRAYTYPE(                                                                \ 
  601    VTK_WRAP_TEMPLATE(vtkImplicitArray<BackendT<unsigned long long>, ArrayTypeValue>), double) 
  605VTK_ABI_NAMESPACE_BEGIN
 
Abstract superclass for all arrays.
 
int GetNumberOfComponents() const
Set/Get the dimension (n) of the components.
 
vtkIdType GetNumberOfTuples() const
Get the number of complete tuples (a component group) in the array.
 
std::integral_constant< int, VTK_OPAQUE > DataTypeTag
 
std::integral_constant< int, vtkArrayTypes::VTK_ABSTRACT_ARRAY > ArrayTypeTag
 
A utility structure serving as a backend for composite arrays: an array composed of multiple arrays c...
 
abstract superclass for arrays of numeric data
 
void DeepCopy(vtkAbstractArray *aa) override
Deep copy of data.
 
void Modified() override
Removes out-of-date L2_NORM_RANGE() and L2_NORM_FINITE_RANGE() values.
 
Base interface for all typed vtkDataArray subclasses.
 
void Initialize() override
Release storage and reset array to initial state.
 
void SetNumberOfTuples(vtkIdType number) override
Set the number of tuples (a component group) in the array.
 
void SetNumberOfComponents(int num) override
Set/Get the dimension (n) of the components.
 
A read only array class that wraps an implicit function from integers to any value type supported by ...
 
vtkImplicitArrayTypeMacro(SelfType, GenericDataArrayType)
 
void ImplicitDeepCopy(vtkImplicitArray< OtherBackend, OtherArrayType > *other)
Specific DeepCopy for implicit arrays.
 
void SetTypedTuple(vtkIdType tupleIdx, const ValueType *tuple)
Will not do anything for these read only arrays!
 
void Squeeze() override
Release all extraneous internal memory including the void pointer used by GetVoidPointer
 
void SetTypedComponent(vtkIdType tupleIdx, int comp, ValueType value)
Will not do anything for these read only arrays!
 
std::unique_ptr< vtkInternals > Internals
 
bool AllocateTuples(vtkIdType numTuples)
No allocation necessary.
 
void ConstructBackend(Params &&... params)
Utility method for setting backend parameterization directly.
 
bool ReallocateTuples(vtkIdType numTuples)
No allocation necessary.
 
std::shared_ptr< BackendT > GetBackend()
Setter/Getter for Backend.
 
static vtkImplicitArray< BackendT, ArrayType > * FastDownCast(vtkAbstractArray *source)
Perform a fast, safe cast from a vtkAbstractArray to a vtkDataArray.
 
static vtkImplicitArray * New()
 
unsigned long GetActualMemorySize() const override
Return the memory in kibibytes (1024 bytes) consumed by this implicit data array.
 
void SetBackend(std::shared_ptr< BackendT > newBackend)
Setter/Getter for Backend.
 
void SetValue(vtkIdType idx, ValueType value)
Will not do anything for these read only arrays!
 
ValueType GetValue(vtkIdType idx) const
Implementation of vtkGDAConceptMethods.
 
ValueType GetTypedComponent(vtkIdType idx, int comp) const
Get component comp of the tuple at idx.
 
void Initialize() override
Reset the array to default construction.
 
vtkImplicitArray< BackendT, ArrayType > SelfType
 
std::integral_constant< int, vtkArrayTypes::VTK_ABSTRACT_ARRAY > ArrayTypeTag
 
void * GetVoidPointer(vtkIdType valueIdx) override
Use of this method is discouraged, it creates a memory copy of the data into a contiguous AoS-ordered...
 
void DeepCopy(vtkDataArray *da) override
Specific DeepCopy for implicit arrays.
 
std::shared_ptr< BackendT > Backend
The backend object actually mapping the indexes.
 
void GetTypedTuple(vtkIdType idx, ValueType *tuple) const
Copy the tuple at idx into tuple.
 
~vtkImplicitArray() override
 
A backend for the vtkImplicitArray framework allowing one to use a subset of a given data array,...
 
A backend for the vtkImplicitArray to query structured points efficiently.
 
A utility structure serving as a backend for affine (as a function of the index) implicit arrays.
 
A utility structure serving as a backend for constant implicit arrays.
 
A composite trait for handling all the different capabilities a "backend" to an implicit array can ha...
 
static constexpr bool can_read
 
typename trait::rtype rtype
 
#define vtkArrayDownCast_Template2FastCastMacro(ArrayT)
Same as vtkArrayDownCast_FastCastMacro, but treats ArrayT as a two-parameter template (the parameter ...
 
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
 
#define VTK_DECLARE_VALUERANGE_ARRAYTYPE(ArrayType, ValueType)
 
#define VTK_DECLARE_VALUERANGE_IMPLICIT_BACKENDTYPE(BackendT, ArrayTypeValue)
 
#define VTK_WRAP_TEMPLATE(...)
 
@ VTK_STRUCTURED_POINT_ARRAY