VTK  9.3.0
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
18#ifndef vtkActorCollection_h
19#define vtkActorCollection_h
20
21#include "vtkActor.h" // For inline methods
22#include "vtkPropCollection.h"
23#include "vtkRenderingCoreModule.h" // For export macro
24
25VTK_ABI_NAMESPACE_BEGIN
26class vtkProperty;
27
28class VTKRENDERINGCORE_EXPORT vtkActorCollection : public vtkPropCollection
29{
30public:
33 void PrintSelf(ostream& os, vtkIndent indent) override;
34
38 void AddItem(vtkActor* a);
39
43 vtkActor* GetNextActor();
44
48 vtkActor* GetLastActor();
49
51
56 vtkActor* GetNextItem();
57 vtkActor* GetLastItem();
59
64
70 {
71 return static_cast<vtkActor*>(this->GetNextItemAsObject(cookie));
72 }
73
74protected:
75 vtkActorCollection() = default;
76 ~vtkActorCollection() override = default;
77
78private:
79 // hide the standard AddItem from the user and the compiler.
80 void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
81 void AddItem(vtkProp* o) { this->vtkPropCollection::AddItem(o); }
82
84 void operator=(const vtkActorCollection&) = delete;
85};
86
88{
90}
91
93{
94 return static_cast<vtkActor*>(this->GetNextItemAsObject());
95}
96
98{
99 if (this->Bottom == nullptr)
100 {
101 return nullptr;
102 }
103 else
104 {
105 return static_cast<vtkActor*>(this->Bottom->Item);
106 }
107}
108
110{
111 return this->GetNextActor();
112}
113
115{
116 return this->GetLastActor();
117}
118
119VTK_ABI_NAMESPACE_END
120#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:41
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
void AddItem(vtkProp *a)
Add a Prop to the bottom of the list.
abstract superclass for all actors, volumes and annotations
Definition vtkProp.h:43
represent surface properties of a geometric object
Definition vtkProperty.h:57
void * vtkCollectionSimpleIterator