Graphics/vtkCutter.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00045 #ifndef __vtkCutter_h
00046 #define __vtkCutter_h
00047
00048 #include "vtkDataSetToPolyDataFilter.h"
00049
00050 #include "vtkContourValues.h"
00051
00052 #define VTK_SORT_BY_VALUE 0
00053 #define VTK_SORT_BY_CELL 1
00054
00055 class vtkImplicitFunction;
00056 class vtkPointLocator;
00057
00058 class VTK_GRAPHICS_EXPORT vtkCutter : public vtkDataSetToPolyDataFilter
00059 {
00060 public:
00061 vtkTypeRevisionMacro(vtkCutter,vtkDataSetToPolyDataFilter);
00062 void PrintSelf(ostream& os, vtkIndent indent);
00063
00066 static vtkCutter *New();
00067
00069
00071 void SetValue(int i, double value)
00072 {this->ContourValues->SetValue(i,value);}
00074
00076
00077 double GetValue(int i)
00078 {return this->ContourValues->GetValue(i);}
00080
00082
00084 double *GetValues()
00085 {return this->ContourValues->GetValues();}
00087
00089
00092 void GetValues(double *contourValues)
00093 {this->ContourValues->GetValues(contourValues);}
00095
00097
00100 void SetNumberOfContours(int number)
00101 {this->ContourValues->SetNumberOfContours(number);}
00103
00105
00106 int GetNumberOfContours()
00107 {return this->ContourValues->GetNumberOfContours();}
00109
00111
00113 void GenerateValues(int numContours, double range[2])
00114 {this->ContourValues->GenerateValues(numContours, range);}
00116
00118
00120 void GenerateValues(int numContours, double rangeStart, double rangeEnd)
00121 {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
00123
00126 unsigned long GetMTime();
00127
00129
00130 virtual void SetCutFunction(vtkImplicitFunction*);
00131 vtkGetObjectMacro(CutFunction,vtkImplicitFunction);
00133
00135
00138 vtkSetMacro(GenerateCutScalars,int);
00139 vtkGetMacro(GenerateCutScalars,int);
00140 vtkBooleanMacro(GenerateCutScalars,int);
00142
00144
00146 void SetLocator(vtkPointLocator *locator);
00147 vtkGetObjectMacro(Locator,vtkPointLocator);
00149
00151
00159 vtkSetClampMacro(SortBy,int,VTK_SORT_BY_VALUE,VTK_SORT_BY_CELL);
00160 vtkGetMacro(SortBy,int);
00161 void SetSortByToSortByValue()
00162 {this->SetSortBy(VTK_SORT_BY_VALUE);}
00163 void SetSortByToSortByCell()
00164 {this->SetSortBy(VTK_SORT_BY_CELL);}
00165 const char *GetSortByAsString();
00167
00170 void CreateDefaultLocator();
00171
00172 protected:
00173 vtkCutter(vtkImplicitFunction *cf=NULL);
00174 ~vtkCutter();
00175
00176 void Execute();
00177 void UnstructuredGridCutter();
00178 void DataSetCutter();
00179 vtkImplicitFunction *CutFunction;
00180
00181 vtkPointLocator *Locator;
00182 int SortBy;
00183 vtkContourValues *ContourValues;
00184 int GenerateCutScalars;
00185 private:
00186 vtkCutter(const vtkCutter&);
00187 void operator=(const vtkCutter&);
00188 };
00189
00191 inline const char *vtkCutter::GetSortByAsString(void)
00192 {
00193 if ( this->SortBy == VTK_SORT_BY_VALUE )
00194 {
00195 return "SortByValue";
00196 }
00197 else
00198 {
00199 return "SortByCell";
00200 }
00201 }
00202
00203
00204 #endif
00205
00206