1 // Copyright (C) 2004-2022 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>
48 #include "GHS3DPlugin_Hypothesis.hxx"
54 #include <QGridLayout>
56 #include <QHeaderView>
60 #include <QPushButton>
63 #include <QTableWidget>
64 #include <QTableWidgetItem>
65 #include <QVBoxLayout>
68 #include <utilities.h>
72 QComboBox* getModeCombo( QWidget* parent, bool isPThreadCombo )
74 QComboBox* combo = new QComboBox( parent );
77 combo->insertItem((int) GHS3DPlugin_OptimizerHypothesis::SAFE, QObject::tr("MODE_SAFE"));
78 combo->insertItem((int) GHS3DPlugin_OptimizerHypothesis::AGGRESSIVE, QObject::tr("MODE_AGGRESSIVE"));
79 combo->insertItem((int) GHS3DPlugin_OptimizerHypothesis::NONE, QObject::tr("MODE_NONE"));
83 combo->insertItem((int) GHS3DPlugin_OptimizerHypothesis::NO, QObject::tr("MODE_NO"));
84 combo->insertItem((int) GHS3DPlugin_OptimizerHypothesis::YES, QObject::tr("MODE_YES"));
85 combo->insertItem((int) GHS3DPlugin_OptimizerHypothesis::ONLY, QObject::tr("MODE_ONLY"));
92 // BEGIN EnforcedVertexTableWidgetDelegate
95 EnforcedVertexTableWidgetDelegate::EnforcedVertexTableWidgetDelegate(QObject *parent)
96 : QItemDelegate(parent)
100 QWidget *EnforcedVertexTableWidgetDelegate::createEditor(QWidget *parent,
101 const QStyleOptionViewItem & option ,
102 const QModelIndex & index ) const
104 QModelIndex father = index.parent();
105 QString entry = father.child(index.row(), ENF_VER_ENTRY_COLUMN).data().toString();
107 if (index.column() == ENF_VER_X_COLUMN ||
108 index.column() == ENF_VER_Y_COLUMN ||
109 index.column() == ENF_VER_Z_COLUMN ||
110 index.column() == ENF_VER_SIZE_COLUMN) {
111 SMESHGUI_SpinBox *editor = new SMESHGUI_SpinBox(parent);
112 if (index.column() == ENF_VER_SIZE_COLUMN)
113 editor->RangeStepAndValidator(0, COORD_MAX, 10.0, "length_precision");
115 editor->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
116 editor->setReadOnly(!entry.isEmpty());
117 editor->setDisabled(!entry.isEmpty());
120 else if (index.column() == ENF_VER_GROUP_COLUMN ||
121 index.column() == ENF_VER_NAME_COLUMN) {
123 QLineEdit *editor = new QLineEdit(parent);
124 if (index.column() != ENF_VER_GROUP_COLUMN) {
125 editor->setReadOnly(!entry.isEmpty());
126 editor->setDisabled(!entry.isEmpty());
130 return QItemDelegate::createEditor(parent, option, index);
133 void EnforcedVertexTableWidgetDelegate::setEditorData(QWidget *editor,
134 const QModelIndex &index) const
136 if (index.column() == ENF_VER_X_COLUMN ||
137 index.column() == ENF_VER_Y_COLUMN ||
138 index.column() == ENF_VER_Z_COLUMN ||
139 index.column() == ENF_VER_SIZE_COLUMN)
141 SMESHGUI_SpinBox *lineEdit = qobject_cast<SMESHGUI_SpinBox*>(editor);
142 lineEdit->SetValue(index.data().toDouble());
144 else if (index.column() == ENF_VER_COMPOUND_COLUMN) {
145 QCheckBox *checkBox = qobject_cast<QCheckBox*>(editor);
146 checkBox->setChecked(index.data().toBool());
149 QItemDelegate::setEditorData(editor, index);
153 void EnforcedVertexTableWidgetDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
154 const QModelIndex &index) const
156 QModelIndex parent = index.parent();
158 QString entry = parent.child(index.row(), ENF_VER_ENTRY_COLUMN).data().toString();
159 bool isCompound = parent.child(index.row(), ENF_VER_COMPOUND_COLUMN).data(Qt::CheckStateRole).toBool();
161 if (index.column() == ENF_VER_X_COLUMN ||
162 index.column() == ENF_VER_Y_COLUMN ||
163 index.column() == ENF_VER_Z_COLUMN) {
164 SMESHGUI_SpinBox *lineEdit = qobject_cast<SMESHGUI_SpinBox*>(editor);
165 if (!isCompound && !vertexExists(model, index, lineEdit->GetString()))
166 model->setData(index, lineEdit->GetValue(), Qt::EditRole);
168 else if (index.column() == ENF_VER_SIZE_COLUMN)
170 SMESHGUI_SpinBox *lineEdit = qobject_cast<SMESHGUI_SpinBox*>(editor);
171 const double newsize = lineEdit->GetValue();
173 model->setData(index, newsize, Qt::EditRole);
175 else if (index.column() == ENF_VER_NAME_COLUMN) {
176 QLineEdit *lineEdit = qobject_cast<QLineEdit*>(editor);
177 QString value = lineEdit->text();
178 if (entry.isEmpty() && !vertexExists(model, index, value))
179 model->setData(index, value, Qt::EditRole);
181 else if (index.column() == ENF_VER_ENTRY_COLUMN) {
182 QLineEdit *lineEdit = qobject_cast<QLineEdit*>(editor);
183 QString value = lineEdit->text();
184 if (! vertexExists(model, index, value))
185 model->setData(index, value, Qt::EditRole);
187 else if (index.column() == ENF_VER_COMPOUND_COLUMN) {
188 QCheckBox *checkBox = qobject_cast<QCheckBox*>(editor);
189 model->setData(index, checkBox->isChecked(), Qt::CheckStateRole);
192 QItemDelegate::setModelData(editor, model, index);
196 void EnforcedVertexTableWidgetDelegate::updateEditorGeometry(QWidget *editor,
197 const QStyleOptionViewItem &option,
198 const QModelIndex &/* index */) const
200 editor->setGeometry(option.rect);
203 bool EnforcedVertexTableWidgetDelegate::vertexExists(QAbstractItemModel *model,
204 const QModelIndex &index,
208 QModelIndex parent = index.parent();
209 int row = index.row();
210 int col = index.column();
212 if (parent.isValid() && !value.isEmpty()) {
213 if (col == ENF_VER_X_COLUMN || col == ENF_VER_Y_COLUMN || col == ENF_VER_Z_COLUMN) {
215 if (col == ENF_VER_X_COLUMN) {
216 x = value.toDouble();
217 y = parent.child(row, ENF_VER_Y_COLUMN).data().toDouble();
218 z = parent.child(row, ENF_VER_Z_COLUMN).data().toDouble();
220 if (col == ENF_VER_Y_COLUMN) {
221 y = value.toDouble();
222 x = parent.child(row, ENF_VER_X_COLUMN).data().toDouble();
223 z = parent.child(row, ENF_VER_Z_COLUMN).data().toDouble();
225 if (col == ENF_VER_Z_COLUMN) {
226 z = value.toDouble();
227 x = parent.child(row, ENF_VER_X_COLUMN).data().toDouble();
228 y = parent.child(row, ENF_VER_Y_COLUMN).data().toDouble();
230 int nbChildren = model->rowCount(parent);
231 for (int i = 0 ; i < nbChildren ; i++) {
233 double childX = parent.child(i, ENF_VER_X_COLUMN).data().toDouble();
234 double childY = parent.child(i, ENF_VER_Y_COLUMN).data().toDouble();
235 double childZ = parent.child(i, ENF_VER_Z_COLUMN).data().toDouble();
236 if ((childX == x) && (childY == y) && (childZ == z)) {
243 else if (col == ENF_VER_NAME_COLUMN) {
244 QString name = parent.child(row, ENF_VER_NAME_COLUMN).data().toString();
254 // END EnforcedVertexTableWidgetDelegate
258 // BEGIN EnforcedMeshTableWidgetDelegate
261 EnforcedMeshTableWidgetDelegate::EnforcedMeshTableWidgetDelegate(QObject *parent)
262 : QItemDelegate(parent)
266 QWidget *EnforcedMeshTableWidgetDelegate::createEditor(QWidget *parent,
267 const QStyleOptionViewItem & option ,
268 const QModelIndex & index ) const
270 return QItemDelegate::createEditor(parent, option, index);
273 void EnforcedMeshTableWidgetDelegate::setEditorData(QWidget *editor,
274 const QModelIndex &index) const
276 QItemDelegate::setEditorData(editor, index);
279 void EnforcedMeshTableWidgetDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
280 const QModelIndex &index) const
282 QItemDelegate::setModelData(editor, model, index);
286 void EnforcedMeshTableWidgetDelegate::updateEditorGeometry(QWidget *editor,
287 const QStyleOptionViewItem &option,
288 const QModelIndex &/* index */) const
290 editor->setGeometry(option.rect);
294 // END EnforcedMeshTableWidgetDelegate
298 GHS3DPluginGUI_HypothesisCreator::GHS3DPluginGUI_HypothesisCreator( const QString& theHypType )
299 : SMESHGUI_GenericHypothesisCreator( theHypType ),
301 myOptimizationLevelCombo(0),
308 myUseProximityGroup(0),
309 myNbProximityLayers(0),
310 myToMakeGroupsOfDomains(0),
311 myToMeshHolesCheck(0),
312 myOptimizationCombo(0),
313 mySplitOverConstrainedCombo(0),
314 myPThreadsModeCombo(0),
315 myNumberOfThreadsSpin(0),
316 mySmoothOffSliversCheck(0),
317 myCreateNewNodesCheck(0)
319 GeomToolSelected = NULL;
320 GeomToolSelected = getGeomSelectionTool();
322 iconVertex = QPixmap(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_OBJBROWSER_VERTEX")));
323 iconCompound = QPixmap(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_OBJBROWSER_COMPOUND")));
324 // mySelectionMgr = SMESH::GetSelectionMgr(SMESHGUI::GetSMESHGUI());
325 myEnfMeshConstraintLabels << tr( "GHS3D_ENF_MESH_CONSTRAINT_NODE" ) << tr( "GHS3D_ENF_MESH_CONSTRAINT_EDGE" ) << tr("GHS3D_ENF_MESH_CONSTRAINT_FACE");
328 GHS3DPluginGUI_HypothesisCreator::~GHS3DPluginGUI_HypothesisCreator()
330 GHS3DPluginGUI_HypothesisCreator* that = (GHS3DPluginGUI_HypothesisCreator*)this;
331 that->getGeomSelectionTool()->selectionMgr()->clearFilters();
332 myEnfMeshWdg->deactivateSelection();
336 * \brief {Get or create the geom selection tool for study}
338 GeomSelectionTools* GHS3DPluginGUI_HypothesisCreator::getGeomSelectionTool()
340 GHS3DPluginGUI_HypothesisCreator* that = (GHS3DPluginGUI_HypothesisCreator*)this;
341 if (that->GeomToolSelected == NULL) {
342 that->GeomToolSelected = new GeomSelectionTools();
344 return that->GeomToolSelected;
347 GEOM::GEOM_Gen_var GHS3DPluginGUI_HypothesisCreator::getGeomEngine()
349 return GeometryGUI::GetGeomGen();
352 bool GHS3DPluginGUI_HypothesisCreator::isOptimization() const
354 return ( hypType() == GHS3DPlugin_OptimizerHypothesis::GetHypType() );
357 QFrame* GHS3DPluginGUI_HypothesisCreator::buildFrame()
359 QFrame* fr = new QFrame( 0 );
360 QVBoxLayout* lay = new QVBoxLayout( fr );
362 lay->setSpacing( 0 );
365 QTabWidget* tab = new QTabWidget( fr );
366 tab->setTabShape( QTabWidget::Rounded );
367 tab->setTabPosition( QTabWidget::North );
368 lay->addWidget( tab );
371 myStdGroup = new QWidget();
372 QGridLayout* aStdLayout = new QGridLayout( myStdGroup );
373 aStdLayout->setSpacing( 6 );
374 aStdLayout->setMargin( 11 );
379 aStdLayout->addWidget( new QLabel( tr( "SMESH_NAME" ), myStdGroup ), row, 0, 1, 1 );
380 myName = new QLineEdit( myStdGroup );
381 aStdLayout->addWidget( myName, row++, 1, 1, 1 );
383 if ( isOptimization() )
385 myToMeshHolesCheck = new QCheckBox( tr( "GHS3D_TO_MESH_HOLES" ), myStdGroup );
386 aStdLayout->addWidget( myToMeshHolesCheck, row, 0, 1, 1 );
387 myToMakeGroupsOfDomains = new QCheckBox( tr( "GHS3D_TO_MAKE_DOMAIN_GROUPS" ), myStdGroup );
388 aStdLayout->addWidget( myToMakeGroupsOfDomains, row++, 1, 1, 1 );
390 QLabel* optimizationLbl = new QLabel( tr( "GHS3D_OPTIMIZATION" ), myStdGroup );
391 aStdLayout->addWidget( optimizationLbl, row, 0, 1, 1 );
392 myOptimizationCombo = getModeCombo( myStdGroup, false );
393 aStdLayout->addWidget( myOptimizationCombo, row++, 1, 1, 1 );
395 QLabel* optimizatiolLevelLbl = new QLabel( tr( "GHS3D_OPTIMIZATIOL_LEVEL" ), myStdGroup );
396 aStdLayout->addWidget( optimizatiolLevelLbl, row, 0, 1, 1 );
397 myOptimizationLevelCombo = new QComboBox( myStdGroup );
398 aStdLayout->addWidget( myOptimizationLevelCombo, row++, 1, 1, 1 );
400 QLabel* splitOverconstrainedLbl = new QLabel( tr("GHS3D_SPLIT_OVERCONSTRAINED"), myStdGroup );
401 aStdLayout->addWidget( splitOverconstrainedLbl, row, 0, 1, 1 );
402 mySplitOverConstrainedCombo = getModeCombo( myStdGroup, false );
403 aStdLayout->addWidget( mySplitOverConstrainedCombo, row++, 1, 1, 1 );
405 QLabel* pthreadsModeLbl = new QLabel( tr( "GHS3D_PTHREADS_MODE" ), myStdGroup);
406 aStdLayout->addWidget( pthreadsModeLbl, row, 0, 1, 1 );
407 myPThreadsModeCombo = getModeCombo( myStdGroup, true );
408 aStdLayout->addWidget( myPThreadsModeCombo, row++, 1, 1, 1 );
410 QLabel* nbThreadsLbl = new QLabel( tr( "GHS3D_NB_THREADS" ), myStdGroup);
411 aStdLayout->addWidget( nbThreadsLbl, row, 0, 1, 1 );
412 myNumberOfThreadsSpin = new SalomeApp_IntSpinBox( 0, 1000, 1, myStdGroup );
413 aStdLayout->addWidget( myNumberOfThreadsSpin, row++, 1, 1, 1 );
415 mySmoothOffSliversCheck = new QCheckBox( tr( "GHS3D_SMOOTH_OFF_SLIVERS" ), myStdGroup );
416 aStdLayout->addWidget( mySmoothOffSliversCheck, row, 0, 1, 1 );
417 myCreateNewNodesCheck = new QCheckBox( tr( "TO_ADD_NODES" ), myStdGroup );
418 aStdLayout->addWidget( myCreateNewNodesCheck, row++, 1, 1, 1 );
424 QGroupBox* mainGroup = new QGroupBox( tr("GHS3D_MAIN_PARAMS"), myStdGroup );
425 QLabel* optimizatiolLevelLbl = new QLabel( tr( "GHS3D_OPTIMIZATIOL_LEVEL" ), mainGroup );
426 myOptimizationLevelCombo = new QComboBox( mainGroup );
427 myMinSizeCheck = new QCheckBox( tr("GHS3D_MIN_SIZE"), mainGroup );
428 myMaxSizeCheck = new QCheckBox( tr("GHS3D_MAX_SIZE"), mainGroup );
429 myMinSizeSpin = new SMESHGUI_SpinBox( mainGroup );
430 myMaxSizeSpin = new SMESHGUI_SpinBox( mainGroup );
431 myMinSizeCheck->setChecked( false );
432 myMaxSizeCheck->setChecked( false );
433 myMinSizeSpin->RangeStepAndValidator(0, COORD_MAX, 10.0, "length_precision");
434 myMaxSizeSpin->RangeStepAndValidator(0, COORD_MAX, 10.0, "length_precision");
435 myMinSizeSpin->setEnabled( false );
436 myMaxSizeSpin->setEnabled( false );
437 connect( myMinSizeCheck, SIGNAL( toggled(bool)), myMinSizeSpin, SLOT( setEnabled(bool)));
438 connect( myMaxSizeCheck, SIGNAL( toggled(bool)), myMaxSizeSpin, SLOT( setEnabled(bool)));
440 QGridLayout* mainLayout = new QGridLayout( mainGroup );
441 mainLayout->setSpacing( 6 );
442 mainLayout->setMargin( 11 );
443 mainLayout->addWidget( optimizatiolLevelLbl, 0, 0, 1, 1 );
444 mainLayout->addWidget( myOptimizationLevelCombo, 0, 1, 1, 1 );
445 mainLayout->addWidget( myMinSizeCheck, 1, 0, 1, 1 );
446 mainLayout->addWidget( myMinSizeSpin, 1, 1, 1, 1 );
447 mainLayout->addWidget( myMaxSizeCheck, 2, 0, 1, 1 );
448 mainLayout->addWidget( myMaxSizeSpin, 2, 1, 1, 1 );
452 QGroupBox* proxyGroup = new QGroupBox( tr("GHS3D_VOLUME_PROXIMITY"), myStdGroup );
453 myGradationCheck = new QCheckBox( tr("GHS3D_GRADATION"), proxyGroup );
454 myGradationSpin = new SMESHGUI_SpinBox( proxyGroup );
455 myGradationSpin->RangeStepAndValidator(1, COORD_MAX, 0.1, "length_precision");
456 myGradationSpin->setEnabled( false );
457 connect( myGradationCheck, SIGNAL( toggled(bool)), myGradationSpin, SLOT( setEnabled(bool)));
458 myUseProximityGroup = new QGroupBox( tr("GHS3D_USE_VOLUME_PROXIMITY"), proxyGroup );
459 myUseProximityGroup->setCheckable( true );
460 //myUseProximityGroup->setChecked( false );
461 QLabel* nbProximityLayersLabel = new QLabel( tr("GHS3D_NB_LAYERS"));
462 myNbProximityLayers = new SalomeApp_IntSpinBox( 2, 1e6, 1, proxyGroup );
464 QHBoxLayout* useProxyLayout = new QHBoxLayout( myUseProximityGroup );
465 useProxyLayout->addWidget( nbProximityLayersLabel );
466 useProxyLayout->addWidget( myNbProximityLayers );
468 QGridLayout* proxyLayout = new QGridLayout( proxyGroup );
469 proxyLayout->setSpacing( 6 );
470 proxyLayout->setMargin( 11 );
471 proxyLayout->addWidget( myGradationCheck, 0, 0, 1, 1 );
472 proxyLayout->addWidget( myGradationSpin, 0, 1, 1, 1 );
473 proxyLayout->addWidget( myUseProximityGroup, 1, 0, 1, 2 );
477 QGroupBox* otherGroup = new QGroupBox( tr("GHS3D_OTHER_PARAMETERS"), myStdGroup );
478 myToMeshHolesCheck = new QCheckBox( tr( "GHS3D_TO_MESH_HOLES" ), otherGroup );
479 myToMakeGroupsOfDomains = new QCheckBox( tr( "GHS3D_TO_MAKE_DOMAIN_GROUPS" ), otherGroup );
481 QGridLayout* otherLayout = new QGridLayout( otherGroup );
482 otherLayout->setSpacing( 6 );
483 otherLayout->setMargin( 11 );
484 otherLayout->addWidget( myToMeshHolesCheck, 0, 0 );
485 otherLayout->addWidget( myToMakeGroupsOfDomains, 1, 0 );
488 aStdLayout->addWidget( mainGroup, row++, 0, 1, 2 );
489 aStdLayout->addWidget( proxyGroup, row++, 0, 1, 2 );
490 aStdLayout->addWidget( otherGroup, row++, 0, 1, 2 );
492 aStdLayout->setRowStretch( row, 10 );
494 myOptimizationLevelCombo->addItems( QStringList()
495 << tr( "LEVEL_NONE" ) << tr( "LEVEL_LIGHT" )
496 << tr( "LEVEL_MEDIUM" ) << tr( "LEVEL_STANDARDPLUS" )
497 << tr( "LEVEL_STRONG" ));
499 // advanced parameters
500 myAdvGroup = new QWidget();
501 QGridLayout* anAdvLayout = new QGridLayout( myAdvGroup );
502 anAdvLayout->setSpacing( 6 );
503 anAdvLayout->setMargin( 11 );
504 myAdvWidget = new GHS3DPluginGUI_AdvWidget(myAdvGroup);
505 anAdvLayout->addWidget( myAdvWidget);
507 myAdvWidget->maxMemoryCheck->setText(tr( "MAX_MEMORY_SIZE" ));
508 myAdvWidget->initialMemoryCheck->setText(tr( "INIT_MEMORY_SIZE" ));
510 myAdvWidget->maxMemorySpin->stepBy(10);
511 myAdvWidget->maxMemorySpin->setValue( 128 );
513 myAdvWidget->initialMemorySpin->stepBy(10);
514 myAdvWidget->initialMemorySpin->setValue( 100 );
516 myAdvWidget->initialMemoryLabel ->setText (tr( "MEGABYTE" ));
517 myAdvWidget->maxMemoryLabel ->setText (tr( "MEGABYTE" ));
519 myAdvWidget->workingDirectoryLabel ->setText (tr( "WORKING_DIR" ));
520 myAdvWidget->workingDirectoryPushButton ->setText (tr( "SELECT_DIR" ));
521 myAdvWidget->keepWorkingFilesCheck ->setText (tr( "KEEP_WORKING_FILES" ));
522 myAdvWidget->verboseLevelLabel ->setText (tr( "VERBOSE_LEVEL" ));
523 myAdvWidget->removeLogOnSuccessCheck ->setText (tr( "REMOVE_LOG_ON_SUCCESS" ));
524 myAdvWidget->logInFileCheck ->setText (tr( "LOG_IN_FILE" ));
526 myAdvWidget->memoryGroupBox ->setTitle(tr( "MEMORY_GROUP_TITLE" ));
527 myAdvWidget->logGroupBox ->setTitle(tr( "LOG_GROUP_TITLE" ));
528 //myAdvWidget->advancedMeshingGroupBox ->setTitle(tr( "ADVANCED_MESHING_GROUP_TITLE" ));
530 // myAdvWidget->createNewNodesCheck ->setText (tr( "TO_ADD_NODES" ));
531 // myAdvWidget->removeInitialCentralPointCheck->setText (tr( "NO_INITIAL_CENTRAL_POINT" ));
532 // myAdvWidget->boundaryRecoveryCheck ->setText (tr( "RECOVERY_VERSION" ));
533 // myAdvWidget->FEMCorrectionCheck ->setText (tr( "FEM_CORRECTION" ));
534 // myAdvWidget->gradationLabel ->setText (tr( "GHS3D_GRADATION" ));
535 // myAdvWidget->gradationSpinBox->RangeStepAndValidator(0.0, 5.0, 0.05, "length_precision");
537 // if ( isOptimization() )
539 // myAdvWidget->createNewNodesCheck->hide();
540 // myAdvWidget->removeInitialCentralPointCheck->hide();
541 // myAdvWidget->boundaryRecoveryCheck->hide();
542 // myAdvWidget->FEMCorrectionCheck->hide();
543 // myAdvWidget->gradationLabel->hide();
544 // myAdvWidget->gradationSpinBox->hide();
547 // Enforced vertices parameters
548 myEnfGroup = new QWidget();
549 QGridLayout* anEnfLayout = new QGridLayout(myEnfGroup);
551 myEnforcedTableWidget = new QTableWidget(myEnfGroup);
552 myEnforcedTableWidget ->setMinimumWidth(300);
553 myEnforcedTableWidget->setRowCount( 0 );
554 myEnforcedTableWidget->setColumnCount( ENF_VER_NB_COLUMNS );
555 myEnforcedTableWidget->setSortingEnabled(true);
556 myEnforcedTableWidget->setHorizontalHeaderLabels
558 << tr( "GHS3D_ENF_NAME_COLUMN" ) << tr( "GHS3D_ENF_VER_X_COLUMN" )
559 << tr( "GHS3D_ENF_VER_Y_COLUMN" ) << tr( "GHS3D_ENF_VER_Z_COLUMN" )
560 << tr( "GHS3D_ENF_SIZE_COLUMN" ) << tr("GHS3D_ENF_ENTRY_COLUMN")
561 << tr("GHS3D_ENF_VER_COMPOUND_COLUMN") << tr( "GHS3D_ENF_GROUP_COLUMN" ));
562 myEnforcedTableWidget->verticalHeader()->hide();
563 myEnforcedTableWidget->horizontalHeader()->setStretchLastSection(true);
564 myEnforcedTableWidget->setAlternatingRowColors(true);
565 myEnforcedTableWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
566 myEnforcedTableWidget->setSelectionBehavior(QAbstractItemView::SelectItems);
567 myEnforcedTableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive);
569 myEnforcedTableWidget->resizeColumnsToContents();
570 myEnforcedTableWidget->hideColumn(ENF_VER_ENTRY_COLUMN);
571 myEnforcedTableWidget->hideColumn(ENF_VER_COMPOUND_COLUMN);
573 myEnforcedTableWidget->setItemDelegate(new EnforcedVertexTableWidgetDelegate());
576 TColStd_MapOfInteger shapeTypes;
577 shapeTypes.Add( TopAbs_VERTEX );
578 shapeTypes.Add( TopAbs_COMPOUND );
580 SMESH_NumberFilter* vertexFilter = new SMESH_NumberFilter("GEOM", TopAbs_SHAPE, 1, shapeTypes);
581 myEnfVertexWdg = new StdMeshersGUI_ObjectReferenceParamWdg( vertexFilter, 0, /*multiSel=*/true);
582 myEnfVertexWdg->SetDefaultText(tr("GHS3D_ENF_SELECT_VERTEX"), "QLineEdit { color: grey }");
584 QLabel* myXCoordLabel = new QLabel( tr( "GHS3D_ENF_VER_X_LABEL" ), myEnfGroup );
585 myXCoord = new SMESHGUI_SpinBox(myEnfGroup);
586 myXCoord->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
587 QLabel* myYCoordLabel = new QLabel( tr( "GHS3D_ENF_VER_Y_LABEL" ), myEnfGroup );
588 myYCoord = new SMESHGUI_SpinBox(myEnfGroup);
589 myYCoord->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
590 QLabel* myZCoordLabel = new QLabel( tr( "GHS3D_ENF_VER_Z_LABEL" ), myEnfGroup );
591 myZCoord = new SMESHGUI_SpinBox(myEnfGroup);
592 myZCoord->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
593 QLabel* mySizeLabel = new QLabel( tr( "GHS3D_ENF_SIZE_LABEL" ), myEnfGroup );
594 mySizeValue = new SMESHGUI_SpinBox(myEnfGroup);
595 mySizeValue->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
597 QLabel* myGroupNameLabel = new QLabel( tr( "GHS3D_ENF_GROUP_LABEL" ), myEnfGroup );
598 myGroupName = new QLineEdit(myEnfGroup);
600 addVertexButton = new QPushButton(tr("GHS3D_ENF_ADD"),myEnfGroup);
601 addVertexButton->setEnabled(false);
602 removeVertexButton = new QPushButton(tr("GHS3D_ENF_REMOVE"),myEnfGroup);
604 anEnfLayout->addWidget(myEnforcedTableWidget, ENF_VER_VERTEX, 0, ENF_VER_NB_LINES, 1);
606 QGridLayout* anEnfLayout2 = new QGridLayout(myEnfGroup);
607 anEnfLayout2->addWidget(myEnfVertexWdg, ENF_VER_VERTEX, 0, 1, 2);
608 anEnfLayout2->addWidget(myXCoordLabel, ENF_VER_X_COORD, 0, 1, 1);
609 anEnfLayout2->addWidget(myXCoord, ENF_VER_X_COORD, 1, 1, 1);
610 anEnfLayout2->addWidget(myYCoordLabel, ENF_VER_Y_COORD, 0, 1, 1);
611 anEnfLayout2->addWidget(myYCoord, ENF_VER_Y_COORD, 1, 1, 1);
612 anEnfLayout2->addWidget(myZCoordLabel, ENF_VER_Z_COORD, 0, 1, 1);
613 anEnfLayout2->addWidget(myZCoord, ENF_VER_Z_COORD, 1, 1, 1);
614 anEnfLayout2->addWidget(mySizeLabel, ENF_VER_SIZE, 0, 1, 1);
615 anEnfLayout2->addWidget(mySizeValue, ENF_VER_SIZE, 1, 1, 1);
616 anEnfLayout2->addWidget(myGroupNameLabel, ENF_VER_GROUP, 0, 1, 1);
617 anEnfLayout2->addWidget(myGroupName, ENF_VER_GROUP, 1, 1, 1);
618 anEnfLayout2->addWidget(addVertexButton, ENF_VER_BTN, 0, 1, 1);
619 anEnfLayout2->addWidget(removeVertexButton, ENF_VER_BTN, 1, 1, 1);
620 anEnfLayout2->setRowStretch(ENF_VER_NB_LINES, 1);
622 anEnfLayout->addLayout(anEnfLayout2, ENF_VER_VERTEX, 1,ENF_VER_NB_LINES, 1);
623 anEnfLayout->setRowStretch(ENF_VER_VERTEX, 10);
626 // Enforced meshes parameters
627 myEnfMeshGroup = new QWidget();
628 QGridLayout* anEnfMeshLayout = new QGridLayout(myEnfMeshGroup);
630 myEnforcedMeshTableWidget = new QTableWidget(myEnfGroup);
631 myEnforcedMeshTableWidget->setRowCount( 0 );
632 myEnforcedMeshTableWidget->setColumnCount( ENF_MESH_NB_COLUMNS );
633 myEnforcedMeshTableWidget->setSortingEnabled(true);
634 myEnforcedMeshTableWidget->verticalHeader()->hide();
635 QStringList enforcedMeshHeaders;
636 enforcedMeshHeaders << tr( "GHS3D_ENF_NAME_COLUMN" )
637 << tr( "GHS3D_ENF_ENTRY_COLUMN" )
638 << tr( "GHS3D_ENF_MESH_CONSTRAINT_COLUMN" )
639 << tr( "GHS3D_ENF_GROUP_COLUMN" );
640 myEnforcedMeshTableWidget->setHorizontalHeaderLabels(enforcedMeshHeaders);
641 myEnforcedMeshTableWidget->horizontalHeader()->setStretchLastSection(true);
642 myEnforcedMeshTableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive);
644 myEnforcedMeshTableWidget->setAlternatingRowColors(true);
645 myEnforcedMeshTableWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
646 myEnforcedMeshTableWidget->setSelectionBehavior(QAbstractItemView::SelectItems);
647 myEnforcedMeshTableWidget->resizeColumnsToContents();
648 myEnforcedMeshTableWidget->hideColumn(ENF_MESH_ENTRY_COLUMN);
650 myEnforcedMeshTableWidget->setItemDelegate(new EnforcedMeshTableWidgetDelegate());
652 myEnfMeshWdg = new StdMeshersGUI_ObjectReferenceParamWdg( SMESH::IDSOURCE, myEnfMeshGroup, /*multiSel=*/true);
653 myEnfMeshWdg->SetDefaultText(tr("GHS3D_ENF_SELECT_MESH"), "QLineEdit { color: grey }");
655 myEnfMeshWdg->AvoidSimultaneousSelection(myEnfVertexWdg);
657 QLabel* myMeshConstraintLabel = new QLabel( tr( "GHS3D_ENF_MESH_CONSTRAINT_LABEL" ), myEnfMeshGroup );
658 myEnfMeshConstraint = new QComboBox(myEnfMeshGroup);
659 myEnfMeshConstraint->insertItems(0,myEnfMeshConstraintLabels);
660 myEnfMeshConstraint->setEditable(false);
661 myEnfMeshConstraint->setCurrentIndex(0);
663 QLabel* myMeshGroupNameLabel = new QLabel( tr( "GHS3D_ENF_GROUP_LABEL" ), myEnfMeshGroup );
664 myMeshGroupName = new QLineEdit(myEnfMeshGroup);
666 addEnfMeshButton = new QPushButton(tr("GHS3D_ENF_ADD"),myEnfMeshGroup);
667 removeEnfMeshButton = new QPushButton(tr("GHS3D_ENF_REMOVE"),myEnfMeshGroup);
669 anEnfMeshLayout->addWidget(myEnforcedMeshTableWidget, ENF_MESH_MESH, 0, ENF_MESH_NB_LINES , 1);
671 QGridLayout* anEnfMeshLayout2 = new QGridLayout(myEnfMeshGroup);
672 anEnfMeshLayout2->addWidget(myEnfMeshWdg, ENF_MESH_MESH, 0, 1, 2);
673 anEnfMeshLayout2->addWidget(myMeshConstraintLabel, ENF_MESH_CONSTRAINT, 0, 1, 1);
674 anEnfMeshLayout2->addWidget(myEnfMeshConstraint, ENF_MESH_CONSTRAINT, 1, 1, 1);
675 anEnfMeshLayout2->addWidget(myMeshGroupNameLabel, ENF_MESH_GROUP, 0, 1, 1);
676 anEnfMeshLayout2->addWidget(myMeshGroupName, ENF_MESH_GROUP, 1, 1, 1);
677 anEnfMeshLayout2->addWidget(addEnfMeshButton, ENF_MESH_BTN, 0, 1, 1);
678 anEnfMeshLayout2->addWidget(removeEnfMeshButton, ENF_MESH_BTN, 1, 1, 1);
679 anEnfMeshLayout2->setRowStretch(ENF_MESH_NB_LINES, 1);
681 anEnfMeshLayout->addLayout(anEnfMeshLayout2, ENF_MESH_MESH, 1, ENF_MESH_NB_LINES, 1);
682 anEnfMeshLayout->setRowStretch(ENF_MESH_MESH, 10);
685 tab->insertTab( STD_TAB, myStdGroup, tr( "SMESH_ARGUMENTS" ) );
686 tab->insertTab( ADV_TAB, myAdvGroup, tr( "GHS3D_ADV_ARGS" ) );
687 if ( !isOptimization() )
689 tab->insertTab( ENF_VER_TAB, myEnfGroup, tr( "GHS3D_ENFORCED_VERTICES" ) );
690 tab->insertTab( ENF_MESH_TAB, myEnfMeshGroup, tr( "GHS3D_ENFORCED_MESHES" ) );
692 tab->setCurrentIndex( STD_TAB );
694 connect( myAdvWidget->maxMemoryCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
695 connect( myAdvWidget->initialMemoryCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
696 connect( myAdvWidget->logInFileCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
697 connect( myAdvWidget->keepWorkingFilesCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
698 connect( myAdvWidget->workingDirectoryPushButton, SIGNAL( clicked() ), this, SLOT( onDirBtnClicked() ) );
699 connect( myAdvWidget->addBtn, SIGNAL( clicked() ), this, SLOT( onAddOption() ) );
701 connect( myEnforcedTableWidget, SIGNAL( itemClicked(QTableWidgetItem *)), this, SLOT( synchronizeCoords() ) );
702 connect( myEnforcedTableWidget, SIGNAL( itemChanged(QTableWidgetItem *)), this, SLOT( updateEnforcedVertexValues(QTableWidgetItem *) ) );
703 connect( myEnforcedTableWidget, SIGNAL( itemSelectionChanged() ), this, SLOT( synchronizeCoords() ) );
704 connect( addVertexButton, SIGNAL( clicked()), this, SLOT( onAddEnforcedVertex() ) );
705 connect( removeVertexButton, SIGNAL( clicked()), this, SLOT( onRemoveEnforcedVertex() ) );
706 connect( myEnfVertexWdg, SIGNAL( contentModified()), this, SLOT( onSelectEnforcedVertex() ) );
707 connect( myEnfVertexWdg, SIGNAL( contentModified()), this, SLOT( checkVertexIsDefined() ) );
708 connect( myXCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
709 connect( myYCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
710 connect( myZCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
711 connect( mySizeValue, SIGNAL( textChanged(const QString&) ), this, SLOT( checkVertexIsDefined() ) );
712 connect( myXCoord, SIGNAL( valueChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
713 connect( myYCoord, SIGNAL( valueChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
714 connect( myZCoord, SIGNAL( valueChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
715 connect( mySizeValue, SIGNAL( valueChanged(const QString&) ), this, SLOT( checkVertexIsDefined() ) );
716 connect( this, SIGNAL( vertexDefined(bool) ), addVertexButton, SLOT( setEnabled(bool) ) );
718 connect( addEnfMeshButton, SIGNAL( clicked()), this, SLOT( onAddEnforcedMesh() ) );
719 connect( removeEnfMeshButton, SIGNAL( clicked()), this, SLOT( onRemoveEnforcedMesh() ) );
725 * This method checks if an enforced vertex is defined;
727 void GHS3DPluginGUI_HypothesisCreator::clearEnfVertexSelection()
729 if (myEnfVertexWdg->NbObjects() != 0) {
730 disconnect( myEnfVertexWdg, SIGNAL( contentModified()), this, SLOT( onSelectEnforcedVertex() ) );
731 disconnect( myEnfVertexWdg, SIGNAL( contentModified()), this, SLOT( checkVertexIsDefined() ) );
732 myEnfVertexWdg->SetObject(GEOM::GEOM_Object::_nil());
733 connect( myEnfVertexWdg, SIGNAL( contentModified()), this, SLOT( onSelectEnforcedVertex() ) );
734 connect( myEnfVertexWdg, SIGNAL( contentModified()), this, SLOT( checkVertexIsDefined() ) );
736 GHS3DPluginGUI_HypothesisCreator* that = (GHS3DPluginGUI_HypothesisCreator*)this;
737 that->checkVertexIsDefined();
741 * This method checks if an enforced vertex is defined;
743 void GHS3DPluginGUI_HypothesisCreator::checkVertexIsDefined()
745 bool enfVertexIsDefined = false;
746 enfVertexIsDefined = (!mySizeValue->GetString().isEmpty() &&
747 (!myEnfVertexWdg->NbObjects() == 0 ||
748 (myEnfVertexWdg->NbObjects() == 0 && !myXCoord->GetString().isEmpty()
749 && !myYCoord->GetString().isEmpty()
750 && !myZCoord->GetString().isEmpty())));
751 emit vertexDefined(enfVertexIsDefined);
755 * This method checks if an enforced mesh is defined;
757 void GHS3DPluginGUI_HypothesisCreator::checkEnfMeshIsDefined()
759 emit enfMeshDefined( myEnfVertexWdg->NbObjects() != 0);
763 * This method resets the content of the X, Y, Z, size and GroupName widgets;
765 void GHS3DPluginGUI_HypothesisCreator::clearEnforcedVertexWidgets()
767 myXCoord->setCleared(true);
768 myYCoord->setCleared(true);
769 myZCoord->setCleared(true);
770 myXCoord->setText("");
771 myYCoord->setText("");
772 myZCoord->setText("");
773 addVertexButton->setEnabled(false);
776 /** GHS3DPluginGUI_HypothesisCreator::updateEnforcedVertexValues(item)
777 This method updates the tooltip of a modified item. The QLineEdit widgets content
778 is synchronized with the coordinates of the enforced vertex clicked in the tree widget.
780 void GHS3DPluginGUI_HypothesisCreator::updateEnforcedVertexValues(QTableWidgetItem* item)
782 int row = myEnforcedTableWidget->row(item);
784 QVariant vertexName = myEnforcedTableWidget->item(row,ENF_VER_NAME_COLUMN)->data(Qt::EditRole);
785 QVariant x = myEnforcedTableWidget->item(row,ENF_VER_X_COLUMN)->data( Qt::EditRole);
786 QVariant y = myEnforcedTableWidget->item(row,ENF_VER_Y_COLUMN)->data( Qt::EditRole);
787 QVariant z = myEnforcedTableWidget->item(row,ENF_VER_Z_COLUMN)->data( Qt::EditRole);
788 QVariant size = myEnforcedTableWidget->item(row,ENF_VER_SIZE_COLUMN)->data( Qt::EditRole);
789 QVariant entry = myEnforcedTableWidget->item(row,ENF_VER_ENTRY_COLUMN)->data( Qt::EditRole);
790 QString groupName = myEnforcedTableWidget->item(row,ENF_VER_GROUP_COLUMN)->data( Qt::EditRole).toString();
792 clearEnforcedVertexWidgets();
794 if ( !x.isNull() || !entry.isNull()) {
795 QString toolTip = vertexName.toString();
796 toolTip += QString("(");
797 if (entry.isNull() || (!entry.isNull() && entry.toString() == "")) {
798 toolTip += x.toString();
799 toolTip += QString(", ") + y.toString();
800 toolTip += QString(", ") + z.toString();
803 toolTip += entry.toString();
804 toolTip += QString(")");
807 toolTip += QString("=") + size.toString();
809 if (!groupName.isEmpty())
810 toolTip += QString(" [") + groupName + QString("]");
812 for (int col=0;col<ENF_VER_NB_COLUMNS;col++)
813 myEnforcedTableWidget->item(row,col)->setToolTip(toolTip);
816 disconnect( myXCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
817 disconnect( myYCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
818 disconnect( myZCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
819 myXCoord->SetValue(x.toDouble());
820 myYCoord->SetValue(y.toDouble());
821 myZCoord->SetValue(z.toDouble());
822 connect( myXCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
823 connect( myYCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
824 connect( myZCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
827 mySizeValue->SetValue(size.toDouble());
829 if (!groupName.isEmpty())
830 myGroupName->setText(groupName);
834 void GHS3DPluginGUI_HypothesisCreator::onSelectEnforcedVertex()
836 size_t nbSelEnfVertex = myEnfVertexWdg->NbObjects();
837 clearEnforcedVertexWidgets();
838 if (nbSelEnfVertex == 1)
840 if ( CORBA::is_nil( getGeomEngine() ) && !GeometryGUI::InitGeomGen() )
843 myEnfVertex = myEnfVertexWdg->GetObject< GEOM::GEOM_Object >(nbSelEnfVertex-1);
844 if (myEnfVertex == GEOM::GEOM_Object::_nil())
846 if (myEnfVertex->GetShapeType() == GEOM::VERTEX)
848 GEOM::GEOM_IMeasureOperations_var measureOp = getGeomEngine()->GetIMeasureOperations( );
849 if (CORBA::is_nil(measureOp))
853 measureOp->PointCoordinates (myEnfVertex, x, y, z);
854 if ( measureOp->IsDone() )
856 disconnect( myXCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
857 disconnect( myYCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
858 disconnect( myZCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
859 myXCoord->SetValue(x);
860 myYCoord->SetValue(y);
861 myZCoord->SetValue(z);
862 connect( myXCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
863 connect( myYCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
864 connect( myZCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
870 /** GHS3DPluginGUI_HypothesisCreator::synchronizeCoords()
871 This method synchronizes the QLineEdit/SMESHGUI_SpinBox widgets content with the coordinates
872 of the enforced vertex clicked in the tree widget.
874 void GHS3DPluginGUI_HypothesisCreator::synchronizeCoords()
876 clearEnforcedVertexWidgets();
877 QList<QTableWidgetItem *> items = myEnforcedTableWidget->selectedItems();
878 disconnect( myEnfVertexWdg, SIGNAL( contentModified()), this, SLOT( onSelectEnforcedVertex() ) );
879 if (! items.isEmpty()) {
880 QTableWidgetItem *item;
883 if (items.size() == 1) {
885 row = myEnforcedTableWidget->row(item);
886 QVariant x = myEnforcedTableWidget->item(row,ENF_VER_X_COLUMN)->data( Qt::EditRole);
887 QVariant y = myEnforcedTableWidget->item(row,ENF_VER_Y_COLUMN)->data( Qt::EditRole);
888 QVariant z = myEnforcedTableWidget->item(row,ENF_VER_Z_COLUMN)->data( Qt::EditRole);
889 QVariant size = myEnforcedTableWidget->item(row,ENF_VER_SIZE_COLUMN)->data( Qt::EditRole);
890 entry = myEnforcedTableWidget->item(row,ENF_VER_ENTRY_COLUMN)->data( Qt::EditRole);
891 if (!entry.isNull()) {
892 SMESH::string_array_var objIds = new SMESH::string_array;
894 objIds[0] = entry.toString().toStdString().c_str();
895 myEnfVertexWdg->SetObjects(objIds);
898 myEnfVertexWdg->SetObject(GEOM::GEOM_Object::_nil());
900 QVariant group = myEnforcedTableWidget->item(row,ENF_VER_GROUP_COLUMN)->data( Qt::EditRole);
901 if (!x.isNull()/* && entry.isNull()*/) {
902 // disconnect( myXCoord, SIGNAL( textChanged(const QString &)), this, SLOT( onSelectEnforcedVertex() ) );
903 disconnect( myXCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
904 disconnect( myYCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
905 disconnect( myZCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
906 myXCoord->SetValue(x.toDouble());
907 myYCoord->SetValue(y.toDouble());
908 myZCoord->SetValue(z.toDouble());
909 connect( myXCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
910 connect( myYCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
911 connect( myZCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
914 mySizeValue->SetValue(size.toDouble());
916 if (!group.isNull() && (!x.isNull() || !entry.isNull()))
917 myGroupName->setText(group.toString());
920 QList<QString> entryList;
921 for (int i = 0; i < items.size(); ++i) {
923 row = myEnforcedTableWidget->row(item);
924 entry = myEnforcedTableWidget->item(row,ENF_VER_ENTRY_COLUMN)->data( Qt::EditRole);
926 entryList << entry.toString();
928 if (entryList.size() > 0) {
929 SMESH::string_array_var objIds = new SMESH::string_array;
930 objIds->length(entryList.size());
931 for (int i = 0; i < entryList.size() ; i++)
932 objIds[i] = entryList.at(i).toStdString().c_str();
933 myEnfVertexWdg->SetObjects(objIds);
936 myEnfVertexWdg->SetObject(GEOM::GEOM_Object::_nil());
941 myEnfVertexWdg->SetObject(GEOM::GEOM_Object::_nil());
943 connect( myEnfVertexWdg, SIGNAL( contentModified()), this, SLOT( onSelectEnforcedVertex() ) );
944 GHS3DPluginGUI_HypothesisCreator* that = (GHS3DPluginGUI_HypothesisCreator*)this;
945 that->checkVertexIsDefined();
948 /** GHS3DPluginGUI_HypothesisCreator::addEnforcedMesh( meshName, geomEntry, elemType, size, groupName)
949 This method adds in the tree widget an enforced mesh from mesh, submesh or group with optionally size and and groupName.
951 void GHS3DPluginGUI_HypothesisCreator::addEnforcedMesh(std::string name,
954 std::string groupName)
956 bool okToCreate = true;
957 QString itemEntry = "";
958 int itemElementType = 0;
959 int rowCount = myEnforcedMeshTableWidget->rowCount();
960 bool allColumns = true;
961 for (int row = 0;row<rowCount;row++) {
962 for (int col = 0 ; col < ENF_MESH_NB_COLUMNS ; col++) {
963 if (col == ENF_MESH_CONSTRAINT_COLUMN){
964 if (qobject_cast<QComboBox*>(myEnforcedMeshTableWidget->cellWidget(row, col)) == 0) {
969 else if (myEnforcedMeshTableWidget->item(row, col) == 0) {
973 if (col == ENF_MESH_CONSTRAINT_COLUMN) {
974 QComboBox* itemComboBox = qobject_cast<QComboBox*>(myEnforcedMeshTableWidget->cellWidget(row, col));
975 itemElementType = itemComboBox->currentIndex();
977 else if (col == ENF_MESH_ENTRY_COLUMN)
978 itemEntry = myEnforcedMeshTableWidget->item(row, col)->data(Qt::EditRole).toString();
984 if (itemEntry == QString(entry.c_str()) && itemElementType == elementType) {
994 myEnforcedMeshTableWidget->setRowCount(rowCount+1);
995 myEnforcedMeshTableWidget->setSortingEnabled(false);
997 for (int col=0;col<ENF_MESH_NB_COLUMNS;col++) {
998 if (col == ENF_MESH_CONSTRAINT_COLUMN) {
999 QComboBox* comboBox = new QComboBox();
1000 QPalette pal = comboBox->palette();
1001 pal.setColor(QPalette::Button, Qt::white);
1002 comboBox->setPalette(pal);
1003 comboBox->insertItems(0,myEnfMeshConstraintLabels);
1004 comboBox->setEditable(false);
1005 comboBox->setCurrentIndex(elementType);
1006 myEnforcedMeshTableWidget->setCellWidget(rowCount,col,comboBox);
1009 QTableWidgetItem* item = new QTableWidgetItem();
1010 item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled);
1012 case ENF_MESH_NAME_COLUMN:
1013 item->setData( 0, name.c_str() );
1014 item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled);
1015 myEnforcedMeshTableWidget->setItem(rowCount,col,item);
1017 case ENF_MESH_ENTRY_COLUMN:
1018 item->setData( 0, entry.c_str() );
1019 item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled);
1020 myEnforcedMeshTableWidget->setItem(rowCount,col,item);
1022 case ENF_MESH_GROUP_COLUMN:
1023 item->setData( 0, groupName.c_str() );
1024 myEnforcedMeshTableWidget->setItem(rowCount,col,item);
1031 myEnforcedMeshTableWidget->setSortingEnabled(true);
1034 /** GHS3DPluginGUI_HypothesisCreator::addEnforcedVertex( x, y, z, size, vertexName, geomEntry, groupName)
1035 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.
1037 void GHS3DPluginGUI_HypothesisCreator::addEnforcedVertex(double x, double y, double z, double size, std::string vertexName, std::string geomEntry, std::string groupName, bool isCompound)
1039 myEnforcedTableWidget->disconnect(SIGNAL( itemChanged(QTableWidgetItem *)));
1040 bool okToCreate = true;
1041 double itemX=0.,itemY=0.,itemZ=0.,itemSize = 0;
1042 QString itemEntry, itemGroupName = QString("");
1043 // bool itemIsCompound;
1044 int rowCount = myEnforcedTableWidget->rowCount();
1047 for (int row = 0;row<rowCount;row++) {
1049 for (int col = 0 ; col < ENF_VER_NB_COLUMNS ; col++) {
1050 if (myEnforcedTableWidget->item(row, col) == 0) {
1055 data = myEnforcedTableWidget->item(row, col)->data(Qt::EditRole);
1056 if (!data.isNull()) {
1058 case ENF_VER_GROUP_COLUMN:
1059 itemGroupName = data.toString();
1061 case ENF_VER_ENTRY_COLUMN:
1062 itemEntry = data.toString();
1064 case ENF_VER_X_COLUMN:
1065 itemX = data.toDouble();
1067 case ENF_VER_Y_COLUMN:
1068 itemY = data.toDouble();
1070 case ENF_VER_Z_COLUMN:
1071 itemZ = data.toDouble();
1073 case ENF_VER_SIZE_COLUMN:
1074 itemSize = data.toDouble();
1086 if (( !isCompound && ((itemX == x) && (itemY == y) && (itemZ == z))) ||
1087 ( !itemEntry.isEmpty() && ( itemEntry == geomEntry.c_str() )))
1090 if (itemSize != size) {
1091 myEnforcedTableWidget->item(row, ENF_VER_SIZE_COLUMN)->setData( Qt::EditRole, QVariant(size));
1093 // update group name
1094 if (itemGroupName.toStdString() != groupName) {
1095 myEnforcedTableWidget->item(row, ENF_VER_GROUP_COLUMN)->setData( Qt::EditRole, QVariant(groupName.c_str()));
1102 if (geomEntry.empty()) {
1111 QString myVertexName;
1112 while(indexRef != vertexIndex) {
1113 indexRef = vertexIndex;
1114 if (vertexName.empty())
1115 myVertexName = QString("Vertex #%1").arg(vertexIndex);
1117 myVertexName = QString(vertexName.c_str());
1119 for (int row = 0;row<rowCount;row++) {
1120 QString name = myEnforcedTableWidget->item(row,ENF_VER_NAME_COLUMN)->data(Qt::EditRole).toString();
1121 if (myVertexName == name) {
1128 myEnforcedTableWidget->setRowCount(rowCount+1);
1129 myEnforcedTableWidget->setSortingEnabled(false);
1130 for (int col=0;col<ENF_VER_NB_COLUMNS;col++) {
1131 QTableWidgetItem* item = new QTableWidgetItem();
1132 item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled);
1134 case ENF_VER_NAME_COLUMN:
1135 item->setData( Qt::EditRole, myVertexName );
1136 if (!geomEntry.empty()) {
1138 item->setIcon(QIcon(iconCompound.scaled(iconCompound.size()*0.7,Qt::KeepAspectRatio,Qt::SmoothTransformation)));
1140 item->setIcon(QIcon(iconVertex.scaled(iconVertex.size()*0.7,Qt::KeepAspectRatio,Qt::SmoothTransformation)));
1143 case ENF_VER_X_COLUMN:
1145 item->setData( 0, QVariant(x) );
1147 case ENF_VER_Y_COLUMN:
1149 item->setData( 0, QVariant(y) );
1151 case ENF_VER_Z_COLUMN:
1153 item->setData( 0, QVariant(z) );
1155 case ENF_VER_SIZE_COLUMN:
1156 item->setData( 0, QVariant(size) );
1158 case ENF_VER_ENTRY_COLUMN:
1159 if (!geomEntry.empty())
1160 item->setData( 0, QString(geomEntry.c_str()) );
1162 case ENF_VER_COMPOUND_COLUMN:
1163 item->setData( Qt::CheckStateRole, isCompound );
1164 item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable);
1166 case ENF_VER_GROUP_COLUMN:
1167 if (!groupName.empty())
1168 item->setData( 0, QString(groupName.c_str()) );
1174 myEnforcedTableWidget->setItem(rowCount,col,item);
1177 connect( myEnforcedTableWidget,SIGNAL( itemChanged(QTableWidgetItem *)), this, SLOT( updateEnforcedVertexValues(QTableWidgetItem *) ) );
1179 myEnforcedTableWidget->setSortingEnabled(true);
1180 // myEnforcedTableWidget->setCurrentItem(myEnforcedTableWidget->item(rowCount,ENF_VER_NAME_COLUMN));
1181 updateEnforcedVertexValues(myEnforcedTableWidget->item(rowCount,ENF_VER_NAME_COLUMN));
1184 /** GHS3DPluginGUI_HypothesisCreator::onAddEnforcedMesh()
1185 This method is called when a item is added into the enforced meshes tree widget
1187 void GHS3DPluginGUI_HypothesisCreator::onAddEnforcedMesh()
1189 GHS3DPluginGUI_HypothesisCreator* that = (GHS3DPluginGUI_HypothesisCreator*)this;
1191 that->getGeomSelectionTool()->selectionMgr()->clearFilters();
1192 myEnfMeshWdg->deactivateSelection();
1194 for (int column = 0; column < myEnforcedMeshTableWidget->columnCount(); ++column)
1195 myEnforcedMeshTableWidget->resizeColumnToContents(column);
1198 size_t selEnfMeshes = myEnfMeshWdg->NbObjects();
1199 if (selEnfMeshes == 0)
1202 std::string groupName = myMeshGroupName->text().simplified().toStdString();
1204 int elementType = myEnfMeshConstraint->currentIndex();
1207 _PTR(Study) aStudy = SMESH::getStudy();
1208 _PTR(SObject) aSObj;
1209 QString meshEntry = myEnfMeshWdg->GetValue();
1211 if (selEnfMeshes == 1)
1213 aSObj = aStudy->FindObjectID(meshEntry.toStdString().c_str());
1214 CORBA::Object_var anObj = SMESH::SObjectToObject(aSObj);
1215 if (!CORBA::is_nil(anObj)) {
1216 addEnforcedMesh( aSObj->GetName(), aSObj->GetID(), elementType, groupName);
1221 QStringList meshEntries = meshEntry.split(" ", QString::SkipEmptyParts);
1222 QStringListIterator meshEntriesIt (meshEntries);
1223 while (meshEntriesIt.hasNext()) {
1224 aSObj = aStudy->FindObjectID(meshEntriesIt.next().toStdString().c_str());
1225 CORBA::Object_var anObj = SMESH::SObjectToObject(aSObj);
1226 if (!CORBA::is_nil(anObj)) {
1227 addEnforcedMesh( aSObj->GetName(), aSObj->GetID(), elementType, groupName);
1232 myEnfVertexWdg->SetObject(SMESH::SMESH_IDSource::_nil());
1234 for (int column = 0; column < myEnforcedMeshTableWidget->columnCount(); ++column)
1235 myEnforcedMeshTableWidget->resizeColumnToContents(column);
1239 /** GHS3DPluginGUI_HypothesisCreator::onAddEnforcedVertex()
1240 This method is called when a item is added into the enforced vertices tree widget
1242 void GHS3DPluginGUI_HypothesisCreator::onAddEnforcedVertex()
1244 GHS3DPluginGUI_HypothesisCreator* that = (GHS3DPluginGUI_HypothesisCreator*)this;
1246 that->getGeomSelectionTool()->selectionMgr()->clearFilters();
1247 myEnfVertexWdg->deactivateSelection();
1249 for (int column = 0; column < myEnforcedTableWidget->columnCount(); ++column)
1250 myEnforcedTableWidget->resizeColumnToContents(column);
1253 size_t selEnfVertex = myEnfVertexWdg->NbObjects();
1254 bool coordsEmpty = (myXCoord->text().isEmpty()) || (myYCoord->text().isEmpty()) || (myZCoord->text().isEmpty());
1255 if ((selEnfVertex == 0) && coordsEmpty)
1258 std::string groupName = myGroupName->text().simplified().toStdString();
1260 double size = mySizeValue->GetValue();
1262 if (selEnfVertex <= 1)
1264 double x = 0, y = 0, z=0;
1265 if (myXCoord->GetString() != "") {
1266 x = myXCoord->GetValue();
1267 y = myYCoord->GetValue();
1268 z = myZCoord->GetValue();
1270 if (selEnfVertex == 1) {
1271 myEnfVertex = myEnfVertexWdg->GetObject< GEOM::GEOM_Object >();
1272 std::string entry = "", name = "";
1273 bool isCompound = false;
1274 if ( !myEnfVertex->_is_nil() ) {
1275 entry = SMESH::toStdStr( myEnfVertex->GetStudyEntry() );
1276 name = SMESH::toStdStr( myEnfVertex->GetName() );
1277 isCompound = ( myEnfVertex->GetShapeType() == GEOM::COMPOUND );
1279 addEnforcedVertex(x, y, z, size, name, entry, groupName, isCompound);
1282 addEnforcedVertex(x, y, z, size, "", "", groupName);
1287 if ( CORBA::is_nil(getGeomEngine()))
1290 GEOM::GEOM_IMeasureOperations_var measureOp = getGeomEngine()->GetIMeasureOperations( );
1291 if (CORBA::is_nil(measureOp))
1294 CORBA::Double x = 0, y = 0,z = 0;
1295 for ( size_t j = 0 ; j < selEnfVertex ; j++)
1297 myEnfVertex = myEnfVertexWdg->GetObject< GEOM::GEOM_Object >(j);
1298 if (myEnfVertex == GEOM::GEOM_Object::_nil())
1300 if (myEnfVertex->GetShapeType() == GEOM::VERTEX) {
1301 measureOp->PointCoordinates (myEnfVertex, x, y, z);
1302 if ( measureOp->IsDone() )
1303 addEnforcedVertex(x, y, z, size, myEnfVertex->GetName(),myEnfVertex->GetStudyEntry(), groupName);
1304 } else if (myEnfVertex->GetShapeType() == GEOM::COMPOUND) {
1305 addEnforcedVertex(0., 0., 0., size, myEnfVertex->GetName(),myEnfVertex->GetStudyEntry(), groupName, true);
1310 myEnfVertexWdg->SetObject(GEOM::GEOM_Object::_nil());
1312 for (int column = 0; column < myEnforcedTableWidget->columnCount(); ++column)
1313 myEnforcedTableWidget->resizeColumnToContents(column);
1316 /** GHS3DPluginGUI_HypothesisCreator::onRemoveEnforcedMesh()
1317 This method is called when a item is removed from the enforced meshes tree widget
1319 void GHS3DPluginGUI_HypothesisCreator::onRemoveEnforcedMesh()
1321 QList<int> selectedRows;
1322 QList<QTableWidgetItem *> selectedItems = myEnforcedMeshTableWidget->selectedItems();
1323 QTableWidgetItem* item;
1325 foreach( item, selectedItems ) {
1327 if (!selectedRows.contains( row ) )
1328 selectedRows.append(row);
1331 qSort( selectedRows );
1332 QListIterator<int> it( selectedRows );
1334 while ( it.hasPrevious() ) {
1335 row = it.previous();
1336 myEnforcedMeshTableWidget->removeRow(row );
1339 myEnforcedMeshTableWidget->selectionModel()->clearSelection();
1342 /** GHS3DPluginGUI_HypothesisCreator::onRemoveEnforcedVertex()
1343 This method is called when a item is removed from the enforced vertices tree widget
1345 void GHS3DPluginGUI_HypothesisCreator::onRemoveEnforcedVertex()
1347 QList<int> selectedRows;
1348 QList<QTableWidgetItem *> selectedItems = myEnforcedTableWidget->selectedItems();
1349 QTableWidgetItem* item;
1351 foreach( item, selectedItems ) {
1353 if (!selectedRows.contains( row ) )
1354 selectedRows.append(row);
1357 qSort( selectedRows );
1358 QListIterator<int> it( selectedRows );
1360 while ( it.hasPrevious() ) {
1361 row = it.previous();
1362 myEnforcedTableWidget->removeRow(row );
1365 myEnforcedTableWidget->selectionModel()->clearSelection();
1368 void GHS3DPluginGUI_HypothesisCreator::onToMeshHoles(bool /*isOn*/)
1370 // myToMakeGroupsOfDomains->setEnabled( isOn );
1372 // myToMakeGroupsOfDomains->setChecked( false );
1375 void GHS3DPluginGUI_HypothesisCreator::onDirBtnClicked()
1377 QString dir = SUIT_FileDlg::getExistingDirectory( dlg(), myAdvWidget->workingDirectoryLineEdit->text(), QString() );
1378 if ( !dir.isEmpty() )
1379 myAdvWidget->workingDirectoryLineEdit->setText( dir );
1382 void GHS3DPluginGUI_HypothesisCreator::updateWidgets()
1384 //myToMakeGroupsOfDomains->setEnabled( myToMeshHolesCheck->isChecked() );
1385 myAdvWidget->maxMemorySpin->setEnabled( myAdvWidget->maxMemoryCheck->isChecked() );
1386 //myAdvWidget->initialMemoryCheck->setEnabled( !myAdvWidget->boundaryRecoveryCheck->isChecked() );
1387 myAdvWidget->initialMemorySpin->setEnabled( myAdvWidget->initialMemoryCheck->isChecked() /*&& !myAdvWidget->boundaryRecoveryCheck->isChecked()*/ );
1388 //myOptimizationLevelCombo->setEnabled( !myAdvWidget->boundaryRecoveryCheck->isChecked() );
1389 if ( sender() == myAdvWidget->logInFileCheck ||
1390 sender() == myAdvWidget->keepWorkingFilesCheck )
1392 bool logFileRemovable = ( myAdvWidget->logInFileCheck->isChecked() &&
1393 !myAdvWidget->keepWorkingFilesCheck->isChecked() );
1394 myAdvWidget->removeLogOnSuccessCheck->setEnabled( logFileRemovable );
1398 bool GHS3DPluginGUI_HypothesisCreator::checkParams(QString& msg) const
1400 if ( !QFileInfo( myAdvWidget->workingDirectoryLineEdit->text().trimmed() ).isWritable() ) {
1401 SUIT_MessageBox::warning( dlg(),
1402 tr( "SMESH_WRN_WARNING" ),
1403 tr( "GHS3D_PERMISSION_DENIED" ) );
1407 GHS3DPlugin::GHS3DPlugin_Hypothesis_var h =
1408 GHS3DPlugin::GHS3DPlugin_Hypothesis::_narrow( hypothesis() );
1410 myAdvWidget->myOptionTable->setFocus();
1411 QApplication::instance()->processEvents();
1413 QString name, value;
1414 bool isDefault, ok = true;
1415 int iRow = 0, nbRows = myAdvWidget->myOptionTable->topLevelItemCount();
1416 for ( ; iRow < nbRows; ++iRow )
1418 QTreeWidgetItem* row = myAdvWidget->myOptionTable->topLevelItem( iRow );
1419 myAdvWidget->GetOptionAndValue( row, name, value, isDefault );
1421 if ( name.simplified().isEmpty() )
1422 continue; // invalid custom option
1424 if ( isDefault ) // not selected option
1428 h->SetOptionValue( name.toLatin1().constData(), value.toLatin1().constData() );
1430 catch ( const SALOME::SALOME_Exception& ex )
1432 msg = ex.details.text.in();
1440 h->SetOptionValues( myOptions ); // restore values
1446 void GHS3DPluginGUI_HypothesisCreator::retrieveParams() const
1448 GHS3DPluginGUI_HypothesisCreator* that = (GHS3DPluginGUI_HypothesisCreator*)this;
1449 GHS3DHypothesisData data;
1450 readParamsFromHypo( data );
1454 myName->setText( data.myName );
1456 int width = QFontMetrics( myName->font() ).width( data.myName );
1457 QGridLayout* aStdLayout = (QGridLayout*) myStdGroup->layout();
1458 aStdLayout->setColumnMinimumWidth( 1, width + 10 );
1460 myToMeshHolesCheck ->setChecked ( data.myToMeshHoles );
1461 myToMakeGroupsOfDomains ->setChecked ( data.myToMakeGroupsOfDomains );
1462 myOptimizationLevelCombo ->setCurrentIndex( data.myOptimizationLevel );
1463 if ( myOptimizationCombo ) // optimizer
1465 myOptimizationCombo ->setCurrentIndex( data.myOptimization );
1466 mySplitOverConstrainedCombo ->setCurrentIndex( data.mySplitOverConstrained );
1467 myPThreadsModeCombo ->setCurrentIndex( data.myPThreadsMode );
1468 myNumberOfThreadsSpin ->setValue ( data.myNumberOfThreads );
1469 mySmoothOffSliversCheck ->setChecked ( data.mySmoothOffSlivers );
1470 myCreateNewNodesCheck ->setChecked ( data.myToCreateNewNodes );
1474 myMinSizeSpin->setValue( data.myMinSize );
1475 myMinSizeCheck->setChecked( data.myUseMinSize );
1476 myMaxSizeSpin->setValue( data.myMaxSize );
1477 myMaxSizeCheck->setChecked( data.myUseMaxSize );
1478 myGradationCheck->setChecked( data.myUseGradation );
1479 myGradationSpin->setValue( data.myUseGradation ? data.myGradation : GHS3DPlugin_Hypothesis::DefaultGradation() );
1480 myUseProximityGroup->setChecked( data.myUseProximity );
1481 myNbProximityLayers->setValue( data.myNbProximityLayers );
1483 myAdvWidget->maxMemoryCheck ->setChecked ( data.myMaximumMemory > 0 );
1484 myAdvWidget->maxMemorySpin ->setValue
1485 ( qMax( data.myMaximumMemory, (float)myAdvWidget->maxMemorySpin->minimum() ));
1486 myAdvWidget->initialMemoryCheck ->setChecked ( data.myInitialMemory > 0 );
1487 myAdvWidget->initialMemorySpin ->setValue
1488 ( qMax( data.myInitialMemory, (float)myAdvWidget->initialMemorySpin->minimum() ));
1489 myAdvWidget->workingDirectoryLineEdit ->setText ( data.myWorkingDir );
1490 myAdvWidget->keepWorkingFilesCheck ->setChecked ( data.myKeepFiles );
1491 myAdvWidget->verboseLevelSpin ->setValue ( data.myVerboseLevel );
1492 myAdvWidget->logInFileCheck ->setChecked ( !data.myLogInStandardOutput );
1493 myAdvWidget->removeLogOnSuccessCheck ->setChecked ( data.myRemoveLogOnSuccess );
1495 if ( myOptions.operator->() ) {
1496 for ( int i = 0, nb = myOptions->length(); i < nb; ++i )
1497 myAdvWidget->AddOption( that->myOptions[i].in() );
1499 if ( myCustomOptions.operator->() ) {
1500 for ( int i = 0, nb = myCustomOptions->length(); i < nb; ++i )
1501 myAdvWidget->AddOption( that->myCustomOptions[i].in() );
1503 myAdvWidget->myOptionTable->resizeColumnToContents( OPTION_NAME_COLUMN );
1506 TEnfVertexList::const_iterator it;
1508 myEnforcedTableWidget->clearContents();
1509 myEnforcedTableWidget->setSortingEnabled(false);
1510 myEnforcedTableWidget->disconnect(SIGNAL( itemChanged(QTableWidgetItem *)));
1511 for(it = data.myEnforcedVertices.begin() ; it != data.myEnforcedVertices.end(); it++ )
1513 TEnfVertex* enfVertex = (*it);
1514 myEnforcedTableWidget->setRowCount(rowCount+1);
1516 for (int col=0;col<ENF_VER_NB_COLUMNS;col++) {
1517 QTableWidgetItem* item = new QTableWidgetItem();
1518 item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled);
1520 case ENF_VER_NAME_COLUMN:
1521 item->setData( 0, enfVertex->name.c_str() );
1522 if (!enfVertex->geomEntry.empty()) {
1523 if (enfVertex->isCompound)
1524 item->setIcon(QIcon(iconCompound.scaled(iconCompound.size()*0.7,Qt::KeepAspectRatio,Qt::SmoothTransformation)));
1526 item->setIcon(QIcon(iconVertex.scaled(iconVertex.size()*0.7,Qt::KeepAspectRatio,Qt::SmoothTransformation)));
1530 case ENF_VER_X_COLUMN:
1531 if (!enfVertex->isCompound) {
1532 item->setData( 0, enfVertex->coords.at(0) );
1535 case ENF_VER_Y_COLUMN:
1536 if (!enfVertex->isCompound) {
1537 item->setData( 0, enfVertex->coords.at(1) );
1540 case ENF_VER_Z_COLUMN:
1541 if (!enfVertex->isCompound) {
1542 item->setData( 0, enfVertex->coords.at(2) );
1545 case ENF_VER_SIZE_COLUMN:
1546 item->setData( 0, enfVertex->size );
1548 case ENF_VER_ENTRY_COLUMN:
1549 item->setData( 0, enfVertex->geomEntry.c_str() );
1551 case ENF_VER_COMPOUND_COLUMN:
1552 item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable);
1553 item->setData( Qt::CheckStateRole, enfVertex->isCompound );
1555 case ENF_VER_GROUP_COLUMN:
1556 item->setData( 0, enfVertex->groupName.c_str() );
1562 myEnforcedTableWidget->setItem(rowCount,col,item);
1564 that->updateEnforcedVertexValues(myEnforcedTableWidget->item(rowCount,ENF_VER_NAME_COLUMN));
1568 connect( myEnforcedTableWidget,SIGNAL( itemChanged(QTableWidgetItem *)), this, SLOT( updateEnforcedVertexValues(QTableWidgetItem *) ) );
1569 myEnforcedTableWidget->setSortingEnabled(true);
1571 for (int column = 0; column < myEnforcedTableWidget->columnCount(); ++column)
1572 myEnforcedTableWidget->resizeColumnToContents(column);
1574 // Update Enforced meshes QTableWidget
1575 TEnfMeshList::const_iterator itMesh;
1577 myEnforcedMeshTableWidget->clearContents();
1578 myEnforcedMeshTableWidget->setSortingEnabled(false);
1579 // myEnforcedMeshTableWidget->disconnect(SIGNAL( itemChanged(QTableWidgetItem *)));
1580 for(itMesh = data.myEnforcedMeshes.begin() ; itMesh != data.myEnforcedMeshes.end(); itMesh++ )
1582 TEnfMesh* enfMesh = (*itMesh);
1583 myEnforcedMeshTableWidget->setRowCount(rowCount+1);
1585 for (int col=0;col<ENF_MESH_NB_COLUMNS;col++) {
1586 if (col == ENF_MESH_CONSTRAINT_COLUMN) {
1587 QComboBox* comboBox = new QComboBox();
1588 QPalette pal = comboBox->palette();
1589 pal.setColor(QPalette::Button, Qt::white);
1590 comboBox->setPalette(pal);
1591 comboBox->insertItems(0,myEnfMeshConstraintLabels);
1592 comboBox->setEditable(false);
1593 comboBox->setCurrentIndex(enfMesh->elementType);
1594 myEnforcedMeshTableWidget->setCellWidget(rowCount,col,comboBox);
1597 QTableWidgetItem* item = new QTableWidgetItem();
1598 item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled);
1600 case ENF_MESH_NAME_COLUMN:
1601 item->setData( 0, enfMesh->name.c_str() );
1602 item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled);
1603 myEnforcedMeshTableWidget->setItem(rowCount,col,item);
1605 case ENF_MESH_ENTRY_COLUMN:
1606 item->setData( 0, enfMesh->entry.c_str() );
1607 item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled);
1608 myEnforcedMeshTableWidget->setItem(rowCount,col,item);
1610 case ENF_MESH_GROUP_COLUMN:
1611 item->setData( 0, enfMesh->groupName.c_str() );
1612 myEnforcedMeshTableWidget->setItem(rowCount,col,item);
1623 myEnforcedMeshTableWidget->setSortingEnabled(true);
1625 for (int col=0;col<ENF_MESH_NB_COLUMNS;col++)
1626 myEnforcedMeshTableWidget->resizeColumnToContents(col);
1628 that->updateWidgets();
1629 that->checkVertexIsDefined();
1632 QString GHS3DPluginGUI_HypothesisCreator::storeParams() const
1634 GHS3DHypothesisData data;
1635 readParamsFromWidgets( data );
1636 storeParamsToHypo( data );
1638 QString valStr = "";
1640 if ( !data.myBoundaryRecovery )
1641 valStr = " --components " + data.myToMeshHoles ? "all" : "outside_components" ;
1643 if ( data.myOptimizationLevel >= 0 && data.myOptimizationLevel < 5 && !data.myBoundaryRecovery) {
1644 const char* level[] = { "none" , "light" , "standard" , "standard+" , "strong" };
1645 valStr += " --optimisation_level ";
1646 valStr += level[ data.myOptimizationLevel ];
1648 if ( data.myMaximumMemory > 0 ) {
1649 valStr += " --max_memory ";
1650 valStr += QString::number( data.myMaximumMemory );
1652 if ( data.myInitialMemory > 0 && !data.myBoundaryRecovery ) {
1653 valStr += " --automatic_memory ";
1654 valStr += QString::number( data.myInitialMemory );
1656 valStr += " --verbose ";
1657 valStr += QString::number( data.myVerboseLevel );
1659 if ( !data.myToCreateNewNodes )
1660 valStr += " --no_internal_points";
1662 if ( data.myRemoveInitialCentralPoint )
1663 valStr += " --no_initial_central_point";
1665 // if ( data.myBoundaryRecovery )
1668 // if ( data.myFEMCorrection )
1669 // valStr += " -FEM";
1671 if ( data.myGradation != 1.05 ) {
1672 valStr += " -Dcpropa=";
1673 valStr += QString::number( data.myGradation );
1679 bool GHS3DPluginGUI_HypothesisCreator::readParamsFromHypo( GHS3DHypothesisData& h_data ) const
1681 GHS3DPlugin::GHS3DPlugin_Hypothesis_var h =
1682 GHS3DPlugin::GHS3DPlugin_Hypothesis::_narrow( initParamsHypothesis() );
1683 GHS3DPlugin::GHS3DPlugin_OptimizerHypothesis_var opt =
1684 GHS3DPlugin::GHS3DPlugin_OptimizerHypothesis::_narrow( initParamsHypothesis() );
1686 HypothesisData* data = SMESH::GetHypothesisData( hypType() );
1687 h_data.myName = isCreation() && data ? hypName() : "";
1689 if ( !opt->_is_nil() )
1691 h_data.myOptimization = opt->GetOptimization();
1692 h_data.mySplitOverConstrained = opt->GetSplitOverConstrained();
1693 h_data.myPThreadsMode = opt->GetPThreadsMode();
1694 h_data.myNumberOfThreads = opt->GetMaximalNumberOfThreads();
1695 h_data.mySmoothOffSlivers = opt->GetSmoothOffSlivers();
1699 // avoid "Conditional jump or move depends on uninitialised value" error
1700 h_data.myOptimization = 1;
1701 h_data.mySplitOverConstrained = 1;
1702 h_data.myPThreadsMode = 1;
1703 h_data.myNumberOfThreads = 1;
1704 h_data.mySmoothOffSlivers = 1;
1706 h_data.myOptimizationLevel = h->GetOptimizationLevel();
1707 h_data.myMinSize = h->GetMinSize();
1708 h_data.myMaxSize = h->GetMaxSize();
1709 this->myMinSizeDefault = h->GetMinSizeDefault();
1710 this->myMaxSizeDefault = h->GetMaxSizeDefault();
1711 if ( ! ( h_data.myUseMinSize = h_data.myMinSize > 0 ))
1712 h_data.myMinSize = this->myMinSizeDefault;
1713 if ( ! ( h_data.myUseMaxSize = h_data.myMaxSize > 0 ))
1714 h_data.myMaxSize = this->myMaxSizeDefault;
1715 h_data.myNbProximityLayers = h->GetNbVolumeProximityLayers();
1716 h_data.myUseGradation = h->GetGradation() != GHS3DPlugin_Hypothesis::DefaultGradation();
1717 h_data.myUseProximity = h->GetVolumeProximity();
1718 h_data.myToMeshHoles = h->GetToMeshHoles();
1719 h_data.myToMakeGroupsOfDomains = h->GetToMakeGroupsOfDomains();
1720 h_data.myMaximumMemory = h->GetMaximumMemory();
1721 h_data.myInitialMemory = h->GetInitialMemory();
1722 h_data.myInitialMemory = h->GetInitialMemory();
1723 h_data.myKeepFiles = h->GetKeepFiles();
1724 h_data.myWorkingDir = h->GetWorkingDirectory();
1725 h_data.myVerboseLevel = h->GetVerboseLevel();
1726 h_data.myToCreateNewNodes = h->GetToCreateNewNodes();
1727 //h_data.myRemoveInitialCentralPoint = h->GetToRemoveCentralPoint();
1728 //h_data.myBoundaryRecovery = h->GetToUseBoundaryRecoveryVersion();
1729 //h_data.myFEMCorrection = h->GetFEMCorrection();
1730 h_data.myGradation = h->GetGradation();
1731 //h_data.myTextOption = h->GetAdvancedOption();
1732 h_data.myLogInStandardOutput = h->GetStandardOutputLog();
1733 h_data.myRemoveLogOnSuccess = h->GetRemoveLogOnSuccess();
1735 GHS3DPluginGUI_HypothesisCreator* that = (GHS3DPluginGUI_HypothesisCreator*)this;
1736 that->myOptions = h->GetOptionValues();
1737 that->myCustomOptions = h->GetAdvancedOptionValues();
1739 GHS3DPlugin::GHS3DEnforcedVertexList_var vertices = h->GetEnforcedVertices();
1740 h_data.myEnforcedVertices.clear();
1741 for (CORBA::ULong i=0 ; i<vertices->length() ; i++) {
1742 TEnfVertex* myVertex = new TEnfVertex();
1743 myVertex->name = CORBA::string_dup(vertices[i].name.in());
1744 myVertex->geomEntry = CORBA::string_dup(vertices[i].geomEntry.in());
1745 myVertex->groupName = CORBA::string_dup(vertices[i].groupName.in());
1746 myVertex->size = vertices[i].size;
1747 myVertex->isCompound = vertices[i].isCompound;
1748 if (vertices[i].coords.length()) {
1749 for (CORBA::ULong c = 0; c < vertices[i].coords.length() ; c++)
1750 myVertex->coords.push_back(vertices[i].coords[c]);
1752 h_data.myEnforcedVertices.insert(myVertex);
1755 GHS3DPlugin::GHS3DEnforcedMeshList_var enfMeshes = h->GetEnforcedMeshes();
1756 h_data.myEnforcedMeshes.clear();
1757 for (CORBA::ULong i=0 ; i<enfMeshes->length() ; i++) {
1758 TEnfMesh* myEnfMesh = new TEnfMesh();
1759 myEnfMesh->name = CORBA::string_dup(enfMeshes[i].name.in());
1760 myEnfMesh->entry = CORBA::string_dup(enfMeshes[i].entry.in());
1761 myEnfMesh->groupName = CORBA::string_dup(enfMeshes[i].groupName.in());
1762 switch (enfMeshes[i].elementType) {
1764 myEnfMesh->elementType = 0;
1767 myEnfMesh->elementType = 1;
1770 myEnfMesh->elementType = 2;
1775 // myEnfMesh->elementType = enfMeshes[i].elementType;
1776 h_data.myEnforcedMeshes.insert(myEnfMesh);
1781 bool GHS3DPluginGUI_HypothesisCreator::storeParamsToHypo( const GHS3DHypothesisData& h_data ) const
1783 GHS3DPlugin::GHS3DPlugin_Hypothesis_var h =
1784 GHS3DPlugin::GHS3DPlugin_Hypothesis::_narrow( hypothesis() );
1785 GHS3DPlugin::GHS3DPlugin_OptimizerHypothesis_var opt =
1786 GHS3DPlugin::GHS3DPlugin_OptimizerHypothesis::_narrow( initParamsHypothesis() );
1792 SMESH::SetName( SMESH::FindSObject( h ), h_data.myName.toLatin1().constData() );
1794 h->SetOptimizationLevel ((CORBA::Short) h_data.myOptimizationLevel );
1795 h->SetMinSize ( h_data.myUseMinSize ? h_data.myMinSize : 0 );
1796 h->SetMaxSize ( h_data.myUseMaxSize ? h_data.myMaxSize : 0 );
1797 h->SetMinMaxSizeDefault ( this->myMinSizeDefault, this->myMaxSizeDefault );
1798 h->SetGradation ( h_data.myGradation );
1799 h->SetVolumeProximity ( h_data.myUseProximity );
1800 h->SetNbVolumeProximityLayers ((CORBA::Short) h_data.myNbProximityLayers );
1801 h->SetToMeshHoles ( h_data.myToMeshHoles );
1802 h->SetToMakeGroupsOfDomains ( h_data.myToMakeGroupsOfDomains );
1804 h->SetMaximumMemory ( h_data.myMaximumMemory );
1805 h->SetInitialMemory ( h_data.myInitialMemory );
1806 h->SetInitialMemory ( h_data.myInitialMemory );
1807 h->SetKeepFiles ( h_data.myKeepFiles );
1808 h->SetWorkingDirectory ( h_data.myWorkingDir.toLatin1().constData() );
1809 h->SetVerboseLevel ( h_data.myVerboseLevel );
1810 //h->SetToRemoveCentralPoint ( h_data.myRemoveInitialCentralPoint );
1811 //h->SetToUseBoundaryRecoveryVersion( h_data.myBoundaryRecovery );
1812 //h->SetFEMCorrection ( h_data.myFEMCorrection );
1813 h->SetStandardOutputLog ( h_data.myLogInStandardOutput );
1814 h->SetRemoveLogOnSuccess ( h_data.myRemoveLogOnSuccess );
1816 if ( !opt->_is_nil() )
1818 opt->SetToCreateNewNodes ( h_data.myToCreateNewNodes );
1819 opt->SetOptimization ( (GHS3DPlugin::Mode) h_data.myOptimization );
1820 opt->SetSplitOverConstrained ( (GHS3DPlugin::Mode) h_data.mySplitOverConstrained );
1821 opt->SetPThreadsMode ( (GHS3DPlugin::PThreadsMode) h_data.myPThreadsMode );
1822 opt->SetSmoothOffSlivers ( h_data.mySmoothOffSlivers );
1823 opt->SetMaximalNumberOfThreads((CORBA::Short) h_data.myNumberOfThreads );
1826 // Enforced vertices
1827 GHS3DPlugin::GHS3DEnforcedVertexList_var vertexHyp = h->GetEnforcedVertices();
1828 int nbVertexHyp = vertexHyp->length();
1830 // 1. Clear all enforced vertices in hypothesis
1831 // 2. Add new enforced vertex according to h_data
1832 if ( nbVertexHyp > 0)
1833 h->ClearEnforcedVertices();
1835 TEnfVertexList::const_iterator it;
1836 double x = 0, y = 0, z = 0;
1837 for(it = h_data.myEnforcedVertices.begin() ; it != h_data.myEnforcedVertices.end(); it++ ) {
1838 TEnfVertex* enfVertex = (*it);
1840 if (enfVertex->coords.size()) {
1841 x = enfVertex->coords.at(0);
1842 y = enfVertex->coords.at(1);
1843 z = enfVertex->coords.at(2);
1845 ok = h->p_SetEnforcedVertex( enfVertex->size, x, y, z, enfVertex->name.c_str(), enfVertex->geomEntry.c_str(), enfVertex->groupName.c_str(), enfVertex->isCompound);
1849 GHS3DPlugin::GHS3DEnforcedMeshList_var enfMeshListHyp = h->GetEnforcedMeshes();
1850 int nbEnfMeshListHyp = enfMeshListHyp->length();
1852 // 1. Clear all enforced vertices in hypothesis
1853 // 2. Add new enforced vertex according to h_data
1854 if ( nbEnfMeshListHyp > 0)
1855 h->ClearEnforcedMeshes();
1857 TEnfMeshList::const_iterator itEnfMesh;
1859 _PTR(Study) aStudy = SMESH::getStudy();
1861 for(itEnfMesh = h_data.myEnforcedMeshes.begin() ; itEnfMesh != h_data.myEnforcedMeshes.end(); itEnfMesh++ ) {
1862 TEnfMesh* enfMesh = (*itEnfMesh);
1864 _PTR(SObject) aSObj = aStudy->FindObjectID(enfMesh->entry.c_str());
1865 SMESH::SMESH_IDSource_var theSource = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( aSObj );
1867 SMESH::ElementType elementType = SMESH::NODE;
1868 switch(enfMesh->elementType) {
1870 elementType = SMESH::NODE;
1873 elementType = SMESH::EDGE;
1876 elementType = SMESH::FACE;
1882 ok = h->p_SetEnforcedMesh(theSource, elementType, enfMesh->name.c_str(), enfMesh->groupName.c_str());
1885 catch ( const SALOME::SALOME_Exception& ex )
1887 SalomeApp_Tools::QtCatchCorbaException( ex );
1893 bool GHS3DPluginGUI_HypothesisCreator::readParamsFromWidgets( GHS3DHypothesisData& h_data ) const
1895 h_data.myName = myName ? myName->text() : "";
1896 h_data.myOptimizationLevel = myOptimizationLevelCombo->currentIndex();
1897 if ( mySplitOverConstrainedCombo ) // optimizer
1899 h_data.myToCreateNewNodes = myCreateNewNodesCheck->isChecked();
1900 h_data.myOptimization = myOptimizationCombo->currentIndex();
1901 h_data.mySplitOverConstrained = mySplitOverConstrainedCombo->currentIndex();
1902 h_data.myPThreadsMode = myPThreadsModeCombo->currentIndex();
1903 h_data.myNumberOfThreads = myNumberOfThreadsSpin->value();
1904 h_data.mySmoothOffSlivers = mySmoothOffSliversCheck->isChecked();
1908 h_data.myMinSize = myMinSizeSpin->value();
1909 h_data.myMaxSize = myMaxSizeSpin->value();
1910 h_data.myUseMinSize = myMinSizeCheck->isChecked();
1911 h_data.myUseMaxSize = myMaxSizeCheck->isChecked();
1912 h_data.myGradation = myGradationSpin->value();
1913 h_data.myUseGradation = myGradationCheck->isChecked();
1914 h_data.myUseProximity = myUseProximityGroup->isChecked();
1915 h_data.myNbProximityLayers = myNbProximityLayers->value();
1916 h_data.myToMeshHoles = myToMeshHolesCheck->isChecked();
1917 h_data.myToMakeGroupsOfDomains = myToMakeGroupsOfDomains->isChecked();
1919 h_data.myMaximumMemory = float( myAdvWidget->maxMemoryCheck->isChecked() ? myAdvWidget->maxMemorySpin->value() : -1 );
1920 h_data.myInitialMemory = float( myAdvWidget->initialMemoryCheck->isChecked() ? myAdvWidget->initialMemorySpin->value() : -1 );
1921 h_data.myKeepFiles = myAdvWidget->keepWorkingFilesCheck->isChecked();
1922 h_data.myWorkingDir = myAdvWidget->workingDirectoryLineEdit->text().trimmed();
1923 h_data.myVerboseLevel = short( myAdvWidget->verboseLevelSpin->value() );
1924 h_data.myLogInStandardOutput = !myAdvWidget->logInFileCheck->isChecked();
1925 h_data.myRemoveLogOnSuccess = myAdvWidget->removeLogOnSuccessCheck->isChecked();
1927 // Enforced vertices
1928 h_data.myEnforcedVertices.clear();
1929 QVariant valueX, valueY, valueZ;
1930 for (int row=0 ; row<myEnforcedTableWidget->rowCount() ; row++)
1932 TEnfVertex *myVertex = new TEnfVertex();
1933 myVertex->name = myEnforcedTableWidget->item(row,ENF_VER_NAME_COLUMN)->data(Qt::EditRole).toString().toStdString();
1934 myVertex->geomEntry = myEnforcedTableWidget->item(row,ENF_VER_ENTRY_COLUMN)->data(Qt::EditRole).toString().toStdString();
1935 myVertex->groupName = myEnforcedTableWidget->item(row,ENF_VER_GROUP_COLUMN)->data(Qt::EditRole).toString().toStdString();
1936 valueX = myEnforcedTableWidget->item(row,ENF_VER_X_COLUMN)->data(Qt::EditRole);
1937 valueY = myEnforcedTableWidget->item(row,ENF_VER_Y_COLUMN)->data(Qt::EditRole);
1938 valueZ = myEnforcedTableWidget->item(row,ENF_VER_Z_COLUMN)->data(Qt::EditRole);
1939 if (!valueX.isNull() && !valueY.isNull() && !valueZ.isNull()) {
1940 myVertex->coords.push_back(valueX.toDouble());
1941 myVertex->coords.push_back(valueY.toDouble());
1942 myVertex->coords.push_back(valueZ.toDouble());
1944 myVertex->size = myEnforcedTableWidget->item(row,ENF_VER_SIZE_COLUMN)->data(Qt::EditRole).toDouble();
1945 myVertex->isCompound = myEnforcedTableWidget->item(row,ENF_VER_COMPOUND_COLUMN)->data(Qt::CheckStateRole).toBool();
1946 h_data.myEnforcedVertices.insert(myVertex);
1950 h_data.myEnforcedMeshes.clear();
1952 for (int row=0 ; row<myEnforcedMeshTableWidget->rowCount() ; row++)
1954 TEnfMesh *myEnfMesh = new TEnfMesh();
1955 myEnfMesh->name = myEnforcedMeshTableWidget->item(row,ENF_MESH_NAME_COLUMN)->data(Qt::EditRole).toString().toStdString();
1956 myEnfMesh->entry = myEnforcedMeshTableWidget->item(row,ENF_MESH_ENTRY_COLUMN)->data(Qt::EditRole).toString().toStdString();
1957 myEnfMesh->groupName = myEnforcedMeshTableWidget->item(row,ENF_MESH_GROUP_COLUMN)->data(Qt::EditRole).toString().toStdString();
1958 QComboBox* combo = qobject_cast<QComboBox*>(myEnforcedMeshTableWidget->cellWidget(row,ENF_MESH_CONSTRAINT_COLUMN));
1959 myEnfMesh->elementType = combo->currentIndex();
1960 h_data.myEnforcedMeshes.insert(myEnfMesh);
1966 QString GHS3DPluginGUI_HypothesisCreator::caption() const
1968 return tr( "GHS3D_TITLE" );
1971 QPixmap GHS3DPluginGUI_HypothesisCreator::icon() const
1973 return SUIT_Session::session()->resourceMgr()->loadPixmap( "GHS3DPlugin", tr( "ICON_DLG_GHS3D_PARAMETERS" ) );
1976 QString GHS3DPluginGUI_HypothesisCreator::type() const
1978 return tr( isOptimization() ? "GHS3D_OPTIMIZATIOL_HYPOTHESIS" : "GHS3D_HYPOTHESIS" );
1981 QString GHS3DPluginGUI_HypothesisCreator::helpPage() const
1983 return isOptimization() ? "optimization_page.html" : "ghs3d_hypo_page.html";
1986 void GHS3DPluginGUI_HypothesisCreator::onAddOption()
1988 myAdvWidget->AddOption( NULL, true );