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 
48  vtkAlgorithm *algorithm=0, int threadId=0);
50 
52 
55  void Initialize(
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 
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
vtkImageStencilIterator::SpanSliceEndIncrement
int SpanSliceEndIncrement
Definition: vtkImageStencilIterator.h:123
vtkImageStencilIterator::SliceEndIncrement
vtkIdType SliceEndIncrement
Definition: vtkImageStencilIterator.h:118
vtkImageStencilIterator::SpanCountPointer
int * SpanCountPointer
Definition: vtkImageStencilIterator.h:134
vtkImageStencilIterator::RowEndPointer
DType * RowEndPointer
Definition: vtkImageStencilIterator.h:109
vtkImageStencilIterator
an image region iterator
Definition: vtkImageStencilIterator.h:36
vtkImageStencilIterator::IsAtEnd
bool IsAtEnd()
Definition: vtkImageStencilIterator.h:74
vtkIdType
int vtkIdType
Definition: vtkType.h:275
vtkImageStencilIterator::SpanMinZ
int SpanMinZ
Definition: vtkImageStencilIterator.h:129
vtkAlgorithm
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:62
vtkImageStencilIterator::Algorithm
vtkAlgorithm * Algorithm
Definition: vtkImageStencilIterator.h:138
vtkImageStencilIterator::ReportProgress
void ReportProgress()
vtkImageStencilIterator::SpanMaxZ
int SpanMaxZ
Definition: vtkImageStencilIterator.h:130
vtkImageStencilIterator::SliceIncrement
vtkIdType SliceIncrement
Definition: vtkImageStencilIterator.h:116
vtkImageStencilIterator::SpanMinY
int SpanMinY
Definition: vtkImageStencilIterator.h:127
vtkImageStencilIterator::SpanIndexX
int SpanIndexX
Definition: vtkImageStencilIterator.h:131
vtkImageStencilIterator::SpanMaxX
int SpanMaxX
Definition: vtkImageStencilIterator.h:126
vtkImageStencilIterator::BeginSpan
DType * BeginSpan()
Definition: vtkImageStencilIterator.h:82
vtkImageStencilIterator::Initialize
void Initialize(vtkImageData *image, vtkImageStencilData *stencil, int extent[6])
vtkImageStencilIterator::EndPointer
DType * EndPointer
Definition: vtkImageStencilIterator.h:111
vtkgl::stencil
GLint GLfloat GLint stencil
Definition: vtkgl.h:12368
vtkImageStencilIterator::NextSpan
void NextSpan()
vtkImageStencilIterator::SpanIndexZ
int SpanIndexZ
Definition: vtkImageStencilIterator.h:133
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
vtkImageStencilIterator::SpanIndexY
int SpanIndexY
Definition: vtkImageStencilIterator.h:132
vtkImageStencilIterator::vtkImageStencilIterator
vtkImageStencilIterator()
vtkImageStencilIterator::PixelIncrement
vtkIdType PixelIncrement
Definition: vtkImageStencilIterator.h:114
vtkImageStencilIterator::SpanMaxY
int SpanMaxY
Definition: vtkImageStencilIterator.h:128
vtkImageStencilIterator::vtkImageStencilIterator
vtkImageStencilIterator(vtkImageData *image, vtkImageStencilData *stencil, int extent[6], vtkAlgorithm *algorithm=0, int threadId=0)
vtkImageStencilIterator::RowEndIncrement
vtkIdType RowEndIncrement
Definition: vtkImageStencilIterator.h:117
vtkImageStencilIterator::Count
vtkIdType Count
Definition: vtkImageStencilIterator.h:139
vtkImageStencilIterator::SetSpanState
void SetSpanState(int idX)
vtkImageStencilIterator::SliceEndPointer
DType * SliceEndPointer
Definition: vtkImageStencilIterator.h:110
vtkImageStencilData
efficient description of an image stencil
Definition: vtkImageStencilData.h:37
vtkImageStencilIterator::InStencil
bool InStencil
Definition: vtkImageStencilIterator.h:122
vtkImageStencilIterator::RowIncrement
vtkIdType RowIncrement
Definition: vtkImageStencilIterator.h:115
vtkImageStencilIterator::SpanEndPointer
DType * SpanEndPointer
Definition: vtkImageStencilIterator.h:108
vtkImagingCoreModule.h
vtkImageStencilIterator::EndSpan
DType * EndSpan()
Definition: vtkImageStencilIterator.h:90
vtkX3D::extent
@ extent
Definition: vtkX3D.h:345
vtkImageStencilIterator::HasStencil
bool HasStencil
Definition: vtkImageStencilIterator.h:121
VTKIMAGINGCORE_EXPORT
#define VTKIMAGINGCORE_EXPORT
Definition: vtkImagingCoreModule.h:15
vtkImageStencilIterator::SpanMinX
int SpanMinX
Definition: vtkImageStencilIterator.h:125
vtkImageStencilIterator::IsInStencil
bool IsInStencil()
Definition: vtkImageStencilIterator.h:62
vtkImageStencilIterator::Target
vtkIdType Target
Definition: vtkImageStencilIterator.h:140
vtkgl::image
GLenum GLsizei GLenum GLenum const GLvoid * image
Definition: vtkgl.h:11341
vtkImageStencilIterator::SpanSliceIncrement
int SpanSliceIncrement
Definition: vtkImageStencilIterator.h:124
vtkSystemIncludes.h
vtkImageStencilIterator::Pointer
DType * Pointer
Definition: vtkImageStencilIterator.h:107
vtkImageStencilIterator::SpanListPointer
int ** SpanListPointer
Definition: vtkImageStencilIterator.h:135