VTK  9.3.0
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
17#ifndef vtkImageIterator_h
18#define vtkImageIterator_h
19
20#include "vtkCommonDataModelModule.h" // For export macro
21#include "vtkSystemIncludes.h"
22VTK_ABI_NAMESPACE_BEGIN
23class vtkImageData;
24
25template <class DType>
26class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator
27{
28public:
29 typedef DType* SpanIterator;
30
36
41
45 void Initialize(vtkImageData* id, int* ext);
46
50 void NextSpan();
51
55 SpanIterator BeginSpan() { return this->Pointer; }
56
60 SpanIterator EndSpan() { return this->SpanEndPointer; }
61
65 vtkTypeBool IsAtEnd() { return (this->Pointer >= this->EndPointer); }
66
67protected:
68 DType* Pointer;
71 DType* EndPointer;
72 vtkIdType Increments[3];
73 vtkIdType ContinuousIncrements[3];
74};
75
76#ifndef vtkImageIterator_cxx
77#ifdef _MSC_VER
78#pragma warning(push)
79// The following is needed when the vtkImageIterator is declared
80// dllexport and is used from another class in vtkCommonCore
81#pragma warning(disable : 4910) // extern and dllexport incompatible
82#endif
83vtkExternTemplateMacro(extern template class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator);
84#ifdef _MSC_VER
85#pragma warning(pop)
86#endif
87#endif
88
89VTK_ABI_NAMESPACE_END
90#endif
91// 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...
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:64
#define vtkExternTemplateMacro(decl)
A macro to declare extern templates for all numerical types.
Definition vtkType.h:410
int vtkIdType
Definition vtkType.h:315