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 "SUIT_Session.h"
33 #include "SUIT_Desktop.h"
35 #include <TopTools_MapOfShape.hxx>
36 #include <TopExp_Explorer.hxx>
37 #include <Precision.hxx>
39 #include "OperationGUI_PartitionDlg.h" // Method PARTITION
40 #include "OperationGUI_ArchimedeDlg.h" // Method ARCHIMEDE
41 #include "OperationGUI_FilletDlg.h" // Method FILLET
42 #include "OperationGUI_ChamferDlg.h" // Method CHAMFER
44 #include "OperationGUI_ClippingDlg.h"
46 OperationGUI* OperationGUI::myGUIObject = 0;
48 //=======================================================================
49 // function : GetOperationGUI()
50 // purpose : Get the only OperationGUI object [ static ]
51 //=======================================================================
52 OperationGUI* OperationGUI::GetOperationGUI( GeometryGUI* parent )
54 if ( myGUIObject == 0 ) {
55 // init OperationGUI only once
56 myGUIObject = new OperationGUI( parent );
61 //=======================================================================
62 // function : OperationGUI()
63 // purpose : Constructor
64 //=======================================================================
65 OperationGUI::OperationGUI(GeometryGUI* parent) : GEOMGUI(parent)
70 //=======================================================================
71 // function : ~OperationGUI()
72 // purpose : Destructor
73 //=======================================================================
74 OperationGUI::~OperationGUI()
79 //=======================================================================
80 // function : OnGUIEvent()
82 //=======================================================================
83 bool OperationGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
85 getGeometryGUI()->EmitSignalDeactivateDialog();
87 switch ( theCommandID )
89 case 503: // PARTITION
90 ( new OperationGUI_PartitionDlg( parent, "" ) )->show();
92 case 504: // ARCHIMEDE
93 new OperationGUI_ArchimedeDlg( getGeometryGUI(), parent );
96 new OperationGUI_FilletDlg( parent );
99 new OperationGUI_ChamferDlg( parent );
101 case 507: // CLIPPING RANGE
102 ( new OperationGUI_ClippingDlg( parent, "" ) )->show();
105 SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
112 //=====================================================================================
114 //=====================================================================================
117 GEOMGUI* GetLibGUI(GeometryGUI* parent)
119 return OperationGUI::GetOperationGUI(parent);