00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00050 #ifndef __vtkCutter_h
00051 #define __vtkCutter_h
00052
00053 #include "vtkPolyDataAlgorithm.h"
00054
00055 #include "vtkContourValues.h"
00056
00057 #define VTK_SORT_BY_VALUE 0
00058 #define VTK_SORT_BY_CELL 1
00059
00060 class vtkImplicitFunction;
00061 class vtkIncrementalPointLocator;
00062 class vtkSynchronizedTemplates3D;
00063 class vtkSynchronizedTemplatesCutter3D;
00064 class vtkGridSynchronizedTemplates3D;
00065 class vtkRectilinearSynchronizedTemplates;
00066
00067 class VTK_GRAPHICS_EXPORT vtkCutter : public vtkPolyDataAlgorithm
00068 {
00069 public:
00070 vtkTypeMacro(vtkCutter,vtkPolyDataAlgorithm);
00071 void PrintSelf(ostream& os, vtkIndent indent);
00072
00075 static vtkCutter *New();
00076
00078
00080 void SetValue(int i, double value)
00081 {this->ContourValues->SetValue(i,value);}
00083
00085
00086 double GetValue(int i)
00087 {return this->ContourValues->GetValue(i);}
00089
00091
00093 double *GetValues()
00094 {return this->ContourValues->GetValues();}
00096
00098
00101 void GetValues(double *contourValues)
00102 {this->ContourValues->GetValues(contourValues);}
00104
00106
00109 void SetNumberOfContours(int number)
00110 {this->ContourValues->SetNumberOfContours(number);}
00112
00114
00115 int GetNumberOfContours()
00116 {return this->ContourValues->GetNumberOfContours();}
00118
00120
00122 void GenerateValues(int numContours, double range[2])
00123 {this->ContourValues->GenerateValues(numContours, range);}
00125
00127
00129 void GenerateValues(int numContours, double rangeStart, double rangeEnd)
00130 {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
00132
00135 unsigned long GetMTime();
00136
00138
00139 virtual void SetCutFunction(vtkImplicitFunction*);
00140 vtkGetObjectMacro(CutFunction,vtkImplicitFunction);
00142
00144
00147 vtkSetMacro(GenerateCutScalars,int);
00148 vtkGetMacro(GenerateCutScalars,int);
00149 vtkBooleanMacro(GenerateCutScalars,int);
00151
00153
00155 void SetLocator(vtkIncrementalPointLocator *locator);
00156 vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
00158
00160
00170 vtkSetClampMacro(SortBy,int,VTK_SORT_BY_VALUE,VTK_SORT_BY_CELL);
00171 vtkGetMacro(SortBy,int);
00172 void SetSortByToSortByValue()
00173 {this->SetSortBy(VTK_SORT_BY_VALUE);}
00174 void SetSortByToSortByCell()
00175 {this->SetSortBy(VTK_SORT_BY_CELL);}
00176 const char *GetSortByAsString();
00178
00181 void CreateDefaultLocator();
00182
00187 static void GetCellTypeDimensions(unsigned char* cellTypeDimensions);
00188
00189 protected:
00190 vtkCutter(vtkImplicitFunction *cf=NULL);
00191 ~vtkCutter();
00192
00194
00195 virtual int ProcessRequest(vtkInformation*,
00196 vtkInformationVector**,
00197 vtkInformationVector*);
00199
00200 virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00201 virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00202 virtual int FillInputPortInformation(int port, vtkInformation *info);
00203 void UnstructuredGridCutter(vtkDataSet *input, vtkPolyData *output);
00204 void DataSetCutter(vtkDataSet *input, vtkPolyData *output);
00205 void StructuredPointsCutter(vtkDataSet *, vtkPolyData *,
00206 vtkInformation *, vtkInformationVector **,
00207 vtkInformationVector *);
00208 void StructuredGridCutter(vtkDataSet *, vtkPolyData *);
00209 void RectilinearGridCutter(vtkDataSet *, vtkPolyData *);
00210 vtkImplicitFunction *CutFunction;
00211
00212 vtkSynchronizedTemplates3D *SynchronizedTemplates3D;
00213 vtkSynchronizedTemplatesCutter3D *SynchronizedTemplatesCutter3D;
00214 vtkGridSynchronizedTemplates3D *GridSynchronizedTemplates;
00215 vtkRectilinearSynchronizedTemplates *RectilinearSynchronizedTemplates;
00216
00217 vtkIncrementalPointLocator *Locator;
00218 int SortBy;
00219 vtkContourValues *ContourValues;
00220 int GenerateCutScalars;
00221 private:
00222 vtkCutter(const vtkCutter&);
00223 void operator=(const vtkCutter&);
00224 };
00225
00227 inline const char *vtkCutter::GetSortByAsString(void)
00228 {
00229 if ( this->SortBy == VTK_SORT_BY_VALUE )
00230 {
00231 return "SortByValue";
00232 }
00233 else
00234 {
00235 return "SortByCell";
00236 }
00237 }
00238
00239 #endif