|
VTK
9.6.20251229
|
create and manipulate ordered lists of objects More...
#include <vtkCollection.h>
Public Types | |
| typedef vtkObject | Superclass |
Public Member Functions | |
| virtual vtkTypeBool | IsA (const char *type) |
| Return 1 if this class is the same type of (or a subclass of) the named class. | |
| vtkCollection * | NewInstance () const |
| void | PrintSelf (ostream &os, vtkIndent indent) override |
| Methods invoked by print to print information about the object including superclasses. | |
| void | AddItem (vtkObject *) |
| Add given item to the bottom (end) of the collection. | |
| void | InsertItem (int i, vtkObject *) |
| Insert given item into the collection after the i'th item. | |
| void | ReplaceItem (int i, vtkObject *) |
| Replace the i'th item in the collection with the given item. | |
| void | RemoveItem (int i) |
| Remove the i'th item in the collection. | |
| void | RemoveItem (vtkObject *) |
| Remove the first occurrence of the given item from the collection. | |
| void | RemoveAllItems () |
| Remove all items from the collection. | |
| int | IsItemPresent (vtkObject *a) VTK_FUTURE_CONST |
| Search for the given item and return the 1-based index of its first occurrence in the collection. | |
| int | IndexOfFirstOccurence (vtkObject *a) VTK_FUTURE_CONST |
| Just calls IndexOfFirstOccurrence. | |
| int | IndexOfFirstOccurrence (vtkObject *a) const |
| Search for the given item and return the 0-based index of its first occurrence in the collection. | |
| int | GetNumberOfItems () VTK_FUTURE_CONST |
| Return the number of items in the collection. | |
| vtkObject * | GetItemAsObject (int i) VTK_FUTURE_CONST |
| Get the i'th item in the collection. | |
| void | InitTraversal () |
| Initialize the traversal of the collection. | |
| void | InitTraversal (vtkCollectionSimpleIterator &cookie) |
| A reentrant safe way to iterate through a collection. | |
| vtkObject * | GetNextItemAsObject () |
| Get the next item in the collection. | |
| vtkObject * | GetNextItemAsObject (vtkCollectionSimpleIterator &cookie) VTK_FUTURE_CONST |
| A reentrant safe way to get the next item as a collection. | |
| vtkCollectionIterator * | NewIterator () |
| Get an iterator to traverse the items in this collection. | |
| bool | UsesGarbageCollector () const override |
| Participate in garbage collection. | |
Public Member Functions inherited from vtkObject | |
| vtkBaseTypeMacro (vtkObject, vtkObjectBase) | |
| virtual void | DebugOn () |
| Turn debugging output on. | |
| virtual void | DebugOff () |
| Turn debugging output off. | |
| bool | GetDebug () |
| Get the value of the debug flag. | |
| void | SetDebug (bool debugFlag) |
| Set the value of the debug flag. | |
| virtual void | Modified () |
| Update the modification time for this object. | |
| virtual vtkMTimeType | GetMTime () |
| Return this object's modified time. | |
| void | PrintSelf (ostream &os, vtkIndent indent) override |
| Methods invoked by print to print information about the object including superclasses. | |
| void | RemoveObserver (unsigned long tag) |
| void | RemoveObservers (unsigned long event) |
| void | RemoveObservers (const char *event) |
| void | RemoveAllObservers () |
| vtkTypeBool | HasObserver (unsigned long event) |
| vtkTypeBool | HasObserver (const char *event) |
| vtkTypeBool | InvokeEvent (unsigned long event) |
| vtkTypeBool | InvokeEvent (const char *event) |
| std::string | GetObjectDescription () const override |
| The object description printed in messages and PrintSelf output. | |
| unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
| Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
| unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
| Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
| vtkCommand * | GetCommand (unsigned long tag) |
| Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
| void | RemoveObserver (vtkCommand *) |
| Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
| void | RemoveObservers (unsigned long event, vtkCommand *) |
| Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
| void | RemoveObservers (const char *event, vtkCommand *) |
| Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
| vtkTypeBool | HasObserver (unsigned long event, vtkCommand *) |
| Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
| vtkTypeBool | HasObserver (const char *event, vtkCommand *) |
| Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
| 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. | |
| 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. | |
| 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. | |
| vtkTypeBool | InvokeEvent (unsigned long event, void *callData) |
| This method invokes an event and return whether the event was aborted or not. | |
| vtkTypeBool | InvokeEvent (const char *event, void *callData) |
| This method invokes an event and return whether the event was aborted or not. | |
| virtual void | SetObjectName (const std::string &objectName) |
| Set/get the name of this object for reporting purposes. | |
| virtual std::string | GetObjectName () const |
| Set/get the name of this object for reporting purposes. | |
Public Member Functions inherited from vtkObjectBase | |
| const char * | GetClassName () const |
| Return the class name as a string. | |
| virtual vtkIdType | GetNumberOfGenerationsFromBase (const char *name) |
| Given the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class). | |
| virtual void | Delete () |
| Delete a VTK object. | |
| virtual void | FastDelete () |
| Delete a reference to this object. | |
| void | InitializeObjectBase () |
| void | Print (ostream &os) |
| Print an object to an ostream. | |
| void | Register (vtkObjectBase *o) |
| Increase the reference count (mark as used by another object). | |
| virtual void | UnRegister (vtkObjectBase *o) |
| Decrease the reference count (release by another object). | |
| int | GetReferenceCount () |
| Return the current reference count of this object. | |
| void | SetReferenceCount (int) |
| Sets the reference count. | |
| bool | GetIsInMemkind () const |
| A local state flag that remembers whether this object lives in the normal or extended memory space. | |
| virtual void | PrintHeader (ostream &os, vtkIndent indent) |
| Methods invoked by print to print information about the object including superclasses. | |
| virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
| Methods invoked by print to print information about the object including superclasses. | |
Static Public Member Functions | |
| static vtkTypeBool | IsTypeOf (const char *type) |
| static vtkCollection * | SafeDownCast (vtkObjectBase *o) |
| static vtkCollection * | New () |
| Construct an empty collection. | |
Static Public Member Functions inherited from vtkObject | |
| static vtkObject * | New () |
| Create an object with Debug turned off, modified time initialized to zero, and reference counting on. | |
| static void | BreakOnError () |
| This method is called when vtkErrorMacro executes. | |
| static void | SetGlobalWarningDisplay (vtkTypeBool val) |
| This is a global flag that controls whether any debug, warning or error messages are displayed. | |
| static void | GlobalWarningDisplayOn () |
| This is a global flag that controls whether any debug, warning or error messages are displayed. | |
| static void | GlobalWarningDisplayOff () |
| This is a global flag that controls whether any debug, warning or error messages are displayed. | |
| static vtkTypeBool | GetGlobalWarningDisplay () |
| This is a global flag that controls whether any debug, warning or error messages are displayed. | |
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. | |
| static vtkIdType | GetNumberOfGenerationsFromBaseType (const char *name) |
| Given a the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class). | |
| static vtkObjectBase * | New () |
| Create an object with Debug turned off, modified time initialized to zero, and reference counting on. | |
| static void | SetMemkindDirectory (const char *directoryname) |
| The name of a directory, ideally mounted -o dax, to memory map an extended memory space within. | |
| static bool | GetUsingMemkind () |
| A global state flag that controls whether vtkObjects are constructed in the usual way (the default) or within the extended memory space. | |
Protected Member Functions | |
| virtual vtkObjectBase * | NewInstanceInternal () const |
| vtkCollection () | |
| ~vtkCollection () override | |
| virtual void | RemoveElement (vtkCollectionElement *element, vtkCollectionElement *previous) |
| virtual void | DeleteElement (vtkCollectionElement *) |
| void | ReportReferences (vtkGarbageCollector *collector) override |
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=nullptr) |
| These methods allow a command to exclusively grab all events. | |
| void | InternalReleaseFocus () |
| These methods allow a command to exclusively grab all events. | |
Protected Member Functions inherited from vtkObjectBase | |
| vtkObjectBase () | |
| virtual | ~vtkObjectBase () |
| vtkObjectBase (const vtkObjectBase &) | |
| void | operator= (const vtkObjectBase &) |
Protected Attributes | |
| int | NumberOfItems |
| vtkCollectionElement * | Top |
| vtkCollectionElement * | Bottom |
| vtkCollectionElement * | Current |
Protected Attributes inherited from vtkObject | |
| bool | Debug |
| vtkTimeStamp | MTime |
| vtkSubjectHelper * | SubjectHelper |
| std::string | ObjectName |
Protected Attributes inherited from vtkObjectBase | |
| std::atomic< int32_t > | ReferenceCount |
| vtkWeakPointerBase ** | WeakPointers |
Friends | |
| class | vtkCollectionIterator |
Additional Inherited Members | |
Static Protected Member Functions inherited from vtkObjectBase | |
| static vtkMallocingFunction | GetCurrentMallocFunction () |
| static vtkReallocingFunction | GetCurrentReallocFunction () |
| static vtkFreeingFunction | GetCurrentFreeFunction () |
| static vtkFreeingFunction | GetAlternateFreeFunction () |
create and manipulate ordered lists of objects
vtkCollection is a general object for creating and manipulating lists of objects. The lists are ordered and allow duplicate entries. vtkCollection also serves as a base class for lists of specific types of objects.
Definition at line 46 of file vtkCollection.h.
| typedef vtkObject vtkCollection::Superclass |
Definition at line 49 of file vtkCollection.h.
|
protected |
|
overrideprotected |
|
static |
|
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 vtkObjectBase.
Reimplemented in vtkActor2DCollection, vtkActorCollection, vtkAssemblyPath, vtkAssemblyPaths, vtkCullerCollection, vtkDataArrayCollection, vtkDataObjectCollection, vtkDataSetCollection, vtkIdListCollection, vtkImageReader2Collection, vtkImageSliceCollection, vtkImplicitFunctionCollection, vtkLightCollection, vtkMapperCollection, vtkObjectFactoryCollection, vtkOverrideInformationCollection, vtkPlaneCollection, vtkPolyDataCollection, vtkProp3DCollection, vtkPropCollection, vtkRendererCollection, vtkRenderPassCollection, vtkRenderWindowCollection, vtkSocketCollection, vtkStructuredPointsCollection, vtkTextPropertyCollection, vtkTransformCollection, and vtkVolumeCollection.
|
static |
|
protectedvirtual |
Reimplemented in vtkActor2DCollection, vtkActorCollection, vtkAssemblyPath, vtkAssemblyPaths, vtkCullerCollection, vtkDataArrayCollection, vtkDataObjectCollection, vtkDataSetCollection, vtkIdListCollection, vtkImageReader2Collection, vtkImageSliceCollection, vtkImplicitFunctionCollection, vtkLightCollection, vtkMapperCollection, vtkObjectFactoryCollection, vtkOverrideInformationCollection, vtkPlaneCollection, vtkPolyDataCollection, vtkProp3DCollection, vtkPropCollection, vtkRendererCollection, vtkRenderPassCollection, vtkRenderWindowCollection, vtkSocketCollection, vtkStructuredPointsCollection, vtkTextPropertyCollection, vtkTransformCollection, and vtkVolumeCollection.
| vtkCollection * vtkCollection::NewInstance | ( | ) | const |
|
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 vtkObjectBase.
Reimplemented in vtkCullerCollection, vtkDataArrayCollection, vtkDataObjectCollection, vtkDataSetCollection, vtkIdListCollection, vtkImageReader2Collection, vtkImageSliceCollection, vtkImplicitFunctionCollection, vtkLightCollection, vtkMapperCollection, vtkObjectFactoryCollection, vtkOverrideInformationCollection, vtkPlaneCollection, vtkPolyDataCollection, vtkProp3DCollection, vtkPropCollection, vtkRendererCollection, vtkRenderPassCollection, vtkRenderWindowCollection, vtkSocketCollection, vtkStructuredPointsCollection, vtkTextPropertyCollection, vtkTransformCollection, and vtkVolumeCollection.
|
static |
Construct an empty collection.
| void vtkCollection::AddItem | ( | vtkObject * | ) |
Add given item to the bottom (end) of the collection.
Does not prevent duplicate entries. Given item must not be nullptr.
Note: it is undefined behaviour to invoke this during traversal of the collection.
| void vtkCollection::InsertItem | ( | int | i, |
| vtkObject * | ) |
Insert given item into the collection after the i'th item.
Does not prevent duplicate entries. If the collection is empty, does nothing (regardless of parameters). If i < 0 the given item is placed at the top (beginning) of the collection. Given item must not be nullptr.
Note: it is undefined behaviour to invoke this during traversal of the collection.
| void vtkCollection::ReplaceItem | ( | int | i, |
| vtkObject * | ) |
Replace the i'th item in the collection with the given item.
If i is out-of-range, this function does nothing. Given item must not be nullptr.
Note: It is well-defined to replace an item during traversal of the collection.
| void vtkCollection::RemoveItem | ( | int | i | ) |
Remove the i'th item in the collection.
If i is out-of-range, this function does nothing.
Note: It is well-defined to remove items during traversal of the collection.
| void vtkCollection::RemoveItem | ( | vtkObject * | ) |
Remove the first occurrence of the given item from the collection.
Removes only the first occurrence found, not all occurrences. If no occurrence is found, the collection is unaffected. If given item is nullptr, does nothing.
Note: It is well-defined to remove items during traversal of the collection.
| void vtkCollection::RemoveAllItems | ( | ) |
Remove all items from the collection.
Note: It is well-defined to remove items during traversal of the collection.
| int vtkCollection::IsItemPresent | ( | vtkObject * | a | ) |
Search for the given item and return the 1-based index of its first occurrence in the collection.
If the item is not found, the return value is 0. If the item is found, the return value is its first location + 1 (a 1-based index). If given item is nullptr, returns 0.
| int vtkCollection::IndexOfFirstOccurence | ( | vtkObject * | a | ) |
Just calls IndexOfFirstOccurrence.
| int vtkCollection::IndexOfFirstOccurrence | ( | vtkObject * | a | ) | const |
Search for the given item and return the 0-based index of its first occurrence in the collection.
If the item is not found, the return value is -1. If the item is found, the return value is its first location (a 0-based index). If given item is nullptr, returns -1.
|
inline |
Return the number of items in the collection.
Definition at line 131 of file vtkCollection.h.
| vtkObject * vtkCollection::GetItemAsObject | ( | int | i | ) |
Get the i'th item in the collection.
nullptr is returned if i is out of range.
|
inline |
Initialize the traversal of the collection.
This means the next call to GetNextItemAsObject() will return the first object in the collection.
Definition at line 143 of file vtkCollection.h.
|
inline |
A reentrant safe way to iterate through a collection.
Just pass the same cookie value around each time.
Definition at line 149 of file vtkCollection.h.
|
inline |
Get the next item in the collection.
nullptr is returned if the collection is exhausted.
Definition at line 199 of file vtkCollection.h.
|
inline |
A reentrant safe way to get the next item as a collection.
Just pass the same cookie back and forth.
Definition at line 214 of file vtkCollection.h.
| vtkCollectionIterator * vtkCollection::NewIterator | ( | ) |
Get an iterator to traverse the items in this collection.
|
inlineoverridevirtual |
Participate in garbage collection.
Reimplemented from vtkObjectBase.
Definition at line 175 of file vtkCollection.h.
|
protectedvirtual |
|
protectedvirtual |
Reimplemented in vtkActor2DCollection, and vtkImageSliceCollection.
|
overrideprotectedvirtual |
Reimplemented from vtkObjectBase.
|
friend |
Definition at line 189 of file vtkCollection.h.
|
protected |
Definition at line 184 of file vtkCollection.h.
|
protected |
Definition at line 185 of file vtkCollection.h.
|
protected |
Definition at line 186 of file vtkCollection.h.
|
protected |
Definition at line 187 of file vtkCollection.h.