Salome HOME
Copyright update: 2016
[modules/hexablock.git] / src / HEXABLOCKGUI / HEXABLOCKGUI.cxx
index d508afb873f620c621f4f6e40ebbc0e63d6de3d4..faced0468ed8584b4bc384595d7f042820f3aed1 100755 (executable)
@@ -1,9 +1,9 @@
-// Copyright (C) 2009-2013  CEA/DEN, EDF R&D
+// Copyright (C) 2009-2016  CEA/DEN, EDF R&D
 //
 // 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 <cassert>
 
-
+#include <QDir>
 #include <QInputDialog>
 #include <QIcon>
 #include <QStackedWidget>
+#include <QMenu>
+#include <QSplitter>
 
 #include <QtxTreeView.h>
 #include <SUIT_MessageBox.h>
@@ -72,7 +74,6 @@
 
 
 #include <SALOME_ListIO.hxx>
-#include <SALOME_ListIteratorOfListIO.hxx>
 
 
 #include <SALOME_LifeCycleCORBA.hxx>
 
 
 #include <Visual3d_ViewManager.hxx>
-#include <V3d_PerspectiveView.hxx>
+//#include <V3d_PerspectiveView.hxx>
 #include <V3d_AmbientLight.hxx>
 #include <V3d_DirectionalLight.hxx>
 #include <Xw_Window.hxx>
 
 #include <AIS_ListIteratorOfListOfInteractive.hxx>
 
+#include <utilities.h>
 
 #define DW_MINIMUM_WIDTH       50
 #define DWINPUT_MINIMUM_HEIGHT 50
@@ -453,7 +455,7 @@ void HEXABLOCKGUI::addInStudy(QMap<QString, TopoDS_Shape>& topo_shapes,
     SOCC_Prs* prs = getOccPrs(currentDocGView);
     if (prs == NULL)
     {
-        prs = new SOCC_Prs();
+        prs = new SOCC_Prs(0);
         isNewPrs = true;
     }
 
@@ -538,7 +540,9 @@ void HEXABLOCKGUI::windows( QMap<int, int>& theMap ) const
     DEBTRACE("HEXABLOCKGUI::windows");
     theMap.clear();
     theMap.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::LeftDockWidgetArea );
+#ifndef DISABLE_PYCONSOLE
     theMap.insert( SalomeApp_Application::WT_PyConsole,     Qt::BottomDockWidgetArea );
+#endif
 }
 
 QString  HEXABLOCKGUI::engineIOR() const
@@ -950,6 +954,7 @@ void HEXABLOCKGUI::createAndFillDockWidget()
     _dwInputPanel = new QDockWidget(aParent);
     _dwInputPanel->setVisible(false);
     _dwInputPanel->setWindowTitle("Input Panel");
+    _dwInputPanel->setObjectName("hexablockInputPanelDock");
 //    _dwInputPanel->setMinimumWidth(DWINPUT_MINIMUM_WIDTH); // --- force a minimum until display
 
 //    _treeViewDelegate = new DocumentDelegate(_dwInputPanel);
@@ -960,6 +965,7 @@ void HEXABLOCKGUI::createAndFillDockWidget()
     _dwPattern->setVisible(false);
     _dwPattern->setWindowTitle("Model");
     _dwPattern->setMinimumWidth(DW_MINIMUM_WIDTH); // --- force a minimum until display
+    _dwPattern->setObjectName("hexablockModelDock");
 
     QFrame*      patternFrame  = new QFrame(_dwPattern);
     patternFrame->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
@@ -994,6 +1000,7 @@ void HEXABLOCKGUI::createAndFillDockWidget()
     _dwGroups->setVisible(false);
     _dwGroups->setWindowTitle("Groups");
     _dwGroups->setMinimumWidth(DW_MINIMUM_WIDTH); // --- force a minimum until display
+    _dwGroups->setObjectName("hexablockGroupsDock");
     _groupsTreeView = new QTreeView(_dwGroups);
     _groupsTreeView->setEditTriggers(QAbstractItemView::NoEditTriggers);
 //    _groupsTreeView->setItemDelegate(_treeViewDelegate);
@@ -1005,6 +1012,7 @@ void HEXABLOCKGUI::createAndFillDockWidget()
     _dwMesh->setVisible(false);
     _dwMesh->setWindowTitle("Mesh");
     _dwMesh->setMinimumWidth(DW_MINIMUM_WIDTH); // --- force a minimum until display
+    _dwMesh->setObjectName("hexablockMeshDock");
     _meshTreeView = new QTreeView(_dwMesh);
     _meshTreeView->setEditTriggers(QAbstractItemView::NoEditTriggers);
     _meshTreeView->setSelectionMode(QAbstractItemView::SingleSelection);
@@ -1480,7 +1488,7 @@ void HEXABLOCKGUI::createTools()
 {
     int aToolId;
 
-    aToolId = createTool ( tr( "HexaBlock Toolbar" ) );
+    aToolId = createTool ( tr( "HexaBlock Toolbar" ), QString( "HexaBlockMain" ) );
     createTool( _newAct, aToolId );
     createTool( _importAct, aToolId );
     createTool( _saveAct, aToolId );
@@ -1489,7 +1497,7 @@ void HEXABLOCKGUI::createTools()
     //createTool( separator(), aToolId );
 
     // Pattern Data
-    aToolId = createTool ( tr( "Construction" ) );
+    aToolId = createTool ( tr( "Construction" ), QString( "HexaBlockConstruction" ) );
     createTool( _addVertex, aToolId );
     createTool( _addEdge, aToolId );
     createTool( _addQuad, aToolId );
@@ -1515,7 +1523,7 @@ void HEXABLOCKGUI::createTools()
     createTool( _makePipes,    aToolId );
 
     // Pattern Data Edition
-    aToolId = createTool ( tr( "Operation" ) );
+    aToolId = createTool ( tr( "Operation" ), QString( "HexaBlockOperation" ) );
     createTool( _removeHexa, aToolId );
     createTool( _prismQuad,  aToolId );
     createTool( _joinQuad,   aToolId );
@@ -1530,19 +1538,19 @@ void HEXABLOCKGUI::createTools()
     createTool( _quadRevolution, aToolId );
 
     // Association
-    aToolId = createTool ( tr( "Association" ) );
+    aToolId = createTool ( tr( "Association" ), QString( "HexaBlockAssociation" ) );
     createTool( _assocVertex, aToolId );
     createTool( _assocEdge, aToolId );
     createTool( _assocQuad, aToolId );
     createTool( _addShapeAct, aToolId );
 
     // Group
-    aToolId = createTool ( tr( "Group" ) );
+    aToolId = createTool ( tr( "Group" ), QString( "HexaBlockGroup" ) );
     createTool( _addGroup,    aToolId );
     createTool( _removeGroup, aToolId ); //CS_TODO
 
     // Law
-    aToolId = createTool ( tr( "Mesh" ) );
+    aToolId = createTool ( tr( "Mesh" ), QString( "HexaBlockMesh" ) );
     createTool( _addLaw,    aToolId );
     createTool( _removeLaw, aToolId );
     createTool( _setPropagation, aToolId );