]> SALOME platform Git repositories - modules/geom.git/blob - src/BlocksGUI/BlocksGUI.cxx
Salome HOME
Improve actions management
[modules/geom.git] / src / BlocksGUI / BlocksGUI.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 : Julia DOROVSKIKH, Open CASCADE S.A.S. (julia.dorovskikh@opencascade.com)
25 //
26 #include "BlocksGUI.h"
27
28 #include "BlocksGUI_QuadFaceDlg.h"
29 #include "BlocksGUI_BlockDlg.h"
30 #include "BlocksGUI_TrsfDlg.h"
31 #include "BlocksGUI_ExplodeDlg.h"
32 #include "BlocksGUI_PropagateDlg.h"
33
34 #include <GeometryGUI.h>
35 #include "GeometryGUI_Operations.h"
36
37 #include <SUIT_Desktop.h>
38 #include <SUIT_MessageBox.h>
39 #include <SUIT_Session.h>
40 #include <SalomeApp_Application.h>
41
42 //=======================================================================
43 // function : BlocksGUI()
44 // purpose  : Constructor
45 //=======================================================================
46 BlocksGUI::BlocksGUI( GeometryGUI* parent )
47   : GEOMGUI( parent )
48 {
49 }
50
51 //=======================================================================
52 // function : ~BlocksGUI()
53 // purpose  : Destructor
54 //=======================================================================
55 BlocksGUI::~BlocksGUI()
56 {
57 }
58
59 //=======================================================================
60 // function : OnGUIEvent()
61 // purpose  :
62 //=======================================================================
63 bool BlocksGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
64 {
65   getGeometryGUI()->EmitSignalDeactivateDialog();
66
67   QDialog* aDlg = 0;
68
69   switch ( theCommandID ) {
70   case GEOMOp::OpHexaSolid:      aDlg = new BlocksGUI_BlockDlg    ( getGeometryGUI(), parent ); break;
71   case GEOMOp::OpMultiTransform: aDlg = new BlocksGUI_TrsfDlg     ( getGeometryGUI(), parent ); break;
72   case GEOMOp::OpQuadFace:       aDlg = new BlocksGUI_QuadFaceDlg ( getGeometryGUI(), parent ); break;
73   case GEOMOp::OpExplodeBlock:   aDlg = new BlocksGUI_ExplodeDlg  ( getGeometryGUI(), parent ); break;
74   case GEOMOp::OpPropagate:      aDlg = new BlocksGUI_PropagateDlg( 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 BlocksGUI( parent );
100   }
101 }