VTK  9.1.0
vtkActor2DCollection.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkActor2DCollection.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=========================================================================*/
28#ifndef vtkActor2DCollection_h
29#define vtkActor2DCollection_h
30
31#include "vtkPropCollection.h"
32#include "vtkRenderingCoreModule.h" // For export macro
33
34#include "vtkActor2D.h" // Needed for inline methods
35
36class vtkViewport;
37
38class VTKRENDERINGCORE_EXPORT vtkActor2DCollection : public vtkPropCollection
39{
40public:
46
48 void PrintSelf(ostream& os, vtkIndent indent) override;
49
54 void Sort();
55
61
63
67 vtkActor2D* GetNextActor2D();
68 vtkActor2D* GetLastActor2D();
70
72
77 vtkActor2D* GetNextItem();
78 vtkActor2D* GetLastItem();
80
84 void RenderOverlay(vtkViewport* viewport);
85
91 {
92 return static_cast<vtkActor2D*>(this->GetNextItemAsObject(cookie));
93 }
94
95protected:
98
100
101private:
102 // hide the standard AddItem from the user and the compiler.
103 void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
104 void AddItem(vtkProp* o) { this->vtkPropCollection::AddItem(o); }
105 int IsItemPresent(vtkObject* o) { return this->vtkCollection::IsItemPresent(o); }
106
107private:
109 void operator=(const vtkActor2DCollection&) = delete;
110};
111
113{
114 return this->vtkCollection::IsItemPresent(a);
115}
116
118{
119 return static_cast<vtkActor2D*>(this->GetNextItemAsObject());
120}
121
123{
124 if (this->Bottom == nullptr)
125 {
126 return nullptr;
127 }
128 else
129 {
130 return static_cast<vtkActor2D*>(this->Bottom->Item);
131 }
132}
133
135{
136 return this->GetNextActor2D();
137}
138
140{
141 return this->GetLastActor2D();
142}
143
144#endif
a list of 2D actors
vtkActor2DCollection()=default
void AddItem(vtkActor2D *a)
Add an actor to the list.
static vtkActor2DCollection * New()
Destructor for the vtkActor2DCollection class.
void DeleteElement(vtkCollectionElement *) override
vtkActor2D * GetLastActor2D()
Standard Collection methods.
void Sort()
Sorts the vtkActor2DCollection by layer number.
vtkActor2D * GetNextItem()
Access routines that are provided for compatibility with previous version of VTK.
~vtkActor2DCollection() override
vtkActor2D * GetNextActor2D(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
void RenderOverlay(vtkViewport *viewport)
Sort and then render the collection of 2D actors.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkActor2D * GetNextActor2D()
Standard Collection methods.
int IsItemPresent(vtkActor2D *a)
Standard Collection methods.
vtkActor2D * GetLastItem()
Access routines that are provided for compatibility with previous version of VTK.
a actor that draws 2D data
Definition: vtkActor2D.h:149
vtkCollectionElement * Bottom
void AddItem(vtkObject *)
Add an object to the bottom of the list.
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
int IsItemPresent(vtkObject *a)
Search for an object and return location in list.
a simple class to control print indentation
Definition: vtkIndent.h:113
abstract base class for most VTK objects
Definition: vtkObject.h:82
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:76
abstract specification for Viewports
Definition: vtkViewport.h:47
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:48