Salome HOME
Porting SMESH module to Qt 4
[modules/smesh.git] / src / StdMeshersGUI / StdMeshersGUI_NbSegmentsCreator.h
1 // Copyright (C) 2003  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 // File   : StdMeshersGUI_NbSegmentsCreator.h
21 // Author : Open CASCADE S.A.S.
22 //
23
24 #ifndef STDMESHERSGUI_NBSEGMENTSCREATOR_H
25 #define STDMESHERSGUI_NBSEGMENTSCREATOR_H
26
27 // SMESH includes
28 #include "SMESH_StdMeshersGUI.hxx"
29
30 #include "StdMeshersGUI_StdHypothesisCreator.h"
31
32 // IDL includes
33 #include <SALOMEconfig.h>
34 #include CORBA_SERVER_HEADER(SMESH_Mesh)
35
36 class QtxIntSpinBox;
37 class QtxComboBox;
38 class SMESHGUI_SpinBox;
39 class StdMeshersGUI_DistrTableFrame;
40 class StdMeshersGUI_DistrPreview;
41 class QLineEdit;
42 class QButtonGroup;
43 class QGroupBox;
44 class QGridLayout;
45 class QRadioButton;
46
47 typedef struct
48 {
49   int                 myNbSeg, myDistrType, myConv;
50   double              myScale;
51   SMESH::double_array myTable;
52   QString             myName, myExpr;
53
54 } NbSegmentsHypothesisData;
55
56 class STDMESHERSGUI_EXPORT StdMeshersGUI_NbSegmentsCreator : public StdMeshersGUI_StdHypothesisCreator
57 {
58   Q_OBJECT
59
60 public:
61   StdMeshersGUI_NbSegmentsCreator();
62   virtual ~StdMeshersGUI_NbSegmentsCreator();
63
64   virtual bool checkParams() const;
65
66 protected:
67   virtual QFrame*  buildFrame();
68   virtual void     retrieveParams() const;
69   virtual QString  storeParams() const;
70
71 protected slots:
72   virtual void     onValueChanged();
73
74 private:
75   bool readParamsFromHypo( NbSegmentsHypothesisData& ) const;
76   bool readParamsFromWidgets( NbSegmentsHypothesisData& ) const;
77   bool storeParamsToHypo( const NbSegmentsHypothesisData& ) const;
78
79 private:
80   QtxIntSpinBox*   myNbSeg;
81   QtxComboBox*     myDistr;
82   SMESHGUI_SpinBox*   myScale;
83   StdMeshersGUI_DistrTableFrame*  myTable;
84   StdMeshersGUI_DistrPreview* myPreview;
85   QLineEdit       *myName, *myExpr;
86   QGroupBox*       myConvBox;
87   QButtonGroup*    myConv;
88   QLabel          *myLScale, *myLTable, *myLExpr, *myInfo;
89   QGridLayout*     myGroupLayout;
90   int              myTableRow, myPreviewRow;
91   QRadioButton*    myCutNeg;
92 };
93
94 #endif // STDMESHERSGUI_NBSEGMENTSCREATOR_H