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