00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkImageIterator.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 =========================================================================*/ 00028 #ifndef __vtkImageIterator_h 00029 #define __vtkImageIterator_h 00030 00031 #include "vtkSystemIncludes.h" 00032 class vtkImageData; 00033 00034 template<class DType> 00035 class vtkImageIterator 00036 { 00037 public: 00038 typedef DType *SpanIterator; 00039 00042 vtkImageIterator(); 00043 00045 vtkImageIterator(vtkImageData *id, int *ext); 00046 00049 void Initialize(vtkImageData *id, int *ext); 00050 00052 void NextSpan(); 00053 00055 00056 SpanIterator BeginSpan() 00057 { 00058 return this->Pointer; 00059 } 00061 00063 00064 SpanIterator EndSpan() 00065 { 00066 return this->SpanEndPointer; 00067 } 00069 00071 00072 int IsAtEnd() 00073 { 00074 return (this->Pointer >= this->EndPointer); 00075 } 00077 00078 protected: 00079 DType *Pointer; 00080 DType *SpanEndPointer; 00081 DType *SliceEndPointer; 00082 DType *EndPointer; 00083 vtkIdType Increments[3]; 00084 vtkIdType ContinuousIncrements[3]; 00085 }; 00086 00087 #ifdef VTK_NO_EXPLICIT_TEMPLATE_INSTANTIATION 00088 #include "vtkImageIterator.txx" 00089 #endif 00090 00091 #endif