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