VTK  9.7.20260805
vtkGenericDataArray.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
55
56#ifndef vtkGenericDataArray_h
57#define vtkGenericDataArray_h
58
59#include "vtkDataArray.h"
60
61#include "vtkCompiler.h" // for VTK_USE_EXTERN_TEMPLATE
62#include "vtkDeprecation.h" // for VTK_DEPRECATED_IN_9_7_0
64#include "vtkSmartPointer.h"
65#include "vtkTypeTraits.h"
66
67#include <cassert> // for assert
68#include <memory> // for std::unique_ptr
69
70VTK_ABI_NAMESPACE_BEGIN
71template <class DerivedT, class ValueTypeT, int ArrayType = vtkArrayTypes::VTK_DATA_ARRAY>
73{
74 static_assert(ArrayType >= vtkArrayTypes::VTK_ABSTRACT_ARRAY &&
76 "ArrayType must be a valid vtkAbstractArray::ArrayType enum value");
77
78public:
81 using ArrayTypeTag = std::integral_constant<int, ArrayType>;
82 using DataTypeTag = std::integral_constant<int, vtkTypeTraits<ValueTypeT>::VTK_TYPE_ID>;
83 using ValueType = ValueTypeT;
84
89
98 {
99 return static_cast<const DerivedT*>(this)->GetValue(valueIdx);
100 }
101
109 void SetValue(vtkIdType valueIdx, ValueType value)
110 VTK_EXPECTS(0 <= valueIdx && valueIdx < GetNumberOfValues())
111 {
112 static_cast<DerivedT*>(this)->SetValue(valueIdx, value);
113 }
114
123 void GetTypedTuple(vtkIdType tupleIdx, ValueType* tuple) const
124 VTK_EXPECTS(0 <= tupleIdx && tupleIdx < GetNumberOfTuples())
125 {
126 static_cast<const DerivedT*>(this)->GetTypedTuple(tupleIdx, tuple);
127 }
128
137 void SetTypedTuple(vtkIdType tupleIdx, const ValueType* tuple)
138 VTK_EXPECTS(0 <= tupleIdx && tupleIdx < GetNumberOfTuples())
139 {
140 static_cast<DerivedT*>(this)->SetTypedTuple(tupleIdx, tuple);
141 }
142
148 ValueType GetTypedComponent(vtkIdType tupleIdx, int compIdx) const
149 VTK_EXPECTS(0 <= tupleIdx && GetNumberOfComponents() * tupleIdx + compIdx < GetNumberOfValues())
150 VTK_EXPECTS(0 <= compIdx && compIdx < GetNumberOfComponents())
151 {
152 return static_cast<const DerivedT*>(this)->GetTypedComponent(tupleIdx, compIdx);
153 }
154
160 void SetTypedComponent(vtkIdType tupleIdx, int compIdx, ValueType value)
161 VTK_EXPECTS(0 <= tupleIdx && GetNumberOfComponents() * tupleIdx + compIdx < GetNumberOfValues())
162 VTK_EXPECTS(0 <= compIdx && compIdx < GetNumberOfComponents())
163 {
164 static_cast<DerivedT*>(this)->SetTypedComponent(tupleIdx, compIdx, value);
165 }
166
168
172 void* GetVoidPointer(vtkIdType valueIdx) override;
173 VTK_DEPRECATED_IN_9_7_0("Use vtkAOSDataArrayTemplate::GetPointer(valueIdx) instead")
175 void SetVoidArray(void*, vtkIdType, int) override;
176 void SetVoidArray(void*, vtkIdType, int, int) override;
177 void SetArrayFreeFunction(void (*callback)(void*)) override;
178 VTK_DEPRECATED_IN_9_7_0("Use vtkAOSDataArrayTemplate::WritePointer(valueIdx, numValues) or "
179 "vtkAbstractArray::SetNumberOf[Values/Tuples]() instead")
180 void* WriteVoidPointer(vtkIdType valueIdx, vtkIdType numValues) override;
181 VTK_DEPRECATED_IN_9_7_0("Use vtkAOSDataArrayTemplate::WritePointer(valueIdx, numValues) or "
182 "vtkAbstractArray::SetNumberOf[Values/Tuples]() instead")
185
192 void RemoveTuple(vtkIdType tupleIdx) override;
193
198
202 void InsertValue(vtkIdType valueIdx, ValueType value);
203
207 void InsertTypedTuple(vtkIdType tupleIdx, const ValueType* t);
208
213
218 void InsertTypedComponent(vtkIdType tupleIdx, int compIdx, ValueType val);
219
221
233 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
234 void GetValueRange(ValueType range[2], int comp);
237
243 void GetValueRange(ValueType range[2]) { this->GetValueRange(range, 0); }
244
251 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
252 void GetFiniteValueRange(ValueType range[2], int comp);
255 void GetFiniteValueRange(ValueType range[2]) { this->GetFiniteValueRange(range, 0); }
257
261 virtual void FillTypedComponent(int compIdx, ValueType value);
262
266 virtual void FillValue(ValueType value);
267
268#ifndef __VTK_WRAP__
270
278#endif
279 int GetArrayType() const override;
280 int GetDataType() const override;
283 int GetDataTypeSize() const override;
284 bool HasStandardMemoryLayout() const override;
286 void SetNumberOfComponents(int num) override;
287 void Squeeze() override;
288 void SetTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray* source) override;
289 // MSVC doesn't like 'using' here (error C2487). Just forward instead:
290 // using Superclass::SetTuple;
291 void SetTuple(vtkIdType tupleIdx, const float* tuple) override
292 {
293 this->Superclass::SetTuple(tupleIdx, tuple);
294 }
295 void SetTuple(vtkIdType tupleIdx, const double* tuple) override
296 {
297 this->Superclass::SetTuple(tupleIdx, tuple);
298 }
299
301 vtkIdType dstStart, vtkIdList* srcIds, vtkAbstractArray* source) override;
302 void InsertTuples(vtkIdList* dstIds, vtkIdList* srcIds, vtkAbstractArray* source) override;
303 // MSVC doesn't like 'using' here (error C2487). Just forward instead:
304 // using Superclass::InsertTuples;
306 vtkIdType dstStart, vtkIdType n, vtkIdType srcStart, vtkAbstractArray* source) override
307 {
308 this->Superclass::InsertTuples(dstStart, n, srcStart, source);
309 }
310
311 void InsertTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray* source) override;
312 void InsertTuple(vtkIdType tupleIdx, const float* source) override;
313 void InsertTuple(vtkIdType tupleIdx, const double* source) override;
314 void InsertComponent(vtkIdType tupleIdx, int compIdx, double value) override;
316 vtkIdType InsertNextTuple(const float* tuple) override;
317 vtkIdType InsertNextTuple(const double* tuple) override;
318 void GetTuples(vtkIdList* tupleIds, vtkAbstractArray* output) override;
319 void GetTuples(vtkIdType p1, vtkIdType p2, vtkAbstractArray* output) override;
320 double* GetTuple(vtkIdType tupleIdx) override;
321 void GetTuple(vtkIdType tupleIdx, double* tuple) override;
323 double* weights) override;
324 void InterpolateTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx1, vtkAbstractArray* source1,
325 vtkIdType srcTupleIdx2, vtkAbstractArray* source2, double t) override;
326 void SetComponent(vtkIdType tupleIdx, int compIdx, double value) override;
327 double GetComponent(vtkIdType tupleIdx, int compIdx) override;
328 void SetVariantValue(vtkIdType valueIdx, vtkVariant value) override;
330 void InsertVariantValue(vtkIdType valueIdx, vtkVariant value) override;
333 void LookupValue(vtkVariant value, vtkIdList* valueIds) override;
334 virtual void LookupTypedValue(ValueType value, vtkIdList* valueIds);
335 void ClearLookup() override;
336 void DataChanged() override;
337 void FillComponent(int compIdx, double value) override;
338 VTK_DEPRECATED_IN_9_7_0("Use vtk::DataArrayValueRange, or the array directly")
340
341protected:
344
351 {
352 return static_cast<DerivedT*>(this)->ReallocateTuples(numTuples);
353 }
354
355 // This method resizes the array if needed so that the given tuple index is
356 // valid/accessible.
358
367 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
368
377 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
378
386 ValueType* ranges, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
387
393 ValueType range[2], const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
394
402 ValueType* ranges, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
403
409 ValueType range[2], const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
410
411 std::vector<double> LegacyTuple;
412 std::vector<ValueType> LegacyValueRange;
413 std::vector<ValueType> LegacyValueRangeFull;
414
416
417private:
419 void operator=(const vtkGenericDataArray&) = delete;
420
421 struct vtkInternals;
422 std::unique_ptr<vtkInternals> Internals;
423};
424VTK_ABI_NAMESPACE_END
425
426// These macros define the vtkGenericDataArray methods that aren't redefined
427// in vtkAOSDataArrayTemplate and vtkSOADataArrayTemplate. The wrappers do
428// not see vtkGenericDataArray as a superclass of AOS/SOA arrays, so these
429// macros are used to fill in the missing parts of the inherited interface.
430#define vtkCreateGenericWrappedArrayReadInterface(T) \
431 int GetDataType() const override; \
432 T GetDataTypeValueMin() const; \
433 T GetDataTypeValueMax() const; \
434 T* GetValueRange(int comp) VTK_SIZEHINT(2); \
435 T* GetValueRange() VTK_SIZEHINT(2); \
436 void GetValueRange(T range[2], int comp);
437#define vtkCreateGenericWrappedArrayWriteInterface(T) \
438 void InsertTypedTuple(vtkIdType i, const T* tuple) VTK_EXPECTS(0 <= i); \
439 vtkIdType InsertNextTypedTuple(const T* tuple); \
440 void InsertValue(vtkIdType id, T f) VTK_EXPECTS(0 <= id); \
441 vtkIdType InsertNextValue(T f);
442#define vtkCreateGenericWrappedArrayInterface(T) \
443 vtkCreateGenericWrappedArrayReadInterface(T); \
444 vtkCreateGenericWrappedArrayWriteInterface(T);
445
446// This macro is used by the subclasses to create dummy
447// declarations for these functions such that the wrapper
448// can see them. The wrappers ignore vtkGenericDataArray.
449#define vtkCreateWrappedArrayReadInterface(T) \
450 vtkCreateGenericWrappedArrayReadInterface(T); \
451 void GetTypedTuple(vtkIdType i, T* tuple) VTK_EXPECTS(0 <= i && i < GetNumberOfTuples()); \
452 T GetTypedComponent(vtkIdType i, int c) const VTK_EXPECTS(0 <= c && c < GetNumberOfComponents()) \
453 VTK_EXPECTS(0 <= i && GetNumberOfComponents() * i + c < GetNumberOfValues()); \
454 T GetValue(vtkIdType id) const VTK_EXPECTS(0 <= id && id < GetNumberOfValues());
455#define vtkCreateWrappedArrayWriteInterface(T) \
456 vtkCreateGenericWrappedArrayWriteInterface(T); \
457 void SetTypedTuple(vtkIdType i, const T* tuple) VTK_EXPECTS(0 <= i && i < GetNumberOfTuples()); \
458 void SetTypedComponent(vtkIdType i, int c, T value); \
459 void SetValue(vtkIdType id, T value) VTK_EXPECTS(0 <= id && id < GetNumberOfValues()); \
460 bool SetNumberOfValues(vtkIdType number) override;
461
462#define VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(ArrayType, ValueType) \
463 template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange( \
464 ArrayType*, ValueType*, vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
465 template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(ArrayType*, ValueType*, \
466 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char); \
467 template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
468 vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
469 template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
470 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char);
471
472namespace vtkDataArrayPrivate
473{
474VTK_ABI_NAMESPACE_BEGIN
475template <typename A, typename R, typename T>
476VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(
477 A*, R*, T, const unsigned char* ghosts, unsigned char ghostsToSkip);
478template <typename A, typename R>
479VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(
480 A*, R[2], AllValues, const unsigned char* ghosts, unsigned char ghostsToSkip);
481template <typename A, typename R>
482VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(
483 A*, R[2], FiniteValues, const unsigned char* ghosts, unsigned char ghostsToSkip);
484VTK_ABI_NAMESPACE_END
485} // namespace vtkDataArrayPrivate
486
487#define VTK_DECLARE_VALUERANGE_ARRAYTYPE(ArrayType, ValueType) \
488 extern template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange( \
489 ArrayType*, ValueType*, vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
490 extern template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(ArrayType*, ValueType*, \
491 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char); \
492 extern template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
493 vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
494 extern template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
495 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char);
496
497#include "vtkGenericDataArray.txx"
498
499// Adds an implementation of NewInstanceInternal() that returns an AoS
500// (unmapped) VTK array, if possible. This allows the pipeline to copy and
501// propagate the array when the array data is not modifiable. Use this in
502// combination with vtkAbstractTypeMacro or vtkAbstractTemplateTypeMacro
503// (instead of vtkTypeMacro) to avoid adding the default NewInstance
504// implementation.
505#define vtkAOSArrayNewInstanceMacro(thisClass) \
506protected: \
507 vtkObjectBase* NewInstanceInternal() const override \
508 { \
509 if (vtkDataArray* da = vtkDataArray::CreateDataArray(thisClass::DataTypeTag::value)) \
510 { \
511 return da; \
512 } \
513 return thisClass::New(); \
514 } \
515 \
516public:
517
518#endif
519
520// This is used to tell libraries other than vtkCommonCore that instantiations of
521// the GetValueRange lookups can be found externally. This prevents each library
522// from instantiating these on their own.
523// Additionally, it helps hide implementation details that pull in system
524// headers.
525#ifdef VTK_USE_EXTERN_TEMPLATE
526
527#ifndef VTK_GDA_TEMPLATE_EXTERN
528#define VTK_GDA_TEMPLATE_EXTERN
529#ifdef _MSC_VER
530#pragma warning(push)
531// The following is needed when the following is declared
532// dllexport and is used from another class in vtkCommonCore
533#pragma warning(disable : 4910) // extern and dllexport incompatible
534#endif
535
536namespace vtkDataArrayPrivate
537{
538VTK_ABI_NAMESPACE_BEGIN
539// This is instantiated in vtkGenericDataArray.cxx
541
542VTK_ABI_NAMESPACE_END
543} // namespace vtkDataArrayPrivate
544
545#ifdef _MSC_VER
546#pragma warning(pop)
547#endif
548#endif // VTK_GDA_TEMPLATE_EXTERN
549
550#endif // VTK_USE_EXTERN_TEMPLATE
551
552// VTK-HeaderTest-Exclude: vtkGenericDataArray.h
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.
virtual void SetTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray *source)=0
Set the tuple at dstTupleIdx in this array to the tuple at srcTupleIdx in the source array.
virtual void InsertTuples(vtkIdList *dstIds, vtkIdList *srcIds, vtkAbstractArray *source)=0
Copy the tuples indexed in srcIds from the source array to the tuple locations indexed by dstIds in t...
vtkIdType GetNumberOfValues() const
Get the total number of values in the array.
Abstract superclass to iterate over elements in an vtkAbstractArray.
internal class used by vtkGenericDataArray to support LookupValue.
void InterpolateTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx1, vtkAbstractArray *source1, vtkIdType srcTupleIdx2, vtkAbstractArray *source2, double t) override
Insert the tuple at dstTupleIdx in this array to the tuple interpolated from the two tuple indices,...
ValueType * GetFiniteValueRange(int comp)
These methods are analogous to the GetValueRange methods, except that the only consider finite values...
void DataChanged() override
Tell the array explicitly that the data has changed.
virtual void LookupTypedValue(ValueType value, vtkIdList *valueIds)
void * GetVoidPointer(vtkIdType valueIdx) override
Default implementation raises a runtime error.
int GetDataTypeSize() const override
Return the size of the underlying data type.
void InsertComponent(vtkIdType tupleIdx, int compIdx, double value) override
Insert value at the location specified by tupleIdx and compIdx.
ValueType * GetValueRange()
Get the range of array values for the 0th component in the native data type.
void GetFiniteValueRange(ValueType range[2])
These methods are analogous to the GetValueRange methods, except that the only consider finite values...
void SetTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray *source) override
See documentation from parent class.
bool HasStandardMemoryLayout() const override
Returns true if this array uses the standard memory layout defined in the VTK user guide,...
void InsertTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray *source) override
See documentation from parent class.
void ComputeValueRange(ValueType range[2], int comp, const unsigned char *ghosts, unsigned char ghostsToSkip=0xff)
Compute the range for a specific component.
void GetFiniteValueRange(ValueType range[2], int comp, const unsigned char *ghosts, unsigned char ghostsToSkip=0xff)
These methods are analogous to the GetValueRange methods, except that the only consider finite values...
void InsertTuple(vtkIdType tupleIdx, const float *source) override
Insert the data tuple at tupleIdx.
double GetComponent(vtkIdType tupleIdx, int compIdx) override
Return the data component at the location specified by tupleIdx and compIdx.
void LookupValue(vtkVariant value, vtkIdList *valueIds) override
Return the value indices where a specific value appears.
void * WriteVoidPointer(vtkIdType valueIdx, vtkIdType numValues) override
int GetArrayType() const override
Method for type-checking in FastDownCast implementations.
bool ComputeVectorValueRange(ValueType range[2], const unsigned char *ghosts, unsigned char ghostsToSkip=0xff)
Returns true if the range was computed.
void SetComponent(vtkIdType tupleIdx, int compIdx, double value) override
Set the data component at the location specified by tupleIdx and compIdx to value.
bool ComputeFiniteScalarValueRange(ValueType *ranges, const unsigned char *ghosts, unsigned char ghostsToSkip=0xff)
Computes the range for each component of an array, the length of ranges must be two times the number ...
vtkTemplateTypeMacro(SelfType, vtkDataArray)
bool EnsureAccessToTuple(vtkIdType tupleIdx)
void ComputeFiniteValueRange(ValueType range[2], int comp, const unsigned char *ghosts, unsigned char ghostsToSkip=0xff)
Compute the range for a specific component.
void GetValueRange(ValueType range[2], int comp, const unsigned char *ghosts, unsigned char ghostsToSkip=0xff)
vtkIdType LookupValue(vtkVariant value) override
Return the value indices where a specific value appears.
ValueType GetDataTypeValueMin() const
void GetTuples(vtkIdType p1, vtkIdType p2, vtkAbstractArray *output) override
Get the tuples for the range of tuple ids specified (i.e., p1->p2 inclusive).
bool ComputeFiniteVectorValueRange(ValueType range[2], const unsigned char *ghosts, unsigned char ghostsToSkip=0xff)
Returns true if the range was computed.
void GetFiniteValueRange(ValueType range[2], int comp)
These methods are analogous to the GetValueRange methods, except that the only consider finite values...
void InsertVariantValue(vtkIdType valueIdx, vtkVariant value) override
Insert a value into the array from a variant.
void InterpolateTuple(vtkIdType dstTupleIdx, vtkIdList *ptIndices, vtkAbstractArray *source, double *weights) override
Set the tuple at dstTupleIdx in this array to the interpolated tuple value, given the ptIndices in th...
void SetTuple(vtkIdType tupleIdx, const double *tuple) override
Set the data tuple at tupleIdx.
void SetVariantValue(vtkIdType valueIdx, vtkVariant value) override
Set a value in the array from a variant.
void SetNumberOfComponents(int num) override
Set/Get the dimension (n) of the components.
void SetTuple(vtkIdType tupleIdx, const float *tuple) override
Set the data tuple at tupleIdx.
virtual vtkIdType LookupTypedValue(ValueType value)
bool ComputeScalarValueRange(ValueType *ranges, const unsigned char *ghosts, unsigned char ghostsToSkip=0xff)
Computes the range for each component of an array, the length of ranges must be two times the number ...
vtkIdType InsertNextTuple(const double *tuple) override
Insert the data tuple at the end of the array and return the tuple index at which the data was insert...
std::integral_constant< int, vtkTypeTraits< T >::VTK_TYPE_ID > DataTypeTag
void GetTuple(vtkIdType tupleIdx, double *tuple) override
Get the data tuple at tupleIdx by filling in a user-provided array, Make sure that your array is larg...
virtual void FillValue(ValueType value)
Set all the values in array to value.
vtkVariant GetVariantValue(vtkIdType valueIdx) override
Retrieve value from the array as a variant.
ValueType * WritePointer(vtkIdType valueIdx, vtkIdType numValues)
void InsertTuples(vtkIdType dstStart, vtkIdType n, vtkIdType srcStart, vtkAbstractArray *source) override
See documentation from parent class.
double * GetTuple(vtkIdType tupleIdx) override
Get the data tuple at tupleIdx.
void GetValueRange(ValueType range[2])
vtkIdType InsertNextTuple(const float *tuple) override
Insert the data tuple at the end of the array and return the tuple index at which the data was insert...
vtkTypeBool ReserveTuples(vtkIdType numTuples) override
Reserve the array to the requested number of tuples and preserve data.
virtual void FillTypedComponent(int compIdx, ValueType value)
Set component comp of all tuples to value.
void InsertTuplesStartingAt(vtkIdType dstStart, vtkIdList *srcIds, vtkAbstractArray *source) override
See documentation from parent class.
void FillComponent(int compIdx, double value) override
Fill a component of a data array with a specified value.
void ClearLookup() override
Delete the associated fast lookup data structure on this array, if it exists.
void InsertTuples(vtkIdList *dstIds, vtkIdList *srcIds, vtkAbstractArray *source) override
See documentation from parent class.
vtkIdType InsertNextTuple(vtkIdType srcTupleIdx, vtkAbstractArray *source) override
See documentation from parent class.
void InsertTypedComponent(vtkIdType tupleIdx, int compIdx, ValueType val)
void Squeeze() override
Free any unnecessary memory.
static DerivedT * FastDownCast(vtkAbstractArray *source)
Perform a fast, safe cast from a vtkAbstractArray to a DerivedT.
int GetDataType() const override
Return the underlying data type.
ValueType GetDataTypeValueMax() const
void InsertTuple(vtkIdType tupleIdx, const double *source) override
Insert the data tuple at tupleIdx.
void GetTuples(vtkIdList *tupleIds, vtkAbstractArray *output) override
Given a list of tuple ids, return an array of tuples.
ValueType * GetFiniteValueRange()
These methods are analogous to the GetValueRange methods, except that the only consider finite values...
vtkGenericDataArray< vtkmDataArray< T >, T, ArrayType > SelfType
list of point or cell ids
Definition vtkIdList.h:26
A type representing the union of many types.
Definition vtkVariant.h:53
void SetTypedComponent(vtkIdType tupleIdx, int compIdx, ValueType value)
Set component compIdx of the tuple at tupleIdx to value.
ValueType GetTypedComponent(vtkIdType tupleIdx, int compIdx) const
Get component compIdx of the tuple at tupleIdx.
void GetTypedTuple(vtkIdType tupleIdx, ValueType *tuple) const
Copy the tuple at tupleIdx into tuple.
void SetTypedTuple(vtkIdType tupleIdx, const ValueType *tuple)
Set this array's tuple at tupleIdx to the values in tuple.
void SetValue(vtkIdType valueIdx, ValueType value)
Set the value at valueIdx to value.
ValueType GetValue(vtkIdType valueIdx) const
Get the value at valueIdx.
VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(A *, R *, T, const unsigned char *ghosts, unsigned char ghostsToSkip)
VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(A *, R[2], AllValues, const unsigned char *ghosts, unsigned char ghostsToSkip)
int vtkTypeBool
Definition vtkABI.h:64
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
#define vtkDataArray
#define VTK_DEPRECATED_IN_9_7_0(reason)
#define VTK_DECLARE_VALUERANGE_ARRAYTYPE(ArrayType, ValueType)
int vtkIdType
Definition vtkType.h:363
@ VTK_ABSTRACT_ARRAY
Definition vtkType.h:72
@ VTK_NUM_ARRAY_TYPES
Definition vtkType.h:99
#define VTK_SIZEHINT(...)
#define VTK_EXPECTS(x)
#define VTK_NEWINSTANCE