1 // Copyright (C) 2004-2019 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"
28 #include "GHS3DPlugin_OptimizerHypothesis.hxx"
30 #include <GeometryGUI.h>
32 #include <SMESHGUI_Utils.h>
33 #include <SMESHGUI_SpinBox.h>
34 #include <SMESHGUI_HypothesesUtils.h>
35 #include <SMESH_NumberFilter.hxx>
36 #include <SMESH_TypeFilter.hxx>
37 #include <StdMeshersGUI_ObjectReferenceParamWdg.h>
39 #include <LightApp_SelectionMgr.h>
40 #include <SUIT_FileDlg.h>
41 #include <SUIT_MessageBox.h>
42 #include <SUIT_ResourceMgr.h>
43 #include <SUIT_Session.h>
44 #include <SalomeApp_IntSpinBox.h>
45 #include <SalomeApp_Tools.h>
46 #include <SalomeApp_TypeFilter.h>
52 #include <QGridLayout>
54 #include <QHeaderView>
58 #include <QPushButton>
61 #include <QTableWidget>
62 #include <QTableWidgetItem>
63 #include <QVBoxLayout>
66 #include <utilities.h>
70 QComboBox* getModeCombo( QWidget* parent, bool isPThreadCombo )
72 QComboBox* combo = new QComboBox( parent );
75 combo->insertItem((int) GHS3DPlugin_OptimizerHypothesis::SAFE, QObject::tr("MODE_SAFE"));
76 combo->insertItem((int) GHS3DPlugin_OptimizerHypothesis::AGGRESSIVE, QObject::tr("MODE_AGGRESSIVE"));
77 combo->insertItem((int) GHS3DPlugin_OptimizerHypothesis::NONE, QObject::tr("MODE_NONE"));
81 combo->insertItem((int) GHS3DPlugin_OptimizerHypothesis::NO, QObject::tr("MODE_NO"));
82 combo->insertItem((int) GHS3DPlugin_OptimizerHypothesis::YES, QObject::tr("MODE_YES"));
83 combo->insertItem((int) GHS3DPlugin_OptimizerHypothesis::ONLY, QObject::tr("MODE_ONLY"));
90 // BEGIN EnforcedVertexTableWidgetDelegate
93 EnforcedVertexTableWidgetDelegate::EnforcedVertexTableWidgetDelegate(QObject *parent)
94 : QItemDelegate(parent)
98 QWidget *EnforcedVertexTableWidgetDelegate::createEditor(QWidget *parent,
99 const QStyleOptionViewItem & option ,
100 const QModelIndex & index ) const
102 QModelIndex father = index.parent();
103 QString entry = father.child(index.row(), ENF_VER_ENTRY_COLUMN).data().toString();
105 if (index.column() == ENF_VER_X_COLUMN ||
106 index.column() == ENF_VER_Y_COLUMN ||
107 index.column() == ENF_VER_Z_COLUMN ||
108 index.column() == ENF_VER_SIZE_COLUMN) {
109 SMESHGUI_SpinBox *editor = new SMESHGUI_SpinBox(parent);
110 if (index.column() == ENF_VER_SIZE_COLUMN)
111 editor->RangeStepAndValidator(0, COORD_MAX, 10.0, "length_precision");
113 editor->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
114 editor->setReadOnly(!entry.isEmpty());
115 editor->setDisabled(!entry.isEmpty());
118 else if (index.column() == ENF_VER_GROUP_COLUMN ||
119 index.column() == ENF_VER_NAME_COLUMN) {
121 QLineEdit *editor = new QLineEdit(parent);
122 if (index.column() != ENF_VER_GROUP_COLUMN) {
123 editor->setReadOnly(!entry.isEmpty());
124 editor->setDisabled(!entry.isEmpty());
128 return QItemDelegate::createEditor(parent, option, index);
131 void EnforcedVertexTableWidgetDelegate::setEditorData(QWidget *editor,
132 const QModelIndex &index) const
134 if (index.column() == ENF_VER_X_COLUMN ||
135 index.column() == ENF_VER_Y_COLUMN ||
136 index.column() == ENF_VER_Z_COLUMN ||
137 index.column() == ENF_VER_SIZE_COLUMN)
139 SMESHGUI_SpinBox *lineEdit = qobject_cast<SMESHGUI_SpinBox*>(editor);
140 lineEdit->SetValue(index.data().toDouble());
142 else if (index.column() == ENF_VER_COMPOUND_COLUMN) {
143 QCheckBox *checkBox = qobject_cast<QCheckBox*>(editor);
144 checkBox->setChecked(index.data().toBool());
147 QItemDelegate::setEditorData(editor, index);
151 void EnforcedVertexTableWidgetDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
152 const QModelIndex &index) const
154 QModelIndex parent = index.parent();
156 QString entry = parent.child(index.row(), ENF_VER_ENTRY_COLUMN).data().toString();
157 bool isCompound = parent.child(index.row(), ENF_VER_COMPOUND_COLUMN).data(Qt::CheckStateRole).toBool();
159 if (index.column() == ENF_VER_X_COLUMN ||
160 index.column() == ENF_VER_Y_COLUMN ||
161 index.column() == ENF_VER_Z_COLUMN) {
162 SMESHGUI_SpinBox *lineEdit = qobject_cast<SMESHGUI_SpinBox*>(editor);
163 if (!isCompound && !vertexExists(model, index, lineEdit->GetString()))
164 model->setData(index, lineEdit->GetValue(), Qt::EditRole);
166 else if (index.column() == ENF_VER_SIZE_COLUMN)
168 SMESHGUI_SpinBox *lineEdit = qobject_cast<SMESHGUI_SpinBox*>(editor);
169 const double newsize = lineEdit->GetValue();
171 model->setData(index, newsize, Qt::EditRole);
173 else if (index.column() == ENF_VER_NAME_COLUMN) {
174 QLineEdit *lineEdit = qobject_cast<QLineEdit*>(editor);
175 QString value = lineEdit->text();
176 if (entry.isEmpty() && !vertexExists(model, index, value))
177 model->setData(index, value, Qt::EditRole);
179 else if (index.column() == ENF_VER_ENTRY_COLUMN) {
180 QLineEdit *lineEdit = qobject_cast<QLineEdit*>(editor);
181 QString value = lineEdit->text();
182 if (! vertexExists(model, index, value))
183 model->setData(index, value, Qt::EditRole);
185 else if (index.column() == ENF_VER_COMPOUND_COLUMN) {
186 QCheckBox *checkBox = qobject_cast<QCheckBox*>(editor);
187 model->setData(index, checkBox->isChecked(), Qt::CheckStateRole);
190 QItemDelegate::setModelData(editor, model, index);
194 void EnforcedVertexTableWidgetDelegate::updateEditorGeometry(QWidget *editor,
195 const QStyleOptionViewItem &option,
196 const QModelIndex &/* index */) const
198 editor->setGeometry(option.rect);
201 bool EnforcedVertexTableWidgetDelegate::vertexExists(QAbstractItemModel *model,
202 const QModelIndex &index,
206 QModelIndex parent = index.parent();
207 int row = index.row();
208 int col = index.column();
210 if (parent.isValid() && !value.isEmpty()) {
211 if (col == ENF_VER_X_COLUMN || col == ENF_VER_Y_COLUMN || col == ENF_VER_Z_COLUMN) {
213 if (col == ENF_VER_X_COLUMN) {
214 x = value.toDouble();
215 y = parent.child(row, ENF_VER_Y_COLUMN).data().toDouble();
216 z = parent.child(row, ENF_VER_Z_COLUMN).data().toDouble();
218 if (col == ENF_VER_Y_COLUMN) {
219 y = value.toDouble();
220 x = parent.child(row, ENF_VER_X_COLUMN).data().toDouble();
221 z = parent.child(row, ENF_VER_Z_COLUMN).data().toDouble();
223 if (col == ENF_VER_Z_COLUMN) {
224 z = value.toDouble();
225 x = parent.child(row, ENF_VER_X_COLUMN).data().toDouble();
226 y = parent.child(row, ENF_VER_Y_COLUMN).data().toDouble();
228 int nbChildren = model->rowCount(parent);
229 for (int i = 0 ; i < nbChildren ; i++) {
231 double childX = parent.child(i, ENF_VER_X_COLUMN).data().toDouble();
232 double childY = parent.child(i, ENF_VER_Y_COLUMN).data().toDouble();
233 double childZ = parent.child(i, ENF_VER_Z_COLUMN).data().toDouble();
234 if ((childX == x) && (childY == y) && (childZ == z)) {
241 else if (col == ENF_VER_NAME_COLUMN) {
242 QString name = parent.child(row, ENF_VER_NAME_COLUMN).data().toString();
252 // END EnforcedVertexTableWidgetDelegate
256 // BEGIN EnforcedMeshTableWidgetDelegate
259 EnforcedMeshTableWidgetDelegate::EnforcedMeshTableWidgetDelegate(QObject *parent)
260 : QItemDelegate(parent)
264 QWidget *EnforcedMeshTableWidgetDelegate::createEditor(QWidget *parent,
265 const QStyleOptionViewItem & option ,
266 const QModelIndex & index ) const
268 return QItemDelegate::createEditor(parent, option, index);
271 void EnforcedMeshTableWidgetDelegate::setEditorData(QWidget *editor,
272 const QModelIndex &index) const
274 QItemDelegate::setEditorData(editor, index);
277 void EnforcedMeshTableWidgetDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
278 const QModelIndex &index) const
280 QItemDelegate::setModelData(editor, model, index);
284 void EnforcedMeshTableWidgetDelegate::updateEditorGeometry(QWidget *editor,
285 const QStyleOptionViewItem &option,
286 const QModelIndex &/* index */) const
288 editor->setGeometry(option.rect);
292 // END EnforcedMeshTableWidgetDelegate
296 GHS3DPluginGUI_HypothesisCreator::GHS3DPluginGUI_HypothesisCreator( const QString& theHypType )
297 : SMESHGUI_GenericHypothesisCreator( theHypType ),
299 myOptimizationLevelCombo(0),
306 myUseProximityGroup(0),
307 myNbProximityLayers(0),
308 myToMakeGroupsOfDomains(0),
309 myToMeshHolesCheck(0),
310 myOptimizationCombo(0),
311 mySplitOverConstrainedCombo(0),
312 myPThreadsModeCombo(0),
313 myNumberOfThreadsSpin(0),
314 mySmoothOffSliversCheck(0),
315 myCreateNewNodesCheck(0)
317 GeomToolSelected = NULL;
318 GeomToolSelected = getGeomSelectionTool();
320 iconVertex = QPixmap(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_OBJBROWSER_VERTEX")));
321 iconCompound = QPixmap(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_OBJBROWSER_COMPOUND")));
322 // mySelectionMgr = SMESH::GetSelectionMgr(SMESHGUI::GetSMESHGUI());
323 myEnfMeshConstraintLabels << tr( "GHS3D_ENF_MESH_CONSTRAINT_NODE" ) << tr( "GHS3D_ENF_MESH_CONSTRAINT_EDGE" ) << tr("GHS3D_ENF_MESH_CONSTRAINT_FACE");
326 GHS3DPluginGUI_HypothesisCreator::~GHS3DPluginGUI_HypothesisCreator()
328 GHS3DPluginGUI_HypothesisCreator* that = (GHS3DPluginGUI_HypothesisCreator*)this;
329 that->getGeomSelectionTool()->selectionMgr()->clearFilters();
330 myEnfMeshWdg->deactivateSelection();
334 * \brief {Get or create the geom selection tool for study}
336 GeomSelectionTools* GHS3DPluginGUI_HypothesisCreator::getGeomSelectionTool()
338 GHS3DPluginGUI_HypothesisCreator* that = (GHS3DPluginGUI_HypothesisCreator*)this;
339 if (that->GeomToolSelected == NULL) {
340 that->GeomToolSelected = new GeomSelectionTools();
342 return that->GeomToolSelected;
345 GEOM::GEOM_Gen_var GHS3DPluginGUI_HypothesisCreator::getGeomEngine()
347 return GeometryGUI::GetGeomGen();
350 bool GHS3DPluginGUI_HypothesisCreator::isOptimization() const
352 return ( hypType() == GHS3DPlugin_OptimizerHypothesis::GetHypType() );
355 QFrame* GHS3DPluginGUI_HypothesisCreator::buildFrame()
357 QFrame* fr = new QFrame( 0 );
358 QVBoxLayout* lay = new QVBoxLayout( fr );
360 lay->setSpacing( 0 );
363 QTabWidget* tab = new QTabWidget( fr );
364 tab->setTabShape( QTabWidget::Rounded );
365 tab->setTabPosition( QTabWidget::North );
366 lay->addWidget( tab );
369 myStdGroup = new QWidget();
370 QGridLayout* aStdLayout = new QGridLayout( myStdGroup );
371 aStdLayout->setSpacing( 6 );
372 aStdLayout->setMargin( 11 );
377 aStdLayout->addWidget( new QLabel( tr( "SMESH_NAME" ), myStdGroup ), row, 0, 1, 1 );
378 myName = new QLineEdit( myStdGroup );
379 aStdLayout->addWidget( myName, row++, 1, 1, 1 );
381 if ( isOptimization() )
383 myToMeshHolesCheck = new QCheckBox( tr( "GHS3D_TO_MESH_HOLES" ), myStdGroup );
384 aStdLayout->addWidget( myToMeshHolesCheck, row, 0, 1, 1 );
385 myToMakeGroupsOfDomains = new QCheckBox( tr( "GHS3D_TO_MAKE_DOMAIN_GROUPS" ), myStdGroup );
386 aStdLayout->addWidget( myToMakeGroupsOfDomains, row++, 1, 1, 1 );
388 QLabel* optimizationLbl = new QLabel( tr( "GHS3D_OPTIMIZATION" ), myStdGroup );
389 aStdLayout->addWidget( optimizationLbl, row, 0, 1, 1 );
390 myOptimizationCombo = getModeCombo( myStdGroup, false );
391 aStdLayout->addWidget( myOptimizationCombo, row++, 1, 1, 1 );
393 QLabel* optimizatiolLevelLbl = new QLabel( tr( "GHS3D_OPTIMIZATIOL_LEVEL" ), myStdGroup );
394 aStdLayout->addWidget( optimizatiolLevelLbl, row, 0, 1, 1 );
395 myOptimizationLevelCombo = new QComboBox( myStdGroup );
396 aStdLayout->addWidget( myOptimizationLevelCombo, row++, 1, 1, 1 );
398 QLabel* splitOverconstrainedLbl = new QLabel( tr("GHS3D_SPLIT_OVERCONSTRAINED"), myStdGroup );
399 aStdLayout->addWidget( splitOverconstrainedLbl, row, 0, 1, 1 );
400 mySplitOverConstrainedCombo = getModeCombo( myStdGroup, false );
401 aStdLayout->addWidget( mySplitOverConstrainedCombo, row++, 1, 1, 1 );
403 QLabel* pthreadsModeLbl = new QLabel( tr( "GHS3D_PTHREADS_MODE" ), myStdGroup);
404 aStdLayout->addWidget( pthreadsModeLbl, row, 0, 1, 1 );
405 myPThreadsModeCombo = getModeCombo( myStdGroup, true );
406 aStdLayout->addWidget( myPThreadsModeCombo, row++, 1, 1, 1 );
408 QLabel* nbThreadsLbl = new QLabel( tr( "GHS3D_NB_THREADS" ), myStdGroup);
409 aStdLayout->addWidget( nbThreadsLbl, row, 0, 1, 1 );
410 myNumberOfThreadsSpin = new SalomeApp_IntSpinBox( 0, 1000, 1, myStdGroup );
411 aStdLayout->addWidget( myNumberOfThreadsSpin, row++, 1, 1, 1 );
413 mySmoothOffSliversCheck = new QCheckBox( tr( "GHS3D_SMOOTH_OFF_SLIVERS" ), myStdGroup );
414 aStdLayout->addWidget( mySmoothOffSliversCheck, row, 0, 1, 1 );
415 myCreateNewNodesCheck = new QCheckBox( tr( "TO_ADD_NODES" ), myStdGroup );
416 aStdLayout->addWidget( myCreateNewNodesCheck, row++, 1, 1, 1 );
422 QGroupBox* mainGroup = new QGroupBox( tr("GHS3D_MAIN_PARAMS"), myStdGroup );
423 QLabel* optimizatiolLevelLbl = new QLabel( tr( "GHS3D_OPTIMIZATIOL_LEVEL" ), mainGroup );
424 myOptimizationLevelCombo = new QComboBox( mainGroup );
425 myMinSizeCheck = new QCheckBox( tr("GHS3D_MIN_SIZE"), mainGroup );
426 myMaxSizeCheck = new QCheckBox( tr("GHS3D_MAX_SIZE"), mainGroup );
427 myMinSizeSpin = new SMESHGUI_SpinBox( mainGroup );
428 myMaxSizeSpin = new SMESHGUI_SpinBox( mainGroup );
429 myMinSizeCheck->setChecked( false );
430 myMaxSizeCheck->setChecked( false );
431 myMinSizeSpin->RangeStepAndValidator(0, COORD_MAX, 10.0, "length_precision");
432 myMaxSizeSpin->RangeStepAndValidator(0, COORD_MAX, 10.0, "length_precision");
433 myMinSizeSpin->setEnabled( false );
434 myMaxSizeSpin->setEnabled( false );
435 connect( myMinSizeCheck, SIGNAL( toggled(bool)), myMinSizeSpin, SLOT( setEnabled(bool)));
436 connect( myMaxSizeCheck, SIGNAL( toggled(bool)), myMaxSizeSpin, SLOT( setEnabled(bool)));
438 QGridLayout* mainLayout = new QGridLayout( mainGroup );
439 mainLayout->setSpacing( 6 );
440 mainLayout->setMargin( 11 );
441 mainLayout->addWidget( optimizatiolLevelLbl, 0, 0, 1, 1 );
442 mainLayout->addWidget( myOptimizationLevelCombo, 0, 1, 1, 1 );
443 mainLayout->addWidget( myMinSizeCheck, 1, 0, 1, 1 );
444 mainLayout->addWidget( myMinSizeSpin, 1, 1, 1, 1 );
445 mainLayout->addWidget( myMaxSizeCheck, 2, 0, 1, 1 );
446 mainLayout->addWidget( myMaxSizeSpin, 2, 1, 1, 1 );
450 QGroupBox* proxyGroup = new QGroupBox( tr("GHS3D_VOLUME_PROXIMITY"), myStdGroup );
451 myGradationCheck = new QCheckBox( tr("GHS3D_GRADATION"), proxyGroup );
452 myGradationSpin = new SMESHGUI_SpinBox( proxyGroup );
453 myGradationSpin->RangeStepAndValidator(1, COORD_MAX, 0.1, "length_precision");
454 myGradationSpin->setEnabled( false );
455 connect( myGradationCheck, SIGNAL( toggled(bool)), myGradationSpin, SLOT( setEnabled(bool)));
456 myUseProximityGroup = new QGroupBox( tr("GHS3D_USE_VOLUME_PROXIMITY"), proxyGroup );
457 myUseProximityGroup->setCheckable( true );
458 //myUseProximityGroup->setChecked( false );
459 QLabel* nbProximityLayersLabel = new QLabel( tr("GHS3D_NB_LAYERS"));
460 myNbProximityLayers = new SalomeApp_IntSpinBox( 2, 1e6, 1, proxyGroup );
462 QHBoxLayout* useProxyLayout = new QHBoxLayout( myUseProximityGroup );
463 useProxyLayout->addWidget( nbProximityLayersLabel );
464 useProxyLayout->addWidget( myNbProximityLayers );
466 QGridLayout* proxyLayout = new QGridLayout( proxyGroup );
467 proxyLayout->setSpacing( 6 );
468 proxyLayout->setMargin( 11 );
469 proxyLayout->addWidget( myGradationCheck, 0, 0, 1, 1 );
470 proxyLayout->addWidget( myGradationSpin, 0, 1, 1, 1 );
471 proxyLayout->addWidget( myUseProximityGroup, 1, 0, 1, 2 );
475 QGroupBox* otherGroup = new QGroupBox( tr("GHS3D_OTHER_PARAMETERS"), myStdGroup );
476 myToMeshHolesCheck = new QCheckBox( tr( "GHS3D_TO_MESH_HOLES" ), otherGroup );
477 myToMakeGroupsOfDomains = new QCheckBox( tr( "GHS3D_TO_MAKE_DOMAIN_GROUPS" ), otherGroup );
479 QGridLayout* otherLayout = new QGridLayout( otherGroup );
480 otherLayout->setSpacing( 6 );
481 otherLayout->setMargin( 11 );
482 otherLayout->addWidget( myToMeshHolesCheck, 0, 0 );
483 otherLayout->addWidget( myToMakeGroupsOfDomains, 1, 0 );
486 aStdLayout->addWidget( mainGroup, row++, 0, 1, 2 );
487 aStdLayout->addWidget( proxyGroup, row++, 0, 1, 2 );
488 aStdLayout->addWidget( otherGroup, row++, 0, 1, 2 );
490 aStdLayout->setRowStretch( row, 10 );
492 myOptimizationLevelCombo->addItems( QStringList()
493 << tr( "LEVEL_NONE" ) << tr( "LEVEL_LIGHT" )
494 << tr( "LEVEL_MEDIUM" ) << tr( "LEVEL_STANDARDPLUS" )
495 << tr( "LEVEL_STRONG" ));
497 // advanced parameters
498 myAdvGroup = new QWidget();
499 QGridLayout* anAdvLayout = new QGridLayout( myAdvGroup );
500 anAdvLayout->setSpacing( 6 );
501 anAdvLayout->setMargin( 11 );
502 myAdvWidget = new GHS3DPluginGUI_AdvWidget(myAdvGroup);
503 anAdvLayout->addWidget( myAdvWidget);
505 myAdvWidget->maxMemoryCheck->setText(tr( "MAX_MEMORY_SIZE" ));
506 myAdvWidget->initialMemoryCheck->setText(tr( "INIT_MEMORY_SIZE" ));
508 myAdvWidget->maxMemorySpin->stepBy(10);
509 myAdvWidget->maxMemorySpin->setValue( 128 );
511 myAdvWidget->initialMemorySpin->stepBy(10);
512 myAdvWidget->initialMemorySpin->setValue( 100 );
514 myAdvWidget->initialMemoryLabel ->setText (tr( "MEGABYTE" ));
515 myAdvWidget->maxMemoryLabel ->setText (tr( "MEGABYTE" ));
517 myAdvWidget->workingDirectoryLabel ->setText (tr( "WORKING_DIR" ));
518 myAdvWidget->workingDirectoryPushButton ->setText (tr( "SELECT_DIR" ));
519 myAdvWidget->keepWorkingFilesCheck ->setText (tr( "KEEP_WORKING_FILES" ));
520 myAdvWidget->verboseLevelLabel ->setText (tr( "VERBOSE_LEVEL" ));
521 myAdvWidget->removeLogOnSuccessCheck ->setText (tr( "REMOVE_LOG_ON_SUCCESS" ));
522 myAdvWidget->logInFileCheck ->setText (tr( "LOG_IN_FILE" ));
524 myAdvWidget->memoryGroupBox ->setTitle(tr( "MEMORY_GROUP_TITLE" ));
525 myAdvWidget->logGroupBox ->setTitle(tr( "LOG_GROUP_TITLE" ));
526 //myAdvWidget->advancedMeshingGroupBox ->setTitle(tr( "ADVANCED_MESHING_GROUP_TITLE" ));
528 // myAdvWidget->createNewNodesCheck ->setText (tr( "TO_ADD_NODES" ));
529 // myAdvWidget->removeInitialCentralPointCheck->setText (tr( "NO_INITIAL_CENTRAL_POINT" ));
530 // myAdvWidget->boundaryRecoveryCheck ->setText (tr( "RECOVERY_VERSION" ));
531 // myAdvWidget->FEMCorrectionCheck ->setText (tr( "FEM_CORRECTION" ));
532 // myAdvWidget->gradationLabel ->setText (tr( "GHS3D_GRADATION" ));
533 // myAdvWidget->gradationSpinBox->RangeStepAndValidator(0.0, 5.0, 0.05, "length_precision");
535 // if ( isOptimization() )
537 // myAdvWidget->createNewNodesCheck->hide();
538 // myAdvWidget->removeInitialCentralPointCheck->hide();
539 // myAdvWidget->boundaryRecoveryCheck->hide();
540 // myAdvWidget->FEMCorrectionCheck->hide();
541 // myAdvWidget->gradationLabel->hide();
542 // myAdvWidget->gradationSpinBox->hide();
545 // Enforced vertices parameters
546 myEnfGroup = new QWidget();
547 QGridLayout* anEnfLayout = new QGridLayout(myEnfGroup);
549 myEnforcedTableWidget = new QTableWidget(myEnfGroup);
550 myEnforcedTableWidget ->setMinimumWidth(300);
551 myEnforcedTableWidget->setRowCount( 0 );
552 myEnforcedTableWidget->setColumnCount( ENF_VER_NB_COLUMNS );
553 myEnforcedTableWidget->setSortingEnabled(true);
554 myEnforcedTableWidget->setHorizontalHeaderLabels
556 << tr( "GHS3D_ENF_NAME_COLUMN" ) << tr( "GHS3D_ENF_VER_X_COLUMN" )
557 << tr( "GHS3D_ENF_VER_Y_COLUMN" ) << tr( "GHS3D_ENF_VER_Z_COLUMN" )
558 << tr( "GHS3D_ENF_SIZE_COLUMN" ) << tr("GHS3D_ENF_ENTRY_COLUMN")
559 << tr("GHS3D_ENF_VER_COMPOUND_COLUMN") << tr( "GHS3D_ENF_GROUP_COLUMN" ));
560 myEnforcedTableWidget->verticalHeader()->hide();
561 myEnforcedTableWidget->horizontalHeader()->setStretchLastSection(true);
562 myEnforcedTableWidget->setAlternatingRowColors(true);
563 myEnforcedTableWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
564 myEnforcedTableWidget->setSelectionBehavior(QAbstractItemView::SelectItems);
565 myEnforcedTableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive);
567 myEnforcedTableWidget->resizeColumnsToContents();
568 myEnforcedTableWidget->hideColumn(ENF_VER_ENTRY_COLUMN);
569 myEnforcedTableWidget->hideColumn(ENF_VER_COMPOUND_COLUMN);
571 myEnforcedTableWidget->setItemDelegate(new EnforcedVertexTableWidgetDelegate());
574 TColStd_MapOfInteger shapeTypes;
575 shapeTypes.Add( TopAbs_VERTEX );
576 shapeTypes.Add( TopAbs_COMPOUND );
578 SMESH_NumberFilter* vertexFilter = new SMESH_NumberFilter("GEOM", TopAbs_SHAPE, 1, shapeTypes);
579 myEnfVertexWdg = new StdMeshersGUI_ObjectReferenceParamWdg( vertexFilter, 0, /*multiSel=*/true);
580 myEnfVertexWdg->SetDefaultText(tr("GHS3D_ENF_SELECT_VERTEX"), "QLineEdit { color: grey }");
582 QLabel* myXCoordLabel = new QLabel( tr( "GHS3D_ENF_VER_X_LABEL" ), myEnfGroup );
583 myXCoord = new SMESHGUI_SpinBox(myEnfGroup);
584 myXCoord->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
585 QLabel* myYCoordLabel = new QLabel( tr( "GHS3D_ENF_VER_Y_LABEL" ), myEnfGroup );
586 myYCoord = new SMESHGUI_SpinBox(myEnfGroup);
587 myYCoord->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
588 QLabel* myZCoordLabel = new QLabel( tr( "GHS3D_ENF_VER_Z_LABEL" ), myEnfGroup );
589 myZCoord = new SMESHGUI_SpinBox(myEnfGroup);
590 myZCoord->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
591 QLabel* mySizeLabel = new QLabel( tr( "GHS3D_ENF_SIZE_LABEL" ), myEnfGroup );
592 mySizeValue = new SMESHGUI_SpinBox(myEnfGroup);
593 mySizeValue->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
595 QLabel* myGroupNameLabel = new QLabel( tr( "GHS3D_ENF_GROUP_LABEL" ), myEnfGroup );
596 myGroupName = new QLineEdit(myEnfGroup);
598 addVertexButton = new QPushButton(tr("GHS3D_ENF_ADD"),myEnfGroup);
599 addVertexButton->setEnabled(false);
600 removeVertexButton = new QPushButton(tr("GHS3D_ENF_REMOVE"),myEnfGroup);
602 anEnfLayout->addWidget(myEnforcedTableWidget, ENF_VER_VERTEX, 0, ENF_VER_NB_LINES, 1);
604 QGridLayout* anEnfLayout2 = new QGridLayout(myEnfGroup);
605 anEnfLayout2->addWidget(myEnfVertexWdg, ENF_VER_VERTEX, 0, 1, 2);
606 anEnfLayout2->addWidget(myXCoordLabel, ENF_VER_X_COORD, 0, 1, 1);
607 anEnfLayout2->addWidget(myXCoord, ENF_VER_X_COORD, 1, 1, 1);
608 anEnfLayout2->addWidget(myYCoordLabel, ENF_VER_Y_COORD, 0, 1, 1);
609 anEnfLayout2->addWidget(myYCoord, ENF_VER_Y_COORD, 1, 1, 1);
610 anEnfLayout2->addWidget(myZCoordLabel, ENF_VER_Z_COORD, 0, 1, 1);
611 anEnfLayout2->addWidget(myZCoord, ENF_VER_Z_COORD, 1, 1, 1);
612 anEnfLayout2->addWidget(mySizeLabel, ENF_VER_SIZE, 0, 1, 1);
613 anEnfLayout2->addWidget(mySizeValue, ENF_VER_SIZE, 1, 1, 1);
614 anEnfLayout2->addWidget(myGroupNameLabel, ENF_VER_GROUP, 0, 1, 1);
615 anEnfLayout2->addWidget(myGroupName, ENF_VER_GROUP, 1, 1, 1);
616 anEnfLayout2->addWidget(addVertexButton, ENF_VER_BTN, 0, 1, 1);
617 anEnfLayout2->addWidget(removeVertexButton, ENF_VER_BTN, 1, 1, 1);
618 anEnfLayout2->setRowStretch(ENF_VER_NB_LINES, 1);
620 anEnfLayout->addLayout(anEnfLayout2, ENF_VER_VERTEX, 1,ENF_VER_NB_LINES, 1);
621 anEnfLayout->setRowStretch(ENF_VER_VERTEX, 10);
624 // Enforced meshes parameters
625 myEnfMeshGroup = new QWidget();
626 QGridLayout* anEnfMeshLayout = new QGridLayout(myEnfMeshGroup);
628 myEnforcedMeshTableWidget = new QTableWidget(myEnfGroup);
629 myEnforcedMeshTableWidget->setRowCount( 0 );
630 myEnforcedMeshTableWidget->setColumnCount( ENF_MESH_NB_COLUMNS );
631 myEnforcedMeshTableWidget->setSortingEnabled(true);
632 myEnforcedMeshTableWidget->verticalHeader()->hide();
633 QStringList enforcedMeshHeaders;
634 enforcedMeshHeaders << tr( "GHS3D_ENF_NAME_COLUMN" )
635 << tr( "GHS3D_ENF_ENTRY_COLUMN" )
636 << tr( "GHS3D_ENF_MESH_CONSTRAINT_COLUMN" )
637 << tr( "GHS3D_ENF_GROUP_COLUMN" );
638 myEnforcedMeshTableWidget->setHorizontalHeaderLabels(enforcedMeshHeaders);
639 myEnforcedMeshTableWidget->horizontalHeader()->setStretchLastSection(true);
640 myEnforcedMeshTableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive);
642 myEnforcedMeshTableWidget->setAlternatingRowColors(true);
643 myEnforcedMeshTableWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
644 myEnforcedMeshTableWidget->setSelectionBehavior(QAbstractItemView::SelectItems);
645 myEnforcedMeshTableWidget->resizeColumnsToContents();
646 myEnforcedMeshTableWidget->hideColumn(ENF_MESH_ENTRY_COLUMN);
648 myEnforcedMeshTableWidget->setItemDelegate(new EnforcedMeshTableWidgetDelegate());
650 myEnfMeshWdg = new StdMeshersGUI_ObjectReferenceParamWdg( SMESH::IDSOURCE, myEnfMeshGroup, /*multiSel=*/true);
651 myEnfMeshWdg->SetDefaultText(tr("GHS3D_ENF_SELECT_MESH"), "QLineEdit { color: grey }");
653 myEnfMeshWdg->AvoidSimultaneousSelection(myEnfVertexWdg);
655 QLabel* myMeshConstraintLabel = new QLabel( tr( "GHS3D_ENF_MESH_CONSTRAINT_LABEL" ), myEnfMeshGroup );
656 myEnfMeshConstraint = new QComboBox(myEnfMeshGroup);
657 myEnfMeshConstraint->insertItems(0,myEnfMeshConstraintLabels);
658 myEnfMeshConstraint->setEditable(false);
659 myEnfMeshConstraint->setCurrentIndex(0);
661 QLabel* myMeshGroupNameLabel = new QLabel( tr( "GHS3D_ENF_GROUP_LABEL" ), myEnfMeshGroup );
662 myMeshGroupName = new QLineEdit(myEnfMeshGroup);
664 addEnfMeshButton = new QPushButton(tr("GHS3D_ENF_ADD"),myEnfMeshGroup);
665 removeEnfMeshButton = new QPushButton(tr("GHS3D_ENF_REMOVE"),myEnfMeshGroup);
667 anEnfMeshLayout->addWidget(myEnforcedMeshTableWidget, ENF_MESH_MESH, 0, ENF_MESH_NB_LINES , 1);
669 QGridLayout* anEnfMeshLayout2 = new QGridLayout(myEnfMeshGroup);
670 anEnfMeshLayout2->addWidget(myEnfMeshWdg, ENF_MESH_MESH, 0, 1, 2);
671 anEnfMeshLayout2->addWidget(myMeshConstraintLabel, ENF_MESH_CONSTRAINT, 0, 1, 1);
672 anEnfMeshLayout2->addWidget(myEnfMeshConstraint, ENF_MESH_CONSTRAINT, 1, 1, 1);
673 anEnfMeshLayout2->addWidget(myMeshGroupNameLabel, ENF_MESH_GROUP, 0, 1, 1);
674 anEnfMeshLayout2->addWidget(myMeshGroupName, ENF_MESH_GROUP, 1, 1, 1);
675 anEnfMeshLayout2->addWidget(addEnfMeshButton, ENF_MESH_BTN, 0, 1, 1);
676 anEnfMeshLayout2->addWidget(removeEnfMeshButton, ENF_MESH_BTN, 1, 1, 1);
677 anEnfMeshLayout2->setRowStretch(ENF_MESH_NB_LINES, 1);
679 anEnfMeshLayout->addLayout(anEnfMeshLayout2, ENF_MESH_MESH, 1, ENF_MESH_NB_LINES, 1);
680 anEnfMeshLayout->setRowStretch(ENF_MESH_MESH, 10);
683 tab->insertTab( STD_TAB, myStdGroup, tr( "SMESH_ARGUMENTS" ) );
684 tab->insertTab( ADV_TAB, myAdvGroup, tr( "GHS3D_ADV_ARGS" ) );
685 if ( !isOptimization() )
687 tab->insertTab( ENF_VER_TAB, myEnfGroup, tr( "GHS3D_ENFORCED_VERTICES" ) );
688 tab->insertTab( ENF_MESH_TAB, myEnfMeshGroup, tr( "GHS3D_ENFORCED_MESHES" ) );
690 tab->setCurrentIndex( STD_TAB );
692 connect( myAdvWidget->maxMemoryCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
693 connect( myAdvWidget->initialMemoryCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
694 connect( myAdvWidget->logInFileCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
695 connect( myAdvWidget->keepWorkingFilesCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
696 connect( myAdvWidget->workingDirectoryPushButton, SIGNAL( clicked() ), this, SLOT( onDirBtnClicked() ) );
697 connect( myAdvWidget->addBtn, SIGNAL( clicked() ), this, SLOT( onAddOption() ) );
699 connect( myEnforcedTableWidget, SIGNAL( itemClicked(QTableWidgetItem *)), this, SLOT( synchronizeCoords() ) );
700 connect( myEnforcedTableWidget, SIGNAL( itemChanged(QTableWidgetItem *)), this, SLOT( updateEnforcedVertexValues(QTableWidgetItem *) ) );
701 connect( myEnforcedTableWidget, SIGNAL( itemSelectionChanged() ), this, SLOT( synchronizeCoords() ) );
702 connect( addVertexButton, SIGNAL( clicked()), this, SLOT( onAddEnforcedVertex() ) );
703 connect( removeVertexButton, SIGNAL( clicked()), this, SLOT( onRemoveEnforcedVertex() ) );
704 connect( myEnfVertexWdg, SIGNAL( contentModified()), this, SLOT( onSelectEnforcedVertex() ) );
705 connect( myEnfVertexWdg, SIGNAL( contentModified()), this, SLOT( checkVertexIsDefined() ) );
706 connect( myXCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
707 connect( myYCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
708 connect( myZCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
709 connect( mySizeValue, SIGNAL( textChanged(const QString&) ), this, SLOT( checkVertexIsDefined() ) );
710 connect( myXCoord, SIGNAL( valueChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
711 connect( myYCoord, SIGNAL( valueChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
712 connect( myZCoord, SIGNAL( valueChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
713 connect( mySizeValue, SIGNAL( valueChanged(const QString&) ), this, SLOT( checkVertexIsDefined() ) );
714 connect( this, SIGNAL( vertexDefined(bool) ), addVertexButton, SLOT( setEnabled(bool) ) );
716 connect( addEnfMeshButton, SIGNAL( clicked()), this, SLOT( onAddEnforcedMesh() ) );
717 connect( removeEnfMeshButton, SIGNAL( clicked()), this, SLOT( onRemoveEnforcedMesh() ) );
723 * This method checks if an enforced vertex is defined;
725 void GHS3DPluginGUI_HypothesisCreator::clearEnfVertexSelection()
727 if (myEnfVertexWdg->NbObjects() != 0) {
728 disconnect( myEnfVertexWdg, SIGNAL( contentModified()), this, SLOT( onSelectEnforcedVertex() ) );
729 disconnect( myEnfVertexWdg, SIGNAL( contentModified()), this, SLOT( checkVertexIsDefined() ) );
730 myEnfVertexWdg->SetObject(GEOM::GEOM_Object::_nil());
731 connect( myEnfVertexWdg, SIGNAL( contentModified()), this, SLOT( onSelectEnforcedVertex() ) );
732 connect( myEnfVertexWdg, SIGNAL( contentModified()), this, SLOT( checkVertexIsDefined() ) );
734 GHS3DPluginGUI_HypothesisCreator* that = (GHS3DPluginGUI_HypothesisCreator*)this;
735 that->checkVertexIsDefined();
739 * This method checks if an enforced vertex is defined;
741 void GHS3DPluginGUI_HypothesisCreator::checkVertexIsDefined()
743 bool enfVertexIsDefined = false;
744 enfVertexIsDefined = (!mySizeValue->GetString().isEmpty() &&
745 (!myEnfVertexWdg->NbObjects() == 0 ||
746 (myEnfVertexWdg->NbObjects() == 0 && !myXCoord->GetString().isEmpty()
747 && !myYCoord->GetString().isEmpty()
748 && !myZCoord->GetString().isEmpty())));
749 emit vertexDefined(enfVertexIsDefined);
753 * This method checks if an enforced mesh is defined;
755 void GHS3DPluginGUI_HypothesisCreator::checkEnfMeshIsDefined()
757 emit enfMeshDefined( myEnfVertexWdg->NbObjects() != 0);
761 * This method resets the content of the X, Y, Z, size and GroupName widgets;
763 void GHS3DPluginGUI_HypothesisCreator::clearEnforcedVertexWidgets()
765 myXCoord->setCleared(true);
766 myYCoord->setCleared(true);
767 myZCoord->setCleared(true);
768 myXCoord->setText("");
769 myYCoord->setText("");
770 myZCoord->setText("");
771 addVertexButton->setEnabled(false);
774 /** GHS3DPluginGUI_HypothesisCreator::updateEnforcedVertexValues(item)
775 This method updates the tooltip of a modified item. The QLineEdit widgets content
776 is synchronized with the coordinates of the enforced vertex clicked in the tree widget.
778 void GHS3DPluginGUI_HypothesisCreator::updateEnforcedVertexValues(QTableWidgetItem* item)
780 int row = myEnforcedTableWidget->row(item);
782 QVariant vertexName = myEnforcedTableWidget->item(row,ENF_VER_NAME_COLUMN)->data(Qt::EditRole);
783 QVariant x = myEnforcedTableWidget->item(row,ENF_VER_X_COLUMN)->data( Qt::EditRole);
784 QVariant y = myEnforcedTableWidget->item(row,ENF_VER_Y_COLUMN)->data( Qt::EditRole);
785 QVariant z = myEnforcedTableWidget->item(row,ENF_VER_Z_COLUMN)->data( Qt::EditRole);
786 QVariant size = myEnforcedTableWidget->item(row,ENF_VER_SIZE_COLUMN)->data( Qt::EditRole);
787 QVariant entry = myEnforcedTableWidget->item(row,ENF_VER_ENTRY_COLUMN)->data( Qt::EditRole);
788 QString groupName = myEnforcedTableWidget->item(row,ENF_VER_GROUP_COLUMN)->data( Qt::EditRole).toString();
790 clearEnforcedVertexWidgets();
792 if ( !x.isNull() || !entry.isNull()) {
793 QString toolTip = vertexName.toString();
794 toolTip += QString("(");
795 if (entry.isNull() || (!entry.isNull() && entry.toString() == "")) {
796 toolTip += x.toString();
797 toolTip += QString(", ") + y.toString();
798 toolTip += QString(", ") + z.toString();
801 toolTip += entry.toString();
802 toolTip += QString(")");
805 toolTip += QString("=") + size.toString();
807 if (!groupName.isEmpty())
808 toolTip += QString(" [") + groupName + QString("]");
810 for (int col=0;col<ENF_VER_NB_COLUMNS;col++)
811 myEnforcedTableWidget->item(row,col)->setToolTip(toolTip);
814 disconnect( myXCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
815 disconnect( myYCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
816 disconnect( myZCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
817 myXCoord->SetValue(x.toDouble());
818 myYCoord->SetValue(y.toDouble());
819 myZCoord->SetValue(z.toDouble());
820 connect( myXCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
821 connect( myYCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
822 connect( myZCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
825 mySizeValue->SetValue(size.toDouble());
827 if (!groupName.isEmpty())
828 myGroupName->setText(groupName);
832 void GHS3DPluginGUI_HypothesisCreator::onSelectEnforcedVertex()
834 int nbSelEnfVertex = myEnfVertexWdg->NbObjects();
835 clearEnforcedVertexWidgets();
836 if (nbSelEnfVertex == 1)
838 if ( CORBA::is_nil( getGeomEngine() ) && !GeometryGUI::InitGeomGen() )
841 myEnfVertex = myEnfVertexWdg->GetObject< GEOM::GEOM_Object >(nbSelEnfVertex-1);
842 if (myEnfVertex == GEOM::GEOM_Object::_nil())
844 if (myEnfVertex->GetShapeType() == GEOM::VERTEX)
846 GEOM::GEOM_IMeasureOperations_var measureOp = getGeomEngine()->GetIMeasureOperations( );
847 if (CORBA::is_nil(measureOp))
851 measureOp->PointCoordinates (myEnfVertex, x, y, z);
852 if ( measureOp->IsDone() )
854 disconnect( myXCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
855 disconnect( myYCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
856 disconnect( myZCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
857 myXCoord->SetValue(x);
858 myYCoord->SetValue(y);
859 myZCoord->SetValue(z);
860 connect( myXCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
861 connect( myYCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
862 connect( myZCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
868 /** GHS3DPluginGUI_HypothesisCreator::synchronizeCoords()
869 This method synchronizes the QLineEdit/SMESHGUI_SpinBox widgets content with the coordinates
870 of the enforced vertex clicked in the tree widget.
872 void GHS3DPluginGUI_HypothesisCreator::synchronizeCoords()
874 clearEnforcedVertexWidgets();
875 QList<QTableWidgetItem *> items = myEnforcedTableWidget->selectedItems();
876 disconnect( myEnfVertexWdg, SIGNAL( contentModified()), this, SLOT( onSelectEnforcedVertex() ) );
877 if (! items.isEmpty()) {
878 QTableWidgetItem *item;
881 if (items.size() == 1) {
883 row = myEnforcedTableWidget->row(item);
884 QVariant x = myEnforcedTableWidget->item(row,ENF_VER_X_COLUMN)->data( Qt::EditRole);
885 QVariant y = myEnforcedTableWidget->item(row,ENF_VER_Y_COLUMN)->data( Qt::EditRole);
886 QVariant z = myEnforcedTableWidget->item(row,ENF_VER_Z_COLUMN)->data( Qt::EditRole);
887 QVariant size = myEnforcedTableWidget->item(row,ENF_VER_SIZE_COLUMN)->data( Qt::EditRole);
888 entry = myEnforcedTableWidget->item(row,ENF_VER_ENTRY_COLUMN)->data( Qt::EditRole);
889 if (!entry.isNull()) {
890 SMESH::string_array_var objIds = new SMESH::string_array;
892 objIds[0] = entry.toString().toStdString().c_str();
893 myEnfVertexWdg->SetObjects(objIds);
896 myEnfVertexWdg->SetObject(GEOM::GEOM_Object::_nil());
898 QVariant group = myEnforcedTableWidget->item(row,ENF_VER_GROUP_COLUMN)->data( Qt::EditRole);
899 if (!x.isNull()/* && entry.isNull()*/) {
900 // disconnect( myXCoord, SIGNAL( textChanged(const QString &)), this, SLOT( onSelectEnforcedVertex() ) );
901 disconnect( myXCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
902 disconnect( myYCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
903 disconnect( myZCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
904 myXCoord->SetValue(x.toDouble());
905 myYCoord->SetValue(y.toDouble());
906 myZCoord->SetValue(z.toDouble());
907 connect( myXCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
908 connect( myYCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
909 connect( myZCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
912 mySizeValue->SetValue(size.toDouble());
914 if (!group.isNull() && (!x.isNull() || !entry.isNull()))
915 myGroupName->setText(group.toString());
918 QList<QString> entryList;
919 for (int i = 0; i < items.size(); ++i) {
921 row = myEnforcedTableWidget->row(item);
922 entry = myEnforcedTableWidget->item(row,ENF_VER_ENTRY_COLUMN)->data( Qt::EditRole);
924 entryList << entry.toString();
926 if (entryList.size() > 0) {
927 SMESH::string_array_var objIds = new SMESH::string_array;
928 objIds->length(entryList.size());
929 for (int i = 0; i < entryList.size() ; i++)
930 objIds[i] = entryList.at(i).toStdString().c_str();
931 myEnfVertexWdg->SetObjects(objIds);
934 myEnfVertexWdg->SetObject(GEOM::GEOM_Object::_nil());
939 myEnfVertexWdg->SetObject(GEOM::GEOM_Object::_nil());
941 connect( myEnfVertexWdg, SIGNAL( contentModified()), this, SLOT( onSelectEnforcedVertex() ) );
942 GHS3DPluginGUI_HypothesisCreator* that = (GHS3DPluginGUI_HypothesisCreator*)this;
943 that->checkVertexIsDefined();
946 /** GHS3DPluginGUI_HypothesisCreator::addEnforcedMesh( meshName, geomEntry, elemType, size, groupName)
947 This method adds in the tree widget an enforced mesh from mesh, submesh or group with optionally size and and groupName.
949 void GHS3DPluginGUI_HypothesisCreator::addEnforcedMesh(std::string name,
952 std::string groupName)
954 bool okToCreate = true;
955 QString itemEntry = "";
956 int itemElementType = 0;
957 int rowCount = myEnforcedMeshTableWidget->rowCount();
958 bool allColumns = true;
959 for (int row = 0;row<rowCount;row++) {
960 for (int col = 0 ; col < ENF_MESH_NB_COLUMNS ; col++) {
961 if (col == ENF_MESH_CONSTRAINT_COLUMN){
962 if (qobject_cast<QComboBox*>(myEnforcedMeshTableWidget->cellWidget(row, col)) == 0) {
967 else if (myEnforcedMeshTableWidget->item(row, col) == 0) {
971 if (col == ENF_MESH_CONSTRAINT_COLUMN) {
972 QComboBox* itemComboBox = qobject_cast<QComboBox*>(myEnforcedMeshTableWidget->cellWidget(row, col));
973 itemElementType = itemComboBox->currentIndex();
975 else if (col == ENF_MESH_ENTRY_COLUMN)
976 itemEntry = myEnforcedMeshTableWidget->item(row, col)->data(Qt::EditRole).toString();
982 if (itemEntry == QString(entry.c_str()) && itemElementType == elementType) {
992 myEnforcedMeshTableWidget->setRowCount(rowCount+1);
993 myEnforcedMeshTableWidget->setSortingEnabled(false);
995 for (int col=0;col<ENF_MESH_NB_COLUMNS;col++) {
996 if (col == ENF_MESH_CONSTRAINT_COLUMN) {
997 QComboBox* comboBox = new QComboBox();
998 QPalette pal = comboBox->palette();
999 pal.setColor(QPalette::Button, Qt::white);
1000 comboBox->setPalette(pal);
1001 comboBox->insertItems(0,myEnfMeshConstraintLabels);
1002 comboBox->setEditable(false);
1003 comboBox->setCurrentIndex(elementType);
1004 myEnforcedMeshTableWidget->setCellWidget(rowCount,col,comboBox);
1007 QTableWidgetItem* item = new QTableWidgetItem();
1008 item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled);
1010 case ENF_MESH_NAME_COLUMN:
1011 item->setData( 0, name.c_str() );
1012 item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled);
1013 myEnforcedMeshTableWidget->setItem(rowCount,col,item);
1015 case ENF_MESH_ENTRY_COLUMN:
1016 item->setData( 0, entry.c_str() );
1017 item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled);
1018 myEnforcedMeshTableWidget->setItem(rowCount,col,item);
1020 case ENF_MESH_GROUP_COLUMN:
1021 item->setData( 0, groupName.c_str() );
1022 myEnforcedMeshTableWidget->setItem(rowCount,col,item);
1029 myEnforcedMeshTableWidget->setSortingEnabled(true);
1032 /** GHS3DPluginGUI_HypothesisCreator::addEnforcedVertex( x, y, z, size, vertexName, geomEntry, groupName)
1033 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.
1035 void GHS3DPluginGUI_HypothesisCreator::addEnforcedVertex(double x, double y, double z, double size, std::string vertexName, std::string geomEntry, std::string groupName, bool isCompound)
1037 myEnforcedTableWidget->disconnect(SIGNAL( itemChanged(QTableWidgetItem *)));
1038 bool okToCreate = true;
1039 double itemX,itemY,itemZ,itemSize = 0;
1040 QString itemEntry, itemGroupName = QString("");
1041 // bool itemIsCompound;
1042 int rowCount = myEnforcedTableWidget->rowCount();
1045 for (int row = 0;row<rowCount;row++) {
1047 for (int col = 0 ; col < ENF_VER_NB_COLUMNS ; col++) {
1048 if (myEnforcedTableWidget->item(row, col) == 0) {
1053 data = myEnforcedTableWidget->item(row, col)->data(Qt::EditRole);
1054 if (!data.isNull()) {
1056 case ENF_VER_GROUP_COLUMN:
1057 itemGroupName = data.toString();
1059 case ENF_VER_ENTRY_COLUMN:
1060 itemEntry = data.toString();
1062 case ENF_VER_X_COLUMN:
1063 itemX = data.toDouble();
1065 case ENF_VER_Y_COLUMN:
1066 itemY = data.toDouble();
1068 case ENF_VER_Z_COLUMN:
1069 itemZ = data.toDouble();
1071 case ENF_VER_SIZE_COLUMN:
1072 itemSize = data.toDouble();
1084 if (( !isCompound && ((itemX == x) && (itemY == y) && (itemZ == z))) ||
1085 ( !itemEntry.isEmpty() && ( itemEntry == geomEntry.c_str() )))
1088 if (itemSize != size) {
1089 myEnforcedTableWidget->item(row, ENF_VER_SIZE_COLUMN)->setData( Qt::EditRole, QVariant(size));
1091 // update group name
1092 if (itemGroupName.toStdString() != groupName) {
1093 myEnforcedTableWidget->item(row, ENF_VER_GROUP_COLUMN)->setData( Qt::EditRole, QVariant(groupName.c_str()));
1100 if (geomEntry.empty()) {
1109 QString myVertexName;
1110 while(indexRef != vertexIndex) {
1111 indexRef = vertexIndex;
1112 if (vertexName.empty())
1113 myVertexName = QString("Vertex #%1").arg(vertexIndex);
1115 myVertexName = QString(vertexName.c_str());
1117 for (int row = 0;row<rowCount;row++) {
1118 QString name = myEnforcedTableWidget->item(row,ENF_VER_NAME_COLUMN)->data(Qt::EditRole).toString();
1119 if (myVertexName == name) {
1126 myEnforcedTableWidget->setRowCount(rowCount+1);
1127 myEnforcedTableWidget->setSortingEnabled(false);
1128 for (int col=0;col<ENF_VER_NB_COLUMNS;col++) {
1129 QTableWidgetItem* item = new QTableWidgetItem();
1130 item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled);
1132 case ENF_VER_NAME_COLUMN:
1133 item->setData( Qt::EditRole, myVertexName );
1134 if (!geomEntry.empty()) {
1136 item->setIcon(QIcon(iconCompound.scaled(iconCompound.size()*0.7,Qt::KeepAspectRatio,Qt::SmoothTransformation)));
1138 item->setIcon(QIcon(iconVertex.scaled(iconVertex.size()*0.7,Qt::KeepAspectRatio,Qt::SmoothTransformation)));
1141 case ENF_VER_X_COLUMN:
1143 item->setData( 0, QVariant(x) );
1145 case ENF_VER_Y_COLUMN:
1147 item->setData( 0, QVariant(y) );
1149 case ENF_VER_Z_COLUMN:
1151 item->setData( 0, QVariant(z) );
1153 case ENF_VER_SIZE_COLUMN:
1154 item->setData( 0, QVariant(size) );
1156 case ENF_VER_ENTRY_COLUMN:
1157 if (!geomEntry.empty())
1158 item->setData( 0, QString(geomEntry.c_str()) );
1160 case ENF_VER_COMPOUND_COLUMN:
1161 item->setData( Qt::CheckStateRole, isCompound );
1162 item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable);
1164 case ENF_VER_GROUP_COLUMN:
1165 if (!groupName.empty())
1166 item->setData( 0, QString(groupName.c_str()) );
1172 myEnforcedTableWidget->setItem(rowCount,col,item);
1175 connect( myEnforcedTableWidget,SIGNAL( itemChanged(QTableWidgetItem *)), this, SLOT( updateEnforcedVertexValues(QTableWidgetItem *) ) );
1177 myEnforcedTableWidget->setSortingEnabled(true);
1178 // myEnforcedTableWidget->setCurrentItem(myEnforcedTableWidget->item(rowCount,ENF_VER_NAME_COLUMN));
1179 updateEnforcedVertexValues(myEnforcedTableWidget->item(rowCount,ENF_VER_NAME_COLUMN));
1182 /** GHS3DPluginGUI_HypothesisCreator::onAddEnforcedMesh()
1183 This method is called when a item is added into the enforced meshes tree widget
1185 void GHS3DPluginGUI_HypothesisCreator::onAddEnforcedMesh()
1187 GHS3DPluginGUI_HypothesisCreator* that = (GHS3DPluginGUI_HypothesisCreator*)this;
1189 that->getGeomSelectionTool()->selectionMgr()->clearFilters();
1190 myEnfMeshWdg->deactivateSelection();
1192 for (int column = 0; column < myEnforcedMeshTableWidget->columnCount(); ++column)
1193 myEnforcedMeshTableWidget->resizeColumnToContents(column);
1196 int selEnfMeshes = myEnfMeshWdg->NbObjects();
1197 if (selEnfMeshes == 0)
1200 std::string groupName = myMeshGroupName->text().simplified().toStdString();
1202 int elementType = myEnfMeshConstraint->currentIndex();
1205 _PTR(Study) aStudy = SMESH::getStudy();
1206 _PTR(SObject) aSObj;
1207 QString meshEntry = myEnfMeshWdg->GetValue();
1209 if (selEnfMeshes == 1)
1211 aSObj = aStudy->FindObjectID(meshEntry.toStdString().c_str());
1212 CORBA::Object_var anObj = SMESH::SObjectToObject(aSObj);
1213 if (!CORBA::is_nil(anObj)) {
1214 addEnforcedMesh( aSObj->GetName(), aSObj->GetID(), elementType, groupName);
1219 QStringList meshEntries = meshEntry.split(" ", QString::SkipEmptyParts);
1220 QStringListIterator meshEntriesIt (meshEntries);
1221 while (meshEntriesIt.hasNext()) {
1222 aSObj = aStudy->FindObjectID(meshEntriesIt.next().toStdString().c_str());
1223 CORBA::Object_var anObj = SMESH::SObjectToObject(aSObj);
1224 if (!CORBA::is_nil(anObj)) {
1225 addEnforcedMesh( aSObj->GetName(), aSObj->GetID(), elementType, groupName);
1230 myEnfVertexWdg->SetObject(SMESH::SMESH_IDSource::_nil());
1232 for (int column = 0; column < myEnforcedMeshTableWidget->columnCount(); ++column)
1233 myEnforcedMeshTableWidget->resizeColumnToContents(column);
1237 /** GHS3DPluginGUI_HypothesisCreator::onAddEnforcedVertex()
1238 This method is called when a item is added into the enforced vertices tree widget
1240 void GHS3DPluginGUI_HypothesisCreator::onAddEnforcedVertex()
1242 GHS3DPluginGUI_HypothesisCreator* that = (GHS3DPluginGUI_HypothesisCreator*)this;
1244 that->getGeomSelectionTool()->selectionMgr()->clearFilters();
1245 myEnfVertexWdg->deactivateSelection();
1247 for (int column = 0; column < myEnforcedTableWidget->columnCount(); ++column)
1248 myEnforcedTableWidget->resizeColumnToContents(column);
1251 int selEnfVertex = myEnfVertexWdg->NbObjects();
1252 bool coordsEmpty = (myXCoord->text().isEmpty()) || (myYCoord->text().isEmpty()) || (myZCoord->text().isEmpty());
1253 if ((selEnfVertex == 0) && coordsEmpty)
1256 std::string groupName = myGroupName->text().simplified().toStdString();
1258 double size = mySizeValue->GetValue();
1260 if (selEnfVertex <= 1)
1262 double x = 0, y = 0, z=0;
1263 if (myXCoord->GetString() != "") {
1264 x = myXCoord->GetValue();
1265 y = myYCoord->GetValue();
1266 z = myZCoord->GetValue();
1268 if (selEnfVertex == 1) {
1269 myEnfVertex = myEnfVertexWdg->GetObject< GEOM::GEOM_Object >();
1270 std::string entry = "", name = "";
1271 bool isCompound = false;
1272 if ( !myEnfVertex->_is_nil() ) {
1273 entry = SMESH::toStdStr( myEnfVertex->GetStudyEntry() );
1274 name = SMESH::toStdStr( myEnfVertex->GetName() );
1275 isCompound = ( myEnfVertex->GetShapeType() == GEOM::COMPOUND );
1277 addEnforcedVertex(x, y, z, size, name, entry, groupName, isCompound);
1280 addEnforcedVertex(x, y, z, size, "", "", groupName);
1285 if ( CORBA::is_nil(getGeomEngine()))
1288 GEOM::GEOM_IMeasureOperations_var measureOp = getGeomEngine()->GetIMeasureOperations( );
1289 if (CORBA::is_nil(measureOp))
1292 CORBA::Double x = 0, y = 0,z = 0;
1293 for (int j = 0 ; j < selEnfVertex ; j++)
1295 myEnfVertex = myEnfVertexWdg->GetObject< GEOM::GEOM_Object >(j);
1296 if (myEnfVertex == GEOM::GEOM_Object::_nil())
1298 if (myEnfVertex->GetShapeType() == GEOM::VERTEX) {
1299 measureOp->PointCoordinates (myEnfVertex, x, y, z);
1300 if ( measureOp->IsDone() )
1301 addEnforcedVertex(x, y, z, size, myEnfVertex->GetName(),myEnfVertex->GetStudyEntry(), groupName);
1302 } else if (myEnfVertex->GetShapeType() == GEOM::COMPOUND) {
1303 addEnforcedVertex(0., 0., 0., size, myEnfVertex->GetName(),myEnfVertex->GetStudyEntry(), groupName, true);
1308 myEnfVertexWdg->SetObject(GEOM::GEOM_Object::_nil());
1310 for (int column = 0; column < myEnforcedTableWidget->columnCount(); ++column)
1311 myEnforcedTableWidget->resizeColumnToContents(column);
1314 /** GHS3DPluginGUI_HypothesisCreator::onRemoveEnforcedMesh()
1315 This method is called when a item is removed from the enforced meshes tree widget
1317 void GHS3DPluginGUI_HypothesisCreator::onRemoveEnforcedMesh()
1319 QList<int> selectedRows;
1320 QList<QTableWidgetItem *> selectedItems = myEnforcedMeshTableWidget->selectedItems();
1321 QTableWidgetItem* item;
1323 foreach( item, selectedItems ) {
1325 if (!selectedRows.contains( row ) )
1326 selectedRows.append(row);
1329 qSort( selectedRows );
1330 QListIterator<int> it( selectedRows );
1332 while ( it.hasPrevious() ) {
1333 row = it.previous();
1334 myEnforcedMeshTableWidget->removeRow(row );
1337 myEnforcedMeshTableWidget->selectionModel()->clearSelection();
1340 /** GHS3DPluginGUI_HypothesisCreator::onRemoveEnforcedVertex()
1341 This method is called when a item is removed from the enforced vertices tree widget
1343 void GHS3DPluginGUI_HypothesisCreator::onRemoveEnforcedVertex()
1345 QList<int> selectedRows;
1346 QList<QTableWidgetItem *> selectedItems = myEnforcedTableWidget->selectedItems();
1347 QTableWidgetItem* item;
1349 foreach( item, selectedItems ) {
1351 if (!selectedRows.contains( row ) )
1352 selectedRows.append(row);
1355 qSort( selectedRows );
1356 QListIterator<int> it( selectedRows );
1358 while ( it.hasPrevious() ) {
1359 row = it.previous();
1360 myEnforcedTableWidget->removeRow(row );
1363 myEnforcedTableWidget->selectionModel()->clearSelection();
1366 void GHS3DPluginGUI_HypothesisCreator::onToMeshHoles(bool isOn)
1368 // myToMakeGroupsOfDomains->setEnabled( isOn );
1370 // myToMakeGroupsOfDomains->setChecked( false );
1373 void GHS3DPluginGUI_HypothesisCreator::onDirBtnClicked()
1375 QString dir = SUIT_FileDlg::getExistingDirectory( dlg(), myAdvWidget->workingDirectoryLineEdit->text(), QString() );
1376 if ( !dir.isEmpty() )
1377 myAdvWidget->workingDirectoryLineEdit->setText( dir );
1380 void GHS3DPluginGUI_HypothesisCreator::updateWidgets()
1382 //myToMakeGroupsOfDomains->setEnabled( myToMeshHolesCheck->isChecked() );
1383 myAdvWidget->maxMemorySpin->setEnabled( myAdvWidget->maxMemoryCheck->isChecked() );
1384 //myAdvWidget->initialMemoryCheck->setEnabled( !myAdvWidget->boundaryRecoveryCheck->isChecked() );
1385 myAdvWidget->initialMemorySpin->setEnabled( myAdvWidget->initialMemoryCheck->isChecked() /*&& !myAdvWidget->boundaryRecoveryCheck->isChecked()*/ );
1386 //myOptimizationLevelCombo->setEnabled( !myAdvWidget->boundaryRecoveryCheck->isChecked() );
1387 if ( sender() == myAdvWidget->logInFileCheck ||
1388 sender() == myAdvWidget->keepWorkingFilesCheck )
1390 bool logFileRemovable = ( myAdvWidget->logInFileCheck->isChecked() &&
1391 !myAdvWidget->keepWorkingFilesCheck->isChecked() );
1392 myAdvWidget->removeLogOnSuccessCheck->setEnabled( logFileRemovable );
1396 bool GHS3DPluginGUI_HypothesisCreator::checkParams(QString& msg) const
1398 if ( !QFileInfo( myAdvWidget->workingDirectoryLineEdit->text().trimmed() ).isWritable() ) {
1399 SUIT_MessageBox::warning( dlg(),
1400 tr( "SMESH_WRN_WARNING" ),
1401 tr( "GHS3D_PERMISSION_DENIED" ) );
1405 GHS3DPlugin::GHS3DPlugin_Hypothesis_var h =
1406 GHS3DPlugin::GHS3DPlugin_Hypothesis::_narrow( hypothesis() );
1408 myAdvWidget->myOptionTable->setFocus();
1409 QApplication::instance()->processEvents();
1411 QString name, value;
1412 bool isDefault, ok = true;
1413 int iRow = 0, nbRows = myAdvWidget->myOptionTable->topLevelItemCount();
1414 for ( ; iRow < nbRows; ++iRow )
1416 QTreeWidgetItem* row = myAdvWidget->myOptionTable->topLevelItem( iRow );
1417 myAdvWidget->GetOptionAndValue( row, name, value, isDefault );
1419 if ( name.simplified().isEmpty() )
1420 continue; // invalid custom option
1422 if ( isDefault ) // not selected option
1426 h->SetOptionValue( name.toLatin1().constData(), value.toLatin1().constData() );
1428 catch ( const SALOME::SALOME_Exception& ex )
1430 msg = ex.details.text.in();
1438 h->SetOptionValues( myOptions ); // restore values
1444 void GHS3DPluginGUI_HypothesisCreator::retrieveParams() const
1446 GHS3DPluginGUI_HypothesisCreator* that = (GHS3DPluginGUI_HypothesisCreator*)this;
1447 GHS3DHypothesisData data;
1448 readParamsFromHypo( data );
1452 myName->setText( data.myName );
1454 int width = QFontMetrics( myName->font() ).width( data.myName );
1455 QGridLayout* aStdLayout = (QGridLayout*) myStdGroup->layout();
1456 aStdLayout->setColumnMinimumWidth( 1, width + 10 );
1458 myToMeshHolesCheck ->setChecked ( data.myToMeshHoles );
1459 myToMakeGroupsOfDomains ->setChecked ( data.myToMakeGroupsOfDomains );
1460 myOptimizationLevelCombo ->setCurrentIndex( data.myOptimizationLevel );
1461 if ( myOptimizationCombo ) // optimizer
1463 myOptimizationCombo ->setCurrentIndex( data.myOptimization );
1464 mySplitOverConstrainedCombo ->setCurrentIndex( data.mySplitOverConstrained );
1465 myPThreadsModeCombo ->setCurrentIndex( data.myPThreadsMode );
1466 myNumberOfThreadsSpin ->setValue ( data.myNumberOfThreads );
1467 mySmoothOffSliversCheck ->setChecked ( data.mySmoothOffSlivers );
1468 myCreateNewNodesCheck ->setChecked ( data.myToCreateNewNodes );
1472 myMinSizeSpin->setValue( data.myMinSize );
1473 myMinSizeCheck->setChecked( data.myUseMinSize );
1474 myMaxSizeSpin->setValue( data.myMaxSize );
1475 myMaxSizeCheck->setChecked( data.myUseMaxSize );
1476 myGradationCheck->setChecked( data.myUseGradation );
1477 myGradationSpin->setValue( data.myUseGradation ? data.myGradation : GHS3DPlugin_Hypothesis::DefaultGradation() );
1478 myUseProximityGroup->setChecked( data.myUseProximity );
1479 myNbProximityLayers->setValue( data.myNbProximityLayers );
1481 myAdvWidget->maxMemoryCheck ->setChecked ( data.myMaximumMemory > 0 );
1482 myAdvWidget->maxMemorySpin ->setValue
1483 ( qMax( data.myMaximumMemory, (float)myAdvWidget->maxMemorySpin->minimum() ));
1484 myAdvWidget->initialMemoryCheck ->setChecked ( data.myInitialMemory > 0 );
1485 myAdvWidget->initialMemorySpin ->setValue
1486 ( qMax( data.myInitialMemory, (float)myAdvWidget->initialMemorySpin->minimum() ));
1487 myAdvWidget->workingDirectoryLineEdit ->setText ( data.myWorkingDir );
1488 myAdvWidget->keepWorkingFilesCheck ->setChecked ( data.myKeepFiles );
1489 myAdvWidget->verboseLevelSpin ->setValue ( data.myVerboseLevel );
1490 myAdvWidget->logInFileCheck ->setChecked ( !data.myLogInStandardOutput );
1491 myAdvWidget->removeLogOnSuccessCheck ->setChecked ( data.myRemoveLogOnSuccess );
1493 if ( myOptions.operator->() ) {
1494 for ( int i = 0, nb = myOptions->length(); i < nb; ++i )
1495 myAdvWidget->AddOption( that->myOptions[i].in() );
1497 if ( myCustomOptions.operator->() ) {
1498 for ( int i = 0, nb = myCustomOptions->length(); i < nb; ++i )
1499 myAdvWidget->AddOption( that->myCustomOptions[i].in() );
1501 myAdvWidget->myOptionTable->resizeColumnToContents( OPTION_NAME_COLUMN );
1504 TEnfVertexList::const_iterator it;
1506 myEnforcedTableWidget->clearContents();
1507 myEnforcedTableWidget->setSortingEnabled(false);
1508 myEnforcedTableWidget->disconnect(SIGNAL( itemChanged(QTableWidgetItem *)));
1509 for(it = data.myEnforcedVertices.begin() ; it != data.myEnforcedVertices.end(); it++ )
1511 TEnfVertex* enfVertex = (*it);
1512 myEnforcedTableWidget->setRowCount(rowCount+1);
1514 for (int col=0;col<ENF_VER_NB_COLUMNS;col++) {
1515 QTableWidgetItem* item = new QTableWidgetItem();
1516 item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled);
1518 case ENF_VER_NAME_COLUMN:
1519 item->setData( 0, enfVertex->name.c_str() );
1520 if (!enfVertex->geomEntry.empty()) {
1521 if (enfVertex->isCompound)
1522 item->setIcon(QIcon(iconCompound.scaled(iconCompound.size()*0.7,Qt::KeepAspectRatio,Qt::SmoothTransformation)));
1524 item->setIcon(QIcon(iconVertex.scaled(iconVertex.size()*0.7,Qt::KeepAspectRatio,Qt::SmoothTransformation)));
1528 case ENF_VER_X_COLUMN:
1529 if (!enfVertex->isCompound) {
1530 item->setData( 0, enfVertex->coords.at(0) );
1533 case ENF_VER_Y_COLUMN:
1534 if (!enfVertex->isCompound) {
1535 item->setData( 0, enfVertex->coords.at(1) );
1538 case ENF_VER_Z_COLUMN:
1539 if (!enfVertex->isCompound) {
1540 item->setData( 0, enfVertex->coords.at(2) );
1543 case ENF_VER_SIZE_COLUMN:
1544 item->setData( 0, enfVertex->size );
1546 case ENF_VER_ENTRY_COLUMN:
1547 item->setData( 0, enfVertex->geomEntry.c_str() );
1549 case ENF_VER_COMPOUND_COLUMN:
1550 item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable);
1551 item->setData( Qt::CheckStateRole, enfVertex->isCompound );
1553 case ENF_VER_GROUP_COLUMN:
1554 item->setData( 0, enfVertex->groupName.c_str() );
1560 myEnforcedTableWidget->setItem(rowCount,col,item);
1562 that->updateEnforcedVertexValues(myEnforcedTableWidget->item(rowCount,ENF_VER_NAME_COLUMN));
1566 connect( myEnforcedTableWidget,SIGNAL( itemChanged(QTableWidgetItem *)), this, SLOT( updateEnforcedVertexValues(QTableWidgetItem *) ) );
1567 myEnforcedTableWidget->setSortingEnabled(true);
1569 for (int column = 0; column < myEnforcedTableWidget->columnCount(); ++column)
1570 myEnforcedTableWidget->resizeColumnToContents(column);
1572 // Update Enforced meshes QTableWidget
1573 TEnfMeshList::const_iterator itMesh;
1575 myEnforcedMeshTableWidget->clearContents();
1576 myEnforcedMeshTableWidget->setSortingEnabled(false);
1577 // myEnforcedMeshTableWidget->disconnect(SIGNAL( itemChanged(QTableWidgetItem *)));
1578 for(itMesh = data.myEnforcedMeshes.begin() ; itMesh != data.myEnforcedMeshes.end(); itMesh++ )
1580 TEnfMesh* enfMesh = (*itMesh);
1581 myEnforcedMeshTableWidget->setRowCount(rowCount+1);
1583 for (int col=0;col<ENF_MESH_NB_COLUMNS;col++) {
1584 if (col == ENF_MESH_CONSTRAINT_COLUMN) {
1585 QComboBox* comboBox = new QComboBox();
1586 QPalette pal = comboBox->palette();
1587 pal.setColor(QPalette::Button, Qt::white);
1588 comboBox->setPalette(pal);
1589 comboBox->insertItems(0,myEnfMeshConstraintLabels);
1590 comboBox->setEditable(false);
1591 comboBox->setCurrentIndex(enfMesh->elementType);
1592 myEnforcedMeshTableWidget->setCellWidget(rowCount,col,comboBox);
1595 QTableWidgetItem* item = new QTableWidgetItem();
1596 item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled);
1598 case ENF_MESH_NAME_COLUMN:
1599 item->setData( 0, enfMesh->name.c_str() );
1600 item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled);
1601 myEnforcedMeshTableWidget->setItem(rowCount,col,item);
1603 case ENF_MESH_ENTRY_COLUMN:
1604 item->setData( 0, enfMesh->entry.c_str() );
1605 item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled);
1606 myEnforcedMeshTableWidget->setItem(rowCount,col,item);
1608 case ENF_MESH_GROUP_COLUMN:
1609 item->setData( 0, enfMesh->groupName.c_str() );
1610 myEnforcedMeshTableWidget->setItem(rowCount,col,item);
1621 myEnforcedMeshTableWidget->setSortingEnabled(true);
1623 for (int col=0;col<ENF_MESH_NB_COLUMNS;col++)
1624 myEnforcedMeshTableWidget->resizeColumnToContents(col);
1626 that->updateWidgets();
1627 that->checkVertexIsDefined();
1630 QString GHS3DPluginGUI_HypothesisCreator::storeParams() const
1632 GHS3DHypothesisData data;
1633 readParamsFromWidgets( data );
1634 storeParamsToHypo( data );
1636 QString valStr = "";
1638 if ( !data.myBoundaryRecovery )
1639 valStr = " --components " + data.myToMeshHoles ? "all" : "outside_components" ;
1641 if ( data.myOptimizationLevel >= 0 && data.myOptimizationLevel < 5 && !data.myBoundaryRecovery) {
1642 const char* level[] = { "none" , "light" , "standard" , "standard+" , "strong" };
1643 valStr += " --optimisation_level ";
1644 valStr += level[ data.myOptimizationLevel ];
1646 if ( data.myMaximumMemory > 0 ) {
1647 valStr += " --max_memory ";
1648 valStr += QString::number( data.myMaximumMemory );
1650 if ( data.myInitialMemory > 0 && !data.myBoundaryRecovery ) {
1651 valStr += " --automatic_memory ";
1652 valStr += QString::number( data.myInitialMemory );
1654 valStr += " --verbose ";
1655 valStr += QString::number( data.myVerboseLevel );
1657 if ( !data.myToCreateNewNodes )
1658 valStr += " --no_internal_points";
1660 if ( data.myRemoveInitialCentralPoint )
1661 valStr += " --no_initial_central_point";
1663 // if ( data.myBoundaryRecovery )
1666 // if ( data.myFEMCorrection )
1667 // valStr += " -FEM";
1669 if ( data.myGradation != 1.05 ) {
1670 valStr += " -Dcpropa=";
1671 valStr += QString::number( data.myGradation );
1677 bool GHS3DPluginGUI_HypothesisCreator::readParamsFromHypo( GHS3DHypothesisData& h_data ) const
1679 GHS3DPlugin::GHS3DPlugin_Hypothesis_var h =
1680 GHS3DPlugin::GHS3DPlugin_Hypothesis::_narrow( initParamsHypothesis() );
1681 GHS3DPlugin::GHS3DPlugin_OptimizerHypothesis_var opt =
1682 GHS3DPlugin::GHS3DPlugin_OptimizerHypothesis::_narrow( initParamsHypothesis() );
1684 HypothesisData* data = SMESH::GetHypothesisData( hypType() );
1685 h_data.myName = isCreation() && data ? hypName() : "";
1687 if ( !opt->_is_nil() )
1689 h_data.myOptimization = opt->GetOptimization();
1690 h_data.mySplitOverConstrained = opt->GetSplitOverConstrained();
1691 h_data.myPThreadsMode = opt->GetPThreadsMode();
1692 h_data.myNumberOfThreads = opt->GetMaximalNumberOfThreads();
1693 h_data.mySmoothOffSlivers = opt->GetSmoothOffSlivers();
1697 // avoid "Conditional jump or move depends on uninitialised value" error
1698 h_data.myOptimization = 1;
1699 h_data.mySplitOverConstrained = 1;
1700 h_data.myPThreadsMode = 1;
1701 h_data.myNumberOfThreads = 1;
1702 h_data.mySmoothOffSlivers = 1;
1704 h_data.myOptimizationLevel = h->GetOptimizationLevel();
1705 h_data.myMinSize = h->GetMinSize();
1706 h_data.myMaxSize = h->GetMaxSize();
1707 this->myMinSizeDefault = h->GetMinSizeDefault();
1708 this->myMaxSizeDefault = h->GetMaxSizeDefault();
1709 if ( ! ( h_data.myUseMinSize = h_data.myMinSize > 0 ))
1710 h_data.myMinSize = this->myMinSizeDefault;
1711 if ( ! ( h_data.myUseMaxSize = h_data.myMaxSize > 0 ))
1712 h_data.myMaxSize = this->myMaxSizeDefault;
1713 h_data.myNbProximityLayers = h->GetNbVolumeProximityLayers();
1714 h_data.myUseGradation = h->GetGradation() != GHS3DPlugin_Hypothesis::DefaultGradation();
1715 h_data.myUseProximity = h->GetVolumeProximity();
1716 h_data.myToMeshHoles = h->GetToMeshHoles();
1717 h_data.myToMakeGroupsOfDomains = h->GetToMakeGroupsOfDomains();
1718 h_data.myMaximumMemory = h->GetMaximumMemory();
1719 h_data.myInitialMemory = h->GetInitialMemory();
1720 h_data.myInitialMemory = h->GetInitialMemory();
1721 h_data.myKeepFiles = h->GetKeepFiles();
1722 h_data.myWorkingDir = h->GetWorkingDirectory();
1723 h_data.myVerboseLevel = h->GetVerboseLevel();
1724 h_data.myToCreateNewNodes = h->GetToCreateNewNodes();
1725 //h_data.myRemoveInitialCentralPoint = h->GetToRemoveCentralPoint();
1726 //h_data.myBoundaryRecovery = h->GetToUseBoundaryRecoveryVersion();
1727 //h_data.myFEMCorrection = h->GetFEMCorrection();
1728 h_data.myGradation = h->GetGradation();
1729 //h_data.myTextOption = h->GetAdvancedOption();
1730 h_data.myLogInStandardOutput = h->GetStandardOutputLog();
1731 h_data.myRemoveLogOnSuccess = h->GetRemoveLogOnSuccess();
1733 GHS3DPluginGUI_HypothesisCreator* that = (GHS3DPluginGUI_HypothesisCreator*)this;
1734 that->myOptions = h->GetOptionValues();
1735 that->myCustomOptions = h->GetAdvancedOptionValues();
1737 GHS3DPlugin::GHS3DEnforcedVertexList_var vertices = h->GetEnforcedVertices();
1738 h_data.myEnforcedVertices.clear();
1739 for (CORBA::ULong i=0 ; i<vertices->length() ; i++) {
1740 TEnfVertex* myVertex = new TEnfVertex();
1741 myVertex->name = CORBA::string_dup(vertices[i].name.in());
1742 myVertex->geomEntry = CORBA::string_dup(vertices[i].geomEntry.in());
1743 myVertex->groupName = CORBA::string_dup(vertices[i].groupName.in());
1744 myVertex->size = vertices[i].size;
1745 myVertex->isCompound = vertices[i].isCompound;
1746 if (vertices[i].coords.length()) {
1747 for (CORBA::ULong c = 0; c < vertices[i].coords.length() ; c++)
1748 myVertex->coords.push_back(vertices[i].coords[c]);
1750 h_data.myEnforcedVertices.insert(myVertex);
1753 GHS3DPlugin::GHS3DEnforcedMeshList_var enfMeshes = h->GetEnforcedMeshes();
1754 h_data.myEnforcedMeshes.clear();
1755 for (CORBA::ULong i=0 ; i<enfMeshes->length() ; i++) {
1756 TEnfMesh* myEnfMesh = new TEnfMesh();
1757 myEnfMesh->name = CORBA::string_dup(enfMeshes[i].name.in());
1758 myEnfMesh->entry = CORBA::string_dup(enfMeshes[i].entry.in());
1759 myEnfMesh->groupName = CORBA::string_dup(enfMeshes[i].groupName.in());
1760 switch (enfMeshes[i].elementType) {
1762 myEnfMesh->elementType = 0;
1765 myEnfMesh->elementType = 1;
1768 myEnfMesh->elementType = 2;
1773 // myEnfMesh->elementType = enfMeshes[i].elementType;
1774 h_data.myEnforcedMeshes.insert(myEnfMesh);
1779 bool GHS3DPluginGUI_HypothesisCreator::storeParamsToHypo( const GHS3DHypothesisData& h_data ) const
1781 GHS3DPlugin::GHS3DPlugin_Hypothesis_var h =
1782 GHS3DPlugin::GHS3DPlugin_Hypothesis::_narrow( hypothesis() );
1783 GHS3DPlugin::GHS3DPlugin_OptimizerHypothesis_var opt =
1784 GHS3DPlugin::GHS3DPlugin_OptimizerHypothesis::_narrow( initParamsHypothesis() );
1790 SMESH::SetName( SMESH::FindSObject( h ), h_data.myName.toLatin1().constData() );
1792 h->SetOptimizationLevel ( h_data.myOptimizationLevel );
1793 h->SetMinSize ( h_data.myUseMinSize ? h_data.myMinSize : 0 );
1794 h->SetMaxSize ( h_data.myUseMaxSize ? h_data.myMaxSize : 0 );
1795 h->SetMinMaxSizeDefault ( this->myMinSizeDefault, this->myMaxSizeDefault );
1796 h->SetGradation ( h_data.myGradation );
1797 h->SetVolumeProximity ( h_data.myUseProximity );
1798 h->SetNbVolumeProximityLayers ( h_data.myNbProximityLayers );
1799 h->SetToMeshHoles ( h_data.myToMeshHoles );
1800 h->SetToMakeGroupsOfDomains ( h_data.myToMakeGroupsOfDomains );
1802 h->SetMaximumMemory ( h_data.myMaximumMemory );
1803 h->SetInitialMemory ( h_data.myInitialMemory );
1804 h->SetInitialMemory ( h_data.myInitialMemory );
1805 h->SetKeepFiles ( h_data.myKeepFiles );
1806 h->SetWorkingDirectory ( h_data.myWorkingDir.toLatin1().constData() );
1807 h->SetVerboseLevel ( h_data.myVerboseLevel );
1808 //h->SetToRemoveCentralPoint ( h_data.myRemoveInitialCentralPoint );
1809 //h->SetToUseBoundaryRecoveryVersion( h_data.myBoundaryRecovery );
1810 //h->SetFEMCorrection ( h_data.myFEMCorrection );
1811 h->SetStandardOutputLog ( h_data.myLogInStandardOutput );
1812 h->SetRemoveLogOnSuccess ( h_data.myRemoveLogOnSuccess );
1814 if ( !opt->_is_nil() )
1816 opt->SetToCreateNewNodes ( h_data.myToCreateNewNodes );
1817 opt->SetOptimization ( (GHS3DPlugin::Mode) h_data.myOptimization );
1818 opt->SetSplitOverConstrained ( (GHS3DPlugin::Mode) h_data.mySplitOverConstrained );
1819 opt->SetPThreadsMode ( (GHS3DPlugin::PThreadsMode) h_data.myPThreadsMode );
1820 opt->SetSmoothOffSlivers ( h_data.mySmoothOffSlivers );
1821 opt->SetMaximalNumberOfThreads( h_data.myNumberOfThreads );
1824 // Enforced vertices
1825 GHS3DPlugin::GHS3DEnforcedVertexList_var vertexHyp = h->GetEnforcedVertices();
1826 int nbVertexHyp = vertexHyp->length();
1828 // 1. Clear all enforced vertices in hypothesis
1829 // 2. Add new enforced vertex according to h_data
1830 if ( nbVertexHyp > 0)
1831 h->ClearEnforcedVertices();
1833 TEnfVertexList::const_iterator it;
1834 double x = 0, y = 0, z = 0;
1835 for(it = h_data.myEnforcedVertices.begin() ; it != h_data.myEnforcedVertices.end(); it++ ) {
1836 TEnfVertex* enfVertex = (*it);
1838 if (enfVertex->coords.size()) {
1839 x = enfVertex->coords.at(0);
1840 y = enfVertex->coords.at(1);
1841 z = enfVertex->coords.at(2);
1843 ok = h->p_SetEnforcedVertex( enfVertex->size, x, y, z, enfVertex->name.c_str(), enfVertex->geomEntry.c_str(), enfVertex->groupName.c_str(), enfVertex->isCompound);
1847 GHS3DPlugin::GHS3DEnforcedMeshList_var enfMeshListHyp = h->GetEnforcedMeshes();
1848 int nbEnfMeshListHyp = enfMeshListHyp->length();
1850 // 1. Clear all enforced vertices in hypothesis
1851 // 2. Add new enforced vertex according to h_data
1852 if ( nbEnfMeshListHyp > 0)
1853 h->ClearEnforcedMeshes();
1855 TEnfMeshList::const_iterator itEnfMesh;
1857 _PTR(Study) aStudy = SMESH::getStudy();
1859 for(itEnfMesh = h_data.myEnforcedMeshes.begin() ; itEnfMesh != h_data.myEnforcedMeshes.end(); itEnfMesh++ ) {
1860 TEnfMesh* enfMesh = (*itEnfMesh);
1862 _PTR(SObject) aSObj = aStudy->FindObjectID(enfMesh->entry.c_str());
1863 SMESH::SMESH_IDSource_var theSource = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( aSObj );
1865 SMESH::ElementType elementType;
1866 switch(enfMesh->elementType) {
1868 elementType = SMESH::NODE;
1871 elementType = SMESH::EDGE;
1874 elementType = SMESH::FACE;
1880 ok = h->p_SetEnforcedMesh(theSource, elementType, enfMesh->name.c_str(), enfMesh->groupName.c_str());
1883 catch ( const SALOME::SALOME_Exception& ex )
1885 SalomeApp_Tools::QtCatchCorbaException( ex );
1891 bool GHS3DPluginGUI_HypothesisCreator::readParamsFromWidgets( GHS3DHypothesisData& h_data ) const
1893 h_data.myName = myName ? myName->text() : "";
1894 h_data.myOptimizationLevel = myOptimizationLevelCombo->currentIndex();
1895 if ( mySplitOverConstrainedCombo ) // optimizer
1897 h_data.myToCreateNewNodes = myCreateNewNodesCheck->isChecked();
1898 h_data.myOptimization = myOptimizationCombo->currentIndex();
1899 h_data.mySplitOverConstrained = mySplitOverConstrainedCombo->currentIndex();
1900 h_data.myPThreadsMode = myPThreadsModeCombo->currentIndex();
1901 h_data.myNumberOfThreads = myNumberOfThreadsSpin->value();
1902 h_data.mySmoothOffSlivers = mySmoothOffSliversCheck->isChecked();
1906 h_data.myMinSize = myMinSizeSpin->value();
1907 h_data.myMaxSize = myMaxSizeSpin->value();
1908 h_data.myUseMinSize = myMinSizeCheck->isChecked();
1909 h_data.myUseMaxSize = myMaxSizeCheck->isChecked();
1910 h_data.myGradation = myGradationSpin->value();
1911 h_data.myUseGradation = myGradationCheck->isChecked();
1912 h_data.myUseProximity = myUseProximityGroup->isChecked();
1913 h_data.myNbProximityLayers = myNbProximityLayers->value();
1914 h_data.myToMeshHoles = myToMeshHolesCheck->isChecked();
1915 h_data.myToMakeGroupsOfDomains = myToMakeGroupsOfDomains->isChecked();
1917 h_data.myMaximumMemory = myAdvWidget->maxMemoryCheck->isChecked() ? myAdvWidget->maxMemorySpin->value() : -1;
1918 h_data.myInitialMemory = myAdvWidget->initialMemoryCheck->isChecked() ? myAdvWidget->initialMemorySpin->value() : -1;
1919 h_data.myKeepFiles = myAdvWidget->keepWorkingFilesCheck->isChecked();
1920 h_data.myWorkingDir = myAdvWidget->workingDirectoryLineEdit->text().trimmed();
1921 h_data.myVerboseLevel = myAdvWidget->verboseLevelSpin->value();
1922 h_data.myLogInStandardOutput = !myAdvWidget->logInFileCheck->isChecked();
1923 h_data.myRemoveLogOnSuccess = myAdvWidget->removeLogOnSuccessCheck->isChecked();
1925 // Enforced vertices
1926 h_data.myEnforcedVertices.clear();
1927 QVariant valueX, valueY, valueZ;
1928 for (int row=0 ; row<myEnforcedTableWidget->rowCount() ; row++)
1930 TEnfVertex *myVertex = new TEnfVertex();
1931 myVertex->name = myEnforcedTableWidget->item(row,ENF_VER_NAME_COLUMN)->data(Qt::EditRole).toString().toStdString();
1932 myVertex->geomEntry = myEnforcedTableWidget->item(row,ENF_VER_ENTRY_COLUMN)->data(Qt::EditRole).toString().toStdString();
1933 myVertex->groupName = myEnforcedTableWidget->item(row,ENF_VER_GROUP_COLUMN)->data(Qt::EditRole).toString().toStdString();
1934 valueX = myEnforcedTableWidget->item(row,ENF_VER_X_COLUMN)->data(Qt::EditRole);
1935 valueY = myEnforcedTableWidget->item(row,ENF_VER_Y_COLUMN)->data(Qt::EditRole);
1936 valueZ = myEnforcedTableWidget->item(row,ENF_VER_Z_COLUMN)->data(Qt::EditRole);
1937 if (!valueX.isNull() && !valueY.isNull() && !valueZ.isNull()) {
1938 myVertex->coords.push_back(valueX.toDouble());
1939 myVertex->coords.push_back(valueY.toDouble());
1940 myVertex->coords.push_back(valueZ.toDouble());
1942 myVertex->size = myEnforcedTableWidget->item(row,ENF_VER_SIZE_COLUMN)->data(Qt::EditRole).toDouble();
1943 myVertex->isCompound = myEnforcedTableWidget->item(row,ENF_VER_COMPOUND_COLUMN)->data(Qt::CheckStateRole).toBool();
1944 h_data.myEnforcedVertices.insert(myVertex);
1948 h_data.myEnforcedMeshes.clear();
1950 for (int row=0 ; row<myEnforcedMeshTableWidget->rowCount() ; row++)
1952 TEnfMesh *myEnfMesh = new TEnfMesh();
1953 myEnfMesh->name = myEnforcedMeshTableWidget->item(row,ENF_MESH_NAME_COLUMN)->data(Qt::EditRole).toString().toStdString();
1954 myEnfMesh->entry = myEnforcedMeshTableWidget->item(row,ENF_MESH_ENTRY_COLUMN)->data(Qt::EditRole).toString().toStdString();
1955 myEnfMesh->groupName = myEnforcedMeshTableWidget->item(row,ENF_MESH_GROUP_COLUMN)->data(Qt::EditRole).toString().toStdString();
1956 QComboBox* combo = qobject_cast<QComboBox*>(myEnforcedMeshTableWidget->cellWidget(row,ENF_MESH_CONSTRAINT_COLUMN));
1957 myEnfMesh->elementType = combo->currentIndex();
1958 h_data.myEnforcedMeshes.insert(myEnfMesh);
1964 QString GHS3DPluginGUI_HypothesisCreator::caption() const
1966 return tr( "GHS3D_TITLE" );
1969 QPixmap GHS3DPluginGUI_HypothesisCreator::icon() const
1971 return SUIT_Session::session()->resourceMgr()->loadPixmap( "GHS3DPlugin", tr( "ICON_DLG_GHS3D_PARAMETERS" ) );
1974 QString GHS3DPluginGUI_HypothesisCreator::type() const
1976 return tr( isOptimization() ? "GHS3D_OPTIMIZATIOL_HYPOTHESIS" : "GHS3D_HYPOTHESIS" );
1979 QString GHS3DPluginGUI_HypothesisCreator::helpPage() const
1981 return isOptimization() ? "optimization_page.html" : "ghs3d_hypo_page.html";
1984 void GHS3DPluginGUI_HypothesisCreator::onAddOption()
1986 myAdvWidget->AddOption( NULL, true );