-// 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>
// ============================================================== 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)
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;
_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() )
pyConsole->exec( command );
else
return false;
+#else
+ return false;
+#endif
return true;
}