VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkStringArray Class Reference

a vtkAbstractArray subclass for strings More...

#include <vtkStringArray.h>

Inheritance diagram for vtkStringArray:
[legend]
Collaboration diagram for vtkStringArray:
[legend]

Public Types

typedef vtkAbstractArray Superclass
 
- Public Types inherited from vtkAbstractArray
enum  DeleteMethod { VTK_DATA_ARRAY_FREE, VTK_DATA_ARRAY_DELETE }
 
enum  { MAX_DISCRETE_VALUES = 32 }
 
enum  {
  AbstractArray = 0, DataArray, AoSDataArrayTemplate, SoADataArrayTemplate,
  TypedDataArray, MappedDataArray, DataArrayTemplate = AoSDataArrayTemplate
}
 
typedef vtkObject Superclass
 

Public Member Functions

virtual int IsA (const char *type)
 Return 1 if this class is the same type of (or a subclass of) the named class. More...
 
vtkStringArrayNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses. More...
 
int GetDataType () override
 Get the data type. More...
 
int IsNumeric () override
 This method is here to make backward compatibility easier. More...
 
void Initialize () override
 Release storage and reset array to initial state. More...
 
int GetDataTypeSize () override
 Return the size of the data type. More...
 
void Squeeze () override
 Free any unnecessary memory. More...
 
int Resize (vtkIdType numTuples) override
 Resize the array while conserving the data. More...
 
void SetTuple (vtkIdType i, vtkIdType j, vtkAbstractArray *source) override
 Set the tuple at the ith location using the jth tuple in the source array. More...
 
void InsertTuple (vtkIdType i, vtkIdType j, vtkAbstractArray *source) override
 Insert the jth tuple in the source array, at ith location in this array. More...
 
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 this array. More...
 
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, starting at the dstStart location. More...
 
vtkIdType InsertNextTuple (vtkIdType j, vtkAbstractArray *source) override
 Insert the jth tuple in the source array, at the end in this array. More...
 
void InterpolateTuple (vtkIdType i, vtkIdList *ptIndices, vtkAbstractArray *source, double *weights) override
 Set the ith tuple in this array as the interpolated tuple value, given the ptIndices in the source array and associated interpolation weights. More...
 
void InterpolateTuple (vtkIdType i, vtkIdType id1, vtkAbstractArray *source1, vtkIdType id2, vtkAbstractArray *source2, double t) override
 Insert the ith tuple in this array as interpolated from the two values, p1 and p2, and an interpolation factor, t. More...
 
void GetTuples (vtkIdList *ptIds, vtkAbstractArray *output) override
 Given a list of indices, return an array of values. More...
 
void GetTuples (vtkIdType p1, vtkIdType p2, vtkAbstractArray *output) override
 Get the values for the range of indices specified (i.e., p1->p2 inclusive). More...
 
int Allocate (vtkIdType sz, vtkIdType ext=1000) override
 Allocate memory for this array. More...
 
vtkStdStringGetValue (vtkIdType id)
 Get the data at a particular index. More...
 
void SetValue (vtkIdType id, vtkStdString value)
 Set the data at a particular index. More...
 
void SetValue (vtkIdType id, const char *value)
 
void SetNumberOfTuples (vtkIdType number) override
 Set the number of tuples (a component group) in the array. More...
 
void SetNumberOfValues (vtkIdType number) override
 Specify the number of values for this object to hold. More...
 
vtkIdType GetNumberOfValues ()
 
int GetNumberOfElementComponents ()
 
int GetElementComponentSize () override
 Return the size, in bytes, of the lowest-level element of an array. More...
 
void InsertValue (vtkIdType id, vtkStdString f)
 Insert data at a specified position in the array. More...
 
void InsertValue (vtkIdType id, const char *val)
 
void SetVariantValue (vtkIdType idx, vtkVariant value) override
 Set a value in the array form a variant. More...
 
void InsertVariantValue (vtkIdType idx, vtkVariant value) override
 Safely set a value in the array form a variant. More...
 
