VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkImplicitModeller.h 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 =========================================================================*/ 00092 #ifndef __vtkImplicitModeller_h 00093 #define __vtkImplicitModeller_h 00094 00095 #include "vtkFiltersHybridModule.h" // For export macro 00096 #include "vtkImageAlgorithm.h" 00097 00098 #define VTK_VOXEL_MODE 0 00099 #define VTK_CELL_MODE 1 00100 00101 class vtkDataArray; 00102 class vtkExtractGeometry; 00103 class vtkMultiThreader; 00104 00105 class VTKFILTERSHYBRID_EXPORT vtkImplicitModeller : public vtkImageAlgorithm 00106 { 00107 public: 00108 vtkTypeMacro(vtkImplicitModeller,vtkImageAlgorithm); 00109 void PrintSelf(ostream& os, vtkIndent indent); 00110 00114 static vtkImplicitModeller *New(); 00115 00118 double ComputeModelBounds(vtkDataSet *input = NULL); 00119 00121 00122 vtkGetVectorMacro(SampleDimensions,int,3); 00123 void SetSampleDimensions(int i, int j, int k); 00124 void SetSampleDimensions(int dim[3]); 00126 00128 00132 vtkSetClampMacro(MaximumDistance,double,0.0,1.0); 00133 vtkGetMacro(MaximumDistance,double); 00135 00137 00139 vtkSetVector6Macro(ModelBounds,double); 00140 vtkGetVectorMacro(ModelBounds,double,6); 00142 00144 00148 vtkSetMacro(AdjustBounds,int); 00149 vtkGetMacro(AdjustBounds,int); 00150 vtkBooleanMacro(AdjustBounds,int); 00152 00154 00157 vtkSetClampMacro(AdjustDistance,double,-1.0,1.0); 00158 vtkGetMacro(AdjustDistance,double); 00160 00162 00164 vtkSetMacro(Capping,int); 00165 vtkGetMacro(Capping,int); 00166 vtkBooleanMacro(Capping,int); 00168 00170 00172 void SetCapValue(double value); 00173 vtkGetMacro(CapValue,double); 00175 00177 00185 vtkSetMacro(ScaleToMaximumDistance, int); 00186 vtkGetMacro(ScaleToMaximumDistance, int); 00187 vtkBooleanMacro(ScaleToMaximumDistance,int); 00189 00191 00196 vtkSetClampMacro(ProcessMode, int, 0, 1); 00197 vtkGetMacro(ProcessMode, int); 00198 void SetProcessModeToPerVoxel() {this->SetProcessMode(VTK_VOXEL_MODE);} 00199 void SetProcessModeToPerCell() {this->SetProcessMode(VTK_CELL_MODE);} 00200 const char *GetProcessModeAsString(void); 00202 00204 00206 vtkSetMacro(LocatorMaxLevel,int); 00207 vtkGetMacro(LocatorMaxLevel,int); 00209 00211 00212 vtkSetClampMacro( NumberOfThreads, int, 1, VTK_MAX_THREADS ); 00213 vtkGetMacro( NumberOfThreads, int ); 00215 00217 00218 void SetOutputScalarType(int type); 00219 vtkGetMacro(OutputScalarType,int); 00220 void SetOutputScalarTypeToFloat(){this->SetOutputScalarType(VTK_FLOAT);}; 00221 void SetOutputScalarTypeToDouble(){this->SetOutputScalarType(VTK_DOUBLE);}; 00222 void SetOutputScalarTypeToInt(){this->SetOutputScalarType(VTK_INT);}; 00223 void SetOutputScalarTypeToUnsignedInt() 00224 {this->SetOutputScalarType(VTK_UNSIGNED_INT);}; 00225 void SetOutputScalarTypeToLong(){this->SetOutputScalarType(VTK_LONG);}; 00226 void SetOutputScalarTypeToUnsignedLong() 00227 {this->SetOutputScalarType(VTK_UNSIGNED_LONG);}; 00228 void SetOutputScalarTypeToShort(){this->SetOutputScalarType(VTK_SHORT);}; 00229 void SetOutputScalarTypeToUnsignedShort() 00230 {this->SetOutputScalarType(VTK_UNSIGNED_SHORT);}; 00231 void SetOutputScalarTypeToUnsignedChar() 00232 {this->SetOutputScalarType(VTK_UNSIGNED_CHAR);}; 00233 void SetOutputScalarTypeToChar() 00234 {this->SetOutputScalarType(VTK_CHAR);}; 00236 00241 void StartAppend(); 00242 00248 void Append(vtkDataSet *input); 00249 00251 void EndAppend(); 00252 00253 // See the vtkAlgorithm for a desciption of what these do 00254 int ProcessRequest(vtkInformation*, 00255 vtkInformationVector**, 00256 vtkInformationVector*); 00257 00258 protected: 00259 vtkImplicitModeller(); 00260 ~vtkImplicitModeller(); 00261 00262 double GetScalarTypeMax(int type); 00263 00264 virtual int RequestInformation (vtkInformation *, 00265 vtkInformationVector **, 00266 vtkInformationVector *); 00267 virtual int RequestData (vtkInformation *, 00268 vtkInformationVector **, vtkInformationVector *); 00269 00270 void StartAppend(int internal); 00271 void Cap(vtkDataArray *s); 00272 00273 vtkMultiThreader *Threader; 00274 int NumberOfThreads; 00275 00276 int SampleDimensions[3]; 00277 double MaximumDistance; 00278 double ModelBounds[6]; 00279 int Capping; 00280 double CapValue; 00281 int DataAppended; 00282 int AdjustBounds; 00283 double AdjustDistance; 00284 int ProcessMode; 00285 int LocatorMaxLevel; 00286 int OutputScalarType; 00287 int ScaleToMaximumDistance; 00288 00289 // flag to limit to one ComputeModelBounds per StartAppend 00290 int BoundsComputed; 00291 00292 // the max distance computed during that one call 00293 double InternalMaxDistance; 00294 00295 virtual int FillInputPortInformation(int, vtkInformation*); 00296 00297 private: 00298 vtkImplicitModeller(const vtkImplicitModeller&); // Not implemented. 00299 void operator=(const vtkImplicitModeller&); // Not implemented. 00300 }; 00301 00302 #endif 00303 00304