VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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:
39  static vtkImageStencilData *New();
41  void PrintSelf(ostream& os, vtkIndent indent);
42 
43  void Initialize();
44  void DeepCopy(vtkDataObject *o);
46  void InternalImageStencilDataCopy(vtkImageStencilData *s);
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 
119  void AllocateExtents();
120 
122  void Fill();
123 
126  virtual void CopyInformationFromPipeline(vtkInformation* meta_data);
127 
128  //BTX
130 
133  //ETX
135 
137  virtual void Add ( vtkImageStencilData * );
138 
141  virtual void Subtract( vtkImageStencilData * );
142 
145  virtual void Replace( vtkImageStencilData * );
146 
149  virtual int Clip( int extent[6] );
150 
151 protected:
154 
156  void CopyOriginAndSpacingFromPipeline(vtkInformation* meta_data);
157 
160  virtual void InternalAdd( vtkImageStencilData * );
161 
162  void CollapseAdditionalIntersections(int r2, int idx, int *clist,
163  int &clistlen);
164 
166 
167  double Spacing[3];
168  double Origin[3];
170 
171  int Extent[6];
172 
174 
177  int **ExtentLists;
179 
180 private:
181  vtkImageStencilData(const vtkImageStencilData&); // Not implemented.
182  void operator=(const vtkImageStencilData&); // Not implemented.
183 
184  friend class vtkImageStencilIteratorFriendship;
185 };
186 
187 //BTX
189 
194 {
195 public:
197 
198  vtkImageStencilRaster(const int wholeExtent[2]);
199 
202 
206  void PrepareForNewData(const int allocateExtent[2] = 0);
207 
209 
212  void InsertLine(const double p1[2], const double p2[2],
213  bool inflect1, bool inflect2);
215 
217 
219  void FillStencilData(vtkImageStencilData *data, const int extent[6],
220  int xj = 0, int yj = 1);
222 
224 
225  void SetTolerance(double tol) { this->Tolerance = tol; }
226  double GetTolerance() { return this->Tolerance; }
228 
229 protected:
232  void PrepareExtent(int ymin, int ymax);
233 
236  void InsertPoint(int y, double x);
237 
238  int Extent[2];
239  int UsedExtent[2];
240  double **Raster;
241  double Tolerance;
242 
243 private:
244  vtkImageStencilRaster(const vtkImageStencilRaster&); // Not implemented.
245  void operator=(const vtkImageStencilRaster&); // Not implemented.
246 };
247 //ETX
248 
249 #endif
250 
251 
252 
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: vtkgl.h:11339
static vtkDataObject * GetData(vtkInformation *info)
GLclampf f
Definition: vtkgl.h:14181
const GLdouble * v
Definition: vtkgl.h:11595
static vtkDataObject * New()
Store vtkAlgorithm input/output information.
#define VTK_3D_EXTENT
Definition: vtkDataObject.h:61
virtual void Initialize()
GLint GLint GLint GLint GLint GLint y
Definition: vtkgl.h:11318
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:619
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
void SetTolerance(double tol)
a simple class to control print indentation
Definition: vtkIndent.h:38
efficient description of an image stencil
#define VTKIMAGINGCORE_EXPORT
virtual void CopyInformationFromPipeline(vtkInformation *vtkNotUsed(info))
#define vtkGetVector3Macro(name, type)
Definition: vtkSetGet.h:294
void PrintSelf(ostream &os, vtkIndent indent)
GLdouble s
Definition: vtkgl.h:11594
Store zero or more vtkInformation instances.
#define vtkGetVector6Macro(name, type)
Definition: vtkSetGet.h:370
general representation of visualization data
Definition: vtkDataObject.h:64
#define vtkSetVector3Macro(name, type)
Definition: vtkSetGet.h:277
virtual void DeepCopy(vtkDataObject *src)
virtual void ShallowCopy(vtkDataObject *src)
#define VTK_DATA_OBJECT
Definition: vtkType.h:73