vtkIdType InsertNextValue (vtkStdString f)
 Insert data at the end of the array. More...
 
vtkIdType InsertNextValue (const char *f)
 
vtkStdStringWritePointer (vtkIdType id, vtkIdType number)
 Get the address of a particular data index. More...
 
vtkStdStringGetPointer (vtkIdType id)
 Get the address of a particular data index. More...
 
void * GetVoidPointer (vtkIdType id) override
 Return a void pointer. More...
 
void DeepCopy (vtkAbstractArray *aa) override
 Deep copy of another string array. More...
 
void SetArray (vtkStdString *array, vtkIdType size, int save)
 This method lets the user specify data to be held by the array. More...
 
void SetVoidArray (void *array, vtkIdType size, int save) override
 
void SetVoidArray (void *array, vtkIdType size, int save, int vtkNotUsed(deleteMethod)) override
 This method lets the user specify data to be held by the array. More...
 
unsigned long GetActualMemorySize () override
 Return the memory in kibibytes (1024 bytes) consumed by this data array. More...
 
VTK_NEWINSTANCE vtkArrayIteratorNewIterator () override
 Returns a vtkArrayIteratorTemplate<vtkStdString>. More...
 
vtkIdType GetDataSize () override
 Returns the size of the data in DataTypeSize units. More...
 
vtkIdType LookupValue (vtkStdString value)
 
void LookupValue (vtkStdString value, vtkIdList *ids)
 
vtkIdType LookupValue (const char *value)
 
void LookupValue (const char *value, vtkIdList *ids)
 
void DataChanged () override
 Tell the array explicitly that the data has changed. More...
 
virtual void DataElementChanged (vtkIdType id)
 Tell the array explicitly that a single data element has changed. More...
 
void ClearLookup () override
 Delete the associated fast lookup data structure on this array, if it exists. More...
 
vtkIdType LookupValue (vtkVariant value) override
 Return the indices where a specific value appears. More...
 
void LookupValue (vtkVariant value, vtkIdList *ids) override
 Return the indices where a specific value appears. More...
 
- Public Member Functions inherited from vtkAbstractArray
vtkAbstractArrayNewInstance () const
 
void SetComponentName (vtkIdType component, const char *name)
 Set the name for a component. More...
 
const char * GetComponentName (vtkIdType component)
 Get the component name for a given component. More...
 
bool HasAComponentName ()
 Returns if any component has had a name assigned. More...
 
int CopyComponentNames (vtkAbstractArray *da)
 Copies the component names from the inputed array to the current array make sure that the current array has the same number of components as the input array. More...
 
vtkIdType GetNumberOfTuples ()
 Get the number of complete tuples (a component group) in the array. More...
 
vtkIdType GetNumberOfValues () const
 Get the total number of values in the array. More...
 
virtual bool HasStandardMemoryLayout ()
 Returns true if this array uses the standard memory layout defined in the VTK user guide, e.g. More...
 
vtkIdType GetSize ()
 Return the size of the data. More...
 
vtkIdType GetMaxId ()
 What is the maximum id currently in the array. More...
 
virtual void ExportToVoidPointer (void *out_ptr)
 This method copies the array data to the void pointer specified by the user. More...
 
virtual const char * GetDataTypeAsString (void)
 Get the name of a data type as a string. More...
 
virtual vtkVariant GetVariantValue (vtkIdType valueIdx)
 Retrieve value from the array as a variant. More...
 
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 (or, when passed -1, by the tuples as a whole). More...
 
vtkInformationGetInformation ()
 Get an information object that can be used to annotate the array. More...
 
bool HasInformation ()
 Inquire if this array has an instance of vtkInformation already associated with it. More...
 
virtual int CopyInformation (vtkInformation *infoFrom, int deep=1)
 Copy information instance. More...
 
virtual int GetArrayType ()
 Method for type-checking in FastDownCast implementations. More...
 
virtual void SetNumberOfComponents (int)
 Set/Get the dimension (n) of the components. More...
 
int GetNumberOfComponents ()
 Set/Get the dimension (n) of the components. More...
 
