Salome HOME
Updated copyright comment
[modules/hexablock.git] / src / HEXABLOCKGUI / HEXABLOCKGUI.hxx
old mode 100755 (executable)
new mode 100644 (file)
index fbc8652..54fe883
@@ -1,9 +1,9 @@
-// Copyright (C) 2009-2013  CEA/DEN, EDF R&D
+// Copyright (C) 2009-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.
+// 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
 #include <map>
 #include <set>
 
+#include <QPointer>
 #include <QTreeView>
 #include <QModelIndex>
 #include <QDockWidget>
 
-
 #include "klinkitemselectionmodel.hxx"
 
 #include <OB_Browser.h>
@@ -46,6 +46,7 @@
 #include "HEXABLOCKGUI_OCCSelector.h"
 #include "hexa_base.hxx"
 
+class QDir;
 
 // #include CORBA_CLIENT_HEADER(HEXABLOCK_Gen)  // Abu Juin 2013
 
@@ -56,15 +57,15 @@ namespace HEXABLOCK
     class VtkDocumentGraphicView;
     class OccGraphicView;
     class GraphicViewsHandler;
-    class DocumentDelegate;
+//    class DocumentDelegate;
     class DocumentModel;
     class PatternDataModel;
-    class PatternBuilderModel;
+//    class PatternBuilderModel;
     class AssociationsModel;
     class GroupsModel;
     class MeshModel;
     class PatternDataSelectionModel;
-    class PatternBuilderSelectionModel;
+//    class PatternBuilderSelectionModel;
     class GroupsSelectionModel;
     class MeshSelectionModel;
 
@@ -128,6 +129,7 @@ public:
   enum ViewType {
       VTK,
       OCC,
+      VTK_OCC,
       UNKNOWN
   };
 
@@ -135,7 +137,7 @@ public:
 
   // static HEXABLOCK_ORB::HEXABLOCK_Gen_ptr InitHEXABLOCKGen( SalomeApp_Application* );
   static LightApp_SelectionMgr*   selectionMgr();
-  static SALOMEDS::Study_var  ClientStudyToStudy (_PTR(Study) theStudy);
+  static SALOMEDS::Study_var  getStudyServant();
   static ViewType getActiveViewType();
   static HEXABLOCKGUI*  getInstance();
 
@@ -160,7 +162,6 @@ public:
   virtual void setResource(SUIT_ResourceMgr* r);
   virtual void createPreferences();
   virtual void preferencesChanged( const QString& sect, const QString& name );
-  virtual void studyActivated();
 
   ///Returns a new HEXA_NS::Document and it's entry in the study
   std::pair <QString, HEXA_NS::Document*> newHexaDocument();
@@ -173,6 +174,7 @@ public:
 
   void initialMenus();
   void showAllMenus();
+  void setAllMenusEnabled(bool enable);
   void updateSelectors();
 
   void switchModel(HEXABLOCK::GUI::VtkDocumentGraphicView* dgview);
@@ -192,6 +194,20 @@ public:
   QTreeView* getPatternDataTreeView() const { return _patternDataTreeView; }
   QTreeView* getPatternGeomTreeView() const { return _patternGeomTreeView; }
 
+  void showVertexInfoDialog(HEXA_NS::Vertex* vertex);
+  void showEdgeInfoDialog(HEXA_NS::Edge* edge);
+  void showQuadInfoDialog(HEXA_NS::Quad* quad);
+  void showHexaInfoDialog(HEXA_NS::Hexa* hexa);
+  void showVectorInfoDialog(HEXA_NS::Vector* vector);
+  void showGroupInfoDialog(HEXA_NS::Group* group);
+  void showLawInfoDialog(HEXA_NS::Law* law);
+  void showPropagationInfoDialog(HEXA_NS::Propagation* propagation);
+
+  void showVtkActor();
+  void showOccActor();
+  void hideVtkActor();
+  void hideOccActor();
+
 public slots:
   bool deactivateModule( SUIT_Study* theStudy);
   bool activateModule( SUIT_Study* theStudy);
@@ -203,6 +219,12 @@ public slots:
   void showGroupsMenus(bool show);
   void showMeshMenus(bool show);
 
+  void enableDocumentMenus(bool enable);
+  void enablePatternMenus(bool enable);
+  void enableAssociationMenus(bool enable);
+  void enableGroupsMenus(bool enable);
+  void enableMeshMenus(bool enable);
+
 protected slots:
   void onWindowActivated( SUIT_ViewWindow* svw);
   void onWindowClosed( SUIT_ViewWindow* svw);
@@ -211,7 +233,6 @@ protected slots:
   virtual void                        onViewManagerRemoved( SUIT_ViewManager* );
 
   void onSelectionChanged( const QItemSelection & selected, const QItemSelection & deselected );
-  void showActor();
   void hideActor();
   void showOnlyActor();
 
