]> SALOME platform Git repositories - modules/geom.git/blob - src/GEOMGUI/GeometryGUI_FilletDlg.h
Salome HOME
NRI : Merge from V1_2.
[modules/geom.git] / src / GEOMGUI / GeometryGUI_FilletDlg.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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : GeometryGUI_FilletDlg.h
25 //  Author : Damien COQUERET
26 //  Module : GEOM
27 //  $Header$
28
29 #ifndef DIALOGBOX_FILLET_H
30 #define DIALOGBOX_FILLET_H
31
32 #include "SALOME_Selection.h"
33 #include "GEOM_ShapeTypeFilter.hxx"
34 #include "GeometryGUI_SpinBox.h"
35
36 // Qt Includes
37 #include <qvariant.h>
38 #include <qdialog.h>
39 #include <qvalidator.h>
40
41 // Open CASCADE Includes
42 #include <AIS_InteractiveContext.hxx>
43
44 class QVBoxLayout; 
45 class QHBoxLayout; 
46 class QGridLayout; 
47 class QButtonGroup;
48 class QFrame;
49 class QGroupBox;
50 class QLineEdit;
51 class QPushButton;
52 class QRadioButton;
53 class QToolButton;
54 class QLabel;
55 class GeometryGUI;
56
57 //=================================================================================
58 // class    : GeometryGUI_FilletDlg
59 // purpose  :
60 //=================================================================================
61 class GeometryGUI_FilletDlg : public QDialog
62
63     Q_OBJECT
64
65 public:
66     GeometryGUI_FilletDlg( QWidget* parent = 0,
67                       const char* name = 0,
68                       SALOME_Selection* Sel = 0,
69                       Handle (AIS_InteractiveContext) ic = 0,
70                       bool modal = FALSE,
71                       WFlags fl = 0 );
72     
73     ~GeometryGUI_FilletDlg();
74
75 private :
76  
77     void Init( SALOME_Selection* Sel, Handle (AIS_InteractiveContext) ic  ) ;
78     void closeEvent( QCloseEvent* e ) ;
79     void enterEvent( QEvent* e);
80     void ResetStateOfDialog() ;
81
82     /* Interactive and local context management see also : bool myUseLocalContext() */
83     Handle (AIS_InteractiveContext) myIC ;                 /* Interactive context */ 
84     Standard_Integer                myLocalContextId ;     /* identify a local context used by this method */
85     bool                            myUseLocalContext ;    /* true when this method as opened a local context  */
86
87     QDoubleValidator      *myVa ;                  /* Double validator for numeric input */
88
89     GEOM::GEOM_Gen_var myGeom ;                       /* Current Geom object */
90     GeometryGUI*          myGeomGUI ;                    /* Current GeomGUI object */
91     SALOME_Selection*     mySelection ;                  /* User shape selection */    
92
93     TopoDS_Shape          mySimulationTopoDs ;    /* Shape used for simulation display */
94     void MakePreview();
95
96     TopoDS_Shape          myShape ;
97     bool                  myOkShape ;
98     char*                 myShapeIOR ;
99   
100     QLineEdit*            myEditCurrentArgument;         /* Current LineEdit */   
101     int                   myConstructorId ;              /* Current constructor id = radio button id */
102     int                   myShapeType ;
103
104     bool                  myOkRadius ;
105     double                myRadius ;
106     
107     QButtonGroup* GroupConstructors;
108
109     QRadioButton* Constructor1;
110     QRadioButton* Constructor2;
111     QRadioButton* Constructor3;
112
113     QGroupBox* GroupButtons;
114     QPushButton* buttonOk;
115     QPushButton* buttonCancel;
116     QPushButton* buttonApply;
117
118     QGroupBox* GroupC1;
119     QPushButton* SelectButtonC1A1;   
120     QLineEdit* LineEditC1A1;
121     QLabel* TextLabelC1A1;
122     GeometryGUI_SpinBox* SpinBox_C1A2 ;
123     QLabel* TextLabelC1A2; 
124
125     QGroupBox* GroupC2;
126     QPushButton* SelectButtonC2A1;   
127     QLineEdit* LineEditC2A1;
128     QLabel* TextLabelC2A1;
129     GeometryGUI_SpinBox* SpinBox_C2A2 ;
130     QLabel* TextLabelC2A2; 
131     
132     QGroupBox* GroupC3;
133     QPushButton* SelectButtonC3A1;   
134     QLineEdit* LineEditC3A1;
135     QLabel* TextLabelC3A1;
136     GeometryGUI_SpinBox* SpinBox_C3A2 ;
137     QLabel* TextLabelC3A2; 
138
139 private slots:
140
141     void ConstructorsClicked(int constructorId);
142     void ClickOnOk();
143     void ClickOnCancel();
144     void ClickOnApply();
145     void SetEditCurrentArgument() ;
146     void SelectionIntoArgument() ;
147     void DeactivateActiveDialog() ;
148     void LineEditReturnPressed() ;
149     void ActivateThisDialog() ;
150     void ValueChangedInSpinBox( double newValue ) ;
151
152 protected:
153
154     QGridLayout* GeometryGUI_FilletDlgLayout;
155     QGridLayout* GroupButtonsLayout;
156     QGridLayout* GroupConstructorsLayout;
157     QGridLayout* GroupC1Layout;
158     QGridLayout* GroupC2Layout;
159     QGridLayout* GroupC3Layout;
160 };
161
162 #endif // DIALOGBOX_FILLET_H
163