VTK  9.7.0
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_6_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
88 enum
89 {
90 VTK_DATA_TYPE VTK_DEPRECATED_IN_9_6_0("Use DataTypeTag::value") =
92 };
93
98
107 {
108 return static_cast<const DerivedT*>(this)->GetValue(valueIdx);
109 }
110
118 void SetValue(vtkIdType valueIdx, ValueType value)
119 VTK_EXPECTS(0 <= valueIdx && valueIdx < GetNumberOfValues())
120 {
121 static_cast<DerivedT*>(this)->SetValue(valueIdx, value);
122 }
123
132 void GetTypedTuple(vtkIdType tupleIdx, ValueType* tuple) const
133 VTK_EXPECTS(0 <= tupleIdx && tupleIdx < GetNumberOfTuples())
134 {
135 static_cast<const DerivedT*>(this)->GetTypedTuple(tupleIdx, tuple);
136 }
137
146 void SetTypedTuple(vtkIdType tupleIdx, const ValueType* tuple)
147 VTK_EXPECTS(0 <= tupleIdx && tupleIdx < GetNumberOfTuples())
148 {
149 static_cast<DerivedT*>(this)->SetTypedTuple(tupleIdx, tuple);
150 }
151
157 ValueType GetTypedComponent(vtkIdType tupleIdx, int compIdx) const
158 VTK_EXPECTS(0 <= tupleIdx && GetNumberOfComponents() * tupleIdx + compIdx < GetNumberOfValues())
159 VTK_EXPECTS(0 <= compIdx && compIdx < GetNumberOfComponents())
160 {
161 return static_cast<const DerivedT*>(this)->GetTypedComponent(tupleIdx, compIdx);
162 }
163
169 void SetTypedComponent(vtkIdType tupleIdx, int compIdx, ValueType value)
170 VTK_EXPECTS(0 <= tupleIdx && GetNumberOfComponents() * tupleIdx + compIdx < GetNumberOfValues())
171 VTK_EXPECTS(0 <= compIdx && compIdx < GetNumberOfComponents())
172 {
173 static_cast<DerivedT*>(this)->SetTypedComponent(tupleIdx, compIdx, value);
174 }
175
177
181 void* GetVoidPointer(vtkIdType valueIdx) override;
182 VTK_DEPRECATED_IN_9_7_0("Use vtkAOSDataArrayTemplate::GetPointer(valueIdx) instead")
184 void SetVoidArray(void*, vtkIdType, int) override;
185 void SetVoidArray(void*, vtkIdType, int, int) override;
186 void SetArrayFreeFunction(void (*callback)(void*)) override;
187 VTK_DEPRECATED_IN_9_7_0("Use vtkAOSDataArrayTemplate::WritePointer(valueIdx, numValues) or "
188 "vtkAbstractArray::SetNumberOf[Values/Tuples]() instead")
189 void* WriteVoidPointer(vtkIdType valueIdx, vtkIdType numValues) override;
190 VTK_DEPRECATED_IN_9_7_0("Use vtkAOSDataArrayTemplate::WritePointer(valueIdx, numValues) or "
191 "vtkAbstractArray::SetNumberOf[Values/Tuples]() instead")
194
201 void RemoveTuple(vtkIdType tupleIdx) override;
202
207
211 void InsertValue(vtkIdType valueIdx, ValueType value);
212
216 void InsertTypedTuple(vtkIdType tupleIdx, const ValueType* t);
217
222
227 void InsertTypedComponent(vtkIdType tupleIdx, int compIdx, ValueType val);
228
230
242 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
243 void GetValueRange(ValueType range[2], int comp);
246
252 void GetValueRange(ValueType range[2]) { this->GetValueRange(range, 0); }
253
260 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
261 void GetFiniteValueRange(ValueType range[2], int comp);
264 void GetFiniteValueRange(ValueType range[2]) { this->GetFiniteValueRange(range, 0); }
266
270 virtual void FillTypedComponent(int compIdx, ValueType value);
271
275 virtual void FillValue(ValueType value);
276
277#ifndef __VTK_WRAP__
279
287#endif
288 int GetArrayType() const override;
289 int GetDataType() const override;
292 int GetDataTypeSize() const override;
293 bool HasStandardMemoryLayout() const override;
295 void SetNumberOfComponents(int num) override;
296 void Squeeze() override;
297 void SetTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray* source) override;
298 // MSVC doesn't like 'using' here (error C2487). Just forward instead:
299 // using Superclass::SetTuple;
300 void SetTuple(vtkIdType tupleIdx, const float* tuple) override
301 {
302 this->Superclass::SetTuple(tupleIdx, tuple);
303 }
304 void SetTuple(vtkIdType tupleIdx, const double* tuple) override
305 {
306 this->Superclass::SetTuple(tupleIdx, tuple);
307 }
308
310 vtkIdType dstStart, vtkIdList* srcIds, vtkAbstractArray* source) override;
311 void InsertTuples(vtkIdList* dstIds, vtkIdList* srcIds, vtkAbstractArray* source) override;
312 // MSVC doesn't like 'using' here (error C2487). Just forward instead:
313 // using Superclass::InsertTuples;
315 vtkIdType dstStart, vtkIdType n, vtkIdType srcStart, vtkAbstractArray* source) override
316 {
317 this->Superclass::InsertTuples(dstStart, n, srcStart, source);
318 }
319
320 void InsertTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray* source) override;
321 void InsertTuple(vtkIdType tupleIdx, const float* source) override;
322 void InsertTuple(vtkIdType tupleIdx, const double* source) override;
323 void InsertComponent(vtkIdType tupleIdx, int compIdx, double value) override;
325 vtkIdType InsertNextTuple(const float* tuple) override;
326 vtkIdType InsertNextTuple(const double* tuple) override;
327 void GetTuples(vtkIdList* tupleIds, vtkAbstractArray* output) override;
328 void GetTuples(vtkIdType p1, vtkIdType p2, vtkAbstractArray* output) override;
329 double* GetTuple(vtkIdType tupleIdx) override;
330 void GetTuple(vtkIdType tupleIdx, double* tuple) override;
332 double* weights) override;
333 void InterpolateTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx1, vtkAbstractArray* source1,
334 vtkIdType srcTupleIdx2, vtkAbstractArray* source2, double t) override;
335 void SetComponent(vtkIdType tupleIdx, int compIdx, double value) override;
336 double GetComponent(vtkIdType tupleIdx, int compIdx) override;
337 void SetVariantValue(vtkIdType valueIdx, vtkVariant value) override;
339 void InsertVariantValue(vtkIdType valueIdx, vtkVariant value) override;
342 void LookupValue(vtkVariant value, vtkIdList* valueIds) override;
343 virtual void LookupTypedValue(ValueType value, vtkIdList* valueIds);
344 void ClearLookup() override;
345 void DataChanged() override;
346 void FillComponent(int compIdx, double value) override;
347 VTK_DEPRECATED_IN_9_7_0("Use vtk::DataArrayValueRange, or the array directly")
349
350protected:
353
360 {
361 return static_cast<DerivedT*>(this)->ReallocateTuples(numTuples);
362 }
363
364 // This method resizes the array if needed so that the given tuple index is
365 // valid/accessible.
367
376 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
377
386 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
387
395 ValueType* ranges, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
396
402 ValueType range[2], const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
403
411 ValueType* ranges, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
412
418 ValueType range[2], const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
419
420 std::vector<double> LegacyTuple;
421 std::vector<ValueType> LegacyValueRange;
422 std::vector<ValueType> LegacyValueRangeFull;
423
425
426private:
428 void operator=(const vtkGenericDataArray&) = delete;
429
430 struct vtkInternals;
431 std::unique_ptr<vtkInternals> Internals;
432};
433VTK_ABI_NAMESPACE_END
434
435// These macros define the vtkGenericDataArray methods that aren't redefined
436// in vtkAOSDataArrayTemplate and vtkSOADataArrayTemplate. The wrappers do
437// not see vtkGenericDataArray as a superclass of AOS/SOA arrays, so these
438// macros are used to fill in the missing parts of the inherited interface.
439#define vtkCreateGenericWrappedArrayReadInterface(T) \
440 int GetDataType() const override; \
441 T GetDataTypeValueMin() const; \
442 T GetDataTypeValueMax() const; \
443 T* GetValueRange(int comp) VTK_SIZEHINT(2); \
444 T* GetValueRange() VTK_SIZEHINT(2); \
445 void GetValueRange(T range[2], int comp); \
446 void GetValueRange(T range[2], int comp);
447#define vtkCreateGenericWrappedArrayWriteInterface(T) \
448 void InsertTypedTuple(vtkIdType i, const T* tuple) VTK_EXPECTS(0 <= i); \
449 vtkIdType InsertNextTypedTuple(const T* tuple); \
450 void InsertValue(vtkIdType id, T f) VTK_EXPECTS(0 <= id); \
451 vtkIdType InsertNextValue(T f);
452#define vtkCreateGenericWrappedArrayInterface(T) \
453 vtkCreateGenericWrappedArrayReadInterface(T); \
454 vtkCreateGenericWrappedArrayWriteInterface(T);
455
456// This macro is used by the subclasses to create dummy
457// declarations for these functions such that the wrapper
458// can see them. The wrappers ignore vtkGenericDataArray.
459#define vtkCreateWrappedArrayReadInterface(T) \
460 vtkCreateGenericWrappedArrayReadInterface(T); \
461 void GetTypedTuple(vtkIdType i, T* tuple) VTK_EXPECTS(0 <= i && i < GetNumberOfTuples()); \
462 T GetTypedComponent(vtkIdType i, int c) const VTK_EXPECTS(0 <= c && c < GetNumberOfComponents()) \
463 VTK_EXPECTS(0 <= i && GetNumberOfComponents() * i + c < GetNumberOfValues()); \
464 T GetValue(vtkIdType id) const VTK_EXPECTS(0 <= id && id < GetNumberOfValues());
465#define vtkCreateWrappedArrayWriteInterface(T) \
466 vtkCreateGenericWrappedArrayWriteInterface(T); \
467 void SetTypedTuple(vtkIdType i, const T* tuple) VTK_EXPECTS(0 <= i && i < GetNumberOfTuples()); \
468 void SetTypedComponent(vtkIdType i, int c, ValueType value); \
469 void SetValue(vtkIdType id, T value) VTK_EXPECTS(0 <= id && id < GetNumberOfValues()); \
470 bool SetNumberOfValues(vtkIdType number) override;
471
472#define VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(ArrayType, ValueType) \
473 template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange( \
474 ArrayType*, ValueType*, vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
475 template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(ArrayType*, ValueType*, \
476 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char); \
477 template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
478 vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
479 template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
480 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char);
481
482namespace vtkDataArrayPrivate
483{
484VTK_ABI_NAMESPACE_BEGIN
485template <typename A, typename R, typename T>
486VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(
487 A*, R*, T, const unsigned char* ghosts, unsigned char ghostsToSkip);
488template <typename A, typename R>
489VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(
490 A*, R[2], AllValues, const unsigned char* ghosts, unsigned char ghostsToSkip);
491template <typename A, typename R>
492VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(
493 A*, R[2], FiniteValues, const unsigned char* ghosts, unsigned char ghostsToSkip);
494VTK_ABI_NAMESPACE_END
495} // namespace vtkDataArrayPrivate
496
497#define VTK_DECLARE_VALUERANGE_ARRAYTYPE(ArrayType, ValueType) \
498 extern template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange( \
499 ArrayType*, ValueType*, vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
500 extern template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(ArrayType*, ValueType*, \
501 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char); \
502 extern template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
503 vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
504 extern template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
505 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char);
506
507#include "vtkGenericDataArray.txx"
508
509// Adds an implementation of NewInstanceInternal() that returns an AoS
510// (unmapped) VTK array, if possible. This allows the pipeline to copy and
511// propagate the array when the array data is not modifiable. Use this in
512// combination with vtkAbstractTypeMacro or vtkAbstractTemplateTypeMacro
513// (instead of vtkTypeMacro) to avoid adding the default NewInstance
514// implementation.
515#define vtkAOSArrayNewInstanceMacro(thisClass) \
516protected: \
517 vtkObjectBase* NewInstanceInternal() const override \
518 { \
519 if (vtkDataArray* da = vtkDataArray::CreateDataArray(thisClass::DataTypeTag::value)) \
520 { \
521 return da; \
522 } \
523 return thisClass::New(); \
524 } \
525 \
526public:
527
528#endif
529
530// This is used to tell libraries other than vtkCommonCore that instantiations of
531// the GetValueRange lookups can be found externally. This prevents each library
532// from instantiating these on their own.
533// Additionally, it helps hide implementation details that pull in system
534// headers.
535#ifdef VTK_USE_EXTERN_TEMPLATE
536
537#ifndef VTK_GDA_TEMPLATE_EXTERN
538#define VTK_GDA_TEMPLATE_EXTERN
539#ifdef _MSC_VER
540#pragma warning(push)
541// The following is needed when the following is declared
542// dllexport and is used from another class in vtkCommonCore
543#pragma warning(disable : 4910) // extern and dllexport incompatible
544#endif
545
546namespace vtkDataArrayPrivate
547{
548VTK_ABI_NAMESPACE_BEGIN
549// This is instantiated in vtkGenericDataArray.cxx
551
552VTK_ABI_NAMESPACE_END
553} // namespace vtkDataArrayPrivate
554
555#ifdef _MSC_VER
556#pragma warning(pop)
557#endif
558#endif // VTK_GDA_TEMPLATE_EXTERN
559
560#endif // VTK_USE_EXTERN_TEMPLATE
561
562// 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)
Template defining traits of native types used by VTK.
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_DEPRECATED_IN_9_6_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