Salome HOME
4544ee70526bfc90c8a29ef7f8ff653c61b647ab
[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_Export.hxx"
25
26 #include "HEXABLOCKGUI_OccGraphicView.hxx"
27 #include "HEXABLOCKGUI.hxx"
28 #include "HEXABLOCKGUI_DocumentPanel.hxx"
29
30 #include <QDialog>
31
32 class SalomeApp_DoubleSpinBox;
33 class MyDlgRef_Skeleton;
34 class QSpinBox;
35 class QDoubleSpinBox;
36 class QLineEdit;
37 class QButtonGroup;
38 class QPushButton;
39
40 #ifndef COORD_MIN
41 #  define COORD_MIN -1e+12
42 #  define COORD_MAX +1e+12
43 #  define MAX_NUMBER 100000
44 #  define DBL_DIGITS_DISPLAY 13
45 #endif // COORD_MIN
46
47 #include "hexa_base.hxx"
48
49 namespace HEXABLOCK
50 {
51 namespace GUI
52 {
53
54 class HEXABLOCK_EXPORT MyGEOMBase_Skeleton : public HexaBaseDialog
55 {
56         Q_OBJECT
57
58 public:
59         MyGEOMBase_Skeleton( QWidget* = 0, Qt::WindowFlags = 0 );
60         ~MyGEOMBase_Skeleton();
61
62 private:
63         void Init();
64
65 protected:
66         virtual bool        apply(QModelIndex& result) = 0;
67         virtual void       _initInputWidget( Mode editmode ) = 0;
68         void                initSpinBox( QSpinBox*, int, int, int = 1 );
69         void                initSpinBox( SalomeApp_DoubleSpinBox*, double, double, double = 0.01,
70                                     const char* = "length_precision", unsigned int decimals = 6 );
71
72         void                closeEvent( QCloseEvent* );
73
74         /*! returns id of a selected "constructor" radio button or '-1' in case of error
75          */
76         int                 getConstructorId() const;
77         /*! set selected "constructor" radio button id
78          */
79         void                setConstructorId( const int );
80         /*! unset selection on all "constructor" radio buttons
81          */
82         void                unsetConstructorId();
83
84         void                showOnlyPreviewControl();
85
86         MyDlgRef_Skeleton*  mainFrame();
87         QWidget*            centralWidget();
88
89 protected:
90         QLineEdit*          myEditCurrentArgument; //!< Current LineEdit
91
92         QButtonGroup*       myRBGroup;             //!< radio button group
93         MyDlgRef_Skeleton*  myMainFrame;           //!< dialog box's mainframe widgetx
94
95 signals:
96 void                constructorsClicked( int );
97 };
98
99 }
100 }
101
102 #endif // MYGEOMBASE_SKELETON_H