Salome HOME
d561ee6fffd6fdd8a6503123778cc310b95f295c
[modules/filter.git] / src / FILTERGUI / SelectParams.h
1 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 //
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
8 //
9 // This library is distributed in the hope that it will be useful
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 // Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20
21 #ifndef SELECTPARAMS_HEADER
22 #define SELECTPARAMS_HEADER
23
24 #include "utilities.h"
25 #include "MEDMEM_Med.hxx"
26 #include "MEDMEM_Meshing.hxx"
27
28 #include "SelectField.h"
29 #include <qwt_plot.h>
30 #include <vector>
31 #include <SalomeApp_Module.h>
32 #include <SUIT_Desktop.h>
33 #include <qdialog.h>
34
35 #include <SALOMEconfig.h>
36 /* #include CORBA_CLIENT_HEADER(MED_Gen) */
37
38 class QLineEdit;
39 class QLabel;
40 class QButtonGroup;
41 class QGridLayout;
42 class QRadioButton;
43 class QPushButton;
44 class QGroupBox;
45 class QFrame;
46
47 class SelectParams: public QDialog
48 {
49   Q_OBJECT
50
51 public:
52   SelectParams(FilterGUI*,SelectField *sel,
53                const char* name = 0,
54                bool modal = FALSE,
55                WFlags fl = 0) throw(SALOME_Exception);
56   virtual ~SelectParams();
57
58 protected:
59   virtual void     buildFrame();
60   virtual void     calcHisto();
61   virtual void     displayHisto();
62   virtual void     calcRateRed();
63   virtual void     clearSThresh();
64   virtual void     displayFThresh();
65   virtual void     displaySThresh();
66   virtual void     enableWidgets();
67   virtual void     generateCriteria() throw(SALOME_Exception);
68
69 protected slots:
70   virtual void     gradSelected();
71   virtual void     enterSHisto();
72   virtual void     updateHisto();
73   virtual void     scaleSelected();
74   virtual void     nbThreshSelected();
75   virtual void     areaSelected();
76   virtual void     enterFThresh();
77   virtual void     enterSThresh();
78   virtual void     moveThresh(const QMouseEvent &e);
79   virtual void     getOutFileName();
80   virtual void     process();
81   virtual void     ClickOnCancel();
82   virtual void     ClickOnHelp();
83
84 private:
85
86 private:
87   int _size;
88   long _myHistoCurve, _myHistoFThresh, _myHistoSThresh;
89   double _xmin, _xmax, _ymin, _ymax;
90   double _fthresh, _sthresh;
91   double *_x, *_y;
92   double _xft[100], _yft[100], _xst[100], _yst[100];
93
94   QLineEdit *_myLESH, *_myFThresh, *_myExpr, *_myLEST, *_myLEFT, *_myOFN;
95   QButtonGroup *_myHSize, *_myFunc, *_myFScale, *_myNbThresh, *_myArea, *_myVThresh, *_myOutFile;
96   QGridLayout *_myGroupLayout, *_myGroupLayout2, *_lay, *_GroupButtonsLayout;
97   QRadioButton *_myFieldB, *_myGradB, *_myInt, *_myExt, *_myOneThresh, *_myTwoThresh, *_myLinear, *_myLog;
98   QPushButton *_myHisto, *_myOFB, *_myProc, * _buttonCancel, * _buttonHelp;
99   QGroupBox* _GroupC1, *_GroupC2, *_GroupButtons;
100   QwtPlot *_myPlot;
101   QLabel *_myLSH, *_myLFT, *_myLST, *_myLRR;
102   QwtDiMap _qmap;
103   QFrame *_fr;
104   QString _inputFile, _inputMesh, _inputField;
105   int _inputTS;
106   SelectField *_sel;
107   ::MEDMEM::MED *_med;
108   MESH* _mesh;
109   FIELD<double> * _myGradient;
110   FIELD<double> * _myDField;
111   FIELD<int> * _myIField;
112   FIELD<int> *_criteria;
113 };
114
115 #endif