VTK  9.2.6
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=========================================================================*/
29
30#ifndef vtkActorCollection_h
31#define vtkActorCollection_h
32
33#include "vtkActor.h" // For inline methods
34#include "vtkPropCollection.h"
35#include "vtkRenderingCoreModule.h" // For export macro
36
37class vtkProperty;
38
39class VTKRENDERINGCORE_EXPORT vtkActorCollection : public vtkPropCollection
40{
41public:
44 void PrintSelf(ostream& os, vtkIndent indent) override;
45
49 void AddItem(vtkActor* a);
50
55
60
62
70
75
81 {
82 return static_cast<vtkActor*>(this->GetNextItemAsObject(cookie));
83 }
84
85protected:
86 vtkActorCollection() = default;
87 ~vtkActorCollection() override = default;
88
89private:
90 // hide the standard AddItem from the user and the compiler.
91 void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
92 void AddItem(vtkProp* o) { this->vtkPropCollection::AddItem(o); }
93
94private:
95 vtkActorCollection(const vtkActorCollection&) = delete;
96 void operator=(const vtkActorCollection&) = delete;
97};
98
100{
101 this->vtkCollection::AddItem(a);
102}
103
105{
106 return static_cast<vtkActor*>(this->GetNextItemAsObject());
107}
108
110{
111 if (this->Bottom == nullptr)
112 {
113 return nullptr;
114 }
115 else
116 {
117 return static_cast<vtkActor*>(this->Bottom->Item);
118 }
119}
120
122{
123 return this->GetNextActor();
124}
125
127{
128 return this->GetLastActor();
129}
130
131#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:52
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:40
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:57
represent surface properties of a geometric object
Definition vtkProperty.h:68
void * vtkCollectionSimpleIterator