vtkCutter.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00049 #ifndef __vtkCutter_h
00050 #define __vtkCutter_h
00051
00052 #include "vtkDataSetToPolyDataFilter.h"
00053
00054 #include "vtkContourValues.h"
00055
00056 #define VTK_SORT_BY_VALUE 0
00057 #define VTK_SORT_BY_CELL 1
00058
00059 class vtkImplicitFunction;
00060 class vtkPointLocator;
00061
00062 class VTK_GRAPHICS_EXPORT vtkCutter : public vtkDataSetToPolyDataFilter
00063 {
00064 public:
00065 vtkTypeRevisionMacro(vtkCutter,vtkDataSetToPolyDataFilter);
00066 void PrintSelf(ostream& os, vtkIndent indent);
00067
00070 static vtkCutter *New();
00071
00073
00075 void SetValue(int i, float value)
00076 {this->ContourValues->SetValue(i,value);}
00078
00080
00081 float GetValue(int i)
00082 {return this->ContourValues->GetValue(i);}
00084
00086
00088 float *GetValues()
00089 {return this->ContourValues->GetValues();}
00091
00093
00096 void GetValues(float *contourValues)
00097 {this->ContourValues->GetValues(contourValues);}
00099
00101
00104 void SetNumberOfContours(int number)
00105 {this->ContourValues->SetNumberOfContours(number);}
00107
00109
00110 int GetNumberOfContours()
00111 {return this->ContourValues->GetNumberOfContours();}
00113
00115
00117 void GenerateValues(int numContours, float range[2])
00118 {this->ContourValues->GenerateValues(numContours, range);}
00120
00122
00124 void GenerateValues(int numContours, float rangeStart, float rangeEnd)
00125 {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
00127
00130 unsigned long GetMTime();
00131
00133
00134 virtual void SetCutFunction(vtkImplicitFunction*);
00135 vtkGetObjectMacro(CutFunction,vtkImplicitFunction);
00137
00139
00142 vtkSetMacro(GenerateCutScalars,int);
00143 vtkGetMacro(GenerateCutScalars,int);
00144 vtkBooleanMacro(GenerateCutScalars,int);
00146
00148
00150 void SetLocator(vtkPointLocator *locator);
00151 vtkGetObjectMacro(Locator,vtkPointLocator);
00153
00155
00163 vtkSetClampMacro(SortBy,int,VTK_SORT_BY_VALUE,VTK_SORT_BY_CELL);
00164 vtkGetMacro(SortBy,int);
00165 void SetSortByToSortByValue()
00166 {this->SetSortBy(VTK_SORT_BY_VALUE);}
00167 void SetSortByToSortByCell()
00168 {this->SetSortBy(VTK_SORT_BY_CELL);}
00169 const char *GetSortByAsString();
00171
00174 void CreateDefaultLocator();
00175
00176 protected:
00177 vtkCutter(vtkImplicitFunction *cf=NULL);
00178 ~vtkCutter();
00179
00180 void Execute();
00181 vtkImplicitFunction *CutFunction;
00182
00183 vtkPointLocator *Locator;
00184 int SortBy;
00185 vtkContourValues *ContourValues;
00186 int GenerateCutScalars;
00187 private:
00188 vtkCutter(const vtkCutter&);
00189 void operator=(const vtkCutter&);
00190 };
00191
00193 inline const char *vtkCutter::GetSortByAsString(void)
00194 {
00195 if ( this->SortBy == VTK_SORT_BY_VALUE )
00196 {
00197 return "SortByValue";
00198 }
00199 else
00200 {
00201 return "SortByCell";
00202 }
00203 }
00204
00205
00206 #endif
00207
00208