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