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 =========================================================================*/
26 #ifndef __vtkActorCollection_h
27 #define __vtkActorCollection_h
28 
29 #include "vtkPropCollection.h"
30 #include "vtkActor.h" // For inline methods
31 
32 class vtkProperty;
33 
35 {
36 public:
37  static vtkActorCollection *New();
39  virtual void PrintSelf(ostream& os, vtkIndent indent);
40 
42  void AddItem(vtkActor *a);
43 
45  vtkActor *GetNextActor();
46 
48  vtkActor *GetLastActor();
49 
51 
54  vtkActor *GetNextItem();
55  vtkActor *GetLastItem();
57 
59  void ApplyProperties(vtkProperty *p);
60 
61  //BTX
63 
66  return static_cast<vtkActor *>(this->GetNextItemAsObject(cookie));};
67  //ETX
69 
70 protected:
73 
74 
75 private:
76  // hide the standard AddItem from the user and the compiler.
77  void AddItem(vtkObject *o) { this->vtkCollection::AddItem(o); };
78  void AddItem(vtkProp *o) { this->vtkPropCollection::AddItem(o); };
79 
80 private:
81  vtkActorCollection(const vtkActorCollection&); // Not implemented.
82  void operator=(const vtkActorCollection&); // Not implemented.
83 };
84 
86 {
87  this->vtkCollection::AddItem(a);
88 }
89 
91 {
92  return static_cast<vtkActor *>(this->GetNextItemAsObject());
93 }
94 
96 {
97  if ( this->Bottom == NULL )
98  {
99  return NULL;
100  }
101  else
102  {
103  return static_cast<vtkActor *>(this->Bottom->Item);
104  }
105 }
106 
108 {
109  return this->GetNextActor();
110 }
111 
113 {
114  return this->GetLastActor();
115 }
116 
117 #endif
118 
119 
120 
121 
122