Salome HOME
NRI : Replace Geometry by GEOM.
[modules/geom.git] / src / GEOMGUI / GeometryGUI_MultiTranslationDlg.h
1 //  File      : GeometryGUI_MultiTranslationDlg.h
2 //  Created   :
3 //  Author    : Damien COQUERET
4 //  Project   : SALOME
5 //  Module    : GeometryGUI
6 //  Copyright : OPEN CASCADE
7 //  $Header$
8
9 #ifndef DIALOGBOX_MULTITRANSLATION_H
10 #define DIALOGBOX_MULTITRANSLATION_H
11
12 #include "SALOME_Selection.h"
13 #include "GEOM_ShapeTypeFilter.hxx"
14 #include "GEOM_EdgeFilter.hxx"
15 #include "GeometryGUI_SpinBox.h"
16
17 #include <gp_Vec.hxx>
18 #include <gp_Dir.hxx>
19
20 #include <qvariant.h>
21 #include <qdialog.h>
22
23 class QVBoxLayout; 
24 class QHBoxLayout; 
25 class QGridLayout; 
26 class QButtonGroup;
27 class QCheckBox;
28 class QGroupBox;
29 class QLabel;
30 class QSpinBox;
31 class QLineEdit;
32 class QPushButton;
33 class QSpinBox;
34 class QRadioButton;
35 class GeometryGUI;
36
37 //=================================================================================
38 // class    : GeometryGUI_MultiTranslationDlg
39 // purpose  :
40 //=================================================================================
41 class GeometryGUI_MultiTranslationDlg : public QDialog
42
43     Q_OBJECT
44
45 public:
46     GeometryGUI_MultiTranslationDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
47     ~GeometryGUI_MultiTranslationDlg();
48
49 private :
50     
51     GEOM::GEOM_Gen_var        myGeom ;                /* Current Geom object */   
52     GeometryGUI*                 myGeomGUI ;             /* Current GeomGUI object */ 
53     TopoDS_Shape                 mySimulationTopoDs ;    /* Shape used for simulation display */
54     SALOME_Selection*            mySelection ;           /* User shape selection */
55     TopoDS_Shape                 myBase ;
56     GEOM::GEOM_Shape_var               myGeomShape ;           /* is myBase */
57
58     gp_Vec                       myVec ;
59     int                          myNbTimes1 ;
60     int                          myNbTimes2 ;
61     Standard_Real                myStep1 ;
62     Standard_Real                myStep2 ;
63     gp_Dir                       myDir1 ;
64     gp_Dir                       myDir2 ;
65    
66     bool                         myOkBase ; 
67     bool                         myOkDir1 ;
68     bool                         myOkDir2 ;
69
70     QLineEdit*                   myEditCurrentArgument;  /* Current LineEdit */   
71     int                          myConstructorId ;       /* Current constructor id = radio button id */ 
72     Handle(GEOM_EdgeFilter)      myEdgeFilter;           /* Filter selection */
73
74     void closeEvent( QCloseEvent* e ) ;
75     void enterEvent( QEvent* e);
76     void Init( SALOME_Selection* Sel ) ;
77     void MakeMultiTranslationSimulationAndDisplay() ;
78
79     QButtonGroup* GroupConstructors;
80     QRadioButton* Constructor1;
81     QRadioButton* Constructor2;
82
83     QGroupBox* GroupButtons;
84     QPushButton* buttonOk;
85     QPushButton* buttonCancel;
86     QPushButton* buttonApply;
87
88     QGroupBox* GroupC1;
89     QPushButton* SelectButtonC1A2;
90     QLineEdit* LineEditC1A1;
91     QLineEdit* LineEditC1A2;
92     QPushButton* SelectButtonC1A1;
93     QLabel* TextLabelC1A1;
94     QLabel* TextLabelC1A2;
95     
96     QLabel* TextLabelC1A3;
97     QLabel* TextLabelC1A4;
98     GeometryGUI_SpinBox* SpinBox_C1A3 ;
99     QSpinBox* SpinBox_C1A4 ;
100
101     QGroupBox* GroupC2;
102     QPushButton* SelectButtonC2A2;
103     QLineEdit* LineEditC2A1;
104     QLineEdit* LineEditC2A2;
105     QPushButton* SelectButtonC2A1;
106     QLineEdit* LineEditC2A3;
107     QPushButton* SelectButtonC2A3;
108     QLabel* TextLabelC2A1;
109     QLabel* TextLabelC2A2;
110     QLabel* TextLabelC2A3;
111     
112     QLabel* TextLabelC2A4;
113     QLabel* TextLabelC2A5;
114     QLabel* TextLabelC2A6;
115     QLabel* TextLabelC2A7;
116     GeometryGUI_SpinBox* SpinBox_C2A4 ;
117     QSpinBox* SpinBox_C2A5;
118     GeometryGUI_SpinBox* SpinBox_C2A6 ;
119     QSpinBox* SpinBox_C2A7 ;
120
121     QCheckBox* CheckBoxReverse0;
122     QCheckBox* CheckBoxReverse1;
123     QCheckBox* CheckBoxReverse2;
124
125 private slots:
126
127     void ConstructorsClicked(int constructorId);
128     void ClickOnOk();
129     void ClickOnCancel();
130     void ClickOnApply();
131     void SetEditCurrentArgument() ;
132     void SelectionIntoArgument() ;
133     void DeactivateActiveDialog() ;
134     void ActivateThisDialog() ;
135     void LineEditReturnPressed() ;
136     void ReverseAngle1(int) ;
137     void ReverseAngle2(int) ;
138     void ValueChangedInSpinBox( double newValue ) ; /* for GeometryGUI_SpinBox       */
139     void ValueChangedInt( int newIntValue ) ;       /* for QT spin box ! not const ! */
140
141 protected:
142     QGridLayout* GeometryGUI_MultiTranslationDlgLayout;
143     QGridLayout* GroupConstructorsLayout;
144     QGridLayout* GroupButtonsLayout;
145     QGridLayout* GroupC1Layout;
146     QGridLayout* GroupC2Layout;
147 };
148
149 #endif // DIALOGBOX_MULTITRANSLATION_H