VTK
vtkImageIterator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageIterator.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
28 #ifndef vtkImageIterator_h
29 #define vtkImageIterator_h
30 
31 #include "vtkCommonDataModelModule.h" // For export macro
32 #include "vtkSystemIncludes.h"
33 class vtkImageData;
34 
35 template<class DType>
37 {
38 public:
39  typedef DType *SpanIterator;
40 
44 
46  vtkImageIterator(vtkImageData *id, int *ext);
47 
50  void Initialize(vtkImageData *id, int *ext);
51 
53  void NextSpan();
54 
56 
57  SpanIterator BeginSpan()
58  {
59  return this->Pointer;
60  }
62 
64 
65  SpanIterator EndSpan()
66  {
67  return this->SpanEndPointer;
68  }
70 
72 
73  int IsAtEnd()
74  {
75  return (this->Pointer >= this->EndPointer);
76  }
78 
79 protected:
80  DType *Pointer;
83  DType *EndPointer;
84  vtkIdType Increments[3];
85  vtkIdType ContinuousIncrements[3];
86 };
87 
88 #ifdef VTK_NO_EXPLICIT_TEMPLATE_INSTANTIATION
89 #include "vtkImageIterator.txx"
90 #endif
91 
92 #endif
93 // VTK-HeaderTest-Exclude: vtkImageIterator.h
SpanIterator BeginSpan()
int vtkIdType
Definition: vtkType.h:275
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
SpanIterator EndSpan()
#define VTKCOMMONDATAMODEL_EXPORT
a simple image iterator