VTK
dox/Filters/General/vtkClipVolume.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkClipVolume.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 =========================================================================*/
00063 #ifndef __vtkClipVolume_h
00064 #define __vtkClipVolume_h
00065 
00066 #include "vtkFiltersGeneralModule.h" // For export macro
00067 #include "vtkUnstructuredGridAlgorithm.h"
00068 
00069 class vtkCellData;
00070 class vtkDataArray;
00071 class vtkIdList;
00072 class vtkImplicitFunction;
00073 class vtkMergePoints;
00074 class vtkOrderedTriangulator;
00075 class vtkPointData;
00076 class vtkIncrementalPointLocator;
00077 class vtkPoints;
00078 class vtkUnstructuredGrid;
00079 class vtkCell;
00080 class vtkTetra;
00081 class vtkCellArray;
00082 class vtkIdTypeArray;
00083 class vtkUnsignedCharArray;
00084 
00085 class VTKFILTERSGENERAL_EXPORT vtkClipVolume : public vtkUnstructuredGridAlgorithm
00086 {
00087 public:
00088   vtkTypeMacro(vtkClipVolume,vtkUnstructuredGridAlgorithm);
00089   void PrintSelf(ostream& os, vtkIndent indent);
00090 
00093   static vtkClipVolume *New();
00094 
00096 
00099   vtkSetMacro(Value,double);
00100   vtkGetMacro(Value,double);
00102 
00104 
00109   vtkSetMacro(InsideOut,int);
00110   vtkGetMacro(InsideOut,int);
00111   vtkBooleanMacro(InsideOut,int);
00113 
00115 
00118   virtual void SetClipFunction(vtkImplicitFunction*);
00119   vtkGetObjectMacro(ClipFunction,vtkImplicitFunction);
00121 
00123 
00127   vtkSetMacro(GenerateClipScalars,int);
00128   vtkGetMacro(GenerateClipScalars,int);
00129   vtkBooleanMacro(GenerateClipScalars,int);
00131 
00133 
00135   vtkSetMacro(GenerateClippedOutput,int);
00136   vtkGetMacro(GenerateClippedOutput,int);
00137   vtkBooleanMacro(GenerateClippedOutput,int);
00139 
00141   vtkUnstructuredGrid *GetClippedOutput();
00142 
00144 
00148   vtkSetMacro(Mixed3DCellGeneration,int);
00149   vtkGetMacro(Mixed3DCellGeneration,int);
00150   vtkBooleanMacro(Mixed3DCellGeneration,int);
00152 
00154 
00157   vtkSetClampMacro(MergeTolerance,double,0.0001,0.25);
00158   vtkGetMacro(MergeTolerance,double);
00160 
00162 
00164   void SetLocator(vtkIncrementalPointLocator *locator);
00165   vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
00167 
00170   void CreateDefaultLocator();
00171 
00173   unsigned long int GetMTime();
00174 
00175 protected:
00176   vtkClipVolume(vtkImplicitFunction *cf=NULL);
00177   ~vtkClipVolume();
00178 
00179   virtual void ReportReferences(vtkGarbageCollector*);
00180 
00181   virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00182   virtual int FillInputPortInformation(int port, vtkInformation *info);
00183 
00184   void ClipTets(double value, vtkTetra *clipTetra, vtkDataArray *clipScalars,
00185                 vtkDataArray *cellScalars, vtkIdList *tetraIds,
00186                 vtkPoints *tetraPts, vtkPointData *inPD, vtkPointData *outPD,
00187                 vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD,
00188                 vtkCellData *clippedCD, int insideOut);
00189   void ClipVoxel(double value, vtkDataArray *cellScalars, int flip,
00190                  double origin[3], double spacing[3], vtkIdList *cellIds,
00191                  vtkPoints *cellPts, vtkPointData *inPD, vtkPointData *outPD,
00192                  vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD,
00193                  vtkCellData *clippedCD);
00194 
00195   vtkImplicitFunction *ClipFunction;
00196   vtkIncrementalPointLocator     *Locator;
00197   int                  InsideOut;
00198   double                Value;
00199   int                  GenerateClipScalars;
00200   double                MergeTolerance;
00201   int                  Mixed3DCellGeneration;
00202   int                  GenerateClippedOutput;
00203   vtkUnstructuredGrid *ClippedOutput;
00204 
00205 private:
00206   vtkOrderedTriangulator *Triangulator;
00207 
00208   // Used temporarily to pass data around
00209   vtkIdType             NumberOfCells;
00210   vtkCellArray          *Connectivity;
00211   vtkUnsignedCharArray  *Types;
00212   vtkIdTypeArray        *Locations;
00213   vtkIdType             NumberOfClippedCells;
00214   vtkCellArray          *ClippedConnectivity;
00215   vtkUnsignedCharArray  *ClippedTypes;
00216   vtkIdTypeArray        *ClippedLocations;
00217 
00218 private:
00219   vtkClipVolume(const vtkClipVolume&);  // Not implemented.
00220   void operator=(const vtkClipVolume&);  // Not implemented.
00221 };
00222 
00223 #endif