Salome HOME
Fix compilation error (conflict of OK name between OCCT Plate_Plate.hxx and GEOM...
[modules/geom.git] / src / AdvancedGUI / AdvancedGUI.cxx
index 2c478e469ff6bfc01b15308795c5f083db84c719..d0722bc9fb697579b0611a311a229a3de20e8998 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2024  CEA, EDF, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -23,7 +23,7 @@
 #include "AdvancedGUI.h"
 
 #include "GeometryGUI.h"
-#include "GeometryGUI_Operations.h"
+//#include "GeometryGUI_Operations.h"
 
 #include <SUIT_Desktop.h>
 #include <SalomeApp_Application.h>
 #include "AdvancedGUI_PipeTShapeDlg.h"
 #include "AdvancedGUI_DividedDiskDlg.h"
 #include "AdvancedGUI_DividedCylinderDlg.h"
+#include "AdvancedGUI_SmoothingSurfaceDlg.h"
 //@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@//
 
 #include <QDialog>
 
+#include <iostream>
+
 //=======================================================================
 // function : AdvancedGUI()
 // purpose  : Constructor
 //=======================================================================
-AdvancedGUI::AdvancedGUI( GeometryGUI* parent ) : GEOMGUI( parent )
+AdvancedGUI::AdvancedGUI( GeometryGUI* parent ) : GEOMPluginGUI( parent )
 {
 }
 
@@ -56,6 +59,28 @@ AdvancedGUI::~AdvancedGUI()
 // purpose  : 
 //=======================================================================
 bool AdvancedGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
+{
+  switch ( theCommandID ) {
+  case 1:
+    return OnGUIEvent("TShape_Basic", parent);
+  case 2:
+    return OnGUIEvent("DividedDisk", parent);
+  case 3:
+    return OnGUIEvent("DividedCylinder", parent);
+  case 4:
+    return OnGUIEvent("SmoothingSurface", parent);
+  //@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@//
+  default:
+    return OnGUIEvent("", parent);
+  }
+  return false;
+}
+
+//=======================================================================
+// function : OnGUIEvent()
+// purpose  : 
+//=======================================================================
+bool AdvancedGUI::OnGUIEvent( const QString& theCommandID, SUIT_Desktop* parent )
 {
   SalomeApp_Application* app = getGeometryGUI()->getApp();
   if ( !app ) return false;
@@ -64,23 +89,24 @@ bool AdvancedGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
 
   QDialog* aDlg = NULL;
 
-  switch ( theCommandID ) {
-  case GEOMOp::OpPipeTShape:
+  if (theCommandID == "TShape_Basic") {
     aDlg = new AdvancedGUI_PipeTShapeDlg( getGeometryGUI(), parent );
-    break;
-//   case GEOMOp::OpPipeTShapeGroups:
-//     aDlg = new AdvancedGUI_PipeTShapeGroupsDlg( getGeometryGUI(), parent );
-//     break;
-  case GEOMOp::OpDividedDisk:
+  }
+  //else if (theCommandID == "TShape_Groups") {
+  //  aDlg = new AdvancedGUI_PipeTShapeGroupsDlg( getGeometryGUI(), parent );
+  //}
+  else if (theCommandID == "DividedDisk") {
     aDlg = new AdvancedGUI_DividedDiskDlg( getGeometryGUI(), parent );
-    break;
-  case GEOMOp::OpDividedCylinder:
+  }
+  else if (theCommandID == "DividedCylinder") {
     aDlg = new AdvancedGUI_DividedCylinderDlg( getGeometryGUI(), parent );
-    break;
+  }
+  else if (theCommandID == "SmoothingSurface") {
+    aDlg = new AdvancedGUI_SmoothingSurfaceDlg( getGeometryGUI(), parent );
+  }
   //@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@//
-  default:
+  else {
     app->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) );
-    break;
   }
 
   if ( aDlg != NULL )
@@ -97,7 +123,7 @@ extern "C"
 #ifdef WIN32
   __declspec( dllexport )
 #endif
-  GEOMGUI* GetLibGUI( GeometryGUI* parent )
+  GEOMPluginGUI* GetLibGUI( GeometryGUI* parent )
   {
     return new AdvancedGUI( parent );
   }