Salome HOME
2be7d261f87545efb0c7d35a20af569b4bfebb97
[modules/geom.git] / src / OperationGUI / OperationGUI.cxx
1 // Copyright (C) 2007-2023  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  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, or (at your option) any later version.
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   : OperationGUI.cxx
23 //  Author : Damien COQUERET, Open CASCADE S.A.S.
24
25 #include "OperationGUI.h"
26
27 #include <GeometryGUI.h>
28 #include "GeometryGUI_Operations.h"
29
30 #include <SUIT_Desktop.h>
31 #include <SalomeApp_Application.h>
32
33 #include "OperationGUI_PartitionDlg.h"   // Method PARTITION
34 #include "OperationGUI_ArchimedeDlg.h"   // Method ARCHIMEDE
35 #include "OperationGUI_FilletDlg.h"      // Method FILLET
36 #include "OperationGUI_Fillet1d2dDlg.h"  // Method FILLET 2D and FILLET 1D
37 #include "OperationGUI_ChamferDlg.h"     // Method CHAMFER
38 #include "OperationGUI_GetShapesOnShapeDlg.h"
39 #include "OperationGUI_GetSharedShapesDlg.h"
40 #include "OperationGUI_ExtrudedFeatureDlg.h" // Methods EXTRUDED BOSS / CUT
41 #include "OperationGUI_TransferDataDlg.h"
42 #include "OperationGUI_ExtractionDlg.h"
43
44 //=======================================================================
45 // function : OperationGUI()
46 // purpose  : Constructor
47 //=======================================================================
48 OperationGUI::OperationGUI( GeometryGUI* parent ) :
49   GEOMGUI( parent )
50 {
51 }
52
53 //=======================================================================
54 // function : ~OperationGUI()
55 // purpose  : Destructor
56 //=======================================================================
57 OperationGUI::~OperationGUI()
58 {
59 }
60
61
62 //=======================================================================
63 // function : OnGUIEvent()
64 // purpose  : 
65 //=======================================================================
66 bool OperationGUI::OnGUIEvent (int theCommandID, SUIT_Desktop* parent)
67 {
68   SalomeApp_Application* app = getGeometryGUI()->getApp();
69   if (!app) return false;
70
71   getGeometryGUI()->EmitSignalDeactivateDialog();
72
73   switch (theCommandID) {
74   case GEOMOp::OpPartition:     (new OperationGUI_PartitionDlg       (getGeometryGUI(), parent))->show(); break;
75   case GEOMOp::OpArchimede:     (new OperationGUI_ArchimedeDlg       (getGeometryGUI(), parent))->show(); break;
76   case GEOMOp::OpFillet3d:      (new OperationGUI_FilletDlg          (getGeometryGUI(), parent))->show(); break;
77   case GEOMOp::OpChamfer:       (new OperationGUI_ChamferDlg         (getGeometryGUI(), parent))->show(); break;
78   case GEOMOp::OpShapesOnShape: (new OperationGUI_GetShapesOnShapeDlg(getGeometryGUI(), parent))->show(); break;
79   case GEOMOp::OpSharedShapes:  (new OperationGUI_GetSharedShapesDlg (getGeometryGUI(), parent))->show(); break;
80   case GEOMOp::OpExtrudedBoss:  (new OperationGUI_ExtrudedFeatureDlg (BOSS, getGeometryGUI(), parent))->show(); break;
81   case GEOMOp::OpExtrudedCut:   (new OperationGUI_ExtrudedFeatureDlg (CUT, getGeometryGUI(), parent))->show(); break;
82   case GEOMOp::OpFillet1d:      (new OperationGUI_Fillet1d2dDlg      (getGeometryGUI(), parent, true))->show(); break;
83   case GEOMOp::OpFillet2d:      (new OperationGUI_Fillet1d2dDlg      (getGeometryGUI(), parent, false))->show(); break;
84   case GEOMOp::OpTransferData:  (new OperationGUI_TransferDataDlg    (getGeometryGUI(), parent))->show(); break;
85   case GEOMOp::OpExtraction:    (new OperationGUI_ExtractionDlg      (getGeometryGUI(), parent))->show(); break;
86   default:
87     app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
88   }
89
90   return true;
91 }
92
93 //=====================================================================================
94 // EXPORTED METHODS
95 //=====================================================================================
96 extern "C"
97 {
98 #ifdef WIN32
99   __declspec( dllexport )
100 #endif
101   GEOMGUI* GetLibGUI( GeometryGUI* parent )
102   {
103     return new OperationGUI( parent );
104   }
105 }