Back to index

salome-geom  6.5.0
GenerationGUI.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   : GenerationGUI.cxx
00025 // Author : Damien COQUERET, Open CASCADE S.A.S.
00026 //
00027 #include "GenerationGUI.h"
00028 
00029 #include <GeometryGUI.h>
00030 #include "GeometryGUI_Operations.h"
00031 
00032 #include <SUIT_Desktop.h>
00033 #include <SalomeApp_Application.h>
00034 
00035 #include "GenerationGUI_PrismDlg.h"     // Method PRISM
00036 #include "GenerationGUI_RevolDlg.h"     // Method REVOL
00037 #include "GenerationGUI_FillingDlg.h"   // Method FILLING
00038 #include "GenerationGUI_PipeDlg.h"      // Method PIPE
00039 
00040 //=======================================================================
00041 // function : GenerationGUI()
00042 // purpose  : Constructor
00043 //=======================================================================
00044 GenerationGUI::GenerationGUI( GeometryGUI* parent )
00045   : GEOMGUI( parent )
00046 {
00047 }
00048 
00049 //=======================================================================
00050 // function : ~GenerationGUI()
00051 // purpose  : Destructor
00052 //=======================================================================
00053 GenerationGUI::~GenerationGUI()
00054 {
00055 }
00056 
00057 
00058 //=======================================================================
00059 // function : OnGUIEvent()
00060 // purpose  : 
00061 //=======================================================================
00062 bool GenerationGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
00063 {
00064   SalomeApp_Application* app = getGeometryGUI()->getApp();
00065   if ( !app ) return false;
00066 
00067   getGeometryGUI()->EmitSignalDeactivateDialog();
00068 
00069   QDialog* aDlg = NULL;
00070 
00071   switch ( theCommandID ) {
00072   case GEOMOp::OpPrism:      aDlg = new GenerationGUI_PrismDlg   ( getGeometryGUI(), parent ); break;
00073   case GEOMOp::OpRevolution: aDlg = new GenerationGUI_RevolDlg   ( getGeometryGUI(), parent ); break;
00074   case GEOMOp::OpFilling:    aDlg = new GenerationGUI_FillingDlg ( getGeometryGUI(), parent ); break;
00075   case GEOMOp::OpPipe:       aDlg = new GenerationGUI_PipeDlg    ( getGeometryGUI(), parent ); break;
00076     
00077   default: app->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) ); break;
00078   }
00079 
00080   if (aDlg != NULL )
00081     aDlg->show();
00082 
00083   return true;
00084 }
00085 
00086 
00087 //=====================================================================================
00088 // EXPORTED METHODS
00089 //=====================================================================================
00090 extern "C"
00091 {
00092 #ifdef WIN32
00093   __declspec( dllexport )
00094 #endif
00095   GEOMGUI* GetLibGUI( GeometryGUI* parent )
00096   {
00097     return new GenerationGUI( parent );
00098   }
00099 }