Back to index

salome-geom  6.5.0
BuildGUI.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 "BuildGUI.h"
00028 
00029 #include <SUIT_Desktop.h>
00030 #include <SalomeApp_Application.h>
00031 
00032 #include "BuildGUI_EdgeDlg.h"       // Method EDGE
00033 #include "BuildGUI_WireDlg.h"       // Method WIRE
00034 #include "BuildGUI_FaceDlg.h"       // Method FACE
00035 #include "BuildGUI_ShellDlg.h"      // Method SHELL
00036 #include "BuildGUI_SolidDlg.h"      // Method SOLID
00037 #include "BuildGUI_CompoundDlg.h"   // Method COMPOUND
00038 
00039 #include <GeometryGUI.h>
00040 #include "GeometryGUI_Operations.h"
00041 
00042 //=======================================================================
00043 // function : BuildGUI()
00044 // purpose  : Constructor
00045 //=======================================================================
00046 BuildGUI::BuildGUI( GeometryGUI* parent )
00047   : GEOMGUI( parent )
00048 {
00049 }
00050 
00051 //=======================================================================
00052 // function : ~BuildGUI()
00053 // purpose  : Destructor
00054 //=======================================================================
00055 BuildGUI::~BuildGUI()
00056 {
00057 }
00058 
00059 
00060 //=======================================================================
00061 // function : OnGUIEvent()
00062 // purpose  : 
00063 //=======================================================================
00064 bool BuildGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
00065 {
00066   getGeometryGUI()->EmitSignalDeactivateDialog();
00067 
00068   QDialog* aDlg = 0;
00069 
00070   switch ( theCommandID ) {
00071   case GEOMOp::OpEdge:     aDlg = new BuildGUI_EdgeDlg    ( getGeometryGUI(), parent ); break;
00072   case GEOMOp::OpWire:     aDlg = new BuildGUI_WireDlg    ( getGeometryGUI(), parent ); break;
00073   case GEOMOp::OpFace:     aDlg = new BuildGUI_FaceDlg    ( getGeometryGUI(), parent ); break;
00074   case GEOMOp::OpShell:    aDlg = new BuildGUI_ShellDlg   ( getGeometryGUI(), parent ); break;
00075   case GEOMOp::OpSolid:    aDlg = new BuildGUI_SolidDlg   ( getGeometryGUI(), parent ); break;
00076   case GEOMOp::OpCompound: aDlg = new BuildGUI_CompoundDlg( getGeometryGUI(), parent ); break;
00077   default: 
00078     getGeometryGUI()->getApp()->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) ); 
00079     break;
00080   }
00081   
00082   if ( aDlg ) {
00083     aDlg->updateGeometry();
00084     aDlg->resize( aDlg->minimumSizeHint() );
00085     aDlg->show();
00086   }
00087 
00088   return true;
00089 }
00090 
00091 //=====================================================================================
00092 // EXPORTED METHODS
00093 //=====================================================================================
00094 extern "C"
00095 {
00096 #ifdef WIN32
00097   __declspec( dllexport )
00098 #endif
00099   GEOMGUI* GetLibGUI( GeometryGUI* parent )
00100   {
00101     return new BuildGUI( parent );
00102   }
00103 }