Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

dox/Common/vtkImageIterator.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkImageIterator.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00032 #ifndef __vtkImageIterator_h
00033 #define __vtkImageIterator_h
00034 
00035 #include "vtkSystemIncludes.h"
00036 class vtkImageData;
00037 
00038 template<class DType>
00039 class vtkImageIterator 
00040 {
00041 public:        
00042   typedef DType *SpanIterator;
00043   
00045   vtkImageIterator(vtkImageData *id, int *ext);
00046 
00048   void NextSpan();
00049 
00051 
00052   SpanIterator BeginSpan()
00053     {
00054       return this->Pointer;
00055     }
00057 
00059 
00060   SpanIterator EndSpan()
00061     {
00062       return this->SpanEndPointer;
00063     }
00065     
00067 
00068   int IsAtEnd()
00069     {
00070     return (this->Pointer >= this->EndPointer);
00071     }
00073 
00074 protected:
00075   DType *Pointer;
00076   DType *SpanEndPointer;
00077   DType *SliceEndPointer;
00078   DType *EndPointer;
00079   int    Increments[3];
00080   int    ContinuousIncrements[3];
00081 };
00082 
00083 #ifdef VTK_NO_EXPLICIT_TEMPLATE_INSTANTIATION
00084 #include "vtkImageIterator.txx"
00085 #endif 
00086 
00087 #endif