VTK  9.6.1
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
17
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#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
25
26VTK_ABI_NAMESPACE_BEGIN
27class vtkProperty;
28
29class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkActorCollection : public vtkPropCollection
30{
31public:
34 void PrintSelf(ostream& os, vtkIndent indent) override;
35
39 void AddItem(vtkActor* a);
40
45
50
52
60
65
71 {
72 return static_cast<vtkActor*>(this->GetNextItemAsObject(cookie));
73 }
74
75protected:
76 vtkActorCollection() = default;
77 ~vtkActorCollection() override = default;
78
79private:
80 // hide the standard AddItem from the user and the compiler.
81 void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
82 void AddItem(vtkProp* o) { this->vtkPropCollection::AddItem(o); }
83
84 vtkActorCollection(const vtkActorCollection&) = delete;
85 void operator=(const vtkActorCollection&) = delete;
86};
87
89{
91}
92
94{
95 return static_cast<vtkActor*>(this->GetNextItemAsObject());
96}
97
99{
100 if (this->Bottom == nullptr)
101 {
102 return nullptr;
103 }
104 else
105 {
106 return static_cast<vtkActor*>(this->Bottom->Item);
107 }
108}
109
111{
112 return this->GetNextActor();
113}
114
116{
117 return this->GetLastActor();
118}
119
120VTK_ABI_NAMESPACE_END
121#endif
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:42
vtkCollectionElement * Bottom
void AddItem(vtkObject *)
Add given item to the bottom (end) of the collection.
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
a simple class to control print indentation
Definition vtkIndent.h:29
vtkPropCollection()=default
void AddItem(vtkProp *a)
Add a Prop to the bottom of the list.
abstract superclass for all actors, volumes and annotations
Definition vtkProp.h:50
represent surface properties of a geometric object
Definition vtkProperty.h:60
void * vtkCollectionSimpleIterator
#define VTK_MARSHALAUTO