VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkTableBasedClipDataSet.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 =========================================================================*/ 00015 00016 00017 /***************************************************************************** 00018 * 00019 * Copyright (c) 2000 - 2009, Lawrence Livermore National Security, LLC 00020 * Produced at the Lawrence Livermore National Laboratory 00021 * LLNL-CODE-400124 00022 * All rights reserved. 00023 * 00024 * This file was adapted from the VisIt clipper (vtkVisItClipper). For details, 00025 * see https://visit.llnl.gov/. The full copyright notice is contained in the 00026 * file COPYRIGHT located at the root of the VisIt distribution or at 00027 * http://www.llnl.gov/visit/copyright.html. 00028 * 00029 *****************************************************************************/ 00030 00031 00095 #ifndef vtkTableBasedClipDataSet_h 00096 #define vtkTableBasedClipDataSet_h 00097 00098 #include "vtkFiltersGeneralModule.h" // For export macro 00099 #include "vtkUnstructuredGridAlgorithm.h" 00100 00101 class vtkCallbackCommand; 00102 class vtkImplicitFunction; 00103 class vtkIncrementalPointLocator; 00104 00105 class VTKFILTERSGENERAL_EXPORT vtkTableBasedClipDataSet : public vtkUnstructuredGridAlgorithm 00106 { 00107 public: 00108 vtkTypeMacro( vtkTableBasedClipDataSet, vtkUnstructuredGridAlgorithm ); 00109 void PrintSelf( ostream & os, vtkIndent indent ); 00110 00114 static vtkTableBasedClipDataSet * New(); 00115 00118 unsigned long GetMTime(); 00119 00121 00127 vtkSetMacro( InsideOut, int ); 00128 vtkGetMacro( InsideOut, int ); 00129 vtkBooleanMacro( InsideOut, int ); 00131 00133 00137 vtkSetMacro( Value, double ); 00138 vtkGetMacro( Value, double ); 00140 00142 00146 vtkSetMacro( UseValueAsOffset, bool ); 00147 vtkGetMacro( UseValueAsOffset, bool ); 00148 vtkBooleanMacro( UseValueAsOffset, bool ); 00150 00152 00155 virtual void SetClipFunction( vtkImplicitFunction * ); 00156 vtkGetObjectMacro( ClipFunction, vtkImplicitFunction ); 00158 00160 00164 vtkSetMacro( GenerateClipScalars, int ); 00165 vtkGetMacro( GenerateClipScalars, int ); 00166 vtkBooleanMacro( GenerateClipScalars, int ); 00168 00170 00177 void SetLocator( vtkIncrementalPointLocator * locator ); 00178 vtkGetObjectMacro( Locator, vtkIncrementalPointLocator ); 00180 00182 00186 vtkSetClampMacro( MergeTolerance, double, 0.0001, 0.25 ); 00187 vtkGetMacro( MergeTolerance, double ); 00189 00192 void CreateDefaultLocator(); 00193 00195 00197 vtkSetMacro( GenerateClippedOutput, int ); 00198 vtkGetMacro( GenerateClippedOutput, int ); 00199 vtkBooleanMacro( GenerateClippedOutput, int ); 00201 00203 vtkUnstructuredGrid * GetClippedOutput(); 00204 00206 00209 vtkSetClampMacro(OutputPointsPrecision, int, SINGLE_PRECISION, DEFAULT_PRECISION); 00210 vtkGetMacro(OutputPointsPrecision, int); 00212 00213 protected: 00214 vtkTableBasedClipDataSet( vtkImplicitFunction * cf = NULL ); 00215 ~vtkTableBasedClipDataSet(); 00216 00217 virtual int RequestData( vtkInformation *, 00218 vtkInformationVector **, vtkInformationVector * ); 00219 virtual int FillInputPortInformation( int port, vtkInformation * info ); 00220 00222 00225 void ClipDataSet( vtkDataSet * pDataSet, 00226 vtkDataArray * clipAray, vtkUnstructuredGrid * unstruct ); 00228 00230 00232 void ClipImageData( vtkDataSet * inputGrd, vtkDataArray * clipAray, 00233 double isoValue, vtkUnstructuredGrid * outputUG ); 00235 00237 00242 void ClipPolyData( vtkDataSet * inputGrd, vtkDataArray * clipAray, 00243 double isoValue, vtkUnstructuredGrid * outputUG ); 00245 00247 00252 void ClipRectilinearGridData( vtkDataSet * inputGrd, vtkDataArray * clipAray, 00253 double isoValue, vtkUnstructuredGrid * outputUG ); 00255 00257 00262 void ClipStructuredGridData( vtkDataSet * inputGrd, vtkDataArray * clipAray, 00263 double isoValue, vtkUnstructuredGrid * outputUG ); 00265 00267 00272 void ClipUnstructuredGridData( vtkDataSet * inputGrd, vtkDataArray * clipAray, 00273 double isoValue, vtkUnstructuredGrid * outputUG ); 00275 00276 00278 00279 static void InternalProgressCallbackFunction( vtkObject *, unsigned long, 00280 void * clientdata, void * ); 00282 00284 void InternalProgressCallback( vtkAlgorithm * algorithm ); 00285 00286 00287 int InsideOut; 00288 int GenerateClipScalars; 00289 int GenerateClippedOutput; 00290 bool UseValueAsOffset; 00291 double Value; 00292 double MergeTolerance; 00293 vtkCallbackCommand * InternalProgressObserver; 00294 vtkImplicitFunction * ClipFunction; 00295 vtkIncrementalPointLocator * Locator; 00296 00297 int OutputPointsPrecision; 00298 00299 private: 00300 vtkTableBasedClipDataSet( const vtkTableBasedClipDataSet &); // Not implemented. 00301 void operator= ( const vtkTableBasedClipDataSet & ); // Not implemented. 00302 }; 00303 00304 #endif