VTK
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 =========================================================================*/
27 #ifndef vtkCullerCollection_h
28 #define vtkCullerCollection_h
29 
30 #include "vtkRenderingCoreModule.h" // For export macro
31 #include "vtkCollection.h"
32 #include "vtkCuller.h" // for inline functions
33 
34 class VTKRENDERINGCORE_EXPORT vtkCullerCollection : public vtkCollection
35 {
36  public:
37  static vtkCullerCollection *New();
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
44  void AddItem(vtkCuller *a)
45  {
46  this->vtkCollection::AddItem(a);
47  }
48 
53  {
54  return static_cast<vtkCuller *>(this->GetNextItemAsObject());
55  }
56 
60  vtkCuller *GetLastItem();
61 
67  {
68  return static_cast<vtkCuller *>(this->GetNextItemAsObject(cookie));
69  }
70 
71 protected:
73  ~vtkCullerCollection() override {}
74 
75 private:
76  // hide the standard AddItem from the user and the compiler.
77  void AddItem(vtkObject *o)
78  {
79  this->vtkCollection::AddItem(o);
80  }
81 
82 private:
84  void operator=(const vtkCullerCollection&) = delete;
85 };
86 
87 
89 {
90  if ( this->Bottom == nullptr )
91  {
92  return nullptr;
93  }
94  else
95  {
96  return static_cast<vtkCuller *>(this->Bottom->Item);
97  }
98 }
99 
100 #endif
101 
102 
103 
104 
105 
vtkCollection::New
static vtkCollection * New()
Construct with empty list.
vtkCollectionSimpleIterator
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:47
vtkCollection.h
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:59
vtkCollectionElement::Item
vtkObject * Item
Definition: vtkCollection.h:44
vtkCollection::GetNextItemAsObject
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
Definition: vtkCollection.h:177
vtkCollection
create and manipulate ordered lists of objects
Definition: vtkCollection.h:51
vtkCullerCollection::GetLastItem
vtkCuller * GetLastItem()
Get the last Culler in the list.
Definition: vtkCullerCollection.h:88
vtkCullerCollection::AddItem
void AddItem(vtkCuller *a)
Add an Culler to the bottom of the list.
Definition: vtkCullerCollection.h:44
vtkCollection::Bottom
vtkCollectionElement * Bottom
Definition: vtkCollection.h:164
vtkCuller
a superclass for prop cullers
Definition: vtkCuller.h:40
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkCullerCollection::GetNextItem
vtkCuller * GetNextItem()
Get the next Culler in the list.
Definition: vtkCullerCollection.h:52
vtkCullerCollection::~vtkCullerCollection
~vtkCullerCollection() override
Definition: vtkCullerCollection.h:73
vtkCullerCollection
an ordered list of Cullers
Definition: vtkCullerCollection.h:34
vtkCuller.h
vtkCollection::AddItem
void AddItem(vtkObject *)
Add an object to the bottom of the list.
vtkCullerCollection::vtkCullerCollection
vtkCullerCollection()
Definition: vtkCullerCollection.h:72
vtkCollection::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:66