VTK  9.3.0
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
18#ifndef vtkPropCollection_h
19#define vtkPropCollection_h
20
21#include "vtkCollection.h"
22#include "vtkRenderingCoreModule.h" // For export macro
23
24#include "vtkProp.h" // Needed for inline methods
25
26VTK_ABI_NAMESPACE_BEGIN
27class VTKRENDERINGCORE_EXPORT vtkPropCollection : public vtkCollection
28{
29public:
32 void PrintSelf(ostream& os, vtkIndent indent) override;
33
37 void AddItem(vtkProp* a);
38
42 vtkProp* GetNextProp();
43
47 vtkProp* GetLastProp();
48
56
62 {
63 return static_cast<vtkProp*>(this->GetNextItemAsObject(cookie));
64 }
65
66protected:
67 vtkPropCollection() = default;
68 ~vtkPropCollection() override = default;
69
70private:
71 // hide the standard AddItem from the user and the compiler.
72 void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
73
74 vtkPropCollection(const vtkPropCollection&) = delete;
75 void operator=(const vtkPropCollection&) = delete;
76};
77
79{
81}
82
84{
85 return static_cast<vtkProp*>(this->GetNextItemAsObject());
86}
87
89{
90 if (this->Bottom == nullptr)
91 {
92 return nullptr;
93 }
94 else
95 {
96 return static_cast<vtkProp*>(this->Bottom->Item);
97 }
98}
99
100VTK_ABI_NAMESPACE_END
101#endif
create and manipulate ordered lists of objects
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
abstract base class for most VTK objects
Definition vtkObject.h:49
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:43
void * vtkCollectionSimpleIterator