VTK  9.5.20251120
vtkImageIterator.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
65
66#ifndef vtkImageIterator_h
67#define vtkImageIterator_h
68
69#include "vtkCommonDataModelModule.h" // For export macro
70#include "vtkSystemIncludes.h"
71VTK_ABI_NAMESPACE_BEGIN
72class vtkImageData;
73
74template <class DType>
75class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator
76{
77public:
78 typedef DType* SpanIterator;
79
85
90
94 void Initialize(vtkImageData* id, int* ext);
95
99 void NextSpan();
100
104 SpanIterator BeginSpan() { return this->Pointer; }
105
110
114 vtkTypeBool IsAtEnd() { return (this->Pointer >= this->EndPointer); }
115
116protected:
117 DType* Pointer;
123};
124
125#ifndef vtkImageIterator_cxx
126#ifdef _MSC_VER
127#pragma warning(push)
128// The following is needed when the vtkImageIterator is declared
129// dllexport and is used from another class in vtkCommonCore
130#pragma warning(disable : 4910) // extern and dllexport incompatible
131#endif
132vtkExternTemplateMacro(extern template class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator);
133#ifdef _MSC_VER
134#pragma warning(pop)
135#endif
136#endif
137
138VTK_ABI_NAMESPACE_END
139#endif
140// VTK-HeaderTest-Exclude: vtkImageIterator.h
topologically and geometrically regular array of data
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...
vtkIdType ContinuousIncrements[3]
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.
vtkIdType Increments[3]
vtkTypeBool IsAtEnd()
Test if the end of the extent has been reached.
int vtkTypeBool
Definition vtkABI.h:64
#define vtkExternTemplateMacro(decl)
A macro to declare extern templates for all numerical types.
Definition vtkType.h:492
int vtkIdType
Definition vtkType.h:367