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