Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages
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
00055 #ifndef __vtkThreshold_h
00056 #define __vtkThreshold_h
00057
00058 #include "vtkDataSetToUnstructuredGridFilter.h"
00059
00060 #define VTK_ATTRIBUTE_MODE_DEFAULT 0
00061 #define VTK_ATTRIBUTE_MODE_USE_POINT_DATA 1
00062 #define VTK_ATTRIBUTE_MODE_USE_CELL_DATA 2
00063
00064 class VTK_GRAPHICS_EXPORT vtkThreshold : public vtkDataSetToUnstructuredGridFilter
00065 {
00066 public:
00067 static vtkThreshold *New();
00068 vtkTypeRevisionMacro(vtkThreshold,vtkDataSetToUnstructuredGridFilter);
00069 void PrintSelf(ostream& os, vtkIndent indent);
00070
00073 void ThresholdByLower(float lower);
00074
00077 void ThresholdByUpper(float upper);
00078
00081 void ThresholdBetween(float lower, float upper);
00082
00084
00085 vtkGetMacro(UpperThreshold,float);
00086 vtkGetMacro(LowerThreshold,float);
00088
00090
00096 vtkSetMacro(AttributeMode,int);
00097 vtkGetMacro(AttributeMode,int);
00098 void SetAttributeModeToDefault()
00099 {this->SetAttributeMode(VTK_ATTRIBUTE_MODE_DEFAULT);};
00100 void SetAttributeModeToUsePointData()
00101 {this->SetAttributeMode(VTK_ATTRIBUTE_MODE_USE_POINT_DATA);};
00102 void SetAttributeModeToUseCellData()
00103 {this->SetAttributeMode(VTK_ATTRIBUTE_MODE_USE_CELL_DATA);};
00104 const char *GetAttributeModeAsString();
00106
00108
00112 vtkSetMacro(AllScalars,int);
00113 vtkGetMacro(AllScalars,int);
00114 vtkBooleanMacro(AllScalars,int);
00116
00117 protected:
00118 vtkThreshold();
00119 ~vtkThreshold();
00120
00121
00122
00123
00124 friend class vtkCutMaterial;
00125
00127
00130 vtkGetStringMacro(InputScalarsSelection);
00131 virtual void SelectInputScalars(const char *fieldName)
00132 {this->SetInputScalarsSelection(fieldName);}
00134
00135
00136
00137 void Execute();
00138
00139 int AllScalars;
00140 float LowerThreshold;
00141 float UpperThreshold;
00142 int AttributeMode;
00143
00144
00145 int (vtkThreshold::*ThresholdFunction)(float s);
00146
00147
00148 int Lower(float s) {return ( s <= this->LowerThreshold ? 1 : 0 );};
00149 int Upper(float s) {return ( s >= this->UpperThreshold ? 1 : 0 );};
00150 int Between(float s) {return ( s >= this->LowerThreshold ?
00151 ( s <= this->UpperThreshold ? 1 : 0 ) : 0 );};
00152
00153 char *InputScalarsSelection;
00154 vtkSetStringMacro(InputScalarsSelection);
00155
00156 private:
00157 vtkThreshold(const vtkThreshold&);
00158 void operator=(const vtkThreshold&);
00159 };
00160
00161 #endif