VTK  9.7.20260828
vtkGenericDataArray.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
164
165#ifndef vtkGenericDataArray_h
166#define vtkGenericDataArray_h
167
168#include "vtkDataArray.h"
169
170#include "vtkCompiler.h" // for VTK_USE_EXTERN_TEMPLATE
171#include "vtkDeprecation.h" // for VTK_DEPRECATED_IN_9_7_0
173#include "vtkSmartPointer.h"
174#include "vtkTypeTraits.h"
175#include "vtkWrappingHints.h" // for VTK_MARSHALEXCLUDE, VTK_SIZEHINT
176
177#include <cassert> // for assert
178#include <memory> // for std::unique_ptr
179
180VTK_ABI_NAMESPACE_BEGIN
181template <class DerivedT, class ValueTypeT, int ArrayType = vtkArrayTypes::VTK_DATA_ARRAY>
183{
184 static_assert(ArrayType >= vtkArrayTypes::VTK_ABSTRACT_ARRAY &&
186 "ArrayType must be a valid vtkAbstractArray::ArrayType enum value");
187
188public:
191 using ArrayTypeTag = std::integral_constant<int, ArrayType>;
192 using DataTypeTag = std::integral_constant<int, vtkTypeTraits<ValueTypeT>::VTK_TYPE_ID>;
193 using ValueType = ValueTypeT;
194
199
208 {
209 return static_cast<const DerivedT*>(this)->GetValue(valueIdx);
210 }
211
219 void SetValue(vtkIdType valueIdx, ValueType value)
220 VTK_EXPECTS(0 <= valueIdx && valueIdx < GetNumberOfValues())
221 {
222 static_cast<DerivedT*>(this)->SetValue(valueIdx, value);
223 }
224
233 void GetTypedTuple(vtkIdType tupleIdx, ValueType* tuple) const
234 VTK_EXPECTS(0 <= tupleIdx && tupleIdx < GetNumberOfTuples())
235 {
236 static_cast<const DerivedT*>(this)->GetTypedTuple(tupleIdx, tuple);
237 }
238
247 void SetTypedTuple(vtkIdType tupleIdx, const ValueType* tuple)
248 VTK_EXPECTS(0 <= tupleIdx && tupleIdx < GetNumberOfTuples())
249 {
250 static_cast<DerivedT*>(this)->SetTypedTuple(tupleIdx, tuple);
251 }
252
258 ValueType GetTypedComponent(vtkIdType tupleIdx, int compIdx) const
259 VTK_EXPECTS(0 <= tupleIdx && GetNumberOfComponents() * tupleIdx + compIdx < GetNumberOfValues())
260 VTK_EXPECTS(0 <= compIdx && compIdx < GetNumberOfComponents())
261 {
262 return static_cast<const DerivedT*>(this)->GetTypedComponent(tupleIdx, compIdx);
263 }
264
270 void SetTypedComponent(vtkIdType tupleIdx, int compIdx, ValueType value)
271 VTK_EXPECTS(0 <= tupleIdx && GetNumberOfComponents() * tupleIdx + compIdx < GetNumberOfValues())
272 VTK_EXPECTS(0 <= compIdx && compIdx < GetNumberOfComponents())
273 {
274 static_cast<DerivedT*>(this)->SetTypedComponent(tupleIdx, compIdx, value);
275 }
276
278
282 void* GetVoidPointer(vtkIdType valueIdx) override;
283 VTK_DEPRECATED_IN_9_7_0("Use vtkAOSDataArrayTemplate::GetPointer(valueIdx) instead")
285 void SetVoidArray(void*, vtkIdType, int) override;
286 void SetVoidArray(void*, vtkIdType, int, int) override;
287 void SetArrayFreeFunction(void (*callback)(void*)) override;
288 VTK_DEPRECATED_IN_9_7_0("Use vtkAOSDataArrayTemplate::WritePointer(valueIdx, numValues) or "
289 "vtkAbstractArray::SetNumberOf[Values/Tuples]() instead")
290 void* WriteVoidPointer(vtkIdType valueIdx, vtkIdType numValues) override;
291 VTK_DEPRECATED_IN_9_7_0("Use vtkAOSDataArrayTemplate::WritePointer(valueIdx, numValues) or "
292 "vtkAbstractArray::SetNumberOf[Values/Tuples]() instead")
295
302 void RemoveTuple(vtkIdType tupleIdx) override;
303
308
312 void InsertValue(vtkIdType valueIdx, ValueType value);
313
317 void InsertTypedTuple(vtkIdType tupleIdx, const ValueType* t);
318
323
328 void InsertTypedComponent(vtkIdType tupleIdx, int compIdx, ValueType val);
329
331
343 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
344 void GetValueRange(ValueType range[2], int comp);
347
353 void GetValueRange(ValueType range[2]) { this->GetValueRange(range, 0); }
354
361 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
362 void GetFiniteValueRange(ValueType range[2], int comp);
365 void GetFiniteValueRange(ValueType range[2]) { this->GetFiniteValueRange(range, 0); }
367
371 virtual void FillTypedComponent(int compIdx, ValueType value);
372
376 virtual void FillValue(ValueType value);
377
378#ifndef __VTK_WRAP__
380
388#endif
389 int GetArrayType() const override;
390 int GetDataType() const override;
393 int GetDataTypeSize() const override;
394 bool HasStandardMemoryLayout() const override;
396 void SetNumberOfComponents(int num) override;
397 void Squeeze() override;
398 void SetTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray* source) override;
399 // MSVC doesn't like 'using' here (error C2487). Just forward instead:
400 // using Superclass::SetTuple;
401 void SetTuple(vtkIdType tupleIdx, const float* tuple) override
402 {
403 this->Superclass::SetTuple(tupleIdx, tuple);
404 }
405 void SetTuple(vtkIdType tupleIdx, const double* tuple) override
406 {
407 this->Superclass::SetTuple(tupleIdx, tuple);
408 }
409
411 vtkIdType dstStart, vtkIdList* srcIds, vtkAbstractArray* source) override;
412 void InsertTuples(vtkIdList* dstIds, vtkIdList* srcIds, vtkAbstractArray* source) override;
413 // MSVC doesn't like 'using' here (error C2487). Just forward instead:
414 // using Superclass::InsertTuples;
416 vtkIdType dstStart, vtkIdType n, vtkIdType srcStart, vtkAbstractArray* source) override
417 {
418 this->Superclass::InsertTuples(dstStart, n, srcStart, source);
419 }
420
421 void InsertTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray* source) override;
422 void InsertTuple(vtkIdType tupleIdx, const float* source) override;
423 void InsertTuple(vtkIdType tupleIdx, const double* source) override;
424 void InsertComponent(vtkIdType tupleIdx, int compIdx, double value) override;
426 vtkIdType InsertNextTuple(const float* tuple) override;
427 vtkIdType InsertNextTuple(const double* tuple) override;
428 void GetTuples(vtkIdList* tupleIds, vtkAbstractArray* output) override;
429 void GetTuples(vtkIdType p1, vtkIdType p2, vtkAbstractArray* output) override;
430 double* GetTuple(vtkIdType tupleIdx) override;
431 void GetTuple(vtkIdType tupleIdx, double* tuple) override;
433 double* weights) override;
434 void InterpolateTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx1, vtkAbstractArray* source1,
435 vtkIdType srcTupleIdx2, vtkAbstractArray* source2, double t) override;
436 void SetComponent(vtkIdType tupleIdx, int compIdx, double value) override;
437 double GetComponent(vtkIdType tupleIdx, int compIdx) override;
438 void SetVariantValue(vtkIdType valueIdx, vtkVariant value) override;
440 void InsertVariantValue(vtkIdType valueIdx, vtkVariant value) override;
443 void LookupValue(vtkVariant value, vtkIdList* valueIds) override;
444 virtual void LookupTypedValue(ValueType value, vtkIdList* valueIds);
445 void ClearLookup() override;
446 void DataChanged() override;
447 void FillComponent(int compIdx, double value) override;
448 VTK_DEPRECATED_IN_9_7_0("Use vtk::DataArrayValueRange, or the array directly")
450
451protected:
454
461 {
462 return static_cast<DerivedT*>(this)->ReallocateTuples(numTuples);
463 }
464
465 // This method resizes the array if needed so that the given tuple index is
466 // valid/accessible.
468
477 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
478
487 ValueType range[2], int comp, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
488
496 ValueType* ranges, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
497
503 ValueType range[2], const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
504
512 ValueType* ranges, const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
513
519 ValueType range[2], const unsigned char* ghosts, unsigned char ghostsToSkip = 0xff);
520
521 std::vector<double> LegacyTuple;
522 std::vector<ValueType> LegacyValueRange;
523 std::vector<ValueType> LegacyValueRangeFull;
524
526
527private:
529 void operator=(const vtkGenericDataArray&) = delete;
530
531 struct vtkInternals;
532 std::unique_ptr<vtkInternals> Internals;
533};
534VTK_ABI_NAMESPACE_END
535
536// These macros define the vtkGenericDataArray methods that aren't redefined
537// in vtkAOSDataArrayTemplate and vtkSOADataArrayTemplate. The wrappers do
538// not see vtkGenericDataArray as a superclass of AOS/SOA arrays, so these
539// macros are used to fill in the missing parts of the inherited interface.
540#define vtkCreateGenericWrappedArrayReadInterface(T) \
541 int GetDataType() const override; \
542 T GetDataTypeValueMin() const; \
543 T GetDataTypeValueMax() const; \
544 T* GetValueRange(int comp) VTK_SIZEHINT(2); \
545 T* GetValueRange() VTK_SIZEHINT(2); \
546 void GetValueRange(T range[2], int comp);
547#define vtkCreateGenericWrappedArrayWriteInterface(T) \
548 void InsertTypedTuple(vtkIdType i, const T* tuple) VTK_EXPECTS(0 <= i); \
549 vtkIdType InsertNextTypedTuple(const T* tuple); \
550 void InsertValue(vtkIdType id, T f) VTK_EXPECTS(0 <= id); \
551 vtkIdType InsertNextValue(T f);
552#define vtkCreateGenericWrappedArrayInterface(T) \
553 vtkCreateGenericWrappedArrayReadInterface(T); \
554 vtkCreateGenericWrappedArrayWriteInterface(T);
555
556// This macro is used by the subclasses to create dummy
557// declarations for these functions such that the wrapper
558// can see them. The wrappers ignore vtkGenericDataArray.
559#define vtkCreateWrappedArrayReadInterface(T) \
560 vtkCreateGenericWrappedArrayReadInterface(T); \
561 void GetTypedTuple(vtkIdType i, T* tuple) VTK_EXPECTS(0 <= i && i < GetNumberOfTuples()) \
562 VTK_SIZEHINT(tuple, GetNumberOfComponents()); \
563 T GetTypedComponent(vtkIdType i, int c) const VTK_EXPECTS(0 <= c && c < GetNumberOfComponents()) \
564 VTK_EXPECTS(0 <= i && GetNumberOfComponents() * i + c < GetNumberOfValues()); \
565 VTK_MARSHALEXCLUDE(VTK_MARSHAL_EXCLUDE_REASON_IS_REDUNDANT) \
566 T GetValue(vtkIdType id) const VTK_EXPECTS(0 <= id && id < GetNumberOfValues());
567#define vtkCreateWrappedArrayWriteInterface(T) \
568 vtkCreateGenericWrappedArrayWriteInterface(T); \
569 void SetTypedTuple(vtkIdType i, const T* tuple) VTK_EXPECTS(0 <= i && i < GetNumberOfTuples()) \
570 VTK_SIZEHINT(tuple, GetNumberOfComponents()); \
571 void SetTypedComponent(vtkIdType i, int c, T value); \
572 VTK_MARSHALEXCLUDE(VTK_MARSHAL_EXCLUDE_REASON_IS_REDUNDANT) \
573 void SetValue(vtkIdType id, T value) VTK_EXPECTS(0 <= id && id < GetNumberOfValues()); \
574 bool SetNumberOfValues(vtkIdType number) override;
575
576#define VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(ArrayType, ValueType) \
577 template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange( \
578 ArrayType*, ValueType*, vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
579 template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(ArrayType*, ValueType*, \
580 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char); \
581 template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
582 vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
583 template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
584 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char);
585
586namespace vtkDataArrayPrivate
587{
588VTK_ABI_NAMESPACE_BEGIN
589template <typename A, typename R, typename T>
590VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(
591 A*, R*, T, const unsigned char* ghosts, unsigned char ghostsToSkip);
592template <typename A, typename R>
593VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(
594 A*, R[2], AllValues, const unsigned char* ghosts, unsigned char ghostsToSkip);
595template <typename A, typename R>
596VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(
597 A*, R[2], FiniteValues, const unsigned char* ghosts, unsigned char ghostsToSkip);
598VTK_ABI_NAMESPACE_END
599} // namespace vtkDataArrayPrivate
600
601#define VTK_DECLARE_VALUERANGE_ARRAYTYPE(ArrayType, ValueType) \
602 extern template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange( \
603 ArrayType*, ValueType*, vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
604 extern template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(ArrayType*, ValueType*, \
605 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char); \
606 extern template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
607 vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
608 extern template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
609 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char);
610
611#include "vtkGenericDataArray.txx"
612
613// Adds an implementation of NewInstanceInternal() that returns an AoS
614// (unmapped) VTK array, if possible. This allows the pipeline to copy and
615// propagate the array when the array data is not modifiable. Use this in
616// combination with vtkAbstractTypeMacro or vtkAbstractTemplateTypeMacro
617// (instead of vtkTypeMacro) to avoid adding the default NewInstance
618// implementation.
619#define vtkAOSArrayNewInstanceMacro(thisClass) \
620protected: \
621 vtkObjectBase* NewInstanceInternal() const override \
622 { \
623 if (vtkDataArray* da = vtkDataArray::CreateDataArray(thisClass::DataTypeTag::value)) \
624 { \
625 return da; \
626 } \
627 return thisClass::New(); \
628 } \
629 \
630public:
631
632#endif
633
634// This is used to tell libraries other than vtkCommonCore that instantiations of
635// the GetValueRange lookups can be found externally. This prevents each library
636// from instantiating these on their own.
637// Additionally, it helps hide implementation details that pull in system
638// headers.
639#ifdef VTK_USE_EXTERN_TEMPLATE
640
641#ifndef VTK_GDA_TEMPLATE_EXTERN
642#define VTK_GDA_TEMPLATE_EXTERN
643#ifdef _MSC_VER
644#pragma warning(push)
645// The following is needed when the following is declared
646// dllexport and is used from another class in vtkCommonCore
647#pragma warning(disable : 4910) // extern and dllexport incompatible
648#endif
649
650namespace vtkDataArrayPrivate
651{
652VTK_ABI_NAMESPACE_BEGIN
653// This is instantiated in vtkGenericDataArray.cxx
655
656VTK_ABI_NAMESPACE_END
657} // namespace vtkDataArrayPrivate
658
659#ifdef _MSC_VER
660#pragma warning(pop)
661#endif
662#endif // VTK_GDA_TEMPLATE_EXTERN
663
664#endif // VTK_USE_EXTERN_TEMPLATE
665
666// VTK-HeaderTest-Exclude: vtkGenericDataArray.h
Abstract superclass for all arrays.
int GetNumberOfComponents() const
Set/Get the dimension (n) of the components.
vtkIdType GetNumberOfTuples() const
Get the number of complete tuples (a component group) in the array.
virtual void SetTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray *source)=0
Set the tuple at dstTupleIdx in this array to the tuple at srcTupleIdx in the source array.
virtual void InsertTuples(vtkIdList *dstIds, vtkIdList *srcIds, vtkAbstractArray *source)=0
Copy the tuples indexed in srcIds from the source array to the tuple locations indexed by dstIds in t...
vtkIdType GetNumberOfValues() const
Get the total number of values in the array.
Abstract superclass to iterate over elements in an vtkAbstractArray.
internal class used by vtkGenericDataArray to support LookupValue.
void InterpolateTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx1, vtkAbstractArray *source1, vtkIdType srcTupleIdx2, vtkAbstractArray *source2, double t) override
Insert the tuple at dstTupleIdx in this array to the tuple interpolated from the two tuple indices,...
ValueType * GetFiniteValueRange(int comp)
These methods are analogous to the GetValueRange methods, except that the only consider finite values...
void DataChanged() override
Tell the array explicitly that the data has changed.
virtual void LookupTypedValue(ValueType value, vtkIdList *valueIds)
void * GetVoidPointer(vtkIdType valueIdx) override
Default implementation raises a runtime error.
int GetDataTypeSize() const override
Return the size of the underlying data type.
void InsertComponent(vtkIdType tupleIdx, int compIdx, double value) override
Insert value at the location specified by tupleIdx and compIdx.
ValueType * GetValueRange()
Get the range of array values for the 0th component in the native data type.
void GetFiniteValueRange(ValueType range[2])
These methods are analogous to the GetValueRange methods, except that the only consider finite values...
void SetTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray *source) override
See documentation from parent class.
bool HasStandardMemoryLayout() const override
Returns true if this array uses the standard memory layout defined in the VTK user guide,...
void InsertTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray *source) override
See documentation from parent class.
void ComputeValueRange(ValueType range[2], int comp, const unsigned char *ghosts, unsigned char ghostsToSkip=0xff)
Compute the range for a specific component.
void GetFiniteValueRange(ValueType range[2], int comp, const unsigned char *ghosts, unsigned char ghostsToSkip=0xff)
These methods are analogous to the GetValueRange methods, except that the only consider finite values...
void InsertTuple(vtkIdType tupleIdx, const float *source) override
Insert the data tuple at tupleIdx.
double GetComponent(vtkIdType tupleIdx, int compIdx) override
Return the data component at the location specified by tupleIdx and compIdx.
void LookupValue(vtkVariant value, vtkIdList *valueIds) override
Return the value indices where a specific value appears.
void * WriteVoidPointer(vtkIdType valueIdx, vtkIdType numValues) override
int GetArrayType() const override
Method for type-checking in FastDownCast implementations.
bool ComputeVectorValueRange(ValueType range[2], const unsigned char *ghosts, unsigned char ghostsToSkip=0xff)
Returns true if the range was computed.
void SetComponent(vtkIdType tupleIdx, int compIdx, double value) override
Set the data component at the location specified by tupleIdx and compIdx to value.
bool ComputeFiniteScalarValueRange(ValueType *ranges, const unsigned char *ghosts, unsigned char ghostsToSkip=0xff)
Computes the range for each component of an array, the length of ranges must be two times the number ...
vtkTemplateTypeMacro(SelfType, vtkDataArray)
bool EnsureAccessToTuple(vtkIdType tupleIdx)
void ComputeFiniteValueRange(ValueType range[2], int comp, const unsigned char *ghosts, unsigned char ghostsToSkip=0xff)
Compute the range for a specific component.
void GetValueRange(ValueType range[2], int comp, const unsigned char *ghosts, unsigned char ghostsToSkip=0xff)
vtkIdType LookupValue(vtkVariant value) override
Return the value indices where a specific value appears.
ValueType GetDataTypeValueMin() const
void GetTuples(vtkIdType p1, vtkIdType p2, vtkAbstractArray *output) override
Get the tuples for the range of tuple ids specified (i.e., p1->p2 inclusive).
bool ComputeFiniteVectorValueRange(ValueType range[2], const unsigned char *ghosts, unsigned char ghostsToSkip=0xff)
Returns true if the range was computed.
void GetFiniteValueRange(ValueType range[2], int comp)
These methods are analogous to the GetValueRange methods, except that the only consider finite values...
void InsertVariantValue(vtkIdType valueIdx, vtkVariant value) override
Insert a value into the array from a variant.
void InterpolateTuple(vtkIdType dstTupleIdx, vtkIdList *ptIndices, vtkAbstractArray *source, double *weights) override
Set the tuple at dstTupleIdx in this array to the interpolated tuple value, given the ptIndices in th...
void SetTuple(vtkIdType tupleIdx, const double *tuple) override
Set the data tuple at tupleIdx.
void SetVariantValue(vtkIdType valueIdx, vtkVariant value) override
Set a value in the array from a variant.
void SetNumberOfComponents(int num) override
Set/Get the dimension (n) of the components.
void SetTuple(vtkIdType tupleIdx, const float *tuple) override
Set the data tuple at tupleIdx.
virtual vtkIdType LookupTypedValue(ValueType value)
bool ComputeScalarValueRange(ValueType *ranges, const unsigned char *ghosts, unsigned char ghostsToSkip=0xff)
Computes the range for each component of an array, the length of ranges must be two times the number ...
vtkIdType InsertNextTuple(const double *tuple) override
Insert the data tuple at the end of the array and return the tuple index at which the data was insert...
std::integral_constant< int, vtkTypeTraits< T >::VTK_TYPE_ID > DataTypeTag
void GetTuple(vtkIdType tupleIdx, double *tuple) override
Get the data tuple at tupleIdx by filling in a user-provided array, Make sure that your array is larg...
virtual void FillValue(ValueType value)
Set all the values in array to value.
vtkVariant GetVariantValue(vtkIdType valueIdx) override
Retrieve value from the array as a variant.
ValueType * WritePointer(vtkIdType valueIdx, vtkIdType numValues)
void InsertTuples(vtkIdType dstStart, vtkIdType n, vtkIdType srcStart, vtkAbstractArray *source) override
See documentation from parent class.
double * GetTuple(vtkIdType tupleIdx) override
Get the data tuple at tupleIdx.
void GetValueRange(ValueType range[2])
vtkIdType InsertNextTuple(const float *tuple) override
Insert the data tuple at the end of the array and return the tuple index at which the data was insert...
vtkTypeBool ReserveTuples(vtkIdType numTuples) override
Reserve the array to the requested number of tuples and preserve data.
virtual void FillTypedComponent(int compIdx, ValueType value)
Set component comp of all tuples to value.
void InsertTuplesStartingAt(vtkIdType dstStart, vtkIdList *srcIds, vtkAbstractArray *source) override
See documentation from parent class.
void FillComponent(int compIdx, double value) override
Fill a component of a data array with a specified value.
void ClearLookup() override
Delete the associated fast lookup data structure on this array, if it exists.
void InsertTuples(vtkIdList *dstIds, vtkIdList *srcIds, vtkAbstractArray *source) override
See documentation from parent class.
vtkIdType InsertNextTuple(vtkIdType srcTupleIdx, vtkAbstractArray *source) override
See documentation from parent class.
void InsertTypedComponent(vtkIdType tupleIdx, int compIdx, ValueType val)
void Squeeze() override
Free any unnecessary memory.
static DerivedT * FastDownCast(vtkAbstractArray *source)
Perform a fast, safe cast from a vtkAbstractArray to a DerivedT.
int GetDataType() const override
Return the underlying data type.
ValueType GetDataTypeValueMax() const
void InsertTuple(vtkIdType tupleIdx, const double *source) override
Insert the data tuple at tupleIdx.
void GetTuples(vtkIdList *tupleIds, vtkAbstractArray *output) override
Given a list of tuple ids, return an array of tuples.
ValueType * GetFiniteValueRange()
These methods are analogous to the GetValueRange methods, except that the only consider finite values...
vtkGenericDataArray< vtkmDataArray< T >, T, ArrayType > SelfType
list of point or cell ids
Definition vtkIdList.h:135
A type representing the union of many types.
Definition vtkVariant.h:162
void SetTypedComponent(vtkIdType tupleIdx, int compIdx, ValueType value)
Set component compIdx of the tuple at tupleIdx to value.
ValueType GetTypedComponent(vtkIdType tupleIdx, int compIdx) const
Get component compIdx of the tuple at tupleIdx.
void GetTypedTuple(vtkIdType tupleIdx, ValueType *tuple) const
Copy the tuple at tupleIdx into tuple.
void SetTypedTuple(vtkIdType tupleIdx, const ValueType *tuple)
Set this array's tuple at tupleIdx to the values in tuple.
void SetValue(vtkIdType valueIdx, ValueType value)
Set the value at valueIdx to value.
ValueType GetValue(vtkIdType valueIdx) const
Get the value at valueIdx.
VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(A *, R *, T, const unsigned char *ghosts, unsigned char ghostsToSkip)
VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(A *, R[2], AllValues, const unsigned char *ghosts, unsigned char ghostsToSkip)
int vtkTypeBool
Definition vtkABI.h:64
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
#define vtkDataArray
#define VTK_DEPRECATED_IN_9_7_0(reason)
#define VTK_DECLARE_VALUERANGE_ARRAYTYPE(ArrayType, ValueType)
int vtkIdType
Definition vtkType.h:363
@ VTK_ABSTRACT_ARRAY
Definition vtkType.h:72
@ VTK_NUM_ARRAY_TYPES
Definition vtkType.h:99
#define VTK_SIZEHINT(...)
#define VTK_EXPECTS(x)
#define VTK_NEWINSTANCE