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 00175 virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00176 virtual int FillInputPortInformation(int port, vtkInformation *info); 00177 vtkImplicitFunction *ClipFunction; 00178 00179 vtkIncrementalPointLocator *Locator; 00180 int InsideOut; 00181 double Value; 00182 int GenerateClipScalars; 00183 00184 int GenerateClippedOutput; 00185 double MergeTolerance; 00186 00187 // Callback registered with the InternalProgressObserver. 00188 static void InternalProgressCallbackFunction(vtkObject*, unsigned long, 00189 void* clientdata, void*); 00190 void InternalProgressCallback(vtkAlgorithm *algorithm); 00191 // The observer to report progress from the internal readers. 00192 vtkCallbackCommand* InternalProgressObserver; 00193 00194 //helper functions 00195 void ClipVolume(vtkDataSet *input, vtkUnstructuredGrid *output); 00196 00197 int ClipPoints(vtkDataSet* input, vtkUnstructuredGrid* output, 00198 vtkInformationVector** inputVector); 00199 00200 bool UseValueAsOffset; 00201 int OutputPointsPrecision; 00202 00203 private: 00204 vtkClipDataSet(const vtkClipDataSet&); // Not implemented. 00205 void operator=(const vtkClipDataSet&); // Not implemented. 00206 }; 00207 00208 #endif