VTK
dox/Rendering/Core/vtkActorCollection.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkActorCollection.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00026 #ifndef __vtkActorCollection_h
00027 #define __vtkActorCollection_h
00028 
00029 #include "vtkRenderingCoreModule.h" // For export macro
00030 #include "vtkPropCollection.h"
00031 #include "vtkActor.h" // For inline methods
00032 
00033 class vtkProperty;
00034 
00035 class VTKRENDERINGCORE_EXPORT vtkActorCollection : public vtkPropCollection
00036 {
00037 public:
00038   static vtkActorCollection *New();
00039   vtkTypeMacro(vtkActorCollection,vtkPropCollection);
00040   virtual void PrintSelf(ostream& os, vtkIndent indent);
00041 
00043   void AddItem(vtkActor *a);
00044 
00046   vtkActor *GetNextActor();
00047 
00049   vtkActor *GetLastActor();
00050 
00052 
00055   vtkActor *GetNextItem();
00056   vtkActor *GetLastItem();
00058 
00060   void ApplyProperties(vtkProperty *p);
00061 
00062   //BTX
00064 
00066   vtkActor *GetNextActor(vtkCollectionSimpleIterator &cookie) {
00067     return static_cast<vtkActor *>(this->GetNextItemAsObject(cookie));};
00068   //ETX
00070 
00071 protected:
00072   vtkActorCollection() {};
00073   ~vtkActorCollection() {};
00074 
00075 
00076 private:
00077   // hide the standard AddItem from the user and the compiler.
00078   void AddItem(vtkObject *o) { this->vtkCollection::AddItem(o); };
00079   void AddItem(vtkProp *o) { this->vtkPropCollection::AddItem(o); };
00080 
00081 private:
00082   vtkActorCollection(const vtkActorCollection&);  // Not implemented.
00083   void operator=(const vtkActorCollection&);  // Not implemented.
00084 };
00085 
00086 inline void vtkActorCollection::AddItem(vtkActor *a)
00087 {
00088   this->vtkCollection::AddItem(a);
00089 }
00090 
00091 inline vtkActor *vtkActorCollection::GetNextActor()
00092 {
00093   return static_cast<vtkActor *>(this->GetNextItemAsObject());
00094 }
00095 
00096 inline vtkActor *vtkActorCollection::GetLastActor()
00097 {
00098   if ( this->Bottom == NULL )
00099     {
00100     return NULL;
00101     }
00102   else
00103     {
00104     return static_cast<vtkActor *>(this->Bottom->Item);
00105     }
00106 }
00107 
00108 inline vtkActor *vtkActorCollection::GetNextItem()
00109 {
00110   return this->GetNextActor();
00111 }
00112 
00113 inline vtkActor *vtkActorCollection::GetLastItem()
00114 {
00115   return this->GetLastActor();
00116 }
00117 
00118 #endif
00119 
00120 
00121 
00122 
00123