VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends
vtkCollection Class Reference

create and manipulate unsorted lists of objects More...

#include <vtkCollection.h>

Inheritance diagram for vtkCollection:
Inheritance graph
[legend]
Collaboration diagram for vtkCollection:
Collaboration graph
[legend]

List of all members.

Public Types

typedef vtkObject Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkCollectionNewInstance () const
void PrintSelf (ostream &os, vtkIndent indent)
void AddItem (vtkObject *)
void InsertItem (int i, vtkObject *)
void ReplaceItem (int i, vtkObject *)
void RemoveItem (int i)
void RemoveItem (vtkObject *)
void RemoveAllItems ()
int IsItemPresent (vtkObject *a)
int GetNumberOfItems ()
void InitTraversal ()
vtkObjectGetNextItemAsObject ()
vtkObjectGetItemAsObject (int i)
vtkCollectionIteratorNewIterator ()
void InitTraversal (vtkCollectionSimpleIterator &cookie)
vtkObjectGetNextItemAsObject (vtkCollectionSimpleIterator &cookie)

Static Public Member Functions

static int IsTypeOf (const char *type)
static vtkCollectionSafeDownCast (vtkObjectBase *o)
static vtkCollectionNew ()

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
virtual void RemoveElement (vtkCollectionElement *element, vtkCollectionElement *previous)
virtual void DeleteElement (vtkCollectionElement *)
virtual void ReportReferences (vtkGarbageCollector *collector)

Protected Attributes

int NumberOfItems
vtkCollectionElementTop
vtkCollectionElementBottom
vtkCollectionElementCurrent

Friends

class vtkCollectionIterator
virtual void Register (vtkObjectBase *o)
virtual void UnRegister (vtkObjectBase *o)
 vtkCollection ()
 ~vtkCollection ()

Detailed Description

create and manipulate unsorted lists of objects

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
Tests:
vtkCollection (Tests)

Definition at line 52 of file vtkCollection.h.


Member Typedef Documentation


Constructor & Destructor Documentation

Participate in garbage collection.

Participate in garbage collection.


Member Function Documentation

static int vtkCollection::IsTypeOf ( const char *  name) [static]
virtual int vtkCollection::IsA ( const char *  name) [virtual]
virtual vtkObjectBase* vtkCollection::NewInstanceInternal ( ) const [protected, virtual]
void vtkCollection::PrintSelf ( ostream &  os,
vtkIndent  indent 
) [virtual]

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 vtkObject.

Reimplemented in vtkExecutiveCollection, vtkAssemblyPath, vtkLightCollection, vtkRenderPassCollection, vtkProp3DCollection, vtkActorCollection, vtkMapperCollection, vtkVolumeCollection, vtkShader2Collection, vtkPolyDataCollection, vtkCullerCollection, vtkRendererCollection, vtkRenderWindowCollection, vtkImageReader2Collection, vtkStructuredPointsCollection, and vtkSocketCollection.

static vtkCollection* vtkCollection::New ( ) [static]

Add an object to the list. Does not prevent duplicate entries.

void vtkCollection::InsertItem ( int  i,
vtkObject  
)

Insert item into the list after the i'th item. Does not prevent duplicate entries. If i < 0 the item is placed at the top of the list.

Replace the i'th item in the collection with a

Reimplemented in vtkSocketCollection.

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.

Reimplemented in vtkSocketCollection.

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).

Reimplemented in vtkSocketCollection.

Remove all objects from the list.

Reimplemented in vtkSocketCollection.

Search for an object and return location in list. If the return value is 0, the object was not found. If the object was found, the location is the return value-1.

Return the number of objects in the list.

Definition at line 93 of file vtkCollection.h.

void vtkCollection::InitTraversal ( ) [inline]

Initialize the traversal of the collection. This means the data pointer is set at the beginning of the list.

Definition at line 97 of file vtkCollection.h.

A reentrant safe way to iterate through a collection. Just pass the same cookie value around each time

Definition at line 103 of file vtkCollection.h.

Get the next item in the collection. NULL is returned if the collection is exhausted.

Definition at line 156 of file vtkCollection.h.

Get the i'th item in the collection. NULL is returned if i is out of range

A reentrant safe way to get the next object as a collection. Just pass the same cookie back and forth.

Definition at line 171 of file vtkCollection.h.

Get an iterator to traverse the objects in this collection.

virtual void vtkCollection::Register ( vtkObjectBase o) [virtual]

Participate in garbage collection.

Reimplemented from vtkObjectBase.

virtual void vtkCollection::UnRegister ( vtkObjectBase o) [virtual]

Participate in garbage collection.

Reimplemented from vtkObjectBase.

virtual void vtkCollection::RemoveElement ( vtkCollectionElement element,
vtkCollectionElement previous 
) [protected, virtual]
virtual void vtkCollection::DeleteElement ( vtkCollectionElement ) [protected, virtual]
virtual void vtkCollection::ReportReferences ( vtkGarbageCollector collector) [protected, virtual]

Reimplemented from vtkObjectBase.


Friends And Related Function Documentation

friend class vtkCollectionIterator [friend]

Definition at line 145 of file vtkCollection.h.


Member Data Documentation

Definition at line 139 of file vtkCollection.h.

Definition at line 140 of file vtkCollection.h.

Definition at line 141 of file vtkCollection.h.

Definition at line 142 of file vtkCollection.h.


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