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 "vtkPropCollection.h"
31 
32 #include "vtkActor2D.h" // Needed for inline methods
33 
34 class vtkViewport;
35 
37 {
38  public:
41  static vtkActor2DCollection *New();
42 
44 
47  void Sort();
48 
51  void AddItem(vtkActor2D *a);
52 
54 
55  int IsItemPresent(vtkActor2D *a);
56  vtkActor2D *GetNextActor2D();
57  vtkActor2D *GetLastActor2D();
59 
61 
64  vtkActor2D *GetNextItem();
65  vtkActor2D *GetLastItem();
67 
68 
70  void RenderOverlay(vtkViewport* viewport);
71 
72  //BTX
74 
77  return static_cast<vtkActor2D *>(this->GetNextItemAsObject(cookie));};
78  //ETX
80 
81 protected:
84 
85  virtual void DeleteElement(vtkCollectionElement *);
86 
87 private:
88  // hide the standard AddItem from the user and the compiler.
89  void AddItem(vtkObject *o) { this->vtkCollection::AddItem(o); };
90  void AddItem(vtkProp *o) { this->vtkPropCollection::AddItem(o); };
91  int IsItemPresent(vtkObject *o) { return this->vtkCollection::IsItemPresent(o); };
92 
93 private:
94  vtkActor2DCollection(const vtkActor2DCollection&); // Not implemented.
95  void operator=(const vtkActor2DCollection&); // Not implemented.
96 };
97 
98 inline int vtkActor2DCollection::IsItemPresent(vtkActor2D *a)
99 {
100  return this->vtkCollection::IsItemPresent(a);
101 }
102 
104 {
105  return static_cast<vtkActor2D *>(this->GetNextItemAsObject());
106 }
107 
109 {
110  if ( this->Bottom == NULL )
111  {
112  return NULL;
113  }
114  else
115  {
116  return static_cast<vtkActor2D *>(this->Bottom->Item);
117  }
118 }
119 
121 {
122  return this->GetNextActor2D();
123 }
124 
126 {
127  return this->GetLastActor2D();
128 }
129 
130 #endif
131 
132 
133 
134 
135 
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:49
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:46
a list of 2D actors
abstract base class for most VTK objects
Definition: vtkObject.h:60
virtual void DeleteElement(vtkCollectionElement *)
#define VTK_FILTERING_EXPORT
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)
vtkObject * GetNextItemAsObject()
static vtkPropCollection * New()