]> SALOME platform Git repositories - modules/geom.git/blob - src/GEOMGUI/GeometryGUI_BoxDlg.h
Salome HOME
fd7318ec655d588c9561d1361b1998d4aa0796fe
[modules/geom.git] / src / GEOMGUI / GeometryGUI_BoxDlg.h
1 //  File      : GeometryGUI_BoxDlg.h
2 //  Created   :
3 //  Author    : Lucien PIGNOLONI
4 //  Project   : SALOME
5 //  Module    : GeometryGUI
6 //  Copyright : OPEN CASCADE
7 //  $Header$
8
9
10 #ifndef DIALOGBOX_BOX_H
11 #define DIALOGBOX_BOX_H
12
13 #include "SALOME_Selection.h"
14 #include "GEOM_ShapeTypeFilter.hxx"
15
16 #include <gp_Pnt.hxx>
17 #include <BRepPrimAPI_MakeBox.hxx>
18 #include <Precision.hxx>
19
20 #include <qvariant.h>
21 #include <qdialog.h>
22 #include <qwidget.h>
23
24 class QVBoxLayout; 
25 class QHBoxLayout; 
26 class QGridLayout; 
27 class QButtonGroup;
28 class QFrame;
29 class QGroupBox;
30 class QLineEdit;
31 class QPushButton;
32 class QRadioButton;
33 class QLabel;
34 class QPushButton;
35 class GeometryGUI_SpinBox;
36 class GeometryGUI;
37
38
39 //=================================================================================
40 // class    : GeometryGUI_BoxDlg
41 // purpose  :
42 //=================================================================================
43 class GeometryGUI_BoxDlg : public QDialog
44
45     Q_OBJECT
46
47 public:
48     GeometryGUI_BoxDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
49     ~GeometryGUI_BoxDlg();
50
51 private :
52  
53     void closeEvent( QCloseEvent* e ) ;
54     void enterEvent( QEvent* e );
55     void Init(SALOME_Selection* Sel) ;
56     bool TestBoxDimensions( gp_Pnt P1, gp_Pnt P2 ) ;
57
58     GEOM::GEOM_Gen_var myGeom ;                /* Current GeomI object */
59     GeometryGUI*          myGeomGUI ;             /* Current GeomGUI object */
60     TopoDS_Shape          mySimulationTopoDs ;    /* Shape used for simulation display */
61     SALOME_Selection*     mySelection ;           /* User shape selection */    
62     gp_Pnt                myPoint1 ;              /* Points containing the vector */    
63     gp_Pnt                myPoint2 ;
64     bool                  myOkPoint1 ;            /* true when myPoint is defined */
65     bool                  myOkPoint2 ;
66     int                   myConstructorId ;       /* Current constructor id = radio button id */ 
67     QLineEdit*            myEditCurrentArgument;  /* Current LineEdit */
68     Handle(GEOM_ShapeTypeFilter) myVertexFilter;  /* filter for selection */
69
70
71     QButtonGroup* GroupConstructors;
72     QRadioButton* Constructor1;
73     QRadioButton* Constructor2;
74
75     QGroupBox* GroupButtons;
76     QPushButton* buttonApply;
77     QPushButton* buttonOk;
78     QPushButton* buttonCancel;
79
80     QGroupBox* GroupPoints;
81     QPushButton* SelectButtonPt1;    
82     QPushButton* SelectButtonPt2;
83     QLineEdit* LineEditPt2;
84     QLineEdit* LineEditPt1;
85     QLabel* TextLabelPt1;
86     QLabel* TextLabelPt2;
87
88     QGroupBox* GroupDimensions ;    
89     QLabel* TextLabel_DX ;
90     QLabel* TextLabel_DY ;
91     QLabel* TextLabel_DZ ;
92
93     GeometryGUI_SpinBox* SpinBox_DX ;
94     GeometryGUI_SpinBox* SpinBox_DY ;
95     GeometryGUI_SpinBox* SpinBox_DZ ;
96
97 private slots:
98
99     void ConstructorsClicked(int constructorId);
100     void ClickOnOk();
101     void ClickOnCancel();
102     void ClickOnApply();
103     void SetEditCurrentArgument() ;
104     void SelectionIntoArgument() ;
105     void LineEditReturnPressed() ;
106     void DeactivateActiveDialog() ;
107     void ActivateThisDialog() ;
108     void ValueChangedInSpinBox( double newValue ) ;
109
110 protected:
111
112     QGridLayout* GeometryGUI_BoxDlgLayout;
113     QGridLayout* GroupConstructorsLayout;
114     QGridLayout* GroupButtonsLayout;
115     QGridLayout* GroupPointsLayout;
116     QGridLayout* GroupDimensionsLayout;
117
118 };
119
120 #endif // DIALOGBOX_BOX_H