VTK  9.3.20240424
vtkActorCollection.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
57#ifndef vtkActorCollection_h
58#define vtkActorCollection_h
59
60#include "vtkActor.h" // For inline methods
61#include "vtkPropCollection.h"
62#include "vtkRenderingCoreModule.h" // For export macro
63#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
64
65VTK_ABI_NAMESPACE_BEGIN
66class vtkProperty;
67
68class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkActorCollection : public vtkPropCollection
69{
70public:
73 void PrintSelf(ostream& os, vtkIndent indent) override;
74
78 void AddItem(vtkActor* a);
79
83 vtkActor* GetNextActor();
84
88 vtkActor* GetLastActor();
89
91
96 vtkActor* GetNextItem();
97 vtkActor* GetLastItem();
99
104
110 {
111 return static_cast<vtkActor*>(this->GetNextItemAsObject(cookie));
112 }
113
114protected:
116 ~vtkActorCollection() override = default;
117
118private:
119 // hide the standard AddItem from the user and the compiler.
120 void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
121 void AddItem(vtkProp* o) { this->vtkPropCollection::AddItem(o); }
122
123 vtkActorCollection(const vtkActorCollection&) = delete;
124 void operator=(const vtkActorCollection&) = delete;
125};
126
128{
129 this->vtkCollection::AddItem(a);
130}
131
133{
134 return static_cast<vtkActor*>(this->GetNextItemAsObject());
135}
136
138{
139 if (this->Bottom == nullptr)
140 {
141 return nullptr;
142 }
143 else
144 {
145 return static_cast<vtkActor*>(this->Bottom->Item);
146 }
147}
148
150{
151 return this->GetNextActor();
152}
153
155{
156 return this->GetLastActor();
157}
158
159VTK_ABI_NAMESPACE_END
160#endif
an ordered list of actors
static vtkActorCollection * New()
void AddItem(vtkActor *a)
Add an actor to the bottom of the list.
vtkActor * GetNextItem()
Access routines that are provided for compatibility with previous version of VTK.
vtkActorCollection()=default
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void ApplyProperties(vtkProperty *p)
Apply properties to all actors in this collection.
vtkActor * GetNextActor()
Get the next actor in the list.
vtkActor * GetLastActor()
Get the last actor in the list.
~vtkActorCollection() override=default
vtkActor * GetLastItem()
Access routines that are provided for compatibility with previous version of VTK.
vtkActor * GetNextActor(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:151
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:108
abstract base class for most VTK objects
Definition vtkObject.h:162
an ordered list of Props
void AddItem(vtkProp *a)
Add a Prop to the bottom of the list.
abstract superclass for all actors, volumes and annotations
Definition vtkProp.h:66
represent surface properties of a geometric object
void * vtkCollectionSimpleIterator
#define VTK_MARSHALAUTO