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 "vtkRenderingCoreModule.h" // For export macro
30 #include "vtkPropCollection.h"
31 #include "vtkActor.h" // For inline methods
32 
33 class vtkProperty;
34 
36 {
37 public:
38  static vtkActorCollection *New();
40  virtual void PrintSelf(ostream& os, vtkIndent indent);
41 
43  void AddItem(vtkActor *a);
44 
46  vtkActor *GetNextActor();
47 
49  vtkActor *GetLastActor();
50 
52 
55  vtkActor *GetNextItem();
56  vtkActor *GetLastItem();
58 
60  void ApplyProperties(vtkProperty *p);
61 
62  //BTX
64 
67  return static_cast<vtkActor *>(this->GetNextItemAsObject(cookie));};
68  //ETX
70 
71 protected:
74 
75 
76 private:
77  // hide the standard AddItem from the user and the compiler.
78  void AddItem(vtkObject *o) { this->vtkCollection::AddItem(o); };
79  void AddItem(vtkProp *o) { this->vtkPropCollection::AddItem(o); };
80 
81 private:
82  vtkActorCollection(const vtkActorCollection&); // Not implemented.
83  void operator=(const vtkActorCollection&); // Not implemented.
84 };
85 
87 {
88  this->vtkCollection::AddItem(a);
89 }
90 
92 {
93  return static_cast<vtkActor *>(this->GetNextItemAsObject());
94 }
95 
97 {
98  if ( this->Bottom == NULL )
99  {
100  return NULL;
101  }
102  else
103  {
104  return static_cast<vtkActor *>(this->Bottom->Item);
105  }
106 }
107 
109 {
110  return this->GetNextActor();
111 }
112 
114 {
115  return this->GetLastActor();
116 }
117 
118 #endif
119 
120 
121 
122 
123 
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:50
abstract base class for most VTK objects
Definition: vtkObject.h:61
void PrintSelf(ostream &os, vtkIndent indent)
represent surface properties of a geometric object
Definition: vtkProperty.h:63
a list of Props
void AddItem(vtkActor *a)
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkActor * GetLastActor()
vtkActor * GetNextActor(vtkCollectionSimpleIterator &cookie)
a list of actors
vtkCollectionElement * Bottom
void AddItem(vtkObject *)
void AddItem(vtkProp *a)
#define VTKRENDERINGCORE_EXPORT
vtkActor * GetNextActor()
vtkObject * GetNextItemAsObject()
static vtkPropCollection * New()