Salome HOME
Join modifications from branch OCC_debug_for_3_2_0b1
[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.org
20 //
21 //
22 //
23 //  File   : BooleanGUI.cxx
24 //  Author : Julia DOOVSKIKH
25 //  Module : GEOM
26 //  $Header$
27
28 #include "BlocksGUI.h"
29
30 #include "BlocksGUI_QuadFaceDlg.h"
31 #include "BlocksGUI_BlockDlg.h"
32 #include "BlocksGUI_TrsfDlg.h"
33 #include "BlocksGUI_ExplodeDlg.h"
34 #include "BlocksGUI_PropagateDlg.h"
35
36 #include "GeometryGUI.h"
37
38 #include "SUIT_Desktop.h"
39 #include "SUIT_MessageBox.h"
40 #include "SUIT_Session.h"
41
42 #include "SalomeApp_Application.h"
43
44 BlocksGUI* BlocksGUI::myGUIObject = 0;
45
46 //=======================================================================
47 // function : GetBlocksGUI()
48 // purpose  : Get the only BlocksGUI object [ static ]
49 //=======================================================================
50 BlocksGUI* BlocksGUI::GetBlocksGUI( GeometryGUI* parent )
51 {
52   if ( myGUIObject == 0 )
53     myGUIObject = new BlocksGUI( parent );
54
55   return myGUIObject;
56 }
57
58 //=======================================================================
59 // function : BlocksGUI()
60 // purpose  : Constructor
61 //=======================================================================
62 BlocksGUI::BlocksGUI( GeometryGUI* parent )
63      : GEOMGUI( parent )
64 {
65 }
66
67 //=======================================================================
68 // function : ~BlocksGUI()
69 // purpose  : Destructor
70 //=======================================================================
71 BlocksGUI::~BlocksGUI()
72 {
73 }
74
75 //=======================================================================
76 // function : OnGUIEvent()
77 // purpose  :
78 //=======================================================================
79 bool BlocksGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
80 {
81   getGeometryGUI()->EmitSignalDeactivateDialog();
82
83   QDialog* aDlg = NULL;
84
85   switch (theCommandID)
86   {
87     case 9999:  aDlg = new BlocksGUI_BlockDlg     (getGeometryGUI(), parent); break;
88     case 9998:  aDlg = new BlocksGUI_TrsfDlg      (getGeometryGUI(), parent); break;
89     case 9997:  aDlg = new BlocksGUI_QuadFaceDlg  (getGeometryGUI(), parent); break;
90     case 9995:  aDlg = new BlocksGUI_ExplodeDlg   (getGeometryGUI(), parent); break;
91     case 99991: aDlg = new BlocksGUI_PropagateDlg (getGeometryGUI(), parent); break;
92     default:
93       getGeometryGUI()->getApp()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
94       break;
95   }
96
97   if (aDlg != NULL)
98     aDlg->show();
99
100   return true;
101 }
102
103 //=====================================================================================
104 // EXPORTED METHODS
105 //=====================================================================================
106 extern "C"
107 {
108 #ifdef WNT
109         __declspec( dllexport )
110 #endif
111   GEOMGUI* GetLibGUI( GeometryGUI* parent )
112   {
113     return BlocksGUI::GetBlocksGUI( parent );
114   }
115 }