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:
39  static vtkImageStencilData *New();
41  void PrintSelf(ostream& os, vtkIndent indent);
42 
43  void Initialize();
44  void DeepCopy(vtkDataObject *o);
45  void ShallowCopy(vtkDataObject *f);
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 
125 
127  virtual void CopyInformationFromPipeline(vtkInformation* meta_data);
128  virtual void CopyInformationToPipeline(vtkInformation* meta_data);
130 
131  //BTX
133 
135  static vtkImageStencilData* GetData(vtkInformationVector* v, int i=0);
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 
159  void CopyOriginAndSpacingFromPipeline(vtkInformation* meta_data);
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 
220  void FillStencilData(vtkImageStencilData *data, const int extent[6],
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 
static vtkDataObject * GetData(vtkInformation *info)
static vtkDataObject * New()
Store vtkAlgorithm input/output information.
#define VTK_3D_EXTENT
Definition: vtkDataObject.h:61
virtual void Initialize()
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))
void PrintSelf(ostream &os, vtkIndent indent)
Store zero or more vtkInformation instances.
general representation of visualization data
Definition: vtkDataObject.h:64
virtual void CopyInformationToPipeline(vtkInformation *vtkNotUsed(info))
virtual void DeepCopy(vtkDataObject *src)
virtual void ShallowCopy(vtkDataObject *src)
#define VTK_DATA_OBJECT
Definition: vtkType.h:73