00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkImageIterator.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 =========================================================================*/ 00039 #ifndef __vtkImageIterator_h 00040 #define __vtkImageIterator_h 00041 00042 #include "vtkSystemIncludes.h" 00043 class vtkImageData; 00044 00045 template<class DType> 00046 class vtkImageIterator 00047 { 00048 public: 00049 typedef DType *SpanIterator; 00050 00052 vtkImageIterator(vtkImageData *id, int *ext); 00053 00055 void NextSpan(); 00056 00058 00059 SpanIterator BeginSpan() 00060 { 00061 return this->Pointer; 00062 } 00064 00066 00067 SpanIterator EndSpan() 00068 { 00069 return this->SpanEndPointer; 00070 } 00072 00074 00075 int IsAtEnd() 00076 { 00077 return (this->Pointer >= this->EndPointer); 00078 } 00080 00081 protected: 00082 DType *Pointer; 00083 DType *SpanEndPointer; 00084 DType *SliceEndPointer; 00085 DType *EndPointer; 00086 int Increments[3]; 00087 int ContinuousIncrements[3]; 00088 }; 00089 00090 #ifdef VTK_NO_EXPLICIT_TEMPLATE_INSTANTIATION 00091 #include "vtkImageIterator.txx" 00092 #endif 00093 00094 #endif