void Reset ()
 Reset to an empty state, without freeing any memory. More...
 
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. More...
 
virtual void SetName (const char *)
 Set/get array's name. More...
 
virtual char * GetName ()
 Set/get array's name. More...
 
virtual unsigned int GetMaxDiscreteValues ()
 Get/Set the maximum number of prominent values this array may contain before it is considered continuous. More...
 
virtual void SetMaxDiscreteValues (unsigned int)
 Get/Set the maximum number of prominent values this array may contain before it is considered continuous. More...
 
- Public Member Functions inherited from vtkObject
 vtkBaseTypeMacro (vtkObject, vtkObjectBase)
 
virtual void DebugOn ()
 Turn debugging output on. More...
 
virtual void DebugOff ()
 Turn debugging output off. More...
 
bool GetDebug ()
 Get the value of the debug flag. More...
 
void SetDebug (bool debugFlag)
 Set the value of the debug flag. More...
 
virtual void Modified ()
 Update the modification time for this object. More...
 
virtual vtkMTimeType GetMTime ()
 Return this object's modified time. More...
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
int HasObserver (unsigned long event)
 
int HasObserver (const char *event)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
vtkCommandGetCommand (unsigned long tag)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObserver (vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObservers (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObservers (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
int HasObserver (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
int HasObserver (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 Overloads to AddObserver that allow developers to add class member functions as callbacks for events. More...
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 Overloads to AddObserver that allow developers to add class member functions as callbacks for events. More...
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 Allow user to set the AbortFlagOn() with the return value of the callback method. More...
 
int InvokeEvent (unsigned long event, void *callData)
 This method invokes an event and return whether the event was aborted or not. More...
 
int InvokeEvent (const char *event, void *callData)
 This method invokes an event and return whether the event was aborted or not. More...
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 Return the class name as a string. More...
 
virtual void Delete ()
 Delete a VTK object. More...
 
virtual void FastDelete ()
 Delete a reference to this object. More...
 
void InitializeObjectBase ()
 
void Print (ostream &os)
 Print an object to an ostream. More...
 
virtual void Register (vtkObjectBase *o)
 Increase the reference count (mark as used by another object). More...
 
virtual void UnRegister (vtkObjectBase *o)
 Decrease the reference count (release by another object). More...
 
int GetReferenceCount ()
 Return the current reference count of this object. More...
 
void SetReferenceCount (int)
 Sets the reference count. More...
 
void PrintRevisions (ostream &)
 Legacy. More...
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses. More...
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses. More...
 

Static Public Member Functions

static vtkStringArrayNew ()
 
static int IsTypeOf (const char *type)
 
static vtkStringArraySafeDownCast (vtkObjectBase *o)
 
- Static Public Member Functions inherited from vtkAbstractArray
static int IsTypeOf (const char *type)
 
static vtkAbstractArraySafeDownCast (vtkObjectBase *o)
 
static VTK_NEWINSTANCE vtkAbstractArrayCreateArray (int dataType)
 Creates an array for dataType where dataType is one of VTK_BIT, VTK_CHAR, VTK_UNSIGNED_CHAR, VTK_SHORT, VTK_UNSIGNED_SHORT, VTK_INT, VTK_UNSIGNED_INT, VTK_LONG, VTK_UNSIGNED_LONG, VTK_DOUBLE, VTK_DOUBLE, VTK_ID_TYPE, VTK_STRING. More...
 
static vtkInformationIntegerKeyGUI_HIDE ()
 This key is a hint to end user interface that this array is internal and should not be shown to the end user. More...
 
static vtkInformationInformationVectorKeyPER_COMPONENT ()
 This key is used to hold a vector of COMPONENT_VALUES (and, for vtkDataArray subclasses, COMPONENT_RANGE) keys – one for each component of the array. More...
 
static vtkInformationVariantVectorKeyDISCRETE_VALUES ()
 A key used to hold discrete values taken on either by the tuples of the array (when present in this->GetInformation()) or individual components (when present in one entry of the PER_COMPONENT() information vector). More...
 
static vtkInformationDoubleVectorKeyDISCRETE_VALUE_SAMPLE_PARAMETERS ()
 A key used to hold conditions under which cached discrete values were generated; the value is a 2-vector of doubles. More...
 
static int GetDataTypeSize (int type)
 Return the size of the underlying data type. More...
 
- Static Public Member Functions inherited from vtkObject
static vtkObjectNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More...
 
static void BreakOnError ()
 This method is called when vtkErrorMacro executes. More...
 
static void SetGlobalWarningDisplay (int val)
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static void GlobalWarningDisplayOn ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static void GlobalWarningDisplayOff ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static int GetGlobalWarningDisplay ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
- Static Public Member Functions inherited from vtkObjectBase
static vtkTypeBool IsTypeOf (const char *name)
 Return 1 if this class type is the same type of (or a subclass of) the named class. More...
 
static vtkObjectBaseNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More...
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkStringArray ()
 
 ~vtkStringArray () override
 
vtkStdStringResizeAndExtend (vtkIdType sz)
 
- Protected Member Functions inherited from vtkAbstractArray
 vtkAbstractArray ()
 
 ~vtkAbstractArray () override
 
virtual void SetInformation (vtkInformation *)
 Set an information object that can be used to annotate the array. More...
 
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 the array. More...
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
 ~vtkObject () override
 
void RegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 These methods allow a command to exclusively grab all events. More...
 
void InternalReleaseFocus ()
 These methods allow a command to exclusively grab all events. More...
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void CollectRevisions (ostream &)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Protected Attributes

vtkStdStringArray
 
int SaveUserArray
 
- Protected Attributes inherited from vtkAbstractArray
vtkIdType Size
 
vtkIdType MaxId
 
int NumberOfComponents
 
unsigned int MaxDiscreteValues
 
char * Name
 
bool RebuildArray
 
vtkInformationInformation
 
vtkInternalComponentNames * ComponentNames
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Detailed Description

a vtkAbstractArray subclass for strings

Points and cells may sometimes have associated data that are stored as strings, e.g. labels for information visualization projects. This class provides a clean way to store and access those strings.

Thanks:
Andy Wilson (atwil.nosp@m.so@s.nosp@m.andia.nosp@m..gov) wrote this class.
Examples:
vtkStringArray (Examples)
Tests:
vtkStringArray (Tests)

Definition at line 42 of file vtkStringArray.h.

Member Typedef Documentation

Definition at line 46 of file vtkStringArray.h.

Constructor & Destructor Documentation

vtkStringArray::vtkStringArray ( )
protected
vtkStringArray::~vtkStringArray ( )
overrideprotected

Member Function Documentation

static vtkStringArray* vtkStringArray::New ( )
static
static int vtkStringArray::IsTypeOf ( const char *  type)
static
virtual int vtkStringArray::IsA ( const char *  name)
virtual

Return 1 if this class is the same type of (or a subclass of) the named class.

Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkAbstractArray.

static vtkStringArray* vtkStringArray::SafeDownCast ( vtkObjectBase o)
static
virtual vtkObjectBase* vtkStringArray::NewInstanceInternal ( ) const
protectedvirtual

Reimplemented from vtkAbstractArray.

vtkStringArray* vtkStringArray::NewInstance ( ) const
void vtkStringArray::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
overridevirtual

Methods invoked by print to print information about the object including superclasses.

Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkAbstractArray.

int vtkStringArray::GetDataType ( )
inlineoverridevirtual

Get the data type.

Implements vtkAbstractArray.

Definition at line 58 of file vtkStringArray.h.

int vtkStringArray::IsNumeric ( )
inlineoverridevirtual

This method is here to make backward compatibility easier.

It must return true if and only if an array contains numeric data.

Implements vtkAbstractArray.

Definition at line 61 of file vtkStringArray.h.

void vtkStringArray::Initialize ( )
overridevirtual

Release storage and reset array to initial state.

Implements vtkAbstractArray.

int vtkStringArray::GetDataTypeSize ( )
overridevirtual

Return the size of the data type.

WARNING: This may not mean what you expect with strings. It will return sizeof(std::string) and not take into account the data included in any particular string.

Implements vtkAbstractArray.

void vtkStringArray::Squeeze ( )
inlineoverridevirtual

Free any unnecessary memory.

Resize object to just fit data requirement. Reclaims extra memory.

Implements vtkAbstractArray.

Definition at line 80 of file vtkStringArray.h.

int vtkStringArray::Resize ( vtkIdType  numTuples)
overridevirtual

Resize the array while conserving the data.

Implements vtkAbstractArray.

void vtkStringArray::SetTuple ( vtkIdType  i,
vtkIdType  j,
vtkAbstractArray source 
)
overridevirtual

Set the tuple at the ith location using the jth tuple in the source array.

This method assumes that the two arrays have the same type and structure. Note that range checking and memory allocation is not performed; use in conjunction with SetNumberOfTuples() to allocate space.

Implements vtkAbstractArray.

void vtkStringArray::InsertTuple ( vtkIdType  i,
vtkIdType  j,
vtkAbstractArray source 
)
overridevirtual

Insert the jth tuple in the source array, at ith location in this array.

Note that memory allocation is performed as necessary to hold the data.

Implements vtkAbstractArray.

void vtkStringArray::InsertTuples ( vtkIdList dstIds,
vtkIdList srcIds,
vtkAbstractArray source 
)
overridevirtual

Copy the tuples indexed in srcIds from the source array to the tuple locations indexed by dstIds in this array.

Note that memory allocation is performed as necessary to hold the data.

Implements vtkAbstractArray.

void vtkStringArray::InsertTuples ( vtkIdType  dstStart,
vtkIdType  n,
vtkIdType  srcStart,
vtkAbstractArray source 
)
overridevirtual

Copy n consecutive tuples starting at srcStart from the source array to this array, starting at the dstStart location.

Note that memory allocation is performed as necessary to hold the data.

Implements vtkAbstractArray.

vtkIdType vtkStringArray::InsertNextTuple ( vtkIdType  j,
vtkAbstractArray source 
)
overridevirtual

Insert the jth tuple in the source array, at the end in this array.

Note that memory allocation is performed as necessary to hold the data. Returns the location at which the data was inserted.

Implements vtkAbstractArray.

void vtkStringArray::InterpolateTuple ( vtkIdType  i,
vtkIdList ptIndices,
vtkAbstractArray source,
double weights 
)
overridevirtual

Set the ith tuple in this array as the interpolated tuple value, given the ptIndices in the source array and associated interpolation weights.

This method assumes that the two arrays are of the same type and strcuture.

Implements vtkAbstractArray.

void vtkStringArray::InterpolateTuple ( vtkIdType  i,
vtkIdType  id1,
vtkAbstractArray source1,
vtkIdType  id2,
vtkAbstractArray source2,
double  t 
)
overridevirtual

Insert the ith tuple in this array as interpolated from the two values, p1 and p2, and an interpolation factor, t.

The interpolation factor ranges from (0,1), with t=0 located at p1. This method assumes that the three arrays are of the same type. p1 is value at index id1 in source1, while, p2 is value at index id2 in source2.

Implements vtkAbstractArray.

void vtkStringArray::GetTuples ( vtkIdList ptIds,
vtkAbstractArray output 
)
overridevirtual

Given a list of indices, return an array of values.

You must insure that the output array has been previously allocated with enough space to hold the data and that the types match sufficiently to allow conversion (if necessary).

Reimplemented from vtkAbstractArray.

void vtkStringArray::GetTuples ( vtkIdType  p1,
vtkIdType  p2,
vtkAbstractArray output 
)
overridevirtual

Get the values for the range of indices specified (i.e., p1->p2 inclusive).

You must insure that the output array has been previously allocated with enough space to hold the data and that the type of the output array is compatible with the type of this array.

Reimplemented from vtkAbstractArray.

int vtkStringArray::Allocate ( vtkIdType  sz,
vtkIdType  ext = 1000 
)
overridevirtual

Allocate memory for this array.

Delete old storage only if necessary. Note that ext is no longer used.

Implements vtkAbstractArray.

vtkStdString& vtkStringArray::GetValue ( vtkIdType  id)

Get the data at a particular index.

void vtkStringArray::SetValue ( vtkIdType  id,
vtkStdString  value 
)
inline

Set the data at a particular index.

Does not do range checking. Make sure you use the method SetNumberOfValues() before inserting data.

Definition at line 178 of file vtkStringArray.h.

void vtkStringArray::SetValue ( vtkIdType  id,
const char *  value 
)
void vtkStringArray::SetNumberOfTuples ( vtkIdType  number)
inlineoverridevirtual

Set the number of tuples (a component group) in the array.

Note that this may allocate space depending on the number of components.

Implements vtkAbstractArray.

Definition at line 187 of file vtkStringArray.h.

void vtkStringArray::SetNumberOfValues ( vtkIdType  number)
overridevirtual

Specify the number of values for this object to hold.

Does an allocation as well as setting the MaxId ivar. Used in conjunction with SetValue() method for fast insertion.

Reimplemented from vtkAbstractArray.

vtkIdType vtkStringArray::GetNumberOfValues ( )
inline

Definition at line 197 of file vtkStringArray.h.

int vtkStringArray::GetNumberOfElementComponents ( )
inline

Definition at line 199 of file vtkStringArray.h.

int vtkStringArray::GetElementComponentSize ( )
inlineoverridevirtual

Return the size, in bytes, of the lowest-level element of an array.

For vtkDataArray and subclasses this is the size of the data type. For vtkStringArray, this is sizeof(vtkStdString::value_type), which winds up being sizeof(char).

Implements vtkAbstractArray.

Definition at line 200 of file vtkStringArray.h.

void vtkStringArray::InsertValue ( vtkIdType  id,
vtkStdString  f 
)

Insert data at a specified position in the array.

void vtkStringArray::InsertValue ( vtkIdType  id,
const char *  val 
)
void vtkStringArray::SetVariantValue ( vtkIdType  idx,
vtkVariant  value 
)
overridevirtual

Set a value in the array form a variant.

Insert a value into the array from a variant.

Implements vtkAbstractArray.

void vtkStringArray::InsertVariantValue ( vtkIdType  idx,
vtkVariant  value 
)
overridevirtual

Safely set a value in the array form a variant.

Safely insert a value into the array from a variant.

Implements vtkAbstractArray.

vtkIdType vtkStringArray::InsertNextValue ( vtkStdString  f)

Insert data at the end of the array.

Return its location in the array.

vtkIdType vtkStringArray::InsertNextValue ( const char *  f)
vtkStdString* vtkStringArray::WritePointer ( vtkIdType  id,
vtkIdType  number 
)

Get the address of a particular data index.

Make sure data is allocated for the number of items requested. Set MaxId according to the number of data values requested.

vtkStdString* vtkStringArray::GetPointer ( vtkIdType  id)
inline

Get the address of a particular data index.

Performs no checks to verify that the memory has been allocated etc.

Definition at line 239 of file vtkStringArray.h.

void* vtkStringArray::GetVoidPointer ( vtkIdType  valueIdx)
inlineoverridevirtual

Return a void pointer.

For image pipeline interface and other special pointer manipulation. Use of this method is discouraged, as newer arrays require a deep-copy of the array data in order to return a suitable pointer. See vtkArrayDispatch for a safer alternative for fast data access.

Implements vtkAbstractArray.

Definition at line 240 of file vtkStringArray.h.

void vtkStringArray::DeepCopy ( vtkAbstractArray aa)
overridevirtual

Deep copy of another string array.

Will complain and change nothing if the array passed in is not a vtkStringArray.

Reimplemented from vtkAbstractArray.

void vtkStringArray::SetArray ( vtkStdString array,
vtkIdType  size,
int  save 
)

This method lets the user specify data to be held by the array.

The array argument is a pointer to the data. size is the size of the array supplied by the user. Set save to 1 to keep the class from deleting the array when it cleans up or reallocates memory. The class uses the actual array provided; it does not copy the data from the supplied array. If save is 0, then this class is free to delete the array when it cleans up or reallocates. In that case, it is required that the array was allocated using the C++ new operator (and not malloc).

void vtkStringArray::SetVoidArray ( void *  array,
vtkIdType  size,
int  save 
)
inlineoverride

Definition at line 259 of file vtkStringArray.h.

void vtkStringArray::SetVoidArray ( void *  array,
vtkIdType  size,
int  save,
int   vtkNotUseddeleteMethod 
)
inlineoverridevirtual

This method lets the user specify data to be held by the array.

The array argument is a pointer to the data. size is the size of the array supplied by the user. Set save to 1 to keep the class from deleting the array when it cleans up or reallocates memory. The class uses the actual array provided; it does not copy the data from the supplied array. If specified, the delete method determines how the data array will be deallocated. If the delete method is VTK_DATA_ARRAY_FREE, free() will be used. If the delete method is DELETE, delete[] will be used. The default is FREE. (Note not all subclasses can support deleteMethod.)

Reimplemented from vtkAbstractArray.

Definition at line 261 of file vtkStringArray.h.

unsigned long vtkStringArray::GetActualMemorySize ( )
overridevirtual

Return the memory in kibibytes (1024 bytes) consumed by this data array.

Used to support streaming and reading/writing data. The value returned is guaranteed to be greater than or equal to the memory required to actually represent the data represented by this object. The information returned is valid only after the pipeline has been updated.

This function takes into account the size of the contents of the strings as well as the string containers themselves.

Implements vtkAbstractArray.

VTK_NEWINSTANCE vtkArrayIterator* vtkStringArray::NewIterator ( )
overridevirtual

Returns a vtkArrayIteratorTemplate<vtkStdString>.

Implements vtkAbstractArray.

vtkIdType vtkStringArray::GetDataSize ( )
overridevirtual

Returns the size of the data in DataTypeSize units.

Thus, the number of bytes for the data can be computed by GetDataSize() * GetDataTypeSize(). The size computation includes the string termination character for each string.

Reimplemented from vtkAbstractArray.

vtkIdType vtkStringArray::LookupValue ( vtkVariant  value)
overridevirtual

Return the indices where a specific value appears.

Implements vtkAbstractArray.

void vtkStringArray::LookupValue ( vtkVariant  value,
vtkIdList ids 
)
overridevirtual

Return the indices where a specific value appears.

Implements vtkAbstractArray.

vtkIdType vtkStringArray::LookupValue ( vtkStdString  value)
void vtkStringArray::LookupValue ( vtkStdString  value,
vtkIdList ids 
)
vtkIdType vtkStringArray::LookupValue ( const char *  value)
void vtkStringArray::LookupValue ( const char *  value,
vtkIdList ids 
)
void vtkStringArray::DataChanged ( )
overridevirtual

Tell the array explicitly that the data has changed.

This is only necessary to call when you modify the array contents without using the array's API (i.e. you retrieve a pointer to the data and modify the array contents). You need to call this so that the fast lookup will know to rebuild itself. Otherwise, the lookup functions will give incorrect results.

Implements vtkAbstractArray.

virtual void vtkStringArray::DataElementChanged ( vtkIdType  id)
virtual

Tell the array explicitly that a single data element has changed.

Like DataChanged(), then is only necessary when you modify the array contents without using the array's API.

void vtkStringArray::ClearLookup ( )
overridevirtual

Delete the associated fast lookup data structure on this array, if it exists.

The lookup will be rebuilt on the next call to a lookup function.

Implements vtkAbstractArray.

vtkStdString* vtkStringArray::ResizeAndExtend ( vtkIdType  sz)
protected

Member Data Documentation

vtkStdString* vtkStringArray::Array
protected

Definition at line 332 of file vtkStringArray.h.

int vtkStringArray::SaveUserArray
protected

Definition at line 335 of file vtkStringArray.h.


The documentation for this class was generated from the following file: