Back to index

salome-geom  6.5.0
BlocksGUI.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 : Julia DOROVSKIKH, Open CASCADE S.A.S. (julia.dorovskikh@opencascade.com)
00026 //
00027 #include "BlocksGUI.h"
00028 
00029 #include "BlocksGUI_QuadFaceDlg.h"
00030 #include "BlocksGUI_BlockDlg.h"
00031 #include "BlocksGUI_TrsfDlg.h"
00032 #include "BlocksGUI_ExplodeDlg.h"
00033 #include "BlocksGUI_PropagateDlg.h"
00034 
00035 #include <GeometryGUI.h>
00036 #include "GeometryGUI_Operations.h"
00037 
00038 #include <SUIT_Desktop.h>
00039 #include <SUIT_MessageBox.h>
00040 #include <SUIT_Session.h>
00041 #include <SalomeApp_Application.h>
00042 
00043 //=======================================================================
00044 // function : BlocksGUI()
00045 // purpose  : Constructor
00046 //=======================================================================
00047 BlocksGUI::BlocksGUI( GeometryGUI* parent )
00048   : GEOMGUI( parent )
00049 {
00050 }
00051 
00052 //=======================================================================
00053 // function : ~BlocksGUI()
00054 // purpose  : Destructor
00055 //=======================================================================
00056 BlocksGUI::~BlocksGUI()
00057 {
00058 }
00059 
00060 //=======================================================================
00061 // function : OnGUIEvent()
00062 // purpose  :
00063 //=======================================================================
00064 bool BlocksGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
00065 {
00066   getGeometryGUI()->EmitSignalDeactivateDialog();
00067 
00068   QDialog* aDlg = 0;
00069 
00070   switch ( theCommandID ) {
00071   case GEOMOp::OpHexaSolid:      aDlg = new BlocksGUI_BlockDlg    ( getGeometryGUI(), parent ); break;
00072   case GEOMOp::OpMultiTransform: aDlg = new BlocksGUI_TrsfDlg     ( getGeometryGUI(), parent ); break;
00073   case GEOMOp::OpQuadFace:       aDlg = new BlocksGUI_QuadFaceDlg ( getGeometryGUI(), parent ); break;
00074   case GEOMOp::OpExplodeBlock:   aDlg = new BlocksGUI_ExplodeDlg  ( getGeometryGUI(), parent ); break;
00075   case GEOMOp::OpPropagate:      aDlg = new BlocksGUI_PropagateDlg( getGeometryGUI(), parent ); break;
00076   default:
00077     getGeometryGUI()->getApp()->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) );
00078     break;
00079   }
00080 
00081   if ( aDlg ) {
00082     aDlg->updateGeometry();
00083     aDlg->resize( aDlg->minimumSizeHint() );
00084     aDlg->show();
00085   }
00086 
00087   return true;
00088 }
00089 
00090 //=====================================================================================
00091 // EXPORTED METHODS
00092 //=====================================================================================
00093 extern "C"
00094 {
00095 #ifdef WIN32
00096   __declspec( dllexport )
00097 #endif
00098   GEOMGUI* GetLibGUI( GeometryGUI* parent )
00099   {
00100     return new BlocksGUI( parent );
00101   }
00102 }