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