VTK  9.6.20260220
vtkCullerCollection.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
33
34#ifndef vtkCullerCollection_h
35#define vtkCullerCollection_h
36
37#include "vtkCollection.h"
38#include "vtkCuller.h" // for inline functions
39#include "vtkRenderingCoreModule.h" // For export macro
40#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
41
42VTK_ABI_NAMESPACE_BEGIN
43class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkCullerCollection : public vtkCollection
44{
45public:
48 void PrintSelf(ostream& os, vtkIndent indent) override;
49
54
58 vtkCuller* GetNextItem() { return static_cast<vtkCuller*>(this->GetNextItemAsObject()); }
59
63 vtkCuller* GetLastItem();
64
70 {
71 return static_cast<vtkCuller*>(this->GetNextItemAsObject(cookie));
72 }
73
74protected:
76 ~vtkCullerCollection() override = default;
77
78private:
79 // hide the standard AddItem from the user and the compiler.
80 void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
81
83 void operator=(const vtkCullerCollection&) = delete;
84};
85
87{
88 int numItems = this->GetNumberOfItems();
89 if (numItems == 0)
90 {
91 return nullptr;
92 }
93 else
94 {
95 return static_cast<vtkCuller*>(this->GetItemAsObject(numItems - 1));
96 }
97}
98
99VTK_ABI_NAMESPACE_END
100#endif
void AddItem(vtkObject *)
Add given item to the bottom (end) of 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.
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
an ordered list of Cullers
void AddItem(vtkCuller *a)
Add an Culler to the bottom of the list.
vtkCuller * GetNextItem()
Get the next Culler in the list.
vtkCuller * GetNextCuller(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
~vtkCullerCollection() override=default
static vtkCullerCollection * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkCuller * GetLastItem()
Get the last Culler in the list.
vtkCullerCollection()=default
a superclass for prop cullers
Definition vtkCuller.h:31
a simple class to control print indentation
Definition vtkIndent.h:108
void * vtkCollectionSimpleIterator
#define VTK_MARSHALAUTO