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 =========================================================================*/
29 #ifndef vtkImageIterator_h
30 #define vtkImageIterator_h
31 
32 #include "vtkCommonDataModelModule.h" // For export macro
33 #include "vtkSystemIncludes.h"
34 class vtkImageData;
35 
36 template<class DType>
37 class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator
38 {
39 public:
40  typedef DType *SpanIterator;
41 
47 
51  vtkImageIterator(vtkImageData *id, int *ext);
52 
56  void Initialize(vtkImageData *id, int *ext);
57 
61  void NextSpan();
62 
66  SpanIterator BeginSpan()
67  {
68  return this->Pointer;
69  }
70 
74  SpanIterator EndSpan()
75  {
76  return this->SpanEndPointer;
77  }
78 
82  int IsAtEnd()
83  {
84  return (this->Pointer >= this->EndPointer);
85  }
86 
87 protected:
88  DType *Pointer;
91  DType *EndPointer;
92  vtkIdType Increments[3];
93  vtkIdType ContinuousIncrements[3];
94 };
95 
96 #ifndef vtkImageIterator_cxx
98  extern template class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator
99 )
100 #endif
101 
102 #endif
103 // VTK-HeaderTest-Exclude: vtkImageIterator.h
SpanIterator BeginSpan()
Return an iterator (pointer) for the span.
int vtkIdType
Definition: vtkType.h:287
int IsAtEnd()
Test if the end of the extent has been reached.
#define vtkExternTemplateMacro(decl)
A macro to declare extern templates for all numerical types.
Definition: vtkType.h:345
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
SpanIterator EndSpan()
Return an iterator (pointer) for the end of the span.
a simple image iterator