00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00075 #ifndef __vtkClipVolume_h
00076 #define __vtkClipVolume_h
00077
00078 #include "vtkStructuredPointsToUnstructuredGridFilter.h"
00079
00080 class vtkCellData;
00081 class vtkDataArray;
00082 class vtkIdList;
00083 class vtkImplicitFunction;
00084 class vtkMergePoints;
00085 class vtkOrderedTriangulator;
00086 class vtkPointData;
00087 class vtkPointLocator;
00088 class vtkPoints;
00089 class vtkUnstructuredGrid;
00090 class vtkCell;
00091 class vtkTetra;
00092 class vtkCellArray;
00093 class vtkIdTypeArray;
00094 class vtkUnsignedCharArray;
00095
00096 class VTK_GRAPHICS_EXPORT vtkClipVolume : public vtkStructuredPointsToUnstructuredGridFilter
00097 {
00098 public:
00099 vtkTypeRevisionMacro(vtkClipVolume,vtkStructuredPointsToUnstructuredGridFilter);
00100 void PrintSelf(ostream& os, vtkIndent indent);
00101
00104 static vtkClipVolume *New();
00105
00107
00110 vtkSetMacro(Value,double);
00111 vtkGetMacro(Value,double);
00113
00115
00120 vtkSetMacro(InsideOut,int);
00121 vtkGetMacro(InsideOut,int);
00122 vtkBooleanMacro(InsideOut,int);
00124
00126
00129 virtual void SetClipFunction(vtkImplicitFunction*);
00130 vtkGetObjectMacro(ClipFunction,vtkImplicitFunction);
00132
00134
00138 vtkSetMacro(GenerateClipScalars,int);
00139 vtkGetMacro(GenerateClipScalars,int);
00140 vtkBooleanMacro(GenerateClipScalars,int);
00142
00144
00146 vtkSetMacro(GenerateClippedOutput,int);
00147 vtkGetMacro(GenerateClippedOutput,int);
00148 vtkBooleanMacro(GenerateClippedOutput,int);
00150
00152 vtkUnstructuredGrid *GetClippedOutput();
00153
00155
00159 vtkSetMacro(Mixed3DCellGeneration,int);
00160 vtkGetMacro(Mixed3DCellGeneration,int);
00161 vtkBooleanMacro(Mixed3DCellGeneration,int);
00163
00165
00168 vtkSetClampMacro(MergeTolerance,double,0.0001,0.25);
00169 vtkGetMacro(MergeTolerance,double);
00171
00173
00175 void SetLocator(vtkPointLocator *locator);
00176 vtkGetObjectMacro(Locator,vtkPointLocator);
00178
00181 void CreateDefaultLocator();
00182
00184 unsigned long int GetMTime();
00185
00186 protected:
00187 vtkClipVolume(vtkImplicitFunction *cf=NULL);
00188 ~vtkClipVolume();
00189
00190 virtual void ReportReferences(vtkGarbageCollector*);
00191 virtual void RemoveReferences();
00192
00193 void Execute();
00194 void ClipTets(double value, vtkTetra *clipTetra, vtkDataArray *clipScalars,
00195 vtkDataArray *cellScalars, vtkIdList *tetraIds,
00196 vtkPoints *tetraPts, vtkPointData *inPD, vtkPointData *outPD,
00197 vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD,
00198 vtkCellData *clippedCD, int insideOut);
00199 void ClipVoxel(double value, vtkDataArray *cellScalars, int flip,
00200 double origin[3], double spacing[3], vtkIdList *cellIds,
00201 vtkPoints *cellPts, vtkPointData *inPD, vtkPointData *outPD,
00202 vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD,
00203 vtkCellData *clippedCD);
00204
00205 vtkImplicitFunction *ClipFunction;
00206 vtkPointLocator *Locator;
00207 int InsideOut;
00208 double Value;
00209 int GenerateClipScalars;
00210 double MergeTolerance;
00211 int Mixed3DCellGeneration;
00212 int GenerateClippedOutput;
00213 vtkUnstructuredGrid *ClippedOutput;
00214
00215 private:
00216 vtkOrderedTriangulator *Triangulator;
00217
00218
00219 vtkIdType NumberOfCells;
00220 vtkCellArray *Connectivity;
00221 vtkUnsignedCharArray *Types;
00222 vtkIdTypeArray *Locations;
00223 vtkIdType NumberOfClippedCells;
00224 vtkCellArray *ClippedConnectivity;
00225 vtkUnsignedCharArray *ClippedTypes;
00226 vtkIdTypeArray *ClippedLocations;
00227
00228 private:
00229 vtkClipVolume(const vtkClipVolume&);
00230 void operator=(const vtkClipVolume&);
00231 };
00232
00233 #endif