22 #ifndef vtkCollection_h
23 #define vtkCollection_h
25 #include "vtkCommonCoreModule.h"
34 VTK_ABI_NAMESPACE_BEGIN
83 void RemoveItem(
int i);
100 void RemoveAllItems();
107 int IsItemPresent(
vtkObject* a) VTK_FUTURE_CONST;
113 int IndexOfFirstOccurence(
vtkObject* a) VTK_FUTURE_CONST;
120 int IndexOfFirstOccurrence(
vtkObject* a) const;
125 int GetNumberOfItems() VTK_FUTURE_CONST {
return static_cast<int>(this->Objects.size()); }
131 vtkObject* GetItemAsObject(
int i) VTK_FUTURE_CONST;
170 std::vector<vtkObject*>::iterator
end() {
return this->Objects.end(); }
179 std::sort(this->Objects.begin(), this->Objects.end(), f);
197 std::size_t Current = 0;
198 std::vector<vtkObject*> Objects;
206 if (this->Current >= this->Objects.size())
210 vtkObject* obj = this->Objects[this->Current];
220 if (elem >= this->Objects.data() + this->Objects.size())
228 VTK_ABI_NAMESPACE_END
void * vtkCollectionSimpleIterator
abstract base class for most VTK objects
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void InitTraversal()
Initialize the traversal of the collection.
bool UsesGarbageCollector() const override
Participate in garbage collection.
Detect and break reference loops.
#define VTK_DEPRECATED_IN_9_6_0(reason)
a simple class to control print indentation
virtual void ReportReferences(vtkGarbageCollector *)
iterator through a vtkCollection.
std::vector< vtkObject * >::iterator end()
create and manipulate ordered lists of objects
void InitTraversal(vtkCollectionSimpleIterator &cookie)
A reentrant safe way to iterate through a collection.
void Sort(std::function< bool(vtkObject *, vtkObject *)> f)
Sort the collection according to a given std::function that should return true if the first vtkObject...
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
#define VTK_DEPRECATED_IN_9_7_0(reason)