]> SALOME platform Git repositories - modules/geom.git/blob - src/RepairGUI/RepairGUI.cxx
Salome HOME
Fix for PAL10496.
[modules/geom.git] / src / RepairGUI / RepairGUI.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   : RepairGUI.cxx
25 //  Author : Damien COQUERET
26 //  Module : GEOM
27 //  $Header$
28
29 #include "RepairGUI.h"
30
31 #include "SUIT_Desktop.h"
32 #include "SUIT_Session.h"
33
34 #include "SalomeApp_Application.h"
35
36 #include "RepairGUI_SewingDlg.h"        // Method SEWING
37 #include "RepairGUI_SuppressFacesDlg.h" // Method SUPPRESS FACES
38 #include "RepairGUI_RemoveHolesDlg.h"   // Method SUPPRESS HOLE
39 #include "RepairGUI_ShapeProcessDlg.h"  // Method PROCESS SHAPE
40 #include "RepairGUI_CloseContourDlg.h"  // Method CLOSE CONTOUR
41 #include "RepairGUI_RemoveIntWiresDlg.h"// Method REMOVE INTERNAL WIRES
42 #include "RepairGUI_DivideEdgeDlg.h"    // Method DEVIDE EDGE
43 #include "RepairGUI_FreeBoundDlg.h"     // Method FREE BOUNDARIES
44 #include "RepairGUI_FreeFacesDlg.h"     // Method FREE FACES
45 #include "RepairGUI_GlueDlg.h"          // Method GLUE FACES
46
47 #include "utilities.h"
48
49 using namespace std;
50
51 //=======================================================================
52 // function : RepairGUI()
53 // purpose  : Constructor
54 //=======================================================================
55 RepairGUI::RepairGUI( GeometryGUI* parent ) : GEOMGUI( parent )
56 {
57 }
58
59 //=======================================================================
60 // function : ~RepairGUI()
61 // purpose  : Destructor
62 //=======================================================================
63 RepairGUI::~RepairGUI()
64 {
65 }
66
67
68 //=======================================================================
69 // function : OnGUIEvent()
70 // purpose  : 
71 //=======================================================================
72 bool RepairGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
73 {
74   SalomeApp_Application* app = getGeometryGUI()->getApp();
75   if (!app) return false;
76
77   getGeometryGUI()->EmitSignalDeactivateDialog();
78
79   QDialog* aDlg = NULL;
80   switch (theCommandID) {
81     case 601: aDlg = new RepairGUI_SewingDlg        (getGeometryGUI(), parent, ""); break;
82     case 602: aDlg = new RepairGUI_GlueDlg          (getGeometryGUI(), parent, ""); break;
83     case 603: aDlg = new RepairGUI_SuppressFacesDlg (getGeometryGUI(), parent, ""); break;
84     case 604: aDlg = new RepairGUI_RemoveHolesDlg   (getGeometryGUI(), parent, ""); break;
85     case 605: aDlg = new RepairGUI_ShapeProcessDlg  (getGeometryGUI(), parent, ""); break;
86     case 606: aDlg = new RepairGUI_CloseContourDlg  (getGeometryGUI(), parent, ""); break;
87     case 607: aDlg = new RepairGUI_RemoveIntWiresDlg(getGeometryGUI(), parent, ""); break;
88     case 608: aDlg = new RepairGUI_DivideEdgeDlg    (getGeometryGUI(), parent, ""); break;
89     case 609: aDlg = new RepairGUI_FreeBoundDlg     (getGeometryGUI(), parent, ""); break;    
90     case 610: aDlg = new RepairGUI_FreeFacesDlg     (getGeometryGUI(), parent, ""); break;    
91     default:
92       app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
93       break;
94   }
95
96   if ( aDlg )
97     aDlg->show();
98
99   return true;
100 }
101
102
103 //=====================================================================================
104 // EXPORTED METHODS
105 //=====================================================================================
106 extern "C"
107 {
108 #ifdef WNT
109         __declspec( dllexport )
110 #endif
111   GEOMGUI* GetLibGUI( GeometryGUI* parent )
112   {
113     return new RepairGUI( parent );
114   }
115 }