@@ -226,7 +247,6 @@ protected:
   HEXABLOCK::GUI::VtkDocumentGraphicView* lastVtkDocGView;
 
   HEXABLOCKGUI_Resource* _myresource;
-  static int _oldStudyId;
   // static HEXABLOCK_ORB::HEXABLOCK_Gen_var _hexaEngine;  // Hexa6 TODo
 private slots:
 
@@ -248,8 +268,8 @@ private slots:
   void addHexa();
 
   void addVector();
-  void addCylinder();
-  void addPipe();
+//  void addCylinder();
+//  void addPipe();
   void makeGrid();
   void makeCylinder();
   void makePipe();
@@ -312,7 +332,7 @@ private:
       if (docGView == NULL)
           return NULL;
       if (!occPrs.contains(docGView))
-          occPrs[docGView] = new SOCC_Prs();
+          occPrs[docGView] = new SOCC_Prs(0);
       return occPrs[docGView];
   }
 
@@ -323,10 +343,12 @@ private:
   QDockWidget *_dwAssociation;   // Hexablock association edition
   QDockWidget *_dwGroups;        // Hexablock groups edition
   QDockWidget *_dwMesh;          // Hexablock meshing edtion
-  QDockWidget *_dwObjectBrowser; // Salome study
+  QPointer<QDockWidget> _dwObjectBrowser; // Salome study
   QDockWidget *_dwInputPanel;    // user Input
 
 
+  // ** Elements creation and modification Dialogs **
+
   // Dialog Box ( to keep persistent values )
   HEXABLOCK::GUI::VertexDialog*                 _vertexDiag;
   HEXABLOCK::GUI::EdgeDialog*                   _edgeDiag;
@@ -363,6 +385,16 @@ private:
   HEXABLOCK::GUI::ModelInfoDialog*              _modelInfoDiag;
   HEXABLOCK::GUI::AddShapeDialog*               _addShapeDiag;
 
+  // ** Elements information dialogs **
+  HEXABLOCK::GUI::VertexDialog*                 _vertexInfoDialog;
+  HEXABLOCK::GUI::EdgeDialog*                   _edgeInfoDialog;
+  HEXABLOCK::GUI::QuadDialog*                   _quadInfoDialog;
+  HEXABLOCK::GUI::HexaDialog*                   _hexaInfoDialog;
+  HEXABLOCK::GUI::VectorDialog*                 _vectorInfoDialog;
+  HEXABLOCK::GUI::GroupDialog*                  _groupInfoDialog;
+  HEXABLOCK::GUI::LawDialog*                    _lawInfoDialog;
+  HEXABLOCK::GUI::PropagationDialog*            _propagationInfoDialog;
+
 
   std::set<HEXABLOCK::GUI::HexaBaseDialog*> currentModelDialogs;
   // Actions
@@ -381,8 +413,8 @@ private:
 
   // Pattern Builder
   QAction *_addVector;
-  QAction *_addCylinder;
-  QAction *_addPipe;
+//  QAction *_addCylinder;
+//  QAction *_addPipe;
   QAction *_makeGrid; //Cartesian, Cylindrical, Spherical
   QAction *_makeCylinder;
   QAction *_makePipe;
@@ -425,9 +457,7 @@ private:
 
   // Meshing
   QAction *_computeMesh;
-
   QAction* _showModelInfoAct;
-
   QAction* _addShapeAct;
 
 
@@ -444,14 +474,14 @@ private:
 
   //      VIEW      VIEW      VIEW      VIEW      VIEW      VIEW      VIEW      VIEW      VIEW      VIEW
   QTreeView* _patternDataTreeView;    //  document's pattern : 1 ( only one view )
-  QTreeView* _patternBuilderTreeView; //  document's pattern : 1 ( only one view )
+//  QTreeView* _patternBuilderTreeView; //  document's pattern : 1 ( only one view )
   QTreeView* _patternGeomTreeView; // the geometries' tree view
   QTreeView* _associationTreeView;    //  document's association : 1 ( only one view )
   QTreeView* _groupsTreeView; //  document's groups
   QTreeView* _meshTreeView;   //  document's mesh property: 1 ( only one view )
 
   //      DELEGATE      DELEGATE      DELEGATE      DELEGATE      DELEGATE      DELEGATE      DELEGATE
-  HEXABLOCK::GUI::DocumentDelegate    *_treeViewDelegate;  // specific editor for each item of the tree
+//  HEXABLOCK::GUI::DocumentDelegate    *_treeViewDelegate;  // specific editor for each item of the tree
 
   HEXABLOCK::GUI::GraphicViewsHandler*  graphicViewsHandler; //vtk views hanlder (create, close, ...)
 
@@ -462,6 +492,7 @@ private:
 
   bool _isSaved;
   bool moduleActivatedOnce;
+  bool menusEnabled;
 
   QDir* loadDocLastPath;
   QDir* saveDocLastPath;