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 =========================================================================*/
27 #ifndef vtkActor2DCollection_h
28 #define vtkActor2DCollection_h
29 
30 #include "vtkRenderingCoreModule.h" // For export macro
31 #include "vtkPropCollection.h"
32 
33 #include "vtkActor2D.h" // Needed for inline methods
34 
35 class vtkViewport;
36 
38 {
39  public:
42  static vtkActor2DCollection *New();
43 
45 
48  void Sort();
49 
52  void AddItem(vtkActor2D *a);
53 
55 
56  int IsItemPresent(vtkActor2D *a);
57  vtkActor2D *GetNextActor2D();
58  vtkActor2D *GetLastActor2D();
60 
62 
65  vtkActor2D *GetNextItem();
66  vtkActor2D *GetLastItem();
68 
69 
71  void RenderOverlay(vtkViewport* viewport);
72 
73  //BTX
75 
78  return static_cast<vtkActor2D *>(this->GetNextItemAsObject(cookie));};
79  //ETX
81 
82 protected:
85 
86  virtual void DeleteElement(vtkCollectionElement *);
87 
88 private:
89  // hide the standard AddItem from the user and the compiler.
90  void AddItem(vtkObject *o) { this->vtkCollection::AddItem(o); };
91  void AddItem(vtkProp *o) { this->vtkPropCollection::AddItem(o); };
92  int IsItemPresent(vtkObject *o) { return this->vtkCollection::IsItemPresent(o); };
93 
94 private:
95  vtkActor2DCollection(const vtkActor2DCollection&); // Not implemented.
96  void operator=(const vtkActor2DCollection&); // Not implemented.
97 };
98 
100 {
101  return this->vtkCollection::IsItemPresent(a);
102 }
103 
105 {
106  return static_cast<vtkActor2D *>(this->GetNextItemAsObject());
107 }
108 
110 {
111  if ( this->Bottom == NULL )
112  {
113  return NULL;
114  }
115  else
116  {
117  return static_cast<vtkActor2D *>(this->Bottom->Item);
118  }
119 }
120 
122 {
123  return this->GetNextActor2D();
124 }
125 
127 {
128  return this->GetLastActor2D();
129 }
130 
131 #endif
132 
133 
134 
135 
136 
137 // VTK-HeaderTest-Exclude: vtkActor2DCollection.h
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:52
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:47
a list of 2D actors
abstract base class for most VTK objects
Definition: vtkObject.h:61
virtual void DeleteElement(vtkCollectionElement *)
abstract specification for Viewports
Definition: vtkViewport.h:46
a actor that draws 2D data
Definition: vtkActor2D.h:44
int IsItemPresent(vtkObject *a)
a list of Props
vtkCollectionElement * Bottom
void AddItem(vtkObject *)
int IsItemPresent(vtkActor2D *a)
void AddItem(vtkProp *a)
vtkActor2D * GetNextActor2D(vtkCollectionSimpleIterator &cookie)
#define VTKRENDERINGCORE_EXPORT
vtkObject * GetNextItemAsObject()
static vtkPropCollection * New()