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=========================================================================*/
26#ifndef vtkImageIterator_h
27#define vtkImageIterator_h
28
29#include "vtkCommonDataModelModule.h" // For export macro
30#include "vtkSystemIncludes.h"
31class vtkImageData;
32
33template <class DType>
34class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator
35{
36public:
37 typedef DType* SpanIterator;
38
44
49
53 void Initialize(vtkImageData* id, int* ext);
54
58 void NextSpan();
59
63 SpanIterator BeginSpan() { return this->Pointer; }
64
68 SpanIterator EndSpan() { return this->SpanEndPointer; }
69
73 vtkTypeBool IsAtEnd() { return (this->Pointer >= this->EndPointer); }
74
75protected:
76 DType* Pointer;
79 DType* EndPointer;
80 vtkIdType Increments[3];
81 vtkIdType ContinuousIncrements[3];
82};
83
84#ifndef vtkImageIterator_cxx
85#ifdef _MSC_VER
86#pragma warning(push)
87// The following is needed when the vtkImageIterator is declared
88// dllexport and is used from another class in vtkCommonCore
89#pragma warning(disable : 4910) // extern and dllexport incompatible
90#endif
91vtkExternTemplateMacro(extern template class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator);
92#ifdef _MSC_VER
93#pragma warning(pop)
94#endif
95#endif
96
97#endif
98// 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:69
#define vtkExternTemplateMacro(decl)
A macro to declare extern templates for all numerical types.
Definition vtkType.h:395
int vtkIdType
Definition vtkType.h:332