Salome HOME
*** empty log message ***
[modules/geom.git] / src / GEOMBase / GEOMBase_Skeleton.h
1 // GEOM GEOMGUI : GUI for Geometry component
2 //
3 // Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
6 // This library is free software; you can redistribute it and/or 
7 // modify it under the terms of the GNU Lesser General Public 
8 // License as published by the Free Software Foundation; either 
9 // version 2.1 of the License. 
10 // 
11 // This library is distributed in the hope that it will be useful, 
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
14 // Lesser General Public License for more details. 
15 // 
16 // You should have received a copy of the GNU Lesser General Public 
17 // License along with this library; if not, write to the Free Software 
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
19 // 
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 // File   : GEOMBase_Skeleton.h
23 // Author : Damine COQUERET, Open CASCADE S.A.S.
24 //
25
26 #ifndef GEOMBASE_SKELETON_H
27 #define GEOMBASE_SKELETON_H
28
29 #include "GEOM_GEOMBase.hxx"
30 #include "GEOMBase_Helper.h"
31
32 #include <QDialog>
33
34 class GeometryGUI;
35 class DlgRef_Skeleton;
36 class QDoubleSpinBox;
37 class QLineEdit;
38 class QButtonGroup;
39 class QPushButton;
40
41 #ifndef COORD_MIN
42 #  define COORD_MIN -1e+15
43 #  define COORD_MAX +1e+15
44 #  define MAX_NUMBER 100000
45 #  define DBL_DIGITS_DISPLAY 16
46 #endif // COORD_MIN
47
48 class GEOMBASE_EXPORT GEOMBase_Skeleton : public QDialog, public GEOMBase_Helper
49 {
50   Q_OBJECT
51
52 public:
53     GEOMBase_Skeleton( GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0 );
54     ~GEOMBase_Skeleton();
55
56 private:
57     void Init();
58
59 protected:
60     void                initSpinBox( QDoubleSpinBox*, double, double, double = 0.1, int = 3 );
61     
62     void                closeEvent( QCloseEvent* );
63     void                keyPressEvent( QKeyEvent* );
64
65     /*! initialize "Name" field with a string "thePrefix_X" (Vertex_3)
66      */
67     void                initName( const QString& = QString() );
68
69     /*! returns contents of "Name" field
70      */
71     virtual const char* getNewObjectName() const;
72
73     /*! returns id of a selected "constructor" radio button or '-1' in case of error
74      */
75     int                 getConstructorId() const;
76     /*! set selected "constructor" radio button id
77      */
78     void                setConstructorId( const int );
79
80     void                setHelpFileName( const QString& );
81
82     DlgRef_Skeleton*    mainFrame();
83     QWidget*            centralWidget();
84     QPushButton*        buttonCancel() const;
85     QPushButton*        buttonOk() const;
86     QPushButton*        buttonApply() const;
87     QPushButton*        buttonHelp() const;
88
89 protected:
90     QLineEdit*          myEditCurrentArgument; //!< Current LineEdit
91     GeometryGUI*        myGeomGUI;             //!< reference GEOM GUI
92     QString             myHelpFileName;        //!< Associated HTML help file name
93     
94     QButtonGroup*       myRBGroup;             //!< radio button group
95     DlgRef_Skeleton*    myMainFrame;           //!< dialog box's mainframe widgetx
96
97 protected slots:
98     virtual void        ClickOnCancel();
99     void                LineEditReturnPressed();
100     void                DeactivateActiveDialog();
101     void                ActivateThisDialog();
102     void                ClickOnHelp();
103
104 signals:
105     void                constructorsClicked( int );
106 };
107
108 #endif // GEOMBASE_SKELETON_H