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 00092 #ifndef __vtkTableBasedClipDataSet_h 00093 #define __vtkTableBasedClipDataSet_h 00094 00095 #include "vtkUnstructuredGridAlgorithm.h" 00096 00097 class vtkCallbackCommand; 00098 class vtkImplicitFunction; 00099 class vtkIncrementalPointLocator; 00100 00101 class VTK_GRAPHICS_EXPORT vtkTableBasedClipDataSet : public vtkUnstructuredGridAlgorithm 00102 { 00103 public: 00104 vtkTypeMacro( vtkTableBasedClipDataSet, vtkUnstructuredGridAlgorithm ); 00105 void PrintSelf( ostream & os, vtkIndent indent ); 00106 00110 static vtkTableBasedClipDataSet * New(); 00111 00114 unsigned long GetMTime(); 00115 00117 00123 vtkSetMacro( InsideOut, int ); 00124 vtkGetMacro( InsideOut, int ); 00125 vtkBooleanMacro( InsideOut, int ); 00127 00129 00133 vtkSetMacro( Value, double ); 00134 vtkGetMacro( Value, double ); 00136 00138 00142 vtkSetMacro( UseValueAsOffset, bool ); 00143 vtkGetMacro( UseValueAsOffset, bool ); 00144 vtkBooleanMacro( UseValueAsOffset, bool ); 00146 00148 00151 virtual void SetClipFunction( vtkImplicitFunction * ); 00152 vtkGetObjectMacro( ClipFunction, vtkImplicitFunction ); 00154 00156 00160 vtkSetMacro( GenerateClipScalars, int ); 00161 vtkGetMacro( GenerateClipScalars, int ); 00162 vtkBooleanMacro( GenerateClipScalars, int ); 00164 00166 00173 void SetLocator( vtkIncrementalPointLocator * locator ); 00174 vtkGetObjectMacro( Locator, vtkIncrementalPointLocator ); 00176 00178 00182 vtkSetClampMacro( MergeTolerance, double, 0.0001, 0.25 ); 00183 vtkGetMacro( MergeTolerance, double ); 00185 00188 void CreateDefaultLocator(); 00189 00191 00193 vtkSetMacro( GenerateClippedOutput, int ); 00194 vtkGetMacro( GenerateClippedOutput, int ); 00195 vtkBooleanMacro( GenerateClippedOutput, int ); 00197 00199 vtkUnstructuredGrid * GetClippedOutput(); 00200 00202 00203 virtual int ProcessRequest( vtkInformation *, 00204 vtkInformationVector **, 00205 vtkInformationVector *); 00206 protected: 00207 vtkTableBasedClipDataSet( vtkImplicitFunction * cf = NULL ); 00208 ~vtkTableBasedClipDataSet(); 00210 00211 virtual int RequestData( vtkInformation *, 00212 vtkInformationVector **, vtkInformationVector * ); 00213 virtual int FillInputPortInformation( int port, vtkInformation * info ); 00214 00216 00219 void ClipDataSet( vtkDataSet * pDataSet, 00220 vtkDataArray * clipAray, vtkUnstructuredGrid * unstruct ); 00222 00224 00226 void ClipImageData( vtkDataSet * inputGrd, vtkDataArray * clipAray, 00227 double isoValue, vtkUnstructuredGrid * outputUG ); 00229 00231 00236 void ClipPolyData( vtkDataSet * inputGrd, vtkDataArray * clipAray, 00237 double isoValue, vtkUnstructuredGrid * outputUG ); 00239 00241 00246 void ClipRectilinearGridData( vtkDataSet * inputGrd, vtkDataArray * clipAray, 00247 double isoValue, vtkUnstructuredGrid * outputUG ); 00249 00251 00256 void ClipStructuredGridData( vtkDataSet * inputGrd, vtkDataArray * clipAray, 00257 double isoValue, vtkUnstructuredGrid * outputUG ); 00259 00261 00266 void ClipUnstructuredGridData( vtkDataSet * inputGrd, vtkDataArray * clipAray, 00267 double isoValue, vtkUnstructuredGrid * outputUG ); 00269 00270 00272 00273 static void InternalProgressCallbackFunction( vtkObject *, unsigned long, 00274 void * clientdata, void * ); 00276 00278 void InternalProgressCallback( vtkAlgorithm * algorithm ); 00279 00280 00281 int InsideOut; 00282 int GenerateClipScalars; 00283 int GenerateClippedOutput; 00284 bool UseValueAsOffset; 00285 double Value; 00286 double MergeTolerance; 00287 vtkCallbackCommand * InternalProgressObserver; 00288 vtkImplicitFunction * ClipFunction; 00289 vtkIncrementalPointLocator * Locator; 00290 00291 private: 00292 vtkTableBasedClipDataSet( const vtkTableBasedClipDataSet &); // Not implemented. 00293 void operator= ( const vtkTableBasedClipDataSet & ); // Not implemented. 00294 }; 00295 00296 #endif