VTK  9.6.20260221
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
165
166#ifndef vtkGenericDataArray_h
167#define vtkGenericDataArray_h
168
169#include "vtkDataArray.h"
170
171#include "vtkCompiler.h" // for VTK_USE_EXTERN_TEMPLATE
172#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_6_0
174#include "vtkSmartPointer.h"
175#include "vtkTypeTraits.h"
176
177#include <cassert> // for assert
178#include <memory> // for std::unique_ptr
179
180VTK_ABI_NAMESPACE_BEGIN
181template <class DerivedT, class ValueTypeT, int ArrayType = vtkArrayTypes::VTK_DATA_ARRAY>
183{
184 static_assert(ArrayType >= vtkArrayTypes::VTK_ABSTRACT_ARRAY &&
186 "ArrayType must be a valid vtkAbstractArray::ArrayType enum value");
187
188public:
191 using ArrayTypeTag = std::integral_constant<int, ArrayType>;
192 using DataTypeTag = std::integral_constant<int, vtkTypeTraits<ValueTypeT>::VTK_TYPE_ID>;
193 using ValueType = ValueTypeT;
194
198 enum
199 {
200 VTK_DATA_TYPE VTK_DEPRECATED_IN_9_6_0("Use DataTypeTag::value") =
202 };
203
208
217 {
218 return static_cast<const DerivedT*>(this)->GetValue(valueIdx);
219 }
220
228 void SetValue(vtkIdType valueIdx, ValueType value)
229 VTK_EXPECTS(0 <= valueIdx && valueIdx < GetNumberOfValues())
230 {
231 static_cast<DerivedT*>(this)->SetValue(valueIdx, value);
232 }
233
242 void GetTypedTuple(vtkIdType tupleIdx, ValueType* tuple) const
243 VTK_EXPECTS(0 <= tupleIdx && tupleIdx < GetNumberOfTuples())
244 {
245 static_cast<const DerivedT*>(this)->GetTypedTuple(tupleIdx, tuple);
246 }
247
256 void SetTypedTuple(vtkIdType tupleIdx, const ValueType* tuple)
257 VTK_EXPECTS(0 <= tupleIdx && tupleIdx < GetNumberOfTuples())
258 {
259 static_cast<DerivedT*>(this)->SetTypedTuple(tupleIdx, tuple);
260 }
261
267 ValueType GetTypedComponent(vtkIdType tupleIdx, int compIdx) const
268 VTK_EXPECTS(0 <= tupleIdx && GetNumberOfComponents() * tupleIdx + compIdx < GetNumberOfValues())
269 VTK_EXPECTS(0 <= compIdx && compIdx < GetNumberOfComponents())
270 {
271 return static_cast<const DerivedT*>(this)->GetTypedComponent(tupleIdx, compIdx);
272 }
273
279 void SetTypedComponent(vtkIdType tupleIdx, int compIdx, ValueType value)
280 VTK_EXPECTS(0 <= tupleIdx && GetNumberOfComponents() * tupleIdx + compIdx < GetNumberOfValues())
281 VTK_EXPECTS(0 <= compIdx && compIdx < GetNumberOfComponents())
282 {
283 static_cast<DerivedT*>(this)->SetTypedComponent(tupleIdx, compIdx, value);
284 }
285
287
291 void* GetVoidPointer(vtkIdType valueIdx) override;
292 VTK_DEPRECATED_IN_9_7_0("Use vtkAOSDataArrayTemplate::GetPointer(valueIdx) instead")
294 void SetVoidArray(void*, vtkIdType, int) override;
295 void SetVoidArray(void*, vtkIdType, int, int) override;
296 void SetArrayFreeFunction(void (*callback)(void*)) override;
297 void* WriteVoidPointer(vtkIdType valueIdx, vtkIdType numValues) override;
298 VTK_DEPRECATED_IN_9_7_0("Use vtkAOSDataArrayTemplate::WritePointer(valueIdx, numValues) instead")
301
308 void RemoveTuple(vtkIdType tupleIdx) override;
309
314
318 void InsertValue(vtkIdType valueIdx, ValueType value);
319
323 void InsertTypedTuple(vtkIdType tupleIdx, const ValueType* t);
324
329
334 void InsertTypedComponent(vtkIdType tupleIdx, int compIdx, ValueType val);
335
337
349 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
350 void GetValueRange(ValueType range[2], int comp);
353
359 void GetValueRange(ValueType range[2]) { this->GetValueRange(range, 0); }
360
367 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
368 void GetFiniteValueRange(ValueType range[2], int comp);
371 void GetFiniteValueRange(ValueType range[2]) { this->GetFiniteValueRange(range, 0); }
373
378 VTK_DEPRECATED_IN_9_6_0("Use GetSize() instead")
379 vtkIdType Capacity() { return this->Size; }
380
384 virtual void FillTypedComponent(int compIdx, ValueType value);
385
389 virtual void FillValue(ValueType value);
390
391#ifndef __VTK_WRAP__
393
401#endif
402 int GetArrayType() const override;
403 int GetDataType() const override;
406 int GetDataTypeSize() const override;
407 bool HasStandardMemoryLayout() const override;
408 vtkTypeBool Allocate(vtkIdType size, vtkIdType ext = 1000) override;
409 vtkTypeBool Resize(vtkIdType numTuples) override;
410 void SetNumberOfComponents(int num) override;
411 void SetNumberOfTuples(vtkIdType number) override;
412 void Initialize() override;
413 void Squeeze() override;
414 void SetTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray* source) override;
415 // MSVC doesn't like 'using' here (error C2487). Just forward instead:
416 // using Superclass::SetTuple;
417 void SetTuple(vtkIdType tupleIdx, const float* tuple) override
418 {
419 this->Superclass::SetTuple(tupleIdx, tuple);
420 }
421 void SetTuple(vtkIdType tupleIdx, const double* tuple) override
422 {
423 this->Superclass::SetTuple(tupleIdx, tuple);
424 }
425
427 vtkIdType dstStart, vtkIdList* srcIds, vtkAbstractArray* source) override;
428 void InsertTuples(vtkIdList* dstIds, vtkIdList* srcIds, vtkAbstractArray* source) override;
429 // MSVC doesn't like 'using' here (error C2487). Just forward instead:
430 // using Superclass::InsertTuples;
432 vtkIdType dstStart, vtkIdType n, vtkIdType srcStart, vtkAbstractArray* source) override
433 {
434 this->Superclass::InsertTuples(dstStart, n, srcStart, source);
435 }
436
437 void InsertTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray* source) override;
438 void InsertTuple(vtkIdType tupleIdx, const float* source) override;
439 void InsertTuple(vtkIdType tupleIdx, const double* source) override;
440 void InsertComponent(vtkIdType tupleIdx, int compIdx, double value) override;
442 vtkIdType InsertNextTuple(const float* tuple) override;
443 vtkIdType InsertNextTuple(const double* tuple) override;
444 void GetTuples(vtkIdList* tupleIds, vtkAbstractArray* output) override;
445 void GetTuples(vtkIdType p1, vtkIdType p2, vtkAbstractArray* output) override;
446 double* GetTuple(vtkIdType tupleIdx) override;
447 void GetTuple(vtkIdType tupleIdx, double* tuple) override;
449 double* weights) override;
450 void InterpolateTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx1, vtkAbstractArray* source1,
451 vtkIdType srcTupleIdx2, vtkAbstractArray* source2, double t) override;
452 void SetComponent(vtkIdType tupleIdx, int compIdx, double value) override;
453 double GetComponent(vtkIdType tupleIdx, int compIdx) override;
454 void SetVariantValue(vtkIdType valueIdx, vtkVariant value) override;
456 void InsertVariantValue(vtkIdType valueIdx, vtkVariant value) override;
459 void LookupValue(vtkVariant value, vtkIdList* valueIds) override;
460 virtual void LookupTypedValue(ValueType value, vtkIdList* valueIds);
461 void ClearLookup() override;
462 void DataChanged() override;
463 void FillComponent(int compIdx, double value) override;
464 VTK_DEPRECATED_IN_9_7_0("Use vtk::DataArrayValueRange, or the array directly")
466
467protected:
470
476 bool AllocateTuples(vtkIdType numTuples)
477 {
478 return static_cast<DerivedT*>(this)->AllocateTuples(numTuples);
479 }
480
487 {
488 return static_cast<DerivedT*>(this)->ReallocateTuples(numTuples);
489 }
490
491 // This method resizes the array if needed so that the given tuple index is
492 // valid/accessible.
494
503 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
504
513 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
514
522 ValueType* ranges, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
523
529 ValueType range[2], const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
530
538 ValueType* ranges, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
539
545 ValueType range[2], const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
546
547 std::vector<double> LegacyTuple;
548 std::vector<ValueType> LegacyValueRange;
549 std::vector<ValueType> LegacyValueRangeFull;
550
552
553private:
555 void operator=(const vtkGenericDataArray&) = delete;
556
557 struct vtkInternals;
558 std::unique_ptr<vtkInternals> Internals;
559};
560VTK_ABI_NAMESPACE_END
561
562// Forward declare necessary stuffs:
563VTK_ABI_NAMESPACE_BEGIN
564template <typename ValueType>
566template <typename ValueType>
568template <typename ValueType>
570VTK_ABI_NAMESPACE_END
571
572#define VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(ArrayType, ValueType) \
573 template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange( \
574 ArrayType*, ValueType*, vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
575 template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(ArrayType*, ValueType*, \
576 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char); \
577 template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
578 vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
579 template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
580 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char);
581
582#define VTK_INSTANTIATE_VALUERANGE_VALUETYPE(ValueType) \
583 VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(vtkAOSDataArrayTemplate<ValueType>, ValueType) \
584 VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(vtkSOADataArrayTemplate<ValueType>, ValueType) \
585 VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(vtkScaledSOADataArrayTemplate<ValueType>, ValueType)
586
587namespace vtkDataArrayPrivate
588{
589VTK_ABI_NAMESPACE_BEGIN
590template <typename A, typename R, typename T>
591VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(
592 A*, R*, T, const unsigned char* ghosts, unsigned char ghostsToSkip);
593template <typename A, typename R>
594VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(
595 A*, R[2], AllValues, const unsigned char* ghosts, unsigned char ghostsToSkip);
596template <typename A, typename R>
597VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(
598 A*, R[2], FiniteValues, const unsigned char* ghosts, unsigned char ghostsToSkip);
599VTK_ABI_NAMESPACE_END
600} // namespace vtkDataArrayPrivate
601
602#define VTK_DECLARE_VALUERANGE_ARRAYTYPE(ArrayType, ValueType) \
603 extern template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange( \
604 ArrayType*, ValueType*, vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
605 extern template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(ArrayType*, ValueType*, \
606 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char); \
607 extern template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
608 vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
609 extern template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
610 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char);
611
612#define VTK_DECLARE_VALUERANGE_VALUETYPE(ValueType) \
613 VTK_DECLARE_VALUERANGE_ARRAYTYPE(vtkAOSDataArrayTemplate<ValueType>, ValueType) \
614 VTK_DECLARE_VALUERANGE_ARRAYTYPE(vtkSOADataArrayTemplate<ValueType>, ValueType) \
615 VTK_DECLARE_VALUERANGE_ARRAYTYPE(vtkScaledSOADataArrayTemplate<ValueType>, ValueType)
616
617#include "vtkGenericDataArray.txx"
618
619// Adds an implementation of NewInstanceInternal() that returns an AoS
620// (unmapped) VTK array, if possible. This allows the pipeline to copy and
621// propagate the array when the array data is not modifiable. Use this in
622// combination with vtkAbstractTypeMacro or vtkAbstractTemplateTypeMacro
623// (instead of vtkTypeMacro) to avoid adding the default NewInstance
624// implementation.
625#define vtkAOSArrayNewInstanceMacro(thisClass) \
626protected: \
627 vtkObjectBase* NewInstanceInternal() const override \
628 { \
629 if (vtkDataArray* da = vtkDataArray::CreateDataArray(thisClass::DataTypeTag::value)) \
630 { \
631 return da; \
632 } \
633 return thisClass::New(); \
634 } \
635 \
636public:
637
638#endif
639
640// This is used to tell libraries other than vtkCommonCore that instantiations of
641// the GetValueRange lookups can be found externally. This prevents each library
642// from instantiating these on their own.
643// Additionally it helps hide implementation details that pull in system
644// headers.
645// We only provide these specializations for the 64-bit integer types, since
646// other types can reuse the double-precision mechanism in
647// vtkDataArray::GetRange without losing precision.
648#ifdef VTK_USE_EXTERN_TEMPLATE
649
650#ifndef VTK_GDA_TEMPLATE_EXTERN
651#define VTK_GDA_TEMPLATE_EXTERN
652#ifdef _MSC_VER
653#pragma warning(push)
654// The following is needed when the following is declared
655// dllexport and is used from another class in vtkCommonCore
656#pragma warning(disable : 4910) // extern and dllexport incompatible
657#endif
658
659VTK_ABI_NAMESPACE_BEGIN
660// Forward declare necessary stuffs:
661template <typename ValueType>
663template <typename ValueType>
665template <typename ValueType>
667
668VTK_ABI_NAMESPACE_END
669
670namespace vtkDataArrayPrivate
671{
672VTK_ABI_NAMESPACE_BEGIN
673// These are instantiated in vtkGenericDataArrayValueRange${i}.cxx
677VTK_DECLARE_VALUERANGE_VALUETYPE(unsigned long long)
678
679// This is instantiated in vtkGenericDataArray.cxx
681
682VTK_ABI_NAMESPACE_END
683} // namespace vtkDataArrayPrivate
684
685#ifdef _MSC_VER
686#pragma warning(pop)
687#endif
688#endif // VTK_GDA_TEMPLATE_EXTERN
689
690#endif // VTK_GDA_VALUERANGE_INSTANTIATING
691
692// 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.
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...
vtkTypeBool Allocate(vtkIdType size, vtkIdType ext=1000) override
Allocate memory for this array.
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).
void Initialize() override
Release storage and reset array to initial state.
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 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.
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...
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.
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...
vtkGenericDataArray< vtkmDataArray< T >, T, ArrayType > SelfType
list of point or cell ids
Definition vtkIdList.h:133
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:162
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.
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_7_0(reason)
#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: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