VTK
vtkImageStencilIterator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageStencilIterator.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 =========================================================================*/
25 #ifndef vtkImageStencilIterator_h
26 #define vtkImageStencilIterator_h
27 
28 #include "vtkSystemIncludes.h"
29 #include "vtkImagingCoreModule.h"
30 class vtkImageData;
32 class vtkAlgorithm;
33 
34 template<class DType>
36 {
37 public:
41 
43 
47  vtkImageData *image, vtkImageStencilData *stencil, int extent[6],
48  vtkAlgorithm *algorithm=0, int threadId=0);
50 
52 
55  void Initialize(
56  vtkImageData *image, vtkImageStencilData *stencil, int extent[6]);
58 
60 
62  bool IsInStencil()
63  {
64  return this->InStencil;
65  }
67 
70  void NextSpan();
71 
73 
74  bool IsAtEnd()
75  {
76  return (this->Pointer == this->EndPointer);
77  }
79 
81 
82  DType *BeginSpan()
83  {
84  return this->Pointer;
85  }
87 
89 
90  DType *EndSpan()
91  {
92  return this->SpanEndPointer;
93  }
95 
96 protected:
97 
99  void SetSpanState(int idX);
100 
104  void ReportProgress();
105 
106  // Pointers
107  DType *Pointer; // current iterator position within data
108  DType *SpanEndPointer; // end of current span
109  DType *RowEndPointer; // end of current row
110  DType *SliceEndPointer; // end of current slice
111  DType *EndPointer; // end of data
112 
113  // Increments
114  vtkIdType PixelIncrement; // to next pixel
115  vtkIdType RowIncrement; // to same position in next row
116  vtkIdType SliceIncrement; // to same position in next slice
117  vtkIdType RowEndIncrement; // from end of row to start of next row
118  vtkIdType SliceEndIncrement; // from end of slice to start of next slice
119 
120  // Stencil-related items
122  bool InStencil;
125  int SpanMinX;
126  int SpanMaxX;
127  int SpanMinY;
128  int SpanMaxY;
129  int SpanMinZ;
130  int SpanMaxZ;
136 
137  // Progress-related items
141 };
142 
143 #ifdef VTK_NO_EXPLICIT_TEMPLATE_INSTANTIATION
144 #include "vtkImageStencilIterator.txx"
145 #endif
146 
147 #endif
148 // VTK-HeaderTest-Exclude: vtkImageStencilIterator.h
int vtkIdType
Definition: vtkType.h:275
an image region iterator
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:61
efficient description of an image stencil
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
#define VTKIMAGINGCORE_EXPORT