Thanks to visit codestin.com
Credit goes to vtk.org

VTK  9.5.20251008
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, int ArrayType = vtkArrayTypes::DataArray>
182{
183 static_assert(
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;
292 void SetVoidArray(void*, vtkIdType, int) override;
293 void SetVoidArray(void*, vtkIdType, int, int) override;
294 void SetArrayFreeFunction(void (*callback)(void*)) override;
295 void* WriteVoidPointer(vtkIdType valueIdx, vtkIdType numValues) override;
298
305 void RemoveTuple(vtkIdType tupleIdx) override;
306
311
315 void InsertValue(vtkIdType valueIdx, ValueType value);
316
320 void InsertTypedTuple(vtkIdType tupleIdx, const ValueType* t);
321
326
331 void InsertTypedComponent(vtkIdType tupleIdx, int compIdx, ValueType val);
332
334
346 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
347 void GetValueRange(ValueType range[2], int comp);
350
356 void GetValueRange(ValueType range[2]) { this->GetValueRange(range, 0); }
357
364 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
365 void GetFiniteValueRange(ValueType range[2], int comp);
368 void GetFiniteValueRange(ValueType range[2]) { this->GetFiniteValueRange(range, 0); }
375 VTK_DEPRECATED_IN_9_6_0("Use GetSize() instead")
376 vtkIdType Capacity() { return this->Size; }
377
381 virtual void FillTypedComponent(int compIdx, ValueType value);
382
386 virtual void FillValue(ValueType value);
387
388#ifndef __VTK_WRAP__
390
398#endif
399 int GetArrayType() const override;
400 int GetDataType() const override;
401 int GetDataTypeSize() const override;
402 bool HasStandardMemoryLayout() const override;
403 vtkTypeBool Allocate(vtkIdType size, vtkIdType ext = 1000) override;
404 vtkTypeBool Resize(vtkIdType numTuples) override;
405 void SetNumberOfComponents(int num) override;
406 void SetNumberOfTuples(vtkIdType number) override;
407 void Initialize() override;
408 void Squeeze() override;
409 void SetTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray* source) override;
410 // MSVC doesn't like 'using' here (error C2487). Just forward instead:
411 // using Superclass::SetTuple;
412 void SetTuple(vtkIdType tupleIdx, const float* tuple) override
413 {
414 this->Superclass::SetTuple(tupleIdx, tuple);
415 }
416 void SetTuple(vtkIdType tupleIdx, const double* tuple) override
417 {
418 this->Superclass::SetTuple(tupleIdx, tuple);
419 }
420
422 vtkIdType dstStart, vtkIdList* srcIds, vtkAbstractArray* source) override;
423 void InsertTuples(vtkIdList* dstIds, vtkIdList* srcIds, vtkAbstractArray* source) override;
424 // MSVC doesn't like 'using' here (error C2487). Just forward instead:
425 // using Superclass::InsertTuples;
427 vtkIdType dstStart, vtkIdType n, vtkIdType srcStart, vtkAbstractArray* source) override
428 {
429 this->Superclass::InsertTuples(dstStart, n, srcStart, source);
430 }
431
432 void InsertTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray* source) override;
433 void InsertTuple(vtkIdType tupleIdx, const float* source) override;
434 void InsertTuple(vtkIdType tupleIdx, const double* source) override;
435 void InsertComponent(vtkIdType tupleIdx, int compIdx, double value) override;
437 vtkIdType InsertNextTuple(const float* tuple) override;
438 vtkIdType InsertNextTuple(const double* tuple) override;
439 void GetTuples(vtkIdList* tupleIds, vtkAbstractArray* output) override;
440 void GetTuples(vtkIdType p1, vtkIdType p2, vtkAbstractArray* output) override;
441 double* GetTuple(vtkIdType tupleIdx) override;
442 void GetTuple(vtkIdType tupleIdx, double* tuple) override;
444 double* weights) override;
445 void InterpolateTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx1, vtkAbstractArray* source1,
446 vtkIdType srcTupleIdx2, vtkAbstractArray* source2, double t) override;
447 void SetComponent(vtkIdType tupleIdx, int compIdx, double value) override;
448 double GetComponent(vtkIdType tupleIdx, int compIdx) override;
449 void SetVariantValue(vtkIdType valueIdx, vtkVariant value) override;
451 void InsertVariantValue(vtkIdType valueIdx, vtkVariant value) override;
454 void LookupValue(vtkVariant value, vtkIdList* valueIds) override;
455 virtual void LookupTypedValue(ValueType value, vtkIdList* valueIds);
456 void ClearLookup() override;
457 void DataChanged() override;
458 void FillComponent(int compIdx, double value) override;
460
461protected:
464
470 bool AllocateTuples(vtkIdType numTuples)
471 {
472 return static_cast<DerivedT*>(this)->AllocateTuples(numTuples);
473 }
474
481 {
482 return static_cast<DerivedT*>(this)->ReallocateTuples(numTuples);
483 }
484
485 // This method resizes the array if needed so that the given tuple index is
486 // valid/accessible.
488
497 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
498
507 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
508
516 ValueType* ranges, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
517
523 ValueType range[2], const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
524
532 ValueType* ranges, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
533
539 ValueType range[2], const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
540
541 std::vector<double> LegacyTuple;
542 std::vector<ValueType> LegacyValueRange;
543 std::vector<ValueType> LegacyValueRangeFull;
544
546
547private:
549 void operator=(const vtkGenericDataArray&) = delete;
550};
551VTK_ABI_NAMESPACE_END
552
553// Forward declare necessary stuffs:
554VTK_ABI_NAMESPACE_BEGIN
555template <typename ValueType>
557template <typename ValueType>
559
560#ifdef VTK_USE_SCALED_SOA_ARRAYS
561template <typename ValueType>
563#endif
564VTK_ABI_NAMESPACE_END
565
566#define VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(ArrayType, ValueType) \
567 template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange( \
568 ArrayType*, ValueType*, vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
569 template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(ArrayType*, ValueType*, \
570 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char); \
571 template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
572 vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
573 template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
574 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char);
575
576#ifdef VTK_USE_SCALED_SOA_ARRAYS
577
578#define VTK_INSTANTIATE_VALUERANGE_VALUETYPE(ValueType) \
579 VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(vtkAOSDataArrayTemplate<ValueType>, ValueType) \
580 VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(vtkSOADataArrayTemplate<ValueType>, ValueType) \
581 VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(vtkScaledSOADataArrayTemplate<ValueType>, ValueType)
582
583#else // VTK_USE_SCALED_SOA_ARRAYS
584
585#define VTK_INSTANTIATE_VALUERANGE_VALUETYPE(ValueType) \
586 VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(vtkAOSDataArrayTemplate<ValueType>, ValueType) \
587 VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(vtkSOADataArrayTemplate<ValueType>, ValueType)
588
589#endif
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#ifdef VTK_USE_SCALED_SOA_ARRAYS
617
618#define VTK_DECLARE_VALUERANGE_VALUETYPE(ValueType) \
619 VTK_DECLARE_VALUERANGE_ARRAYTYPE(vtkAOSDataArrayTemplate<ValueType>, ValueType) \
620 VTK_DECLARE_VALUERANGE_ARRAYTYPE(vtkSOADataArrayTemplate<ValueType>, ValueType) \
621 VTK_DECLARE_VALUERANGE_ARRAYTYPE(vtkScaledSOADataArrayTemplate<ValueType>, ValueType)
622
623#else // VTK_USE_SCALED_SOA_ARRAYS
624
625#define VTK_DECLARE_VALUERANGE_VALUETYPE(ValueType) \
626 VTK_DECLARE_VALUERANGE_ARRAYTYPE(vtkAOSDataArrayTemplate<ValueType>, ValueType) \
627 VTK_DECLARE_VALUERANGE_ARRAYTYPE(vtkSOADataArrayTemplate<ValueType>, ValueType)
628
629#endif
630
631#include "vtkGenericDataArray.txx"
632
633// Adds an implementation of NewInstanceInternal() that returns an AoS
634// (unmapped) VTK array, if possible. This allows the pipeline to copy and
635// propagate the array when the array data is not modifiable. Use this in
636// combination with vtkAbstractTypeMacro or vtkAbstractTemplateTypeMacro
637// (instead of vtkTypeMacro) to avoid adding the default NewInstance
638// implementation.
639#define vtkAOSArrayNewInstanceMacro(thisClass) \
640protected: \
641 vtkObjectBase* NewInstanceInternal() const override \
642 { \
643 if (vtkDataArray* da = vtkDataArray::CreateDataArray(thisClass::DataTypeTag::value)) \
644 { \
645 return da; \
646 } \
647 return thisClass::New(); \
648 } \
649 \
650public:
651
652#endif
653
654// This is used to tell libraries other than vtkCommonCore that instantiations of
655// the GetValueRange lookups can be found externally. This prevents each library
656// from instantiating these on their own.
657// Additionally it helps hide implementation details that pull in system
658// headers.
659// We only provide these specializations for the 64-bit integer types, since
660// other types can reuse the double-precision mechanism in
661// vtkDataArray::GetRange without losing precision.
662#ifdef VTK_USE_EXTERN_TEMPLATE
663
664#ifndef VTK_GDA_TEMPLATE_EXTERN
665#define VTK_GDA_TEMPLATE_EXTERN
666#ifdef _MSC_VER
667#pragma warning(push)
668// The following is needed when the following is declared
669// dllexport and is used from another class in vtkCommonCore
670#pragma warning(disable : 4910) // extern and dllexport incompatible
671#endif
672
673VTK_ABI_NAMESPACE_BEGIN
674// Forward declare necessary stuffs:
675template <typename ValueType>
677template <typename ValueType>
679
680#ifdef VTK_USE_SCALED_SOA_ARRAYS
681template <typename ValueType>
683#endif
684
685VTK_ABI_NAMESPACE_END
686
687namespace vtkDataArrayPrivate
688{
689VTK_ABI_NAMESPACE_BEGIN
690// These are instantiated in vtkGenericDataArrayValueRange${i}.cxx
694VTK_DECLARE_VALUERANGE_VALUETYPE(unsigned long long)
695
696// This is instantiated in vtkGenericDataArray.cxx
698
699VTK_ABI_NAMESPACE_END
700} // namespace vtkDataArrayPrivate
701
702#ifdef _MSC_VER
703#pragma warning(pop)
704#endif
705#endif // VTK_GDA_TEMPLATE_EXTERN
706
707#endif // VTK_GDA_VALUERANGE_INSTANTIATING
708
709// 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.
vtkIdType Capacity()
Return the capacity in typeof T units of the current array.
ValueType * GetValueRange(int comp)
Get the range of array values for the given component in the native data type.
void InterpolateTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx1, vtkAbstractArray *source1, vtkIdType srcTupleIdx2, vtkAbstractArray *source2, double t) override
Insert the tuple at dstTupleIdx in this array to the tuple interpolated from the two tuple indices,...
vtkIdType InsertNextValue(ValueType value)
Insert data at the end of the array.
ValueType * GetFiniteValueRange(int comp)
These methods are analogous to the GetValueRange methods, except that the only consider finite values...
vtkTypeBool Allocate(vtkIdType size, vtkIdType ext=1000) override
Allocate memory for this array.
void InsertValue(vtkIdType valueIdx, ValueType value)
Insert data at a specified position in the array.
void DataChanged() override
Tell the array explicitly that the data has changed.
~vtkGenericDataArray() override
virtual void LookupTypedValue(ValueType value, vtkIdList *valueIds)
void * GetVoidPointer(vtkIdType valueIdx) override
Default implementation raises a runtime error.
int GetDataTypeSize() const override
Return the size of the underlying data type.
void InsertComponent(vtkIdType tupleIdx, int compIdx, double value) override
Insert value at the location specified by tupleIdx and compIdx.
ValueType * GetValueRange()
Get the range of array values for the 0th component in the native data type.
void GetFiniteValueRange(ValueType range[2])
These methods are analogous to the GetValueRange methods, except that the only consider finite values...
void GetValueRange(ValueType range[2], int comp)
Get the range of array values for the given component in the native data type.
void SetTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray *source) override
See documentation from parent class.
bool HasStandardMemoryLayout() const override
Returns true if this array uses the standard memory layout defined in the VTK user guide,...
void InsertTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray *source) override
See documentation from parent class.
void ComputeValueRange(ValueType range[2], int comp, const unsigned char *ghosts, unsigned char ghostsToSkip=0xff)
Compute the range for a specific component.
void GetFiniteValueRange(ValueType range[2], int comp, const unsigned char *ghosts, unsigned char ghostsToSkip=0xff)
These methods are analogous to the GetValueRange methods, except that the only consider finite values...
void InsertTuple(vtkIdType tupleIdx, const float *source) override
Insert the data tuple at tupleIdx.
double GetComponent(vtkIdType tupleIdx, int compIdx) override
Return the data component at the location specified by tupleIdx and compIdx.
void LookupValue(vtkVariant value, vtkIdList *valueIds) override
Return the value indices where a specific value appears.
void * WriteVoidPointer(vtkIdType valueIdx, vtkIdType numValues) override
Default implementation raises a runtime error.
int GetArrayType() const override
Method for type-checking in FastDownCast implementations.
bool ComputeVectorValueRange(ValueType range[2], const unsigned char *ghosts, unsigned char ghostsToSkip=0xff)
Returns true if the range was computed.
void SetComponent(vtkIdType tupleIdx, int compIdx, double value) override
Set the data component at the location specified by tupleIdx and compIdx to value.
bool ComputeFiniteScalarValueRange(ValueType *ranges, const unsigned char *ghosts, unsigned char ghostsToSkip=0xff)
Computes the range for each component of an array, the length of ranges must be two times the number ...
vtkTemplateTypeMacro(SelfType, vtkDataArray)
bool EnsureAccessToTuple(vtkIdType tupleIdx)
void ComputeFiniteValueRange(ValueType range[2], int comp, const unsigned char *ghosts, unsigned char ghostsToSkip=0xff)
Compute the range for a specific component.
vtkIdType InsertNextTypedTuple(const ValueType *t)
Insert (memory allocation performed) the tuple onto the end of the array.
void GetValueRange(ValueType range[2], int comp, const unsigned char *ghosts, unsigned char ghostsToSkip=0xff)
Get the range of array values for the given component in the native data type.
vtkIdType LookupValue(vtkVariant value) override
Return the value indices where a specific value appears.
void GetTuples(vtkIdType p1, vtkIdType p2, vtkAbstractArray *output) override
Get the tuples for the range of tuple ids specified (i.e., p1->p2 inclusive).
void Initialize() override
Release storage and reset array to initial state.
void SetVoidArray(void *, vtkIdType, int, int) override
Default implementation raises a runtime error.
void InsertTypedTuple(vtkIdType tupleIdx, const ValueType *t)
Insert (memory allocation performed) the tuple t at tupleIdx.
vtkGenericDataArrayLookupHelper< SelfType > Lookup
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.
std::vector< ValueType > LegacyValueRange
void RemoveTuple(vtkIdType tupleIdx) override
Removes a tuple at the given index.
void InterpolateTuple(vtkIdType dstTupleIdx, vtkIdList *ptIndices, vtkAbstractArray *source, double *weights) override
Set the tuple at dstTupleIdx in this array to the interpolated tuple value, given the ptIndices in th...
void SetTuple(vtkIdType tupleIdx, const double *tuple) override
Set the data tuple at tupleIdx.
void SetVariantValue(vtkIdType valueIdx, vtkVariant value) override
Set a value in the array from a variant.
void SetNumberOfTuples(vtkIdType number) override
Set the number of tuples (a component group) in the array.
void SetNumberOfComponents(int num) override
Set/Get the dimension (n) of the components.
void SetTuple(vtkIdType tupleIdx, const float *tuple) override
Set the data tuple at tupleIdx.
void SetVoidArray(void *, vtkIdType, int) override
Default implementation raises a runtime error.
virtual vtkIdType LookupTypedValue(ValueType value)
bool ComputeScalarValueRange(ValueType *ranges, const unsigned char *ghosts, unsigned char ghostsToSkip=0xff)
Computes the range for each component of an array, the length of ranges must be two times the number ...
vtkIdType InsertNextTuple(const double *tuple) override
Insert the data tuple at the end of the array and return the tuple index at which the data was insert...
std::integral_constant< int, vtkTypeTraits< ValueTypeT >::VTK_TYPE_ID > DataTypeTag
void GetTuple(vtkIdType tupleIdx, double *tuple) override
Get the data tuple at tupleIdx by filling in a user-provided array, Make sure that your array is larg...
virtual void FillValue(ValueType value)
Set all the values in array to value.
vtkVariant GetVariantValue(vtkIdType valueIdx) override
Retrieve value from the array as a variant.
ValueType * WritePointer(vtkIdType valueIdx, vtkIdType numValues)
Default implementation raises a runtime error.
void InsertTuples(vtkIdType dstStart, vtkIdType n, vtkIdType srcStart, vtkAbstractArray *source) override
See documentation from parent class.
double * GetTuple(vtkIdType tupleIdx) override
Get the data tuple at tupleIdx.
void GetValueRange(ValueType range[2])
vtkIdType InsertNextTuple(const float *tuple) override
Insert the data tuple at the end of the array and return the tuple index at which the data was insert...
virtual void FillTypedComponent(int compIdx, ValueType value)
Set component comp of all tuples to value.
void SetArrayFreeFunction(void(*callback)(void *)) override
Default implementation raises a runtime error.
void InsertTuplesStartingAt(vtkIdType dstStart, vtkIdList *srcIds, vtkAbstractArray *source) override
See documentation from parent class.
std::vector< double > LegacyTuple
void FillComponent(int compIdx, double value) override
Fill a component of a data array with a specified value.
void ClearLookup() override
Delete the associated fast lookup data structure on this array, if it exists.
void InsertTuples(vtkIdList *dstIds, vtkIdList *srcIds, vtkAbstractArray *source) override
See documentation from parent class.
vtkIdType InsertNextTuple(vtkIdType srcTupleIdx, vtkAbstractArray *source) override
See documentation from parent class.
void InsertTypedComponent(vtkIdType tupleIdx, int compIdx, ValueType val)
Insert (memory allocation performed) the value at the specified tuple and component location.
ValueType * GetPointer(vtkIdType valueIdx)
Default implementation raises a runtime error.
std::integral_constant< int, ArrayType > ArrayTypeTag
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.
void InsertTuple(vtkIdType tupleIdx, const double *source) override
Insert the data tuple at tupleIdx.
void GetTuples(vtkIdList *tupleIds, vtkAbstractArray *output) override
Given a list of tuple ids, return an array of tuples.
ValueType * GetFiniteValueRange()
These methods are analogous to the GetValueRange methods, except that the only consider finite values...
vtkArrayIterator * NewIterator() override
Subclasses must override this method and provide the right kind of templated vtkArrayIteratorTemplate...
std::vector< ValueType > LegacyValueRangeFull
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.
bool AllocateTuples(vtkIdType numTuples)
Allocate space for numTuples.
void SetValue(vtkIdType valueIdx, ValueType value)
Set the value at valueIdx to value.
bool ReallocateTuples(vtkIdType numTuples)
Allocate space for numTuples.
ValueType GetValue(vtkIdType valueIdx) const
Get the value at valueIdx.
VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(A *, R *, T, const unsigned char *ghosts, unsigned char ghostsToSkip)
VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(A *, R[2], AllValues, const unsigned char *ghosts, unsigned char ghostsToSkip)
Template defining traits of native types used by VTK.
int vtkTypeBool
Definition vtkABI.h:64
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
#define 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:367
@ NumArrayTypes
Definition vtkType.h:99
@ AbstractArray
Definition vtkType.h:72
#define VTK_SIZEHINT(...)
#define VTK_EXPECTS(x)
#define VTK_NEWINSTANCE