]> SALOME platform Git repositories - modules/geom.git/blob - src/TransformationGUI/TransformationGUI.cxx
Salome HOME
Merge from V4_1_0_maintainance branch (from tag mergeto_BR_QT4_Dev_08Jul08)
[modules/geom.git] / src / TransformationGUI / TransformationGUI.cxx
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.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 // File   : TransformationGUI.cxx
23 // Author : Damien COQUERET, Open CASCADE S.A.S.
24 //
25
26 #include "TransformationGUI.h"
27
28 #include <GeometryGUI.h>
29
30 #include <SUIT_Desktop.h>
31 #include <SalomeApp_Application.h>
32
33 #include "TransformationGUI_MultiTranslationDlg.h"   // Method MULTI TRANSLATION
34 #include "TransformationGUI_MultiRotationDlg.h"      // Method MULTI ROTATION
35 #include "TransformationGUI_TranslationDlg.h"        // Method TRANSLATION
36 #include "TransformationGUI_RotationDlg.h"           // Method ROTATION
37 #include "TransformationGUI_MirrorDlg.h"             // Method MIRROR
38 #include "TransformationGUI_ScaleDlg.h"              // Method SCALE
39 #include "TransformationGUI_OffsetDlg.h"             // Method OFFSET
40 #include "TransformationGUI_PositionDlg.h"           // Method POSITION
41
42 //=======================================================================
43 // function : TransformationGUI()
44 // purpose  : Constructor
45 //=======================================================================
46 TransformationGUI::TransformationGUI( GeometryGUI* parent )
47   : GEOMGUI( parent )
48 {
49 }
50
51 //=======================================================================
52 // function : ~TransformationGUI()
53 // purpose  : Destructor
54 //=======================================================================
55 TransformationGUI::~TransformationGUI()
56 {
57 }
58
59
60 //=======================================================================
61 // function : OnGUIEvent()
62 // purpose  : 
63 //=======================================================================
64 bool TransformationGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
65 {
66   SalomeApp_Application* app = getGeometryGUI()->getApp();
67   if ( !app ) return false;
68
69   getGeometryGUI()->EmitSignalDeactivateDialog();
70   QDialog* aDlg = NULL;
71
72   switch ( theCommandID ) {
73   case 5021: // TRANSLATION
74     aDlg = new TransformationGUI_TranslationDlg( getGeometryGUI(), parent );
75     break;
76   case 5022: // ROTATION
77     aDlg = new TransformationGUI_RotationDlg( getGeometryGUI(), parent );
78     break;
79   case 5023: // POSITION
80     aDlg = new TransformationGUI_PositionDlg( getGeometryGUI(), parent );
81     break;
82   case 5024: // MIRROR
83     aDlg = new TransformationGUI_MirrorDlg( getGeometryGUI(), parent );
84     break;
85   case 5025: // SCALE
86     aDlg = new TransformationGUI_ScaleDlg( getGeometryGUI(), parent );
87     break;
88   case 5026: // OFFSET
89     aDlg = new TransformationGUI_OffsetDlg( getGeometryGUI(), parent );
90     break;
91   case 5027: // MULTI TRANSLATION
92     aDlg = new TransformationGUI_MultiTranslationDlg( getGeometryGUI(), parent );
93     break;
94   case 5028: // MULTI ROTATION
95     aDlg = new TransformationGUI_MultiRotationDlg( getGeometryGUI(), parent );
96     break;
97   default:
98     app->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) );
99     break;
100   }
101
102   if ( aDlg != NULL )
103     aDlg->show();
104
105   return true;
106 }
107
108
109 //=====================================================================================
110 // EXPORTED METHODS
111 //=====================================================================================
112 extern "C"
113 {
114 #ifdef WNT
115   __declspec( dllexport )
116 #endif
117   GEOMGUI* GetLibGUI( GeometryGUI* parent )
118   {
119     return new TransformationGUI( parent );
120   }
121 }