VTK  9.6.20260404
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_6_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
197 enum
198 {
199 VTK_DATA_TYPE VTK_DEPRECATED_IN_9_6_0("Use DataTypeTag::value") =
201 };
202
207
216 {
217 return static_cast<const DerivedT*>(this)->GetValue(valueIdx);
218 }
219
227 void SetValue(vtkIdType valueIdx, ValueType value)
228 VTK_EXPECTS(0 <= valueIdx && valueIdx < GetNumberOfValues())
229 {
230 static_cast<DerivedT*>(this)->SetValue(valueIdx, value);
231 }
232
241 void GetTypedTuple(vtkIdType tupleIdx, ValueType* tuple) const
242 VTK_EXPECTS(0 <= tupleIdx && tupleIdx < GetNumberOfTuples())
243 {
244 static_cast<const DerivedT*>(this)->GetTypedTuple(tupleIdx, tuple);
245 }
246
255 void SetTypedTuple(vtkIdType tupleIdx, const ValueType* tuple)
256 VTK_EXPECTS(0 <= tupleIdx && tupleIdx < GetNumberOfTuples())
257 {
258 static_cast<DerivedT*>(this)->SetTypedTuple(tupleIdx, tuple);
259 }
260
266 ValueType GetTypedComponent(vtkIdType tupleIdx, int compIdx) const
267 VTK_EXPECTS(0 <= tupleIdx && GetNumberOfComponents() * tupleIdx + compIdx < GetNumberOfValues())
268 VTK_EXPECTS(0 <= compIdx && compIdx < GetNumberOfComponents())
269 {
270 return static_cast<const DerivedT*>(this)->GetTypedComponent(tupleIdx, compIdx);
271 }
272
278 void SetTypedComponent(vtkIdType tupleIdx, int compIdx, ValueType value)
279 VTK_EXPECTS(0 <= tupleIdx && GetNumberOfComponents() * tupleIdx + compIdx < GetNumberOfValues())
280 VTK_EXPECTS(0 <= compIdx && compIdx < GetNumberOfComponents())
281 {
282 static_cast<DerivedT*>(this)->SetTypedComponent(tupleIdx, compIdx, value);
283 }
284
286
290 void* GetVoidPointer(vtkIdType valueIdx) override;
291 VTK_DEPRECATED_IN_9_7_0("Use vtkAOSDataArrayTemplate::GetPointer(valueIdx) instead")
293 void SetVoidArray(void*, vtkIdType, int) override;
294 void SetVoidArray(void*, vtkIdType, int, int) override;
295 void SetArrayFreeFunction(void (*callback)(void*)) override;
296 VTK_DEPRECATED_IN_9_7_0("Use vtkAOSDataArrayTemplate::WritePointer(valueIdx, numValues) or "
297 "vtkAbstractArray::SetNumberOf[Values/Tuples]() instead")
298 void* WriteVoidPointer(vtkIdType valueIdx, vtkIdType numValues) override;
299 VTK_DEPRECATED_IN_9_7_0("Use vtkAOSDataArrayTemplate::WritePointer(valueIdx, numValues) or "
300 "vtkAbstractArray::SetNumberOf[Values/Tuples]() instead")
303
310 void RemoveTuple(vtkIdType tupleIdx) override;
311
316
320 void InsertValue(vtkIdType valueIdx, ValueType value);
321
325 void InsertTypedTuple(vtkIdType tupleIdx, const ValueType* t);
326
331
336 void InsertTypedComponent(vtkIdType tupleIdx, int compIdx, ValueType val);
337
339
351 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
352 void GetValueRange(ValueType range[2], int comp);
355
361 void GetValueRange(ValueType range[2]) { this->GetValueRange(range, 0); }
362
369 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
370 void GetFiniteValueRange(ValueType range[2], int comp);
373 void GetFiniteValueRange(ValueType range[2]) { this->GetFiniteValueRange(range, 0); }
375
379 virtual void FillTypedComponent(int compIdx, ValueType value);
380
384 virtual void FillValue(ValueType value);
385
386#ifndef __VTK_WRAP__
388
396#endif
397 int GetArrayType() const override;
398 int GetDataType() const override;
401 int GetDataTypeSize() const override;
402 bool HasStandardMemoryLayout() const override;
404 void SetNumberOfComponents(int num) override;
405 void Squeeze() override;
406 void SetTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray* source) override;
407 // MSVC doesn't like 'using' here (error C2487). Just forward instead:
408 // using Superclass::SetTuple;
409 void SetTuple(vtkIdType tupleIdx, const float* tuple) override
410 {
411 this->Superclass::SetTuple(tupleIdx, tuple);
412 }
413 void SetTuple(vtkIdType tupleIdx, const double* tuple) override
414 {
415 this->Superclass::SetTuple(tupleIdx, tuple);
416 }
417
419 vtkIdType dstStart, vtkIdList* srcIds, vtkAbstractArray* source) override;
420 void InsertTuples(vtkIdList* dstIds, vtkIdList* srcIds, vtkAbstractArray* source) override;
421 // MSVC doesn't like 'using' here (error C2487). Just forward instead:
422 // using Superclass::InsertTuples;
424 vtkIdType dstStart, vtkIdType n, vtkIdType srcStart, vtkAbstractArray* source) override
425 {
426 this->Superclass::InsertTuples(dstStart, n, srcStart, source);
427 }
428
429 void InsertTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray* source) override;
430 void InsertTuple(vtkIdType tupleIdx, const float* source) override;
431 void InsertTuple(vtkIdType tupleIdx, const double* source) override;
432 void InsertComponent(vtkIdType tupleIdx, int compIdx, double value) override;
434 vtkIdType InsertNextTuple(const float* tuple) override;
435 vtkIdType InsertNextTuple(const double* tuple) override;
436 void GetTuples(vtkIdList* tupleIds, vtkAbstractArray* output) override;
437 void GetTuples(vtkIdType p1, vtkIdType p2, vtkAbstractArray* output) override;
438 double* GetTuple(vtkIdType tupleIdx) override;
439 void GetTuple(vtkIdType tupleIdx, double* tuple) override;
441 double* weights) override;
442 void InterpolateTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx1, vtkAbstractArray* source1,
443 vtkIdType srcTupleIdx2, vtkAbstractArray* source2, double t) override;
444 void SetComponent(vtkIdType tupleIdx, int compIdx, double value) override;
445 double GetComponent(vtkIdType tupleIdx, int compIdx) override;
446 void SetVariantValue(vtkIdType valueIdx, vtkVariant value) override;
448 void InsertVariantValue(vtkIdType valueIdx, vtkVariant value) override;
451 void LookupValue(vtkVariant value, vtkIdList* valueIds) override;
452 virtual void LookupTypedValue(ValueType value, vtkIdList* valueIds);
453 void ClearLookup() override;
454 void DataChanged() override;
455 void FillComponent(int compIdx, double value) override;
456 VTK_DEPRECATED_IN_9_7_0("Use vtk::DataArrayValueRange, or the array directly")
458
459protected:
462
469 {
470 return static_cast<DerivedT*>(this)->ReallocateTuples(numTuples);
471 }
472
473 // This method resizes the array if needed so that the given tuple index is
474 // valid/accessible.
476
485 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
486
495 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
496
504 ValueType* ranges, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
505
511 ValueType range[2], const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
512
520 ValueType* ranges, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
521
527 ValueType range[2], const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
528
529 std::vector<double> LegacyTuple;
530 std::vector<ValueType> LegacyValueRange;
531 std::vector<ValueType> LegacyValueRangeFull;
532
534
535private:
537 void operator=(const vtkGenericDataArray&) = delete;
538
539 struct vtkInternals;
540 std::unique_ptr<vtkInternals> Internals;
541};
542VTK_ABI_NAMESPACE_END
543
544// These macros define the vtkGenericDataArray methods that aren't redefined
545// in vtkAOSDataArrayTemplate and vtkSOADataArrayTemplate. The wrappers do
546// not see vtkGenericDataArray as a superclass of AOS/SOA arrays, so these
547// macros are used to fill in the missing parts of the inherited interface.
548#define vtkCreateGenericWrappedArrayReadInterface(T) \
549 int GetDataType() const override; \
550 T GetDataTypeValueMin() const; \
551 T GetDataTypeValueMax() const; \
552 T* GetValueRange(int comp) VTK_SIZEHINT(2); \
553 T* GetValueRange() VTK_SIZEHINT(2); \
554 void GetValueRange(T range[2], int comp); \
555 void GetValueRange(T range[2], int comp);
556#define vtkCreateGenericWrappedArrayWriteInterface(T) \
557 void InsertTypedTuple(vtkIdType i, const T* tuple) VTK_EXPECTS(0 <= i); \
558 vtkIdType InsertNextTypedTuple(const T* tuple); \
559 void InsertValue(vtkIdType id, T f) VTK_EXPECTS(0 <= id); \
560 vtkIdType InsertNextValue(T f);
561#define vtkCreateGenericWrappedArrayInterface(T) \
562 vtkCreateGenericWrappedArrayReadInterface(T); \
563 vtkCreateGenericWrappedArrayWriteInterface(T);
564
565// This macro is used by the subclasses to create dummy
566// declarations for these functions such that the wrapper
567// can see them. The wrappers ignore vtkGenericDataArray.
568#define vtkCreateWrappedArrayReadInterface(T) \
569 vtkCreateGenericWrappedArrayReadInterface(T); \
570 void GetTypedTuple(vtkIdType i, T* tuple) VTK_EXPECTS(0 <= i && i < GetNumberOfTuples()); \
571 T GetTypedComponent(vtkIdType i, int c) const VTK_EXPECTS(0 <= c && c < GetNumberOfComponents()) \
572 VTK_EXPECTS(0 <= i && GetNumberOfComponents() * i + c < GetNumberOfValues()); \
573 T GetValue(vtkIdType id) const VTK_EXPECTS(0 <= id && id < GetNumberOfValues());
574#define vtkCreateWrappedArrayWriteInterface(T) \
575 vtkCreateGenericWrappedArrayWriteInterface(T); \
576 void SetTypedTuple(vtkIdType i, const T* tuple) VTK_EXPECTS(0 <= i && i < GetNumberOfTuples()); \
577 void SetTypedComponent(vtkIdType i, int c, ValueType value); \
578 void SetValue(vtkIdType id, T value) VTK_EXPECTS(0 <= id && id < GetNumberOfValues()); \
579 bool SetNumberOfValues(vtkIdType number) override;
580
581#define VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(ArrayType, ValueType) \
582 template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange( \
583 ArrayType*, ValueType*, vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
584 template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(ArrayType*, ValueType*, \
585 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char); \
586 template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
587 vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
588 template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
589 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char);
590
591namespace vtkDataArrayPrivate
592{
593VTK_ABI_NAMESPACE_BEGIN
594template <typename A, typename R, typename T>
595VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(
596 A*, R*, T, const unsigned char* ghosts, unsigned char ghostsToSkip);
597template <typename A, typename R>
598VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(
599 A*, R[2], AllValues, const unsigned char* ghosts, unsigned char ghostsToSkip);
600template <typename A, typename R>
601VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(
602 A*, R[2], FiniteValues, const unsigned char* ghosts, unsigned char ghostsToSkip);
603VTK_ABI_NAMESPACE_END
604} // namespace vtkDataArrayPrivate
605
606#define VTK_DECLARE_VALUERANGE_ARRAYTYPE(ArrayType, ValueType) \
607 extern template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange( \
608 ArrayType*, ValueType*, vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
609 extern template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(ArrayType*, ValueType*, \
610 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char); \
611 extern template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
612 vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
613 extern template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
614 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char);
615
616#include "vtkGenericDataArray.txx"
617
618// Adds an implementation of NewInstanceInternal() that returns an AoS
619// (unmapped) VTK array, if possible. This allows the pipeline to copy and
620// propagate the array when the array data is not modifiable. Use this in
621// combination with vtkAbstractTypeMacro or vtkAbstractTemplateTypeMacro
622// (instead of vtkTypeMacro) to avoid adding the default NewInstance
623// implementation.
624#define vtkAOSArrayNewInstanceMacro(thisClass) \
625protected: \
626 vtkObjectBase* NewInstanceInternal() const override \
627 { \
628 if (vtkDataArray* da = vtkDataArray::CreateDataArray(thisClass::DataTypeTag::value)) \
629 { \
630 return da; \
631 } \
632 return thisClass::New(); \
633 } \
634 \
635public:
636
637#endif
638
639// This is used to tell libraries other than vtkCommonCore that instantiations of
640// the GetValueRange lookups can be found externally. This prevents each library
641// from instantiating these on their own.
642// Additionally, it helps hide implementation details that pull in system
643// headers.
644#ifdef VTK_USE_EXTERN_TEMPLATE
645
646#ifndef VTK_GDA_TEMPLATE_EXTERN
647#define VTK_GDA_TEMPLATE_EXTERN
648#ifdef _MSC_VER
649#pragma warning(push)
650// The following is needed when the following is declared
651// dllexport and is used from another class in vtkCommonCore
652#pragma warning(disable : 4910) // extern and dllexport incompatible
653#endif
654
655namespace vtkDataArrayPrivate
656{
657VTK_ABI_NAMESPACE_BEGIN
658// This is instantiated in vtkGenericDataArray.cxx
660
661VTK_ABI_NAMESPACE_END
662} // namespace vtkDataArrayPrivate
663
664#ifdef _MSC_VER
665#pragma warning(pop)
666#endif
667#endif // VTK_GDA_TEMPLATE_EXTERN
668
669#endif // VTK_USE_EXTERN_TEMPLATE
670
671// 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)
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