VTK  9.1.0
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
35class VTKRENDERINGCORE_EXPORT vtkPropCollection : public vtkCollection
36{
37public:
40 void PrintSelf(ostream& os, vtkIndent indent) override;
41
45 void AddItem(vtkProp* a);
46
50 vtkProp* GetNextProp();
51
55 vtkProp* GetLastProp();
56
64
70 {
71 return static_cast<vtkProp*>(this->GetNextItemAsObject(cookie));
72 }
73
74protected:
75 vtkPropCollection() = default;
76 ~vtkPropCollection() override = default;
77
78private:
79 // hide the standard AddItem from the user and the compiler.
80 void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
81
82private:
83 vtkPropCollection(const vtkPropCollection&) = delete;
84 void operator=(const vtkPropCollection&) = delete;
85};
86
88{
90}
91
93{
94 return static_cast<vtkProp*>(this->GetNextItemAsObject());
95}
96
98{
99 if (this->Bottom == nullptr)
100 {
101 return nullptr;
102 }
103 else
104 {
105 return static_cast<vtkProp*>(this->Bottom->Item);
106 }
107}
108
109#endif
create and manipulate ordered lists of objects
Definition: vtkCollection.h:53
vtkCollectionElement * Bottom
void AddItem(vtkObject *)
Add an object to the bottom of the list.
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
a simple class to control print indentation
Definition: vtkIndent.h:34
abstract base class for most VTK objects
Definition: vtkObject.h:63
an ordered list of Props
vtkPropCollection()=default
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void AddItem(vtkProp *a)
Add a Prop to the bottom of the list.
vtkProp * GetNextProp(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
int GetNumberOfPaths()
Get the number of paths contained in this list.
~vtkPropCollection() override=default
static vtkPropCollection * New()
vtkProp * GetLastProp()
Get the last Prop in the list.
vtkProp * GetNextProp()
Get the next Prop in the list.
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:57
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:48