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