1 // Copyright (C) 2004-2016 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // GHS3DPlugin GUI: GUI for plugged-in mesher GHS3DPlugin
21 // File : GHS3DPluginGUI_HypothesisCreator.cxx
22 // Author : Michael Zorin
23 // Module : GHS3DPlugin
25 #include "GHS3DPluginGUI_HypothesisCreator.h"
26 #include "GHS3DPluginGUI_Enums.h"
27 #include "GHS3DPluginGUI_Dlg.h"
29 #include <GeometryGUI.h>
31 #include <SMESHGUI_Utils.h>
32 #include <SMESHGUI_SpinBox.h>
33 #include <SMESHGUI_HypothesesUtils.h>
34 #include <SMESH_NumberFilter.hxx>
35 #include <SMESH_TypeFilter.hxx>
36 #include <StdMeshersGUI_ObjectReferenceParamWdg.h>
38 #include <LightApp_SelectionMgr.h>
39 #include <SUIT_Session.h>
40 #include <SUIT_MessageBox.h>
41 #include <SUIT_ResourceMgr.h>
42 #include <SUIT_FileDlg.h>
43 #include <SalomeApp_Tools.h>
44 #include <SalomeApp_TypeFilter.h>
46 #include <TopoDS_Iterator.hxx>
52 #include <QVBoxLayout>
53 #include <QGridLayout>
58 #include <QPushButton>
62 #include <QTableWidget>
63 #include <QTableWidgetItem>
64 #include <QHeaderView>
67 #include <utilities.h>
69 #include <boost/algorithm/string.hpp>
72 // BEGIN EnforcedVertexTableWidgetDelegate
75 EnforcedVertexTableWidgetDelegate::EnforcedVertexTableWidgetDelegate(QObject *parent)
76 : QItemDelegate(parent)
80 QWidget *EnforcedVertexTableWidgetDelegate::createEditor(QWidget *parent,
81 const QStyleOptionViewItem & option ,
82 const QModelIndex & index ) const
84 QModelIndex father = index.parent();
85 QString entry = father.child(index.row(), ENF_VER_ENTRY_COLUMN).data().toString();
87 if (index.column() == ENF_VER_X_COLUMN ||
88 index.column() == ENF_VER_Y_COLUMN ||
89 index.column() == ENF_VER_Z_COLUMN ||
90 index.column() == ENF_VER_SIZE_COLUMN) {
91 SMESHGUI_SpinBox *editor = new SMESHGUI_SpinBox(parent);
92 if (index.column() == ENF_VER_SIZE_COLUMN)
93 editor->RangeStepAndValidator(0, COORD_MAX, 10.0, "length_precision");
95 editor->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
96 editor->setReadOnly(!entry.isEmpty());
97 editor->setDisabled(!entry.isEmpty());
100 // else if (index.column() == ENF_VER_COMPOUND_COLUMN) {
101 // QCheckBox *editor = new QCheckBox(parent);
102 // editor->setDisabled(!entry.isEmpty());
105 else if (index.column() == ENF_VER_GROUP_COLUMN ||
106 index.column() == ENF_VER_NAME_COLUMN) {
108 QLineEdit *editor = new QLineEdit(parent);
109 if (index.column() != ENF_VER_GROUP_COLUMN) {
110 editor->setReadOnly(!entry.isEmpty());
111 editor->setDisabled(!entry.isEmpty());
115 return QItemDelegate::createEditor(parent, option, index);
118 void EnforcedVertexTableWidgetDelegate::setEditorData(QWidget *editor,
119 const QModelIndex &index) const
121 if (index.column() == ENF_VER_X_COLUMN ||
122 index.column() == ENF_VER_Y_COLUMN ||
123 index.column() == ENF_VER_Z_COLUMN ||
124 index.column() == ENF_VER_SIZE_COLUMN)
126 SMESHGUI_SpinBox *lineEdit = qobject_cast<SMESHGUI_SpinBox*>(editor);
127 lineEdit->SetValue(index.data().toDouble());
129 else if (index.column() == ENF_VER_COMPOUND_COLUMN) {
130 QCheckBox *checkBox = qobject_cast<QCheckBox*>(editor);
131 checkBox->setChecked(index.data().toBool());
134 QItemDelegate::setEditorData(editor, index);
138 void EnforcedVertexTableWidgetDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
139 const QModelIndex &index) const
141 QModelIndex parent = index.parent();
143 QString entry = parent.child(index.row(), ENF_VER_ENTRY_COLUMN).data().toString();
144 bool isCompound = parent.child(index.row(), ENF_VER_COMPOUND_COLUMN).data(Qt::CheckStateRole).toBool();
146 if (index.column() == ENF_VER_X_COLUMN ||
147 index.column() == ENF_VER_Y_COLUMN ||
148 index.column() == ENF_VER_Z_COLUMN) {
149 SMESHGUI_SpinBox *lineEdit = qobject_cast<SMESHGUI_SpinBox*>(editor);
150 if (!isCompound && !vertexExists(model, index, lineEdit->GetString()))
151 model->setData(index, lineEdit->GetValue(), Qt::EditRole);
153 else if (index.column() == ENF_VER_SIZE_COLUMN)
155 SMESHGUI_SpinBox *lineEdit = qobject_cast<SMESHGUI_SpinBox*>(editor);
156 const double newsize = lineEdit->GetValue();
158 model->setData(index, newsize, Qt::EditRole);
160 else if (index.column() == ENF_VER_NAME_COLUMN) {
161 QLineEdit *lineEdit = qobject_cast<QLineEdit*>(editor);
162 QString value = lineEdit->text();
163 if (entry.isEmpty() && !vertexExists(model, index, value))
164 model->setData(index, value, Qt::EditRole);
166 else if (index.column() == ENF_VER_ENTRY_COLUMN) {
167 QLineEdit *lineEdit = qobject_cast<QLineEdit*>(editor);
168 QString value = lineEdit->text();
169 if (! vertexExists(model, index, value))
170 model->setData(index, value, Qt::EditRole);
172 else if (index.column() == ENF_VER_COMPOUND_COLUMN) {
173 QCheckBox *checkBox = qobject_cast<QCheckBox*>(editor);
174 model->setData(index, checkBox->isChecked(), Qt::CheckStateRole);
177 QItemDelegate::setModelData(editor, model, index);
181 void EnforcedVertexTableWidgetDelegate::updateEditorGeometry(QWidget *editor,
182 const QStyleOptionViewItem &option, const QModelIndex &/* index */) const
184 editor->setGeometry(option.rect);
187 bool EnforcedVertexTableWidgetDelegate::vertexExists(QAbstractItemModel *model,
188 const QModelIndex &index,
192 QModelIndex parent = index.parent();
193 int row = index.row();
194 int col = index.column();
196 if (parent.isValid() && !value.isEmpty()) {
197 if (col == ENF_VER_X_COLUMN || col == ENF_VER_Y_COLUMN || col == ENF_VER_Z_COLUMN) {
199 if (col == ENF_VER_X_COLUMN) {
200 x = value.toDouble();
201 y = parent.child(row, ENF_VER_Y_COLUMN).data().toDouble();
202 z = parent.child(row, ENF_VER_Z_COLUMN).data().toDouble();
204 if (col == ENF_VER_Y_COLUMN) {
205 y = value.toDouble();
206 x = parent.child(row, ENF_VER_X_COLUMN).data().toDouble();
207 z = parent.child(row, ENF_VER_Z_COLUMN).data().toDouble();
209 if (col == ENF_VER_Z_COLUMN) {
210 z = value.toDouble();
211 x = parent.child(row, ENF_VER_X_COLUMN).data().toDouble();
212 y = parent.child(row, ENF_VER_Y_COLUMN).data().toDouble();
214 int nbChildren = model->rowCount(parent);
215 for (int i = 0 ; i < nbChildren ; i++) {
217 double childX = parent.child(i, ENF_VER_X_COLUMN).data().toDouble();
218 double childY = parent.child(i, ENF_VER_Y_COLUMN).data().toDouble();
219 double childZ = parent.child(i, ENF_VER_Z_COLUMN).data().toDouble();
220 if ((childX == x) && (childY == y) && (childZ == z)) {
227 else if (col == ENF_VER_NAME_COLUMN) {
228 QString name = parent.child(row, ENF_VER_NAME_COLUMN).data().toString();
238 // END EnforcedVertexTableWidgetDelegate
242 // BEGIN EnforcedMeshTableWidgetDelegate
245 EnforcedMeshTableWidgetDelegate::EnforcedMeshTableWidgetDelegate(QObject *parent)
246 : QItemDelegate(parent)
250 QWidget *EnforcedMeshTableWidgetDelegate::createEditor(QWidget *parent,
251 const QStyleOptionViewItem & option ,
252 const QModelIndex & index ) const
254 return QItemDelegate::createEditor(parent, option, index);
257 void EnforcedMeshTableWidgetDelegate::setEditorData(QWidget *editor,
258 const QModelIndex &index) const
260 QItemDelegate::setEditorData(editor, index);
263 void EnforcedMeshTableWidgetDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
264 const QModelIndex &index) const
266 QItemDelegate::setModelData(editor, model, index);
270 void EnforcedMeshTableWidgetDelegate::updateEditorGeometry(QWidget *editor,
271 const QStyleOptionViewItem &option, const QModelIndex &/* index */) const
273 editor->setGeometry(option.rect);
276 // bool EnforcedMeshTableWidgetDelegate::enfMeshExists(QAbstractItemModel *model,
277 // const QModelIndex &index,
278 // QString value) const
280 // bool exists = false;
281 // QModelIndex parent = index.parent();
282 // int row = index.row();
283 // int col = index.column();
288 // END EnforcedMeshTableWidgetDelegate
292 GHS3DPluginGUI_HypothesisCreator::GHS3DPluginGUI_HypothesisCreator( const QString& theHypType )
293 : SMESHGUI_GenericHypothesisCreator( theHypType )
295 GeomToolSelected = NULL;
296 GeomToolSelected = getGeomSelectionTool();
298 iconVertex = QPixmap(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_OBJBROWSER_VERTEX")));
299 iconCompound = QPixmap(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_OBJBROWSER_COMPOUND")));
300 // mySelectionMgr = SMESH::GetSelectionMgr(SMESHGUI::GetSMESHGUI());
301 myEnfMeshConstraintLabels << tr( "GHS3D_ENF_MESH_CONSTRAINT_NODE" ) << tr( "GHS3D_ENF_MESH_CONSTRAINT_EDGE" ) << tr("GHS3D_ENF_MESH_CONSTRAINT_FACE");
304 GHS3DPluginGUI_HypothesisCreator::~GHS3DPluginGUI_HypothesisCreator()
306 GHS3DPluginGUI_HypothesisCreator* that = (GHS3DPluginGUI_HypothesisCreator*)this;
307 that->getGeomSelectionTool()->selectionMgr()->clearFilters();
308 myEnfMeshWdg->deactivateSelection();
312 * \brief {Get or create the geom selection tool for active study}
314 GeomSelectionTools* GHS3DPluginGUI_HypothesisCreator::getGeomSelectionTool()
316 GHS3DPluginGUI_HypothesisCreator* that = (GHS3DPluginGUI_HypothesisCreator*)this;
317 _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
318 if (that->GeomToolSelected == NULL || that->GeomToolSelected->getMyStudy() != aStudy) {
319 that->GeomToolSelected = new GeomSelectionTools(aStudy);
321 return that->GeomToolSelected;
324 GEOM::GEOM_Gen_var GHS3DPluginGUI_HypothesisCreator::getGeomEngine()
326 return GeometryGUI::GetGeomGen();
329 QFrame* GHS3DPluginGUI_HypothesisCreator::buildFrame()
331 QFrame* fr = new QFrame( 0 );
332 QVBoxLayout* lay = new QVBoxLayout( fr );
334 lay->setSpacing( 0 );
337 QTabWidget* tab = new QTabWidget( fr );
338 tab->setTabShape( QTabWidget::Rounded );
339 tab->setTabPosition( QTabWidget::North );
340 lay->addWidget( tab );
343 myStdGroup = new QWidget();
344 QGridLayout* aStdLayout = new QGridLayout( myStdGroup );
345 aStdLayout->setSpacing( 6 );
346 aStdLayout->setMargin( 11 );
352 aStdLayout->addWidget( new QLabel( tr( "SMESH_NAME" ), myStdGroup ), row, 0, 1, 1 );
353 myName = new QLineEdit( myStdGroup );
354 aStdLayout->addWidget( myName, row++, 1, 1, 1 );
357 myToMeshHolesCheck = new QCheckBox( tr( "GHS3D_TO_MESH_HOLES" ), myStdGroup );
358 aStdLayout->addWidget( myToMeshHolesCheck, row, 0, 1, 1 );
359 myToMakeGroupsOfDomains = new QCheckBox( tr( "GHS3D_TO_MAKE_DOMAIN_GROUPS" ), myStdGroup );
360 aStdLayout->addWidget( myToMakeGroupsOfDomains, row++, 1, 1, 1 );
362 aStdLayout->addWidget( new QLabel( tr( "GHS3D_OPTIMIZATIOL_LEVEL" ), myStdGroup ), row, 0, 1, 1 );
363 myOptimizationLevelCombo = new QComboBox( myStdGroup );
364 aStdLayout->addWidget( myOptimizationLevelCombo, row++, 1, 1, 1 );
367 types << tr( "LEVEL_NONE" ) << tr( "LEVEL_LIGHT" ) << tr( "LEVEL_MEDIUM" ) << tr( "LEVEL_STANDARDPLUS" ) << tr( "LEVEL_STRONG" );
368 myOptimizationLevelCombo->addItems( types );
370 aStdLayout->setRowStretch( row, 10 );
372 // advanced parameters
373 myAdvGroup = new QWidget();
374 QGridLayout* anAdvLayout = new QGridLayout( myAdvGroup );
375 anAdvLayout->setSpacing( 6 );
376 anAdvLayout->setMargin( 11 );
377 myAdvWidget = new GHS3DPluginGUI_AdvWidget(myAdvGroup);
378 anAdvLayout->addWidget( myAdvWidget);
380 myAdvWidget->maxMemoryCheck->setText(tr( "MAX_MEMORY_SIZE" ));
381 myAdvWidget->initialMemoryCheck->setText(tr( "INIT_MEMORY_SIZE" ));
383 myAdvWidget->maxMemorySpin->stepBy(10);
384 myAdvWidget->maxMemorySpin->setValue( 128 );
386 myAdvWidget->initialMemorySpin->stepBy(10);
387 myAdvWidget->initialMemorySpin->setValue( 100 );
389 myAdvWidget->initialMemoryLabel ->setText (tr( "MEGABYTE" ));
390 myAdvWidget->maxMemoryLabel ->setText (tr( "MEGABYTE" ));
392 myAdvWidget->workingDirectoryLabel ->setText (tr( "WORKING_DIR" ));
393 myAdvWidget->workingDirectoryPushButton ->setText (tr( "SELECT_DIR" ));
394 myAdvWidget->keepWorkingFilesCheck ->setText (tr( "KEEP_WORKING_FILES" ));
395 myAdvWidget->verboseLevelLabel ->setText (tr( "VERBOSE_LEVEL" ));
396 myAdvWidget->removeLogOnSuccessCheck ->setText (tr( "REMOVE_LOG_ON_SUCCESS" ));
397 myAdvWidget->logInFileCheck ->setText (tr( "LOG_IN_FILE" ));
399 myAdvWidget->memoryGroupBox ->setTitle(tr( "MEMORY_GROUP_TITLE" ));
400 myAdvWidget->logGroupBox ->setTitle(tr( "LOG_GROUP_TITLE" ));
401 myAdvWidget->advancedMeshingGroupBox ->setTitle(tr( "ADVANCED_MESHING_GROUP_TITLE" ));
403 myAdvWidget->createNewNodesCheck ->setText (tr( "TO_ADD_NODES" ));
404 myAdvWidget->removeInitialCentralPointCheck->setText (tr( "NO_INITIAL_CENTRAL_POINT" ));
405 myAdvWidget->boundaryRecoveryCheck ->setText (tr( "RECOVERY_VERSION" ));
406 myAdvWidget->FEMCorrectionCheck ->setText (tr( "FEM_CORRECTION" ));
407 myAdvWidget->gradationLabel ->setText (tr( "GHS3D_GRADATION" ));
408 myAdvWidget->gradationSpinBox->RangeStepAndValidator(0.0, 5.0, 0.05, "length_precision");
410 // Enforced vertices parameters
411 myEnfGroup = new QWidget();
412 QGridLayout* anEnfLayout = new QGridLayout(myEnfGroup);
414 myEnforcedTableWidget = new QTableWidget(myEnfGroup);
415 myEnforcedTableWidget ->setMinimumWidth(300);
416 myEnforcedTableWidget->setRowCount( 0 );
417 myEnforcedTableWidget->setColumnCount( ENF_VER_NB_COLUMNS );
418 myEnforcedTableWidget->setSortingEnabled(true);
419 QStringList enforcedHeaders;
420 enforcedHeaders << tr( "GHS3D_ENF_NAME_COLUMN" )
421 << tr( "GHS3D_ENF_VER_X_COLUMN" )<< tr( "GHS3D_ENF_VER_Y_COLUMN" ) << tr( "GHS3D_ENF_VER_Z_COLUMN" )
422 << tr( "GHS3D_ENF_SIZE_COLUMN" ) << tr("GHS3D_ENF_ENTRY_COLUMN") << tr("GHS3D_ENF_VER_COMPOUND_COLUMN") << tr( "GHS3D_ENF_GROUP_COLUMN" );
424 myEnforcedTableWidget->setHorizontalHeaderLabels(enforcedHeaders);
425 myEnforcedTableWidget->verticalHeader()->hide();
426 myEnforcedTableWidget->horizontalHeader()->setStretchLastSection(true);
427 myEnforcedTableWidget->setAlternatingRowColors(true);
428 myEnforcedTableWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
429 myEnforcedTableWidget->setSelectionBehavior(QAbstractItemView::SelectItems);
430 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
431 myEnforcedTableWidget->horizontalHeader()->setResizeMode(QHeaderView::Interactive);
433 myEnforcedTableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive);
435 myEnforcedTableWidget->resizeColumnsToContents();
436 myEnforcedTableWidget->hideColumn(ENF_VER_ENTRY_COLUMN);
437 myEnforcedTableWidget->hideColumn(ENF_VER_COMPOUND_COLUMN);
439 myEnforcedTableWidget->setItemDelegate(new EnforcedVertexTableWidgetDelegate());
442 TColStd_MapOfInteger shapeTypes;
443 shapeTypes.Add( TopAbs_VERTEX );
444 shapeTypes.Add( TopAbs_COMPOUND );
446 SMESH_NumberFilter* vertexFilter = new SMESH_NumberFilter("GEOM", TopAbs_SHAPE, 1, shapeTypes);
447 myEnfVertexWdg = new StdMeshersGUI_ObjectReferenceParamWdg( vertexFilter, 0, /*multiSel=*/true);
448 myEnfVertexWdg->SetDefaultText(tr("GHS3D_ENF_SELECT_VERTEX"), "QLineEdit { color: grey }");
450 QLabel* myXCoordLabel = new QLabel( tr( "GHS3D_ENF_VER_X_LABEL" ), myEnfGroup );
451 myXCoord = new SMESHGUI_SpinBox(myEnfGroup);
452 myXCoord->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
453 QLabel* myYCoordLabel = new QLabel( tr( "GHS3D_ENF_VER_Y_LABEL" ), myEnfGroup );
454 myYCoord = new SMESHGUI_SpinBox(myEnfGroup);
455 myYCoord->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
456 QLabel* myZCoordLabel = new QLabel( tr( "GHS3D_ENF_VER_Z_LABEL" ), myEnfGroup );
457 myZCoord = new SMESHGUI_SpinBox(myEnfGroup);
458 myZCoord->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
459 QLabel* mySizeLabel = new QLabel( tr( "GHS3D_ENF_SIZE_LABEL" ), myEnfGroup );
460 mySizeValue = new SMESHGUI_SpinBox(myEnfGroup);
461 mySizeValue->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
463 QLabel* myGroupNameLabel = new QLabel( tr( "GHS3D_ENF_GROUP_LABEL" ), myEnfGroup );
464 myGroupName = new QLineEdit(myEnfGroup);
466 addVertexButton = new QPushButton(tr("GHS3D_ENF_ADD"),myEnfGroup);
467 addVertexButton->setEnabled(false);
468 removeVertexButton = new QPushButton(tr("GHS3D_ENF_REMOVE"),myEnfGroup);
469 // myGlobalGroupName = new QCheckBox(tr("GHS3D_ENF_VER_GROUPS"), myEnfGroup);
470 // myGlobalGroupName->setChecked(false);
472 // QGroupBox* GroupBox = new QGroupBox( myEnfGroup );
473 // QLabel* info = new QLabel( GroupBox );
474 // info->setText( tr( "GHS3D_ENF_VER_INFO" ) );
475 // info->setWordWrap( true );
476 // QVBoxLayout* GroupBoxVLayout = new QVBoxLayout( GroupBox );
477 // GroupBoxVLayout->setSpacing( 6 );
478 // GroupBoxVLayout->setMargin( 11 );
479 // GroupBoxVLayout->addWidget( info );
482 //anEnfLayout->addWidget(GroupBox, ENF_VER_WARNING, 0, 1, 2 );
483 anEnfLayout->addWidget(myEnforcedTableWidget, ENF_VER_VERTEX, 0, ENF_VER_NB_LINES, 1);
485 QGridLayout* anEnfLayout2 = new QGridLayout(myEnfGroup);
486 anEnfLayout2->addWidget(myEnfVertexWdg, ENF_VER_VERTEX, 0, 1, 2);
487 anEnfLayout2->addWidget(myXCoordLabel, ENF_VER_X_COORD, 0, 1, 1);
488 anEnfLayout2->addWidget(myXCoord, ENF_VER_X_COORD, 1, 1, 1);
489 anEnfLayout2->addWidget(myYCoordLabel, ENF_VER_Y_COORD, 0, 1, 1);
490 anEnfLayout2->addWidget(myYCoord, ENF_VER_Y_COORD, 1, 1, 1);
491 anEnfLayout2->addWidget(myZCoordLabel, ENF_VER_Z_COORD, 0, 1, 1);
492 anEnfLayout2->addWidget(myZCoord, ENF_VER_Z_COORD, 1, 1, 1);
493 anEnfLayout2->addWidget(mySizeLabel, ENF_VER_SIZE, 0, 1, 1);
494 anEnfLayout2->addWidget(mySizeValue, ENF_VER_SIZE, 1, 1, 1);
495 anEnfLayout2->addWidget(myGroupNameLabel, ENF_VER_GROUP, 0, 1, 1);
496 anEnfLayout2->addWidget(myGroupName, ENF_VER_GROUP, 1, 1, 1);
497 anEnfLayout2->addWidget(addVertexButton, ENF_VER_BTN, 0, 1, 1);
498 anEnfLayout2->addWidget(removeVertexButton, ENF_VER_BTN, 1, 1, 1);
499 anEnfLayout2->setRowStretch(ENF_VER_NB_LINES, 1);
501 anEnfLayout->addLayout(anEnfLayout2, ENF_VER_VERTEX, 1,ENF_VER_NB_LINES, 1);
502 anEnfLayout->setRowStretch(ENF_VER_VERTEX, 10);
505 // Enforced meshes parameters
506 myEnfMeshGroup = new QWidget();
507 QGridLayout* anEnfMeshLayout = new QGridLayout(myEnfMeshGroup);
509 myEnforcedMeshTableWidget = new QTableWidget(myEnfGroup);
510 myEnforcedMeshTableWidget->setRowCount( 0 );
511 myEnforcedMeshTableWidget->setColumnCount( ENF_MESH_NB_COLUMNS );
512 myEnforcedMeshTableWidget->setSortingEnabled(true);
513 myEnforcedMeshTableWidget->verticalHeader()->hide();
514 QStringList enforcedMeshHeaders;
515 enforcedMeshHeaders << tr( "GHS3D_ENF_NAME_COLUMN" )
516 << tr( "GHS3D_ENF_ENTRY_COLUMN" )
517 << tr( "GHS3D_ENF_MESH_CONSTRAINT_COLUMN" )
518 << tr( "GHS3D_ENF_GROUP_COLUMN" );
519 myEnforcedMeshTableWidget->setHorizontalHeaderLabels(enforcedMeshHeaders);
520 myEnforcedMeshTableWidget->horizontalHeader()->setStretchLastSection(true);
521 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
522 myEnforcedMeshTableWidget->horizontalHeader()->setResizeMode(QHeaderView::Interactive);
524 myEnforcedMeshTableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive);
526 myEnforcedMeshTableWidget->setAlternatingRowColors(true);
527 myEnforcedMeshTableWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
528 myEnforcedMeshTableWidget->setSelectionBehavior(QAbstractItemView::SelectItems);
529 myEnforcedMeshTableWidget->resizeColumnsToContents();
530 myEnforcedMeshTableWidget->hideColumn(ENF_MESH_ENTRY_COLUMN);
532 myEnforcedMeshTableWidget->setItemDelegate(new EnforcedMeshTableWidgetDelegate());
534 // myEnfMesh = SMESH::SMESH_Mesh::_nil();
535 // myEnfMeshArray = new SMESH::mesh_array();
537 myEnfMeshWdg = new StdMeshersGUI_ObjectReferenceParamWdg( SMESH::IDSOURCE, myEnfMeshGroup, /*multiSel=*/true);
538 myEnfMeshWdg->SetDefaultText(tr("GHS3D_ENF_SELECT_MESH"), "QLineEdit { color: grey }");
540 myEnfMeshWdg->AvoidSimultaneousSelection(myEnfVertexWdg);
542 QLabel* myMeshConstraintLabel = new QLabel( tr( "GHS3D_ENF_MESH_CONSTRAINT_LABEL" ), myEnfMeshGroup );
543 myEnfMeshConstraint = new QComboBox(myEnfMeshGroup);
544 myEnfMeshConstraint->insertItems(0,myEnfMeshConstraintLabels);
545 myEnfMeshConstraint->setEditable(false);
546 myEnfMeshConstraint->setCurrentIndex(0);
548 QLabel* myMeshGroupNameLabel = new QLabel( tr( "GHS3D_ENF_GROUP_LABEL" ), myEnfMeshGroup );
549 myMeshGroupName = new QLineEdit(myEnfMeshGroup);
551 addEnfMeshButton = new QPushButton(tr("GHS3D_ENF_ADD"),myEnfMeshGroup);
552 // addEnfMeshButton->setEnabled(false);
553 removeEnfMeshButton = new QPushButton(tr("GHS3D_ENF_REMOVE"),myEnfMeshGroup);
555 // QGroupBox* GroupBox2 = new QGroupBox( myEnfMeshGroup );
556 // QLabel* info2 = new QLabel( GroupBox2 );
557 // info2->setText( tr( "GHS3D_ENF_MESH_INFO" ) );
558 // info2->setWordWrap( true );
559 // QVBoxLayout* GroupBox2VLayout = new QVBoxLayout( GroupBox2 );
560 // GroupBox2VLayout->setSpacing( 6 );
561 // GroupBox2VLayout->setMargin( 11 );
562 // GroupBox2VLayout->addWidget( info2 );
564 // anEnfMeshLayout->addWidget( GroupBox2, ENF_MESH_WARNING, 0, 1, 2 );
565 anEnfMeshLayout->addWidget(myEnforcedMeshTableWidget, ENF_MESH_MESH, 0, ENF_MESH_NB_LINES , 1);
567 QGridLayout* anEnfMeshLayout2 = new QGridLayout(myEnfMeshGroup);
568 anEnfMeshLayout2->addWidget(myEnfMeshWdg, ENF_MESH_MESH, 0, 1, 2);
569 anEnfMeshLayout2->addWidget(myMeshConstraintLabel, ENF_MESH_CONSTRAINT, 0, 1, 1);
570 anEnfMeshLayout2->addWidget(myEnfMeshConstraint, ENF_MESH_CONSTRAINT, 1, 1, 1);
571 anEnfMeshLayout2->addWidget(myMeshGroupNameLabel, ENF_MESH_GROUP, 0, 1, 1);
572 anEnfMeshLayout2->addWidget(myMeshGroupName, ENF_MESH_GROUP, 1, 1, 1);
573 anEnfMeshLayout2->addWidget(addEnfMeshButton, ENF_MESH_BTN, 0, 1, 1);
574 anEnfMeshLayout2->addWidget(removeEnfMeshButton, ENF_MESH_BTN, 1, 1, 1);
575 anEnfMeshLayout2->setRowStretch(ENF_MESH_NB_LINES, 1);
577 anEnfMeshLayout->addLayout(anEnfMeshLayout2, ENF_MESH_MESH, 1, ENF_MESH_NB_LINES, 1);
578 anEnfMeshLayout->setRowStretch(ENF_MESH_MESH, 10);
581 tab->insertTab( STD_TAB, myStdGroup, tr( "SMESH_ARGUMENTS" ) );
582 tab->insertTab( ADV_TAB, myAdvGroup, tr( "GHS3D_ADV_ARGS" ) );
583 tab->insertTab( ENF_VER_TAB, myEnfGroup, tr( "GHS3D_ENFORCED_VERTICES" ) );
584 tab->insertTab( ENF_MESH_TAB, myEnfMeshGroup, tr( "GHS3D_ENFORCED_MESHES" ) );
585 tab->setCurrentIndex( STD_TAB );
588 //connect( myToMeshHolesCheck, SIGNAL( toggled( bool ) ), this, SLOT( onToMeshHoles(bool)));
589 connect( myAdvWidget->maxMemoryCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
590 connect( myAdvWidget->initialMemoryCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
591 connect( myAdvWidget->boundaryRecoveryCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
592 connect( myAdvWidget->logInFileCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
593 connect( myAdvWidget->keepWorkingFilesCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
594 connect( myAdvWidget->workingDirectoryPushButton, SIGNAL( clicked() ), this, SLOT( onDirBtnClicked() ) );
596 connect( myEnforcedTableWidget, SIGNAL( itemClicked(QTableWidgetItem *)), this, SLOT( synchronizeCoords() ) );
597 connect( myEnforcedTableWidget, SIGNAL( itemChanged(QTableWidgetItem *)), this, SLOT( updateEnforcedVertexValues(QTableWidgetItem *) ) );
598 connect( myEnforcedTableWidget, SIGNAL( itemSelectionChanged() ), this, SLOT( synchronizeCoords() ) );
599 connect( addVertexButton, SIGNAL( clicked()), this, SLOT( onAddEnforcedVertex() ) );
600 connect( removeVertexButton, SIGNAL( clicked()), this, SLOT( onRemoveEnforcedVertex() ) );
601 connect( myEnfVertexWdg, SIGNAL( contentModified()), this, SLOT( onSelectEnforcedVertex() ) );
602 connect( myEnfVertexWdg, SIGNAL( contentModified()), this, SLOT( checkVertexIsDefined() ) );
603 connect( myXCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
604 connect( myYCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
605 connect( myZCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
606 connect( mySizeValue, SIGNAL( textChanged(const QString&) ), this, SLOT( checkVertexIsDefined() ) );
607 connect( myXCoord, SIGNAL( valueChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
608 connect( myYCoord, SIGNAL( valueChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
609 connect( myZCoord, SIGNAL( valueChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
610 connect( mySizeValue, SIGNAL( valueChanged(const QString&) ), this, SLOT( checkVertexIsDefined() ) );
611 connect( this, SIGNAL( vertexDefined(bool) ), addVertexButton, SLOT( setEnabled(bool) ) );
613 connect( addEnfMeshButton, SIGNAL( clicked()), this, SLOT( onAddEnforcedMesh() ) );
614 connect( removeEnfMeshButton, SIGNAL( clicked()), this, SLOT( onRemoveEnforcedMesh() ) );
615 // connect( myEnfMeshWdg, SIGNAL( contentModified()), this, SLOT( checkEnfMeshIsDefined() ) );
616 // connect( myEnfMeshConstraint, SIGNAL( currentIndexChanged(int) ), this, SLOT( checkEnfMeshIsDefined() ) );
617 // connect( this, SIGNAL( enfMeshDefined(bool) ), addEnfMeshButton, SLOT( setEnabled(bool) ) );
623 * This method checks if an enforced vertex is defined;
625 void GHS3DPluginGUI_HypothesisCreator::clearEnfVertexSelection()
627 if (myEnfVertexWdg->NbObjects() != 0) {
628 disconnect( myEnfVertexWdg, SIGNAL( contentModified()), this, SLOT( onSelectEnforcedVertex() ) );
629 disconnect( myEnfVertexWdg, SIGNAL( contentModified()), this, SLOT( checkVertexIsDefined() ) );
630 myEnfVertexWdg->SetObject(GEOM::GEOM_Object::_nil());
631 connect( myEnfVertexWdg, SIGNAL( contentModified()), this, SLOT( onSelectEnforcedVertex() ) );
632 connect( myEnfVertexWdg, SIGNAL( contentModified()), this, SLOT( checkVertexIsDefined() ) );
634 GHS3DPluginGUI_HypothesisCreator* that = (GHS3DPluginGUI_HypothesisCreator*)this;
635 that->checkVertexIsDefined();
639 * This method checks if an enforced vertex is defined;
641 void GHS3DPluginGUI_HypothesisCreator::checkVertexIsDefined()
643 bool enfVertexIsDefined = false;
644 enfVertexIsDefined = (!mySizeValue->GetString().isEmpty() &&
645 (!myEnfVertexWdg->NbObjects() == 0 ||
646 (myEnfVertexWdg->NbObjects() == 0 && !myXCoord->GetString().isEmpty()
647 && !myYCoord->GetString().isEmpty()
648 && !myZCoord->GetString().isEmpty())));
649 emit vertexDefined(enfVertexIsDefined);
653 * This method checks if an enforced mesh is defined;
655 void GHS3DPluginGUI_HypothesisCreator::checkEnfMeshIsDefined()
657 emit enfMeshDefined( myEnfVertexWdg->NbObjects() != 0);
661 * This method resets the content of the X, Y, Z, size and GroupName widgets;
663 void GHS3DPluginGUI_HypothesisCreator::clearEnforcedVertexWidgets()
665 myXCoord->setCleared(true);
666 myYCoord->setCleared(true);
667 myZCoord->setCleared(true);
668 // mySizeValue->setCleared(true);
669 myXCoord->setText("");
670 myYCoord->setText("");
671 myZCoord->setText("");
672 // mySizeValue->setText("");
673 // myGroupName->setText("");
674 addVertexButton->setEnabled(false);
677 /** GHS3DPluginGUI_HypothesisCreator::updateEnforcedVertexValues(item)
678 This method updates the tooltip of a modified item. The QLineEdit widgets content
679 is synchronized with the coordinates of the enforced vertex clicked in the tree widget.
681 void GHS3DPluginGUI_HypothesisCreator::updateEnforcedVertexValues(QTableWidgetItem* item) {
682 // MESSAGE("GHS3DPluginGUI_HypothesisCreator::updateEnforcedVertexValues");
683 int row = myEnforcedTableWidget->row(item);
685 QVariant vertexName = myEnforcedTableWidget->item(row,ENF_VER_NAME_COLUMN)->data(Qt::EditRole);
686 QVariant x = myEnforcedTableWidget->item(row,ENF_VER_X_COLUMN)->data( Qt::EditRole);
687 QVariant y = myEnforcedTableWidget->item(row,ENF_VER_Y_COLUMN)->data( Qt::EditRole);
688 QVariant z = myEnforcedTableWidget->item(row,ENF_VER_Z_COLUMN)->data( Qt::EditRole);
689 QVariant size = myEnforcedTableWidget->item(row,ENF_VER_SIZE_COLUMN)->data( Qt::EditRole);
690 QVariant entry = myEnforcedTableWidget->item(row,ENF_VER_ENTRY_COLUMN)->data( Qt::EditRole);
691 QString groupName = myEnforcedTableWidget->item(row,ENF_VER_GROUP_COLUMN)->data( Qt::EditRole).toString();
693 clearEnforcedVertexWidgets();
695 if ( !x.isNull() || !entry.isNull()) {
696 QString toolTip = vertexName.toString();
697 toolTip += QString("(");
698 if (entry.isNull() || (!entry.isNull() && entry.toString() == "")) {
699 toolTip += x.toString();
700 toolTip += QString(", ") + y.toString();
701 toolTip += QString(", ") + z.toString();
704 toolTip += entry.toString();
705 toolTip += QString(")");
708 toolTip += QString("=") + size.toString();
710 if (!groupName.isEmpty())
711 toolTip += QString(" [") + groupName + QString("]");
713 // MESSAGE("Tooltip: " << toolTip.toStdString());
714 for (int col=0;col<ENF_VER_NB_COLUMNS;col++)
715 myEnforcedTableWidget->item(row,col)->setToolTip(toolTip);
718 disconnect( myXCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
719 disconnect( myYCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
720 disconnect( myZCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
721 myXCoord->SetValue(x.toDouble());
722 myYCoord->SetValue(y.toDouble());
723 myZCoord->SetValue(z.toDouble());
724 connect( myXCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
725 connect( myYCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
726 connect( myZCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
729 mySizeValue->SetValue(size.toDouble());
731 if (!groupName.isEmpty())
732 myGroupName->setText(groupName);
736 void GHS3DPluginGUI_HypothesisCreator::onSelectEnforcedVertex() {
737 int nbSelEnfVertex = myEnfVertexWdg->NbObjects();
738 clearEnforcedVertexWidgets();
739 if (nbSelEnfVertex == 1)
741 if ( CORBA::is_nil( getGeomEngine() ) && !GeometryGUI::InitGeomGen() )
744 myEnfVertex = myEnfVertexWdg->GetObject< GEOM::GEOM_Object >(nbSelEnfVertex-1);
745 if (myEnfVertex == GEOM::GEOM_Object::_nil())
747 if (myEnfVertex->GetShapeType() == GEOM::VERTEX) {
748 GHS3DPluginGUI_HypothesisCreator* that = (GHS3DPluginGUI_HypothesisCreator*)this;
749 GEOM::GEOM_IMeasureOperations_var measureOp = getGeomEngine()->GetIMeasureOperations( that->getGeomSelectionTool()->getMyStudy()->StudyId() );
750 if (CORBA::is_nil(measureOp))
754 measureOp->PointCoordinates (myEnfVertex, x, y, z);
755 if ( measureOp->IsDone() )
757 disconnect( myXCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
758 disconnect( myYCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
759 disconnect( myZCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
760 myXCoord->SetValue(x);
761 myYCoord->SetValue(y);
762 myZCoord->SetValue(z);
763 connect( myXCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
764 connect( myYCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
765 connect( myZCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
771 /** GHS3DPluginGUI_HypothesisCreator::synchronizeCoords()
772 This method synchronizes the QLineEdit/SMESHGUI_SpinBox widgets content with the coordinates
773 of the enforced vertex clicked in the tree widget.
775 void GHS3DPluginGUI_HypothesisCreator::synchronizeCoords() {
776 clearEnforcedVertexWidgets();
777 QList<QTableWidgetItem *> items = myEnforcedTableWidget->selectedItems();
778 // myEnfVertexWdg->disconnect(SIGNAL(contentModified()));
779 disconnect( myEnfVertexWdg, SIGNAL( contentModified()), this, SLOT( onSelectEnforcedVertex() ) );
780 if (! items.isEmpty()) {
781 QTableWidgetItem *item;
784 if (items.size() == 1) {
786 row = myEnforcedTableWidget->row(item);
787 QVariant x = myEnforcedTableWidget->item(row,ENF_VER_X_COLUMN)->data( Qt::EditRole);
788 QVariant y = myEnforcedTableWidget->item(row,ENF_VER_Y_COLUMN)->data( Qt::EditRole);
789 QVariant z = myEnforcedTableWidget->item(row,ENF_VER_Z_COLUMN)->data( Qt::EditRole);
790 QVariant size = myEnforcedTableWidget->item(row,ENF_VER_SIZE_COLUMN)->data( Qt::EditRole);
791 entry = myEnforcedTableWidget->item(row,ENF_VER_ENTRY_COLUMN)->data( Qt::EditRole);
792 if (!entry.isNull()) {
793 SMESH::string_array_var objIds = new SMESH::string_array;
795 objIds[0] = entry.toString().toStdString().c_str();
796 myEnfVertexWdg->SetObjects(objIds);
799 myEnfVertexWdg->SetObject(GEOM::GEOM_Object::_nil());
801 QVariant group = myEnforcedTableWidget->item(row,ENF_VER_GROUP_COLUMN)->data( Qt::EditRole);
802 if (!x.isNull()/* && entry.isNull()*/) {
803 // disconnect( myXCoord, SIGNAL( textChanged(const QString &)), this, SLOT( onSelectEnforcedVertex() ) );
804 disconnect( myXCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
805 disconnect( myYCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
806 disconnect( myZCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
807 myXCoord->SetValue(x.toDouble());
808 myYCoord->SetValue(y.toDouble());
809 myZCoord->SetValue(z.toDouble());
810 connect( myXCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
811 connect( myYCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
812 connect( myZCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
815 mySizeValue->SetValue(size.toDouble());
817 if (!group.isNull() && (!x.isNull() || !entry.isNull()))
818 myGroupName->setText(group.toString());
821 QList<QString> entryList;
822 for (int i = 0; i < items.size(); ++i) {
824 row = myEnforcedTableWidget->row(item);
825 entry = myEnforcedTableWidget->item(row,ENF_VER_ENTRY_COLUMN)->data( Qt::EditRole);
827 entryList << entry.toString();
829 if (entryList.size() > 0) {
830 SMESH::string_array_var objIds = new SMESH::string_array;
831 objIds->length(entryList.size());
832 for (int i = 0; i < entryList.size() ; i++)
833 objIds[i] = entryList.at(i).toStdString().c_str();
834 myEnfVertexWdg->SetObjects(objIds);
837 myEnfVertexWdg->SetObject(GEOM::GEOM_Object::_nil());
842 myEnfVertexWdg->SetObject(GEOM::GEOM_Object::_nil());
844 connect( myEnfVertexWdg, SIGNAL( contentModified()), this, SLOT( onSelectEnforcedVertex() ) );
845 GHS3DPluginGUI_HypothesisCreator* that = (GHS3DPluginGUI_HypothesisCreator*)this;
846 that->checkVertexIsDefined();
849 /** GHS3DPluginGUI_HypothesisCreator::addEnforcedMesh( meshName, geomEntry, elemType, size, groupName)
850 This method adds in the tree widget an enforced mesh from mesh, submesh or group with optionally size and and groupName.
852 void GHS3DPluginGUI_HypothesisCreator::addEnforcedMesh(std::string name, std::string entry, int elementType, std::string groupName)
854 MESSAGE("addEnforcedMesh(\"" << name << ", \"" << entry << "\", " << elementType << ", \"" << groupName << "\")");
855 bool okToCreate = true;
856 QString itemEntry = "";
857 int itemElementType = 0;
858 int rowCount = myEnforcedMeshTableWidget->rowCount();
859 bool allColumns = true;
860 for (int row = 0;row<rowCount;row++) {
861 for (int col = 0 ; col < ENF_MESH_NB_COLUMNS ; col++) {
862 MESSAGE("col: " << col);
863 if (col == ENF_MESH_CONSTRAINT_COLUMN){
864 if (qobject_cast<QComboBox*>(myEnforcedMeshTableWidget->cellWidget(row, col)) == 0) {
866 MESSAGE("allColumns = false");
870 else if (myEnforcedMeshTableWidget->item(row, col) == 0) {
872 MESSAGE("allColumns = false");
875 if (col == ENF_MESH_CONSTRAINT_COLUMN) {
876 QComboBox* itemComboBox = qobject_cast<QComboBox*>(myEnforcedMeshTableWidget->cellWidget(row, col));
877 itemElementType = itemComboBox->currentIndex();
878 MESSAGE("itemElementType: " << itemElementType);
880 else if (col == ENF_MESH_ENTRY_COLUMN)
881 itemEntry = myEnforcedMeshTableWidget->item(row, col)->data(Qt::EditRole).toString();
887 if (itemEntry == QString(entry.c_str()) && itemElementType == elementType) {
888 // // update group name
889 // if (itemGroupName.toStdString() != groupName) {
890 // MESSAGE("Group is updated from \"" << itemGroupName.toStdString() << "\" to \"" << groupName << "\"");
891 // myEnforcedMeshTableWidget->item(row, ENF_MESH_GROUP_COLUMN)->setData( Qt::EditRole, QVariant(groupName.c_str()));
902 MESSAGE("Creation of enforced mesh");
904 myEnforcedMeshTableWidget->setRowCount(rowCount+1);
905 myEnforcedMeshTableWidget->setSortingEnabled(false);
907 for (int col=0;col<ENF_MESH_NB_COLUMNS;col++) {
908 MESSAGE("Column: " << col);
909 if (col == ENF_MESH_CONSTRAINT_COLUMN) {
910 QComboBox* comboBox = new QComboBox();
911 QPalette pal = comboBox->palette();
912 pal.setColor(QPalette::Button, Qt::white);
913 comboBox->setPalette(pal);
914 comboBox->insertItems(0,myEnfMeshConstraintLabels);
915 comboBox->setEditable(false);
916 comboBox->setCurrentIndex(elementType);
917 MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << comboBox->currentText().toStdString());
918 myEnforcedMeshTableWidget->setCellWidget(rowCount,col,comboBox);
921 QTableWidgetItem* item = new QTableWidgetItem();
922 item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled);
924 case ENF_MESH_NAME_COLUMN:
925 item->setData( 0, name.c_str() );
926 item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled);
927 MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
928 myEnforcedMeshTableWidget->setItem(rowCount,col,item);
930 case ENF_MESH_ENTRY_COLUMN:
931 item->setData( 0, entry.c_str() );
932 item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled);
933 MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
934 myEnforcedMeshTableWidget->setItem(rowCount,col,item);
936 case ENF_MESH_GROUP_COLUMN:
937 item->setData( 0, groupName.c_str() );
938 MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
939 myEnforcedMeshTableWidget->setItem(rowCount,col,item);
948 // connect( myEnforcedMeshTableWidget,SIGNAL( itemChanged(QTableWidgetItem *)), this, SLOT( updateEnforcedVertexValues(QTableWidgetItem *) ) );
950 myEnforcedMeshTableWidget->setSortingEnabled(true);
951 // myEnforcedTableWidget->setCurrentItem(myEnforcedTableWidget->item(rowCount,ENF_VER_NAME_COLUMN));
952 // updateEnforcedVertexValues(myEnforcedTableWidget->item(rowCount,ENF_VER_NAME_COLUMN));
956 /** GHS3DPluginGUI_HypothesisCreator::addEnforcedVertex( x, y, z, size, vertexName, geomEntry, groupName)
957 This method adds in the tree widget an enforced vertex with given size and coords (x,y,z) or GEOM vertex or compound and with optionally groupName.
959 void GHS3DPluginGUI_HypothesisCreator::addEnforcedVertex(double x, double y, double z, double size, std::string vertexName, std::string geomEntry, std::string groupName, bool isCompound)
961 MESSAGE("addEnforcedVertex(" << x << ", " << y << ", " << z << ", " << size << ", \"" << vertexName << ", \"" << geomEntry << "\", \"" << groupName << "\", " << isCompound << ")");
962 myEnforcedTableWidget->disconnect(SIGNAL( itemChanged(QTableWidgetItem *)));
963 bool okToCreate = true;
964 double itemX,itemY,itemZ,itemSize = 0;
965 QString itemEntry, itemGroupName = QString("");
966 // bool itemIsCompound;
967 int rowCount = myEnforcedTableWidget->rowCount();
970 for (int row = 0;row<rowCount;row++) {
972 for (int col = 0 ; col < ENF_VER_NB_COLUMNS ; col++) {
973 if (myEnforcedTableWidget->item(row, col) == 0) {
978 data = myEnforcedTableWidget->item(row, col)->data(Qt::EditRole);
979 if (!data.isNull()) {
981 case ENF_VER_GROUP_COLUMN:
982 itemGroupName = data.toString();
984 case ENF_VER_ENTRY_COLUMN:
985 itemEntry = data.toString();
987 // case ENF_VER_COMPOUND_COLUMN:
988 // itemIsCompound = data.toBool();
990 case ENF_VER_X_COLUMN:
991 itemX = data.toDouble();
993 case ENF_VER_Y_COLUMN:
994 itemY = data.toDouble();
996 case ENF_VER_Z_COLUMN:
997 itemZ = data.toDouble();
999 case ENF_VER_SIZE_COLUMN:
1000 itemSize = data.toDouble();
1012 if (( !isCompound && ((itemX == x) && (itemY == y) && (itemZ == z))) ||
1013 ( !itemEntry.isEmpty() && ( itemEntry == geomEntry.c_str() )))
1016 if (itemSize != size) {
1017 MESSAGE("Size is updated from \"" << itemSize << "\" to \"" << size << "\"");
1018 myEnforcedTableWidget->item(row, ENF_VER_SIZE_COLUMN)->setData( Qt::EditRole, QVariant(size));
1020 // update group name
1021 if (itemGroupName.toStdString() != groupName) {
1022 MESSAGE("Group is updated from \"" << itemGroupName.toStdString() << "\" to \"" << groupName << "\"");
1023 myEnforcedTableWidget->item(row, ENF_VER_GROUP_COLUMN)->setData( Qt::EditRole, QVariant(groupName.c_str()));
1030 if (geomEntry.empty()) {
1031 MESSAGE("Vertex with coords " << x << ", " << y << ", " << z << " already exist: dont create again");
1034 MESSAGE("Vertex with entry " << geomEntry << " already exist: dont create again");
1039 if (geomEntry.empty()) {
1040 MESSAGE("Vertex with coords " << x << ", " << y << ", " << z<< " is created");
1043 MESSAGE("Vertex with geom entry " << geomEntry << " is created");
1048 QString myVertexName;
1049 while(indexRef != vertexIndex) {
1050 indexRef = vertexIndex;
1051 if (vertexName.empty())
1052 myVertexName = QString("Vertex #%1").arg(vertexIndex);
1054 myVertexName = QString(vertexName.c_str());
1056 for (int row = 0;row<rowCount;row++) {
1057 QString name = myEnforcedTableWidget->item(row,ENF_VER_NAME_COLUMN)->data(Qt::EditRole).toString();
1058 if (myVertexName == name) {
1065 MESSAGE("myVertexName is \"" << myVertexName.toStdString() << "\"");
1066 myEnforcedTableWidget->setRowCount(rowCount+1);
1067 myEnforcedTableWidget->setSortingEnabled(false);
1068 for (int col=0;col<ENF_VER_NB_COLUMNS;col++) {
1069 MESSAGE("Column: " << col);
1070 QTableWidgetItem* item = new QTableWidgetItem();
1071 item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled);
1073 case ENF_VER_NAME_COLUMN:
1074 item->setData( Qt::EditRole, myVertexName );
1075 if (!geomEntry.empty()) {
1077 item->setIcon(QIcon(iconCompound.scaled(iconCompound.size()*0.7,Qt::KeepAspectRatio,Qt::SmoothTransformation)));
1079 item->setIcon(QIcon(iconVertex.scaled(iconVertex.size()*0.7,Qt::KeepAspectRatio,Qt::SmoothTransformation)));
1082 case ENF_VER_X_COLUMN:
1084 item->setData( 0, QVariant(x) );
1086 case ENF_VER_Y_COLUMN:
1088 item->setData( 0, QVariant(y) );
1090 case ENF_VER_Z_COLUMN:
1092 item->setData( 0, QVariant(z) );
1094 case ENF_VER_SIZE_COLUMN:
1095 item->setData( 0, QVariant(size) );
1097 case ENF_VER_ENTRY_COLUMN:
1098 if (!geomEntry.empty())
1099 item->setData( 0, QString(geomEntry.c_str()) );
1101 case ENF_VER_COMPOUND_COLUMN:
1102 item->setData( Qt::CheckStateRole, isCompound );
1103 item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable);
1105 case ENF_VER_GROUP_COLUMN:
1106 if (!groupName.empty())
1107 item->setData( 0, QString(groupName.c_str()) );
1113 MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
1114 myEnforcedTableWidget->setItem(rowCount,col,item);
1118 connect( myEnforcedTableWidget,SIGNAL( itemChanged(QTableWidgetItem *)), this, SLOT( updateEnforcedVertexValues(QTableWidgetItem *) ) );
1120 myEnforcedTableWidget->setSortingEnabled(true);
1121 // myEnforcedTableWidget->setCurrentItem(myEnforcedTableWidget->item(rowCount,ENF_VER_NAME_COLUMN));
1122 updateEnforcedVertexValues(myEnforcedTableWidget->item(rowCount,ENF_VER_NAME_COLUMN));
1125 /** GHS3DPluginGUI_HypothesisCreator::onAddEnforcedMesh()
1126 This method is called when a item is added into the enforced meshes tree widget
1128 void GHS3DPluginGUI_HypothesisCreator::onAddEnforcedMesh()
1130 MESSAGE("GHS3DPluginGUI_HypothesisCreator::onAddEnforcedMesh()");
1132 GHS3DPluginGUI_HypothesisCreator* that = (GHS3DPluginGUI_HypothesisCreator*)this;
1134 that->getGeomSelectionTool()->selectionMgr()->clearFilters();
1135 myEnfMeshWdg->deactivateSelection();
1137 for (int column = 0; column < myEnforcedMeshTableWidget->columnCount(); ++column)
1138 myEnforcedMeshTableWidget->resizeColumnToContents(column);
1141 int selEnfMeshes = myEnfMeshWdg->NbObjects();
1142 if (selEnfMeshes == 0)
1145 std::string groupName = myMeshGroupName->text().toStdString();
1146 // if (myGlobalGroupName->isChecked())
1147 // groupName = myGlobalGroupName->text().toStdString();
1149 if (boost::trim_copy(groupName).empty())
1153 int elementType = myEnfMeshConstraint->currentIndex();
1156 _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
1157 _PTR(SObject) aSObj; //SMESH::SMESH_IDSource::_nil;
1158 QString meshEntry = myEnfMeshWdg->GetValue();
1159 MESSAGE("myEnfMeshWdg->GetValue()" << meshEntry.toStdString());
1161 if (selEnfMeshes == 1)
1163 MESSAGE("1 SMESH object selected");
1164 // myEnfMesh = myEnfMeshWdg->GetObject< SMESH::SMESH_IDSource >();
1165 // std::string entry = myEnfMeshWdg->GetValue();
1166 aSObj = aStudy->FindObjectID(meshEntry.toStdString().c_str());
1167 CORBA::Object_var anObj = SMESH::SObjectToObject(aSObj,aStudy);
1168 if (!CORBA::is_nil(anObj)) {
1169 // SMESH::SMESH_IDSource_var theSource = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( aSObj );
1170 addEnforcedMesh( aSObj->GetName(), aSObj->GetID(), elementType, groupName);
1175 MESSAGE(selEnfMeshes << " SMESH objects selected");
1176 QStringList meshEntries = meshEntry.split(" ", QString::SkipEmptyParts);
1177 QStringListIterator meshEntriesIt (meshEntries);
1178 while (meshEntriesIt.hasNext()) {
1179 aSObj = aStudy->FindObjectID(meshEntriesIt.next().toStdString().c_str());
1180 CORBA::Object_var anObj = SMESH::SObjectToObject(aSObj,aStudy);
1181 if (!CORBA::is_nil(anObj)) {
1182 // SMESH::SMESH_IDSource_var theSource = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( aSObj );
1183 addEnforcedMesh( aSObj->GetName(), aSObj->GetID(), elementType, groupName);
1188 myEnfVertexWdg->SetObject(SMESH::SMESH_IDSource::_nil());
1190 for (int column = 0; column < myEnforcedMeshTableWidget->columnCount(); ++column)
1191 myEnforcedMeshTableWidget->resizeColumnToContents(column);
1195 /** GHS3DPluginGUI_HypothesisCreator::onAddEnforcedVertex()
1196 This method is called when a item is added into the enforced vertices tree widget
1198 void GHS3DPluginGUI_HypothesisCreator::onAddEnforcedVertex()
1200 MESSAGE("GHS3DPluginGUI_HypothesisCreator::onAddEnforcedVertex()");
1202 GHS3DPluginGUI_HypothesisCreator* that = (GHS3DPluginGUI_HypothesisCreator*)this;
1204 that->getGeomSelectionTool()->selectionMgr()->clearFilters();
1205 myEnfVertexWdg->deactivateSelection();
1207 for (int column = 0; column < myEnforcedTableWidget->columnCount(); ++column)
1208 myEnforcedTableWidget->resizeColumnToContents(column);
1211 int selEnfVertex = myEnfVertexWdg->NbObjects();
1212 bool coordsEmpty = (myXCoord->text().isEmpty()) || (myYCoord->text().isEmpty()) || (myZCoord->text().isEmpty());
1213 if ((selEnfVertex == 0) && coordsEmpty)
1216 std::string groupName = myGroupName->text().toStdString();
1217 // if (myGlobalGroupName->isChecked())
1218 // groupName = myGlobalGroupName->text().toStdString();
1220 if (boost::trim_copy(groupName).empty())
1223 double size = mySizeValue->GetValue();
1225 if (selEnfVertex <= 1)
1227 MESSAGE("0 or 1 GEOM object selected");
1228 double x = 0, y = 0, z=0;
1229 if (myXCoord->GetString() != "") {
1230 x = myXCoord->GetValue();
1231 y = myYCoord->GetValue();
1232 z = myZCoord->GetValue();
1234 if (selEnfVertex == 1) {
1235 MESSAGE("1 GEOM object selected");
1236 myEnfVertex = myEnfVertexWdg->GetObject< GEOM::GEOM_Object >();
1237 std::string entry = "", name = "";
1238 bool isCompound = false;
1239 if ( !myEnfVertex->_is_nil() ) {
1240 entry = SMESH::toStdStr( myEnfVertex->GetStudyEntry() );
1241 name = SMESH::toStdStr( myEnfVertex->GetName() );
1242 isCompound = ( myEnfVertex->GetShapeType() == GEOM::COMPOUND );
1244 addEnforcedVertex(x, y, z, size, name, entry, groupName, isCompound);
1247 MESSAGE("0 GEOM object selected");
1248 MESSAGE("Coords: ("<<x<<","<<y<<","<<z<<")");
1249 addEnforcedVertex(x, y, z, size, "", "", groupName);
1254 if ( CORBA::is_nil(getGeomEngine()))
1257 GEOM::GEOM_IMeasureOperations_var measureOp = getGeomEngine()->GetIMeasureOperations( that->getGeomSelectionTool()->getMyStudy()->StudyId() );
1258 if (CORBA::is_nil(measureOp))
1261 CORBA::Double x = 0, y = 0,z = 0;
1262 for (int j = 0 ; j < selEnfVertex ; j++)
1264 myEnfVertex = myEnfVertexWdg->GetObject< GEOM::GEOM_Object >(j);
1265 if (myEnfVertex == GEOM::GEOM_Object::_nil())
1267 if (myEnfVertex->GetShapeType() == GEOM::VERTEX) {
1268 measureOp->PointCoordinates (myEnfVertex, x, y, z);
1269 if ( measureOp->IsDone() )
1270 addEnforcedVertex(x, y, z, size, myEnfVertex->GetName(),myEnfVertex->GetStudyEntry(), groupName);
1271 } else if (myEnfVertex->GetShapeType() == GEOM::COMPOUND) {
1272 addEnforcedVertex(0., 0., 0., size, myEnfVertex->GetName(),myEnfVertex->GetStudyEntry(), groupName, true);
1277 myEnfVertexWdg->SetObject(GEOM::GEOM_Object::_nil());
1279 for (int column = 0; column < myEnforcedTableWidget->columnCount(); ++column)
1280 myEnforcedTableWidget->resizeColumnToContents(column);
1283 /** GHS3DPluginGUI_HypothesisCreator::onRemoveEnforcedMesh()
1284 This method is called when a item is removed from the enforced meshes tree widget
1286 void GHS3DPluginGUI_HypothesisCreator::onRemoveEnforcedMesh()
1288 QList<int> selectedRows;
1289 QList<QTableWidgetItem *> selectedItems = myEnforcedMeshTableWidget->selectedItems();
1290 QTableWidgetItem* item;
1292 foreach( item, selectedItems ) {
1294 if (!selectedRows.contains( row ) )
1295 selectedRows.append(row);
1298 qSort( selectedRows );
1299 QListIterator<int> it( selectedRows );
1301 while ( it.hasPrevious() ) {
1302 row = it.previous();
1303 MESSAGE("delete row #"<< row);
1304 myEnforcedMeshTableWidget->removeRow(row );
1307 myEnforcedMeshTableWidget->selectionModel()->clearSelection();
1310 /** GHS3DPluginGUI_HypothesisCreator::onRemoveEnforcedVertex()
1311 This method is called when a item is removed from the enforced vertices tree widget
1313 void GHS3DPluginGUI_HypothesisCreator::onRemoveEnforcedVertex()
1315 QList<int> selectedRows;
1316 QList<QTableWidgetItem *> selectedItems = myEnforcedTableWidget->selectedItems();
1317 QTableWidgetItem* item;
1319 foreach( item, selectedItems ) {
1321 if (!selectedRows.contains( row ) )
1322 selectedRows.append(row);
1325 qSort( selectedRows );
1326 QListIterator<int> it( selectedRows );
1328 while ( it.hasPrevious() ) {
1329 row = it.previous();
1330 MESSAGE("delete row #"<< row);
1331 myEnforcedTableWidget->removeRow(row );
1334 myEnforcedTableWidget->selectionModel()->clearSelection();
1337 void GHS3DPluginGUI_HypothesisCreator::onToMeshHoles(bool isOn)
1339 // myToMakeGroupsOfDomains->setEnabled( isOn );
1341 // myToMakeGroupsOfDomains->setChecked( false );
1344 void GHS3DPluginGUI_HypothesisCreator::onDirBtnClicked()
1346 QString dir = SUIT_FileDlg::getExistingDirectory( dlg(), myAdvWidget->workingDirectoryLineEdit->text(), QString() );
1347 if ( !dir.isEmpty() )
1348 myAdvWidget->workingDirectoryLineEdit->setText( dir );
1351 void GHS3DPluginGUI_HypothesisCreator::updateWidgets()
1353 //myToMakeGroupsOfDomains->setEnabled( myToMeshHolesCheck->isChecked() );
1354 myAdvWidget->maxMemorySpin->setEnabled( myAdvWidget->maxMemoryCheck->isChecked() );
1355 myAdvWidget->initialMemoryCheck->setEnabled( !myAdvWidget->boundaryRecoveryCheck->isChecked() );
1356 myAdvWidget->initialMemorySpin->setEnabled( myAdvWidget->initialMemoryCheck->isChecked() && !myAdvWidget->boundaryRecoveryCheck->isChecked() );
1357 myOptimizationLevelCombo->setEnabled( !myAdvWidget->boundaryRecoveryCheck->isChecked() );
1358 if ( sender() == myAdvWidget->logInFileCheck ||
1359 sender() == myAdvWidget->keepWorkingFilesCheck )
1361 bool logFileRemovable = myAdvWidget->logInFileCheck->isChecked() &&
1362 !myAdvWidget->keepWorkingFilesCheck->isChecked();
1364 myAdvWidget->removeLogOnSuccessCheck->setEnabled( logFileRemovable );
1368 bool GHS3DPluginGUI_HypothesisCreator::checkParams(QString& msg) const
1370 MESSAGE("GHS3DPluginGUI_HypothesisCreator::checkParams");
1372 if ( !QFileInfo( myAdvWidget->workingDirectoryLineEdit->text().trimmed() ).isWritable() ) {
1373 SUIT_MessageBox::warning( dlg(),
1374 tr( "SMESH_WRN_WARNING" ),
1375 tr( "GHS3D_PERMISSION_DENIED" ) );
1382 void GHS3DPluginGUI_HypothesisCreator::retrieveParams() const
1384 MESSAGE("GHS3DPluginGUI_HypothesisCreator::retrieveParams");
1385 GHS3DPluginGUI_HypothesisCreator* that = (GHS3DPluginGUI_HypothesisCreator*)this;
1386 GHS3DHypothesisData data;
1387 readParamsFromHypo( data );
1390 myName->setText( data.myName );
1392 myToMeshHolesCheck ->setChecked ( data.myToMeshHoles );
1393 myToMakeGroupsOfDomains ->setChecked ( data.myToMakeGroupsOfDomains );
1394 myOptimizationLevelCombo ->setCurrentIndex( data.myOptimizationLevel );
1395 myAdvWidget->maxMemoryCheck ->setChecked ( data.myMaximumMemory > 0 );
1396 myAdvWidget->maxMemorySpin ->setValue ( qMax( (int)data.myMaximumMemory,
1397 myAdvWidget->maxMemorySpin->minimum() ));
1398 myAdvWidget->initialMemoryCheck ->setChecked ( data.myInitialMemory > 0 );
1399 myAdvWidget->initialMemorySpin ->setValue ( qMax( (int)data.myInitialMemory,
1400 myAdvWidget->initialMemorySpin->minimum() ));
1401 myAdvWidget->workingDirectoryLineEdit ->setText ( data.myWorkingDir );
1402 myAdvWidget->keepWorkingFilesCheck ->setChecked ( data.myKeepFiles );
1403 myAdvWidget->verboseLevelSpin ->setValue ( data.myVerboseLevel );
1404 myAdvWidget->createNewNodesCheck ->setChecked ( data.myToCreateNewNodes );
1405 myAdvWidget->removeInitialCentralPointCheck ->setChecked ( data.myRemoveInitialCentralPoint );
1406 myAdvWidget->boundaryRecoveryCheck ->setChecked ( data.myBoundaryRecovery );
1407 myAdvWidget->FEMCorrectionCheck ->setChecked ( data.myFEMCorrection );
1408 myAdvWidget->gradationSpinBox ->setValue ( data.myGradation );
1409 myAdvWidget->advOptionTable ->SetCustomOptions( data.myTextOption );
1410 myAdvWidget->logInFileCheck ->setChecked ( !data.myLogInStandardOutput );
1411 myAdvWidget->removeLogOnSuccessCheck ->setChecked ( data.myRemoveLogOnSuccess );
1413 TEnfVertexList::const_iterator it;
1415 myEnforcedTableWidget->clearContents();
1416 myEnforcedTableWidget->setSortingEnabled(false);
1417 myEnforcedTableWidget->disconnect(SIGNAL( itemChanged(QTableWidgetItem *)));
1418 for(it = data.myEnforcedVertices.begin() ; it != data.myEnforcedVertices.end(); it++ )
1420 TEnfVertex* enfVertex = (*it);
1421 myEnforcedTableWidget->setRowCount(rowCount+1);
1423 for (int col=0;col<ENF_VER_NB_COLUMNS;col++) {
1424 MESSAGE("Column: " << col);
1425 // MESSAGE("enfVertex->isCompound: " << enfVertex->isCompound);
1426 QTableWidgetItem* item = new QTableWidgetItem();
1427 item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled);
1429 case ENF_VER_NAME_COLUMN:
1430 item->setData( 0, enfVertex->name.c_str() );
1431 if (!enfVertex->geomEntry.empty()) {
1432 if (enfVertex->isCompound)
1433 item->setIcon(QIcon(iconCompound.scaled(iconCompound.size()*0.7,Qt::KeepAspectRatio,Qt::SmoothTransformation)));
1435 item->setIcon(QIcon(iconVertex.scaled(iconVertex.size()*0.7,Qt::KeepAspectRatio,Qt::SmoothTransformation)));
1437 MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
1440 case ENF_VER_X_COLUMN:
1441 if (!enfVertex->isCompound) {
1442 item->setData( 0, enfVertex->coords.at(0) );
1443 MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
1446 case ENF_VER_Y_COLUMN:
1447 if (!enfVertex->isCompound) {
1448 item->setData( 0, enfVertex->coords.at(1) );
1449 MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
1452 case ENF_VER_Z_COLUMN:
1453 if (!enfVertex->isCompound) {
1454 item->setData( 0, enfVertex->coords.at(2) );
1455 MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
1458 case ENF_VER_SIZE_COLUMN:
1459 item->setData( 0, enfVertex->size );
1460 MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
1462 case ENF_VER_ENTRY_COLUMN:
1463 item->setData( 0, enfVertex->geomEntry.c_str() );
1464 MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
1466 case ENF_VER_COMPOUND_COLUMN:
1467 item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable);
1468 item->setData( Qt::CheckStateRole, enfVertex->isCompound );
1469 MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << enfVertex->isCompound);
1471 case ENF_VER_GROUP_COLUMN:
1472 item->setData( 0, enfVertex->groupName.c_str() );
1473 MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
1479 myEnforcedTableWidget->setItem(rowCount,col,item);
1482 that->updateEnforcedVertexValues(myEnforcedTableWidget->item(rowCount,ENF_VER_NAME_COLUMN));
1486 connect( myEnforcedTableWidget,SIGNAL( itemChanged(QTableWidgetItem *)), this, SLOT( updateEnforcedVertexValues(QTableWidgetItem *) ) );
1487 myEnforcedTableWidget->setSortingEnabled(true);
1489 for (int column = 0; column < myEnforcedTableWidget->columnCount(); ++column)
1490 myEnforcedTableWidget->resizeColumnToContents(column);
1492 // Update Enforced meshes QTableWidget
1493 TEnfMeshList::const_iterator itMesh;
1495 myEnforcedMeshTableWidget->clearContents();
1496 myEnforcedMeshTableWidget->setSortingEnabled(false);
1497 // myEnforcedMeshTableWidget->disconnect(SIGNAL( itemChanged(QTableWidgetItem *)));
1498 for(itMesh = data.myEnforcedMeshes.begin() ; itMesh != data.myEnforcedMeshes.end(); itMesh++ )
1500 TEnfMesh* enfMesh = (*itMesh);
1501 myEnforcedMeshTableWidget->setRowCount(rowCount+1);
1503 for (int col=0;col<ENF_MESH_NB_COLUMNS;col++) {
1504 MESSAGE("Column: " << col);
1505 if (col == ENF_MESH_CONSTRAINT_COLUMN) {
1506 QComboBox* comboBox = new QComboBox();
1507 QPalette pal = comboBox->palette();
1508 pal.setColor(QPalette::Button, Qt::white);
1509 comboBox->setPalette(pal);
1510 comboBox->insertItems(0,myEnfMeshConstraintLabels);
1511 comboBox->setEditable(false);
1512 comboBox->setCurrentIndex(enfMesh->elementType);
1513 MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << comboBox->currentText().toStdString());
1514 myEnforcedMeshTableWidget->setCellWidget(rowCount,col,comboBox);
1517 QTableWidgetItem* item = new QTableWidgetItem();
1518 item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled);
1520 case ENF_MESH_NAME_COLUMN:
1521 item->setData( 0, enfMesh->name.c_str() );
1522 item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled);
1523 MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
1524 myEnforcedMeshTableWidget->setItem(rowCount,col,item);
1526 case ENF_MESH_ENTRY_COLUMN:
1527 item->setData( 0, enfMesh->entry.c_str() );
1528 item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled);
1529 MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
1530 myEnforcedMeshTableWidget->setItem(rowCount,col,item);
1532 case ENF_MESH_GROUP_COLUMN:
1533 item->setData( 0, enfMesh->groupName.c_str() );
1534 MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
1535 myEnforcedMeshTableWidget->setItem(rowCount,col,item);
1542 // myEnforcedMeshTableWidget->setItem(rowCount,col,item);
1545 // that->updateEnforcedVertexValues(myEnforcedTableWidget->item(rowCount,ENF_VER_NAME_COLUMN));
1549 // connect( myEnforcedMeshTableWidget,SIGNAL( itemChanged(QTableWidgetItem *)), this, SLOT( updateEnforcedVertexValues(QTableWidgetItem *) ) );
1550 myEnforcedMeshTableWidget->setSortingEnabled(true);
1552 for (int col=0;col<ENF_MESH_NB_COLUMNS;col++)
1553 myEnforcedMeshTableWidget->resizeColumnToContents(col);
1555 that->updateWidgets();
1556 that->checkVertexIsDefined();
1559 QString GHS3DPluginGUI_HypothesisCreator::storeParams() const
1561 MESSAGE("GHS3DPluginGUI_HypothesisCreator::storeParams");
1562 GHS3DHypothesisData data;
1563 readParamsFromWidgets( data );
1564 storeParamsToHypo( data );
1566 QString valStr = "";
1568 if ( !data.myBoundaryRecovery )
1569 valStr = " --components " + data.myToMeshHoles ? "all" : "outside_components" ;
1571 if ( data.myOptimizationLevel >= 0 && data.myOptimizationLevel < 5 && !data.myBoundaryRecovery) {
1572 const char* level[] = { "none" , "light" , "standard" , "standard+" , "strong" };
1573 valStr += " --optimisation_level ";
1574 valStr += level[ data.myOptimizationLevel ];
1576 if ( data.myMaximumMemory > 0 ) {
1577 valStr += " --max_memory ";
1578 valStr += QString::number( data.myMaximumMemory );
1580 if ( data.myInitialMemory > 0 && !data.myBoundaryRecovery ) {
1581 valStr += " --automatic_memory ";
1582 valStr += QString::number( data.myInitialMemory );
1584 valStr += " --verbose ";
1585 valStr += QString::number( data.myVerboseLevel );
1587 if ( !data.myToCreateNewNodes )
1588 valStr += " --no_internal_points";
1590 if ( data.myRemoveInitialCentralPoint )
1591 valStr += " --no_initial_central_point";
1593 if ( data.myBoundaryRecovery )
1596 if ( data.myFEMCorrection )
1599 if ( data.myGradation != 1.05 ) {
1600 valStr += " -Dcpropa=";
1601 valStr += QString::number( data.myGradation );
1605 valStr += data.myTextOption;
1607 // valStr += " #BEGIN ENFORCED VERTICES#";
1608 // // Add size map parameters storage
1609 // for (int i=0 ; i<mySmpModel->rowCount() ; i++) {
1611 // double x = mySmpModel->data(mySmpModel->index(i,ENF_VER_X_COLUMN)).toDouble();
1612 // double y = mySmpModel->data(mySmpModel->index(i,ENF_VER_Y_COLUMN)).toDouble();
1613 // double z = mySmpModel->data(mySmpModel->index(i,ENF_VER_Z_COLUMN)).toDouble();
1614 // double size = mySmpModel->data(mySmpModel->index(i,ENF_VER_SIZE_COLUMN)).toDouble();
1615 // valStr += QString::number( x );
1617 // valStr += QString::number( y );
1619 // valStr += QString::number( z );
1621 // valStr += QString::number( size );
1622 // if (i!=mySmpModel->rowCount()-1)
1625 // valStr += " #END ENFORCED VERTICES#";
1626 // MESSAGE(valStr.toStdString());
1630 bool GHS3DPluginGUI_HypothesisCreator::readParamsFromHypo( GHS3DHypothesisData& h_data ) const
1632 MESSAGE("GHS3DPluginGUI_HypothesisCreator::readParamsFromHypo");
1633 GHS3DPlugin::GHS3DPlugin_Hypothesis_var h =
1634 GHS3DPlugin::GHS3DPlugin_Hypothesis::_narrow( initParamsHypothesis() );
1636 HypothesisData* data = SMESH::GetHypothesisData( hypType() );
1637 h_data.myName = isCreation() && data ? hypName() : "";
1639 h_data.myToMeshHoles = h->GetToMeshHoles();
1640 h_data.myToMakeGroupsOfDomains = /*h->GetToMeshHoles() &&*/ h->GetToMakeGroupsOfDomains();
1641 h_data.myMaximumMemory = h->GetMaximumMemory();
1642 h_data.myInitialMemory = h->GetInitialMemory();
1643 h_data.myInitialMemory = h->GetInitialMemory();
1644 h_data.myOptimizationLevel = h->GetOptimizationLevel();
1645 h_data.myKeepFiles = h->GetKeepFiles();
1646 h_data.myWorkingDir = h->GetWorkingDirectory();
1647 h_data.myVerboseLevel = h->GetVerboseLevel();
1648 h_data.myToCreateNewNodes = h->GetToCreateNewNodes();
1649 h_data.myRemoveInitialCentralPoint = h->GetToRemoveCentralPoint();
1650 h_data.myBoundaryRecovery = h->GetToUseBoundaryRecoveryVersion();
1651 h_data.myFEMCorrection = h->GetFEMCorrection();
1652 h_data.myGradation = h->GetGradation();
1653 h_data.myTextOption = h->GetAdvancedOption();
1654 h_data.myLogInStandardOutput = h->GetStandardOutputLog();
1655 h_data.myRemoveLogOnSuccess = h->GetRemoveLogOnSuccess();
1657 GHS3DPlugin::GHS3DEnforcedVertexList_var vertices = h->GetEnforcedVertices();
1658 MESSAGE("vertices->length(): " << vertices->length());
1659 h_data.myEnforcedVertices.clear();
1660 for (CORBA::ULong i=0 ; i<vertices->length() ; i++) {
1661 TEnfVertex* myVertex = new TEnfVertex();
1662 myVertex->name = CORBA::string_dup(vertices[i].name.in());
1663 myVertex->geomEntry = CORBA::string_dup(vertices[i].geomEntry.in());
1664 myVertex->groupName = CORBA::string_dup(vertices[i].groupName.in());
1665 myVertex->size = vertices[i].size;
1666 myVertex->isCompound = vertices[i].isCompound;
1667 if (vertices[i].coords.length()) {
1668 for (CORBA::ULong c = 0; c < vertices[i].coords.length() ; c++)
1669 myVertex->coords.push_back(vertices[i].coords[c]);
1670 MESSAGE("Add enforced vertex ("<< myVertex->coords.at(0) << ","<< myVertex->coords.at(1) << ","<< myVertex->coords.at(2) << ") ="<< myVertex->size);
1672 h_data.myEnforcedVertices.insert(myVertex);
1675 GHS3DPlugin::GHS3DEnforcedMeshList_var enfMeshes = h->GetEnforcedMeshes();
1676 MESSAGE("enfMeshes->length(): " << enfMeshes->length());
1677 h_data.myEnforcedMeshes.clear();
1678 for (CORBA::ULong i=0 ; i<enfMeshes->length() ; i++) {
1679 TEnfMesh* myEnfMesh = new TEnfMesh();
1680 myEnfMesh->name = CORBA::string_dup(enfMeshes[i].name.in());
1681 myEnfMesh->entry = CORBA::string_dup(enfMeshes[i].entry.in());
1682 myEnfMesh->groupName = CORBA::string_dup(enfMeshes[i].groupName.in());
1683 switch (enfMeshes[i].elementType) {
1685 myEnfMesh->elementType = 0;
1688 myEnfMesh->elementType = 1;
1691 myEnfMesh->elementType = 2;
1696 // myEnfMesh->elementType = enfMeshes[i].elementType;
1697 h_data.myEnforcedMeshes.insert(myEnfMesh);
1702 bool GHS3DPluginGUI_HypothesisCreator::storeParamsToHypo( const GHS3DHypothesisData& h_data ) const
1704 MESSAGE("GHS3DPluginGUI_HypothesisCreator::storeParamsToHypo");
1705 GHS3DPlugin::GHS3DPlugin_Hypothesis_var h =
1706 GHS3DPlugin::GHS3DPlugin_Hypothesis::_narrow( hypothesis() );
1712 SMESH::SetName( SMESH::FindSObject( h ), h_data.myName.toLatin1().constData() );
1714 if ( h->GetToMeshHoles() != h_data.myToMeshHoles ) // avoid duplication of DumpPython commands
1715 h->SetToMeshHoles ( h_data.myToMeshHoles );
1716 if ( h->GetToMakeGroupsOfDomains() != h_data.myToMakeGroupsOfDomains )
1717 h->SetToMakeGroupsOfDomains( h_data.myToMakeGroupsOfDomains );
1718 if ( h->GetMaximumMemory() != h_data.myMaximumMemory )
1719 h->SetMaximumMemory ( h_data.myMaximumMemory );
1720 if ( h->GetInitialMemory() != h_data.myInitialMemory )
1721 h->SetInitialMemory ( h_data.myInitialMemory );
1722 if ( h->GetInitialMemory() != h_data.myInitialMemory )
1723 h->SetInitialMemory ( h_data.myInitialMemory );
1724 if ( h->GetOptimizationLevel() != h_data.myOptimizationLevel )
1725 h->SetOptimizationLevel( h_data.myOptimizationLevel );
1726 if ( h->GetKeepFiles() != h_data.myKeepFiles )
1727 h->SetKeepFiles ( h_data.myKeepFiles );
1728 if ( h->GetWorkingDirectory() != h_data.myWorkingDir )
1729 h->SetWorkingDirectory ( h_data.myWorkingDir.toLatin1().constData() );
1730 if ( h->GetVerboseLevel() != h_data.myVerboseLevel )
1731 h->SetVerboseLevel ( h_data.myVerboseLevel );
1732 if ( h->GetToCreateNewNodes() != h_data.myToCreateNewNodes )
1733 h->SetToCreateNewNodes( h_data.myToCreateNewNodes );
1734 if ( h->GetToRemoveCentralPoint() != h_data.myRemoveInitialCentralPoint )
1735 h->SetToRemoveCentralPoint( h_data.myRemoveInitialCentralPoint );
1736 if ( h->GetToUseBoundaryRecoveryVersion() != h_data.myBoundaryRecovery )
1737 h->SetToUseBoundaryRecoveryVersion( h_data.myBoundaryRecovery );
1738 if ( h->GetFEMCorrection() != h_data.myFEMCorrection )
1739 h->SetFEMCorrection ( h_data.myFEMCorrection );
1740 if ( h->GetGradation() != h_data.myGradation )
1741 h->SetGradation ( h_data.myGradation );
1742 if ( h->GetAdvancedOption() != h_data.myTextOption )
1743 h->SetAdvancedOption ( h_data.myTextOption.toLatin1().constData() );
1744 if ( h->GetStandardOutputLog() != h_data.myLogInStandardOutput )
1745 h->SetStandardOutputLog( h_data.myLogInStandardOutput );
1746 if ( h->GetRemoveLogOnSuccess() != h_data.myRemoveLogOnSuccess )
1747 h->SetRemoveLogOnSuccess( h_data.myRemoveLogOnSuccess );
1749 // Enforced vertices
1750 int nbVertex = (int) h_data.myEnforcedVertices.size();
1751 GHS3DPlugin::GHS3DEnforcedVertexList_var vertexHyp = h->GetEnforcedVertices();
1752 int nbVertexHyp = vertexHyp->length();
1754 MESSAGE("Store params for size maps: " << nbVertex << " enforced vertices");
1755 MESSAGE("h->GetEnforcedVertices()->length(): " << nbVertexHyp);
1757 // 1. Clear all enforced vertices in hypothesis
1758 // 2. Add new enforced vertex according to h_data
1759 if ( nbVertexHyp > 0)
1760 h->ClearEnforcedVertices();
1762 TEnfVertexList::const_iterator it;
1763 double x = 0, y = 0, z = 0;
1764 for(it = h_data.myEnforcedVertices.begin() ; it != h_data.myEnforcedVertices.end(); it++ ) {
1765 TEnfVertex* enfVertex = (*it);
1767 if (enfVertex->coords.size()) {
1768 x = enfVertex->coords.at(0);
1769 y = enfVertex->coords.at(1);
1770 z = enfVertex->coords.at(2);
1772 ok = h->p_SetEnforcedVertex( enfVertex->size, x, y, z, enfVertex->name.c_str(), enfVertex->geomEntry.c_str(), enfVertex->groupName.c_str(), enfVertex->isCompound);
1776 int nbEnfMeshes = (int) h_data.myEnforcedMeshes.size();
1777 GHS3DPlugin::GHS3DEnforcedMeshList_var enfMeshListHyp = h->GetEnforcedMeshes();
1778 int nbEnfMeshListHyp = enfMeshListHyp->length();
1780 MESSAGE("Store params for size maps: " << nbEnfMeshes << " enforced meshes");
1781 MESSAGE("h->GetEnforcedMeshes()->length(): " << nbEnfMeshListHyp);
1783 // 1. Clear all enforced vertices in hypothesis
1784 // 2. Add new enforced vertex according to h_data
1785 if ( nbEnfMeshListHyp > 0)
1786 h->ClearEnforcedMeshes();
1788 TEnfMeshList::const_iterator itEnfMesh;
1790 _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
1792 for(itEnfMesh = h_data.myEnforcedMeshes.begin() ; itEnfMesh != h_data.myEnforcedMeshes.end(); itEnfMesh++ ) {
1793 TEnfMesh* enfMesh = (*itEnfMesh);
1795 _PTR(SObject) aSObj = aStudy->FindObjectID(enfMesh->entry.c_str());
1796 SMESH::SMESH_IDSource_var theSource = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( aSObj );
1798 MESSAGE("enfMesh->elementType: " << enfMesh->elementType);
1799 SMESH::ElementType elementType;
1800 switch(enfMesh->elementType) {
1802 elementType = SMESH::NODE;
1805 elementType = SMESH::EDGE;
1808 elementType = SMESH::FACE;
1814 std::cout << "h->p_SetEnforcedMesh(theSource, "<< elementType <<", \""<< enfMesh->name << "\", \"" << enfMesh->groupName.c_str() <<"\")"<<std::endl;
1815 ok = h->p_SetEnforcedMesh(theSource, elementType, enfMesh->name.c_str(), enfMesh->groupName.c_str());
1818 // catch(const std::exception& ex) {
1819 // std::cout << "Exception: " << ex.what() << std::endl;
1822 catch ( const SALOME::SALOME_Exception& ex )
1824 SalomeApp_Tools::QtCatchCorbaException( ex );
1830 bool GHS3DPluginGUI_HypothesisCreator::readParamsFromWidgets( GHS3DHypothesisData& h_data ) const
1832 MESSAGE("GHS3DPluginGUI_HypothesisCreator::readParamsFromWidgets");
1833 h_data.myName = myName ? myName->text() : "";
1834 h_data.myToMeshHoles = myToMeshHolesCheck->isChecked();
1835 h_data.myToMakeGroupsOfDomains = myToMakeGroupsOfDomains->isChecked();
1836 h_data.myMaximumMemory = myAdvWidget->maxMemoryCheck->isChecked() ? myAdvWidget->maxMemorySpin->value() : -1;
1837 h_data.myInitialMemory = myAdvWidget->initialMemoryCheck->isChecked() ? myAdvWidget->initialMemorySpin->value() : -1;
1838 h_data.myOptimizationLevel = myOptimizationLevelCombo->currentIndex();
1839 h_data.myKeepFiles = myAdvWidget->keepWorkingFilesCheck->isChecked();
1840 h_data.myWorkingDir = myAdvWidget->workingDirectoryLineEdit->text().trimmed();
1841 h_data.myVerboseLevel = myAdvWidget->verboseLevelSpin->value();
1842 h_data.myToCreateNewNodes = myAdvWidget->createNewNodesCheck->isChecked();
1843 h_data.myRemoveInitialCentralPoint = myAdvWidget->removeInitialCentralPointCheck->isChecked();
1844 h_data.myBoundaryRecovery = myAdvWidget->boundaryRecoveryCheck->isChecked();
1845 h_data.myFEMCorrection = myAdvWidget->FEMCorrectionCheck->isChecked();
1846 h_data.myGradation = myAdvWidget->gradationSpinBox->value();
1847 h_data.myTextOption = myAdvWidget->advOptionTable->GetCustomOptions();
1848 h_data.myLogInStandardOutput = !myAdvWidget->logInFileCheck->isChecked();
1849 h_data.myRemoveLogOnSuccess = myAdvWidget->removeLogOnSuccessCheck->isChecked();
1851 // Enforced vertices
1852 h_data.myEnforcedVertices.clear();
1853 QVariant valueX, valueY, valueZ;
1854 for (int row=0 ; row<myEnforcedTableWidget->rowCount() ; row++) {
1856 TEnfVertex *myVertex = new TEnfVertex();
1857 myVertex->name = myEnforcedTableWidget->item(row,ENF_VER_NAME_COLUMN)->data(Qt::EditRole).toString().toStdString();
1858 MESSAGE("Add new enforced vertex \"" << myVertex->name << "\"" );
1859 myVertex->geomEntry = myEnforcedTableWidget->item(row,ENF_VER_ENTRY_COLUMN)->data(Qt::EditRole).toString().toStdString();
1860 if (myVertex->geomEntry.size())
1861 MESSAGE("Geom entry is \"" << myVertex->geomEntry << "\"" );
1862 myVertex->groupName = myEnforcedTableWidget->item(row,ENF_VER_GROUP_COLUMN)->data(Qt::EditRole).toString().toStdString();
1863 if (myVertex->groupName.size())
1864 MESSAGE("Group name is \"" << myVertex->groupName << "\"" );
1865 valueX = myEnforcedTableWidget->item(row,ENF_VER_X_COLUMN)->data(Qt::EditRole);
1866 valueY = myEnforcedTableWidget->item(row,ENF_VER_Y_COLUMN)->data(Qt::EditRole);
1867 valueZ = myEnforcedTableWidget->item(row,ENF_VER_Z_COLUMN)->data(Qt::EditRole);
1868 if (!valueX.isNull() && !valueY.isNull() && !valueZ.isNull()) {
1869 myVertex->coords.push_back(valueX.toDouble());
1870 myVertex->coords.push_back(valueY.toDouble());
1871 myVertex->coords.push_back(valueZ.toDouble());
1872 MESSAGE("Coords are (" << myVertex->coords.at(0) << ", "
1873 << myVertex->coords.at(1) << ", "
1874 << myVertex->coords.at(2) << ")");
1876 myVertex->size = myEnforcedTableWidget->item(row,ENF_VER_SIZE_COLUMN)->data(Qt::EditRole).toDouble();
1877 MESSAGE("Size is " << myVertex->size);
1878 myVertex->isCompound = myEnforcedTableWidget->item(row,ENF_VER_COMPOUND_COLUMN)->data(Qt::CheckStateRole).toBool();
1879 MESSAGE("Is compound ? " << myVertex->isCompound);
1880 h_data.myEnforcedVertices.insert(myVertex);
1884 h_data.myEnforcedMeshes.clear();
1886 for (int row=0 ; row<myEnforcedMeshTableWidget->rowCount() ; row++) {
1888 TEnfMesh *myEnfMesh = new TEnfMesh();
1889 myEnfMesh->name = myEnforcedMeshTableWidget->item(row,ENF_MESH_NAME_COLUMN)->data(Qt::EditRole).toString().toStdString();
1890 MESSAGE("Add new enforced mesh \"" << myEnfMesh->name << "\"" );
1891 myEnfMesh->entry = myEnforcedMeshTableWidget->item(row,ENF_MESH_ENTRY_COLUMN)->data(Qt::EditRole).toString().toStdString();
1892 MESSAGE("Entry is \"" << myEnfMesh->entry << "\"" );
1893 myEnfMesh->groupName = myEnforcedMeshTableWidget->item(row,ENF_MESH_GROUP_COLUMN)->data(Qt::EditRole).toString().toStdString();
1894 MESSAGE("Group name is \"" << myEnfMesh->groupName << "\"" );
1895 QComboBox* combo = qobject_cast<QComboBox*>(myEnforcedMeshTableWidget->cellWidget(row,ENF_MESH_CONSTRAINT_COLUMN));
1896 myEnfMesh->elementType = combo->currentIndex();
1897 MESSAGE("Element type: " << myEnfMesh->elementType);
1898 h_data.myEnforcedMeshes.insert(myEnfMesh);
1899 std::cout << "h_data.myEnforcedMeshes.size(): " << h_data.myEnforcedMeshes.size() << std::endl;
1905 QString GHS3DPluginGUI_HypothesisCreator::caption() const
1907 return tr( "GHS3D_TITLE" );
1910 QPixmap GHS3DPluginGUI_HypothesisCreator::icon() const
1912 return SUIT_Session::session()->resourceMgr()->loadPixmap( "GHS3DPlugin", tr( "ICON_DLG_GHS3D_PARAMETERS" ) );
1915 QString GHS3DPluginGUI_HypothesisCreator::type() const
1917 return tr( "GHS3D_HYPOTHESIS" );
1920 QString GHS3DPluginGUI_HypothesisCreator::helpPage() const
1922 return "ghs3d_hypo_page.html";