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 "vtkUnstructuredGridAlgorithm.h" 00066 00067 class vtkCallbackCommand; 00068 class vtkImplicitFunction; 00069 class vtkIncrementalPointLocator; 00070 00071 class VTK_GRAPHICS_EXPORT vtkClipDataSet : public vtkUnstructuredGridAlgorithm 00072 { 00073 public: 00074 vtkTypeMacro(vtkClipDataSet,vtkUnstructuredGridAlgorithm); 00075 void PrintSelf(ostream& os, vtkIndent indent); 00076 00079 static vtkClipDataSet *New(); 00080 00082 00086 vtkSetMacro(Value,double); 00087 vtkGetMacro(Value,double); 00089 00091 00094 vtkSetMacro(UseValueAsOffset, bool); 00095 vtkGetMacro(UseValueAsOffset, bool); 00096 vtkBooleanMacro(UseValueAsOffset, bool); 00098 00100 00105 vtkSetMacro(InsideOut,int); 00106 vtkGetMacro(InsideOut,int); 00107 vtkBooleanMacro(InsideOut,int); 00109 00111 00114 virtual void SetClipFunction(vtkImplicitFunction*); 00115 vtkGetObjectMacro(ClipFunction,vtkImplicitFunction); 00117 00119 00123 vtkSetMacro(GenerateClipScalars,int); 00124 vtkGetMacro(GenerateClipScalars,int); 00125 vtkBooleanMacro(GenerateClipScalars,int); 00127 00129 00131 vtkSetMacro(GenerateClippedOutput,int); 00132 vtkGetMacro(GenerateClippedOutput,int); 00133 vtkBooleanMacro(GenerateClippedOutput,int); 00135 00137 00141 vtkSetClampMacro(MergeTolerance,double,0.0001,0.25); 00142 vtkGetMacro(MergeTolerance,double); 00144 00146 vtkUnstructuredGrid *GetClippedOutput(); 00147 00149 00151 void SetLocator(vtkIncrementalPointLocator *locator); 00152 vtkGetObjectMacro(Locator,vtkIncrementalPointLocator); 00154 00157 void CreateDefaultLocator(); 00158 00160 unsigned long GetMTime(); 00161 00162 protected: 00163 vtkClipDataSet(vtkImplicitFunction *cf=NULL); 00164 ~vtkClipDataSet(); 00165 00167 00168 virtual int ProcessRequest(vtkInformation*, 00169 vtkInformationVector**, 00170 vtkInformationVector*); 00172 00173 virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00174 virtual int FillInputPortInformation(int port, vtkInformation *info); 00175 vtkImplicitFunction *ClipFunction; 00176 00177 vtkIncrementalPointLocator *Locator; 00178 int InsideOut; 00179 double Value; 00180 int GenerateClipScalars; 00181 00182 int GenerateClippedOutput; 00183 double MergeTolerance; 00184 00185 // Callback registered with the InternalProgressObserver. 00186 static void InternalProgressCallbackFunction(vtkObject*, unsigned long, 00187 void* clientdata, void*); 00188 void InternalProgressCallback(vtkAlgorithm *algorithm); 00189 // The observer to report progress from the internal readers. 00190 vtkCallbackCommand* InternalProgressObserver; 00191 00192 //helper functions 00193 void ClipVolume(vtkDataSet *input, vtkUnstructuredGrid *output); 00194 00195 int ClipPoints(vtkDataSet* input, vtkUnstructuredGrid* output, 00196 vtkInformationVector** inputVector); 00197 00198 bool UseValueAsOffset; 00199 00200 private: 00201 vtkClipDataSet(const vtkClipDataSet&); // Not implemented. 00202 void operator=(const vtkClipDataSet&); // Not implemented. 00203 }; 00204 00205 #endif