Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

GUI/Client/vtkPVBasicDSPFilterWidget.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkPVBasicDSPFilterWidget.h,v $
00005   Language:  C++
00006 
00007   Copyright 2004 Sandia Corporation.
00008   Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00009   license for use of this work by or on behalf of the
00010   U.S. Government. Redistribution and use in source and binary forms, with
00011   or without modification, are permitted provided that this Notice and any
00012   statement of authorship are reproduced on all copies.
00013 
00014 =========================================================================*/
00015 /*=========================================================================
00016 
00017   Program:   ParaView
00018   Module:    $RCSfile: vtkPVBasicDSPFilterWidget.h,v $
00019 
00020   Copyright (c) Kitware, Inc.
00021   All rights reserved.
00022   See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
00023 
00024      This software is distributed WITHOUT ANY WARRANTY; without even
00025      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00026      PURPOSE.  See the above copyright notice for more information.
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   //BTX
00121 
00123   virtual void AcceptInternal(vtkClientServerID);
00124   //ETX
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   //I would have liked to use vectors, but there was an odd compiler error
00166   //It turns out that using SAF_EXECUTABLE_SRCS instead of SAF_SRCS in
00167   //the CMakeLists file would have fixed it? XXX see if I can change it? XXX
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   //the frame for all of the widgets defined here
00184   vtkKWFrameWithLabel* DSPFilterFrame;
00185 
00186   //widget to select the type of filter
00187   vtkKWFrame* DSPFilterModeSubFrame;
00188   vtkKWLabel* DSPFilterModeLabel;
00189   vtkKWMenuButton* DSPFilterModeMenu; 
00190 
00191   //widget to select the cutoff freq for basic filters
00192   vtkKWFrame* CutoffFreqSubFrame;
00193   vtkKWLabel* CutoffFreqLabel;
00194   vtkKWMenuButton* CutoffFreqMenu; 
00195 
00196   //widget to select the input variable
00197   vtkKWFrame* InputVarSubFrame;
00198   vtkKWLabel* InputVarLabel;
00199   vtkKWMenuButton* InputVarMenu; 
00200 
00201   //text entry box to specify numerator weights for user defined filter
00202   vtkKWFrame *LengthSubFrame;
00203   vtkKWEntry *LengthEntry;
00204   vtkKWLabel *LengthLabel;
00205 
00206   //text entry box to specify numerator weights for user defined filter
00207   vtkKWFrame *NumeratorWeightsSubFrame;
00208   vtkKWEntry *NumeratorWeightsEntry;
00209   vtkKWLabel *NumeratorWeightsLabel;
00210 
00211   //text entry box to specify denominator weights for user defined filter
00212   vtkKWFrame *DenominatorWeightsSubFrame;
00213   vtkKWEntry *DenominatorWeightsEntry;
00214   vtkKWLabel *DenominatorWeightsLabel;
00215 
00216   //text entry box to specify forward numerator weights for user defined filter
00217   vtkKWFrame *ForwardNumeratorWeightsSubFrame;
00218   vtkKWEntry *ForwardNumeratorWeightsEntry;
00219   vtkKWLabel *ForwardNumeratorWeightsLabel;
00220 
00221   //text entry box to specify the output variable name
00222   vtkKWFrame *OutputVarSubFrame;
00223   vtkKWEntry *OutputVarEntry;
00224   vtkKWLabel *OutputVarLabel;
00225 
00226   //button to add this var to the list to be calculated
00227   vtkKWFrame *AddThisVarSubFrame;
00228   vtkKWPushButton *AddThisVarButton;
00229 
00230   //array showing vars to be calculated with a button to delete each
00231   vtkKWPushButton **DeleteThisVarButton;
00232   vtkKWLabel **DeleteThisVarLabel;
00233 
00234 
00235 
00236 
00237 
00238 
00239 
00240 
00241 
00242 
00243 
00244 
00245 private:
00246   vtkPVBasicDSPFilterWidget(const vtkPVBasicDSPFilterWidget&); // Not implemented
00247   void operator=(const vtkPVBasicDSPFilterWidget&); // Not implemented
00248 
00249 
00250 
00251   bool m_gotFileInformation;
00252 };
00253 
00254 #endif

Generated on Tue May 30 12:31:38 2006 for ParaView by doxygen 1.3.5