Salome HOME
Updated for PAL12722.
[modules/geom.git] / src / BuildGUI / BuildGUI.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   : BooleanGUI.cxx
25 //  Author : Damien COQUERET
26 //  Module : GEOM
27 //  $Header$
28
29 #include "BuildGUI.h"
30
31 #include "SUIT_Desktop.h"
32 #include "SUIT_Session.h"
33
34 #include "SalomeApp_Application.h"
35
36 #include "BuildGUI_EdgeDlg.h"       // Method EDGE
37 #include "BuildGUI_WireDlg.h"       // Method WIRE
38 #include "BuildGUI_FaceDlg.h"       // Method FACE
39 #include "BuildGUI_ShellDlg.h"      // Method SHELL
40 #include "BuildGUI_SolidDlg.h"      // Method SOLID
41 #include "BuildGUI_CompoundDlg.h"   // Method COMPOUND
42
43 #include "GeometryGUI.h"
44
45 //=======================================================================
46 // function : BuildGUI()
47 // purpose  : Constructor
48 //=======================================================================
49 BuildGUI::BuildGUI( GeometryGUI* parent )
50 : GEOMGUI( parent )
51 {
52 }
53
54 //=======================================================================
55 // function : ~BuildGUI()
56 // purpose  : Destructor
57 //=======================================================================
58 BuildGUI::~BuildGUI()
59 {
60 }
61
62
63 //=======================================================================
64 // function : OnGUIEvent()
65 // purpose  : 
66 //=======================================================================
67 bool BuildGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
68 {
69   getGeometryGUI()->EmitSignalDeactivateDialog();
70
71   QDialog* aDlg = NULL;
72
73   switch ( theCommandID )
74   {
75     case 4081: aDlg = new BuildGUI_EdgeDlg    ( getGeometryGUI(), parent, "" ); break;
76     case 4082: aDlg = new BuildGUI_WireDlg    ( getGeometryGUI(), parent, "" ); break;
77     case 4083: aDlg = new BuildGUI_FaceDlg    ( getGeometryGUI(), parent, "" ); break;
78     case 4084: aDlg = new BuildGUI_ShellDlg   ( getGeometryGUI(), parent, "" ); break;
79     case 4085: aDlg = new BuildGUI_SolidDlg   ( getGeometryGUI(), parent, "" ); break;
80     case 4086: aDlg = new BuildGUI_CompoundDlg( getGeometryGUI(), parent, "" ); break;
81
82     default: 
83       getGeometryGUI()->getApp()->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) ); 
84       break;
85   }
86
87   if ( aDlg != NULL )
88     aDlg->show();
89
90   return true;
91 }
92
93 //=====================================================================================
94 // EXPORTED METHODS
95 //=====================================================================================
96 extern "C"
97 {
98 #ifdef WNT
99         __declspec( dllexport )
100 #endif
101   GEOMGUI* GetLibGUI( GeometryGUI* parent )
102   {
103     return new BuildGUI( parent );
104   }
105 }