]> SALOME platform Git repositories - modules/geom.git/blob - src/ImportExportGUI/ImportExportGUI.cxx
Salome HOME
0022626: EDF 8453 GEOM: order with SubShapeAllSortedCentres
[modules/geom.git] / src / ImportExportGUI / ImportExportGUI.cxx
1 // Copyright (C) 2013-2014  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, or (at your option) any later version.
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
20 #include <iostream>
21 #include <QDialog>
22
23 #include "GeometryGUI.h"
24 #include "GeometryGUI_Operations.h"
25
26 #include <GEOMBase.h>
27 #include <SUIT_Desktop.h>
28 #include <SUIT_Desktop.h>
29 #include <SUIT_MessageBox.h>
30 #include <SalomeApp_Application.h>
31
32 #include "ImportExportGUI_ExportXAODlg.h"
33 #include "ImportExportGUI_ImportXAODlg.h"
34 #include "ImportExportGUI.h"
35 //@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@//
36
37
38 //=======================================================================
39 // function : ImportExportGUI()
40 // purpose  : Constructor
41 //=======================================================================
42 ImportExportGUI::ImportExportGUI(GeometryGUI* parent) :
43         GEOMGUI(parent)
44 {
45 }
46
47 //=======================================================================
48 // function : ~ImportExportGUI
49 // purpose  : Destructor
50 //=======================================================================
51 ImportExportGUI::~ImportExportGUI()
52 {
53 }
54
55 //=======================================================================
56 // function : OnGUIEvent()
57 // purpose  : 
58 //=======================================================================
59 bool ImportExportGUI::OnGUIEvent(int commandId, SUIT_Desktop* parent)
60 {
61     SalomeApp_Application* app = getGeometryGUI()->getApp();
62     if (!app) return false;
63
64     getGeometryGUI()->EmitSignalDeactivateDialog();
65
66     QDialog* dialog = NULL;
67     switch (commandId)
68     {
69         case GEOMOp::OpExportXAO:
70             dialog = new ImportExportGUI_ExportXAODlg(getGeometryGUI(), parent);
71             break;
72         case GEOMOp::OpImportXAO:
73             dialog = new ImportExportGUI_ImportXAODlg(getGeometryGUI(), parent);
74             break;
75             //@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@//
76         default:
77             app->putInfo(tr("GEOM_PRP_COMMAND").arg(commandId));
78             break;
79     }
80
81     if (dialog != NULL)
82         dialog->show();
83
84     return true;
85 }
86
87 //=====================================================================================
88 // EXPORTED METHODS
89 //=====================================================================================
90 extern "C"
91 {
92 #ifdef WIN32
93     __declspec( dllexport )
94 #endif
95     GEOMGUI* GetLibGUI(GeometryGUI* parent)
96     {
97         return new ImportExportGUI(parent);
98     }
99 }