VTK  9.3.20240327
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
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 
41 VTK_ABI_NAMESPACE_BEGIN
42 class VTKRENDERINGCORE_EXPORT vtkCullerCollection : public vtkCollection
43 {
44 public:
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
52  void AddItem(vtkCuller* a) { this->vtkCollection::AddItem(a); }
53 
57  vtkCuller* GetNextItem() { return static_cast<vtkCuller*>(this->GetNextItemAsObject()); }
58 
62  vtkCuller* GetLastItem();
63 
69  {
70  return static_cast<vtkCuller*>(this->GetNextItemAsObject(cookie));
71  }
72 
73 protected:
74  vtkCullerCollection() = default;
75  ~vtkCullerCollection() override = default;
76 
77 private:
78  // hide the standard AddItem from the user and the compiler.
79  void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
80 
82  void operator=(const vtkCullerCollection&) = delete;
83 };
84 
86 {
87  if (this->Bottom == nullptr)
88  {
89  return nullptr;
90  }
91  else
92  {
93  return static_cast<vtkCuller*>(this->Bottom->Item);
94  }
95 }
96 
97 VTK_ABI_NAMESPACE_END
98 #endif
create and manipulate ordered lists of objects
Definition: vtkCollection.h:45
vtkCollectionElement * Bottom
void AddItem(vtkObject *)
Add an object to the bottom of the list.
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
an ordered list of Cullers
vtkCuller * GetNextCuller(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
void AddItem(vtkCuller *a)
Add an Culler to the bottom of the list.
~vtkCullerCollection() override=default
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkCuller * GetNextItem()
Get the next Culler in the list.
vtkCuller * GetLastItem()
Get the last Culler in the list.
vtkCullerCollection()=default
static vtkCullerCollection * New()
a superclass for prop cullers
Definition: vtkCuller.h:30
a simple class to control print indentation
Definition: vtkIndent.h:108
abstract base class for most VTK objects
Definition: vtkObject.h:161
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:40