Salome HOME
Updated copyright comment
[modules/hexablock.git] / src / HEXABLOCKGUI / HEXABLOCKGUI_DocumentPanel.cxx
old mode 100755 (executable)
new mode 100644 (file)
index 169c6f5..03f5357
@@ -1,4 +1,4 @@
-// Copyright (C) 2009-2014  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
 
 #include "Hex.hxx"
 #include <iostream>
-#include <QtGui>
 #include <QFlags>
+#include <QKeyEvent>
+#include <QStyledItemDelegate>
 
 #include <SalomeApp_Application.h>
 #include <SalomeApp_Study.h>
+#ifndef DISABLE_PYCONSOLE
 #include <PyConsole_Console.h>
+#endif
 #include <SalomeApp_Tools.h>
 
 #include <Standard_GUID.hxx>
@@ -794,10 +797,13 @@ void HexaBaseDialog::onSelectionChanged( const QItemSelection& sel, const QItemS
 // ============================================================== showEvent
 void HexaBaseDialog::showEvent( QShowEvent * event )
 {
-    if ( _editMode == INFO_MODE )
-        getDocumentModel()->allowEdition();
-    else
-        getDocumentModel()->disallowEdition();
+    // Do not disallow edition, otherwise we can't expand group items
+    // (e.g. vertices) when creating an item (e.g. a vertex or an edge).
+    // Hence, no need to allow edition in info mode.
+    //if ( _editMode == INFO_MODE )
+    //    getDocumentModel()->allowEdition();
+    //else
+    //    getDocumentModel()->disallowEdition();
 
     //Connect to salome selection signals
     if (HEXABLOCKGUI::selectionMgr() != NULL)
@@ -3435,10 +3441,10 @@ bool JoinQuadDialog::apply(QModelIndex& result)
             iquads << iquad;
     }
     QModelIndex iquaddest = patternDataModel->mapToSource( _index[quad_dest_le] );
-    QModelIndex ivex0 = patternDataModel->mapToSource( _index[vex0_le] );
-    QModelIndex ivex1 = patternDataModel->mapToSource( _index[vex1_le] );
-    QModelIndex ivex2 = patternDataModel->mapToSource( _index[vex2_le] );
-    QModelIndex ivex3 = patternDataModel->mapToSource( _index[vex3_le] );
+    QModelIndex ivex0 = patternDataModel->mapToSource( _index[vex0_le] ); // from point a
+    QModelIndex ivex1 = patternDataModel->mapToSource( _index[vex1_le] ); // from point b
+    QModelIndex ivex2 = patternDataModel->mapToSource( _index[vex2_le] ); // to point a
+    QModelIndex ivex3 = patternDataModel->mapToSource( _index[vex3_le] ); // to point b
     double nb = nb_spb->value();
 
     vector<double> heights;
@@ -5876,6 +5882,7 @@ bool ComputeMeshDialog::apply(QModelIndex& result)
     _currentObj = NULL;
 
     if (getDocumentModel() == NULL) return false;
+#ifndef DISABLE_PYCONSOLE
     QString command = QString("import hexablock ; %1 = hexablock.mesh(\"%2\", \"%1\", %3, \"%4\")")
                                                                                                          .arg( _name->text() )
                                                                                                          .arg( getDocumentModel()->getName() )
@@ -5889,6 +5896,9 @@ bool ComputeMeshDialog::apply(QModelIndex& result)
         pyConsole->exec( command );
     else
         return false;
+#else
+    return false;
+#endif
 
     return true;
 }