VTK  9.5.2
vtkPropCollection.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
17
18#ifndef vtkPropCollection_h
19#define vtkPropCollection_h
20
21#include "vtkCollection.h"
22#include "vtkRenderingCoreModule.h" // For export macro
23#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
24
25#include "vtkProp.h" // Needed for inline methods
26
27VTK_ABI_NAMESPACE_BEGIN
28class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkPropCollection : public vtkCollection
29{
30public:
33 void PrintSelf(ostream& os, vtkIndent indent) override;
34
38 void AddItem(vtkProp* a);
39
44
49
57
63 {
64 return static_cast<vtkProp*>(this->GetNextItemAsObject(cookie));
65 }
66
67protected:
68 vtkPropCollection() = default;
69 ~vtkPropCollection() override = default;
70
71private:
72 // hide the standard AddItem from the user and the compiler.
73 void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
74
75 vtkPropCollection(const vtkPropCollection&) = delete;
76 void operator=(const vtkPropCollection&) = delete;
77};
78
80{
82}
83
85{
86 return static_cast<vtkProp*>(this->GetNextItemAsObject());
87}
88
90{
91 if (this->Bottom == nullptr)
92 {
93 return nullptr;
94 }
95 else
96 {
97 return static_cast<vtkProp*>(this->Bottom->Item);
98 }
99}
100
101VTK_ABI_NAMESPACE_END
102#endif
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:29
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:44
void * vtkCollectionSimpleIterator
#define VTK_MARSHALAUTO