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 "vtkRenderingImageModule.h" // For export macro 00029 #include "vtkPropCollection.h" 00030 #include "vtkImageSlice.h" // to allow inline static-cast 00031 00032 class VTKRENDERINGIMAGE_EXPORT vtkImageSliceCollection : public vtkPropCollection 00033 { 00034 public: 00035 static vtkImageSliceCollection *New(); 00036 vtkTypeMacro(vtkImageSliceCollection,vtkPropCollection); 00037 00042 void Sort(); 00043 00046 void AddItem(vtkImageSlice *a); 00047 00051 vtkImageSlice *GetNextImage(); 00052 00053 //BTX 00055 00056 vtkImageSlice *GetNextImage(vtkCollectionSimpleIterator &cookie); 00057 //ETX 00059 00062 vtkImageSlice *GetNextItem() { return this->GetNextImage(); } 00063 00064 protected: 00065 vtkImageSliceCollection() {}; 00066 ~vtkImageSliceCollection(); 00067 00068 virtual void DeleteElement(vtkCollectionElement *); 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 vtkImageSliceCollection(const vtkImageSliceCollection&); // Not implemented. 00077 void operator=(const vtkImageSliceCollection&); // Not implemented. 00078 }; 00079 00080 inline vtkImageSlice *vtkImageSliceCollection::GetNextImage() 00081 { 00082 return static_cast<vtkImageSlice *>(this->GetNextItemAsObject()); 00083 } 00084 00085 inline vtkImageSlice *vtkImageSliceCollection::GetNextImage( 00086 vtkCollectionSimpleIterator &cookie) 00087 { 00088 return static_cast<vtkImageSlice *>(this->GetNextItemAsObject(cookie)); 00089 } 00090 00091 00092 #endif