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