VTK  9.1.0
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 =========================================================================*/
46 #ifndef vtkCullerCollection_h
47 #define vtkCullerCollection_h
48 
49 #include "vtkCollection.h"
50 #include "vtkCuller.h" // for inline functions
51 #include "vtkRenderingCoreModule.h" // For export macro
52 
53 class VTKRENDERINGCORE_EXPORT vtkCullerCollection : public vtkCollection
54 {
55 public:
58  void PrintSelf(ostream& os, vtkIndent indent) override;
59 
63  void AddItem(vtkCuller* a) { this->vtkCollection::AddItem(a); }
64 
68  vtkCuller* GetNextItem() { return static_cast<vtkCuller*>(this->GetNextItemAsObject()); }
69 
73  vtkCuller* GetLastItem();
74 
80  {
81  return static_cast<vtkCuller*>(this->GetNextItemAsObject(cookie));
82  }
83 
84 protected:
85  vtkCullerCollection() = default;
86  ~vtkCullerCollection() override = default;
87 
88 private:
89  // hide the standard AddItem from the user and the compiler.
90  void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
91 
92 private:
94  void operator=(const vtkCullerCollection&) = delete;
95 };
96 
98 {
99  if (this->Bottom == nullptr)
100  {
101  return nullptr;
102  }
103  else
104  {
105  return static_cast<vtkCuller*>(this->Bottom->Item);
106  }
107 }
108 
109 #endif
vtkCullerCollection::~vtkCullerCollection
~vtkCullerCollection() override=default
vtkCollectionSimpleIterator
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:48
vtkCullerCollection::New
static vtkCullerCollection * New()
vtkCollection.h
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:82
vtkCollectionElement::Item
vtkObject * Item
Definition: vtkCollection.h:45
vtkCollection::GetNextItemAsObject
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
Definition: vtkCollection.h:179
vtkCollection
create and manipulate ordered lists of objects
Definition: vtkCollection.h:53
vtkCullerCollection::GetLastItem
vtkCuller * GetLastItem()
Get the last Culler in the list.
Definition: vtkCullerCollection.h:97
vtkCullerCollection::AddItem
void AddItem(vtkCuller *a)
Add an Culler to the bottom of the list.
Definition: vtkCullerCollection.h:63
vtkCollection::Bottom
vtkCollectionElement * Bottom
Definition: vtkCollection.h:166
vtkCuller
a superclass for prop cullers
Definition: vtkCuller.h:38
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkCullerCollection::vtkCullerCollection
vtkCullerCollection()=default
vtkCullerCollection::GetNextItem
vtkCuller * GetNextItem()
Get the next Culler in the list.
Definition: vtkCullerCollection.h:68
vtkCullerCollection
an ordered list of Cullers
Definition: vtkCullerCollection.h:54
vtkCuller.h
vtkCollection::AddItem
void AddItem(vtkObject *)
Add an object to the bottom of the list.
vtkCullerCollection::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkCullerCollection::GetNextCuller
vtkCuller * GetNextCuller(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
Definition: vtkCullerCollection.h:79