NAME
vtkCollection - create and manipulate unsorted lists of objects
SYNOPSIS
#include "/opt/vtk-c++/common/vtkCollection.h"
class VTK_EXPORT vtkCollection : public vtkObject
vtkCollection();
virtual ~vtkCollection();
void PrintSelf(ostream& os, vtkIndent indent);
static vtkCollection *New() {return new vtkCollection;};
const char *GetClassName() {return "vtkCollection";};
void AddItem(vtkObject *);
void ReplaceItem(int i, vtkObject *);
void RemoveItem(int i);
void RemoveItem(vtkObject *);
void RemoveAllItems();
int IsItemPresent(vtkObject *);
int GetNumberOfItems();
void InitTraversal();
vtkObject *GetNextItemAsObject();
vtkObject *GetItemAsObject(int i);
DESCRIPTION
vtkCollection is a general object for creating and manipulating lists of objects. The lists are unsorted and allow duplicate entries. vtkCollection also serves as a base class for lists of specific types of objects.
SEE ALSO
vtkActorCollection vtkAssemblyPaths vtkDataSetCollection vtkImplicitFunctionCollection vtkLightCollection vtkPolyDataCollection vtkRenderWindowCollection vtkRendererCollection
vtkStructuredPointsCollection vtkTransformCollection vtkVolumeCollection
SUMMARY
void InitTraversal()
Initialize the traversal of the collection. This means the data pointer is set at the beginning of the list.
vtkObject *GetNextItemAsObject()
Get the next item in the collection. NULL is returned if the collection is exhausted.
vtkCollection()
Construct with empty list.
void AddItem(vtkObject *a)
Add an object to the list. Does not prevent duplicate entries.
void RemoveItem(vtkObject *a)
Remove an object from the list. Removes the first object found, not all occurrences. If no object found, list is unaffected. See warning in description of RemoveItem(int).
void RemoveAllItems()
Remove all objects from the list.
int IsItemPresent(vtkObject *a)
Search for an object and return location in list. If location == 0, object was not found.
int GetNumberOfItems()
Return the number of objects in the list.
vtkObject *GetItemAsObject(int i)
Get the i'th item in the collection. NULL is returned if i is out of range
void ReplaceItem(int i, vtkObject *a)
Replace the i'th item in the collection with a
void RemoveItem(int i)
Remove the i'th item in the list. Be careful if using this function during traversal of the list using GetNextItemAsObject (or GetNextItem in derived class).
The list WILL be shortened if a valid index is given! If this->Current is equal to the element being removed, have it point to then next element in the list.