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

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 "vtkUnstructuredGridAlgorithm.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 vtkUnstructuredGridAlgorithm
00085 {
00086 public:
00087   vtkTypeRevisionMacro(vtkClipVolume,vtkUnstructuredGridAlgorithm);
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   virtual void ReportReferences(vtkGarbageCollector*);
00179 
00180   virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00181   virtual int FillInputPortInformation(int port, vtkInformation *info);
00182 
00183   void ClipTets(double value, vtkTetra *clipTetra, vtkDataArray *clipScalars, 
00184                 vtkDataArray *cellScalars, vtkIdList *tetraIds, 
00185                 vtkPoints *tetraPts, vtkPointData *inPD, vtkPointData *outPD, 
00186                 vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD, 
00187                 vtkCellData *clippedCD, int insideOut);
00188   void ClipVoxel(double value, vtkDataArray *cellScalars, int flip,
00189                  double origin[3], double spacing[3], vtkIdList *cellIds,
00190                  vtkPoints *cellPts, vtkPointData *inPD, vtkPointData *outPD, 
00191                  vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD, 
00192                  vtkCellData *clippedCD);
00193 
00194   vtkImplicitFunction *ClipFunction;
00195   vtkPointLocator     *Locator;
00196   int                  InsideOut;
00197   double                Value;
00198   int                  GenerateClipScalars;
00199   double                MergeTolerance;
00200   int                  Mixed3DCellGeneration;
00201   int                  GenerateClippedOutput;
00202   vtkUnstructuredGrid *ClippedOutput;
00203   
00204 private:
00205   vtkOrderedTriangulator *Triangulator;
00206   
00207   // Used temporarily to pass data around
00208   vtkIdType             NumberOfCells;
00209   vtkCellArray          *Connectivity;
00210   vtkUnsignedCharArray  *Types;
00211   vtkIdTypeArray        *Locations;
00212   vtkIdType             NumberOfClippedCells;
00213   vtkCellArray          *ClippedConnectivity;
00214   vtkUnsignedCharArray  *ClippedTypes;
00215   vtkIdTypeArray        *ClippedLocations;
00216 
00217 private:
00218   vtkClipVolume(const vtkClipVolume&);  // Not implemented.
00219   void operator=(const vtkClipVolume&);  // Not implemented.
00220 };
00221 
00222 #endif

Generated on Mon Jan 21 23:07:24 2008 for VTK by  doxygen 1.4.3-20050530