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