Salome HOME
calculate and draw histogram from MED reference field
[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
27 #include "SelectField.h"
28 #include <qwt_plot.h>
29 #include <vector>
30 #include <SalomeApp_Module.h>
31 #include <SUIT_Desktop.h>
32
33 #include <SALOMEconfig.h>
34 /* #include CORBA_CLIENT_HEADER(MED_Gen) */
35
36 class QLineEdit;
37 class QLabel;
38 class QButtonGroup;
39 class QGridLayout;
40 class QRadioButton;
41 class QPushButton;
42 class QGroupBox;
43 class QFrame;
44
45 class SelectParams: public QObject
46 {
47   Q_OBJECT
48
49 public:
50   SelectParams(SelectField *sel);
51   virtual ~SelectParams();
52
53   virtual QFrame*  buildFrame();
54
55 protected:
56   virtual void     calcHisto();
57   virtual void     displayHisto();
58   virtual void     calcRateRed();
59   virtual void     clearSThresh();
60   virtual void     displayFThresh();
61   virtual void     displaySThresh();
62   virtual void     enableWidgets();
63
64 protected slots:
65   virtual void     updateHisto();
66   virtual void     scaleSelected();
67   virtual void     nbThreshSelected();
68   virtual void     areaSelected();
69   virtual void     enterFThresh();
70   virtual void     enterSThresh();
71   virtual void     moveThresh(const QMouseEvent &e);
72   virtual void     getOutFileName();
73   virtual void     process();
74
75 private:
76
77 private:
78   int _size;
79   long _myHistoCurve, _myHistoFThresh, _myHistoSThresh;
80   double _xmin, _xmax, _ymin, _ymax;
81   double _fthresh, _sthresh;
82   double *_x, *_y;
83   double _xft[100], _yft[100], _xst[100], _yst[100];
84
85   QLineEdit *_myFThresh, *_myExpr, *_myLEST, *_myLEFT, *_myOFN;
86   QButtonGroup *_myFunc, *_myFScale, *_myNbThresh, *_myArea, *_myVThresh, *_myOutFile;
87   QGridLayout *_myGroupLayout, *_myGroupLayout2, *_lay;
88   QRadioButton *_myCutNeg, *_myInt, *_myExt, *_myOneThresh, *_myTwoThresh, *_myFieldB, *_myLinear, *_myLog;
89   QPushButton *_myHisto, *_myOFB, *_myProc;
90   QGroupBox* _GroupC1, *_GroupC2;
91   QwtPlot *_myPlot;
92   QLabel *_myLFT, *_myLST, *_myLRR;
93   QwtDiMap _qmap;
94   QFrame *_fr;
95   QString _inputFile, _inputMesh, _inputField;
96   FIELD<double> * _myDField;
97   FIELD<int> * _myIField;
98   int _inputTS;
99
100 };
101
102 #endif