VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkClipDataSet.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 =========================================================================*/ 00062 #ifndef __vtkClipDataSet_h 00063 #define __vtkClipDataSet_h 00064 00065 #include "vtkFiltersGeneralModule.h" // For export macro 00066 #include "vtkUnstructuredGridAlgorithm.h" 00067 00068 class vtkCallbackCommand; 00069 class vtkImplicitFunction; 00070 class vtkIncrementalPointLocator; 00071 00072 class VTKFILTERSGENERAL_EXPORT vtkClipDataSet : public vtkUnstructuredGridAlgorithm 00073 { 00074 public: 00075 vtkTypeMacro(vtkClipDataSet,vtkUnstructuredGridAlgorithm); 00076 void PrintSelf(ostream& os, vtkIndent indent); 00077 00080 static vtkClipDataSet *New(); 00081 00083 00087 vtkSetMacro(Value,double); 00088 vtkGetMacro(Value,double); 00090 00092 00095 vtkSetMacro(UseValueAsOffset, bool); 00096 vtkGetMacro(UseValueAsOffset, bool); 00097 vtkBooleanMacro(UseValueAsOffset, bool); 00099 00101 00106 vtkSetMacro(InsideOut,int); 00107 vtkGetMacro(InsideOut,int); 00108 vtkBooleanMacro(InsideOut,int); 00110 00112 00115 virtual void SetClipFunction(vtkImplicitFunction*); 00116 vtkGetObjectMacro(ClipFunction,vtkImplicitFunction); 00118 00120 00124 vtkSetMacro(GenerateClipScalars,int); 00125 vtkGetMacro(GenerateClipScalars,int); 00126 vtkBooleanMacro(GenerateClipScalars,int); 00128 00130 00132 vtkSetMacro(GenerateClippedOutput,int); 00133 vtkGetMacro(GenerateClippedOutput,int); 00134 vtkBooleanMacro(GenerateClippedOutput,int); 00136 00138 00142 vtkSetClampMacro(MergeTolerance,double,0.0001,0.25); 00143 vtkGetMacro(MergeTolerance,double); 00145 00147 vtkUnstructuredGrid *GetClippedOutput(); 00148 00150 00152 void SetLocator(vtkIncrementalPointLocator *locator); 00153 vtkGetObjectMacro(Locator,vtkIncrementalPointLocator); 00155 00158 void CreateDefaultLocator(); 00159 00161 unsigned long GetMTime(); 00162 00164 00167 vtkSetClampMacro(OutputPointsPrecision, int, SINGLE_PRECISION, DEFAULT_PRECISION); 00168 vtkGetMacro(OutputPointsPrecision, int); 00170 00171 protected: 00172 vtkClipDataSet(vtkImplicitFunction *cf=NULL); 00173 ~vtkClipDataSet(); 00174 00176 00177 virtual int ProcessRequest(vtkInformation*, 00178 vtkInformationVector**, 00179 vtkInformationVector*); 00181 00182 virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00183 virtual int FillInputPortInformation(int port, vtkInformation *info); 00184 vtkImplicitFunction *ClipFunction; 00185 00186 vtkIncrementalPointLocator *Locator; 00187 int InsideOut; 00188 double Value; 00189 int GenerateClipScalars; 00190 00191 int GenerateClippedOutput; 00192 double MergeTolerance; 00193 00194 // Callback registered with the InternalProgressObserver. 00195 static void InternalProgressCallbackFunction(vtkObject*, unsigned long, 00196 void* clientdata, void*); 00197 void InternalProgressCallback(vtkAlgorithm *algorithm); 00198 // The observer to report progress from the internal readers. 00199 vtkCallbackCommand* InternalProgressObserver; 00200 00201 //helper functions 00202 void ClipVolume(vtkDataSet *input, vtkUnstructuredGrid *output); 00203 00204 int ClipPoints(vtkDataSet* input, vtkUnstructuredGrid* output, 00205 vtkInformationVector** inputVector); 00206 00207 bool UseValueAsOffset; 00208 int OutputPointsPrecision; 00209 00210 private: 00211 vtkClipDataSet(const vtkClipDataSet&); // Not implemented. 00212 void operator=(const vtkClipDataSet&); // Not implemented. 00213 }; 00214 00215 #endif