Salome HOME
Fix compilation error (conflict of OK name between OCCT Plate_Plate.hxx and GEOM...
[modules/geom.git] / ImportExportGUI / ImportExportGUI.cxx
1 // Copyright (C) 2013  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18
19 #include <iostream>
20 #include <QDialog>
21
22 #include "GeometryGUI.h"
23 #include "GeometryGUI_Operations.h"
24
25 #include <GEOMBase.h>
26 #include <SUIT_Desktop.h>
27 #include <SUIT_Desktop.h>
28 #include <SUIT_MessageBox.h>
29 #include <SalomeApp_Application.h>
30
31 #include "ImportExportGUI_ExportXAODlg.h"
32 #include "ImportExportGUI_ImportXAODlg.h"
33 #include "ImportExportGUI.h"
34 //@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@//
35
36
37 //=======================================================================
38 // function : ImportExportGUI()
39 // purpose  : Constructor
40 //=======================================================================
41 ImportExportGUI::ImportExportGUI(GeometryGUI* parent) :
42         GEOMGUI(parent)
43 {
44 }
45
46 //=======================================================================
47 // function : ~ImportExportGUI
48 // purpose  : Destructor
49 //=======================================================================
50 ImportExportGUI::~ImportExportGUI()
51 {
52 }
53
54 //=======================================================================
55 // function : OnGUIEvent()
56 // purpose  : 
57 //=======================================================================
58 bool ImportExportGUI::OnGUIEvent(int commandId, SUIT_Desktop* parent)
59 {
60     SalomeApp_Application* app = getGeometryGUI()->getApp();
61     if (!app) return false;
62
63     getGeometryGUI()->EmitSignalDeactivateDialog();
64
65     QDialog* dialog = NULL;
66     switch (commandId)
67     {
68         case GEOMOp::OpExportXAO:
69             dialog = new ImportExportGUI_ExportXAODlg(getGeometryGUI(), parent);
70             break;
71         case GEOMOp::OpImportXAO:
72             dialog = new ImportExportGUI_ImportXAODlg(getGeometryGUI(), parent);
73             break;
74             //@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@//
75         default:
76             app->putInfo(tr("GEOM_PRP_COMMAND").arg(commandId));
77             break;
78     }
79
80     if (dialog != NULL)
81         dialog->show();
82
83     return true;
84 }
85
86 //=====================================================================================
87 // EXPORTED METHODS
88 //=====================================================================================
89 extern "C"
90 {
91 #ifdef WIN32
92     __declspec( dllexport )
93 #endif
94     GEOMGUI* GetLibGUI(GeometryGUI* parent)
95     {
96         return new ImportExportGUI(parent);
97     }
98 }