VTK
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 "vtkRenderingCoreModule.h" // For export macro
32#include "vtkPropCollection.h"
33
34#include "vtkActor2D.h" // Needed for inline methods
35
36class vtkViewport;
37
38class VTKRENDERINGCORE_EXPORT vtkActor2DCollection : public vtkPropCollection
39{
40 public:
46
48
53 void Sort();
54
60
62
66 vtkActor2D *GetNextActor2D();
67 vtkActor2D *GetLastActor2D();
69
71
76 vtkActor2D *GetNextItem();
77 vtkActor2D *GetLastItem();
79
80
84 void RenderOverlay(vtkViewport* viewport);
85
91 return static_cast<vtkActor2D *>(this->GetNextItemAsObject(cookie));};
92
93protected:
96
98
99private:
100 // hide the standard AddItem from the user and the compiler.
101 void AddItem(vtkObject *o) { this->vtkCollection::AddItem(o); };
102 void AddItem(vtkProp *o) { this->vtkPropCollection::AddItem(o); };
103 int IsItemPresent(vtkObject *o) { return this->vtkCollection::IsItemPresent(o); };
104
105private:
106 vtkActor2DCollection(const vtkActor2DCollection&) VTK_DELETE_FUNCTION;
107 void operator=(const vtkActor2DCollection&) VTK_DELETE_FUNCTION;
108};
109
111{
112 return this->vtkCollection::IsItemPresent(a);
113}
114
116{
117 return static_cast<vtkActor2D *>(this->GetNextItemAsObject());
118}
119
121{
122 if ( this->Bottom == NULL )
123 {
124 return NULL;
125 }
126 else
127 {
128 return static_cast<vtkActor2D *>(this->Bottom->Item);
129 }
130}
131
133{
134 return this->GetNextActor2D();
135}
136
138{
139 return this->GetLastActor2D();
140}
141
142#endif
143
144
145
146
147
148// VTK-HeaderTest-Exclude: vtkActor2DCollection.h
a list of 2D actors
void AddItem(vtkActor2D *a)
Add an actor to the list.
static vtkActor2DCollection * New()
Desctructor for the vtkActor2DCollection class.
void Sort()
Sorts the vtkActor2DCollection by layer number.
vtkActor2D * GetNextItem()
Access routines that are provided for compatibility with previous version of VTK.
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.
virtual void DeleteElement(vtkCollectionElement *)
int IsItemPresent(vtkActor2D *a)
Standard Collection methods.
a actor that draws 2D data
Definition: vtkActor2D.h:46
vtkCollectionElement * Bottom
void AddItem(vtkObject *)
Add an object to the list.
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
int IsItemPresent(vtkObject *a)
Search for an object and return location in list.
abstract base class for most VTK objects
Definition: vtkObject.h:60
a list of Props
void AddItem(vtkProp *a)
Add an Prop to the list.
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:48
abstract specification for Viewports
Definition: vtkViewport.h:48
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:47