VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkImageSliceCollection.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 =========================================================================*/ 00025 #ifndef __vtkImageSliceCollection_h 00026 #define __vtkImageSliceCollection_h 00027 00028 #include "vtkPropCollection.h" 00029 #include "vtkImageSlice.h" // to allow inline static-cast 00030 00031 class VTK_RENDERING_EXPORT vtkImageSliceCollection : public vtkPropCollection 00032 { 00033 public: 00034 static vtkImageSliceCollection *New(); 00035 vtkTypeMacro(vtkImageSliceCollection,vtkPropCollection); 00036 00041 void Sort(); 00042 00045 void AddItem(vtkImageSlice *a); 00046 00050 vtkImageSlice *GetNextImage(); 00051 00052 //BTX 00054 00055 vtkImageSlice *GetNextImage(vtkCollectionSimpleIterator &cookie); 00056 //ETX 00058 00061 vtkImageSlice *GetNextItem() { return this->GetNextImage(); } 00062 00063 protected: 00064 vtkImageSliceCollection() {}; 00065 ~vtkImageSliceCollection(); 00066 00067 virtual void DeleteElement(vtkCollectionElement *); 00068 00069 private: 00070 // hide the standard AddItem from the user and the compiler. 00071 void AddItem(vtkObject *o) { this->vtkCollection::AddItem(o); }; 00072 void AddItem(vtkProp *o) { this->vtkPropCollection::AddItem(o); }; 00073 00074 private: 00075 vtkImageSliceCollection(const vtkImageSliceCollection&); // Not implemented. 00076 void operator=(const vtkImageSliceCollection&); // Not implemented. 00077 }; 00078 00079 inline vtkImageSlice *vtkImageSliceCollection::GetNextImage() 00080 { 00081 return static_cast<vtkImageSlice *>(this->GetNextItemAsObject()); 00082 } 00083 00084 inline vtkImageSlice *vtkImageSliceCollection::GetNextImage( 00085 vtkCollectionSimpleIterator &cookie) 00086 { 00087 return static_cast<vtkImageSlice *>(this->GetNextItemAsObject(cookie)); 00088 } 00089 00090 00091 #endif