VTK
vtkImageStencilData.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageStencilData.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 =========================================================================*/
29 #ifndef vtkImageStencilData_h
30 #define vtkImageStencilData_h
31 
32 
33 #include "vtkImagingCoreModule.h" // For export macro
34 #include "vtkDataObject.h"
35 
37 {
38 public:
41  void PrintSelf(ostream& os, vtkIndent indent);
42 
43  void Initialize();
47 
51 
53  int GetExtentType() { return VTK_3D_EXTENT; };
54 
56 
64  int GetNextExtent(int &r1, int &r2, int xMin, int xMax,
65  int yIdx, int zIdx, int &iter);
67 
72  int IsInside(int xIdx, int yIdx, int zIdx);
73 
79  void InsertNextExtent(int r1, int r2, int yIdx, int zIdx);
80 
87  void InsertAndMergeExtent(int r1, int r2, int yIdx, int zIdx);
88 
90  void RemoveExtent(int r1, int r2, int yIdx, int zIdx);
91 
93 
96  vtkSetVector3Macro(Spacing, double);
97  vtkGetVector3Macro(Spacing, double);
99 
101 
104  vtkSetVector3Macro(Origin, double);
105  vtkGetVector3Macro(Origin, double);
107 
109 
112  void SetExtent(int extent[6]);
113  void SetExtent(int x1, int x2, int y1, int y2, int z1, int z2);
114  vtkGetVector6Macro(Extent, int);
116 
120 
122  void Fill();
123 
125 
127  virtual void CopyInformationFromPipeline(vtkInformation* meta_data);
128  virtual void CopyInformationToPipeline(vtkInformation* meta_data);
130 
131  //BTX
133 
136  //ETX
138 
140  virtual void Add ( vtkImageStencilData * );
141 
144  virtual void Subtract( vtkImageStencilData * );
145 
148  virtual void Replace( vtkImageStencilData * );
149 
152  virtual int Clip( int extent[6] );
153 
154 protected:
157 
160 
163  virtual void InternalAdd( vtkImageStencilData * );
164 
165  void CollapseAdditionalIntersections(int r2, int idx, int *clist,
166  int &clistlen);
167 
169 
170  double Spacing[3];
171  double Origin[3];
173 
174  int Extent[6];
175 
177 
180  int **ExtentLists;
182 
183 private:
184  vtkImageStencilData(const vtkImageStencilData&); // Not implemented.
185  void operator=(const vtkImageStencilData&); // Not implemented.
186 
187  friend class vtkImageStencilIteratorFriendship;
188 };
189 
190 //BTX
192 
197 {
198 public:
200 
201  vtkImageStencilRaster(const int wholeExtent[2]);
202 
205 
209  void PrepareForNewData(const int allocateExtent[2] = 0);
210 
212 
213  void InsertLine(const double p1[2], const double p2[2]);
214  VTK_LEGACY(void InsertLine(const double[2], const double[2], bool, bool));
216 
218 
221  int xj = 0, int yj = 1);
223 
225 
226  void SetTolerance(double tol) { this->Tolerance = tol; }
227  double GetTolerance() { return this->Tolerance; }
229 
230 protected:
233  void PrepareExtent(int ymin, int ymax);
234 
238  void InsertPoint(int y, double x, int i);
239 
240  int Extent[2];
241  int UsedExtent[2];
242  double **Raster;
243  double Tolerance;
244 
245 private:
246  vtkImageStencilRaster(const vtkImageStencilRaster&); // Not implemented.
247  void operator=(const vtkImageStencilRaster&); // Not implemented.
248 };
249 //ETX
250 
251 #endif
252 
253 
254 
vtkGetVector6Macro
#define vtkGetVector6Macro(name, type)
Definition: vtkSetGet.h:380
vtkgl::data
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: vtkgl.h:11339
vtkImageStencilData::ExtentListLengths
int * ExtentListLengths
Definition: vtkImageStencilData.h:179
vtkImageStencilData::GetData
static vtkImageStencilData * GetData(vtkInformation *info)
vtkImageStencilData::SetExtent
void SetExtent(int extent[6])
VTK_DATA_OBJECT
#define VTK_DATA_OBJECT
Definition: vtkType.h:73
vtkImageStencilData::Subtract
virtual void Subtract(vtkImageStencilData *)
vtkSetVector3Macro
#define vtkSetVector3Macro(name, type)
Definition: vtkSetGet.h:287
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkImageStencilData::vtkImageStencilData
vtkImageStencilData()
vtkImageStencilData::NumberOfExtentEntries
int NumberOfExtentEntries
Definition: vtkImageStencilData.h:178
vtkgl::s
GLdouble s
Definition: vtkgl.h:11594
vtkImageStencilData::IsInside
int IsInside(int xIdx, int yIdx, int zIdx)
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkImageStencilData::ShallowCopy
void ShallowCopy(vtkDataObject *f)
vtkImageStencilRaster::SetTolerance
void SetTolerance(double tol)
Definition: vtkImageStencilData.h:226
vtkImageStencilData::GetNextExtent
int GetNextExtent(int &r1, int &r2, int xMin, int xMax, int yIdx, int zIdx, int &iter)
vtkgl::v
const GLdouble * v
Definition: vtkgl.h:11595
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkImageStencilData::InsertAndMergeExtent
void InsertAndMergeExtent(int r1, int r2, int yIdx, int zIdx)
vtkImageStencilData::Replace
virtual void Replace(vtkImageStencilData *)
vtkImageStencilData::CopyOriginAndSpacingFromPipeline
void CopyOriginAndSpacingFromPipeline(vtkInformation *meta_data)
vtkImageStencilRaster::InsertLine
void InsertLine(const double[2], const double[2], bool, bool)
vtkImageStencilRaster::PrepareExtent
void PrepareExtent(int ymin, int ymax)
vtkImageStencilData::New
static vtkImageStencilData * New()
vtkImageStencilRaster
Definition: vtkImageStencilData.h:197
vtkImageStencilData::CopyInformationToPipeline
virtual void CopyInformationToPipeline(vtkInformation *meta_data)
VTK_3D_EXTENT
#define VTK_3D_EXTENT
Definition: vtkDataObject.h:61
vtkImageStencilData::GetExtentType
int GetExtentType()
Definition: vtkImageStencilData.h:53
vtkImageStencilRaster::Tolerance
double Tolerance
Definition: vtkImageStencilData.h:243
vtkImageStencilRaster::~vtkImageStencilRaster
~vtkImageStencilRaster()
vtkGetVector3Macro
#define vtkGetVector3Macro(name, type)
Definition: vtkSetGet.h:304
vtkImageStencilData::GetData
static vtkImageStencilData * GetData(vtkInformationVector *v, int i=0)
vtkImageStencilData::GetDataObjectType
int GetDataObjectType()
Definition: vtkImageStencilData.h:50
vtkImageStencilData::SetExtent
void SetExtent(int x1, int x2, int y1, int y2, int z1, int z2)
vtkImageStencilData::InsertNextExtent
void InsertNextExtent(int r1, int r2, int yIdx, int zIdx)
vtkImageStencilRaster::InsertPoint
void InsertPoint(int y, double x, int i)
vtkImageStencilData::ExtentLists
int ** ExtentLists
Definition: vtkImageStencilData.h:180
vtkImageStencilData::CollapseAdditionalIntersections
void CollapseAdditionalIntersections(int r2, int idx, int *clist, int &clistlen)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkImageStencilData::Initialize
void Initialize()
vtkImageStencilRaster::vtkImageStencilRaster
vtkImageStencilRaster(const int wholeExtent[2])
vtkImageStencilData::DeepCopy
void DeepCopy(vtkDataObject *o)
vtkImageStencilData::Add
virtual void Add(vtkImageStencilData *)
vtkgl::f
GLclampf f
Definition: vtkgl.h:14181
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkImageStencilRaster::Raster
double ** Raster
Definition: vtkImageStencilData.h:242
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkImageStencilData::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
VTK_LEGACY
#define VTK_LEGACY(method)
Definition: vtkSetGet.h:801
vtkImageStencilRaster::InsertLine
void InsertLine(const double p1[2], const double p2[2])
vtkgl::y
GLint GLint GLint GLint GLint GLint y
Definition: vtkgl.h:11318
vtkImageStencilData::RemoveExtent
void RemoveExtent(int r1, int r2, int yIdx, int zIdx)
vtkDataObject.h
vtkImageStencilData::InternalAdd
virtual void InternalAdd(vtkImageStencilData *)
vtkImageStencilData::~vtkImageStencilData
~vtkImageStencilData()
vtkImageStencilData
efficient description of an image stencil
Definition: vtkImageStencilData.h:37
vtkImageStencilRaster::GetTolerance
double GetTolerance()
Definition: vtkImageStencilData.h:227
vtkImagingCoreModule.h
vtkX3D::extent
@ extent
Definition: vtkX3D.h:345
VTKIMAGINGCORE_EXPORT
#define VTKIMAGINGCORE_EXPORT
Definition: vtkImagingCoreModule.h:15
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:65
vtkImageStencilData::AllocateExtents
void AllocateExtents()
vtkImageStencilData::Fill
void Fill()
vtkImageStencilData::CopyInformationFromPipeline
virtual void CopyInformationFromPipeline(vtkInformation *meta_data)
vtkImageStencilData::InternalImageStencilDataCopy
void InternalImageStencilDataCopy(vtkImageStencilData *s)
vtkImageStencilRaster::FillStencilData
void FillStencilData(vtkImageStencilData *data, const int extent[6], int xj=0, int yj=1)
vtkImageStencilRaster::PrepareForNewData
void PrepareForNewData(const int allocateExtent[2]=0)
vtkImageStencilData::Clip
virtual int Clip(int extent[6])