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=========================================================================*/
78#ifndef vtkGenericDataArray_h
79#define vtkGenericDataArray_h
80
81#include "vtkDataArray.h"
82
83#include "vtkCompiler.h" // for VTK_USE_EXTERN_TEMPLATE
85#include "vtkSmartPointer.h"
86#include "vtkTypeTraits.h"
87
88#include <cassert>
89
90template <class DerivedT, class ValueTypeT>
92{
94
95public:
96 typedef ValueTypeT ValueType;
98
102 enum
103 {
105 };
106
111
119 inline ValueType GetValue(vtkIdType valueIdx) const
120 {
121 return static_cast<const DerivedT*>(this)->GetValue(valueIdx);
122 }
123
131 void SetValue(vtkIdType valueIdx, ValueType value)
132 VTK_EXPECTS(0 <= valueIdx && valueIdx < GetNumberOfValues())
133 {
134 static_cast<DerivedT*>(this)->SetValue(valueIdx, value);
135 }
136
145 void GetTypedTuple(vtkIdType tupleIdx, ValueType* tuple) const
146 VTK_EXPECTS(0 <= tupleIdx && tupleIdx < GetNumberOfTuples())
147 {
148 static_cast<const DerivedT*>(this)->GetTypedTuple(tupleIdx, tuple);
149 }
150
159 void SetTypedTuple(vtkIdType tupleIdx, const ValueType* tuple)
160 VTK_EXPECTS(0 <= tupleIdx && tupleIdx < GetNumberOfTuples())
161 {
162 static_cast<DerivedT*>(this)->SetTypedTuple(tupleIdx, tuple);
163 }
164
170 ValueType GetTypedComponent(vtkIdType tupleIdx, int compIdx) const VTK_EXPECTS(0 <= tupleIdx &&
171 tupleIdx < GetNumberOfTuples()) VTK_EXPECTS(0 <= compIdx && compIdx < GetNumberOfComponents())
172 {
173 return static_cast<const DerivedT*>(this)->GetTypedComponent(tupleIdx, compIdx);
174 }
175
181 void SetTypedComponent(vtkIdType tupleIdx, int compIdx, ValueType value)
182 VTK_EXPECTS(0 <= tupleIdx && tupleIdx < GetNumberOfTuples())
183 VTK_EXPECTS(0 <= compIdx && compIdx < GetNumberOfComponents())
184 {
185 static_cast<DerivedT*>(this)->SetTypedComponent(tupleIdx, compIdx, value);
186 }
187
189
193 void* GetVoidPointer(vtkIdType valueIdx) override;
195 void SetVoidArray(void*, vtkIdType, int) override;
196 void SetVoidArray(void*, vtkIdType, int, int) override;
197 void SetArrayFreeFunction(void (*callback)(void*)) override;
198 void* WriteVoidPointer(vtkIdType valueIdx, vtkIdType numValues) override;
201
208 void RemoveTuple(vtkIdType tupleIdx) override;
209
214
218 void InsertValue(vtkIdType valueIdx, ValueType value);
219
223 void InsertTypedTuple(vtkIdType tupleIdx, const ValueType* t);
224
229
234 void InsertTypedComponent(vtkIdType tupleIdx, int compIdx, ValueType val);
235
237
249 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
250 void GetValueRange(ValueType range[2], int comp);
253
259 void GetValueRange(ValueType range[2]) { this->GetValueRange(range, 0); }
260
267 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
268 void GetFiniteValueRange(ValueType range[2], int comp);
271 void GetFiniteValueRange(ValueType range[2]) { this->GetFiniteValueRange(range, 0); }
278 vtkIdType Capacity() { return this->Size; }
279
283 virtual void FillTypedComponent(int compIdx, ValueType value);
284
288 virtual void FillValue(ValueType value);
289
290 int GetDataType() const override;
291 int GetDataTypeSize() const override;
292 bool HasStandardMemoryLayout() const override;
293 vtkTypeBool Allocate(vtkIdType size, vtkIdType ext = 1000) override;
294 vtkTypeBool Resize(vtkIdType numTuples) override;
295 void SetNumberOfComponents(int num) override;
296 void SetNumberOfTuples(vtkIdType number) override;
297 void Initialize() override;
298 void Squeeze() override;
299 void SetTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray* source) override;
300 // MSVC doesn't like 'using' here (error C2487). Just forward instead:
301 // using Superclass::SetTuple;
302 void SetTuple(vtkIdType tupleIdx, const float* tuple) override
303 {
304 this->Superclass::SetTuple(tupleIdx, tuple);
305 }
306 void SetTuple(vtkIdType tupleIdx, const double* tuple) override
307 {
308 this->Superclass::SetTuple(tupleIdx, tuple);
309 }
310
312 vtkIdType dstStart, vtkIdList* srcIds, vtkAbstractArray* source) override;
313 void InsertTuples(vtkIdList* dstIds, vtkIdList* srcIds, vtkAbstractArray* source) override;
314 // MSVC doesn't like 'using' here (error C2487). Just forward instead:
315 // using Superclass::InsertTuples;
317 vtkIdType dstStart, vtkIdType n, vtkIdType srcStart, vtkAbstractArray* source) override
318 {
319 this->Superclass::InsertTuples(dstStart, n, srcStart, source);
320 }
321
322 void InsertTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray* source) override;
323 void InsertTuple(vtkIdType tupleIdx, const float* source) override;
324 void InsertTuple(vtkIdType tupleIdx, const double* source) override;
325 void InsertComponent(vtkIdType tupleIdx, int compIdx, double value) override;
327 vtkIdType InsertNextTuple(const float* tuple) override;
328 vtkIdType InsertNextTuple(const double* tuple) override;
329 void GetTuples(vtkIdList* tupleIds, vtkAbstractArray* output) override;
330 void GetTuples(vtkIdType p1, vtkIdType p2, vtkAbstractArray* output) override;
331 double* GetTuple(vtkIdType tupleIdx) override;
332 void GetTuple(vtkIdType tupleIdx, double* tuple) override;
334 double* weights) override;
335 void InterpolateTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx1, vtkAbstractArray* source1,
336 vtkIdType srcTupleIdx2, vtkAbstractArray* source2, double t) override;
337 void SetComponent(vtkIdType tupleIdx, int compIdx, double value) override;
338 double GetComponent(vtkIdType tupleIdx, int compIdx) override;
339 void SetVariantValue(vtkIdType valueIdx, vtkVariant value) override;
341 void InsertVariantValue(vtkIdType valueIdx, vtkVariant value) override;
344 void LookupValue(vtkVariant value, vtkIdList* valueIds) override;
345 virtual void LookupTypedValue(ValueType value, vtkIdList* valueIds);
346 void ClearLookup() override;
347 void DataChanged() override;
348 void FillComponent(int compIdx, double value) override;
350
351protected:
354
360 inline bool AllocateTuples(vtkIdType numTuples)
361 {
362 return static_cast<DerivedT*>(this)->AllocateTuples(numTuples);
363 }
364
370 inline bool ReallocateTuples(vtkIdType numTuples)
371 {
372 return static_cast<DerivedT*>(this)->ReallocateTuples(numTuples);
373 }
374
375 // This method resizes the array if needed so that the given tuple index is
376 // valid/accessible.
378
387 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
388
397 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
398
406 ValueType* ranges, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
407
413 ValueType range[2], const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
414
422 ValueType* ranges, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
423
429 ValueType range[2], const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
430
431 std::vector<double> LegacyTuple;
432 std::vector<ValueType> LegacyValueRange;
433 std::vector<ValueType> LegacyValueRangeFull;
434
436
437private:
439 void operator=(const vtkGenericDataArray&) = delete;
440};
441
442// these predeclarations are needed before the .txx include for MinGW
443namespace vtkDataArrayPrivate
444{
445template <typename A, typename R, typename T>
446bool DoComputeScalarRange(A*, R*, T, const unsigned char* ghosts, unsigned char ghostsToSkip);
447template <typename A, typename R>
449 A*, R[2], AllValues, const unsigned char* ghosts, unsigned char ghostsToSkip);
450template <typename A, typename R>
452 A*, R[2], FiniteValues, const unsigned char* ghosts, unsigned char ghostsToSkip);
453} // namespace vtkDataArrayPrivate
454
455#include "vtkGenericDataArray.txx"
456
457// Adds an implementation of NewInstanceInternal() that returns an AoS
458// (unmapped) VTK array, if possible. This allows the pipeline to copy and
459// propagate the array when the array data is not modifiable. Use this in
460// combination with vtkAbstractTypeMacro or vtkAbstractTemplateTypeMacro
461// (instead of vtkTypeMacro) to avoid adding the default NewInstance
462// implementation.
463#define vtkAOSArrayNewInstanceMacro(thisClass) \
464protected: \
465 vtkObjectBase* NewInstanceInternal() const override \
466 { \
467 if (vtkDataArray* da = vtkDataArray::CreateDataArray(thisClass::VTK_DATA_TYPE)) \
468 { \
469 return da; \
470 } \
471 return thisClass::New(); \
472 } \
473 \
474public:
475
476#endif
477
478// This portion must be OUTSIDE the include blockers. This is used to tell
479// libraries other than vtkCommonCore that instantiations of
480// the GetValueRange lookups can be found externally. This prevents each library
481// from instantiating these on their own.
482// Additionally it helps hide implementation details that pull in system
483// headers.
484// We only provide these specializations for the 64-bit integer types, since
485// other types can reuse the double-precision mechanism in
486// vtkDataArray::GetRange without losing precision.
487#ifdef VTK_GDA_VALUERANGE_INSTANTIATING
488
489// Forward declare necessary stuffs:
490template <typename ValueType>
492template <typename ValueType>
494
495#ifdef VTK_USE_SCALED_SOA_ARRAYS
496template <typename ValueType>
498#endif
499
500#define VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(ArrayType, ValueType) \
501 template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange( \
502 ArrayType*, ValueType*, vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
503 template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(ArrayType*, ValueType*, \
504 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char); \
505 template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
506 vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
507 template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
508 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char);
509
510#ifdef VTK_USE_SCALED_SOA_ARRAYS
511
512#define VTK_INSTANTIATE_VALUERANGE_VALUETYPE(ValueType) \
513 VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(vtkAOSDataArrayTemplate<ValueType>, ValueType) \
514 VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(vtkSOADataArrayTemplate<ValueType>, ValueType) \
515 VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(vtkScaledSOADataArrayTemplate<ValueType>, ValueType)
516
517#else // VTK_USE_SCALED_SOA_ARRAYS
518
519#define VTK_INSTANTIATE_VALUERANGE_VALUETYPE(ValueType) \
520 VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(vtkAOSDataArrayTemplate<ValueType>, ValueType) \
521 VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(vtkSOADataArrayTemplate<ValueType>, ValueType)
522
523#endif
524
525#elif defined(VTK_USE_EXTERN_TEMPLATE) // VTK_GDA_VALUERANGE_INSTANTIATING
526
527#ifndef VTK_GDA_TEMPLATE_EXTERN
528#define VTK_GDA_TEMPLATE_EXTERN
529#ifdef _MSC_VER
530#pragma warning(push)
531// The following is needed when the following is declared
532// dllexport and is used from another class in vtkCommonCore
533#pragma warning(disable : 4910) // extern and dllexport incompatible
534#endif
535
536// Forward declare necessary stuffs:
537template <typename ValueType>
539template <typename ValueType>
541
542#ifdef VTK_USE_SCALED_SOA_ARRAYS
543template <typename ValueType>
545#endif
546
547namespace vtkDataArrayPrivate
548{
549template <typename A, typename R, typename T>
550bool DoComputeScalarRange(A*, R*, T, const unsigned char* ghosts, unsigned char ghostsToSkip);
551template <typename A, typename R>
553 A*, R[2], AllValues, const unsigned char* ghosts, unsigned char ghostsToSkip);
554template <typename A, typename R>
556 A*, R[2], FiniteValues, const unsigned char* ghosts, unsigned char ghostsToSkip);
557} // namespace vtkDataArrayPrivate
558
559#define VTK_DECLARE_VALUERANGE_ARRAYTYPE(ArrayType, ValueType) \
560 extern template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange( \
561 ArrayType*, ValueType*, vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
562 extern template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(ArrayType*, ValueType*, \
563 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char); \
564 extern template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
565 vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
566 extern template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
567 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char);
568
569#ifdef VTK_USE_SCALED_SOA_ARRAYS
570
571#define VTK_DECLARE_VALUERANGE_VALUETYPE(ValueType) \
572 VTK_DECLARE_VALUERANGE_ARRAYTYPE(vtkAOSDataArrayTemplate<ValueType>, ValueType) \
573 VTK_DECLARE_VALUERANGE_ARRAYTYPE(vtkSOADataArrayTemplate<ValueType>, ValueType) \
574 VTK_DECLARE_VALUERANGE_ARRAYTYPE(vtkScaledSOADataArrayTemplate<ValueType>, ValueType)
575
576#else // VTK_USE_SCALED_SOA_ARRAYS
577
578#define VTK_DECLARE_VALUERANGE_VALUETYPE(ValueType) \
579 VTK_DECLARE_VALUERANGE_ARRAYTYPE(vtkAOSDataArrayTemplate<ValueType>, ValueType) \
580 VTK_DECLARE_VALUERANGE_ARRAYTYPE(vtkSOADataArrayTemplate<ValueType>, ValueType)
581
582#endif
583
584namespace vtkDataArrayPrivate
585{
586// These are instantiated in vtkGenericDataArrayValueRange${i}.cxx
590VTK_DECLARE_VALUERANGE_VALUETYPE(unsigned long long)
591
592// This is instantiated in vtkGenericDataArray.cxx
594
595// These are instantiated in vtkFloatArray.cxx, vtkDoubleArray.cxx, etc
609
610// These are instantiated in vtkSOADataArrayTemplateInstantiate${i}.cxx
624
625// These are instantiated in vtkScaledSOADataArrayTemplateInstantiate${i}.cxx
626#ifdef VTK_USE_SCALED_SOA_ARRAYS
640#endif // VTK_USE_SCALED_SOA_ARRAYS
641
642} // namespace vtkDataArrayPrivate
643
644#undef VTK_DECLARE_VALUERANGE_ARRAYTYPE
645#undef VTK_DECLARE_VALUERANGE_VALUETYPE
646
647#ifdef _MSC_VER
648#pragma warning(pop)
649#endif
650#endif // VTK_SOA_DATA_ARRAY_TEMPLATE_EXTERN
651
652#endif // VTK_GDA_VALUERANGE_INSTANTIATING
653
654// 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:43
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:79
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