21 #ifndef vtkStringArray_h
22 #define vtkStringArray_h
26 #include "vtkCommonCoreModule.h"
30 VTK_ABI_NAMESPACE_BEGIN
31 class vtkStringArrayLookup;
43 using ArrayTypeTag = std::integral_constant<int, vtkArrayTypes::VTK_STRING_ARRAY>;
184 ValueType GetTypedComponent(
vtkIdType tupleIdx,
int comp)
const
186 VTK_EXPECTS(0 <= comp && comp < GetNumberOfComponents());
192 void SetTypedComponent(
vtkIdType tupleIdx,
int comp, ValueType
value)
193 VTK_EXPECTS(0 <= tupleIdx && GetNumberOfComponents() * tupleIdx + comp < GetNumberOfValues())
194 VTK_EXPECTS(0 <= comp && comp < GetNumberOfComponents());
201 void GetTypedTuple(
vtkIdType tupleIdx, ValueType* tuple) const
202 VTK_EXPECTS(0 <= tupleIdx && tupleIdx < GetNumberOfTuples());
209 void SetTypedTuple(
vtkIdType tupleIdx, const ValueType* tuple)
210 VTK_EXPECTS(0 <= tupleIdx && tupleIdx < GetNumberOfTuples());
216 const ValueType& GetValue(
vtkIdType id) const
217 VTK_EXPECTS(0 <=
id &&
id < this->GetNumberOfValues());
229 VTK_EXPECTS(0 <=
id &&
id < this->GetNumberOfValues())
231 this->Buffer->GetBuffer()[id] =
value;
239 int GetNumberOfElementComponents() {
return 0; }
296 #endif // __VTK_WRAP__
324 ValueType* array,
vtkIdType size,
int save,
int deleteMethod = VTK_DATA_ARRAY_DELETE);
327 this->SetArray(static_cast<ValueType*>(array), size, save);
331 this->SetArray(static_cast<ValueType*>(array), size, save, deleteMethod);
376 vtkIdType LookupValue(const ValueType& value);
377 void LookupValue(const ValueType& value,
vtkIdList* ids);
379 vtkIdType LookupValue(const
char* value);
380 void LookupValue(const
char* value,
vtkIdList* ids);
390 void DataChanged() override;
398 virtual
void DataElementChanged(
vtkIdType id);
405 void ClearLookup() override;
409 ~vtkStringArray() override;
414 bool ReallocateTuples(
vtkIdType numTuples);
419 bool EnsureAccessToTuple(
vtkIdType tupleIdx);
430 return this->Buffer->GetBuffer();
437 vtkStringArrayLookup* Lookup;
444 VTK_ABI_NAMESPACE_END
Wrapper around std::string to keep symbols short.
virtual void InsertTuplesStartingAt(vtkIdType dstStart, vtkIdList *srcIds, vtkAbstractArray *source)=0
Copy the tuples indexed in srcIds from the source array to the tuple locations starting at index dstS...
virtual void DataChanged()=0
Tell the array explicitly that the data has changed.
virtual void DeepCopy(vtkAbstractArray *da)
Deep copy of data.
int GetNumberOfComponents() const
Set/Get the dimension (n) of the components.
virtual void GetTuples(vtkIdList *tupleIds, vtkAbstractArray *output)
Given a list of tuple ids, return an array of tuples.
Abstract superclass for all arrays.
int GetArrayType() const override
Return the array type.
virtual bool CopyComponent(int dstComponent, vtkAbstractArray *src, int srcComponent)=0
Copy a component from one array into a component on this array.
virtual vtkTypeBool ReserveTuples(vtkIdType numTuples)=0
Reserve the array to the requested number of tuples and preserve data.
a vtkAbstractArray subclass for strings
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...
int IsNumeric() const override
This method is here to make backward compatibility easier.
A type representing the union of many types.
int GetDataType() const override
Get the data type.
int GetElementComponentSize() const override
Return the size, in bytes, of the lowest-level element of an array.
vtkIdType GetNumberOfValues() const
Get the total number of values in the array.
virtual int GetDataTypeSize() const =0
Return the size of the underlying data type.
void * GetVoidPointer(vtkIdType id) override
Return a void pointer.
#define VTK_MARSHALMANUAL
virtual unsigned long GetActualMemorySize() const =0
Return the memory in kibibytes (1024 bytes) consumed by this data array.
a simple class to control print indentation
void save(Archiver &ar, const std::string &str, const unsigned int version)
vtkBuffer< ValueType > * GetBuffer()
Return the underlying buffer object.
list of point or cell ids
Abstract superclass to iterate over elements in an vtkAbstractArray.
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
vtkArrayDownCast_FastCastMacro(vtkStringArray)
virtual void InsertTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray *source)=0
Insert the tuple at srcTupleIdx in the source array into this array at dstTupleIdx.
std::integral_constant< int, VTK_OPAQUE > DataTypeTag
virtual vtkIdType InsertNextTuple(vtkIdType srcTupleIdx, vtkAbstractArray *source)=0
Insert the tuple from srcTupleIdx in the source array at the end of this 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...
Abstract base class for vtkBuffer providing buffer protocol support.
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...
StdString::value_type value_type
std::integral_constant< int, vtkArrayTypes::VTK_ABSTRACT_ARRAY > ArrayTypeTag
void SetVoidArray(void *array, vtkIdType size, int save, int deleteMethod) override
This method lets the user specify data to be held by the array.
virtual void Squeeze()=0
Free any unnecessary memory.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual void ShallowCopy(vtkAbstractArray *src)
This method will copy the data from the source array to this array.
#define VTK_DEPRECATED_IN_9_7_0(reason)
void SetVoidArray(void *array, vtkIdType size, int save) override
This method lets the user specify data to be held by the 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...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.