VTK  9.1.0
vtkActorCollection.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkActorCollection.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
36#ifndef vtkActorCollection_h
37#define vtkActorCollection_h
38
39#include "vtkActor.h" // For inline methods
40#include "vtkPropCollection.h"
41#include "vtkRenderingCoreModule.h" // For export macro
42
43class vtkProperty;
44
45class VTKRENDERINGCORE_EXPORT vtkActorCollection : public vtkPropCollection
46{
47public:
50 void PrintSelf(ostream& os, vtkIndent indent) override;
51
55 void AddItem(vtkActor* a);
56
60 vtkActor* GetNextActor();
61
65 vtkActor* GetLastActor();
66
68
73 vtkActor* GetNextItem();
74 vtkActor* GetLastItem();
76
81
87 {
88 return static_cast<vtkActor*>(this->GetNextItemAsObject(cookie));
89 }
90
91protected:
92 vtkActorCollection() = default;
93 ~vtkActorCollection() override = default;
94
95private:
96 // hide the standard AddItem from the user and the compiler.
97 void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
98 void AddItem(vtkProp* o) { this->vtkPropCollection::AddItem(o); }
99
100private:
101 vtkActorCollection(const vtkActorCollection&) = delete;
102 void operator=(const vtkActorCollection&) = delete;
103};
104
106{
107 this->vtkCollection::AddItem(a);
108}
109
111{
112 return static_cast<vtkActor*>(this->GetNextItemAsObject());
113}
114
116{
117 if (this->Bottom == nullptr)
118 {
119 return nullptr;
120 }
121 else
122 {
123 return static_cast<vtkActor*>(this->Bottom->Item);
124 }
125}
126
128{
129 return this->GetNextActor();
130}
131
133{
134 return this->GetLastActor();
135}
136
137#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:55
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:43
abstract base class for most VTK objects
Definition: vtkObject.h:63
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:57
represent surface properties of a geometric object
Definition: vtkProperty.h:71
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:48