VTK  9.2.6
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 =========================================================================*/
38 #ifndef vtkImageIterator_h
39 #define vtkImageIterator_h
40 
41 #include "vtkCommonDataModelModule.h" // For export macro
42 #include "vtkSystemIncludes.h"
43 class vtkImageData;
44 
45 template <class DType>
46 class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator
47 {
48 public:
49  typedef DType* SpanIterator;
50 
56 
61 
65  void Initialize(vtkImageData* id, int* ext);
66 
70  void NextSpan();
71 
75  SpanIterator BeginSpan() { return this->Pointer; }
76 
80  SpanIterator EndSpan() { return this->SpanEndPointer; }
81 
85  vtkTypeBool IsAtEnd() { return (this->Pointer >= this->EndPointer); }
86 
87 protected:
88  DType* Pointer;
91  DType* EndPointer;
92  vtkIdType Increments[3];
93  vtkIdType ContinuousIncrements[3];
94 };
95 
96 #ifndef vtkImageIterator_cxx
97 #ifdef _MSC_VER
98 #pragma warning(push)
99 // The following is needed when the vtkImageIterator is declared
100 // dllexport and is used from another class in vtkCommonCore
101 #pragma warning(disable : 4910) // extern and dllexport incompatible
102 #endif
103 vtkExternTemplateMacro(extern template class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator);
104 #ifdef _MSC_VER
105 #pragma warning(pop)
106 #endif
107 #endif
108 
109 #endif
110 // VTK-HeaderTest-Exclude: vtkImageIterator.h
topologically and geometrically regular array of data
Definition: vtkImageData.h:63
a simple image iterator
void Initialize(vtkImageData *id, int *ext)
Initialize the image iterator for a given image data, and given extent.
vtkImageIterator(vtkImageData *id, int *ext)
Create an image iterator for a given image data and a given extent.
vtkImageIterator()
Default empty constructor, useful only when creating an array of iterators You need to call Initializ...
SpanIterator BeginSpan()
Return an iterator (pointer) for the span.
void NextSpan()
Move the iterator to the next span.
SpanIterator EndSpan()
Return an iterator (pointer) for the end of the span.
vtkTypeBool IsAtEnd()
Test if the end of the extent has been reached.
int vtkTypeBool
Definition: vtkABI.h:69
vtkExternTemplateMacro(extern template class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator)
int vtkIdType
Definition: vtkType.h:332