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
00061 #define VTK_NUMBER_OF_CELL_TYPES 68
00062
00063 class vtkImplicitFunction;
00064 class vtkPointLocator;
00065 class vtkSynchronizedTemplates3D;
00066 class vtkSynchronizedTemplatesCutter3D;
00067 class vtkGridSynchronizedTemplates3D;
00068 class vtkRectilinearSynchronizedTemplates;
00069
00070 class VTK_GRAPHICS_EXPORT vtkCutter : public vtkPolyDataAlgorithm
00071 {
00072 public:
00073 vtkTypeRevisionMacro(vtkCutter,vtkPolyDataAlgorithm);
00074 void PrintSelf(ostream& os, vtkIndent indent);
00075
00078 static vtkCutter *New();
00079
00081
00083 void SetValue(int i, double value)
00084 {this->ContourValues->SetValue(i,value);}
00086
00088
00089 double GetValue(int i)
00090 {return this->ContourValues->GetValue(i);}
00092
00094
00096 double *GetValues()
00097 {return this->ContourValues->GetValues();}
00099
00101
00104 void GetValues(double *contourValues)
00105 {this->ContourValues->GetValues(contourValues);}
00107
00109
00112 void SetNumberOfContours(int number)
00113 {this->ContourValues->SetNumberOfContours(number);}
00115
00117
00118 int GetNumberOfContours()
00119 {return this->ContourValues->GetNumberOfContours();}
00121
00123
00125 void GenerateValues(int numContours, double range[2])
00126 {this->ContourValues->GenerateValues(numContours, range);}
00128
00130
00132 void GenerateValues(int numContours, double rangeStart, double rangeEnd)
00133 {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
00135
00138 unsigned long GetMTime();
00139
00141
00142 virtual void SetCutFunction(vtkImplicitFunction*);
00143 vtkGetObjectMacro(CutFunction,vtkImplicitFunction);
00145
00147
00150 vtkSetMacro(GenerateCutScalars,int);
00151 vtkGetMacro(GenerateCutScalars,int);
00152 vtkBooleanMacro(GenerateCutScalars,int);
00154
00156
00158 void SetLocator(vtkPointLocator *locator);
00159 vtkGetObjectMacro(Locator,vtkPointLocator);
00161
00163
00173 vtkSetClampMacro(SortBy,int,VTK_SORT_BY_VALUE,VTK_SORT_BY_CELL);
00174 vtkGetMacro(SortBy,int);
00175 void SetSortByToSortByValue()
00176 {this->SetSortBy(VTK_SORT_BY_VALUE);}
00177 void SetSortByToSortByCell()
00178 {this->SetSortBy(VTK_SORT_BY_CELL);}
00179 const char *GetSortByAsString();
00181
00184 void CreateDefaultLocator();
00185
00190 static void GetCellTypeDimensions(unsigned char* cellTypeDimensions);
00191
00192 protected:
00193 vtkCutter(vtkImplicitFunction *cf=NULL);
00194 ~vtkCutter();
00195
00196 virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00197 virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00198 virtual int FillInputPortInformation(int port, vtkInformation *info);
00199 void UnstructuredGridCutter(vtkDataSet *input, vtkPolyData *output);
00200 void DataSetCutter(vtkDataSet *input, vtkPolyData *output);
00201 void StructuredPointsCutter(vtkDataSet *, vtkPolyData *,
00202 vtkInformation *, vtkInformationVector **,
00203 vtkInformationVector *);
00204 void StructuredGridCutter(vtkDataSet *, vtkPolyData *);
00205 void RectilinearGridCutter(vtkDataSet *, vtkPolyData *);
00206 vtkImplicitFunction *CutFunction;
00207
00208 vtkSynchronizedTemplates3D *SynchronizedTemplates3D;
00209 vtkSynchronizedTemplatesCutter3D *SynchronizedTemplatesCutter3D;
00210 vtkGridSynchronizedTemplates3D *GridSynchronizedTemplates;
00211 vtkRectilinearSynchronizedTemplates *RectilinearSynchronizedTemplates;
00212
00213 vtkPointLocator *Locator;
00214 int SortBy;
00215 vtkContourValues *ContourValues;
00216 int GenerateCutScalars;
00217 private:
00218 vtkCutter(const vtkCutter&);
00219 void operator=(const vtkCutter&);
00220 };
00221
00223 inline const char *vtkCutter::GetSortByAsString(void)
00224 {
00225 if ( this->SortBy == VTK_SORT_BY_VALUE )
00226 {
00227 return "SortByValue";
00228 }
00229 else
00230 {
00231 return "SortByCell";
00232 }
00233 }
00234
00235 #endif