00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkMapperCollection.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 __vtkMapperC_h 00027 #define __vtkMapperC_h 00028 00029 #include "vtkCollection.h" 00030 #include "vtkMapper.h" // Needed for direct access to mapper methods in 00031 // inline functions 00032 00033 class VTK_RENDERING_EXPORT vtkMapperCollection : public vtkCollection 00034 { 00035 public: 00036 static vtkMapperCollection *New(); 00037 vtkTypeRevisionMacro(vtkMapperCollection,vtkCollection); 00038 virtual void PrintSelf(ostream& os, vtkIndent indent); 00039 00041 00042 void AddItem(vtkMapper *a) { 00043 this->vtkCollection::AddItem(static_cast<vtkObject *>(a));}; 00045 00047 00048 vtkMapper *GetNextItem() { 00049 return static_cast<vtkMapper *>(this->GetNextItemAsObject());}; 00051 00053 vtkMapper *GetLastItem(); 00054 00055 //BTX 00057 00059 vtkMapper *GetNextMapper(vtkCollectionSimpleIterator &cookie) { 00060 return static_cast<vtkMapper *>(this->GetNextItemAsObject(cookie));}; 00061 //ETX 00063 00064 protected: 00065 vtkMapperCollection() {}; 00066 ~vtkMapperCollection() {}; 00067 00068 private: 00069 // hide the standard AddItem from the user and the compiler. 00070 void AddItem(vtkObject *o) { this->vtkCollection::AddItem(o); }; 00071 00072 private: 00073 vtkMapperCollection(const vtkMapperCollection&); // Not implemented. 00074 void operator=(const vtkMapperCollection&); // Not implemented. 00075 }; 00076 00077 00078 inline vtkMapper *vtkMapperCollection::GetLastItem() 00079 { 00080 if ( this->Bottom == NULL ) 00081 { 00082 return NULL; 00083 } 00084 else 00085 { 00086 return static_cast<vtkMapper *>(this->Bottom->Item); 00087 } 00088 } 00089 00090 #endif 00091 00092 00093 00094 00095