VTK
vtkPropCollection.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPropCollection.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 =========================================================================*/
33 #ifndef vtkPropCollection_h
34 #define vtkPropCollection_h
35 
36 #include "vtkRenderingCoreModule.h" // For export macro
37 #include "vtkCollection.h"
38 
39 #include "vtkProp.h" // Needed for inline methods
40 
41 class VTKRENDERINGCORE_EXPORT vtkPropCollection : public vtkCollection
42 {
43  public:
44  static vtkPropCollection *New();
46 
50  void AddItem(vtkProp *a);
51 
55  vtkProp *GetNextProp();
56 
60  vtkProp *GetLastProp();
61 
68  int GetNumberOfPaths();
69 
75  return static_cast<vtkProp *>(this->GetNextItemAsObject(cookie));};
76 
77 protected:
79  ~vtkPropCollection() override {}
80 
81 
82 private:
83  // hide the standard AddItem from the user and the compiler.
84  void AddItem(vtkObject *o) { this->vtkCollection::AddItem(o); };
85 
86 private:
87  vtkPropCollection(const vtkPropCollection&) = delete;
88  void operator=(const vtkPropCollection&) = delete;
89 };
90 
92 {
93  this->vtkCollection::AddItem(a);
94 }
95 
97 {
98  return static_cast<vtkProp *>(this->GetNextItemAsObject());
99 }
100 
102 {
103  if ( this->Bottom == nullptr )
104  {
105  return nullptr;
106  }
107  else
108  {
109  return static_cast<vtkProp *>(this->Bottom->Item);
110  }
111 }
112 
113 #endif
114 
115 
116 
117 
118 
119 // VTK-HeaderTest-Exclude: vtkPropCollection.h
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:52
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:47
vtkProp * GetNextProp(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
abstract base class for most VTK objects
Definition: vtkObject.h:59
an ordered list of Props
~vtkPropCollection() override
static vtkCollection * New()
Construct with empty list.
vtkProp * GetLastProp()
Get the last Prop in the list.
void AddItem(vtkObject *)
Add an object to the bottom of the list.
void AddItem(vtkProp *a)
Add a Prop to the bottom of the list.
create and manipulate ordered lists of objects
Definition: vtkCollection.h:51
vtkProp * GetNextProp()
Get the next Prop in the list.
vtkObject * GetNextItemAsObject()
Get the next item in the collection.