VTK  9.2.6
vtkCullerCollection.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCullerCollection.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
36 #ifndef vtkCullerCollection_h
37 #define vtkCullerCollection_h
38 
39 #include "vtkCollection.h"
40 #include "vtkCuller.h" // for inline functions
41 #include "vtkRenderingCoreModule.h" // For export macro
42 
43 class VTKRENDERINGCORE_EXPORT vtkCullerCollection : public vtkCollection
44 {
45 public:
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
53  void AddItem(vtkCuller* a) { this->vtkCollection::AddItem(a); }
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 
74 protected:
75  vtkCullerCollection() = default;
76  ~vtkCullerCollection() override = default;
77 
78 private:
79  // hide the standard AddItem from the user and the compiler.
80  void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
81 
82 private:
84  void operator=(const vtkCullerCollection&) = delete;
85 };
86 
88 {
89  if (this->Bottom == nullptr)
90  {
91  return nullptr;
92  }
93  else
94  {
95  return static_cast<vtkCuller*>(this->Bottom->Item);
96  }
97 }
98 
99 #endif
create and manipulate ordered lists of objects
Definition: vtkCollection.h:56
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:41
a simple class to control print indentation
Definition: vtkIndent.h:49
abstract base class for most VTK objects
Definition: vtkObject.h:72
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:51