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 =========================================================================*/
26 #ifndef vtkImageIterator_h
27 #define vtkImageIterator_h
28 
29 #include "vtkCommonDataModelModule.h" // For export macro
30 #include "vtkSystemIncludes.h"
31 class vtkImageData;
32 
33 template<class DType>
34 class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator
35 {
36 public:
37  typedef DType *SpanIterator;
38 
44 
48  vtkImageIterator(vtkImageData *id, int *ext);
49 
53  void Initialize(vtkImageData *id, int *ext);
54 
58  void NextSpan();
59 
64  {
65  return this->Pointer;
66  }
67 
72  {
73  return this->SpanEndPointer;
74  }
75 
79  int IsAtEnd()
80  {
81  return (this->Pointer >= this->EndPointer);
82  }
83 
84 protected:
85  DType *Pointer;
88  DType *EndPointer;
89  vtkIdType Increments[3];
90  vtkIdType ContinuousIncrements[3];
91 };
92 
93 #ifndef vtkImageIterator_cxx
94 #ifdef _MSC_VER
95 #pragma warning (push)
96 // The following is needed when the vtkImageIterator is declared
97 // dllexport and is used from another class in vtkCommonCore
98 #pragma warning (disable: 4910) // extern and dllexport incompatible
99 #endif
101  extern template class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator
102 )
103 #ifdef _MSC_VER
104 #pragma warning (pop)
105 #endif
106 #endif
107 
108 #endif
109 // VTK-HeaderTest-Exclude: vtkImageIterator.h
SpanIterator BeginSpan()
Return an iterator (pointer) for the span.
int vtkIdType
Definition: vtkType.h:345
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:413
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
SpanIterator EndSpan()
Return an iterator (pointer) for the end of the span.
a simple image iterator