VTK  9.2.6
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
38class VTKRENDERINGCORE_EXPORT vtkPropCollection : public vtkCollection
39{
40public:
43 void PrintSelf(ostream& os, vtkIndent indent) override;
44
48 void AddItem(vtkProp* a);
49
53 vtkProp* GetNextProp();
54
58 vtkProp* GetLastProp();
59
67
73 {
74 return static_cast<vtkProp*>(this->GetNextItemAsObject(cookie));
75 }
76
77protected:
78 vtkPropCollection() = default;
79 ~vtkPropCollection() override = default;
80
81private:
82 // hide the standard AddItem from the user and the compiler.
83 void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
84
85private:
86 vtkPropCollection(const vtkPropCollection&) = delete;
87 void operator=(const vtkPropCollection&) = delete;
88};
89
91{
93}
94
96{
97 return static_cast<vtkProp*>(this->GetNextItemAsObject());
98}
99
101{
102 if (this->Bottom == nullptr)
103 {
104 return nullptr;
105 }
106 else
107 {
108 return static_cast<vtkProp*>(this->Bottom->Item);
109 }
110}
111
112#endif
create and manipulate ordered lists of objects
Definition: vtkCollection.h:56
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:40
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:51