Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkActorCollection.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkActorCollection.h,v $
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 =========================================================================*/
00041 #ifndef __vtkActorC_h
00042 #define __vtkActorC_h
00043 
00044 #include "vtkPropCollection.h"
00045 #include "vtkActor.h" // For inline methods
00046 
00047 class vtkProperty;
00048 
00049 class VTK_RENDERING_EXPORT vtkActorCollection : public vtkPropCollection
00050 {
00051 public:
00052   static vtkActorCollection *New();
00053   vtkTypeRevisionMacro(vtkActorCollection,vtkPropCollection);
00054   virtual void PrintSelf(ostream& os, vtkIndent indent);
00055 
00057   void AddItem(vtkActor *a);
00058 
00060   vtkActor *GetNextActor();
00061 
00063   vtkActor *GetLastActor();
00064 
00066 
00069   vtkActor *GetNextItem();
00070   vtkActor *GetLastItem();
00072 
00074   void ApplyProperties(vtkProperty *p); 
00075 
00076   //BTX
00078 
00080   vtkActor *GetNextActor(vtkCollectionSimpleIterator &cookie) {
00081     return static_cast<vtkActor *>(this->GetNextItemAsObject(cookie));};
00082   //ETX
00084 
00085 protected:
00086   vtkActorCollection() {};
00087   ~vtkActorCollection() {};
00088     
00089 
00090 private:
00091   // hide the standard AddItem from the user and the compiler.
00092   void AddItem(vtkObject *o) { this->vtkCollection::AddItem(o); };
00093   void AddItem(vtkProp *o) { this->vtkPropCollection::AddItem(o); };
00094 
00095 private:
00096   vtkActorCollection(const vtkActorCollection&);  // Not implemented.
00097   void operator=(const vtkActorCollection&);  // Not implemented.
00098 };
00099 
00100 inline void vtkActorCollection::AddItem(vtkActor *a) 
00101 {
00102   this->vtkCollection::AddItem((vtkObject *)a);
00103 }
00104 
00105 inline vtkActor *vtkActorCollection::GetNextActor() 
00106 { 
00107   return static_cast<vtkActor *>(this->GetNextItemAsObject());
00108 }
00109 
00110 inline vtkActor *vtkActorCollection::GetLastActor() 
00111 { 
00112   if ( this->Bottom == NULL )
00113     {
00114     return NULL;
00115     }
00116   else
00117     {
00118     return static_cast<vtkActor *>(this->Bottom->Item);
00119     }
00120 }
00121 
00122 inline vtkActor *vtkActorCollection::GetNextItem() 
00123 { 
00124   return this->GetNextActor();
00125 }
00126 
00127 inline vtkActor *vtkActorCollection::GetLastItem() 
00128 {
00129   return this->GetLastActor();
00130 }
00131 
00132 #endif
00133 
00134 
00135 
00136 
00137