1 // GEOM GEOMGUI : GUI for Geometry component
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : OperationGUI.cxx
25 // Author : Damien COQUERET
30 #include "OperationGUI.h"
32 #include "QAD_RightFrame.h"
33 #include "QAD_Desktop.h"
34 #include "OCCViewer_Viewer3d.h"
35 #include "OCCViewer_ViewFrame.h"
36 #include "SALOMEGUI_QtCatchCorbaException.hxx"
38 #include <TopTools_MapOfShape.hxx>
39 #include <TopExp_Explorer.hxx>
40 #include <Precision.hxx>
42 #include "OperationGUI_PartitionDlg.h" // Method PARTITION
43 #include "OperationGUI_ArchimedeDlg.h" // Method ARCHIMEDE
44 #include "OperationGUI_FilletDlg.h" // Method FILLET
45 #include "OperationGUI_ChamferDlg.h" // Method CHAMFER
47 #include "OperationGUI_ClippingDlg.h"
49 OperationGUI* OperationGUI::myGUIObject = 0;
51 //=======================================================================
52 // function : GetOperationGUI()
53 // purpose : Get the only OperationGUI object [ static ]
54 //=======================================================================
55 OperationGUI* OperationGUI::GetOperationGUI()
57 if ( myGUIObject == 0 ) {
58 // init OperationGUI only once
59 myGUIObject = new OperationGUI();
64 //=======================================================================
65 // function : OperationGUI()
66 // purpose : Constructor
67 //=======================================================================
68 OperationGUI::OperationGUI() : GEOMGUI()
73 //=======================================================================
74 // function : ~OperationGUI()
75 // purpose : Destructor
76 //=======================================================================
77 OperationGUI::~OperationGUI()
82 //=======================================================================
83 // function : OnGUIEvent()
85 //=======================================================================
86 bool OperationGUI::OnGUIEvent( int theCommandID, QAD_Desktop* parent )
88 OperationGUI* myOperationGUI = GetOperationGUI();
89 GeometryGUI::GetGeomGUI()->EmitSignalDeactivateDialog();
90 SALOME_Selection* Sel = SALOME_Selection::Selection(
91 QAD_Application::getDesktop()->getActiveStudy()->getSelection() );
93 switch ( theCommandID )
95 case 503: // PARTITION
96 ( new OperationGUI_PartitionDlg( parent, "", Sel ) )->show();
98 case 504: // ARCHIMEDE
99 new OperationGUI_ArchimedeDlg( parent, Sel );
102 new OperationGUI_FilletDlg( parent, Sel );
105 new OperationGUI_ChamferDlg( parent, Sel );
107 case 507: // CLIPPING RANGE
108 ( new OperationGUI_ClippingDlg( parent, "" ) )->show();
111 parent->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
118 //=====================================================================================
120 //=====================================================================================
125 return OperationGUI::GetOperationGUI();