]> SALOME platform Git repositories - modules/geom.git/blob - src/BlocksGUI/BlocksGUI.cxx
Salome HOME
Merge with version on tag OCC-V2_1_0d
[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_CheckMultiBlockDlg.h"
34 #include "BlocksGUI_ExplodeDlg.h"
35
36 #include "SALOMEGUI_QtCatchCorbaException.hxx"
37
38 #include "QAD_Desktop.h"
39 #include "QAD_MessageBox.h"
40
41 BlocksGUI* BlocksGUI::myGUIObject = 0;
42
43 //=======================================================================
44 // function : GetBlocksGUI()
45 // purpose  : Get the only BlocksGUI object [ static ]
46 //=======================================================================
47 BlocksGUI* BlocksGUI::GetBlocksGUI()
48 {
49   if ( myGUIObject == 0 )
50     myGUIObject = new BlocksGUI();
51
52   return myGUIObject;
53 }
54
55 //=======================================================================
56 // function : BlocksGUI()
57 // purpose  : Constructor
58 //=======================================================================
59 BlocksGUI::BlocksGUI()
60      : GEOMGUI()
61 {
62 }
63
64 //=======================================================================
65 // function : ~BlocksGUI()
66 // purpose  : Destructor
67 //=======================================================================
68 BlocksGUI::~BlocksGUI()
69 {
70 }
71
72 //=======================================================================
73 // function : OnGUIEvent()
74 // purpose  :
75 //=======================================================================
76 bool BlocksGUI::OnGUIEvent( int theCommandID, QAD_Desktop* parent )
77 {
78   GeometryGUI::GetGeomGUI()->EmitSignalDeactivateDialog();
79
80   SALOME_Selection* Sel = SALOME_Selection::Selection
81     (QAD_Application::getDesktop()->getActiveStudy()->getSelection());
82
83   QDialog* aDlg = NULL;
84
85   switch (theCommandID)
86   {
87     case 9999:
88       aDlg = new BlocksGUI_BlockDlg (parent, Sel);
89       break;
90
91     case 9998:
92       aDlg = new BlocksGUI_TrsfDlg (parent, Sel);
93       break;
94
95     case 9997:
96       aDlg = new BlocksGUI_QuadFaceDlg (parent, Sel);
97       break;
98
99     case 9996:
100 //      aDlg = new BlocksGUI_CheckMultiBlockDlg (parent, Sel);
101       QAD_MessageBox::warn1 (parent,
102                              QObject::tr("WRN_WARNING"), 
103                              QObject::tr("WRN_NOT_IMPLEMENTED"),
104                              QObject::tr("BUT_OK"));
105       break;
106
107     case 9995:
108       aDlg = new BlocksGUI_ExplodeDlg (parent, Sel);
109       break;
110
111     default:
112       parent->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
113       break;
114   }
115
116   if (aDlg != NULL)
117     aDlg->show();
118
119   return true;
120 }
121
122 //=====================================================================================
123 // EXPORTED METHODS
124 //=====================================================================================
125 extern "C"
126 {
127   GEOMGUI* GetLibGUI()
128   {
129     return BlocksGUI::GetBlocksGUI();
130   }
131 }