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 =========================================================================*/
27 #ifndef vtkPropCollection_h
28 #define vtkPropCollection_h
29 
30 #include "vtkRenderingCoreModule.h" // For export macro
31 #include "vtkCollection.h"
32 
33 #include "vtkProp.h" // Needed for inline methods
34 
35 class VTKRENDERINGCORE_EXPORT vtkPropCollection : public vtkCollection
36 {
37  public:
38  static vtkPropCollection *New();
40 
44  void AddItem(vtkProp *a);
45 
49  vtkProp *GetNextProp();
50 
54  vtkProp *GetLastProp();
55 
62  int GetNumberOfPaths();
63 
69  return static_cast<vtkProp *>(this->GetNextItemAsObject(cookie));};
70 
71 protected:
73  ~vtkPropCollection() override {}
74 
75 
76 private:
77  // hide the standard AddItem from the user and the compiler.
78  void AddItem(vtkObject *o) { this->vtkCollection::AddItem(o); };
79 
80 private:
81  vtkPropCollection(const vtkPropCollection&) = delete;
82  void operator=(const vtkPropCollection&) = delete;
83 };
84 
86 {
87  this->vtkCollection::AddItem(a);
88 }
89 
91 {
92  return static_cast<vtkProp *>(this->GetNextItemAsObject());
93 }
94 
96 {
97  if ( this->Bottom == nullptr )
98  {
99  return nullptr;
100  }
101  else
102  {
103  return static_cast<vtkProp *>(this->Bottom->Item);
104  }
105 }
106 
107 #endif
108 
109 
110 
111 
112 
113 // VTK-HeaderTest-Exclude: vtkPropCollection.h
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:46
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:44
vtkProp * GetNextProp(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
abstract base class for most VTK objects
Definition: vtkObject.h:53
an ordered list of Props
~vtkPropCollection() override
static vtkCollection * New()
Construct with empty list.
vtkProp * GetLastProp()
Get the last Prop in the list.
vtkCollectionElement * Bottom
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:48
vtkProp * GetNextProp()
Get the next Prop in the list.
vtkObject * GetNextItemAsObject()
Get the next item in the collection.