Salome HOME
Source IHM nettoye
[modules/hexablock.git] / src / HEXABLOCKGUI / MyGEOMBase_Skeleton.hxx
1 // Copyright (C) 2009-2013  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef MYGEOMBASE_SKELETON_H
21 #define MYGEOMBASE_SKELETON_H
22
23
24 #include "HEXABLOCKGUI_OccGraphicView.hxx"
25 #include "HEXABLOCKGUI.hxx"
26 #include "HEXABLOCKGUI_DocumentPanel.hxx"
27
28 #include <QDialog>
29
30 class SalomeApp_DoubleSpinBox;
31 class MyDlgRef_Skeleton;
32 class QSpinBox;
33 class QDoubleSpinBox;
34 class QLineEdit;
35 class QButtonGroup;
36 class QPushButton;
37
38 #ifndef COORD_MIN
39 #  define COORD_MIN -1e+12
40 #  define COORD_MAX +1e+12
41 #  define MAX_NUMBER 100000
42 #  define DBL_DIGITS_DISPLAY 13
43 #endif // COORD_MIN
44
45 namespace HEXABLOCK
46 {
47 namespace GUI
48 {
49
50 class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT MyGEOMBase_Skeleton : public HexaBaseDialog
51 {
52         Q_OBJECT
53
54 public:
55         MyGEOMBase_Skeleton( QWidget* = 0, Qt::WindowFlags = 0 );
56         ~MyGEOMBase_Skeleton();
57
58 private:
59         void Init();
60
61 protected:
62         virtual bool        apply(QModelIndex& result) = 0;
63         virtual void       _initInputWidget( Mode editmode ) = 0;
64         void                initSpinBox( QSpinBox*, int, int, int = 1 );
65         void                initSpinBox( SalomeApp_DoubleSpinBox*, double, double, double = 0.01,
66                                     const char* = "length_precision", unsigned int decimals = 6 );
67
68         void                closeEvent( QCloseEvent* );
69
70         /*! returns id of a selected "constructor" radio button or '-1' in case of error
71          */
72         int                 getConstructorId() const;
73         /*! set selected "constructor" radio button id
74          */
75         void                setConstructorId( const int );
76         /*! unset selection on all "constructor" radio buttons
77          */
78         void                unsetConstructorId();
79
80         void                showOnlyPreviewControl();
81
82         MyDlgRef_Skeleton*  mainFrame();
83         QWidget*            centralWidget();
84
85 protected:
86         QLineEdit*          myEditCurrentArgument; //!< Current LineEdit
87
88         QButtonGroup*       myRBGroup;             //!< radio button group
89         MyDlgRef_Skeleton*  myMainFrame;           //!< dialog box's mainframe widgetx
90
91 signals:
92 void                constructorsClicked( int );
93 };
94
95 }
96 }
97
98 #endif // MYGEOMBASE_SKELETON_H