Salome HOME
To implement issue 0019962: MakePipeBiNormalAlongAxis implementation.
[modules/geom.git] / src / BlocksGUI / BlocksGUI.cxx
1 // GEOM GEOMGUI : GUI for Geometry component
2 //
3 // Copyright (C) 2003  CEA
4 //
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License.
9 //
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 // Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with this library; if not, write to the Free Software
17 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
18 //
19 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 //
21 // File   : BooleanGUI.cxx
22 // Author : Julia DOROVSKIKH, Open CASCADE S.A.S. (julia.dorovskikh@opencascade.com)
23 //
24
25 #include "BlocksGUI.h"
26
27 #include "BlocksGUI_QuadFaceDlg.h"
28 #include "BlocksGUI_BlockDlg.h"
29 #include "BlocksGUI_TrsfDlg.h"
30 #include "BlocksGUI_ExplodeDlg.h"
31 #include "BlocksGUI_PropagateDlg.h"
32
33 #include <GeometryGUI.h>
34
35 #include <SUIT_Desktop.h>
36 #include <SUIT_MessageBox.h>
37 #include <SUIT_Session.h>
38 #include <SalomeApp_Application.h>
39
40 //=======================================================================
41 // function : BlocksGUI()
42 // purpose  : Constructor
43 //=======================================================================
44 BlocksGUI::BlocksGUI( GeometryGUI* parent )
45   : GEOMGUI( parent )
46 {
47 }
48
49 //=======================================================================
50 // function : ~BlocksGUI()
51 // purpose  : Destructor
52 //=======================================================================
53 BlocksGUI::~BlocksGUI()
54 {
55 }
56
57 //=======================================================================
58 // function : OnGUIEvent()
59 // purpose  :
60 //=======================================================================
61 bool BlocksGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
62 {
63   getGeometryGUI()->EmitSignalDeactivateDialog();
64
65   QDialog* aDlg = 0;
66
67   switch ( theCommandID ) {
68   case 9999:  aDlg = new BlocksGUI_BlockDlg    ( getGeometryGUI(), parent ); break;
69   case 9998:  aDlg = new BlocksGUI_TrsfDlg     ( getGeometryGUI(), parent ); break;
70   case 9997:  aDlg = new BlocksGUI_QuadFaceDlg ( getGeometryGUI(), parent ); break;
71   case 9995:  aDlg = new BlocksGUI_ExplodeDlg  ( getGeometryGUI(), parent ); break;
72   case 99991: aDlg = new BlocksGUI_PropagateDlg( getGeometryGUI(), parent ); break;
73   default:
74     getGeometryGUI()->getApp()->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) );
75     break;
76   }
77
78   if ( aDlg ) {
79     aDlg->updateGeometry();
80     aDlg->resize( aDlg->minimumSize() );
81     aDlg->show();
82   }
83
84   return true;
85 }
86
87 //=====================================================================================
88 // EXPORTED METHODS
89 //=====================================================================================
90 extern "C"
91 {
92 #ifdef WIN32
93   __declspec( dllexport )
94 #endif
95   GEOMGUI* GetLibGUI( GeometryGUI* parent )
96   {
97     return new BlocksGUI( parent );
98   }
99 }