VTK  9.1.0
vtkUnicodeStringArray.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkUnicodeStringArray.h
5
6-------------------------------------------------------------------------
7 Copyright 2008 Sandia Corporation.
8 Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9 the U.S. Government retains certain rights in this software.
10-------------------------------------------------------------------------
11
12 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
13 All rights reserved.
14 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
15
16 This software is distributed WITHOUT ANY WARRANTY; without even
17 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
18 PURPOSE. See the above copyright notice for more information.
19
20=========================================================================*/
21
32#ifndef vtkUnicodeStringArray_h
33#define vtkUnicodeStringArray_h
34
35#include "vtkAbstractArray.h"
36#include "vtkCommonCoreModule.h" // For export macro
37#include "vtkUnicodeString.h" // For value type
38
40 "Use vtkStringArray instead.") VTKCOMMONCORE_EXPORT vtkUnicodeStringArray
41 : public vtkAbstractArray
42{
43public:
47 void PrintSelf(ostream& os, vtkIndent indent) override;
48
49 vtkTypeBool Allocate(vtkIdType sz, vtkIdType ext = 1000) override;
50 void Initialize() override;
51 int GetDataType() const override;
52 int GetDataTypeSize() const override;
53 int GetElementComponentSize() const override;
54 void SetNumberOfTuples(vtkIdType number) override;
57 void InsertTuples(vtkIdList* dstIds, vtkIdList* srcIds, vtkAbstractArray* source) override;
59 vtkIdType dstStart, vtkIdType n, vtkIdType srcStart, vtkAbstractArray* source) override;
61 void* GetVoidPointer(vtkIdType id) override;
62 void DeepCopy(vtkAbstractArray* da) override;
64 vtkIdType i, vtkIdList* ptIndices, vtkAbstractArray* source, double* weights) override;
66 vtkAbstractArray* source2, double t) override;
67 void Squeeze() override;
68 vtkTypeBool Resize(vtkIdType numTuples) override;
69 void SetVoidArray(void* array, vtkIdType size, int save) override;
70 void SetVoidArray(void* array, vtkIdType size, int save, int deleteMethod) override;
71 void SetArrayFreeFunction(void (*callback)(void*)) override;
72 unsigned long GetActualMemorySize() const override; // in bytes
73 int IsNumeric() const override;
77 void LookupValue(vtkVariant value, vtkIdList* ids) override;
78
81 void DataChanged() override;
82 void ClearLookup() override;
83
85 void InsertValue(vtkIdType idx, const vtkUnicodeString&); // Ranged checked
86 void SetValue(vtkIdType i, const vtkUnicodeString&); // Not ranged checked
88
89 void InsertNextUTF8Value(const char*);
90 void SetUTF8Value(vtkIdType i, const char*);
91 const char* GetUTF8Value(vtkIdType i);
92
93protected:
96
97private:
99 void operator=(const vtkUnicodeStringArray&) = delete;
100
101 class Implementation;
102 Implementation* Internal;
103};
104
105#endif
106
107// VTK-HeaderTest-Exclude: vtkUnicodeStringArray.h
Abstract superclass for all arrays.
Abstract superclass to iterate over elements in an vtkAbstractArray.
list of point or cell ids
Definition: vtkIdList.h:140
a simple class to control print indentation
Definition: vtkIndent.h:113
a vtkAbstractArray subclass for strings
Subclass of vtkAbstractArray that holds vtkUnicodeStrings.
void SetVoidArray(void *array, vtkIdType size, int save) override
const char * GetUTF8Value(vtkIdType i)
void InsertValue(vtkIdType idx, const vtkUnicodeString &)
void SetValue(vtkIdType i, const vtkUnicodeString &)
void ClearLookup() override
Delete the associated fast lookup data structure on this array, if it exists.
static vtkUnicodeStringArray * ExtendedNew()
void SetNumberOfTuples(vtkIdType number) override
Set the number of tuples (a component group) in the array.
void SetVariantValue(vtkIdType idx, vtkVariant value) override
Set a value in the array from a variant.
void LookupValue(vtkVariant value, vtkIdList *ids) override
Return the value indices where a specific value appears.
vtkIdType InsertNextTuple(vtkIdType j, vtkAbstractArray *source) override
Insert the tuple from srcTupleIdx in the source array at the end of this array.
int GetElementComponentSize() const override
Return the size, in bytes, of the lowest-level element of an array.
void Initialize() override
Release storage and reset array to initial state.
void SetTuple(vtkIdType i, vtkIdType j, vtkAbstractArray *source) override
Set the tuple at dstTupleIdx in this array to the tuple at srcTupleIdx in the source array.
vtkArrayIterator * NewIterator() override
Subclasses must override this method and provide the right kind of templated vtkArrayIteratorTemplate...
vtkIdType InsertNextValue(const vtkUnicodeString &)
vtkUnicodeString & GetValue(vtkIdType i)
void * GetVoidPointer(vtkIdType id) override
Return a void pointer.
vtkVariant GetVariantValue(vtkIdType idx) override
Retrieve value from the array as a variant.
void Squeeze() override
Free any unnecessary memory.
vtkTypeBool Resize(vtkIdType numTuples) override
Resize the array to the requested number of tuples and preserve data.
int GetDataTypeSize() const override
Return the size of the underlying data type.
int GetDataType() const override
Return the underlying data type.
vtkTypeBool Allocate(vtkIdType sz, vtkIdType ext=1000) override
Allocate memory for this array.
void InsertTuple(vtkIdType i, vtkIdType j, vtkAbstractArray *source) override
Insert the tuple at srcTupleIdx in the source array into this array at dstTupleIdx.
void InsertTuples(vtkIdList *dstIds, vtkIdList *srcIds, vtkAbstractArray *source) override
Copy the tuples indexed in srcIds from the source array to the tuple locations indexed by dstIds in t...
void InterpolateTuple(vtkIdType i, 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 InsertVariantValue(vtkIdType idx, vtkVariant value) override
Insert a value into the array from a variant.
static vtkUnicodeStringArray * New()
~vtkUnicodeStringArray() override
int IsNumeric() const override
This method is here to make backward compatibility easier.
void DataChanged() override
Tell the array explicitly that the data has changed.
void SetUTF8Value(vtkIdType i, const char *)
void InterpolateTuple(vtkIdType i, vtkIdType id1, vtkAbstractArray *source1, vtkIdType id2, vtkAbstractArray *source2, double t) override
Insert the tuple at dstTupleIdx in this array to the tuple interpolated from the two tuple indices,...
unsigned long GetActualMemorySize() const override
Return the memory in kibibytes (1024 bytes) consumed by this data array.
vtkIdType LookupValue(vtkVariant value) override
Return the value indices where a specific value appears.
void SetArrayFreeFunction(void(*callback)(void *)) override
This method allows the user to specify a custom free function to be called when the array is dealloca...
void SetVoidArray(void *array, vtkIdType size, int save, int deleteMethod) override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void InsertTuples(vtkIdType dstStart, vtkIdType n, vtkIdType srcStart, vtkAbstractArray *source) override
Copy n consecutive tuples starting at srcStart from the source array to this array,...
void InsertNextUTF8Value(const char *)
void DeepCopy(vtkAbstractArray *da) override
Deep copy of data.
String class that stores Unicode text.
A atomic type representing the union of many types.
Definition: vtkVariant.h:145
@ value
Definition: vtkX3D.h:226
@ size
Definition: vtkX3D.h:259
int vtkTypeBool
Definition: vtkABI.h:69
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
#define VTK_DEPRECATED_IN_9_1_0(reason)
int vtkIdType
Definition: vtkType.h:332
void save(Archiver &ar, const std::string &str, const unsigned int vtkNotUsed(version))
#define VTK_NEWINSTANCE