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