VTK  9.6.1
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
56
57#ifndef vtkGenericDataArray_h
58#define vtkGenericDataArray_h
59
60#include "vtkDataArray.h"
61
62#include "vtkCompiler.h" // for VTK_USE_EXTERN_TEMPLATE
63#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_6_0
65#include "vtkSmartPointer.h"
66#include "vtkTypeTraits.h"
67
68#include <cassert>
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;
183 void SetVoidArray(void*, vtkIdType, int) override;
184 void SetVoidArray(void*, vtkIdType, int, int) override;
185 void SetArrayFreeFunction(void (*callback)(void*)) override;
186 void* WriteVoidPointer(vtkIdType valueIdx, vtkIdType numValues) override;
189
196 void RemoveTuple(vtkIdType tupleIdx) override;
197
202
206 void InsertValue(vtkIdType valueIdx, ValueType value);
207
211 void InsertTypedTuple(vtkIdType tupleIdx, const ValueType* t);
212
217
222 void InsertTypedComponent(vtkIdType tupleIdx, int compIdx, ValueType val);
223
225
237 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
238 void GetValueRange(ValueType range[2], int comp);
241
247 void GetValueRange(ValueType range[2]) { this->GetValueRange(range, 0); }
248
255 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
256 void GetFiniteValueRange(ValueType range[2], int comp);
259 void GetFiniteValueRange(ValueType range[2]) { this->GetFiniteValueRange(range, 0); }
261
266 VTK_DEPRECATED_IN_9_6_0("Use GetSize() instead")
267 vtkIdType Capacity() { return this->Size; }
268
272 virtual void FillTypedComponent(int compIdx, ValueType value);
273
277 virtual void FillValue(ValueType value);
278
279#ifndef __VTK_WRAP__
281
289#endif
290 int GetArrayType() const override;
291 int GetDataType() const override;
294 int GetDataTypeSize() const override;
295 bool HasStandardMemoryLayout() const override;
296 vtkTypeBool Allocate(vtkIdType size, vtkIdType ext = 1000) override;
297 vtkTypeBool Resize(vtkIdType numTuples) override;
298 void SetNumberOfComponents(int num) override;
299 void SetNumberOfTuples(vtkIdType number) override;
300 void Initialize() override;
301 void Squeeze() override;
302 void SetTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray* source) override;
303 // MSVC doesn't like 'using' here (error C2487). Just forward instead:
304 // using Superclass::SetTuple;
305 void SetTuple(vtkIdType tupleIdx, const float* tuple) override
306 {
307 this->Superclass::SetTuple(tupleIdx, tuple);
308 }
309 void SetTuple(vtkIdType tupleIdx, const double* tuple) override
310 {
311 this->Superclass::SetTuple(tupleIdx, tuple);
312 }
313
315 vtkIdType dstStart, vtkIdList* srcIds, vtkAbstractArray* source) override;
316 void InsertTuples(vtkIdList* dstIds, vtkIdList* srcIds, vtkAbstractArray* source) override;
317 // MSVC doesn't like 'using' here (error C2487). Just forward instead:
318 // using Superclass::InsertTuples;
320 vtkIdType dstStart, vtkIdType n, vtkIdType srcStart, vtkAbstractArray* source) override
321 {
322 this->Superclass::InsertTuples(dstStart, n, srcStart, source);
323 }
324
325 void InsertTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray* source) override;
326 void InsertTuple(vtkIdType tupleIdx, const float* source) override;
327 void InsertTuple(vtkIdType tupleIdx, const double* source) override;
328 void InsertComponent(vtkIdType tupleIdx, int compIdx, double value) override;
330 vtkIdType InsertNextTuple(const float* tuple) override;
331 vtkIdType InsertNextTuple(const double* tuple) override;
332 void GetTuples(vtkIdList* tupleIds, vtkAbstractArray* output) override;
333 void GetTuples(vtkIdType p1, vtkIdType p2, vtkAbstractArray* output) override;
334 double* GetTuple(vtkIdType tupleIdx) override;
335 void GetTuple(vtkIdType tupleIdx, double* tuple) override;
337 double* weights) override;
338 void InterpolateTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx1, vtkAbstractArray* source1,
339 vtkIdType srcTupleIdx2, vtkAbstractArray* source2, double t) override;
340 void SetComponent(vtkIdType tupleIdx, int compIdx, double value) override;
341 double GetComponent(vtkIdType tupleIdx, int compIdx) override;
342 void SetVariantValue(vtkIdType valueIdx, vtkVariant value) override;
344 void InsertVariantValue(vtkIdType valueIdx, vtkVariant value) override;
347 void LookupValue(vtkVariant value, vtkIdList* valueIds) override;
348 virtual void LookupTypedValue(ValueType value, vtkIdList* valueIds);
349 void ClearLookup() override;
350 void DataChanged() override;
351 void FillComponent(int compIdx, double value) override;
353
354protected:
357
363 bool AllocateTuples(vtkIdType numTuples)
364 {
365 return static_cast<DerivedT*>(this)->AllocateTuples(numTuples);
366 }
367
374 {
375 return static_cast<DerivedT*>(this)->ReallocateTuples(numTuples);
376 }
377
378 // This method resizes the array if needed so that the given tuple index is
379 // valid/accessible.
381
390 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
391
400 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
401
409 ValueType* ranges, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
410
416 ValueType range[2], const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
417
425 ValueType* ranges, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
426
432 ValueType range[2], const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
433
434 std::vector<double> LegacyTuple;
435 std::vector<ValueType> LegacyValueRange;
436 std::vector<ValueType> LegacyValueRangeFull;
437
439
440private:
442 void operator=(const vtkGenericDataArray&) = delete;
443};
444VTK_ABI_NAMESPACE_END
445
446// Forward declare necessary stuffs:
447VTK_ABI_NAMESPACE_BEGIN
448template <typename ValueType>
450template <typename ValueType>
452template <typename ValueType>
454VTK_ABI_NAMESPACE_END
455
456#define VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(ArrayType, ValueType) \
457 template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange( \
458 ArrayType*, ValueType*, vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
459 template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(ArrayType*, ValueType*, \
460 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char); \
461 template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
462 vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
463 template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
464 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char);
465
466#define VTK_INSTANTIATE_VALUERANGE_VALUETYPE(ValueType) \
467 VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(vtkAOSDataArrayTemplate<ValueType>, ValueType) \
468 VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(vtkSOADataArrayTemplate<ValueType>, ValueType) \
469 VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(vtkScaledSOADataArrayTemplate<ValueType>, ValueType)
470
471namespace vtkDataArrayPrivate
472{
473VTK_ABI_NAMESPACE_BEGIN
474template <typename A, typename R, typename T>
475VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(
476 A*, R*, T, const unsigned char* ghosts, unsigned char ghostsToSkip);
477template <typename A, typename R>
478VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(
479 A*, R[2], AllValues, const unsigned char* ghosts, unsigned char ghostsToSkip);
480template <typename A, typename R>
481VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(
482 A*, R[2], FiniteValues, const unsigned char* ghosts, unsigned char ghostsToSkip);
483VTK_ABI_NAMESPACE_END
484} // namespace vtkDataArrayPrivate
485
486#define VTK_DECLARE_VALUERANGE_ARRAYTYPE(ArrayType, ValueType) \
487 extern template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange( \
488 ArrayType*, ValueType*, vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
489 extern template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(ArrayType*, ValueType*, \
490 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char); \
491 extern template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
492 vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
493 extern template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
494 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char);
495
496#define VTK_DECLARE_VALUERANGE_VALUETYPE(ValueType) \
497 VTK_DECLARE_VALUERANGE_ARRAYTYPE(vtkAOSDataArrayTemplate<ValueType>, ValueType) \
498 VTK_DECLARE_VALUERANGE_ARRAYTYPE(vtkSOADataArrayTemplate<ValueType>, ValueType) \
499 VTK_DECLARE_VALUERANGE_ARRAYTYPE(vtkScaledSOADataArrayTemplate<ValueType>, ValueType)
500
501#include "vtkGenericDataArray.txx"
502
503// Adds an implementation of NewInstanceInternal() that returns an AoS
504// (unmapped) VTK array, if possible. This allows the pipeline to copy and
505// propagate the array when the array data is not modifiable. Use this in
506// combination with vtkAbstractTypeMacro or vtkAbstractTemplateTypeMacro
507// (instead of vtkTypeMacro) to avoid adding the default NewInstance
508// implementation.
509#define vtkAOSArrayNewInstanceMacro(thisClass) \
510protected: \
511 vtkObjectBase* NewInstanceInternal() const override \
512 { \
513 if (vtkDataArray* da = vtkDataArray::CreateDataArray(thisClass::DataTypeTag::value)) \
514 { \
515 return da; \
516 } \
517 return thisClass::New(); \
518 } \
519 \
520public:
521
522#endif
523
524// This is used to tell libraries other than vtkCommonCore that instantiations of
525// the GetValueRange lookups can be found externally. This prevents each library
526// from instantiating these on their own.
527// Additionally it helps hide implementation details that pull in system
528// headers.
529// We only provide these specializations for the 64-bit integer types, since
530// other types can reuse the double-precision mechanism in
531// vtkDataArray::GetRange without losing precision.
532#ifdef VTK_USE_EXTERN_TEMPLATE
533
534#ifndef VTK_GDA_TEMPLATE_EXTERN
535#define VTK_GDA_TEMPLATE_EXTERN
536#ifdef _MSC_VER
537#pragma warning(push)
538// The following is needed when the following is declared
539// dllexport and is used from another class in vtkCommonCore
540#pragma warning(disable : 4910) // extern and dllexport incompatible
541#endif
542
543VTK_ABI_NAMESPACE_BEGIN
544// Forward declare necessary stuffs:
545template <typename ValueType>
547template <typename ValueType>
549template <typename ValueType>
551
552VTK_ABI_NAMESPACE_END
553
554namespace vtkDataArrayPrivate
555{
556VTK_ABI_NAMESPACE_BEGIN
557// These are instantiated in vtkGenericDataArrayValueRange${i}.cxx
561VTK_DECLARE_VALUERANGE_VALUETYPE(unsigned long long)
562
563// This is instantiated in vtkGenericDataArray.cxx
565
566VTK_ABI_NAMESPACE_END
567} // namespace vtkDataArrayPrivate
568
569#ifdef _MSC_VER
570#pragma warning(pop)
571#endif
572#endif // VTK_GDA_TEMPLATE_EXTERN
573
574#endif // VTK_GDA_VALUERANGE_INSTANTIATING
575
576// VTK-HeaderTest-Exclude: vtkGenericDataArray.h
Array-Of-Structs implementation of vtkGenericDataArray.
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.
ValueType * GetValueRange(int comp)
Get the range of array values for the given component in the native data type.
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,...
vtkIdType InsertNextValue(ValueType value)
Insert data at the end of the array.
ValueType * GetFiniteValueRange(int comp)
These methods are analogous to the GetValueRange methods, except that the only consider finite values...
vtkTypeBool Allocate(vtkIdType size, vtkIdType ext=1000) override
Allocate memory for this array.
void InsertValue(vtkIdType valueIdx, ValueType value)
Insert data at a specified position in the array.
void DataChanged() override
Tell the array explicitly that the data has changed.
~vtkGenericDataArray() override
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 GetValueRange(ValueType range[2], int comp)
Get the range of array values for the given component in the native data type.
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
Default implementation raises a runtime error.
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.
vtkIdType InsertNextTypedTuple(const ValueType *t)
Insert (memory allocation performed) the tuple onto the end of the array.
void GetValueRange(ValueType range[2], int comp, const unsigned char *ghosts, unsigned char ghostsToSkip=0xff)
Get the range of array values for the given component in the native data type.
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).
void Initialize() override
Release storage and reset array to initial state.
void SetVoidArray(void *, vtkIdType, int, int) override
Default implementation raises a runtime error.
void InsertTypedTuple(vtkIdType tupleIdx, const ValueType *t)
Insert (memory allocation performed) the tuple t at tupleIdx.
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 RemoveTuple(vtkIdType tupleIdx) override
Removes a tuple at the given index.
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 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.
void SetTuple(vtkIdType tupleIdx, const float *tuple) override
Set the data tuple at tupleIdx.
void SetVoidArray(void *, vtkIdType, int) override
Default implementation raises a runtime error.
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)
Default implementation raises a runtime error.
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...
virtual void FillTypedComponent(int compIdx, ValueType value)
Set component comp of all tuples to value.
void SetArrayFreeFunction(void(*callback)(void *)) override
Default implementation raises a runtime error.
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)
Insert (memory allocation performed) the value at the specified tuple and component location.
ValueType * GetPointer(vtkIdType valueIdx)
Default implementation raises a runtime error.
void Squeeze() override
Free any unnecessary memory.
static DerivedT * FastDownCast(vtkAbstractArray *source)
Perform a fast, safe cast from a vtkAbstractArray to a DerivedT.
vtkTypeBool Resize(vtkIdType numTuples) override
Resize the array to the requested number of tuples and preserve data.
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...
vtkArrayIterator * NewIterator() override
Subclasses must override this method and provide the right kind of templated vtkArrayIteratorTemplate...
vtkGenericDataArray< vtkmDataArray< T >, T, ArrayType > SelfType
list of point or cell ids
Definition vtkIdList.h:24
Struct-Of-Arrays implementation of vtkGenericDataArray.
Struct-Of-Arrays implementation of vtkGenericDataArray with a scaling factor.
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.
bool AllocateTuples(vtkIdType numTuples)
Allocate space for numTuples.
void SetValue(vtkIdType valueIdx, ValueType value)
Set the value at valueIdx to value.
bool ReallocateTuples(vtkIdType numTuples)
Allocate space for numTuples.
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_6_0(reason)
#define VTK_DECLARE_VALUERANGE_ARRAYTYPE(ArrayType, ValueType)
#define VTK_DECLARE_VALUERANGE_VALUETYPE(ValueType)
int vtkIdType
Definition vtkType.h:368
@ 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