Back to index

salome-geom  6.5.0
BooleanGUI.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 
00023 // GEOM GEOMGUI : GUI for Geometry component
00024 // File   : BooleanGUI.cxx
00025 // Author : Damien COQUERET, Open CASCADE S.A.S.
00026 //
00027 #include "BooleanGUI.h"
00028 #include "BooleanGUI_Dialog.h"
00029 
00030 #include <GeometryGUI.h>
00031 #include "GeometryGUI_Operations.h"
00032 #include <SUIT_Desktop.h>
00033 
00034 //=======================================================================
00035 // function : BooleanGUI()
00036 // purpose  : Constructor
00037 //=======================================================================
00038 BooleanGUI::BooleanGUI( GeometryGUI* parent ) 
00039   : GEOMGUI( parent )
00040 {
00041 }
00042 
00043 //=======================================================================
00044 // function : ~BooleanGUI()
00045 // purpose  : Destructor
00046 //=======================================================================
00047 BooleanGUI::~BooleanGUI()
00048 {
00049 }
00050 
00051 
00052 //=======================================================================
00053 // function : OnGUIEvent()
00054 // purpose  : 
00055 //=======================================================================
00056 bool BooleanGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
00057 {
00058   getGeometryGUI()->EmitSignalDeactivateDialog();
00059 
00060   int anOperation = 0;  
00061   switch ( theCommandID ) {
00062   case GEOMOp::OpFuse:
00063     anOperation = FUSE;    break;
00064   case GEOMOp::OpCommon:
00065     anOperation = COMMON;  break;
00066   case GEOMOp::OpCut:
00067     anOperation = CUT;     break;
00068   case GEOMOp::OpSection:
00069     anOperation = SECTION; break;
00070   default:
00071     return false;
00072   }
00073   
00074   QDialog* aDlg = new BooleanGUI_Dialog( anOperation, getGeometryGUI(), parent );
00075   aDlg->show();
00076 
00077   return true;
00078 }
00079 
00080 //=====================================================================================
00081 // EXPORTED METHODS
00082 //=====================================================================================
00083 extern "C"
00084 {
00085 #ifdef WIN32
00086   __declspec( dllexport )
00087 #endif
00088   GEOMGUI* GetLibGUI( GeometryGUI* parent )
00089   {
00090     return new BooleanGUI( parent );
00091   }
00092 }