VTK
vtkActorCollection.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkActorCollection.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 =========================================================================*/
30 #ifndef vtkActorCollection_h
31 #define vtkActorCollection_h
32 
33 #include "vtkRenderingCoreModule.h" // For export macro
34 #include "vtkPropCollection.h"
35 #include "vtkActor.h" // For inline methods
36 
37 class vtkProperty;
38 
39 class VTKRENDERINGCORE_EXPORT vtkActorCollection : public vtkPropCollection
40 {
41 public:
42  static vtkActorCollection *New();
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
49  void AddItem(vtkActor *a);
50 
54  vtkActor *GetNextActor();
55 
59  vtkActor *GetLastActor();
60 
62 
67  vtkActor *GetNextItem();
68  vtkActor *GetLastItem();
70 
74  void ApplyProperties(vtkProperty *p);
75 
81  return static_cast<vtkActor *>(this->GetNextItemAsObject(cookie));};
82 
83 protected:
85  ~vtkActorCollection() override {}
86 
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 
93 private:
94  vtkActorCollection(const vtkActorCollection&) = delete;
95  void operator=(const vtkActorCollection&) = delete;
96 };
97 
99 {
100  this->vtkCollection::AddItem(a);
101 }
102 
104 {
105  return static_cast<vtkActor *>(this->GetNextItemAsObject());
106 }
107 
109 {
110  if ( this->Bottom == nullptr )
111  {
112  return nullptr;
113  }
114  else
115  {
116  return static_cast<vtkActor *>(this->Bottom->Item);
117  }
118 }
119 
121 {
122  return this->GetNextActor();
123 }
124 
126 {
127  return this->GetLastActor();
128 }
129 
130 #endif
131 
132 
133 
134 
135 
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:52
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:47
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
abstract base class for most VTK objects
Definition: vtkObject.h:59
vtkActor * GetLastItem()
Access routines that are provided for compatibility with previous version of VTK. ...
represent surface properties of a geometric object
Definition: vtkProperty.h:66
an ordered list of Props
void AddItem(vtkActor *a)
Add an actor to the bottom of the list.
a simple class to control print indentation
Definition: vtkIndent.h:39
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkActor * GetLastActor()
Get the last actor in the list.
vtkActor * GetNextActor(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
vtkActor * GetNextItem()
Access routines that are provided for compatibility with previous version of VTK. ...
an ordered list of actors
~vtkActorCollection() override
void AddItem(vtkObject *)
Add an object to the bottom of the list.
void AddItem(vtkProp *a)
Add a Prop to the bottom of the list.
vtkActor * GetNextActor()
Get the next actor in the list.
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
static vtkPropCollection * New()