Salome HOME
Join modifications from branch OCC_debug_for_3_2_0b1
[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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
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 "BuildGUI_EdgeDlg.h"       // Method EDGE
35 #include "BuildGUI_WireDlg.h"       // Method WIRE
36 #include "BuildGUI_FaceDlg.h"       // Method FACE
37 #include "BuildGUI_ShellDlg.h"      // Method SHELL
38 #include "BuildGUI_SolidDlg.h"      // Method SOLID
39 #include "BuildGUI_CompoundDlg.h"   // Method COMPOUND
40
41 #include "GeometryGUI.h"
42
43 BuildGUI* BuildGUI::myGUIObject = 0;
44
45 //=======================================================================
46 // function : GetBuildGUI()
47 // purpose  : Get the only BuildGUI object [ static ]
48 //=======================================================================
49 BuildGUI* BuildGUI::GetBuildGUI( GeometryGUI* parent )
50 {
51   if ( myGUIObject == 0 ) 
52     myGUIObject = new BuildGUI( parent );
53
54   return myGUIObject;
55 }
56
57 //=======================================================================
58 // function : BuildGUI()
59 // purpose  : Constructor
60 //=======================================================================
61 BuildGUI::BuildGUI( GeometryGUI* parent )
62 : GEOMGUI( parent )
63 {
64 }
65
66
67 //=======================================================================
68 // function : ~BuildGUI()
69 // purpose  : Destructor
70 //=======================================================================
71 BuildGUI::~BuildGUI()
72 {
73 }
74
75
76 //=======================================================================
77 // function : OnGUIEvent()
78 // purpose  : 
79 //=======================================================================
80 bool BuildGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
81 {
82   getGeometryGUI()->EmitSignalDeactivateDialog();
83   
84   QDialog* aDlg = NULL;
85
86   switch ( theCommandID )
87   {
88     case 4081: aDlg = new BuildGUI_EdgeDlg    ( getGeometryGUI(), parent, "" ); break;
89     case 4082: aDlg = new BuildGUI_WireDlg    ( getGeometryGUI(), parent, "" ); break;
90     case 4083: aDlg = new BuildGUI_FaceDlg    ( getGeometryGUI(), parent, "" ); break;
91     case 4084: aDlg = new BuildGUI_ShellDlg   ( getGeometryGUI(), parent, "" ); break;
92     case 4085: aDlg = new BuildGUI_SolidDlg   ( getGeometryGUI(), parent, "" ); break;
93     case 4086: aDlg = new BuildGUI_CompoundDlg( getGeometryGUI(), parent, "" ); break;
94     
95     default: 
96       SUIT_Session::session()->activeApplication()->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) ); 
97       break;
98   }
99   
100   if ( aDlg != NULL )
101     aDlg->show();
102   
103   return true;
104 }
105
106 //=====================================================================================
107 // EXPORTED METHODS
108 //=====================================================================================
109 extern "C"
110 {
111 #ifdef WNT
112         __declspec( dllexport )
113 #endif
114   GEOMGUI* GetLibGUI( GeometryGUI* parent )
115   {
116     return BuildGUI::GetBuildGUI( parent );
117   }
118 }