VTK  9.7.20260803
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 "vtkSetGet.h" // For VTK_FUTURE_CONST
71#include "vtkSystemIncludes.h"
72
73VTK_ABI_NAMESPACE_BEGIN
74class vtkImageData;
75
76template <class DType>
77class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator
78{
79public:
80 typedef DType* SpanIterator;
81
87
91 vtkImageIterator(vtkImageData* id, VTK_FUTURE_CONST int ext[6]);
92
96 void Initialize(vtkImageData* id, VTK_FUTURE_CONST int ext[6]);
97
101 void NextSpan();
102
106 SpanIterator BeginSpan() { return this->Pointer; }
107
112
116 vtkTypeBool IsAtEnd() { return (this->Pointer >= this->EndPointer); }
117
118protected:
119 DType* Pointer;
125};
126
127#ifndef vtkImageIterator_cxx
128#ifdef _MSC_VER
129#pragma warning(push)
130// The following is needed when the vtkImageIterator is declared
131// dllexport and is used from another class in vtkCommonCore
132#pragma warning(disable : 4910) // extern and dllexport incompatible
133#endif
134vtkExternTemplateMacro(extern template class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator);
135#ifdef _MSC_VER
136#pragma warning(pop)
137#endif
138#endif
139
140VTK_ABI_NAMESPACE_END
141#endif
142// VTK-HeaderTest-Exclude: vtkImageIterator.h
topologically and geometrically regular array of data
a simple image iterator
vtkImageIterator()
Default empty constructor, useful only when creating an array of iterators You need to call Initializ...
vtkIdType ContinuousIncrements[3]
void Initialize(vtkImageData *id, VTK_FUTURE_CONST int ext[6])
Initialize the image iterator for a given image data, and given extent.
vtkImageIterator(vtkImageData *id, VTK_FUTURE_CONST int ext[6])
Create an image iterator for a given image data and a given extent.
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:458
int vtkIdType
Definition vtkType.h:363