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 vtkPointLocator;
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 vtkTypeRevisionMacro(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(vtkPointLocator *locator);
00156 vtkGetObjectMacro(Locator,vtkPointLocator);
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
00193 virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00194 virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00195 virtual int FillInputPortInformation(int port, vtkInformation *info);
00196 void UnstructuredGridCutter(vtkDataSet *input, vtkPolyData *output);
00197 void DataSetCutter(vtkDataSet *input, vtkPolyData *output);
00198 void StructuredPointsCutter(vtkDataSet *, vtkPolyData *,
00199 vtkInformation *, vtkInformationVector **,
00200 vtkInformationVector *);
00201 void StructuredGridCutter(vtkDataSet *, vtkPolyData *);
00202 void RectilinearGridCutter(vtkDataSet *, vtkPolyData *);
00203 vtkImplicitFunction *CutFunction;
00204
00205 vtkSynchronizedTemplates3D *SynchronizedTemplates3D;
00206 vtkSynchronizedTemplatesCutter3D *SynchronizedTemplatesCutter3D;
00207 vtkGridSynchronizedTemplates3D *GridSynchronizedTemplates;
00208 vtkRectilinearSynchronizedTemplates *RectilinearSynchronizedTemplates;
00209
00210 vtkPointLocator *Locator;
00211 int SortBy;
00212 vtkContourValues *ContourValues;
00213 int GenerateCutScalars;
00214 private:
00215 vtkCutter(const vtkCutter&);
00216 void operator=(const vtkCutter&);
00217 };
00218
00220 inline const char *vtkCutter::GetSortByAsString(void)
00221 {
00222 if ( this->SortBy == VTK_SORT_BY_VALUE )
00223 {
00224 return "SortByValue";
00225 }
00226 else
00227 {
00228 return "SortByCell";
00229 }
00230 }
00231
00232 #endif