Graphics/vtkThreshold.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00056 #ifndef __vtkThreshold_h
00057 #define __vtkThreshold_h
00058
00059 #include "vtkDataSetToUnstructuredGridFilter.h"
00060
00061 #define VTK_ATTRIBUTE_MODE_DEFAULT 0
00062 #define VTK_ATTRIBUTE_MODE_USE_POINT_DATA 1
00063 #define VTK_ATTRIBUTE_MODE_USE_CELL_DATA 2
00064
00065 class VTK_GRAPHICS_EXPORT vtkThreshold : public vtkDataSetToUnstructuredGridFilter
00066 {
00067 public:
00068 static vtkThreshold *New();
00069 vtkTypeRevisionMacro(vtkThreshold,vtkDataSetToUnstructuredGridFilter);
00070 void PrintSelf(ostream& os, vtkIndent indent);
00071
00074 void ThresholdByLower(float lower);
00075
00078 void ThresholdByUpper(float upper);
00079
00082 void ThresholdBetween(float lower, float upper);
00083
00085
00086 vtkGetMacro(UpperThreshold,float);
00087 vtkGetMacro(LowerThreshold,float);
00089
00091
00097 vtkSetMacro(AttributeMode,int);
00098 vtkGetMacro(AttributeMode,int);
00099 void SetAttributeModeToDefault()
00100 {this->SetAttributeMode(VTK_ATTRIBUTE_MODE_DEFAULT);};
00101 void SetAttributeModeToUsePointData()
00102 {this->SetAttributeMode(VTK_ATTRIBUTE_MODE_USE_POINT_DATA);};
00103 void SetAttributeModeToUseCellData()
00104 {this->SetAttributeMode(VTK_ATTRIBUTE_MODE_USE_CELL_DATA);};
00105 const char *GetAttributeModeAsString();
00107
00109
00113 vtkSetMacro(AllScalars,int);
00114 vtkGetMacro(AllScalars,int);
00115 vtkBooleanMacro(AllScalars,int);
00117
00118 protected:
00119 vtkThreshold();
00120 ~vtkThreshold();
00121
00122
00123
00124
00125 friend class vtkCutMaterial;
00126
00128
00131 vtkGetStringMacro(InputScalarsSelection);
00132 virtual void SelectInputScalars(const char *fieldName)
00133 {this->SetInputScalarsSelection(fieldName);}
00135
00136
00137
00138 void Execute();
00139
00140 int AllScalars;
00141 float LowerThreshold;
00142 float UpperThreshold;
00143 int AttributeMode;
00144
00145
00146 int (vtkThreshold::*ThresholdFunction)(float s);
00147
00148
00149 int Lower(float s) {return ( s <= this->LowerThreshold ? 1 : 0 );};
00150 int Upper(float s) {return ( s >= this->UpperThreshold ? 1 : 0 );};
00151 int Between(float s) {return ( s >= this->LowerThreshold ?
00152 ( s <= this->UpperThreshold ? 1 : 0 ) : 0 );};
00153
00154 char *InputScalarsSelection;
00155 vtkSetStringMacro(InputScalarsSelection);
00156
00157 private:
00158 vtkThreshold(const vtkThreshold&);
00159 void operator=(const vtkThreshold&);
00160 };
00161
00162 #endif