00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkCullerCollection.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 __vtkCullerCollection_h 00027 #define __vtkCullerCollection_h 00028 00029 #include "vtkCollection.h" 00030 #include "vtkCuller.h" // for inline functions 00031 00032 class VTK_RENDERING_EXPORT vtkCullerCollection : public vtkCollection 00033 { 00034 public: 00035 static vtkCullerCollection *New(); 00036 vtkTypeMacro(vtkCullerCollection,vtkCollection); 00037 virtual void PrintSelf(ostream& os, vtkIndent indent); 00038 00040 00041 void AddItem(vtkCuller *a) 00042 { 00043 this->vtkCollection::AddItem(a); 00044 } 00046 00048 00049 vtkCuller *GetNextItem() 00050 { 00051 return static_cast<vtkCuller *>(this->GetNextItemAsObject()); 00052 } 00054 00056 vtkCuller *GetLastItem(); 00057 00058 //BTX 00060 00062 vtkCuller *GetNextCuller(vtkCollectionSimpleIterator &cookie) 00063 { 00064 return static_cast<vtkCuller *>(this->GetNextItemAsObject(cookie)); 00065 } 00066 //ETX 00068 00069 protected: 00070 vtkCullerCollection() {} 00071 ~vtkCullerCollection() {} 00072 00073 private: 00074 // hide the standard AddItem from the user and the compiler. 00075 void AddItem(vtkObject *o) 00076 { 00077 this->vtkCollection::AddItem(o); 00078 } 00079 00080 private: 00081 vtkCullerCollection(const vtkCullerCollection&); // Not implemented. 00082 void operator=(const vtkCullerCollection&); // Not implemented. 00083 }; 00084 00085 00086 inline vtkCuller *vtkCullerCollection::GetLastItem() 00087 { 00088 if ( this->Bottom == NULL ) 00089 { 00090 return NULL; 00091 } 00092 else 00093 { 00094 return static_cast<vtkCuller *>(this->Bottom->Item); 00095 } 00096 } 00097 00098 #endif 00099 00100 00101 00102 00103