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 =========================================================================*/
27 #ifndef vtkActorCollection_h
28 #define vtkActorCollection_h
29 
30 #include "vtkRenderingCoreModule.h" // For export macro
31 #include "vtkPropCollection.h"
32 #include "vtkActor.h" // For inline methods
33 
34 class vtkProperty;
35 
36 class VTKRENDERINGCORE_EXPORT vtkActorCollection : public vtkPropCollection
37 {
38 public:
39  static vtkActorCollection *New();
41  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
42 
46  void AddItem(vtkActor *a);
47 
51  vtkActor *GetNextActor();
52 
56  vtkActor *GetLastActor();
57 
59 
64  vtkActor *GetNextItem();
65  vtkActor *GetLastItem();
67 
71  void ApplyProperties(vtkProperty *p);
72 
78  return static_cast<vtkActor *>(this->GetNextItemAsObject(cookie));};
79 
80 protected:
82  ~vtkActorCollection() VTK_OVERRIDE {}
83 
84 
85 private:
86  // hide the standard AddItem from the user and the compiler.
87  void AddItem(vtkObject *o) { this->vtkCollection::AddItem(o); };
88  void AddItem(vtkProp *o) { this->vtkPropCollection::AddItem(o); };
89 
90 private:
91  vtkActorCollection(const vtkActorCollection&) VTK_DELETE_FUNCTION;
92  void operator=(const vtkActorCollection&) VTK_DELETE_FUNCTION;
93 };
94 
95 inline void vtkActorCollection::AddItem(vtkActor *a)
96 {
97  this->vtkCollection::AddItem(a);
98 }
99 
101 {
102  return static_cast<vtkActor *>(this->GetNextItemAsObject());
103 }
104 
106 {
107  if ( this->Bottom == NULL )
108  {
109  return NULL;
110  }
111  else
112  {
113  return static_cast<vtkActor *>(this->Bottom->Item);
114  }
115 }
116 
118 {
119  return this->GetNextActor();
120 }
121 
123 {
124  return this->GetLastActor();
125 }
126 
127 #endif
128 
129 
130 
131 
132 
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:44
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:44
represents an object (geometry &amp; properties) in a rendered scene
Definition: vtkActor.h:45
abstract base class for most VTK objects
Definition: vtkObject.h:53
vtkActor * GetLastItem()
Access routines that are provided for compatibility with previous version of VTK. ...
represent surface properties of a geometric object
Definition: vtkProperty.h:58
an ordered list of Props
a simple class to control print indentation
Definition: vtkIndent.h:33
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()