VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkImplicitModeller.h,v $ 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00089 #ifndef __vtkImplicitModeller_h 00090 #define __vtkImplicitModeller_h 00091 00092 #include "vtkImageAlgorithm.h" 00093 00094 #define VTK_VOXEL_MODE 0 00095 #define VTK_CELL_MODE 1 00096 00097 class vtkDataArray; 00098 class vtkExtractGeometry; 00099 class vtkMultiThreader; 00100 00101 class VTK_HYBRID_EXPORT vtkImplicitModeller : public vtkImageAlgorithm 00102 { 00103 public: 00104 vtkTypeRevisionMacro(vtkImplicitModeller,vtkImageAlgorithm); 00105 void PrintSelf(ostream& os, vtkIndent indent); 00106 00110 static vtkImplicitModeller *New(); 00111 00114 double ComputeModelBounds(vtkDataSet *input = NULL); 00115 00117 00118 vtkGetVectorMacro(SampleDimensions,int,3); 00119 void SetSampleDimensions(int i, int j, int k); 00120 void SetSampleDimensions(int dim[3]); 00122 00124 00126 vtkSetClampMacro(MaximumDistance,double,0.0,1.0); 00127 vtkGetMacro(MaximumDistance,double); 00129 00131 00133 vtkSetVector6Macro(ModelBounds,double); 00134 vtkGetVectorMacro(ModelBounds,double,6); 00136 00138 00142 vtkSetMacro(AdjustBounds,int); 00143 vtkGetMacro(AdjustBounds,int); 00144 vtkBooleanMacro(AdjustBounds,int); 00146 00148 00151 vtkSetClampMacro(AdjustDistance,double,-1.0,1.0); 00152 vtkGetMacro(AdjustDistance,double); 00154 00156 00158 vtkSetMacro(Capping,int); 00159 vtkGetMacro(Capping,int); 00160 vtkBooleanMacro(Capping,int); 00162 00164 00166 void SetCapValue(double value); 00167 vtkGetMacro(CapValue,double); 00169 00171 00179 vtkSetMacro(ScaleToMaximumDistance, int); 00180 vtkGetMacro(ScaleToMaximumDistance, int); 00181 vtkBooleanMacro(ScaleToMaximumDistance,int); 00183 00185 00190 vtkSetClampMacro(ProcessMode, int, 0, 1); 00191 vtkGetMacro(ProcessMode, int); 00192 void SetProcessModeToPerVoxel() {this->SetProcessMode(VTK_VOXEL_MODE);} 00193 void SetProcessModeToPerCell() {this->SetProcessMode(VTK_CELL_MODE);} 00194 const char *GetProcessModeAsString(void); 00196 00198 00200 vtkSetMacro(LocatorMaxLevel,int); 00201 vtkGetMacro(LocatorMaxLevel,int); 00203 00205 00206 vtkSetClampMacro( NumberOfThreads, int, 1, VTK_MAX_THREADS ); 00207 vtkGetMacro( NumberOfThreads, int ); 00209 00211 00212 void SetOutputScalarType(int type); 00213 vtkGetMacro(OutputScalarType,int); 00214 void SetOutputScalarTypeToFloat(){this->SetOutputScalarType(VTK_FLOAT);}; 00215 void SetOutputScalarTypeToDouble(){this->SetOutputScalarType(VTK_DOUBLE);}; 00216 void SetOutputScalarTypeToInt(){this->SetOutputScalarType(VTK_INT);}; 00217 void SetOutputScalarTypeToUnsignedInt() 00218 {this->SetOutputScalarType(VTK_UNSIGNED_INT);}; 00219 void SetOutputScalarTypeToLong(){this->SetOutputScalarType(VTK_LONG);}; 00220 void SetOutputScalarTypeToUnsignedLong() 00221 {this->SetOutputScalarType(VTK_UNSIGNED_LONG);}; 00222 void SetOutputScalarTypeToShort(){this->SetOutputScalarType(VTK_SHORT);}; 00223 void SetOutputScalarTypeToUnsignedShort() 00224 {this->SetOutputScalarType(VTK_UNSIGNED_SHORT);}; 00225 void SetOutputScalarTypeToUnsignedChar() 00226 {this->SetOutputScalarType(VTK_UNSIGNED_CHAR);}; 00227 void SetOutputScalarTypeToChar() 00228 {this->SetOutputScalarType(VTK_CHAR);}; 00230 00235 void StartAppend(); 00236 00242 void Append(vtkDataSet *input); 00243 00245 void EndAppend(); 00246 00247 // See the vtkAlgorithm for a desciption of what these do 00248 int ProcessRequest(vtkInformation*, 00249 vtkInformationVector**, 00250 vtkInformationVector*); 00251 00252 protected: 00253 vtkImplicitModeller(); 00254 ~vtkImplicitModeller(); 00255 00256 double GetScalarTypeMax(int type); 00257 00258 virtual int RequestInformation (vtkInformation *, 00259 vtkInformationVector **, 00260 vtkInformationVector *); 00261 virtual int RequestData (vtkInformation *, 00262 vtkInformationVector **, vtkInformationVector *); 00263 00264 void StartAppend(int internal); 00265 void Cap(vtkDataArray *s); 00266 00267 vtkMultiThreader *Threader; 00268 int NumberOfThreads; 00269 00270 int SampleDimensions[3]; 00271 double MaximumDistance; 00272 double ModelBounds[6]; 00273 int Capping; 00274 double CapValue; 00275 int DataAppended; 00276 int AdjustBounds; 00277 double AdjustDistance; 00278 int ProcessMode; 00279 int LocatorMaxLevel; 00280 int OutputScalarType; 00281 int ScaleToMaximumDistance; 00282 00283 // flag to limit to one ComputeModelBounds per StartAppend 00284 int BoundsComputed; 00285 00286 // the max distance computed during that one call 00287 double InternalMaxDistance; 00288 00289 virtual int FillInputPortInformation(int, vtkInformation*); 00290 00291 private: 00292 vtkImplicitModeller(const vtkImplicitModeller&); // Not implemented. 00293 void operator=(const vtkImplicitModeller&); // Not implemented. 00294 }; 00295 00296 #endif 00297 00298