Salome HOME
a220f99b28a5121ead81bf72fce8560490dfa3e2
[modules/geom.git] / OperationGUI.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   : OperationGUI.cxx
23 // Author : Damien COQUERET, Open CASCADE S.A.S.
24 //
25
26 #include "OperationGUI.h"
27
28 #include <GeometryGUI.h>
29
30 #include <SUIT_Session.h>
31 #include <SUIT_Desktop.h>
32 #include <SalomeApp_Application.h>
33
34 #include <TopTools_MapOfShape.hxx>
35 #include <TopExp_Explorer.hxx>
36 #include <Precision.hxx>
37
38 #include "OperationGUI_PartitionDlg.h"   // Method PARTITION
39 #include "OperationGUI_ArchimedeDlg.h"   // Method ARCHIMEDE
40 #include "OperationGUI_FilletDlg.h"      // Method FILLET
41 #include "OperationGUI_ChamferDlg.h"     // Method CHAMFER
42 #include "OperationGUI_ClippingDlg.h"    // Clipping dialog box
43 #include "OperationGUI_GetShapesOnShapeDlg.h"
44
45 //=======================================================================
46 // function : OperationGUI()
47 // purpose  : Constructor
48 //=======================================================================
49 OperationGUI::OperationGUI( GeometryGUI* parent ) :
50   GEOMGUI( parent )
51 {
52 }
53
54 //=======================================================================
55 // function : ~OperationGUI()
56 // purpose  : Destructor
57 //=======================================================================
58 OperationGUI::~OperationGUI()
59 {
60 }
61
62
63 //=======================================================================
64 // function : OnGUIEvent()
65 // purpose  : 
66 //=======================================================================
67 bool OperationGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
68 {
69   SalomeApp_Application* app = getGeometryGUI()->getApp();
70   if ( !app ) return false;
71
72   getGeometryGUI()->EmitSignalDeactivateDialog();
73
74   switch ( theCommandID ) {
75   case 503: ( new OperationGUI_PartitionDlg       ( getGeometryGUI(), parent ) )->show(); break;
76   case 504: ( new OperationGUI_ArchimedeDlg       ( getGeometryGUI(), parent ) )->show(); break;
77   case 505: ( new OperationGUI_FilletDlg          ( getGeometryGUI(), parent ) )->show(); break;
78   case 506: ( new OperationGUI_ChamferDlg         ( getGeometryGUI(), parent ) )->show(); break;
79   case 507: ( new OperationGUI_ClippingDlg        ( getGeometryGUI(), parent ) )->show(); break;
80   case 508: ( new OperationGUI_GetShapesOnShapeDlg( getGeometryGUI(), parent ) )->show(); break;
81   default:
82     app->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) );
83   }
84
85   return true;
86 }
87
88 //=====================================================================================
89 // EXPORTED METHODS
90 //=====================================================================================
91 extern "C"
92 {
93 #ifdef WNT
94   __declspec( dllexport )
95 #endif
96   GEOMGUI* GetLibGUI( GeometryGUI* parent )
97   {
98     return new OperationGUI( parent );
99   }
100 }