Salome HOME
NRI : Rename resources and library.
[modules/geom.git] / src / GEOMGUI / GeometryGUI_OrientationDlg.h
1 //  File      : GeometryGUI_OrientationDlg.h
2 //  Created   :
3 //  Author    : Lucien PIGNOLONI
4 //  Project   : SALOME
5 //  Module    : GeometryGUI
6 //  Copyright : OPEN CASCADE
7 //  $Header$
8
9 #ifndef DIALOGBOX_ORIENTATION_H
10 #define DIALOGBOX_ORIENTATION_H
11
12 #include "SALOME_Selection.h"
13 #include "GEOM_ShapeTypeFilter.hxx"
14 #include "GeometryGUI_SpinBox.h"
15
16 #include <Precision.hxx>
17
18 #include <qvariant.h>
19 #include <qdialog.h>
20 #include <qvalidator.h>
21
22 class QVBoxLayout; 
23 class QHBoxLayout; 
24 class QGridLayout; 
25 class QButtonGroup;
26 class QCheckBox;
27 class QGroupBox;
28 class QLabel;
29 class QLineEdit;
30 class QPushButton;
31 class QRadioButton;
32 class GeometryGUI;
33
34
35 //=================================================================================
36 // class    : DialogBox_ORIENTATION
37 // purpose  :
38 //=================================================================================
39 class GeometryGUI_OrientationDlg : public QDialog
40
41     Q_OBJECT
42
43 public:
44     GeometryGUI_OrientationDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
45     ~GeometryGUI_OrientationDlg();
46
47 private :
48     
49     GEOM::GEOM_Gen_var            myGeom ;                 /* Current Geom object */
50     GeometryGUI*                     myGeomGUI ;              /* Current GeomGUI object */
51     TopoDS_Shape                     mySimulationTopoDs ;     /* Shape used for simulation display */
52     SALOME_Selection*                mySelection ;            /* User shape selection */
53     GEOM::GEOM_Shape_var                   myGeomShape ;            /* is myShape */
54     TopoDS_Shape                     myShape ;                /* topology used */
55     Standard_Real                    myLength ;               /* to simulate normal vector */
56     bool                             myOkShape ;
57     bool                             myOkLength ;
58     QDoubleValidator                 *myVa ;                  /* Double validator for numeric input */
59     QLineEdit*                       myEditCurrentArgument;   /* Current LineEdit */
60     int                              myConstructorId ;        /* Current constructor id = radio button id */
61
62     void closeEvent( QCloseEvent* e ) ;
63     void enterEvent( QEvent* e);
64     void Init( SALOME_Selection* Sel ) ;
65     void MakeOrientationSimulationAndDisplay( const TopoDS_Shape& aTopoDS, Standard_Real length ) ;
66
67     QButtonGroup* GroupConstructors;
68     QRadioButton* Constructor1;
69     QGroupBox* GroupButtons;
70     QPushButton* buttonOk;
71     QPushButton* buttonCancel;
72     QPushButton* buttonApply;
73     QGroupBox* GroupC1;
74     QLineEdit* LineEditC1A1;
75     GeometryGUI_SpinBox*  SpinBox_C1A2 ;
76
77     QPushButton* SelectButtonC1A1;
78     QLabel* TextLabelC1A1;
79     QLabel* TextLabelC1A2;
80     QCheckBox* CheckBoxReverse;
81
82 private slots:
83
84     void ConstructorsClicked(int constructorId);
85     void ClickOnOk();
86     void ClickOnCancel();
87     void ClickOnApply();
88     void SetEditCurrentArgument() ;
89     void SelectionIntoArgument() ;
90     void LineEditReturnPressed() ;
91     void DeactivateActiveDialog() ;
92     void ActivateThisDialog() ;
93     void ReverseOrientation(int state) ;
94     void ValueChangedInSpinBox( double newValue ) ;
95
96 protected:
97
98     QGridLayout* GeometryGUI_OrientationDlgLayout;
99     QGridLayout* GroupConstructorsLayout;
100     QGridLayout* GroupButtonsLayout;
101     QGridLayout* GroupC1Layout;
102 };
103
104 #endif // DIALOGBOX_ORIENTATION_H