VTK
vtkImplicitModeller.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImplicitModeller.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 =========================================================================*/
92 #ifndef __vtkImplicitModeller_h
93 #define __vtkImplicitModeller_h
94 
95 #include "vtkImageAlgorithm.h"
96 
97 #define VTK_VOXEL_MODE 0
98 #define VTK_CELL_MODE 1
99 
100 class vtkDataArray;
101 class vtkExtractGeometry;
102 class vtkMultiThreader;
103 
105 {
106 public:
108  void PrintSelf(ostream& os, vtkIndent indent);
109 
113  static vtkImplicitModeller *New();
114 
117  double ComputeModelBounds(vtkDataSet *input = NULL);
118 
120 
121  vtkGetVectorMacro(SampleDimensions,int,3);
122  void SetSampleDimensions(int i, int j, int k);
123  void SetSampleDimensions(int dim[3]);
125 
127 
129  vtkSetClampMacro(MaximumDistance,double,0.0,1.0);
130  vtkGetMacro(MaximumDistance,double);
132 
134 
136  vtkSetVector6Macro(ModelBounds,double);
137  vtkGetVectorMacro(ModelBounds,double,6);
139 
141 
145  vtkSetMacro(AdjustBounds,int);
146  vtkGetMacro(AdjustBounds,int);
147  vtkBooleanMacro(AdjustBounds,int);
149 
151 
154  vtkSetClampMacro(AdjustDistance,double,-1.0,1.0);
155  vtkGetMacro(AdjustDistance,double);
157 
159 
161  vtkSetMacro(Capping,int);
162  vtkGetMacro(Capping,int);
163  vtkBooleanMacro(Capping,int);
165 
167 
169  void SetCapValue(double value);
170  vtkGetMacro(CapValue,double);
172 
174 
182  vtkSetMacro(ScaleToMaximumDistance, int);
183  vtkGetMacro(ScaleToMaximumDistance, int);
184  vtkBooleanMacro(ScaleToMaximumDistance,int);
186 
188 
193  vtkSetClampMacro(ProcessMode, int, 0, 1);
194  vtkGetMacro(ProcessMode, int);
195  void SetProcessModeToPerVoxel() {this->SetProcessMode(VTK_VOXEL_MODE);}
196  void SetProcessModeToPerCell() {this->SetProcessMode(VTK_CELL_MODE);}
197  const char *GetProcessModeAsString(void);
199 
201 
203  vtkSetMacro(LocatorMaxLevel,int);
204  vtkGetMacro(LocatorMaxLevel,int);
206 
208 
209  vtkSetClampMacro( NumberOfThreads, int, 1, VTK_MAX_THREADS );
210  vtkGetMacro( NumberOfThreads, int );
212 
214 
215  void SetOutputScalarType(int type);
216  vtkGetMacro(OutputScalarType,int);
217  void SetOutputScalarTypeToFloat(){this->SetOutputScalarType(VTK_FLOAT);};
218  void SetOutputScalarTypeToDouble(){this->SetOutputScalarType(VTK_DOUBLE);};
219  void SetOutputScalarTypeToInt(){this->SetOutputScalarType(VTK_INT);};
221  {this->SetOutputScalarType(VTK_UNSIGNED_INT);};
222  void SetOutputScalarTypeToLong(){this->SetOutputScalarType(VTK_LONG);};
224  {this->SetOutputScalarType(VTK_UNSIGNED_LONG);};
225  void SetOutputScalarTypeToShort(){this->SetOutputScalarType(VTK_SHORT);};
227  {this->SetOutputScalarType(VTK_UNSIGNED_SHORT);};
229  {this->SetOutputScalarType(VTK_UNSIGNED_CHAR);};
231  {this->SetOutputScalarType(VTK_CHAR);};
233 
238  void StartAppend();
239 
245  void Append(vtkDataSet *input);
246 
248  void EndAppend();
249 
250  // See the vtkAlgorithm for a desciption of what these do
254 
255 protected:
258 
259  double GetScalarTypeMax(int type);
260 
261  virtual int RequestInformation (vtkInformation *,
264  virtual int RequestData (vtkInformation *,
266 
267  void StartAppend(int internal);
268  void Cap(vtkDataArray *s);
269 
272 
273  int SampleDimensions[3];
275  double ModelBounds[6];
276  int Capping;
277  double CapValue;
285 
286  // flag to limit to one ComputeModelBounds per StartAppend
288 
289  // the max distance computed during that one call
291 
292  virtual int FillInputPortInformation(int, vtkInformation*);
293 
294 private:
295  vtkImplicitModeller(const vtkImplicitModeller&); // Not implemented.
296  void operator=(const vtkImplicitModeller&); // Not implemented.
297 };
298 
299 #endif
300 
301