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 "vtkCollection.h"
31 #include "vtkRenderingCoreModule.h" // For export macro
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  {
70  return static_cast<vtkProp*>(this->GetNextItemAsObject(cookie));
71  }
72 
73 protected:
75  ~vtkPropCollection() override {}
76 
77 private:
78  // hide the standard AddItem from the user and the compiler.
79  void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
80 
81 private:
82  vtkPropCollection(const vtkPropCollection&) = delete;
83  void operator=(const vtkPropCollection&) = delete;
84 };
85 
87 {
88  this->vtkCollection::AddItem(a);
89 }
90 
92 {
93  return static_cast<vtkProp*>(this->GetNextItemAsObject());
94 }
95 
97 {
98  if (this->Bottom == nullptr)
99  {
100  return nullptr;
101  }
102  else
103  {
104  return static_cast<vtkProp*>(this->Bottom->Item);
105  }
106 }
107 
108 #endif
109 
110 // VTK-HeaderTest-Exclude: vtkPropCollection.h
vtkCollection::New
static vtkCollection * New()
Construct with empty list.
vtkCollectionSimpleIterator
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:48
vtkCollection.h
vtkPropCollection::GetNextProp
vtkProp * GetNextProp(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
Definition: vtkPropCollection.h:68
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:53
vtkProp.h
vtkCollectionElement::Item
vtkObject * Item
Definition: vtkCollection.h:45
vtkPropCollection::~vtkPropCollection
~vtkPropCollection() override
Definition: vtkPropCollection.h:75
vtkCollection::GetNextItemAsObject
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
Definition: vtkCollection.h:179
vtkPropCollection::GetLastProp
vtkProp * GetLastProp()
Get the last Prop in the list.
Definition: vtkPropCollection.h:96
vtkCollection
create and manipulate ordered lists of objects
Definition: vtkCollection.h:52
vtkCollection::Bottom
vtkCollectionElement * Bottom
Definition: vtkCollection.h:166
vtkPropCollection::AddItem
void AddItem(vtkProp *a)
Add a Prop to the bottom of the list.
Definition: vtkPropCollection.h:86
vtkPropCollection::vtkPropCollection
vtkPropCollection()
Definition: vtkPropCollection.h:74
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:47
vtkCollection::AddItem
void AddItem(vtkObject *)
Add an object to the bottom of the list.
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:35
vtkPropCollection::GetNextProp
vtkProp * GetNextProp()
Get the next Prop in the list.
Definition: vtkPropCollection.h:91