Back to index

salome-geom  6.5.0
OperationGUI.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 //  File   : OperationGUI.cxx
00023 //  Author : Damien COQUERET, Open CASCADE S.A.S.
00024 
00025 #include "OperationGUI.h"
00026 
00027 #include <GeometryGUI.h>
00028 #include "GeometryGUI_Operations.h"
00029 
00030 #include <SUIT_Session.h>
00031 #include <SUIT_Desktop.h>
00032 #include <SalomeApp_Application.h>
00033 
00034 #include <TopTools_MapOfShape.hxx>
00035 #include <TopExp_Explorer.hxx>
00036 #include <Precision.hxx>
00037 
00038 #include "OperationGUI_PartitionDlg.h"   // Method PARTITION
00039 #include "OperationGUI_ArchimedeDlg.h"   // Method ARCHIMEDE
00040 #include "OperationGUI_FilletDlg.h"      // Method FILLET
00041 #include "OperationGUI_Fillet1d2dDlg.h"  // Method FILLET 2D and FILLET 1D
00042 #include "OperationGUI_ChamferDlg.h"     // Method CHAMFER
00043 #include "OperationGUI_ClippingDlg.h"    // Clipping dialog box
00044 #include "OperationGUI_GetShapesOnShapeDlg.h"
00045 #include "OperationGUI_GetSharedShapesDlg.h"
00046 #include "OperationGUI_ExtrudedFeatureDlg.h" // Methods EXTRUDED BOSS / CUT
00047 
00048 //=======================================================================
00049 // function : OperationGUI()
00050 // purpose  : Constructor
00051 //=======================================================================
00052 OperationGUI::OperationGUI( GeometryGUI* parent ) :
00053   GEOMGUI( parent )
00054 {
00055 }
00056 
00057 //=======================================================================
00058 // function : ~OperationGUI()
00059 // purpose  : Destructor
00060 //=======================================================================
00061 OperationGUI::~OperationGUI()
00062 {
00063 }
00064 
00065 
00066 //=======================================================================
00067 // function : OnGUIEvent()
00068 // purpose  : 
00069 //=======================================================================
00070 bool OperationGUI::OnGUIEvent (int theCommandID, SUIT_Desktop* parent)
00071 {
00072   SalomeApp_Application* app = getGeometryGUI()->getApp();
00073   if (!app) return false;
00074 
00075   getGeometryGUI()->EmitSignalDeactivateDialog();
00076 
00077   switch (theCommandID) {
00078   case GEOMOp::OpPartition:     (new OperationGUI_PartitionDlg       (getGeometryGUI(), parent))->show(); break;
00079   case GEOMOp::OpArchimede:     (new OperationGUI_ArchimedeDlg       (getGeometryGUI(), parent))->show(); break;
00080   case GEOMOp::OpFillet3d:      (new OperationGUI_FilletDlg          (getGeometryGUI(), parent))->show(); break;
00081   case GEOMOp::OpChamfer:       (new OperationGUI_ChamferDlg         (getGeometryGUI(), parent))->show(); break;
00082   case GEOMOp::OpClipping:      (new OperationGUI_ClippingDlg        (getGeometryGUI(), parent))->show(); break;
00083   case GEOMOp::OpShapesOnShape: (new OperationGUI_GetShapesOnShapeDlg(getGeometryGUI(), parent))->show(); break;
00084   case GEOMOp::OpSharedShapes:  (new OperationGUI_GetSharedShapesDlg (getGeometryGUI(), parent))->show(); break;
00085   case GEOMOp::OpExtrudedBoss:  (new OperationGUI_ExtrudedFeatureDlg (BOSS, getGeometryGUI(), parent))->show(); break;
00086   case GEOMOp::OpExtrudedCut:   (new OperationGUI_ExtrudedFeatureDlg (CUT, getGeometryGUI(), parent))->show(); break;
00087   case GEOMOp::OpFillet1d:      (new OperationGUI_Fillet1d2dDlg      (getGeometryGUI(), parent, true))->show(); break;
00088   case GEOMOp::OpFillet2d:      (new OperationGUI_Fillet1d2dDlg      (getGeometryGUI(), parent, false))->show(); break;
00089   default:
00090     app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
00091   }
00092 
00093   return true;
00094 }
00095 
00096 //=====================================================================================
00097 // EXPORTED METHODS
00098 //=====================================================================================
00099 extern "C"
00100 {
00101 #ifdef WNT
00102   __declspec( dllexport )
00103 #endif
00104   GEOMGUI* GetLibGUI( GeometryGUI* parent )
00105   {
00106     return new OperationGUI( parent );
00107   }
00108 }