Salome HOME
Updated copyright comment
[modules/yacs.git] / src / genericgui / GenericGui.hxx
index 643c440eeceb50e02cc7cddc862b0265bbdcd60a..f73940b76f7287ae73794d4f20636f191b8590e8 100644 (file)
@@ -1,24 +1,27 @@
-//  Copyright (C) 2006-2008  CEA/DEN, EDF R&D
+// Copyright (C) 2006-2024  CEA, EDF
 //
-//  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.
+// 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, 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
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef _GENERICGUI_HXX_
 #define _GENERICGUI_HXX_
 
+#include "GenericGuiExport.hxx"
+
 #include <QAction>
 #include <QActionGroup>
 #include <QObject>
@@ -47,8 +50,10 @@ namespace YACS
     class SuitWrapper;
     class CatalogWidget;
     class YACSGuiLoader;
+    class SubjectDataPort;
+    class BatchJobsListDialog;
 
-    class GenericGui: public QObject
+    class GENERICGUI_EXPORT GenericGui: public QObject
     {
       Q_OBJECT
 
@@ -60,17 +65,30 @@ namespace YACS
       void createMenus();
       void createTools();
       void initialMenus();
+      void hideAllMenus();
       void showBaseMenus(bool show);
       void showEditionMenus(bool show);
       void showExecMenus(bool show);
-      void switchContext(QWidget *view);
+      void showCommonMenus(bool show);
+      void switchContext(QWidget *view, bool onExit = false);
+      bool closeContext(QWidget *view, bool onExit = false);
       void showDockWidgets(bool isVisible);
       void raiseStacked();
       CatalogWidget* getCatalogWidget() { return _catalogsWidget; };
       std::list<std::string> getMachineList();
+      void createForEachLoop(std::string type="double");
+      void putGraphInForeachLoop(std::string type);
+      virtual void loadSchema(const std::string& filename,bool edit=true, bool arrangeLocalNodes=false);
+      virtual void onHelpContextModule( const QString&, const QString&, const QString& = QString() );
+      void createContext(YACS::ENGINE::Proc* proc,
+                         const QString& schemaName,
+                         const QString& runName,
+                         bool forEdition);
+      YACSGuiLoader *getLoader() { return _loader; };
 
       QAction *_newSchemaAct;
       QAction *_importSchemaAct;
+      QAction *_chooseBatchJobAct;
       QAction *_importSupervSchemaAct;
       QAction *_exportSchemaAct;
       QAction *_exportSchemaAsAct;
@@ -99,11 +117,14 @@ namespace YACS
       QAction *_getErrorReportAct;
       QAction *_getErrorDetailsAct;
       QAction *_getContainerLogAct;
+      QAction *_shutdownProcAct;
 
       QAction *_editDataTypesAct;
       QAction *_createDataTypeAct;
       QAction *_importDataTypeAct;
       QAction *_newContainerAct;
+      QAction *_newHPContainerAct;
+      QAction *_selectComponentInstanceAct;
       QAction *_newSalomeComponentAct;
       QAction *_newSalomePythonComponentAct;
       QAction *_newCorbaComponentAct;
@@ -124,33 +145,67 @@ namespace YACS
       QAction *_FOREACHNodeAct;
       QAction *_WHILENodeAct;
       QAction *_SWITCHNodeAct;
+      QAction *_OptimizerLoopAct;
       QAction *_nodeFromCatalogAct;
       QAction *_deleteItemAct;
       QAction *_cutItemAct;
       QAction *_copyItemAct;
       QAction *_pasteItemAct;
+      QAction *_putInBlocAct;
+      QAction *_putGraphInBlocAct;
+      QAction *_putGraphInForLoopAct;
+      QAction *_putGraphInWhileLoopAct;
+      QAction *_putGraphInOptimizerLoopAct;
       QAction *_arrangeLocalNodesAct;
       QAction *_arrangeRecurseNodesAct;
       QAction *_computeLinkAct;
+      QAction *_zoomToBlocAct;
+      QAction *_centerOnNodeAct;
+      QAction *_shrinkExpand;
+      QAction *_shrinkExpandChildren;
+      QAction *_shrinkExpandElementaryRecursively;
+
+      QAction *_toggleStraightLinksAct;
       QAction *_toggleAutomaticComputeLinkAct;
       QAction *_toggleSimplifyLinkAct;
       QAction *_toggleForce2NodesLinkAct;
+      QAction *_toggleAddRowColsAct;
       QAction *_toggleSceneItemVisibleAct;
       QAction *_selectReferenceAct;
       QAction *_whatsThisAct;
 
+      QAction *_showAllLinksAct;
+      QAction *_hideAllLinksAct;
+
+      QAction *_showOnlyPortLinksAct;
+      QAction *_showPortLinksAct;
+      QAction *_hidePortLinksAct;
+      QAction *_emphasisPortLinksAct;
+
+      QAction *_showOnlyCtrlLinksAct;
+      QAction *_showCtrlLinksAct;
+      QAction *_hideCtrlLinksAct;
+      QAction *_emphasisCtrlLinksAct;
+
+      QAction *_showOnlyLinkAct;
+      QAction *_showLinkAct;
+      QAction *_hideLinkAct;
+      QAction *_emphasisLinkAct;
+      QAction *_deEmphasizeAllAct;
+
+      QAction *_undoAct;
+      QAction *_redoAct;
+      QAction *_showUndoAct;
+      QAction *_showRedoAct;
+
       YACS::HMI::GuiEditor *_guiEditor;
+      void setLoadedPresentation(YACS::ENGINE::Proc* proc);
 
     public slots:
       void onCleanOnExit();
 
     protected:
       int getMenuId() { return _menuId++; }
-      void createContext(YACS::ENGINE::Proc* proc,
-                         const QString& schemaName,
-                         const QString& runName,
-                         bool forEdition);
-      void setLoadedPresentation(YACS::ENGINE::Proc* proc);
       QString getSaveFileName(const QString& fileName = QString());
 
       YACSGuiLoader *_loader;
@@ -159,6 +214,7 @@ namespace YACS
       QDockWidget* _dwTree;
       QDockWidget* _dwStacked;
       QDockWidget* _dwCatalogs;
+      BatchJobsListDialog* _BJLdialog;
       YACS::ENGINE::Catalog* _builtinCatalog;
       YACS::ENGINE::Catalog* _sessionCatalog;
       CatalogWidget* _catalogsWidget;
@@ -166,12 +222,14 @@ namespace YACS
       int _menuId;
       int _toolId;
       int _schemaCnt;
+      bool _isSaved;
       std::list<std::string> _machineList;
 
     private slots:
 
       void onNewSchema();
       void onImportSchema();
+      void onChooseBatchJob();
       void onImportSupervSchema();
       void onExportSchema();
       void onExportSchemaAs();
@@ -198,12 +256,15 @@ namespace YACS
       void onGetErrorReport();
       void onGetErrorDetails();
       void onGetContainerLog();
+      void onShutdownProc();
 
       void onEditDataTypes();
       void onCreateDataType();
       void onImportDataType();
 
       void onNewContainer();
+      void onNewHPContainer();
+      void onSelectComponentInstance();
       void onNewSalomeComponent();
       void onNewSalomePythonComponent();
       void onNewCorbaComponent();
@@ -225,26 +286,67 @@ namespace YACS
       void onFOREACHNode();
       void onWHILENode();
       void onSWITCHNode();
+      void onOptimizerLoop();
       void onNodeFromCatalog();
 
       void onDeleteItem();
       void onCutItem();
       void onCopyItem();
       void onPasteItem();
-
+      void onPutInBloc();
+      void onPutGraphInBloc();
+      void onPutGraphInForLoop();
+      void onPutGraphInWhileLoop();
+      void onPutGraphInOptimizerLoop();
       void onArrangeLocalNodes();
       void onArrangeRecurseNodes();
       void onRebuildLinks();
+      void onZoomToBloc();
+      void onCenterOnNode();
+      void onShrinkExpand();
+      void onShrinkExpandChildren();
+      void onShrinkExpandElementaryRecursively();
+      void onToggleStraightLinks(bool checked);
       void onToggleAutomaticComputeLinks(bool checked);
       void onToggleSimplifyLinks(bool checked);
       void onToggleForce2NodesLinks(bool checked);
+      void onToggleAddRowCols(bool checked);
 
       void onToggleSceneItemVisible(bool checked);
 
+      void onShowAllLinks();
+      void onHideAllLinks();
+
+      void onShowOnlyPortLinks();
+      void onShowPortLinks();
+      void onHidePortLinks();
+      void onEmphasisPortLinks();
+
+      void onShowOnlyCtrlLinks();
+      void onShowCtrlLinks();
+      void onHideCtrlLinks();
+      void onEmphasisCtrlLinks();
+
+      void onShowOnlyLink();
+      void onShowLink();
+      void onHideLink();
+      void onEmphasisLink();
+      void onDeEmphasizeAll();
+
       void onSelectReference();
       void onWhatsThis();
 
+      void onUndo();
+      void onRedo();
+      void onShowUndo();
+      void onShowRedo();
+
     private:
+      void displayLinks(bool isShown);
+      void displayControlLinks(bool isShown);
+      void displayPortLinks(bool isShown);
+      void displayALink(bool isShown);
+      void emphasizePortLink(YACS::HMI::SubjectDataPort* sub, bool emphasize);
     };
 
   }