Go to the documentation of this file.
60 #ifndef vtkAbstractArray_h
61 #define vtkAbstractArray_h
63 #include "vtkCommonCoreModule.h"
175 {
return (this->MaxId + 1)/this->NumberOfComponents;}
185 return (this->MaxId + 1);
331 {
return this->MaxId;}
338 VTK_DATA_ARRAY_USER_DEFINED
361 int vtkNotUsed(
save)) =0;
363 int vtkNotUsed(deleteMethod))
364 {this->SetVoidArray(array,
size,
save);};
396 vtkSetStringMacro(Name);
397 vtkGetStringMacro(Name);
404 {
return vtkImageScalarTypeNameMacro( this->GetDataType() ); }
439 return this->GetNumberOfComponents() * this->GetNumberOfTuples();
454 VTK_EXPECTS(0 <= valueIdx && valueIdx < GetNumberOfValues());
468 VTK_EXPECTS(0 <= valueIdx && valueIdx < GetNumberOfValues()) = 0;
540 double uncertainty = 1.e-6,
double minimumProminence = 1.e-3);
630 MAX_DISCRETE_VALUES = 32
638 vtkGetMacro(MaxDiscreteValues,
unsigned int);
639 vtkSetMacro(MaxDiscreteValues,
unsigned int);
650 DataArrayTemplate = AoSDataArrayTemplate
659 return AbstractArray;
700 class vtkInternalComponentNames;
714 template <
typename ArrayT>
719 return ArrayT::SafeDownCast(array);
741 template <
typename ArrayT>
754 #define vtkArrayDownCast_FastCastMacro(ArrayT) \
755 template <> struct vtkArrayDownCast_impl<ArrayT> \
757 inline ArrayT* operator()(vtkAbstractArray *array) \
759 return ArrayT::FastDownCast(array); \
771 #define vtkArrayDownCast_TemplateFastCastMacro(ArrayT) \
772 template <typename ValueT> struct vtkArrayDownCast_impl<ArrayT<ValueT> > \
774 inline ArrayT<ValueT>* operator()(vtkAbstractArray *array) \
776 return ArrayT<ValueT>::FastDownCast(array); \
virtual void SetArrayFreeFunction(void(*callback)(void *))=0
This method allows the user to specify a custom free function to be called when the array is dealloca...
virtual void Initialize()=0
Release storage and reset array to initial state.
virtual vtkIdType LookupValue(vtkVariant value)=0
Return the value indices where a specific value appears.
virtual void Squeeze()=0
Free any unnecessary memory.
virtual int CopyInformation(vtkInformation *infoFrom, int deep=1)
Copy information instance.
virtual void InterpolateTuple(vtkIdType dstTupleIdx, vtkIdList *ptIndices, vtkAbstractArray *source, double *weights)=0
Set the tuple at dstTupleIdx in this array to the interpolated tuple value, given the ptIndices in th...
virtual bool HasStandardMemoryLayout()
Returns true if this array uses the standard memory layout defined in the VTK user guide,...
int CopyComponentNames(vtkAbstractArray *da)
Copies the component names from the inputed array to the current array make sure that the current arr...
@ VTK_DATA_ARRAY_ALIGNED_FREE
virtual vtkIdType GetDataSize()
Returns the size of the data in DataTypeSize units.
int GetNumberOfComponents()
virtual vtkVariant GetVariantValue(vtkIdType valueIdx)
Retrieve value from the array as a variant.
virtual void SetVoidArray(void *vtkNotUsed(array), vtkIdType vtkNotUsed(size), int vtkNotUsed(save))=0
This method lets the user specify data to be held by the array.
virtual vtkArrayIterator * NewIterator()=0
Subclasses must override this method and provide the right kind of templated vtkArrayIteratorTemplate...
virtual void InsertTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray *source)=0
Insert the tuple at srcTupleIdx in the source array into this array at dstTupleIdx.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual vtkIdType InsertNextTuple(vtkIdType srcTupleIdx, vtkAbstractArray *source)=0
Insert the tuple from srcTupleIdx in the source array at the end of this array.
void Modified() override
Removes out-of-date PER_COMPONENT() and PER_FINITE_COMPONENT() values.
virtual void SetNumberOfTuples(vtkIdType numTuples)=0
Set the number of tuples (a component group) in the array.
~vtkAbstractArray() override
void save(Archiver &ar, const vtkUnicodeString &str, const unsigned int vtkNotUsed(version))
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...
vtkInformation * Information
virtual void SetVoidArray(void *array, vtkIdType size, int save, int vtkNotUsed(deleteMethod))
abstract base class for most VTK objects
An array holding vtkVariants.
abstract superclass for arrays of numeric data
vtkInternalComponentNames * ComponentNames
bool HasInformation()
Inquire if this array has an instance of vtkInformation already associated with it.
virtual void GetTuples(vtkIdType p1, vtkIdType p2, vtkAbstractArray *output)
Get the tuples for the range of tuple ids specified (i.e., p1->p2 inclusive).
vtkInformation * GetInformation()
Get an information object that can be used to annotate the array.
virtual vtkTypeBool Allocate(vtkIdType numValues, vtkIdType ext=1000)=0
Allocate memory for this array.
virtual void InsertVariantValue(vtkIdType valueIdx, vtkVariant value)=0
Insert a value into the array from a variant.
vtkIdType GetSize()
Return the size of the data.
virtual void * GetVoidPointer(vtkIdType valueIdx)=0
Return a void pointer.
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
vtkIdType GetNumberOfTuples()
Get the number of complete tuples (a component group) in the array.
vtkIdType GetNumberOfValues() const
Get the total number of values in the array.
virtual int GetElementComponentSize()=0
Return the size, in bytes, of the lowest-level element of an array.
virtual unsigned long GetActualMemorySize()=0
Return the memory in kibibytes (1024 bytes) consumed by this data array.
virtual void LookupValue(vtkVariant value, vtkIdList *valueIds)=0
vtkIdType GetMaxId()
What is the maximum id currently in the array.
virtual void UpdateDiscreteValueSet(double uncertainty, double minProminence)
Obtain the set of unique values taken on by each component of the array, as well as by the tuples of ...
void Reset()
Reset to an empty state, without freeing any memory.
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 int IsNumeric()=0
This method is here to make backward compatibility easier.
virtual int GetDataTypeSize()=0
Return the size of the underlying data type.
static vtkInformationDoubleVectorKey * DISCRETE_VALUE_SAMPLE_PARAMETERS()
A key used to hold conditions under which cached discrete values were generated; the value is a 2-vec...
a simple class to control print indentation
static vtkAbstractArray * CreateArray(int dataType)
Creates an array for dataType where dataType is one of VTK_BIT, VTK_CHAR, VTK_UNSIGNED_CHAR,...
virtual int GetDataType()=0
Return the underlying data type.
A atomic type representing the union of many types.
list of point or cell ids
ArrayT * operator()(vtkAbstractArray *array)
virtual void InterpolateTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx1, vtkAbstractArray *source1, vtkIdType srcTupleIdx2, vtkAbstractArray *source2, double t)=0
Insert the tuple at dstTupleIdx in this array to the tuple interpolated from the two tuple indices,...
Implementation of vtkArrayDownCast.
virtual void SetInformation(vtkInformation *)
Set an information object that can be used to annotate the array.
static vtkInformationInformationVectorKey * PER_FINITE_COMPONENT()
This key is used to hold a vector of COMPONENT_VALUES (and, for vtkDataArray subclasses,...
static int GetDataTypeSize(int type)
virtual void SetVariantValue(vtkIdType valueIdx, vtkVariant value)=0
Set a value in the array from a variant.
void SetComponentName(vtkIdType component, const char *name)
Set the name for a component.
virtual int GetArrayType()
Method for type-checking in FastDownCast implementations.
virtual void InsertTuples(vtkIdType dstStart, vtkIdType n, vtkIdType srcStart, vtkAbstractArray *source)=0
Copy n consecutive tuples starting at srcStart from the source array to this array,...
const char * GetComponentName(vtkIdType component)
Get the component name for a given component.
ArrayT * vtkArrayDownCast(vtkAbstractArray *array)
vtkArrayDownCast is to be used by generic (e.g.
Abstract superclass for all arrays.
virtual void ExportToVoidPointer(void *out_ptr)
This method copies the array data to the void pointer specified by the user.
unsigned int MaxDiscreteValues
dynamic, self-adjusting array of vtkIdType
bool HasAComponentName()
Returns if any component has had a name assigned.
virtual void DeepCopy(vtkAbstractArray *da)
Deep copy of data.
Abstract superclass to iterate over elements in an vtkAbstractArray.
virtual void GetTuples(vtkIdList *tupleIds, vtkAbstractArray *output)
Given a list of tuple ids, return an array of tuples.
static vtkInformationIntegerKey * GUI_HIDE()
This key is a hint to end user interface that this array is internal and should not be shown to the e...
virtual void ClearLookup()=0
Delete the associated fast lookup data structure on this array, if it exists.
static vtkInformationVariantVectorKey * DISCRETE_VALUES()
A key used to hold discrete values taken on either by the tuples of the array (when present in this->...
virtual void GetProminentComponentValues(int comp, vtkVariantArray *values, double uncertainty=1.e-6, double minimumProminence=1.e-3)
Populate the given vtkVariantArray with a set of distinct values taken on by the requested component ...
static vtkInformationInformationVectorKey * PER_COMPONENT()
This key is used to hold a vector of COMPONENT_VALUES (and, for vtkDataArray subclasses,...
virtual void DataChanged()=0
Tell the array explicitly that the data has changed.
virtual vtkTypeBool Resize(vtkIdType numTuples)=0
Resize the array to the requested number of tuples and preserve data.
virtual void SetNumberOfValues(vtkIdType numValues)
Specify the number of values (tuples * components) for this object to hold.
virtual const char * GetDataTypeAsString(void)
Get the name of a data type as a string.