00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00037 #ifndef __vtkPVBasicDSPFilterWidget_h
00038 #define __vtkPVBasicDSPFilterWidget_h
00039
00040 #include "vtkPVWidget.h"
00041
00042 class vtkKWLabel;
00043 class vtkKWFrameWithLabel;
00044 class vtkKWMenuButton;
00045 class vtkKWMenuButton;
00046 class vtkKWPushButton;
00047 class vtkKWWidget;
00048 class vtkKWEntry;
00049 class vtkKWFrame;
00050
00051 enum FILTER_WIDGET_FILTER_TYPE
00052 {
00053 FILTER_WIDGET_SMOOTHING,
00054 FILTER_WIDGET_LOW_PASS,
00055 FILTER_WIDGET_HIGH_PASS,
00056 FILTER_WIDGET_USER_DEFINED,
00057 FILTER_WIDGET_INTEGRAL,
00058 FILTER_WIDGET_DERIVATIVE
00059 };
00060
00061 class VTK_EXPORT vtkPVBasicDSPFilterWidget : public vtkPVWidget
00062 {
00063 public:
00064 static vtkPVBasicDSPFilterWidget* New();
00065 vtkTypeRevisionMacro(vtkPVBasicDSPFilterWidget, vtkPVWidget);
00066 void PrintSelf(ostream& os, vtkIndent indent);
00067
00069 void Create(vtkKWApplication *app);
00070
00071
00072 void ChangeDSPFilterMode(const char* newMode);
00073 void ChangeCutoffFreq(const char* newMode);
00074 void ChangeInputVar(const char* newMode);
00075
00076 void CreateCutoffFreqToggle(vtkPVApplication *app, vtkKWWidget *topframe);
00077 void DisableCutoffFreqToggle();
00078 void EnableCutoffFreqToggle();
00079
00080 void CreateInputVarToggle(vtkPVApplication *app, vtkKWWidget *topframe);
00081 void CreateLengthTextEntry(vtkPVApplication *app, vtkKWWidget *topframe);
00082 void CreateNumeratorWeightsTextEntry(vtkPVApplication *app, vtkKWWidget *topframe);
00083 void CreateDenominatorWeightsTextEntry(vtkPVApplication *app, vtkKWWidget *topframe);
00084 void CreateForwardNumeratorWeightsTextEntry(vtkPVApplication *app, vtkKWWidget *topframe);
00085 void CreateOutputVarTextEntry(vtkPVApplication *app, vtkKWWidget *topframe);
00086 void CreateAddThisVarButton(vtkPVApplication *app, vtkKWWidget *topframe);
00087
00088 bool UpdateTogglesWithFileInformation();
00089
00090 void getNumeratorWeightsString(char *a_string, int a_maxLength, bool a_isLowPass, const char *a_cutoff);
00091 void getDenominatorWeightsString(char *a_string, int a_maxLength, bool a_isLowPass, const char *a_cutoff);
00092
00093 char *getSmoothingNumeratorWeightsString( int a_filterLength );
00094 char *getSmoothingForwardNumeratorWeightsString( int a_filterLength );
00095 double *getSmoothingNumeratorWeights( int a_filterLength );
00096
00097 int GetFilterLength();
00098 void SetFilterLength(int len);
00099
00100 void ResizeOutputVariableList();
00101
00102 void SetOutputVariableName(int a_which);
00103
00104 void AddVarFunction();
00105 void DeleteVarFunction(int which);
00106
00107
00108 void SetWidgetsToSmoothingFilterMode();
00109 void SetWidgetsToBasicFilterMode();
00110 void SetWidgetsToUserDefinedMode();
00111 void SetWidgetsToIntegralMode();
00112 void SetWidgetsToCorrelationMode();
00113
00114 virtual void Accept()
00115 {
00116 vtkPVWidget::Accept();
00117 }
00118
00119
00121
00123 virtual void AcceptInternal(vtkClientServerID);
00124
00126
00128 virtual void ResetInternal();
00129
00131 virtual void Initialize();
00132
00135 virtual void SaveInBatchScript(ofstream *file);
00136
00138 virtual void Trace(ofstream *file);
00139
00140
00147 virtual void UpdateEnableState();
00148
00149
00150
00151
00152
00153 void AddThisFilterToSource(const char *a_inputName, const char *a_outputName,
00154 double a_cutoff, FILTER_WIDGET_FILTER_TYPE a_filterType);
00155
00156 void RemoveThisFilterFromSource(const char *a_outputName);
00157
00158
00159
00160
00161 protected:
00162
00163
00164
00165
00166
00167
00168 int m_numOutputVariables;
00169 int m_maxNumOutputVariables;
00170 char **m_outputVariableNames;
00171 char **m_inputVariableNames;
00172 FILTER_WIDGET_FILTER_TYPE *m_filterType;
00173 double *m_outputVariableCutoffs;
00174
00175
00176
00177
00178 vtkPVBasicDSPFilterWidget();
00179 ~vtkPVBasicDSPFilterWidget();
00180
00181
00182
00183
00184 vtkKWFrameWithLabel* DSPFilterFrame;
00185
00186
00187 vtkKWFrame* DSPFilterModeSubFrame;
00188 vtkKWLabel* DSPFilterModeLabel;
00189 vtkKWMenuButton* DSPFilterModeMenu;
00190
00191
00192 vtkKWFrame* CutoffFreqSubFrame;
00193 vtkKWLabel* CutoffFreqLabel;
00194 vtkKWMenuButton* CutoffFreqMenu;
00195
00196
00197 vtkKWFrame* InputVarSubFrame;
00198 vtkKWLabel* InputVarLabel;
00199 vtkKWMenuButton* InputVarMenu;
00200
00201
00202 vtkKWFrame *LengthSubFrame;
00203 vtkKWEntry *LengthEntry;
00204 vtkKWLabel *LengthLabel;
00205
00206
00207 vtkKWFrame *NumeratorWeightsSubFrame;
00208 vtkKWEntry *NumeratorWeightsEntry;
00209 vtkKWLabel *NumeratorWeightsLabel;
00210
00211
00212 vtkKWFrame *DenominatorWeightsSubFrame;
00213 vtkKWEntry *DenominatorWeightsEntry;
00214 vtkKWLabel *DenominatorWeightsLabel;
00215
00216
00217 vtkKWFrame *ForwardNumeratorWeightsSubFrame;
00218 vtkKWEntry *ForwardNumeratorWeightsEntry;
00219 vtkKWLabel *ForwardNumeratorWeightsLabel;
00220
00221
00222 vtkKWFrame *OutputVarSubFrame;
00223 vtkKWEntry *OutputVarEntry;
00224 vtkKWLabel *OutputVarLabel;
00225
00226
00227 vtkKWFrame *AddThisVarSubFrame;
00228 vtkKWPushButton *AddThisVarButton;
00229
00230
00231 vtkKWPushButton **DeleteThisVarButton;
00232 vtkKWLabel **DeleteThisVarLabel;
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245 private:
00246 vtkPVBasicDSPFilterWidget(const vtkPVBasicDSPFilterWidget&);
00247 void operator=(const vtkPVBasicDSPFilterWidget&);
00248
00249
00250
00251 bool m_gotFileInformation;
00252 };
00253
00254 #endif