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

vtkMapperCollection.h

Go to the documentation of this file.
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 =========================================================================*/
00040 #ifndef __vtkMapperC_h
00041 #define __vtkMapperC_h
00042 
00043 #include "vtkCollection.h"
00044 #include "vtkMapper.h" // Needed for direct access to mapper methods in 
00045                        // inline functions
00046 
00047 class VTK_RENDERING_EXPORT vtkMapperCollection : public vtkCollection
00048 {
00049  public:
00050   static vtkMapperCollection *New();
00051   vtkTypeRevisionMacro(vtkMapperCollection,vtkCollection);
00052   virtual void PrintSelf(ostream& os, vtkIndent indent);
00053 
00055 
00056   void AddItem(vtkMapper *a) {
00057     this->vtkCollection::AddItem(static_cast<vtkObject *>(a));};
00059   
00061 
00062   vtkMapper *GetNextItem() { 
00063     return static_cast<vtkMapper *>(this->GetNextItemAsObject());};
00065   
00067   vtkMapper *GetLastItem();
00068   
00069   //BTX
00071 
00073   vtkMapper *GetNextMapper(vtkCollectionSimpleIterator &cookie) {
00074     return static_cast<vtkMapper *>(this->GetNextItemAsObject(cookie));};
00075   //ETX
00077 
00078 protected:  
00079   vtkMapperCollection() {};
00080   ~vtkMapperCollection() {};
00081 
00082 private:
00083   // hide the standard AddItem from the user and the compiler.
00084   void AddItem(vtkObject *o) { this->vtkCollection::AddItem(o); };
00085 
00086 private:
00087   vtkMapperCollection(const vtkMapperCollection&);  // Not implemented.
00088   void operator=(const vtkMapperCollection&);  // Not implemented.
00089 };
00090 
00091 
00092 inline vtkMapper *vtkMapperCollection::GetLastItem() 
00093 { 
00094   if ( this->Bottom == NULL )
00095     {
00096     return NULL;
00097     }
00098   else
00099     {
00100     return static_cast<vtkMapper *>(this->Bottom->Item);
00101     }
00102 }
00103 
00104 #endif
00105 
00106 
00107 
00108 
00109