VTK
dox/Common/DataModel/vtkImageIterator.h
Go to the documentation of this file.
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 "vtkCommonDataModelModule.h" // For export macro
00032 #include "vtkSystemIncludes.h"
00033 class vtkImageData;
00034 
00035 template<class DType>
00036 class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator
00037 {
00038 public:
00039   typedef DType *SpanIterator;
00040 
00043   vtkImageIterator();
00044 
00046   vtkImageIterator(vtkImageData *id, int *ext);
00047 
00050   void Initialize(vtkImageData *id, int *ext);
00051 
00053   void NextSpan();
00054 
00056 
00057   SpanIterator BeginSpan()
00058     {
00059     return this->Pointer;
00060     }
00062 
00064 
00065   SpanIterator EndSpan()
00066     {
00067     return this->SpanEndPointer;
00068     }
00070 
00072 
00073   int IsAtEnd()
00074     {
00075     return (this->Pointer >= this->EndPointer);
00076     }
00078 
00079 protected:
00080   DType *Pointer;
00081   DType *SpanEndPointer;
00082   DType *SliceEndPointer;
00083   DType *EndPointer;
00084   vtkIdType    Increments[3];
00085   vtkIdType    ContinuousIncrements[3];
00086 };
00087 
00088 #ifdef VTK_NO_EXPLICIT_TEMPLATE_INSTANTIATION
00089 #include "vtkImageIterator.txx"
00090 #endif
00091 
00092 #endif
00093 // VTK-HeaderTest-Exclude: vtkImageIterator.h