Back to index

salome-geom  6.5.0
RepairGUI.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   : RepairGUI.cxx
00023 //  Author : Damien COQUERET, Open CASCADE S.A.S.
00024 
00025 #include "RepairGUI.h"
00026 
00027 #include <GeometryGUI.h>
00028 #include "GeometryGUI_Operations.h"
00029 
00030 #include <SUIT_Desktop.h>
00031 #include <SUIT_Session.h>
00032 #include <SalomeApp_Application.h>
00033 
00034 #include "RepairGUI_SewingDlg.h"        // Method SEWING
00035 #include "RepairGUI_SuppressFacesDlg.h" // Method SUPPRESS FACES
00036 #include "RepairGUI_RemoveHolesDlg.h"   // Method SUPPRESS HOLE
00037 #include "RepairGUI_ShapeProcessDlg.h"  // Method PROCESS SHAPE
00038 #include "RepairGUI_CloseContourDlg.h"  // Method CLOSE CONTOUR
00039 #include "RepairGUI_RemoveIntWiresDlg.h"// Method REMOVE INTERNAL WIRES
00040 #include "RepairGUI_DivideEdgeDlg.h"    // Method DEVIDE EDGE
00041 #include "RepairGUI_FreeBoundDlg.h"     // Method FREE BOUNDARIES
00042 #include "RepairGUI_FreeFacesDlg.h"     // Method FREE FACES
00043 #include "RepairGUI_GlueDlg.h"          // Method GLUE FACES
00044 #include "RepairGUI_LimitToleranceDlg.h"    // Method LIMIT TOLERANCE
00045 #include "RepairGUI_ChangeOrientationDlg.h" // Method CHANGE ORIENTATION
00046 #include "RepairGUI_RemoveExtraEdgesDlg.h"  // Method REMOVE EXTRA EDGES
00047 
00048 //=======================================================================
00049 // function : RepairGUI()
00050 // purpose  : Constructor
00051 //=======================================================================
00052 RepairGUI::RepairGUI( GeometryGUI* parent )
00053   : GEOMGUI( parent )
00054 {
00055 }
00056 
00057 //=======================================================================
00058 // function : ~RepairGUI()
00059 // purpose  : Destructor
00060 //=======================================================================
00061 RepairGUI::~RepairGUI()
00062 {
00063 }
00064 
00065 
00066 //=======================================================================
00067 // function : OnGUIEvent()
00068 // purpose  :
00069 //=======================================================================
00070 bool RepairGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
00071 {
00072   SalomeApp_Application* app = getGeometryGUI()->getApp();
00073   if ( !app ) return false;
00074 
00075   getGeometryGUI()->EmitSignalDeactivateDialog();
00076 
00077   QDialog* aDlg = NULL;
00078   switch (theCommandID) {
00079   case GEOMOp::OpSewing:           aDlg = new RepairGUI_SewingDlg            (getGeometryGUI(), parent); break;
00080   case GEOMOp::OpGlueFaces: aDlg = new RepairGUI_GlueDlg (getGeometryGUI(), parent, false, TopAbs_FACE); break;
00081   case GEOMOp::OpGlueEdges: aDlg = new RepairGUI_GlueDlg (getGeometryGUI(), parent, false, TopAbs_EDGE); break;
00082   case GEOMOp::OpLimitTolerance:   aDlg = new RepairGUI_LimitToleranceDlg    (getGeometryGUI(), parent); break;
00083   case GEOMOp::OpSuppressFaces:    aDlg = new RepairGUI_SuppressFacesDlg     (getGeometryGUI(), parent); break;
00084   case GEOMOp::OpSuppressHoles:    aDlg = new RepairGUI_RemoveHolesDlg       (getGeometryGUI(), parent); break;
00085   case GEOMOp::OpShapeProcess:     aDlg = new RepairGUI_ShapeProcessDlg      (getGeometryGUI(), parent); break;
00086   case GEOMOp::OpCloseContour:     aDlg = new RepairGUI_CloseContourDlg      (getGeometryGUI(), parent); break;
00087   case GEOMOp::OpRemoveIntWires:   aDlg = new RepairGUI_RemoveIntWiresDlg    (getGeometryGUI(), parent); break;
00088   case GEOMOp::OpAddPointOnEdge:   aDlg = new RepairGUI_DivideEdgeDlg        (getGeometryGUI(), parent); break;
00089   case GEOMOp::OpFreeBoundaries:   aDlg = new RepairGUI_FreeBoundDlg         (getGeometryGUI(), parent); break;
00090   case GEOMOp::OpFreeFaces:        aDlg = new RepairGUI_FreeFacesDlg         (getGeometryGUI(), parent); break;
00091   case GEOMOp::OpOrientation:      aDlg = new RepairGUI_ChangeOrientationDlg (getGeometryGUI(), parent); break;
00092   case GEOMOp::OpRemoveExtraEdges: aDlg = new RepairGUI_RemoveExtraEdgesDlg  (getGeometryGUI(), parent); break;
00093     default:
00094       app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
00095       break;
00096   }
00097 
00098   if (aDlg)
00099     aDlg->show();
00100 
00101   return true;
00102 }
00103 
00104 
00105 //=====================================================================================
00106 // EXPORTED METHODS
00107 //=====================================================================================
00108 extern "C"
00109 {
00110 #ifdef WNT
00111   __declspec( dllexport )
00112 #endif
00113   GEOMGUI* GetLibGUI( GeometryGUI* parent )
00114   {
00115     return new RepairGUI( parent );
00116   }
00117 }