VTK  9.3.20240423
vtkActor2DCollection.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
16#ifndef vtkActor2DCollection_h
17#define vtkActor2DCollection_h
18
19#include "vtkPropCollection.h"
20#include "vtkRenderingCoreModule.h" // For export macro
21#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
22
23#include "vtkActor2D.h" // Needed for inline methods
24
25VTK_ABI_NAMESPACE_BEGIN
26class vtkViewport;
27
28class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkActor2DCollection : public vtkPropCollection
29{
30public:
36
38 void PrintSelf(ostream& os, vtkIndent indent) override;
39
44 void Sort();
45
51
53
58 vtkActor2D* GetNextActor2D();
59 vtkActor2D* GetLastActor2D();
61
63
68 vtkActor2D* GetNextItem();
69 vtkActor2D* GetLastItem();
71
75 void RenderOverlay(vtkViewport* viewport);
76
82 {
83 return static_cast<vtkActor2D*>(this->GetNextItemAsObject(cookie));
84 }
85
86protected:
89
91
92private:
93 // hide the standard AddItem from the user and the compiler.
94 void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
95 void AddItem(vtkProp* o) { this->vtkPropCollection::AddItem(o); }
96 int IsItemPresent(vtkObject* o) { return this->vtkCollection::IsItemPresent(o); }
98
100 void operator=(const vtkActor2DCollection&) = delete;
101};
102
104{
105 return this->vtkCollection::IsItemPresent(a);
106}
107
109{
111}
112
114{
115 return static_cast<vtkActor2D*>(this->GetNextItemAsObject());
116}
117
119{
120 if (this->Bottom == nullptr)
121 {
122 return nullptr;
123 }
124 else
125 {
126 return static_cast<vtkActor2D*>(this->Bottom->Item);
127 }
128}
129
131{
132 return this->GetNextActor2D();
133}
134
136{
137 return this->GetLastActor2D();
138}
139
140VTK_ABI_NAMESPACE_END
141#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
int IndexOfFirstOccurence(vtkActor2D *a)
Standard Collection methods.
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:145
int IndexOfFirstOccurence(vtkObject *a)
Search for an object and return location in list.
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:108
abstract base class for most VTK objects
Definition vtkObject.h:162
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:66
abstract specification for Viewports
Definition vtkViewport.h:65
void * vtkCollectionSimpleIterator
#define VTK_MARSHALAUTO