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 
36 class vtkViewport;
37 
38 class VTKRENDERINGCORE_EXPORT vtkActor2DCollection : public vtkPropCollection
39 {
40  public:
45  static vtkActor2DCollection *New();
46 
48 
53  void Sort();
54 
59  void AddItem(vtkActor2D *a);
60 
62 
65  int IsItemPresent(vtkActor2D *a);
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 
93 protected:
95  ~vtkActor2DCollection() override;
96 
97  void DeleteElement(vtkCollectionElement *) override;
98 
99 private:
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 
105 private:
107  void operator=(const vtkActor2DCollection&) = delete;
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 == nullptr )
123  {
124  return nullptr;
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
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:59
virtual void DeleteElement(vtkCollectionElement *)
abstract specification for Viewports
Definition: vtkViewport.h:47
a actor that draws 2D data
Definition: vtkActor2D.h:45
vtkActor2D * GetLastActor2D()
Standard Collection methods.
int IsItemPresent(vtkObject *a)
Search for an object and return location in list.
an ordered list of Props
vtkActor2D * GetNextItem()
Access routines that are provided for compatibility with previous version of VTK. ...
void AddItem(vtkObject *)
Add an object to the bottom of the list.
int IsItemPresent(vtkActor2D *a)
Standard Collection methods.
void AddItem(vtkProp *a)
Add a Prop to the bottom of the list.
vtkActor2D * GetNextActor2D(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
vtkActor2D * GetNextActor2D()
Standard Collection methods.
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
static vtkPropCollection * New()
vtkActor2D * GetLastItem()
Access routines that are provided for compatibility with previous version of VTK. ...