65 #ifndef vtkAbstractArray_h
66 #define vtkAbstractArray_h
68 #include "vtkCommonCoreModule.h"
73 VTK_ABI_NAMESPACE_BEGIN
90 using ArrayTypeTag = std::integral_constant<int, vtkArrayTypes::VTK_ABSTRACT_ARRAY>;
96 void PrintValues(ostream& os);
136 virtual
void Initialize();
150 virtual int GetDataTypeSize()
const = 0;
151 static int GetDataTypeSize(
int type);
161 virtual int GetElementComponentSize()
const = 0;
168 vtkSetClampMacro(NumberOfComponents,
int, 1,
VTK_INT_MAX);
186 bool HasAComponentName()
const;
208 virtual bool CopyComponent(
int dstComponent,
vtkAbstractArray* src,
int srcComponent) = 0;
217 this->SetNumberOfValues(this->NumberOfComponents * numTuples);
227 virtual
bool SetNumberOfValues(
vtkIdType numValues);
232 vtkIdType GetNumberOfTuples()
const {
return (this->MaxId + 1) / this->NumberOfComponents; }
241 vtkIdType GetNumberOfValues()
const {
return (this->MaxId + 1); }
256 virtual void InsertTuple(
271 virtual void InsertTuplesStartingAt(
279 virtual void InsertTuples(
309 virtual bool HasStandardMemoryLayout()
const;
318 virtual void* GetVoidPointer(
vtkIdType valueIdx) = 0;
344 virtual void InterpolateTuple(
362 virtual void Squeeze() = 0;
404 VTK_DATA_ARRAY_USER_DEFINED
425 virtual void SetVoidArray(
429 this->SetVoidArray(array, size, save);
439 virtual void SetArrayFreeFunction(
void (*callback)(
void*)) = 0;
447 virtual
void ExportToVoidPointer(
void* out_ptr);
457 virtual
unsigned long GetActualMemorySize() const = 0;
463 vtkSetStringMacro(Name);
464 vtkGetStringMacro(Name);
470 virtual const
char* GetDataTypeAsString()
const
472 return vtkImageScalarTypeNameMacro(this->GetDataType());
491 virtual int IsNumeric()
const = 0;
496 virtual bool IsIntegral()
const;
513 return this->GetNumberOfComponents() * this->GetNumberOfTuples();
532 VTK_EXPECTS(0 <= valueIdx && valueIdx < GetNumberOfValues());
546 VTK_EXPECTS(0 <= valueIdx && valueIdx < GetNumberOfValues()) = 0;
556 virtual void DataChanged() = 0;
563 virtual void ClearLookup() = 0;
617 virtual void GetProminentComponentValues(
int comp,
vtkVariantArray* values,
618 double uncertainty = 1.e-6,
double minimumProminence = 1.e-3);
713 MAX_DISCRETE_VALUES = 32
721 vtkGetMacro(MaxDiscreteValues,
unsigned int);
722 vtkSetMacro(MaxDiscreteValues,
unsigned int);
734 "Use vtkArrayTypes::VTK_SCALED_SOA_DATA_ARRAY") =
741 "ScaleSoADataArrayTemplate has been renamed to ScaledSoADataArrayTemplate") =
754 static const char* GetArrayTypeAsString(
int arrayType);
765 vtkIdType GetSize()
const {
return this->GetCapacity(); }
790 virtual void UpdateDiscreteValueSet(
double uncertainty,
double minProminence);
807 class vtkInternalComponentNames;
821 template <
typename ArrayT>
845 template <
typename ArrayT>
853 VTK_ABI_NAMESPACE_END
860 #define vtkArrayDownCast_FastCastMacro(ArrayT) \
862 struct vtkArrayDownCast_impl<ArrayT> \
864 inline ArrayT* operator()(vtkAbstractArray* array) \
866 return ArrayT::FastDownCast(array); \
878 #define vtkArrayDownCast_TemplateFastCastMacro(ArrayT) \
879 template <typename ValueT> \
880 struct vtkArrayDownCast_impl<ArrayT<ValueT>> \
882 inline ArrayT<ValueT>* operator()(vtkAbstractArray* array) \
884 return ArrayT<ValueT>::FastDownCast(array); \
896 #define vtkArrayDownCast_Template2FastCastMacro(ArrayT) \
897 template <typename ValueT, int ArrayType> \
898 struct vtkArrayDownCast_impl<ArrayT<ValueT, ArrayType>> \
900 inline ArrayT<ValueT, ArrayType>* operator()(vtkAbstractArray* array) \
902 return ArrayT<ValueT, ArrayType>::FastDownCast(array); \
virtual void SetNumberOfTuples(vtkIdType numTuples)
Set the number of tuples (a component group) in the array.
abstract base class for most VTK objects
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
An array holding vtkVariants.
int GetNumberOfComponents() const
Set/Get the dimension (n) of the components.
Abstract superclass for all arrays.
Implementation of vtkArrayDownCast.
dynamic, self-adjusting array of vtkIdType
virtual void SetVoidArray(void *array, vtkIdType size, int save, int deleteMethod)
This method lets the user specify data to be held by the array.
A type representing the union of many types.
vtkInformation * Information
#define VTK_DEPRECATED_IN_9_6_0(reason)
a simple class to control print indentation
void save(Archiver &ar, const std::string &str, const unsigned int version)
list of point or cell ids
ArrayT * operator()(vtkAbstractArray *array)
abstract superclass for arrays of numeric data
bool HasInformation() const
Inquire if this array has an instance of vtkInformation already associated with it.
virtual void Modified()
Update the modification time for this object.
Abstract superclass to iterate over elements in an vtkAbstractArray.
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
virtual int GetArrayType() const
Method for type-checking in FastDownCast implementations.
#define VTK_MARSHALEXCLUDE(reason)
vtkIdType GetCapacity() const
Get the capacity of the array.
std::integral_constant< int, VTK_OPAQUE > DataTypeTag
vtkInternalComponentNames * ComponentNames
ArrayT * vtkArrayDownCast(vtkAbstractArray *array)
vtkArrayDownCast is to be used by generic (e.g.
std::integral_constant< int, vtkArrayTypes::VTK_ABSTRACT_ARRAY > ArrayTypeTag
unsigned int MaxDiscreteValues
const char * GetArrayTypeAsString() const
Get the name for the array type as string.
vtkSmartPointer< vtkDataArray > CreateArray(const Ioss::Field &field)
Create an array for the given field.
#define VTK_DEPRECATED_IN_9_7_0(reason)
vtkIdType GetMaxId() const
What is the maximum id currently in the array.
#define VTK_MARSHAL_EXCLUDE_REASON_IS_INTERNAL