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

Rendering/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 =========================================================================*/
00026 #ifndef __vtkActorC_h
00027 #define __vtkActorC_h
00028 
00029 #include "vtkPropCollection.h"
00030 #include "vtkActor.h" // For inline methods
00031 
00032 class vtkProperty;
00033 
00034 class VTK_RENDERING_EXPORT vtkActorCollection : public vtkPropCollection
00035 {
00036 public:
00037   static vtkActorCollection *New();
00038   vtkTypeRevisionMacro(vtkActorCollection,vtkPropCollection);
00039   virtual void PrintSelf(ostream& os, vtkIndent indent);
00040 
00042   void AddItem(vtkActor *a);
00043 
00045   vtkActor *GetNextActor();
00046 
00048   vtkActor *GetLastActor();
00049 
00051 
00054   vtkActor *GetNextItem();
00055   vtkActor *GetLastItem();
00057 
00059   void ApplyProperties(vtkProperty *p); 
00060 
00061 protected:
00062   vtkActorCollection() {};
00063   ~vtkActorCollection() {};
00064     
00065 
00066 private:
00067   // hide the standard AddItem from the user and the compiler.
00068   void AddItem(vtkObject *o) { this->vtkCollection::AddItem(o); };
00069   void AddItem(vtkProp *o) { this->vtkPropCollection::AddItem(o); };
00070 
00071 private:
00072   vtkActorCollection(const vtkActorCollection&);  // Not implemented.
00073   void operator=(const vtkActorCollection&);  // Not implemented.
00074 };
00075 
00076 inline void vtkActorCollection::AddItem(vtkActor *a) 
00077 {
00078   this->vtkCollection::AddItem((vtkObject *)a);
00079 }
00080 
00081 inline vtkActor *vtkActorCollection::GetNextActor() 
00082 { 
00083   return static_cast<vtkActor *>(this->GetNextItemAsObject());
00084 }
00085 
00086 inline vtkActor *vtkActorCollection::GetLastActor() 
00087 { 
00088   if ( this->Bottom == NULL )
00089     {
00090     return NULL;
00091     }
00092   else
00093     {
00094     return static_cast<vtkActor *>(this->Bottom->Item);
00095     }
00096 }
00097 
00098 inline vtkActor *vtkActorCollection::GetNextItem() 
00099 { 
00100   return this->GetNextActor();
00101 }
00102 
00103 inline vtkActor *vtkActorCollection::GetLastItem() 
00104 {
00105   return this->GetLastActor();
00106 }
00107 
00108 #endif
00109 
00110 
00111 
00112 
00113