VTK  9.2.6
vtkGenericDataArray.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkGenericDataArray.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
66#ifndef vtkGenericDataArray_h
67#define vtkGenericDataArray_h
68
69#include "vtkDataArray.h"
70
71#include "vtkCompiler.h" // for VTK_USE_EXTERN_TEMPLATE
73#include "vtkSmartPointer.h"
74#include "vtkTypeTraits.h"
75
76#include <cassert>
77
78template <class DerivedT, class ValueTypeT>
80{
82
83public:
84 typedef ValueTypeT ValueType;
86
90 enum
91 {
93 };
94
99
107 inline ValueType GetValue(vtkIdType valueIdx) const
108 {
109 return static_cast<const DerivedT*>(this)->GetValue(valueIdx);
110 }
111
119 void SetValue(vtkIdType valueIdx, ValueType value)
120 VTK_EXPECTS(0 <= valueIdx && valueIdx < GetNumberOfValues())
121 {
122 static_cast<DerivedT*>(this)->SetValue(valueIdx, value);
123 }
124
133 void GetTypedTuple(vtkIdType tupleIdx, ValueType* tuple) const
134 VTK_EXPECTS(0 <= tupleIdx && tupleIdx < GetNumberOfTuples())
135 {
136 static_cast<const DerivedT*>(this)->GetTypedTuple(tupleIdx, tuple);
137 }
138
147 void SetTypedTuple(vtkIdType tupleIdx, const ValueType* tuple)
148 VTK_EXPECTS(0 <= tupleIdx && tupleIdx < GetNumberOfTuples())
149 {
150 static_cast<DerivedT*>(this)->SetTypedTuple(tupleIdx, tuple);
151 }
152
158 ValueType GetTypedComponent(vtkIdType tupleIdx, int compIdx) const VTK_EXPECTS(0 <= tupleIdx &&
159 tupleIdx < GetNumberOfTuples()) VTK_EXPECTS(0 <= compIdx && compIdx < GetNumberOfComponents())
160 {
161 return static_cast<const DerivedT*>(this)->GetTypedComponent(tupleIdx, compIdx);
162 }
163
169 void SetTypedComponent(vtkIdType tupleIdx, int compIdx, ValueType value)
170 VTK_EXPECTS(0 <= tupleIdx && tupleIdx < GetNumberOfTuples())
171 VTK_EXPECTS(0 <= compIdx && compIdx < GetNumberOfComponents())
172 {
173 static_cast<DerivedT*>(this)->SetTypedComponent(tupleIdx, compIdx, value);
174 }
175
177
181 void* GetVoidPointer(vtkIdType valueIdx) override;
183 void SetVoidArray(void*, vtkIdType, int) override;
184 void SetVoidArray(void*, vtkIdType, int, int) override;
185 void SetArrayFreeFunction(void (*callback)(void*)) override;
186 void* WriteVoidPointer(vtkIdType valueIdx, vtkIdType numValues) override;
189
196 void RemoveTuple(vtkIdType tupleIdx) override;
197
202
206 void InsertValue(vtkIdType valueIdx, ValueType value);
207
211 void InsertTypedTuple(vtkIdType tupleIdx, const ValueType* t);
212
217
222 void InsertTypedComponent(vtkIdType tupleIdx, int compIdx, ValueType val);
223
225
237 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
238 void GetValueRange(ValueType range[2], int comp);
241
247 void GetValueRange(ValueType range[2]) { this->GetValueRange(range, 0); }
248
255 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
256 void GetFiniteValueRange(ValueType range[2], int comp);
259 void GetFiniteValueRange(ValueType range[2]) { this->GetFiniteValueRange(range, 0); }
266 vtkIdType Capacity() { return this->Size; }
267
271 virtual void FillTypedComponent(int compIdx, ValueType value);
272
276 virtual void FillValue(ValueType value);
277
278 int GetDataType() const override;
279 int GetDataTypeSize() const override;
280 bool HasStandardMemoryLayout() const override;
281 vtkTypeBool Allocate(vtkIdType size, vtkIdType ext = 1000) override;
282 vtkTypeBool Resize(vtkIdType numTuples) override;
283 void SetNumberOfComponents(int num) override;
284 void SetNumberOfTuples(vtkIdType number) override;
285 void Initialize() override;
286 void Squeeze() override;
287 void SetTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray* source) override;
288 // MSVC doesn't like 'using' here (error C2487). Just forward instead:
289 // using Superclass::SetTuple;
290 void SetTuple(vtkIdType tupleIdx, const float* tuple) override
291 {
292 this->Superclass::SetTuple(tupleIdx, tuple);
293 }
294 void SetTuple(vtkIdType tupleIdx, const double* tuple) override
295 {
296 this->Superclass::SetTuple(tupleIdx, tuple);
297 }
298
300 vtkIdType dstStart, vtkIdList* srcIds, vtkAbstractArray* source) override;
301 void InsertTuples(vtkIdList* dstIds, vtkIdList* srcIds, vtkAbstractArray* source) override;
302 // MSVC doesn't like 'using' here (error C2487). Just forward instead:
303 // using Superclass::InsertTuples;
305 vtkIdType dstStart, vtkIdType n, vtkIdType srcStart, vtkAbstractArray* source) override
306 {
307 this->Superclass::InsertTuples(dstStart, n, srcStart, source);
308 }
309
310 void InsertTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray* source) override;
311 void InsertTuple(vtkIdType tupleIdx, const float* source) override;
312 void InsertTuple(vtkIdType tupleIdx, const double* source) override;
313 void InsertComponent(vtkIdType tupleIdx, int compIdx, double value) override;
315 vtkIdType InsertNextTuple(const float* tuple) override;
316 vtkIdType InsertNextTuple(const double* tuple) override;
317 void GetTuples(vtkIdList* tupleIds, vtkAbstractArray* output) override;
318 void GetTuples(vtkIdType p1, vtkIdType p2, vtkAbstractArray* output) override;
319 double* GetTuple(vtkIdType tupleIdx) override;
320 void GetTuple(vtkIdType tupleIdx, double* tuple) override;
322 double* weights) override;
323 void InterpolateTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx1, vtkAbstractArray* source1,
324 vtkIdType srcTupleIdx2, vtkAbstractArray* source2, double t) override;
325 void SetComponent(vtkIdType tupleIdx, int compIdx, double value) override;
326 double GetComponent(vtkIdType tupleIdx, int compIdx) override;
327 void SetVariantValue(vtkIdType valueIdx, vtkVariant value) override;
329 void InsertVariantValue(vtkIdType valueIdx, vtkVariant value) override;
332 void LookupValue(vtkVariant value, vtkIdList* valueIds) override;
333 virtual void LookupTypedValue(ValueType value, vtkIdList* valueIds);
334 void ClearLookup() override;
335 void DataChanged() override;
336 void FillComponent(int compIdx, double value) override;
338
339protected:
342
348 inline bool AllocateTuples(vtkIdType numTuples)
349 {
350 return static_cast<DerivedT*>(this)->AllocateTuples(numTuples);
351 }
352
358 inline bool ReallocateTuples(vtkIdType numTuples)
359 {
360 return static_cast<DerivedT*>(this)->ReallocateTuples(numTuples);
361 }
362
363 // This method resizes the array if needed so that the given tuple index is
364 // valid/accessible.
366
375 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
376
385 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
386
394 ValueType* ranges, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
395
401 ValueType range[2], const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
402
410 ValueType* ranges, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
411
417 ValueType range[2], const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
418
419 std::vector<double> LegacyTuple;
420 std::vector<ValueType> LegacyValueRange;
421 std::vector<ValueType> LegacyValueRangeFull;
422
424
425private:
427 void operator=(const vtkGenericDataArray&) = delete;
428};
429
430// these predeclarations are needed before the .txx include for MinGW
431namespace vtkDataArrayPrivate
432{
433template <typename A, typename R, typename T>
434bool DoComputeScalarRange(A*, R*, T, const unsigned char* ghosts, unsigned char ghostsToSkip);
435template <typename A, typename R>
437 A*, R[2], AllValues, const unsigned char* ghosts, unsigned char ghostsToSkip);
438template <typename A, typename R>
440 A*, R[2], FiniteValues, const unsigned char* ghosts, unsigned char ghostsToSkip);
441} // namespace vtkDataArrayPrivate
442
443#include "vtkGenericDataArray.txx"
444
445// Adds an implementation of NewInstanceInternal() that returns an AoS
446// (unmapped) VTK array, if possible. This allows the pipeline to copy and
447// propagate the array when the array data is not modifiable. Use this in
448// combination with vtkAbstractTypeMacro or vtkAbstractTemplateTypeMacro
449// (instead of vtkTypeMacro) to avoid adding the default NewInstance
450// implementation.
451#define vtkAOSArrayNewInstanceMacro(thisClass) \
452protected: \
453 vtkObjectBase* NewInstanceInternal() const override \
454 { \
455 if (vtkDataArray* da = vtkDataArray::CreateDataArray(thisClass::VTK_DATA_TYPE)) \
456 { \
457 return da; \
458 } \
459 return thisClass::New(); \
460 } \
461 \
462public:
463
464#endif
465
466// This portion must be OUTSIDE the include blockers. This is used to tell
467// libraries other than vtkCommonCore that instantiations of
468// the GetValueRange lookups can be found externally. This prevents each library
469// from instantiating these on their own.
470// Additionally it helps hide implementation details that pull in system
471// headers.
472// We only provide these specializations for the 64-bit integer types, since
473// other types can reuse the double-precision mechanism in
474// vtkDataArray::GetRange without losing precision.
475#ifdef VTK_GDA_VALUERANGE_INSTANTIATING
476
477// Forward declare necessary stuffs:
478template <typename ValueType>
480template <typename ValueType>
482
483#ifdef VTK_USE_SCALED_SOA_ARRAYS
484template <typename ValueType>
486#endif
487
488#define VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(ArrayType, ValueType) \
489 template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange( \
490 ArrayType*, ValueType*, vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
491 template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(ArrayType*, ValueType*, \
492 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char); \
493 template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
494 vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
495 template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
496 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char);
497
498#ifdef VTK_USE_SCALED_SOA_ARRAYS
499
500#define VTK_INSTANTIATE_VALUERANGE_VALUETYPE(ValueType) \
501 VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(vtkAOSDataArrayTemplate<ValueType>, ValueType) \
502 VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(vtkSOADataArrayTemplate<ValueType>, ValueType) \
503 VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(vtkScaledSOADataArrayTemplate<ValueType>, ValueType)
504
505#else // VTK_USE_SCALED_SOA_ARRAYS
506
507#define VTK_INSTANTIATE_VALUERANGE_VALUETYPE(ValueType) \
508 VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(vtkAOSDataArrayTemplate<ValueType>, ValueType) \
509 VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(vtkSOADataArrayTemplate<ValueType>, ValueType)
510
511#endif
512
513#elif defined(VTK_USE_EXTERN_TEMPLATE) // VTK_GDA_VALUERANGE_INSTANTIATING
514
515#ifndef VTK_GDA_TEMPLATE_EXTERN
516#define VTK_GDA_TEMPLATE_EXTERN
517#ifdef _MSC_VER
518#pragma warning(push)
519// The following is needed when the following is declared
520// dllexport and is used from another class in vtkCommonCore
521#pragma warning(disable : 4910) // extern and dllexport incompatible
522#endif
523
524// Forward declare necessary stuffs:
525template <typename ValueType>
527template <typename ValueType>
529
530#ifdef VTK_USE_SCALED_SOA_ARRAYS
531template <typename ValueType>
533#endif
534
535namespace vtkDataArrayPrivate
536{
537template <typename A, typename R, typename T>
538bool DoComputeScalarRange(A*, R*, T, const unsigned char* ghosts, unsigned char ghostsToSkip);
539template <typename A, typename R>
541 A*, R[2], AllValues, const unsigned char* ghosts, unsigned char ghostsToSkip);
542template <typename A, typename R>
544 A*, R[2], FiniteValues, const unsigned char* ghosts, unsigned char ghostsToSkip);
545} // namespace vtkDataArrayPrivate
546
547#define VTK_DECLARE_VALUERANGE_ARRAYTYPE(ArrayType, ValueType) \
548 extern template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange( \
549 ArrayType*, ValueType*, vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
550 extern template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(ArrayType*, ValueType*, \
551 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char); \
552 extern template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
553 vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
554 extern template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
555 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char);
556
557#ifdef VTK_USE_SCALED_SOA_ARRAYS
558
559#define VTK_DECLARE_VALUERANGE_VALUETYPE(ValueType) \
560 VTK_DECLARE_VALUERANGE_ARRAYTYPE(vtkAOSDataArrayTemplate<ValueType>, ValueType) \
561 VTK_DECLARE_VALUERANGE_ARRAYTYPE(vtkSOADataArrayTemplate<ValueType>, ValueType) \
562 VTK_DECLARE_VALUERANGE_ARRAYTYPE(vtkScaledSOADataArrayTemplate<ValueType>, ValueType)
563
564#else // VTK_USE_SCALED_SOA_ARRAYS
565
566#define VTK_DECLARE_VALUERANGE_VALUETYPE(ValueType) \
567 VTK_DECLARE_VALUERANGE_ARRAYTYPE(vtkAOSDataArrayTemplate<ValueType>, ValueType) \
568 VTK_DECLARE_VALUERANGE_ARRAYTYPE(vtkSOADataArrayTemplate<ValueType>, ValueType)
569
570#endif
571
572namespace vtkDataArrayPrivate
573{
574// These are instantiated in vtkGenericDataArrayValueRange${i}.cxx
578VTK_DECLARE_VALUERANGE_VALUETYPE(unsigned long long)
579
580// This is instantiated in vtkGenericDataArray.cxx
582
583// These are instantiated in vtkFloatArray.cxx, vtkDoubleArray.cxx, etc
597
598// These are instantiated in vtkSOADataArrayTemplateInstantiate${i}.cxx
612
613// These are instantiated in vtkScaledSOADataArrayTemplateInstantiate${i}.cxx
614#ifdef VTK_USE_SCALED_SOA_ARRAYS
628#endif // VTK_USE_SCALED_SOA_ARRAYS
629
630} // namespace vtkDataArrayPrivate
631
632#undef VTK_DECLARE_VALUERANGE_ARRAYTYPE
633#undef VTK_DECLARE_VALUERANGE_VALUETYPE
634
635#ifdef _MSC_VER
636#pragma warning(pop)
637#endif
638#endif // VTK_SOA_DATA_ARRAY_TEMPLATE_EXTERN
639
640#endif // VTK_GDA_VALUERANGE_INSTANTIATING
641
642// 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:31
Struct-Of-Arrays implementation of vtkGenericDataArray.
Struct-Of-Arrays implementation of vtkGenericDataArray with a scaling factor.
A atomic type representing the union of many types.
Definition vtkVariant.h:64
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.
bool DoComputeScalarRange(A *, R *, T, const unsigned char *ghosts, unsigned char ghostsToSkip)
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:69
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
#define VTK_DECLARE_VALUERANGE_ARRAYTYPE(ArrayType, ValueType)
#define VTK_DECLARE_VALUERANGE_VALUETYPE(ValueType)
int vtkIdType
Definition vtkType.h:332
#define VTK_SIZEHINT(...)
#define VTK_EXPECTS(x)
#define VTK_NEWINSTANCE