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=========================================================================*/
36#ifndef vtkPropCollection_h
37#define vtkPropCollection_h
38
39#include "vtkCollection.h"
40#include "vtkRenderingCoreModule.h" // For export macro
41
42#include "vtkProp.h" // Needed for inline methods
43
44class VTKRENDERINGCORE_EXPORT vtkPropCollection : public vtkCollection
45{
46public:
49 void PrintSelf(ostream& os, vtkIndent indent) override;
50
54 void AddItem(vtkProp* a);
55
59 vtkProp* GetNextProp();
60
64 vtkProp* GetLastProp();
65
73
79 {
80 return static_cast<vtkProp*>(this->GetNextItemAsObject(cookie));
81 }
82
83protected:
84 vtkPropCollection() = default;
85 ~vtkPropCollection() override = default;
86
87private:
88 // hide the standard AddItem from the user and the compiler.
89 void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
90
91private:
92 vtkPropCollection(const vtkPropCollection&) = delete;
93 void operator=(const vtkPropCollection&) = delete;
94};
95
97{
99}
100
102{
103 return static_cast<vtkProp*>(this->GetNextItemAsObject());
104}
105
107{
108 if (this->Bottom == nullptr)
109 {
110 return nullptr;
111 }
112 else
113 {
114 return static_cast<vtkProp*>(this->Bottom->Item);
115 }
116}
117
118#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:43
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