Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Graphics/vtkClipVolume.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkClipVolume.h,v $
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 =========================================================================*/
00063 #ifndef __vtkClipVolume_h
00064 #define __vtkClipVolume_h
00065 
00066 #include "vtkStructuredPointsToUnstructuredGridFilter.h"
00067 
00068 class vtkCellData;
00069 class vtkDataArray;
00070 class vtkIdList;
00071 class vtkImplicitFunction;
00072 class vtkMergePoints;
00073 class vtkOrderedTriangulator;
00074 class vtkPointData;
00075 class vtkPointLocator;
00076 class vtkPoints;
00077 class vtkUnstructuredGrid;
00078 class vtkCell;
00079 class vtkTetra;
00080 class vtkCellArray;
00081 class vtkIdTypeArray;
00082 class vtkUnsignedCharArray;
00083 
00084 class VTK_GRAPHICS_EXPORT vtkClipVolume : public vtkStructuredPointsToUnstructuredGridFilter
00085 {
00086 public:
00087   vtkTypeRevisionMacro(vtkClipVolume,vtkStructuredPointsToUnstructuredGridFilter);
00088   void PrintSelf(ostream& os, vtkIndent indent);
00089 
00092   static vtkClipVolume *New();
00093 
00095 
00098   vtkSetMacro(Value,double);
00099   vtkGetMacro(Value,double);
00101   
00103 
00108   vtkSetMacro(InsideOut,int);
00109   vtkGetMacro(InsideOut,int);
00110   vtkBooleanMacro(InsideOut,int);
00112 
00114 
00117   virtual void SetClipFunction(vtkImplicitFunction*);
00118   vtkGetObjectMacro(ClipFunction,vtkImplicitFunction);
00120 
00122 
00126   vtkSetMacro(GenerateClipScalars,int);
00127   vtkGetMacro(GenerateClipScalars,int);
00128   vtkBooleanMacro(GenerateClipScalars,int);
00130 
00132 
00134   vtkSetMacro(GenerateClippedOutput,int);
00135   vtkGetMacro(GenerateClippedOutput,int);
00136   vtkBooleanMacro(GenerateClippedOutput,int);
00138 
00140   vtkUnstructuredGrid *GetClippedOutput();
00141 
00143 
00147   vtkSetMacro(Mixed3DCellGeneration,int);
00148   vtkGetMacro(Mixed3DCellGeneration,int);
00149   vtkBooleanMacro(Mixed3DCellGeneration,int);
00151 
00153 
00156   vtkSetClampMacro(MergeTolerance,double,0.0001,0.25);
00157   vtkGetMacro(MergeTolerance,double);
00159   
00161 
00163   void SetLocator(vtkPointLocator *locator);
00164   vtkGetObjectMacro(Locator,vtkPointLocator);
00166 
00169   void CreateDefaultLocator();
00170 
00172   unsigned long int GetMTime();
00173 
00174 protected:
00175   vtkClipVolume(vtkImplicitFunction *cf=NULL);
00176   ~vtkClipVolume();
00177 
00178   void Execute();
00179   void ClipTets(double value, vtkTetra *clipTetra, vtkDataArray *clipScalars, 
00180                 vtkDataArray *cellScalars, vtkIdList *tetraIds, 
00181                 vtkPoints *tetraPts, vtkPointData *inPD, vtkPointData *outPD, 
00182                 vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD, 
00183                 vtkCellData *clippedCD, int insideOut);
00184   void ClipVoxel(double value, vtkDataArray *cellScalars, int flip,
00185                  double origin[3], double spacing[3], vtkIdList *cellIds,
00186                  vtkPoints *cellPts, vtkPointData *inPD, vtkPointData *outPD, 
00187                  vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD, 
00188                  vtkCellData *clippedCD);
00189 
00190   vtkImplicitFunction *ClipFunction;
00191   vtkPointLocator     *Locator;
00192   int                  InsideOut;
00193   double                Value;
00194   int                  GenerateClipScalars;
00195   double                MergeTolerance;
00196   int                  Mixed3DCellGeneration;
00197   int                  GenerateClippedOutput;
00198   vtkUnstructuredGrid *ClippedOutput;
00199   
00200 private:
00201   vtkUnstructuredGrid    *Mesh;
00202   vtkOrderedTriangulator *Triangulator;
00203   
00204   // Used temporarily to pass data around
00205   vtkIdType             NumberOfCells;
00206   vtkCellArray          *Connectivity;
00207   vtkUnsignedCharArray  *Types;
00208   vtkIdTypeArray        *Locations;
00209   vtkIdType             NumberOfClippedCells;
00210   vtkCellArray          *ClippedConnectivity;
00211   vtkUnsignedCharArray  *ClippedTypes;
00212   vtkIdTypeArray        *ClippedLocations;
00213 
00214 private:
00215   vtkClipVolume(const vtkClipVolume&);  // Not implemented.
00216   void operator=(const vtkClipVolume&);  // Not implemented.
00217 };
00218 
00219 #endif