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