Salome HOME
ad021c4e081eb10079bed8daed7f4b62d75f19f9
[modules/geom.git] / src / GEOMGUI / GeometryGUI_RotationDlg.h
1 //  File      : GeometryGUI_RotationDlg.h
2 //  Created   :
3 //  Author    : Lucien PIGNOLONI
4 //  Project   : SALOME
5 //  Module    : GeometryGUI
6 //  Copyright : OPEN CASCADE
7 //  $Header$
8
9 #ifndef DIALOGBOX_ROTATION_H
10 #define DIALOGBOX_ROTATION_H
11
12
13 #include "SALOME_Selection.h"
14 #include "GEOM_ShapeTypeFilter.hxx"
15 #include "GEOM_EdgeFilter.hxx"
16 #include "GeometryGUI_SpinBox.h"
17
18 #include <TopLoc_Location.hxx>
19 #include <BRepBuilderAPI_Transform.hxx>
20 #include <gp_Pnt.hxx>
21 #include <gp_Dir.hxx>
22
23 #include <qvariant.h>
24 #include <qdialog.h>
25
26 class QVBoxLayout; 
27 class QHBoxLayout; 
28 class QGridLayout; 
29 class QButtonGroup;
30 class QCheckBox;
31 class QGroupBox;
32 class QLabel;
33 class QLineEdit;
34 class QPushButton;
35 class QRadioButton;
36 class GeometryGUI;
37
38 //=================================================================================
39 // class    : GeometryGUI_RotationDlg
40 // purpose  :
41 //=================================================================================
42 class GeometryGUI_RotationDlg : public QDialog
43
44     Q_OBJECT
45
46 public:
47     GeometryGUI_RotationDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
48     ~GeometryGUI_RotationDlg();
49
50 private :
51     
52     GEOM::GEOM_Gen_var        myGeom ;                /* Current Geom object */   
53     GeometryGUI*                 myGeomGUI ;             /* Current GeomGUI object */ 
54     SALOME_Selection*            mySelection ;           /* User shape selection */
55     TopoDS_Shape                 mySimulationTopoDs;     /* Shape used for simulation display */
56     TopoDS_Shape                 myBase ;
57     GEOM::GEOM_Shape_var               myGeomShape ;           /* is myBase */
58
59     gp_Pnt                       myLoc ;
60     gp_Dir                       myDir ;    
61     Standard_Real                myAngle ;
62    
63     bool                         myOkBase ; 
64     bool                         myOkAxis ;
65     QLineEdit*                   myEditCurrentArgument;  /* Current LineEdit */   
66     int                          myConstructorId ;       /* Current constructor id = radio button id */ 
67     Handle(GEOM_EdgeFilter)      myEdgeFilter;           /* Filter selection */
68
69     void closeEvent( QCloseEvent* e ) ;
70     void enterEvent( QEvent* e);
71     void Init( SALOME_Selection* Sel ) ;
72     void MakeRotationSimulationAndDisplay( const TopoDS_Shape& S) ;
73
74     QButtonGroup* GroupConstructors;
75     QRadioButton* Constructor1;
76     QGroupBox* GroupButtons;
77     QPushButton* buttonOk;
78     QPushButton* buttonCancel;
79     QPushButton* buttonApply;
80     QGroupBox* GroupC1;
81     QPushButton* SelectButtonC1A2;
82     QLineEdit* LineEditC1A1;
83     QLineEdit* LineEditC1A2;
84     QPushButton* SelectButtonC1A1;
85     QLabel* TextLabelC1A1;
86     QLabel* TextLabelC1A2;
87     GeometryGUI_SpinBox* SpinBox_C1A3 ; /* for angle */
88     QLabel* TextLabelC1A3;
89     QCheckBox* CheckBoxReverse;
90
91 private slots:
92
93     void ConstructorsClicked(int constructorId);
94     void ClickOnOk();
95     void ClickOnCancel();
96     void ClickOnApply();
97     void SetEditCurrentArgument() ;
98     void SelectionIntoArgument() ;
99     void LineEditReturnPressed() ;
100     void DeactivateActiveDialog() ;
101     void ActivateThisDialog() ;
102     void ReverseAngle(int state) ;
103     void ValueChangedInSpinBox( double newValue ) ;
104
105 protected:
106     QGridLayout* GeometryGUI_RotationDlgLayout;
107     QGridLayout* GroupConstructorsLayout;
108     QGridLayout* GroupButtonsLayout;
109     QGridLayout* GroupC1Layout;
110 };
111
112 #endif // DIALOGBOX_ROTATION_H