VTK  9.7.20260718
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
164
165#ifndef vtkGenericDataArray_h
166#define vtkGenericDataArray_h
167
168#include "vtkDataArray.h"
169
170#include "vtkCompiler.h" // for VTK_USE_EXTERN_TEMPLATE
171#include "vtkDeprecation.h" // for VTK_DEPRECATED_IN_9_7_0
173#include "vtkSmartPointer.h"
174#include "vtkTypeTraits.h"
175
176#include <cassert> // for assert
177#include <memory> // for std::unique_ptr
178
179VTK_ABI_NAMESPACE_BEGIN
180template <class DerivedT, class ValueTypeT, int ArrayType = vtkArrayTypes::VTK_DATA_ARRAY>
182{
183 static_assert(ArrayType >= vtkArrayTypes::VTK_ABSTRACT_ARRAY &&
185 "ArrayType must be a valid vtkAbstractArray::ArrayType enum value");
186
187public:
190 using ArrayTypeTag = std::integral_constant<int, ArrayType>;
191 using DataTypeTag = std::integral_constant<int, vtkTypeTraits<ValueTypeT>::VTK_TYPE_ID>;
192 using ValueType = ValueTypeT;
193
198
207 {
208 return static_cast<const DerivedT*>(this)->GetValue(valueIdx);
209 }
210
218 void SetValue(vtkIdType valueIdx, ValueType value)
219 VTK_EXPECTS(0 <= valueIdx && valueIdx < GetNumberOfValues())
220 {
221 static_cast<DerivedT*>(this)->SetValue(valueIdx, value);
222 }
223
232 void GetTypedTuple(vtkIdType tupleIdx, ValueType* tuple) const
233 VTK_EXPECTS(0 <= tupleIdx && tupleIdx < GetNumberOfTuples())
234 {
235 static_cast<const DerivedT*>(this)->GetTypedTuple(tupleIdx, tuple);
236 }
237
246 void SetTypedTuple(vtkIdType tupleIdx, const ValueType* tuple)
247 VTK_EXPECTS(0 <= tupleIdx && tupleIdx < GetNumberOfTuples())
248 {
249 static_cast<DerivedT*>(this)->SetTypedTuple(tupleIdx, tuple);
250 }
251
257 ValueType GetTypedComponent(vtkIdType tupleIdx, int compIdx) const
258 VTK_EXPECTS(0 <= tupleIdx && GetNumberOfComponents() * tupleIdx + compIdx < GetNumberOfValues())
259 VTK_EXPECTS(0 <= compIdx && compIdx < GetNumberOfComponents())
260 {
261 return static_cast<const DerivedT*>(this)->GetTypedComponent(tupleIdx, compIdx);
262 }
263
269 void SetTypedComponent(vtkIdType tupleIdx, int compIdx, ValueType value)
270 VTK_EXPECTS(0 <= tupleIdx && GetNumberOfComponents() * tupleIdx + compIdx < GetNumberOfValues())
271 VTK_EXPECTS(0 <= compIdx && compIdx < GetNumberOfComponents())
272 {
273 static_cast<DerivedT*>(this)->SetTypedComponent(tupleIdx, compIdx, value);
274 }
275
277
281 void* GetVoidPointer(vtkIdType valueIdx) override;
282 VTK_DEPRECATED_IN_9_7_0("Use vtkAOSDataArrayTemplate::GetPointer(valueIdx) instead")
284 void SetVoidArray(void*, vtkIdType, int) override;
285 void SetVoidArray(void*, vtkIdType, int, int) override;
286 void SetArrayFreeFunction(void (*callback)(void*)) override;
287 VTK_DEPRECATED_IN_9_7_0("Use vtkAOSDataArrayTemplate::WritePointer(valueIdx, numValues) or "
288 "vtkAbstractArray::SetNumberOf[Values/Tuples]() instead")
289 void* WriteVoidPointer(vtkIdType valueIdx, vtkIdType numValues) override;
290 VTK_DEPRECATED_IN_9_7_0("Use vtkAOSDataArrayTemplate::WritePointer(valueIdx, numValues) or "
291 "vtkAbstractArray::SetNumberOf[Values/Tuples]() instead")
294
301 void RemoveTuple(vtkIdType tupleIdx) override;
302
307
311 void InsertValue(vtkIdType valueIdx, ValueType value);
312
316 void InsertTypedTuple(vtkIdType tupleIdx, const ValueType* t);
317
322
327 void InsertTypedComponent(vtkIdType tupleIdx, int compIdx, ValueType val);
328
330
342 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
343 void GetValueRange(ValueType range[2], int comp);
346
352 void GetValueRange(ValueType range[2]) { this->GetValueRange(range, 0); }
353
360 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
361 void GetFiniteValueRange(ValueType range[2], int comp);
364 void GetFiniteValueRange(ValueType range[2]) { this->GetFiniteValueRange(range, 0); }
366
370 virtual void FillTypedComponent(int compIdx, ValueType value);
371
375 virtual void FillValue(ValueType value);
376
377#ifndef __VTK_WRAP__
379
387#endif
388 int GetArrayType() const override;
389 int GetDataType() const override;
392 int GetDataTypeSize() const override;
393 bool HasStandardMemoryLayout() const override;
395 void SetNumberOfComponents(int num) override;
396 void Squeeze() override;
397 void SetTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray* source) override;
398 // MSVC doesn't like 'using' here (error C2487). Just forward instead:
399 // using Superclass::SetTuple;
400 void SetTuple(vtkIdType tupleIdx, const float* tuple) override
401 {
402 this->Superclass::SetTuple(tupleIdx, tuple);
403 }
404 void SetTuple(vtkIdType tupleIdx, const double* tuple) override
405 {
406 this->Superclass::SetTuple(tupleIdx, tuple);
407 }
408
410 vtkIdType dstStart, vtkIdList* srcIds, vtkAbstractArray* source) override;
411 void InsertTuples(vtkIdList* dstIds, vtkIdList* srcIds, vtkAbstractArray* source) override;
412 // MSVC doesn't like 'using' here (error C2487). Just forward instead:
413 // using Superclass::InsertTuples;
415 vtkIdType dstStart, vtkIdType n, vtkIdType srcStart, vtkAbstractArray* source) override
416 {
417 this->Superclass::InsertTuples(dstStart, n, srcStart, source);
418 }
419
420 void InsertTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray* source) override;
421 void InsertTuple(vtkIdType tupleIdx, const float* source) override;
422 void InsertTuple(vtkIdType tupleIdx, const double* source) override;
423 void InsertComponent(vtkIdType tupleIdx, int compIdx, double value) override;
425 vtkIdType InsertNextTuple(const float* tuple) override;
426 vtkIdType InsertNextTuple(const double* tuple) override;
427 void GetTuples(vtkIdList* tupleIds, vtkAbstractArray* output) override;
428 void GetTuples(vtkIdType p1, vtkIdType p2, vtkAbstractArray* output) override;
429 double* GetTuple(vtkIdType tupleIdx) override;
430 void GetTuple(vtkIdType tupleIdx, double* tuple) override;
432 double* weights) override;
433 void InterpolateTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx1, vtkAbstractArray* source1,
434 vtkIdType srcTupleIdx2, vtkAbstractArray* source2, double t) override;
435 void SetComponent(vtkIdType tupleIdx, int compIdx, double value) override;
436 double GetComponent(vtkIdType tupleIdx, int compIdx) override;
437 void SetVariantValue(vtkIdType valueIdx, vtkVariant value) override;
439 void InsertVariantValue(vtkIdType valueIdx, vtkVariant value) override;
442 void LookupValue(vtkVariant value, vtkIdList* valueIds) override;
443 virtual void LookupTypedValue(ValueType value, vtkIdList* valueIds);
444 void ClearLookup() override;
445 void DataChanged() override;
446 void FillComponent(int compIdx, double value) override;
447 VTK_DEPRECATED_IN_9_7_0("Use vtk::DataArrayValueRange, or the array directly")
449
450protected:
453
460 {
461 return static_cast<DerivedT*>(this)->ReallocateTuples(numTuples);
462 }
463
464 // This method resizes the array if needed so that the given tuple index is
465 // valid/accessible.
467
476 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
477
486 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
487
495 ValueType* ranges, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
496
502 ValueType range[2], const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
503
511 ValueType* ranges, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
512
518 ValueType range[2], const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
519
520 std::vector<double> LegacyTuple;
521 std::vector<ValueType> LegacyValueRange;
522 std::vector<ValueType> LegacyValueRangeFull;
523
525
526private:
528 void operator=(const vtkGenericDataArray&) = delete;
529
530 struct vtkInternals;
531 std::unique_ptr<vtkInternals> Internals;
532};
533VTK_ABI_NAMESPACE_END
534
535// These macros define the vtkGenericDataArray methods that aren't redefined
536// in vtkAOSDataArrayTemplate and vtkSOADataArrayTemplate. The wrappers do
537// not see vtkGenericDataArray as a superclass of AOS/SOA arrays, so these
538// macros are used to fill in the missing parts of the inherited interface.
539#define vtkCreateGenericWrappedArrayReadInterface(T) \
540 int GetDataType() const override; \
541 T GetDataTypeValueMin() const; \
542 T GetDataTypeValueMax() const; \
543 T* GetValueRange(int comp) VTK_SIZEHINT(2); \
544 T* GetValueRange() VTK_SIZEHINT(2); \
545 void GetValueRange(T range[2], int comp);
546#define vtkCreateGenericWrappedArrayWriteInterface(T) \
547 void InsertTypedTuple(vtkIdType i, const T* tuple) VTK_EXPECTS(0 <= i); \
548 vtkIdType InsertNextTypedTuple(const T* tuple); \
549 void InsertValue(vtkIdType id, T f) VTK_EXPECTS(0 <= id); \
550 vtkIdType InsertNextValue(T f);
551#define vtkCreateGenericWrappedArrayInterface(T) \
552 vtkCreateGenericWrappedArrayReadInterface(T); \
553 vtkCreateGenericWrappedArrayWriteInterface(T);
554
555// This macro is used by the subclasses to create dummy
556// declarations for these functions such that the wrapper
557// can see them. The wrappers ignore vtkGenericDataArray.
558#define vtkCreateWrappedArrayReadInterface(T) \
559 vtkCreateGenericWrappedArrayReadInterface(T); \
560 void GetTypedTuple(vtkIdType i, T* tuple) VTK_EXPECTS(0 <= i && i < GetNumberOfTuples()); \
561 T GetTypedComponent(vtkIdType i, int c) const VTK_EXPECTS(0 <= c && c < GetNumberOfComponents()) \
562 VTK_EXPECTS(0 <= i && GetNumberOfComponents() * i + c < GetNumberOfValues()); \
563 T GetValue(vtkIdType id) const VTK_EXPECTS(0 <= id && id < GetNumberOfValues());
564#define vtkCreateWrappedArrayWriteInterface(T) \
565 vtkCreateGenericWrappedArrayWriteInterface(T); \
566 void SetTypedTuple(vtkIdType i, const T* tuple) VTK_EXPECTS(0 <= i && i < GetNumberOfTuples()); \
567 void SetTypedComponent(vtkIdType i, int c, T value); \
568 void SetValue(vtkIdType id, T value) VTK_EXPECTS(0 <= id && id < GetNumberOfValues()); \
569 bool SetNumberOfValues(vtkIdType number) override;
570
571#define VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(ArrayType, ValueType) \
572 template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange( \
573 ArrayType*, ValueType*, vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
574 template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(ArrayType*, ValueType*, \
575 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char); \
576 template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
577 vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
578 template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
579 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char);
580
581namespace vtkDataArrayPrivate
582{
583VTK_ABI_NAMESPACE_BEGIN
584template <typename A, typename R, typename T>
585VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(
586 A*, R*, T, const unsigned char* ghosts, unsigned char ghostsToSkip);
587template <typename A, typename R>
588VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(
589 A*, R[2], AllValues, const unsigned char* ghosts, unsigned char ghostsToSkip);
590template <typename A, typename R>
591VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(
592 A*, R[2], FiniteValues, const unsigned char* ghosts, unsigned char ghostsToSkip);
593VTK_ABI_NAMESPACE_END
594} // namespace vtkDataArrayPrivate
595
596#define VTK_DECLARE_VALUERANGE_ARRAYTYPE(ArrayType, ValueType) \
597 extern template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange( \
598 ArrayType*, ValueType*, vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
599 extern template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(ArrayType*, ValueType*, \
600 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char); \
601 extern template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
602 vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
603 extern template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
604 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char);
605
606#include "vtkGenericDataArray.txx"
607
608// Adds an implementation of NewInstanceInternal() that returns an AoS
609// (unmapped) VTK array, if possible. This allows the pipeline to copy and
610// propagate the array when the array data is not modifiable. Use this in
611// combination with vtkAbstractTypeMacro or vtkAbstractTemplateTypeMacro
612// (instead of vtkTypeMacro) to avoid adding the default NewInstance
613// implementation.
614#define vtkAOSArrayNewInstanceMacro(thisClass) \
615protected: \
616 vtkObjectBase* NewInstanceInternal() const override \
617 { \
618 if (vtkDataArray* da = vtkDataArray::CreateDataArray(thisClass::DataTypeTag::value)) \
619 { \
620 return da; \
621 } \
622 return thisClass::New(); \
623 } \
624 \
625public:
626
627#endif
628
629// This is used to tell libraries other than vtkCommonCore that instantiations of
630// the GetValueRange lookups can be found externally. This prevents each library
631// from instantiating these on their own.
632// Additionally, it helps hide implementation details that pull in system
633// headers.
634#ifdef VTK_USE_EXTERN_TEMPLATE
635
636#ifndef VTK_GDA_TEMPLATE_EXTERN
637#define VTK_GDA_TEMPLATE_EXTERN
638#ifdef _MSC_VER
639#pragma warning(push)
640// The following is needed when the following is declared
641// dllexport and is used from another class in vtkCommonCore
642#pragma warning(disable : 4910) // extern and dllexport incompatible
643#endif
644
645namespace vtkDataArrayPrivate
646{
647VTK_ABI_NAMESPACE_BEGIN
648// This is instantiated in vtkGenericDataArray.cxx
650
651VTK_ABI_NAMESPACE_END
652} // namespace vtkDataArrayPrivate
653
654#ifdef _MSC_VER
655#pragma warning(pop)
656#endif
657#endif // VTK_GDA_TEMPLATE_EXTERN
658
659#endif // VTK_USE_EXTERN_TEMPLATE
660
661// 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:135
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.
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