Salome HOME
51a3d62c6f82623b6a27f41a3a76f7d08e152ba6
[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   virtual void     projectFields();
69   virtual void     readMapping();
70   virtual int      getNodeNumber(int);
71   virtual int      getNeighbourVertex(int) throw(SALOME_Exception) ;
72
73 protected slots:
74   virtual void     gradSelected();
75   virtual void     enterSHisto();
76   virtual void     updateHisto();
77   virtual void     scaleSelected();
78   virtual void     nbThreshSelected();
79   virtual void     areaSelected();
80   virtual void     enterFThresh();
81   virtual void     enterSThresh();
82   virtual void     moveThresh(const QMouseEvent &e);
83   virtual void     getOutFileName();
84   virtual void     process() throw(SALOME_Exception);
85   virtual void     ClickOnCancel();
86   virtual void     ClickOnHelp();
87
88 private:
89   int _size;
90   long _myHistoCurve, _myHistoFThresh, _myHistoSThresh;
91   double _xmin, _xmax, _ymin, _ymax;
92   double _fthresh, _sthresh;
93   double *_x, *_y;
94   double _xft[100], _yft[100], _xst[100], _yst[100];
95   int _nbvmap;
96   int *_map;
97   int _connL;
98   const int *_conn;
99   const int *_connI;
100
101   QLineEdit *_myLESH, *_myFThresh, *_myExpr, *_myLEST, *_myLEFT, *_myOFN;
102   QButtonGroup *_myHSize, *_myFunc, *_myFScale, *_myNbThresh, *_myArea, *_myVThresh, *_myOutFile;
103   QGridLayout *_myGroupLayout, *_myGroupLayout2, *_lay, *_GroupButtonsLayout;
104   QRadioButton *_myFieldB, *_myGradB, *_myInt, *_myExt, *_myOneThresh, *_myTwoThresh, *_myLinear, *_myLog;
105   QPushButton *_myHisto, *_myOFB, *_myProc, * _buttonCancel, * _buttonHelp;
106   QGroupBox* _GroupC1, *_GroupC2, *_GroupButtons;
107   QwtPlot *_myPlot;
108   QLabel *_myLSH, *_myLFT, *_myLST, *_myLRR;
109   QwtDiMap _qmap;
110   QFrame *_fr;
111   QString _inputFile, _inputMesh, _inputField;
112   int _inputTS;
113   SelectField *_sel;
114   ::MEDMEM::MED *_med, *_newMed;
115   MESH* _mesh, *_newMesh;
116   FIELD<double> * _myGradient;
117   FIELD<double> * _myDField;
118   FIELD<int> * _myIField;
119   FIELD<int> *_criteria;
120 };
121
122 #endif