VTK  9.5.20250916
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
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>
178
179VTK_ABI_NAMESPACE_BEGIN
180template <class DerivedT, class ValueTypeT>
182{
184
185public:
186 typedef ValueTypeT ValueType;
188
192 enum
193 {
195 };
196
201
210 {
211 return static_cast<const DerivedT*>(this)->GetValue(valueIdx);
212 }
213
221 void SetValue(vtkIdType valueIdx, ValueType value)
222 VTK_EXPECTS(0 <= valueIdx && valueIdx < GetNumberOfValues())
223 {
224 static_cast<DerivedT*>(this)->SetValue(valueIdx, value);
225 }
226
235 void GetTypedTuple(vtkIdType tupleIdx, ValueType* tuple) const
236 VTK_EXPECTS(0 <= tupleIdx && tupleIdx < GetNumberOfTuples())
237 {
238 static_cast<const DerivedT*>(this)->GetTypedTuple(tupleIdx, tuple);
239 }
240
249 void SetTypedTuple(vtkIdType tupleIdx, const ValueType* tuple)
250 VTK_EXPECTS(0 <= tupleIdx && tupleIdx < GetNumberOfTuples())
251 {
252 static_cast<DerivedT*>(this)->SetTypedTuple(tupleIdx, tuple);
253 }
254
260 ValueType GetTypedComponent(vtkIdType tupleIdx, int compIdx) const
261 VTK_EXPECTS(0 <= tupleIdx && GetNumberOfComponents() * tupleIdx + compIdx < GetNumberOfValues())
262 VTK_EXPECTS(0 <= compIdx && compIdx < GetNumberOfComponents())
263 {
264 return static_cast<const DerivedT*>(this)->GetTypedComponent(tupleIdx, compIdx);
265 }
266
272 void SetTypedComponent(vtkIdType tupleIdx, int compIdx, ValueType value)
273 VTK_EXPECTS(0 <= tupleIdx && GetNumberOfComponents() * tupleIdx + compIdx < GetNumberOfValues())
274 VTK_EXPECTS(0 <= compIdx && compIdx < GetNumberOfComponents())
275 {
276 static_cast<DerivedT*>(this)->SetTypedComponent(tupleIdx, compIdx, value);
277 }
278
280
284 void* GetVoidPointer(vtkIdType valueIdx) override;
286 void SetVoidArray(void*, vtkIdType, int) override;
287 void SetVoidArray(void*, vtkIdType, int, int) override;
288 void SetArrayFreeFunction(void (*callback)(void*)) override;
289 void* WriteVoidPointer(vtkIdType valueIdx, vtkIdType numValues) override;
292
299 void RemoveTuple(vtkIdType tupleIdx) override;
300
305
309 void InsertValue(vtkIdType valueIdx, ValueType value);
310
314 void InsertTypedTuple(vtkIdType tupleIdx, const ValueType* t);
315
320
325 void InsertTypedComponent(vtkIdType tupleIdx, int compIdx, ValueType val);
326
328
340 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
341 void GetValueRange(ValueType range[2], int comp);
344
350 void GetValueRange(ValueType range[2]) { this->GetValueRange(range, 0); }
351
358 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
359 void GetFiniteValueRange(ValueType range[2], int comp);
362 void GetFiniteValueRange(ValueType range[2]) { this->GetFiniteValueRange(range, 0); }
369 VTK_DEPRECATED_IN_9_6_0("Use GetSize() instead")
370 vtkIdType Capacity() { return this->Size; }
371
375 virtual void FillTypedComponent(int compIdx, ValueType value);
376
380 virtual void FillValue(ValueType value);
381
382 int GetDataType() const override;
383 int GetDataTypeSize() const override;
384 bool HasStandardMemoryLayout() const override;
385 vtkTypeBool Allocate(vtkIdType size, vtkIdType ext = 1000) override;
386 vtkTypeBool Resize(vtkIdType numTuples) override;
387 void SetNumberOfComponents(int num) override;
388 void SetNumberOfTuples(vtkIdType number) override;
389 void Initialize() override;
390 void Squeeze() override;
391 void SetTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray* source) override;
392 // MSVC doesn't like 'using' here (error C2487). Just forward instead:
393 // using Superclass::SetTuple;
394 void SetTuple(vtkIdType tupleIdx, const float* tuple) override
395 {
396 this->Superclass::SetTuple(tupleIdx, tuple);
397 }
398 void SetTuple(vtkIdType tupleIdx, const double* tuple) override
399 {
400 this->Superclass::SetTuple(tupleIdx, tuple);
401 }
402
404 vtkIdType dstStart, vtkIdList* srcIds, vtkAbstractArray* source) override;
405 void InsertTuples(vtkIdList* dstIds, vtkIdList* srcIds, vtkAbstractArray* source) override;
406 // MSVC doesn't like 'using' here (error C2487). Just forward instead:
407 // using Superclass::InsertTuples;
409 vtkIdType dstStart, vtkIdType n, vtkIdType srcStart, vtkAbstractArray* source) override
410 {
411 this->Superclass::InsertTuples(dstStart, n, srcStart, source);
412 }
413
414 void InsertTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray* source) override;
415 void InsertTuple(vtkIdType tupleIdx, const float* source) override;
416 void InsertTuple(vtkIdType tupleIdx, const double* source) override;
417 void InsertComponent(vtkIdType tupleIdx, int compIdx, double value) override;
419 vtkIdType InsertNextTuple(const float* tuple) override;
420 vtkIdType InsertNextTuple(const double* tuple) override;
421 void GetTuples(vtkIdList* tupleIds, vtkAbstractArray* output) override;
422 void GetTuples(vtkIdType p1, vtkIdType p2, vtkAbstractArray* output) override;
423 double* GetTuple(vtkIdType tupleIdx) override;
424 void GetTuple(vtkIdType tupleIdx, double* tuple) override;
426 double* weights) override;
427 void InterpolateTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx1, vtkAbstractArray* source1,
428 vtkIdType srcTupleIdx2, vtkAbstractArray* source2, double t) override;
429 void SetComponent(vtkIdType tupleIdx, int compIdx, double value) override;
430 double GetComponent(vtkIdType tupleIdx, int compIdx) override;
431 void SetVariantValue(vtkIdType valueIdx, vtkVariant value) override;
433 void InsertVariantValue(vtkIdType valueIdx, vtkVariant value) override;
436 void LookupValue(vtkVariant value, vtkIdList* valueIds) override;
437 virtual void LookupTypedValue(ValueType value, vtkIdList* valueIds);
438 void ClearLookup() override;
439 void DataChanged() override;
440 void FillComponent(int compIdx, double value) override;
442
443protected:
446
452 bool AllocateTuples(vtkIdType numTuples)
453 {
454 return static_cast<DerivedT*>(this)->AllocateTuples(numTuples);
455 }
456
463 {
464 return static_cast<DerivedT*>(this)->ReallocateTuples(numTuples);
465 }
466
467 // This method resizes the array if needed so that the given tuple index is
468 // valid/accessible.
470
479 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
480
489 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
490
498 ValueType* ranges, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
499
505 ValueType range[2], const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
506
514 ValueType* ranges, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
515
521 ValueType range[2], const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
522
523 std::vector<double> LegacyTuple;
524 std::vector<ValueType> LegacyValueRange;
525 std::vector<ValueType> LegacyValueRangeFull;
526
528
529private:
531 void operator=(const vtkGenericDataArray&) = delete;
532};
533VTK_ABI_NAMESPACE_END
534
535// Forward declare necessary stuffs:
536VTK_ABI_NAMESPACE_BEGIN
537template <typename ValueType>
539template <typename ValueType>
541
542#ifdef VTK_USE_SCALED_SOA_ARRAYS
543template <typename ValueType>
545#endif
546VTK_ABI_NAMESPACE_END
547
548#define VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(ArrayType, ValueType) \
549 template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange( \
550 ArrayType*, ValueType*, vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
551 template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(ArrayType*, ValueType*, \
552 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char); \
553 template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
554 vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
555 template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
556 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char);
557
558#ifdef VTK_USE_SCALED_SOA_ARRAYS
559
560#define VTK_INSTANTIATE_VALUERANGE_VALUETYPE(ValueType) \
561 VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(vtkAOSDataArrayTemplate<ValueType>, ValueType) \
562 VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(vtkSOADataArrayTemplate<ValueType>, ValueType) \
563 VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(vtkScaledSOADataArrayTemplate<ValueType>, ValueType)
564
565#else // VTK_USE_SCALED_SOA_ARRAYS
566
567#define VTK_INSTANTIATE_VALUERANGE_VALUETYPE(ValueType) \
568 VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(vtkAOSDataArrayTemplate<ValueType>, ValueType) \
569 VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(vtkSOADataArrayTemplate<ValueType>, ValueType)
570
571#endif
572
573namespace vtkDataArrayPrivate
574{
575VTK_ABI_NAMESPACE_BEGIN
576template <typename A, typename R, typename T>
577VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(
578 A*, R*, T, const unsigned char* ghosts, unsigned char ghostsToSkip);
579template <typename A, typename R>
580VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(
581 A*, R[2], AllValues, const unsigned char* ghosts, unsigned char ghostsToSkip);
582template <typename A, typename R>
583VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(
584 A*, R[2], FiniteValues, const unsigned char* ghosts, unsigned char ghostsToSkip);
585VTK_ABI_NAMESPACE_END
586} // namespace vtkDataArrayPrivate
587
588#define VTK_DECLARE_VALUERANGE_ARRAYTYPE(ArrayType, ValueType) \
589 extern template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange( \
590 ArrayType*, ValueType*, vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
591 extern template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(ArrayType*, ValueType*, \
592 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char); \
593 extern template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
594 vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
595 extern template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
596 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char);
597
598#ifdef VTK_USE_SCALED_SOA_ARRAYS
599
600#define VTK_DECLARE_VALUERANGE_VALUETYPE(ValueType) \
601 VTK_DECLARE_VALUERANGE_ARRAYTYPE(vtkAOSDataArrayTemplate<ValueType>, ValueType) \
602 VTK_DECLARE_VALUERANGE_ARRAYTYPE(vtkSOADataArrayTemplate<ValueType>, ValueType) \
603 VTK_DECLARE_VALUERANGE_ARRAYTYPE(vtkScaledSOADataArrayTemplate<ValueType>, ValueType)
604
605#else // VTK_USE_SCALED_SOA_ARRAYS
606
607#define VTK_DECLARE_VALUERANGE_VALUETYPE(ValueType) \
608 VTK_DECLARE_VALUERANGE_ARRAYTYPE(vtkAOSDataArrayTemplate<ValueType>, ValueType) \
609 VTK_DECLARE_VALUERANGE_ARRAYTYPE(vtkSOADataArrayTemplate<ValueType>, ValueType)
610
611#endif
612
613#include "vtkGenericDataArray.txx"
614
615// Adds an implementation of NewInstanceInternal() that returns an AoS
616// (unmapped) VTK array, if possible. This allows the pipeline to copy and
617// propagate the array when the array data is not modifiable. Use this in
618// combination with vtkAbstractTypeMacro or vtkAbstractTemplateTypeMacro
619// (instead of vtkTypeMacro) to avoid adding the default NewInstance
620// implementation.
621#define vtkAOSArrayNewInstanceMacro(thisClass) \
622protected: \
623 vtkObjectBase* NewInstanceInternal() const override \
624 { \
625 if (vtkDataArray* da = vtkDataArray::CreateDataArray(thisClass::VTK_DATA_TYPE)) \
626 { \
627 return da; \
628 } \
629 return thisClass::New(); \
630 } \
631 \
632public:
633
634#endif
635
636// This is used to tell libraries other than vtkCommonCore that instantiations of
637// the GetValueRange lookups can be found externally. This prevents each library
638// from instantiating these on their own.
639// Additionally it helps hide implementation details that pull in system
640// headers.
641// We only provide these specializations for the 64-bit integer types, since
642// other types can reuse the double-precision mechanism in
643// vtkDataArray::GetRange without losing precision.
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
655VTK_ABI_NAMESPACE_BEGIN
656// Forward declare necessary stuffs:
657template <typename ValueType>
659template <typename ValueType>
661
662#ifdef VTK_USE_SCALED_SOA_ARRAYS
663template <typename ValueType>
665#endif
666
667VTK_ABI_NAMESPACE_END
668
669namespace vtkDataArrayPrivate
670{
671VTK_ABI_NAMESPACE_BEGIN
672// These are instantiated in vtkGenericDataArrayValueRange${i}.cxx
676VTK_DECLARE_VALUERANGE_VALUETYPE(unsigned long long)
677
678// This is instantiated in vtkGenericDataArray.cxx
680
681VTK_ABI_NAMESPACE_END
682} // namespace vtkDataArrayPrivate
683
684#ifdef _MSC_VER
685#pragma warning(pop)
686#endif
687#endif // VTK_GDA_TEMPLATE_EXTERN
688
689#endif // VTK_GDA_VALUERANGE_INSTANTIATING
690
691// 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.
abstract superclass for arrays of numeric data
internal class used by vtkGenericDataArray to support LookupValue.
Base interface for all typed vtkDataArray subclasses.
vtkTypeBool Allocate(vtkIdType size, vtkIdType ext=1000) override
Allocate memory for this array.
virtual void FillValue(ValueType value)
Set all the values in array to value.
std::vector< ValueType > LegacyValueRange
void SetNumberOfComponents(int num) override
Set/Get the dimension (n) of the components.
ValueType * GetFiniteValueRange()
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.
void InsertComponent(vtkIdType tupleIdx, int compIdx, double value) override
Insert value at the location specified by tupleIdx and compIdx.
void ComputeValueRange(ValueType range[2], int comp, const unsigned char *ghosts, unsigned char ghostsToSkip=0xff)
Compute the range for a specific component.
vtkIdType LookupValue(vtkVariant value) override
Return the value indices where a specific value appears.
double GetComponent(vtkIdType tupleIdx, int compIdx) override
Return the data component at the location specified by tupleIdx and compIdx.
void InsertVariantValue(vtkIdType valueIdx, vtkVariant value) override
Insert a value into the array from a variant.
void SetTuple(vtkIdType tupleIdx, const double *tuple) override
Set the data tuple at tupleIdx.
std::vector< ValueType > LegacyValueRangeFull
void InsertTuple(vtkIdType tupleIdx, const float *source) override
Insert the data tuple at tupleIdx.
ValueType * GetPointer(vtkIdType valueIdx)
Default implementation raises a runtime error.
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 ...
void RemoveTuple(vtkIdType tupleIdx) override
Removes a tuple at the given index.
void InsertTypedTuple(vtkIdType tupleIdx, const ValueType *t)
Insert (memory allocation performed) the tuple t at tupleIdx.
void SetNumberOfTuples(vtkIdType number) override
Set the number of tuples (a component group) in the array.
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 ...
vtkTypeBool Resize(vtkIdType numTuples) override
Resize the array to the requested number of tuples and preserve data.
ValueType * WritePointer(vtkIdType valueIdx, vtkIdType numValues)
Default implementation raises a runtime error.
double * GetTuple(vtkIdType tupleIdx) override
Get the data tuple at tupleIdx.
void InsertTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray *source) override
See documentation from parent class.
void InsertTuplesStartingAt(vtkIdType dstStart, vtkIdList *srcIds, vtkAbstractArray *source) override
See documentation from parent class.
vtkTemplateTypeMacro(SelfType, vtkDataArray)
void * GetVoidPointer(vtkIdType valueIdx) override
Default implementation raises a runtime error.
void FillComponent(int compIdx, double value) override
Fill a component of a data array with a specified value.
void GetValueRange(ValueType range[2], int comp)
Get the range of array values for the given component in the native data type.
void GetValueRange(ValueType range[2])
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 SetVoidArray(void *, vtkIdType, int, int) override
Default implementation raises a runtime error.
vtkIdType Capacity()
Return the capacity in typeof T units of the current array.
void SetVariantValue(vtkIdType valueIdx, vtkVariant value) override
Set a value in the array from a variant.
vtkVariant GetVariantValue(vtkIdType valueIdx) override
Retrieve value from the array as a variant.
void InsertTypedComponent(vtkIdType tupleIdx, int compIdx, ValueType val)
Insert (memory allocation performed) the value at the specified tuple and component location.
void ClearLookup() override
Delete the associated fast lookup data structure on this array, if it exists.
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...
vtkIdType InsertNextTuple(vtkIdType srcTupleIdx, vtkAbstractArray *source) override
See documentation from parent class.
virtual void LookupTypedValue(ValueType value, vtkIdList *valueIds)
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...
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 SetVoidArray(void *, vtkIdType, int) override
Default implementation raises a runtime error.
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 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 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 vtkIdType LookupTypedValue(ValueType value)
virtual void FillTypedComponent(int compIdx, ValueType value)
Set component comp of all tuples to value.
bool HasStandardMemoryLayout() const override
Returns true if this array uses the standard memory layout defined in the VTK user guide,...
int GetDataTypeSize() const override
Return the size of the underlying data type.
void ComputeFiniteValueRange(ValueType range[2], int comp, const unsigned char *ghosts, unsigned char ghostsToSkip=0xff)
Compute the range for a specific component.
ValueType * GetFiniteValueRange(int comp)
These methods are analogous to the GetValueRange methods, except that the only consider finite values...
void SetArrayFreeFunction(void(*callback)(void *)) override
Default implementation raises a runtime error.
bool ComputeVectorValueRange(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...
bool ComputeFiniteVectorValueRange(ValueType range[2], const unsigned char *ghosts, unsigned char ghostsToSkip=0xff)
Returns true if the range was computed.
void SetTuple(vtkIdType tupleIdx, const float *tuple) override
Set the data tuple at tupleIdx.
~vtkGenericDataArray() override
vtkArrayIterator * NewIterator() override
Subclasses must override this method and provide the right kind of templated vtkArrayIteratorTemplate...
void LookupValue(vtkVariant value, vtkIdList *valueIds) override
Return the value indices where a specific value appears.
void InsertValue(vtkIdType valueIdx, ValueType value)
Insert data at a specified position in the array.
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,...
void InsertTuple(vtkIdType tupleIdx, const double *source) override
Insert the data tuple at tupleIdx.
void InsertTuples(vtkIdType dstStart, vtkIdType n, vtkIdType srcStart, vtkAbstractArray *source) override
See documentation from parent class.
void GetFiniteValueRange(ValueType range[2])
These methods are analogous to the GetValueRange methods, except that the only consider finite values...
void Squeeze() override
Free any unnecessary memory.
bool EnsureAccessToTuple(vtkIdType tupleIdx)
vtkGenericDataArrayLookupHelper< SelfType > Lookup
std::vector< double > LegacyTuple
ValueType * GetValueRange(int comp)
Get the range of array values for the given component in the native data type.
void InsertTuples(vtkIdList *dstIds, vtkIdList *srcIds, vtkAbstractArray *source) override
See documentation from parent class.
void * WriteVoidPointer(vtkIdType valueIdx, vtkIdType numValues) override
Default implementation raises a runtime error.
int GetDataType() const override
Return the underlying data type.
void GetTuples(vtkIdList *tupleIds, vtkAbstractArray *output) override
Given a list of tuple ids, return an array of tuples.
void SetComponent(vtkIdType tupleIdx, int compIdx, double value) override
Set the data component at the location specified by tupleIdx and compIdx to value.
vtkIdType InsertNextValue(ValueType value)
Insert data at the end of the array.
vtkIdType InsertNextTypedTuple(const ValueType *t)
Insert (memory allocation performed) the tuple onto the end of the array.
void SetTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray *source) override
See documentation from parent class.
ValueType * GetValueRange()
Get the range of array values for the 0th component in the native data type.
void Initialize() override
Release storage and reset array to initial state.
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 SetValue(vtkIdType valueIdx, ValueType value)
Set the value at valueIdx to value.
void SetTypedComponent(vtkIdType tupleIdx, int compIdx, ValueType value)
Set component compIdx of the tuple at tupleIdx to value.
ValueType GetValue(vtkIdType valueIdx) const
Get the value at valueIdx.
void SetTypedTuple(vtkIdType tupleIdx, const ValueType *tuple)
Set this array's tuple at tupleIdx to the values in tuple.
void GetTypedTuple(vtkIdType tupleIdx, ValueType *tuple) const
Copy the tuple at tupleIdx into tuple.
bool ReallocateTuples(vtkIdType numTuples)
Allocate space for numTuples.
ValueType GetTypedComponent(vtkIdType tupleIdx, int compIdx) const
Get component compIdx of the tuple at tupleIdx.
bool AllocateTuples(vtkIdType numTuples)
Allocate space for numTuples.
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 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:333
#define VTK_SIZEHINT(...)
#define VTK_EXPECTS(x)
#define VTK_NEWINSTANCE