1 // Copyright (C) 2004-2013 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.
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"
28 #include <GeometryGUI.h>
30 #include <SMESHGUI_Utils.h>
31 #include <SMESHGUI_SpinBox.h>
32 #include <SMESHGUI_HypothesesUtils.h>
33 #include <SMESH_NumberFilter.hxx>
34 #include <SMESH_TypeFilter.hxx>
35 #include <StdMeshersGUI_ObjectReferenceParamWdg.h>
37 #include <LightApp_SelectionMgr.h>
38 #include <SUIT_Session.h>
39 #include <SUIT_MessageBox.h>
40 #include <SUIT_ResourceMgr.h>
41 #include <SUIT_FileDlg.h>
42 #include <SalomeApp_Tools.h>
43 #include <SalomeApp_TypeFilter.h>
45 #include <TopoDS_Iterator.hxx>
51 #include <QVBoxLayout>
52 #include <QGridLayout>
57 #include <QPushButton>
61 #include <QTableWidget>
62 #include <QTableWidgetItem>
63 #include <QHeaderView>
66 #include <utilities.h>
68 #include <boost/algorithm/string.hpp>
75 #include <sys/sysinfo.h>
78 int maxAvailableMemory()
81 // See http://msdn.microsoft.com/en-us/library/aa366589.aspx
82 MEMORYSTATUSEX statex;
83 statex.dwLength = sizeof (statex);
84 int err = GlobalMemoryStatusEx (&statex);
87 statex.ullTotalPhys / 1024 / 1024 +
88 statex.ullTotalPageFile / 1024 / 1024 +
89 statex.ullTotalVirtual / 1024 / 1024;
90 return (int) ( 0.7 * totMB );
94 int err = sysinfo( &si );
97 si.totalram * si.mem_unit / 1024 / 1024 +
98 si.totalswap * si.mem_unit / 1024 / 1024 ;
99 return (int) ( 0.7 * totMB );
107 // BEGIN EnforcedVertexTableWidgetDelegate
110 EnforcedVertexTableWidgetDelegate::EnforcedVertexTableWidgetDelegate(QObject *parent)
111 : QItemDelegate(parent)
115 QWidget *EnforcedVertexTableWidgetDelegate::createEditor(QWidget *parent,
116 const QStyleOptionViewItem & option ,
117 const QModelIndex & index ) const
119 QModelIndex father = index.parent();
120 QString entry = father.child(index.row(), ENF_VER_ENTRY_COLUMN).data().toString();
122 if (index.column() == ENF_VER_X_COLUMN ||
123 index.column() == ENF_VER_Y_COLUMN ||
124 index.column() == ENF_VER_Z_COLUMN ||
125 index.column() == ENF_VER_SIZE_COLUMN) {
126 SMESHGUI_SpinBox *editor = new SMESHGUI_SpinBox(parent);
127 if (index.column() == ENF_VER_SIZE_COLUMN)
128 editor->RangeStepAndValidator(0, COORD_MAX, 10.0, "length_precision");
130 editor->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
131 editor->setReadOnly(!entry.isEmpty());
132 editor->setDisabled(!entry.isEmpty());
135 // else if (index.column() == ENF_VER_COMPOUND_COLUMN) {
136 // QCheckBox *editor = new QCheckBox(parent);
137 // editor->setDisabled(!entry.isEmpty());
140 else if (index.column() == ENF_VER_GROUP_COLUMN ||
141 index.column() == ENF_VER_NAME_COLUMN) {
143 QLineEdit *editor = new QLineEdit(parent);
144 if (index.column() != ENF_VER_GROUP_COLUMN) {
145 editor->setReadOnly(!entry.isEmpty());
146 editor->setDisabled(!entry.isEmpty());
150 return QItemDelegate::createEditor(parent, option, index);
153 void EnforcedVertexTableWidgetDelegate::setEditorData(QWidget *editor,
154 const QModelIndex &index) const
156 if (index.column() == ENF_VER_X_COLUMN ||
157 index.column() == ENF_VER_Y_COLUMN ||
158 index.column() == ENF_VER_Z_COLUMN ||
159 index.column() == ENF_VER_SIZE_COLUMN)
161 SMESHGUI_SpinBox *lineEdit = qobject_cast<SMESHGUI_SpinBox*>(editor);
162 lineEdit->SetValue(index.data().toDouble());
164 else if (index.column() == ENF_VER_COMPOUND_COLUMN) {
165 QCheckBox *checkBox = qobject_cast<QCheckBox*>(editor);
166 checkBox->setChecked(index.data().toBool());
169 QItemDelegate::setEditorData(editor, index);
173 void EnforcedVertexTableWidgetDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
174 const QModelIndex &index) const
176 QModelIndex parent = index.parent();
178 QString entry = parent.child(index.row(), ENF_VER_ENTRY_COLUMN).data().toString();
179 bool isCompound = parent.child(index.row(), ENF_VER_COMPOUND_COLUMN).data(Qt::CheckStateRole).toBool();
181 if (index.column() == ENF_VER_X_COLUMN ||
182 index.column() == ENF_VER_Y_COLUMN ||
183 index.column() == ENF_VER_Z_COLUMN) {
184 SMESHGUI_SpinBox *lineEdit = qobject_cast<SMESHGUI_SpinBox*>(editor);
185 if (!isCompound && !vertexExists(model, index, lineEdit->GetString()))
186 model->setData(index, lineEdit->GetValue(), Qt::EditRole);
188 else if (index.column() == ENF_VER_SIZE_COLUMN)
190 SMESHGUI_SpinBox *lineEdit = qobject_cast<SMESHGUI_SpinBox*>(editor);
191 const double newsize = lineEdit->GetValue();
193 model->setData(index, newsize, Qt::EditRole);
195 else if (index.column() == ENF_VER_NAME_COLUMN) {
196 QLineEdit *lineEdit = qobject_cast<QLineEdit*>(editor);
197 QString value = lineEdit->text();
198 if (entry.isEmpty() && !vertexExists(model, index, value))
199 model->setData(index, value, Qt::EditRole);
201 else if (index.column() == ENF_VER_ENTRY_COLUMN) {
202 QLineEdit *lineEdit = qobject_cast<QLineEdit*>(editor);
203 QString value = lineEdit->text();
204 if (! vertexExists(model, index, value))
205 model->setData(index, value, Qt::EditRole);
207 else if (index.column() == ENF_VER_COMPOUND_COLUMN) {
208 QCheckBox *checkBox = qobject_cast<QCheckBox*>(editor);
209 model->setData(index, checkBox->isChecked(), Qt::CheckStateRole);
212 QItemDelegate::setModelData(editor, model, index);
216 void EnforcedVertexTableWidgetDelegate::updateEditorGeometry(QWidget *editor,
217 const QStyleOptionViewItem &option, const QModelIndex &/* index */) const
219 editor->setGeometry(option.rect);
222 bool EnforcedVertexTableWidgetDelegate::vertexExists(QAbstractItemModel *model,
223 const QModelIndex &index,
227 QModelIndex parent = index.parent();
228 int row = index.row();
229 int col = index.column();
231 if (parent.isValid() && !value.isEmpty()) {
232 if (col == ENF_VER_X_COLUMN || col == ENF_VER_Y_COLUMN || col == ENF_VER_Z_COLUMN) {
234 if (col == ENF_VER_X_COLUMN) {
235 x = value.toDouble();
236 y = parent.child(row, ENF_VER_Y_COLUMN).data().toDouble();
237 z = parent.child(row, ENF_VER_Z_COLUMN).data().toDouble();
239 if (col == ENF_VER_Y_COLUMN) {
240 y = value.toDouble();
241 x = parent.child(row, ENF_VER_X_COLUMN).data().toDouble();
242 z = parent.child(row, ENF_VER_Z_COLUMN).data().toDouble();
244 if (col == ENF_VER_Z_COLUMN) {
245 z = value.toDouble();
246 x = parent.child(row, ENF_VER_X_COLUMN).data().toDouble();
247 y = parent.child(row, ENF_VER_Y_COLUMN).data().toDouble();
249 int nbChildren = model->rowCount(parent);
250 for (int i = 0 ; i < nbChildren ; i++) {
252 double childX = parent.child(i, ENF_VER_X_COLUMN).data().toDouble();
253 double childY = parent.child(i, ENF_VER_Y_COLUMN).data().toDouble();
254 double childZ = parent.child(i, ENF_VER_Z_COLUMN).data().toDouble();
255 if ((childX == x) && (childY == y) && (childZ == z)) {
262 else if (col == ENF_VER_NAME_COLUMN) {
263 QString name = parent.child(row, ENF_VER_NAME_COLUMN).data().toString();
273 // END EnforcedVertexTableWidgetDelegate
277 // BEGIN EnforcedMeshTableWidgetDelegate
280 EnforcedMeshTableWidgetDelegate::EnforcedMeshTableWidgetDelegate(QObject *parent)
281 : QItemDelegate(parent)
285 QWidget *EnforcedMeshTableWidgetDelegate::createEditor(QWidget *parent,
286 const QStyleOptionViewItem & option ,
287 const QModelIndex & index ) const
289 return QItemDelegate::createEditor(parent, option, index);
292 void EnforcedMeshTableWidgetDelegate::setEditorData(QWidget *editor,
293 const QModelIndex &index) const
295 QItemDelegate::setEditorData(editor, index);
298 void EnforcedMeshTableWidgetDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
299 const QModelIndex &index) const
301 QItemDelegate::setModelData(editor, model, index);
305 void EnforcedMeshTableWidgetDelegate::updateEditorGeometry(QWidget *editor,
306 const QStyleOptionViewItem &option, const QModelIndex &/* index */) const
308 editor->setGeometry(option.rect);
311 // bool EnforcedMeshTableWidgetDelegate::enfMeshExists(QAbstractItemModel *model,
312 // const QModelIndex &index,
313 // QString value) const
315 // bool exists = false;
316 // QModelIndex parent = index.parent();
317 // int row = index.row();
318 // int col = index.column();
323 // END EnforcedMeshTableWidgetDelegate
327 GHS3DPluginGUI_HypothesisCreator::GHS3DPluginGUI_HypothesisCreator( const QString& theHypType )
328 : SMESHGUI_GenericHypothesisCreator( theHypType )
330 GeomToolSelected = NULL;
331 GeomToolSelected = getGeomSelectionTool();
333 iconVertex = QPixmap(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_OBJBROWSER_VERTEX")));
334 iconCompound = QPixmap(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_OBJBROWSER_COMPOUND")));
335 // mySelectionMgr = SMESH::GetSelectionMgr(SMESHGUI::GetSMESHGUI());
336 myEnfMeshConstraintLabels << tr( "GHS3D_ENF_MESH_CONSTRAINT_NODE" ) << tr( "GHS3D_ENF_MESH_CONSTRAINT_EDGE" ) << tr("GHS3D_ENF_MESH_CONSTRAINT_FACE");
339 GHS3DPluginGUI_HypothesisCreator::~GHS3DPluginGUI_HypothesisCreator()
341 GHS3DPluginGUI_HypothesisCreator* that = (GHS3DPluginGUI_HypothesisCreator*)this;
342 that->getGeomSelectionTool()->selectionMgr()->clearFilters();
343 myEnfMeshWdg->deactivateSelection();
347 * \brief {Get or create the geom selection tool for active study}
349 GeomSelectionTools* GHS3DPluginGUI_HypothesisCreator::getGeomSelectionTool()
351 GHS3DPluginGUI_HypothesisCreator* that = (GHS3DPluginGUI_HypothesisCreator*)this;
352 _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
353 if (that->GeomToolSelected == NULL || that->GeomToolSelected->getMyStudy() != aStudy) {
354 that->GeomToolSelected = new GeomSelectionTools(aStudy);
356 return that->GeomToolSelected;
359 GEOM::GEOM_Gen_var GHS3DPluginGUI_HypothesisCreator::getGeomEngine()
361 return GeometryGUI::GetGeomGen();
364 QFrame* GHS3DPluginGUI_HypothesisCreator::buildFrame()
366 QFrame* fr = new QFrame( 0 );
367 QVBoxLayout* lay = new QVBoxLayout( fr );
369 lay->setSpacing( 0 );
372 QTabWidget* tab = new QTabWidget( fr );
373 tab->setTabShape( QTabWidget::Rounded );
374 tab->setTabPosition( QTabWidget::North );
375 lay->addWidget( tab );
378 myStdGroup = new QWidget();
379 QGridLayout* aStdLayout = new QGridLayout( myStdGroup );
380 aStdLayout->setSpacing( 6 );
381 aStdLayout->setMargin( 11 );
387 aStdLayout->addWidget( new QLabel( tr( "SMESH_NAME" ), myStdGroup ), row, 0, 1, 1 );
388 myName = new QLineEdit( myStdGroup );
389 aStdLayout->addWidget( myName, row++, 1, 1, 1 );
392 myToMeshHolesCheck = new QCheckBox( tr( "GHS3D_TO_MESH_HOLES" ), myStdGroup );
393 aStdLayout->addWidget( myToMeshHolesCheck, row, 0, 1, 1 );
394 myToMakeGroupsOfDomains = new QCheckBox( tr( "GHS3D_TO_MAKE_DOMAIN_GROUPS" ), myStdGroup );
395 aStdLayout->addWidget( myToMakeGroupsOfDomains, row++, 1, 1, 1 );
397 aStdLayout->addWidget( new QLabel( tr( "GHS3D_OPTIMIZATIOL_LEVEL" ), myStdGroup ), row, 0, 1, 1 );
398 myOptimizationLevelCombo = new QComboBox( myStdGroup );
399 aStdLayout->addWidget( myOptimizationLevelCombo, row++, 1, 1, 1 );
402 types << tr( "LEVEL_NONE" ) << tr( "LEVEL_LIGHT" ) << tr( "LEVEL_MEDIUM" ) << tr( "LEVEL_STANDARDPLUS" ) << tr( "LEVEL_STRONG" );
403 myOptimizationLevelCombo->addItems( types );
405 aStdLayout->setRowStretch( row, 10 );
407 // advanced parameters
408 myAdvGroup = new QWidget();
409 QGridLayout* anAdvLayout = new QGridLayout( myAdvGroup );
410 anAdvLayout->setSpacing( 6 );
411 anAdvLayout->setMargin( 11 );
413 myMaximumMemoryCheck = new QCheckBox( tr( "MAX_MEMORY_SIZE" ), myAdvGroup );
414 myMaximumMemorySpin = new QSpinBox( myAdvGroup );
415 myMaximumMemorySpin->setMinimum( 1 );
416 myMaximumMemorySpin->setMaximum( maxAvailableMemory() );
417 myMaximumMemorySpin->setSingleStep( 10 );
418 QLabel* aMegabyteLabel = new QLabel( tr( "MEGABYTE" ), myAdvGroup );
420 myInitialMemoryCheck = new QCheckBox( tr( "INIT_MEMORY_SIZE" ), myAdvGroup );
421 myInitialMemorySpin = new QSpinBox( myAdvGroup );
422 myInitialMemorySpin->setMinimum( 1 );
423 myInitialMemorySpin->setMaximum( maxAvailableMemory() );
424 myInitialMemorySpin->setSingleStep( 10 );
425 QLabel* aMegabyteLabel2 = new QLabel( tr( "MEGABYTE" ), myAdvGroup );
427 QLabel* aWorkinDirLabel = new QLabel( tr( "WORKING_DIR" ), myAdvGroup );
428 myWorkingDir = new QLineEdit( myAdvGroup );
429 //myWorkingDir->setReadOnly( true );
430 QPushButton* dirBtn = new QPushButton( tr( "SELECT_DIR" ), myAdvGroup );
431 dirBtn->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
433 myKeepFiles = new QCheckBox( tr( "KEEP_WORKING_FILES" ), myAdvGroup );
435 QLabel* aVerboseLevelLabel = new QLabel( tr( "VERBOSE_LEVEL" ), myAdvGroup );
436 myVerboseLevelSpin = new QSpinBox( myAdvGroup );
437 myVerboseLevelSpin->setMinimum( 0 );
438 myVerboseLevelSpin->setMaximum( 10 );
439 myVerboseLevelSpin->setSingleStep( 1 );
441 myToCreateNewNodesCheck = new QCheckBox( tr( "TO_ADD_NODES" ), myAdvGroup );
443 myRemoveInitialCentralPointCheck = new QCheckBox( tr( "NO_INITIAL_CENTRAL_POINT" ), myAdvGroup );
445 myBoundaryRecoveryCheck = new QCheckBox( tr( "RECOVERY_VERSION" ), myAdvGroup );
447 myFEMCorrectionCheck = new QCheckBox( tr( "FEM_CORRECTION" ), myAdvGroup );
449 QLabel* myGradationLabel = new QLabel( tr( "GHS3D_GRADATION" ), myAdvGroup );
450 myGradation = new SMESHGUI_SpinBox(myAdvGroup);
451 myGradation->RangeStepAndValidator(1.05, 5.0, 0.05, "length_precision");
453 QLabel* aTextOptionLabel = new QLabel( tr( "TEXT_OPTION" ), myAdvGroup );
454 myTextOption = new QLineEdit( myAdvGroup );
457 anAdvLayout->addWidget( myMaximumMemoryCheck, row, 0, 1, 1 );
458 anAdvLayout->addWidget( myMaximumMemorySpin, row, 1, 1, 1 );
459 anAdvLayout->addWidget( aMegabyteLabel, row++, 2, 1, 1 );
460 anAdvLayout->addWidget( myInitialMemoryCheck, row, 0, 1, 1 );
461 anAdvLayout->addWidget( myInitialMemorySpin, row, 1, 1, 1 );
462 anAdvLayout->addWidget( aMegabyteLabel2, row++, 2, 1, 1 );
463 anAdvLayout->addWidget( aWorkinDirLabel, row, 0, 1, 1 );
464 anAdvLayout->addWidget( myWorkingDir, row, 1, 1, 2 );
465 anAdvLayout->addWidget( dirBtn, row++, 3, 1, 1 );
466 anAdvLayout->addWidget( myKeepFiles, row++, 0, 1, 4 );
467 anAdvLayout->addWidget( aVerboseLevelLabel, row, 0, 1, 1 );
468 anAdvLayout->addWidget( myVerboseLevelSpin, row++, 1, 1, 2 );
469 anAdvLayout->addWidget( myToCreateNewNodesCheck, row++, 0, 1, 4 );
470 anAdvLayout->addWidget( myRemoveInitialCentralPointCheck, row++, 0, 1, 4 );
471 anAdvLayout->addWidget( myBoundaryRecoveryCheck, row++, 0, 1, 4 );
472 anAdvLayout->addWidget( myFEMCorrectionCheck, row++, 0, 1, 4 );
473 anAdvLayout->addWidget( myGradationLabel, row, 0, 1, 1 );
474 anAdvLayout->addWidget( myGradation, row++, 1, 1, 2 );
475 anAdvLayout->addWidget( aTextOptionLabel, row, 0, 1, 1 );
476 anAdvLayout->addWidget( myTextOption, row++, 1, 1, 2 );
478 // Enforced vertices parameters
479 myEnfGroup = new QWidget();
480 QGridLayout* anEnfLayout = new QGridLayout(myEnfGroup);
482 myEnforcedTableWidget = new QTableWidget(myEnfGroup);
483 myEnforcedTableWidget ->setMinimumWidth(300);
484 myEnforcedTableWidget->setRowCount( 0 );
485 myEnforcedTableWidget->setColumnCount( ENF_VER_NB_COLUMNS );
486 myEnforcedTableWidget->setSortingEnabled(true);
487 QStringList enforcedHeaders;
488 enforcedHeaders << tr( "GHS3D_ENF_NAME_COLUMN" )
489 << tr( "GHS3D_ENF_VER_X_COLUMN" )<< tr( "GHS3D_ENF_VER_Y_COLUMN" ) << tr( "GHS3D_ENF_VER_Z_COLUMN" )
490 << tr( "GHS3D_ENF_SIZE_COLUMN" ) << tr("GHS3D_ENF_ENTRY_COLUMN") << tr("GHS3D_ENF_VER_COMPOUND_COLUMN") << tr( "GHS3D_ENF_GROUP_COLUMN" );
492 myEnforcedTableWidget->setHorizontalHeaderLabels(enforcedHeaders);
493 myEnforcedTableWidget->verticalHeader()->hide();
494 myEnforcedTableWidget->horizontalHeader()->setStretchLastSection(true);
495 myEnforcedTableWidget->setAlternatingRowColors(true);
496 myEnforcedTableWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
497 myEnforcedTableWidget->setSelectionBehavior(QAbstractItemView::SelectItems);
498 myEnforcedTableWidget->horizontalHeader()->setResizeMode(QHeaderView::Interactive);
499 myEnforcedTableWidget->resizeColumnsToContents();
500 myEnforcedTableWidget->hideColumn(ENF_VER_ENTRY_COLUMN);
501 myEnforcedTableWidget->hideColumn(ENF_VER_COMPOUND_COLUMN);
503 myEnforcedTableWidget->setItemDelegate(new EnforcedVertexTableWidgetDelegate());
506 TColStd_MapOfInteger shapeTypes;
507 shapeTypes.Add( TopAbs_VERTEX );
508 shapeTypes.Add( TopAbs_COMPOUND );
510 SMESH_NumberFilter* vertexFilter = new SMESH_NumberFilter("GEOM", TopAbs_SHAPE, 1, shapeTypes);
511 myEnfVertexWdg = new StdMeshersGUI_ObjectReferenceParamWdg( vertexFilter, 0, /*multiSel=*/true, /*stretch=*/false);
512 myEnfVertexWdg->SetDefaultText(tr("GHS3D_ENF_SELECT_VERTEX"), "QLineEdit { color: grey }");
514 QLabel* myXCoordLabel = new QLabel( tr( "GHS3D_ENF_VER_X_LABEL" ), myEnfGroup );
515 myXCoord = new SMESHGUI_SpinBox(myEnfGroup);
516 myXCoord->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
517 QLabel* myYCoordLabel = new QLabel( tr( "GHS3D_ENF_VER_Y_LABEL" ), myEnfGroup );
518 myYCoord = new SMESHGUI_SpinBox(myEnfGroup);
519 myYCoord->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
520 QLabel* myZCoordLabel = new QLabel( tr( "GHS3D_ENF_VER_Z_LABEL" ), myEnfGroup );
521 myZCoord = new SMESHGUI_SpinBox(myEnfGroup);
522 myZCoord->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
523 QLabel* mySizeLabel = new QLabel( tr( "GHS3D_ENF_SIZE_LABEL" ), myEnfGroup );
524 mySizeValue = new SMESHGUI_SpinBox(myEnfGroup);
525 mySizeValue->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
527 QLabel* myGroupNameLabel = new QLabel( tr( "GHS3D_ENF_GROUP_LABEL" ), myEnfGroup );
528 myGroupName = new QLineEdit(myEnfGroup);
530 addVertexButton = new QPushButton(tr("GHS3D_ENF_ADD"),myEnfGroup);
531 addVertexButton->setEnabled(false);
532 removeVertexButton = new QPushButton(tr("GHS3D_ENF_REMOVE"),myEnfGroup);
533 // myGlobalGroupName = new QCheckBox(tr("GHS3D_ENF_VER_GROUPS"), myEnfGroup);
534 // myGlobalGroupName->setChecked(false);
536 QGroupBox* GroupBox = new QGroupBox( myEnfGroup );
537 QLabel* info = new QLabel( GroupBox );
538 info->setText( tr( "GHS3D_ENF_VER_INFO" ) );
539 info->setWordWrap( true );
540 QVBoxLayout* GroupBoxVLayout = new QVBoxLayout( GroupBox );
541 GroupBoxVLayout->setSpacing( 6 );
542 GroupBoxVLayout->setMargin( 11 );
543 GroupBoxVLayout->addWidget( info );
546 anEnfLayout->addWidget(GroupBox, ENF_VER_WARNING, 0, 1, 2 );
547 anEnfLayout->addWidget(myEnforcedTableWidget, ENF_VER_VERTEX, 0, ENF_VER_NB_LINES, 1);
549 QGridLayout* anEnfLayout2 = new QGridLayout(myEnfGroup);
550 anEnfLayout2->addWidget(myEnfVertexWdg, ENF_VER_VERTEX, 0, 1, 2);
551 anEnfLayout2->addWidget(myXCoordLabel, ENF_VER_X_COORD, 0, 1, 1);
552 anEnfLayout2->addWidget(myXCoord, ENF_VER_X_COORD, 1, 1, 1);
553 anEnfLayout2->addWidget(myYCoordLabel, ENF_VER_Y_COORD, 0, 1, 1);
554 anEnfLayout2->addWidget(myYCoord, ENF_VER_Y_COORD, 1, 1, 1);
555 anEnfLayout2->addWidget(myZCoordLabel, ENF_VER_Z_COORD, 0, 1, 1);
556 anEnfLayout2->addWidget(myZCoord, ENF_VER_Z_COORD, 1, 1, 1);
557 anEnfLayout2->addWidget(mySizeLabel, ENF_VER_SIZE, 0, 1, 1);
558 anEnfLayout2->addWidget(mySizeValue, ENF_VER_SIZE, 1, 1, 1);
559 anEnfLayout2->addWidget(myGroupNameLabel, ENF_VER_GROUP, 0, 1, 1);
560 anEnfLayout2->addWidget(myGroupName, ENF_VER_GROUP, 1, 1, 1);
561 anEnfLayout2->addWidget(addVertexButton, ENF_VER_BTN, 0, 1, 1);
562 anEnfLayout2->addWidget(removeVertexButton, ENF_VER_BTN, 1, 1, 1);
563 anEnfLayout2->setRowStretch(ENF_VER_NB_LINES, 1);
565 anEnfLayout->addLayout(anEnfLayout2, ENF_VER_VERTEX, 1,ENF_VER_NB_LINES, 1);
566 anEnfLayout->setRowStretch(ENF_VER_VERTEX, 10);
569 // Enforced meshes parameters
570 myEnfMeshGroup = new QWidget();
571 QGridLayout* anEnfMeshLayout = new QGridLayout(myEnfMeshGroup);
573 myEnforcedMeshTableWidget = new QTableWidget(myEnfGroup);
574 myEnforcedMeshTableWidget->setRowCount( 0 );
575 myEnforcedMeshTableWidget->setColumnCount( ENF_MESH_NB_COLUMNS );
576 myEnforcedMeshTableWidget->setSortingEnabled(true);
577 myEnforcedMeshTableWidget->verticalHeader()->hide();
578 QStringList enforcedMeshHeaders;
579 enforcedMeshHeaders << tr( "GHS3D_ENF_NAME_COLUMN" )
580 << tr( "GHS3D_ENF_ENTRY_COLUMN" )
581 << tr( "GHS3D_ENF_MESH_CONSTRAINT_COLUMN" )
582 << tr( "GHS3D_ENF_GROUP_COLUMN" );
583 myEnforcedMeshTableWidget->setHorizontalHeaderLabels(enforcedMeshHeaders);
584 myEnforcedMeshTableWidget->horizontalHeader()->setStretchLastSection(true);
585 myEnforcedMeshTableWidget->horizontalHeader()->setResizeMode(QHeaderView::Interactive);
586 myEnforcedMeshTableWidget->setAlternatingRowColors(true);
587 myEnforcedMeshTableWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
588 myEnforcedMeshTableWidget->setSelectionBehavior(QAbstractItemView::SelectItems);
589 myEnforcedMeshTableWidget->resizeColumnsToContents();
590 myEnforcedMeshTableWidget->hideColumn(ENF_MESH_ENTRY_COLUMN);
592 myEnforcedMeshTableWidget->setItemDelegate(new EnforcedMeshTableWidgetDelegate());
594 // myEnfMesh = SMESH::SMESH_Mesh::_nil();
595 // myEnfMeshArray = new SMESH::mesh_array();
597 myEnfMeshWdg = new StdMeshersGUI_ObjectReferenceParamWdg( SMESH::IDSOURCE, myEnfMeshGroup, /*multiSel=*/true);
598 myEnfMeshWdg->SetDefaultText(tr("GHS3D_ENF_SELECT_MESH"), "QLineEdit { color: grey }");
600 myEnfMeshWdg->AvoidSimultaneousSelection(myEnfVertexWdg);
602 QLabel* myMeshConstraintLabel = new QLabel( tr( "GHS3D_ENF_MESH_CONSTRAINT_LABEL" ), myEnfMeshGroup );
603 myEnfMeshConstraint = new QComboBox(myEnfMeshGroup);
604 myEnfMeshConstraint->insertItems(0,myEnfMeshConstraintLabels);
605 myEnfMeshConstraint->setEditable(false);
606 myEnfMeshConstraint->setCurrentIndex(0);
608 QLabel* myMeshGroupNameLabel = new QLabel( tr( "GHS3D_ENF_GROUP_LABEL" ), myEnfMeshGroup );
609 myMeshGroupName = new QLineEdit(myEnfMeshGroup);
611 addEnfMeshButton = new QPushButton(tr("GHS3D_ENF_ADD"),myEnfMeshGroup);
612 // addEnfMeshButton->setEnabled(false);
613 removeEnfMeshButton = new QPushButton(tr("GHS3D_ENF_REMOVE"),myEnfMeshGroup);
615 QGroupBox* GroupBox2 = new QGroupBox( myEnfMeshGroup );
616 QLabel* info2 = new QLabel( GroupBox2 );
617 info2->setText( tr( "GHS3D_ENF_MESH_INFO" ) );
618 info2->setWordWrap( true );
619 QVBoxLayout* GroupBox2VLayout = new QVBoxLayout( GroupBox2 );
620 GroupBox2VLayout->setSpacing( 6 );
621 GroupBox2VLayout->setMargin( 11 );
622 GroupBox2VLayout->addWidget( info2 );
624 anEnfMeshLayout->addWidget( GroupBox2, ENF_MESH_WARNING, 0, 1, 2 );
625 anEnfMeshLayout->addWidget(myEnforcedMeshTableWidget, ENF_MESH_MESH, 0, ENF_MESH_NB_LINES , 1);
627 QGridLayout* anEnfMeshLayout2 = new QGridLayout(myEnfMeshGroup);
628 anEnfMeshLayout2->addWidget(myEnfMeshWdg, ENF_MESH_MESH, 0, 1, 2);
629 anEnfMeshLayout2->addWidget(myMeshConstraintLabel, ENF_MESH_CONSTRAINT, 0, 1, 1);
630 anEnfMeshLayout2->addWidget(myEnfMeshConstraint, ENF_MESH_CONSTRAINT, 1, 1, 1);
631 anEnfMeshLayout2->addWidget(myMeshGroupNameLabel, ENF_MESH_GROUP, 0, 1, 1);
632 anEnfMeshLayout2->addWidget(myMeshGroupName, ENF_MESH_GROUP, 1, 1, 1);
633 anEnfMeshLayout2->addWidget(addEnfMeshButton, ENF_MESH_BTN, 0, 1, 1);
634 anEnfMeshLayout2->addWidget(removeEnfMeshButton, ENF_MESH_BTN, 1, 1, 1);
635 anEnfMeshLayout2->setRowStretch(ENF_MESH_NB_LINES, 1);
637 anEnfMeshLayout->addLayout(anEnfMeshLayout2, ENF_MESH_MESH, 1, ENF_MESH_NB_LINES, 1);
638 anEnfMeshLayout->setRowStretch(ENF_MESH_MESH, 10);
641 tab->insertTab( STD_TAB, myStdGroup, tr( "SMESH_ARGUMENTS" ) );
642 tab->insertTab( ADV_TAB, myAdvGroup, tr( "GHS3D_ADV_ARGS" ) );
643 tab->insertTab( ENF_VER_TAB, myEnfGroup, tr( "GHS3D_ENFORCED_VERTICES" ) );
644 tab->insertTab( ENF_MESH_TAB, myEnfMeshGroup, tr( "GHS3D_ENFORCED_MESHES" ) );
645 tab->setCurrentIndex( STD_TAB );
648 connect( myToMeshHolesCheck, SIGNAL( toggled( bool ) ), this, SLOT( onToMeshHoles(bool)));
649 connect( myMaximumMemoryCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
650 connect( myInitialMemoryCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
651 connect( myBoundaryRecoveryCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
652 connect( dirBtn, SIGNAL( clicked() ), this, SLOT( onDirBtnClicked() ) );
653 connect( myEnforcedTableWidget, SIGNAL( itemClicked(QTableWidgetItem *)), this, SLOT( synchronizeCoords() ) );
654 connect( myEnforcedTableWidget, SIGNAL( itemChanged(QTableWidgetItem *)), this, SLOT( updateEnforcedVertexValues(QTableWidgetItem *) ) );
655 connect( myEnforcedTableWidget, SIGNAL( itemSelectionChanged() ), this, SLOT( synchronizeCoords() ) );
656 connect( addVertexButton, SIGNAL( clicked()), this, SLOT( onAddEnforcedVertex() ) );
657 connect( removeVertexButton, SIGNAL( clicked()), this, SLOT( onRemoveEnforcedVertex() ) );
658 connect( myEnfVertexWdg, SIGNAL( contentModified()), this, SLOT( onSelectEnforcedVertex() ) );
659 connect( myEnfVertexWdg, SIGNAL( contentModified()), this, SLOT( checkVertexIsDefined() ) );
660 connect( myXCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
661 connect( myYCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
662 connect( myZCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
663 connect( mySizeValue, SIGNAL( textChanged(const QString&) ), this, SLOT( checkVertexIsDefined() ) );
664 connect( myXCoord, SIGNAL( valueChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
665 connect( myYCoord, SIGNAL( valueChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
666 connect( myZCoord, SIGNAL( valueChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
667 connect( mySizeValue, SIGNAL( valueChanged(const QString&) ), this, SLOT( checkVertexIsDefined() ) );
668 connect( this, SIGNAL( vertexDefined(bool) ), addVertexButton, SLOT( setEnabled(bool) ) );
670 connect( addEnfMeshButton, SIGNAL( clicked()), this, SLOT( onAddEnforcedMesh() ) );
671 connect( removeEnfMeshButton, SIGNAL( clicked()), this, SLOT( onRemoveEnforcedMesh() ) );
672 // connect( myEnfMeshWdg, SIGNAL( contentModified()), this, SLOT( checkEnfMeshIsDefined() ) );
673 // connect( myEnfMeshConstraint, SIGNAL( currentIndexChanged(int) ), this, SLOT( checkEnfMeshIsDefined() ) );
674 // connect( this, SIGNAL( enfMeshDefined(bool) ), addEnfMeshButton, SLOT( setEnabled(bool) ) );
680 * This method checks if an enforced vertex is defined;
682 void GHS3DPluginGUI_HypothesisCreator::clearEnfVertexSelection()
684 if (myEnfVertexWdg->NbObjects() != 0) {
685 disconnect( myEnfVertexWdg, SIGNAL( contentModified()), this, SLOT( onSelectEnforcedVertex() ) );
686 disconnect( myEnfVertexWdg, SIGNAL( contentModified()), this, SLOT( checkVertexIsDefined() ) );
687 myEnfVertexWdg->SetObject(GEOM::GEOM_Object::_nil());
688 connect( myEnfVertexWdg, SIGNAL( contentModified()), this, SLOT( onSelectEnforcedVertex() ) );
689 connect( myEnfVertexWdg, SIGNAL( contentModified()), this, SLOT( checkVertexIsDefined() ) );
691 GHS3DPluginGUI_HypothesisCreator* that = (GHS3DPluginGUI_HypothesisCreator*)this;
692 that->checkVertexIsDefined();
696 * This method checks if an enforced vertex is defined;
698 void GHS3DPluginGUI_HypothesisCreator::checkVertexIsDefined()
700 bool enfVertexIsDefined = false;
701 enfVertexIsDefined = (!mySizeValue->GetString().isEmpty() &&
702 (!myEnfVertexWdg->NbObjects() == 0 ||
703 (myEnfVertexWdg->NbObjects() == 0 && !myXCoord->GetString().isEmpty()
704 && !myYCoord->GetString().isEmpty()
705 && !myZCoord->GetString().isEmpty())));
706 emit vertexDefined(enfVertexIsDefined);
710 * This method checks if an enforced mesh is defined;
712 void GHS3DPluginGUI_HypothesisCreator::checkEnfMeshIsDefined()
714 emit enfMeshDefined( myEnfVertexWdg->NbObjects() != 0);
718 * This method resets the content of the X, Y, Z, size and GroupName widgets;
720 void GHS3DPluginGUI_HypothesisCreator::clearEnforcedVertexWidgets()
722 myXCoord->setCleared(true);
723 myYCoord->setCleared(true);
724 myZCoord->setCleared(true);
725 // mySizeValue->setCleared(true);
726 myXCoord->setText("");
727 myYCoord->setText("");
728 myZCoord->setText("");
729 // mySizeValue->setText("");
730 // myGroupName->setText("");
731 addVertexButton->setEnabled(false);
734 /** GHS3DPluginGUI_HypothesisCreator::updateEnforcedVertexValues(item)
735 This method updates the tooltip of a modified item. The QLineEdit widgets content
736 is synchronized with the coordinates of the enforced vertex clicked in the tree widget.
738 void GHS3DPluginGUI_HypothesisCreator::updateEnforcedVertexValues(QTableWidgetItem* item) {
739 // MESSAGE("GHS3DPluginGUI_HypothesisCreator::updateEnforcedVertexValues");
740 int row = myEnforcedTableWidget->row(item);
742 QVariant vertexName = myEnforcedTableWidget->item(row,ENF_VER_NAME_COLUMN)->data(Qt::EditRole);
743 QVariant x = myEnforcedTableWidget->item(row,ENF_VER_X_COLUMN)->data( Qt::EditRole);
744 QVariant y = myEnforcedTableWidget->item(row,ENF_VER_Y_COLUMN)->data( Qt::EditRole);
745 QVariant z = myEnforcedTableWidget->item(row,ENF_VER_Z_COLUMN)->data( Qt::EditRole);
746 QVariant size = myEnforcedTableWidget->item(row,ENF_VER_SIZE_COLUMN)->data( Qt::EditRole);
747 QVariant entry = myEnforcedTableWidget->item(row,ENF_VER_ENTRY_COLUMN)->data( Qt::EditRole);
748 QString groupName = myEnforcedTableWidget->item(row,ENF_VER_GROUP_COLUMN)->data( Qt::EditRole).toString();
750 clearEnforcedVertexWidgets();
752 if ( !x.isNull() || !entry.isNull()) {
753 QString toolTip = vertexName.toString();
754 toolTip += QString("(");
755 if (entry.isNull() || (!entry.isNull() && entry.toString() == "")) {
756 toolTip += x.toString();
757 toolTip += QString(", ") + y.toString();
758 toolTip += QString(", ") + z.toString();
761 toolTip += entry.toString();
762 toolTip += QString(")");
765 toolTip += QString("=") + size.toString();
767 if (!groupName.isEmpty())
768 toolTip += QString(" [") + groupName + QString("]");
770 // MESSAGE("Tooltip: " << toolTip.toStdString());
771 for (int col=0;col<ENF_VER_NB_COLUMNS;col++)
772 myEnforcedTableWidget->item(row,col)->setToolTip(toolTip);
775 disconnect( myXCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
776 disconnect( myYCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
777 disconnect( myZCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
778 myXCoord->SetValue(x.toDouble());
779 myYCoord->SetValue(y.toDouble());
780 myZCoord->SetValue(z.toDouble());
781 connect( myXCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
782 connect( myYCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
783 connect( myZCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
786 mySizeValue->SetValue(size.toDouble());
788 if (!groupName.isEmpty())
789 myGroupName->setText(groupName);
793 void GHS3DPluginGUI_HypothesisCreator::onSelectEnforcedVertex() {
794 int nbSelEnfVertex = myEnfVertexWdg->NbObjects();
795 clearEnforcedVertexWidgets();
796 if (nbSelEnfVertex == 1)
798 if ( CORBA::is_nil( getGeomEngine() ) && !GeometryGUI::InitGeomGen() )
801 myEnfVertex = myEnfVertexWdg->GetObject< GEOM::GEOM_Object >(nbSelEnfVertex-1);
802 if (myEnfVertex == GEOM::GEOM_Object::_nil())
804 if (myEnfVertex->GetShapeType() == GEOM::VERTEX) {
805 GHS3DPluginGUI_HypothesisCreator* that = (GHS3DPluginGUI_HypothesisCreator*)this;
806 GEOM::GEOM_IMeasureOperations_var measureOp = getGeomEngine()->GetIMeasureOperations( that->getGeomSelectionTool()->getMyStudy()->StudyId() );
807 if (CORBA::is_nil(measureOp))
811 measureOp->PointCoordinates (myEnfVertex, x, y, z);
812 if ( measureOp->IsDone() )
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);
818 myYCoord->SetValue(y);
819 myZCoord->SetValue(z);
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() ) );
828 /** GHS3DPluginGUI_HypothesisCreator::synchronizeCoords()
829 This method synchronizes the QLineEdit/SMESHGUI_SpinBox widgets content with the coordinates
830 of the enforced vertex clicked in the tree widget.
832 void GHS3DPluginGUI_HypothesisCreator::synchronizeCoords() {
833 clearEnforcedVertexWidgets();
834 QList<QTableWidgetItem *> items = myEnforcedTableWidget->selectedItems();
835 // myEnfVertexWdg->disconnect(SIGNAL(contentModified()));
836 disconnect( myEnfVertexWdg, SIGNAL( contentModified()), this, SLOT( onSelectEnforcedVertex() ) );
837 if (! items.isEmpty()) {
838 QTableWidgetItem *item;
841 if (items.size() == 1) {
843 row = myEnforcedTableWidget->row(item);
844 QVariant x = myEnforcedTableWidget->item(row,ENF_VER_X_COLUMN)->data( Qt::EditRole);
845 QVariant y = myEnforcedTableWidget->item(row,ENF_VER_Y_COLUMN)->data( Qt::EditRole);
846 QVariant z = myEnforcedTableWidget->item(row,ENF_VER_Z_COLUMN)->data( Qt::EditRole);
847 QVariant size = myEnforcedTableWidget->item(row,ENF_VER_SIZE_COLUMN)->data( Qt::EditRole);
848 entry = myEnforcedTableWidget->item(row,ENF_VER_ENTRY_COLUMN)->data( Qt::EditRole);
849 if (!entry.isNull()) {
850 SMESH::string_array_var objIds = new SMESH::string_array;
852 objIds[0] = entry.toString().toStdString().c_str();
853 myEnfVertexWdg->SetObjects(objIds);
856 myEnfVertexWdg->SetObject(GEOM::GEOM_Object::_nil());
858 QVariant group = myEnforcedTableWidget->item(row,ENF_VER_GROUP_COLUMN)->data( Qt::EditRole);
859 if (!x.isNull()/* && entry.isNull()*/) {
860 // disconnect( myXCoord, SIGNAL( textChanged(const QString &)), this, SLOT( onSelectEnforcedVertex() ) );
861 disconnect( myXCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
862 disconnect( myYCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
863 disconnect( myZCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
864 myXCoord->SetValue(x.toDouble());
865 myYCoord->SetValue(y.toDouble());
866 myZCoord->SetValue(z.toDouble());
867 connect( myXCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
868 connect( myYCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
869 connect( myZCoord, SIGNAL( textChanged(const QString&) ), this, SLOT( clearEnfVertexSelection() ) );
872 mySizeValue->SetValue(size.toDouble());
874 if (!group.isNull() && (!x.isNull() || !entry.isNull()))
875 myGroupName->setText(group.toString());
878 QList<QString> entryList;
879 for (int i = 0; i < items.size(); ++i) {
881 row = myEnforcedTableWidget->row(item);
882 entry = myEnforcedTableWidget->item(row,ENF_VER_ENTRY_COLUMN)->data( Qt::EditRole);
884 entryList << entry.toString();
886 if (entryList.size() > 0) {
887 SMESH::string_array_var objIds = new SMESH::string_array;
888 objIds->length(entryList.size());
889 for (int i = 0; i < entryList.size() ; i++)
890 objIds[i] = entryList.at(i).toStdString().c_str();
891 myEnfVertexWdg->SetObjects(objIds);
894 myEnfVertexWdg->SetObject(GEOM::GEOM_Object::_nil());
899 myEnfVertexWdg->SetObject(GEOM::GEOM_Object::_nil());
901 connect( myEnfVertexWdg, SIGNAL( contentModified()), this, SLOT( onSelectEnforcedVertex() ) );
902 GHS3DPluginGUI_HypothesisCreator* that = (GHS3DPluginGUI_HypothesisCreator*)this;
903 that->checkVertexIsDefined();
906 /** GHS3DPluginGUI_HypothesisCreator::addEnforcedMesh( meshName, geomEntry, elemType, size, groupName)
907 This method adds in the tree widget an enforced mesh from mesh, submesh or group with optionally size and and groupName.
909 void GHS3DPluginGUI_HypothesisCreator::addEnforcedMesh(std::string name, std::string entry, int elementType, std::string groupName)
911 MESSAGE("addEnforcedMesh(\"" << name << ", \"" << entry << "\", " << elementType << ", \"" << groupName << "\")");
912 bool okToCreate = true;
913 QString itemEntry = "";
914 int itemElementType = 0;
915 int rowCount = myEnforcedMeshTableWidget->rowCount();
916 bool allColumns = true;
917 for (int row = 0;row<rowCount;row++) {
918 for (int col = 0 ; col < ENF_MESH_NB_COLUMNS ; col++) {
919 MESSAGE("col: " << col);
920 if (col == ENF_MESH_CONSTRAINT_COLUMN){
921 if (qobject_cast<QComboBox*>(myEnforcedMeshTableWidget->cellWidget(row, col)) == 0) {
923 MESSAGE("allColumns = false");
927 else if (myEnforcedMeshTableWidget->item(row, col) == 0) {
929 MESSAGE("allColumns = false");
932 if (col == ENF_MESH_CONSTRAINT_COLUMN) {
933 QComboBox* itemComboBox = qobject_cast<QComboBox*>(myEnforcedMeshTableWidget->cellWidget(row, col));
934 itemElementType = itemComboBox->currentIndex();
935 MESSAGE("itemElementType: " << itemElementType);
937 else if (col == ENF_MESH_ENTRY_COLUMN)
938 itemEntry = myEnforcedMeshTableWidget->item(row, col)->data(Qt::EditRole).toString();
944 if (itemEntry == QString(entry.c_str()) && itemElementType == elementType) {
945 // // update group name
946 // if (itemGroupName.toStdString() != groupName) {
947 // MESSAGE("Group is updated from \"" << itemGroupName.toStdString() << "\" to \"" << groupName << "\"");
948 // myEnforcedMeshTableWidget->item(row, ENF_MESH_GROUP_COLUMN)->setData( Qt::EditRole, QVariant(groupName.c_str()));
959 MESSAGE("Creation of enforced mesh");
961 myEnforcedMeshTableWidget->setRowCount(rowCount+1);
962 myEnforcedMeshTableWidget->setSortingEnabled(false);
964 for (int col=0;col<ENF_MESH_NB_COLUMNS;col++) {
965 MESSAGE("Column: " << col);
966 if (col == ENF_MESH_CONSTRAINT_COLUMN) {
967 QComboBox* comboBox = new QComboBox();
968 QPalette pal = comboBox->palette();
969 pal.setColor(QPalette::Button, Qt::white);
970 comboBox->setPalette(pal);
971 comboBox->insertItems(0,myEnfMeshConstraintLabels);
972 comboBox->setEditable(false);
973 comboBox->setCurrentIndex(elementType);
974 MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << comboBox->currentText().toStdString());
975 myEnforcedMeshTableWidget->setCellWidget(rowCount,col,comboBox);
978 QTableWidgetItem* item = new QTableWidgetItem();
979 item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled);
981 case ENF_MESH_NAME_COLUMN:
982 item->setData( 0, name.c_str() );
983 item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled);
984 MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
985 myEnforcedMeshTableWidget->setItem(rowCount,col,item);
987 case ENF_MESH_ENTRY_COLUMN:
988 item->setData( 0, entry.c_str() );
989 item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled);
990 MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
991 myEnforcedMeshTableWidget->setItem(rowCount,col,item);
993 case ENF_MESH_GROUP_COLUMN:
994 item->setData( 0, groupName.c_str() );
995 MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
996 myEnforcedMeshTableWidget->setItem(rowCount,col,item);
1005 // connect( myEnforcedMeshTableWidget,SIGNAL( itemChanged(QTableWidgetItem *)), this, SLOT( updateEnforcedVertexValues(QTableWidgetItem *) ) );
1007 myEnforcedMeshTableWidget->setSortingEnabled(true);
1008 // myEnforcedTableWidget->setCurrentItem(myEnforcedTableWidget->item(rowCount,ENF_VER_NAME_COLUMN));
1009 // updateEnforcedVertexValues(myEnforcedTableWidget->item(rowCount,ENF_VER_NAME_COLUMN));
1013 /** GHS3DPluginGUI_HypothesisCreator::addEnforcedVertex( x, y, z, size, vertexName, geomEntry, groupName)
1014 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.
1016 void GHS3DPluginGUI_HypothesisCreator::addEnforcedVertex(double x, double y, double z, double size, std::string vertexName, std::string geomEntry, std::string groupName, bool isCompound)
1018 MESSAGE("addEnforcedVertex(" << x << ", " << y << ", " << z << ", " << size << ", \"" << vertexName << ", \"" << geomEntry << "\", \"" << groupName << "\", " << isCompound << ")");
1019 myEnforcedTableWidget->disconnect(SIGNAL( itemChanged(QTableWidgetItem *)));
1020 bool okToCreate = true;
1021 double itemX,itemY,itemZ,itemSize = 0;
1022 QString itemEntry, itemGroupName = QString("");
1023 // bool itemIsCompound;
1024 int rowCount = myEnforcedTableWidget->rowCount();
1027 for (int row = 0;row<rowCount;row++) {
1029 for (int col = 0 ; col < ENF_VER_NB_COLUMNS ; col++) {
1030 if (myEnforcedTableWidget->item(row, col) == 0) {
1035 data = myEnforcedTableWidget->item(row, col)->data(Qt::EditRole);
1036 if (!data.isNull()) {
1038 case ENF_VER_GROUP_COLUMN:
1039 itemGroupName = data.toString();
1041 case ENF_VER_ENTRY_COLUMN:
1042 itemEntry = data.toString();
1044 // case ENF_VER_COMPOUND_COLUMN:
1045 // itemIsCompound = data.toBool();
1047 case ENF_VER_X_COLUMN:
1048 itemX = data.toDouble();
1050 case ENF_VER_Y_COLUMN:
1051 itemY = data.toDouble();
1053 case ENF_VER_Z_COLUMN:
1054 itemZ = data.toDouble();
1056 case ENF_VER_SIZE_COLUMN:
1057 itemSize = data.toDouble();
1069 if (( !isCompound && ((itemX == x) && (itemY == y) && (itemZ == z))) || /*( (itemEntry.toStdString() != "") && */ (itemEntry.toStdString() == geomEntry)/*)*/) {
1071 if (itemSize != size) {
1072 MESSAGE("Size is updated from \"" << itemSize << "\" to \"" << size << "\"");
1073 myEnforcedTableWidget->item(row, ENF_VER_SIZE_COLUMN)->setData( Qt::EditRole, QVariant(size));
1075 // update group name
1076 if (itemGroupName.toStdString() != groupName) {
1077 MESSAGE("Group is updated from \"" << itemGroupName.toStdString() << "\" to \"" << groupName << "\"");
1078 myEnforcedTableWidget->item(row, ENF_VER_GROUP_COLUMN)->setData( Qt::EditRole, QVariant(groupName.c_str()));
1085 if (geomEntry.empty()) {
1086 MESSAGE("Vertex with coords " << x << ", " << y << ", " << z << " already exist: dont create again");
1089 MESSAGE("Vertex with entry " << geomEntry << " already exist: dont create again");
1094 if (geomEntry.empty()) {
1095 MESSAGE("Vertex with coords " << x << ", " << y << ", " << z<< " is created");
1098 MESSAGE("Vertex with geom entry " << geomEntry << " is created");
1103 QString myVertexName;
1104 while(indexRef != vertexIndex) {
1105 indexRef = vertexIndex;
1106 if (vertexName.empty())
1107 myVertexName = QString("Vertex #%1").arg(vertexIndex);
1109 myVertexName = QString(vertexName.c_str());
1111 for (int row = 0;row<rowCount;row++) {
1112 QString name = myEnforcedTableWidget->item(row,ENF_VER_NAME_COLUMN)->data(Qt::EditRole).toString();
1113 if (myVertexName == name) {
1120 MESSAGE("myVertexName is \"" << myVertexName.toStdString() << "\"");
1121 myEnforcedTableWidget->setRowCount(rowCount+1);
1122 myEnforcedTableWidget->setSortingEnabled(false);
1123 for (int col=0;col<ENF_VER_NB_COLUMNS;col++) {
1124 MESSAGE("Column: " << col);
1125 QTableWidgetItem* item = new QTableWidgetItem();
1126 item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled);
1128 case ENF_VER_NAME_COLUMN:
1129 item->setData( Qt::EditRole, myVertexName );
1130 if (!geomEntry.empty()) {
1132 item->setIcon(QIcon(iconCompound.scaled(iconCompound.size()*0.7,Qt::KeepAspectRatio,Qt::SmoothTransformation)));
1134 item->setIcon(QIcon(iconVertex.scaled(iconVertex.size()*0.7,Qt::KeepAspectRatio,Qt::SmoothTransformation)));
1137 case ENF_VER_X_COLUMN:
1139 item->setData( 0, QVariant(x) );
1141 case ENF_VER_Y_COLUMN:
1143 item->setData( 0, QVariant(y) );
1145 case ENF_VER_Z_COLUMN:
1147 item->setData( 0, QVariant(z) );
1149 case ENF_VER_SIZE_COLUMN:
1150 item->setData( 0, QVariant(size) );
1152 case ENF_VER_ENTRY_COLUMN:
1153 if (!geomEntry.empty())
1154 item->setData( 0, QString(geomEntry.c_str()) );
1156 case ENF_VER_COMPOUND_COLUMN:
1157 item->setData( Qt::CheckStateRole, isCompound );
1158 item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable);
1160 case ENF_VER_GROUP_COLUMN:
1161 if (!groupName.empty())
1162 item->setData( 0, QString(groupName.c_str()) );
1168 MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
1169 myEnforcedTableWidget->setItem(rowCount,col,item);
1173 connect( myEnforcedTableWidget,SIGNAL( itemChanged(QTableWidgetItem *)), this, SLOT( updateEnforcedVertexValues(QTableWidgetItem *) ) );
1175 myEnforcedTableWidget->setSortingEnabled(true);
1176 // myEnforcedTableWidget->setCurrentItem(myEnforcedTableWidget->item(rowCount,ENF_VER_NAME_COLUMN));
1177 updateEnforcedVertexValues(myEnforcedTableWidget->item(rowCount,ENF_VER_NAME_COLUMN));
1180 /** GHS3DPluginGUI_HypothesisCreator::onAddEnforcedMesh()
1181 This method is called when a item is added into the enforced meshes tree widget
1183 void GHS3DPluginGUI_HypothesisCreator::onAddEnforcedMesh()
1185 MESSAGE("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().toStdString();
1201 // if (myGlobalGroupName->isChecked())
1202 // groupName = myGlobalGroupName->text().toStdString();
1204 if (boost::trim_copy(groupName).empty())
1208 int elementType = myEnfMeshConstraint->currentIndex();
1211 _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
1212 _PTR(SObject) aSObj; //SMESH::SMESH_IDSource::_nil;
1213 QString meshEntry = myEnfMeshWdg->GetValue();
1214 MESSAGE("myEnfMeshWdg->GetValue()" << meshEntry.toStdString());
1216 if (selEnfMeshes == 1)
1218 MESSAGE("1 SMESH object selected");
1219 // myEnfMesh = myEnfMeshWdg->GetObject< SMESH::SMESH_IDSource >();
1220 // std::string entry = myEnfMeshWdg->GetValue();
1221 aSObj = aStudy->FindObjectID(meshEntry.toStdString().c_str());
1222 CORBA::Object_var anObj = SMESH::SObjectToObject(aSObj,aStudy);
1223 if (!CORBA::is_nil(anObj)) {
1224 // SMESH::SMESH_IDSource_var theSource = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( aSObj );
1225 addEnforcedMesh( aSObj->GetName(), aSObj->GetID(), elementType, groupName);
1230 MESSAGE(selEnfMeshes << " SMESH objects selected");
1231 QStringList meshEntries = meshEntry.split(" ", QString::SkipEmptyParts);
1232 QStringListIterator meshEntriesIt (meshEntries);
1233 while (meshEntriesIt.hasNext()) {
1234 aSObj = aStudy->FindObjectID(meshEntriesIt.next().toStdString().c_str());
1235 CORBA::Object_var anObj = SMESH::SObjectToObject(aSObj,aStudy);
1236 if (!CORBA::is_nil(anObj)) {
1237 // SMESH::SMESH_IDSource_var theSource = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( aSObj );
1238 addEnforcedMesh( aSObj->GetName(), aSObj->GetID(), elementType, groupName);
1243 myEnfVertexWdg->SetObject(SMESH::SMESH_IDSource::_nil());
1245 for (int column = 0; column < myEnforcedMeshTableWidget->columnCount(); ++column)
1246 myEnforcedMeshTableWidget->resizeColumnToContents(column);
1250 /** GHS3DPluginGUI_HypothesisCreator::onAddEnforcedVertex()
1251 This method is called when a item is added into the enforced vertices tree widget
1253 void GHS3DPluginGUI_HypothesisCreator::onAddEnforcedVertex()
1255 MESSAGE("GHS3DPluginGUI_HypothesisCreator::onAddEnforcedVertex()");
1257 GHS3DPluginGUI_HypothesisCreator* that = (GHS3DPluginGUI_HypothesisCreator*)this;
1259 that->getGeomSelectionTool()->selectionMgr()->clearFilters();
1260 myEnfVertexWdg->deactivateSelection();
1262 for (int column = 0; column < myEnforcedTableWidget->columnCount(); ++column)
1263 myEnforcedTableWidget->resizeColumnToContents(column);
1266 int selEnfVertex = myEnfVertexWdg->NbObjects();
1267 bool coordsEmpty = (myXCoord->text().isEmpty()) || (myYCoord->text().isEmpty()) || (myZCoord->text().isEmpty());
1268 if ((selEnfVertex == 0) && coordsEmpty)
1271 std::string groupName = myGroupName->text().toStdString();
1272 // if (myGlobalGroupName->isChecked())
1273 // groupName = myGlobalGroupName->text().toStdString();
1275 if (boost::trim_copy(groupName).empty())
1278 double size = mySizeValue->GetValue();
1280 if (selEnfVertex <= 1)
1282 MESSAGE("0 or 1 GEOM object selected");
1283 double x = 0, y = 0, z=0;
1284 if (myXCoord->GetString() != "") {
1285 x = myXCoord->GetValue();
1286 y = myYCoord->GetValue();
1287 z = myZCoord->GetValue();
1289 if (selEnfVertex == 1) {
1290 MESSAGE("1 GEOM object selected");
1291 myEnfVertex = myEnfVertexWdg->GetObject< GEOM::GEOM_Object >();
1292 std::string entry = "";
1293 if (myEnfVertex != GEOM::GEOM_Object::_nil())
1294 entry = myEnfVertex->GetStudyEntry();
1295 addEnforcedVertex(x, y, z, size, myEnfVertex->GetName(),entry, groupName, myEnfVertex->GetShapeType() == GEOM::COMPOUND);
1298 MESSAGE("0 GEOM object selected");
1299 MESSAGE("Coords: ("<<x<<","<<y<<","<<z<<")");
1300 addEnforcedVertex(x, y, z, size, "", "", groupName);
1305 if ( CORBA::is_nil(getGeomEngine()))
1308 GEOM::GEOM_IMeasureOperations_var measureOp = getGeomEngine()->GetIMeasureOperations( that->getGeomSelectionTool()->getMyStudy()->StudyId() );
1309 if (CORBA::is_nil(measureOp))
1312 CORBA::Double x = 0, y = 0,z = 0;
1313 for (int j = 0 ; j < selEnfVertex ; j++)
1315 myEnfVertex = myEnfVertexWdg->GetObject< GEOM::GEOM_Object >(j);
1316 if (myEnfVertex == GEOM::GEOM_Object::_nil())
1318 if (myEnfVertex->GetShapeType() == GEOM::VERTEX) {
1319 measureOp->PointCoordinates (myEnfVertex, x, y, z);
1320 if ( measureOp->IsDone() )
1321 addEnforcedVertex(x, y, z, size, myEnfVertex->GetName(),myEnfVertex->GetStudyEntry(), groupName);
1322 } else if (myEnfVertex->GetShapeType() == GEOM::COMPOUND) {
1323 addEnforcedVertex(0., 0., 0., size, myEnfVertex->GetName(),myEnfVertex->GetStudyEntry(), groupName, true);
1328 myEnfVertexWdg->SetObject(GEOM::GEOM_Object::_nil());
1330 for (int column = 0; column < myEnforcedTableWidget->columnCount(); ++column)
1331 myEnforcedTableWidget->resizeColumnToContents(column);
1334 /** GHS3DPluginGUI_HypothesisCreator::onRemoveEnforcedMesh()
1335 This method is called when a item is removed from the enforced meshes tree widget
1337 void GHS3DPluginGUI_HypothesisCreator::onRemoveEnforcedMesh()
1339 QList<int> selectedRows;
1340 QList<QTableWidgetItem *> selectedItems = myEnforcedMeshTableWidget->selectedItems();
1341 QTableWidgetItem* item;
1343 foreach( item, selectedItems ) {
1345 if (!selectedRows.contains( row ) )
1346 selectedRows.append(row);
1349 qSort( selectedRows );
1350 QListIterator<int> it( selectedRows );
1352 while ( it.hasPrevious() ) {
1353 row = it.previous();
1354 MESSAGE("delete row #"<< row);
1355 myEnforcedMeshTableWidget->removeRow(row );
1358 myEnforcedMeshTableWidget->selectionModel()->clearSelection();
1361 /** GHS3DPluginGUI_HypothesisCreator::onRemoveEnforcedVertex()
1362 This method is called when a item is removed from the enforced vertices tree widget
1364 void GHS3DPluginGUI_HypothesisCreator::onRemoveEnforcedVertex()
1366 QList<int> selectedRows;
1367 QList<QTableWidgetItem *> selectedItems = myEnforcedTableWidget->selectedItems();
1368 QTableWidgetItem* item;
1370 foreach( item, selectedItems ) {
1372 if (!selectedRows.contains( row ) )
1373 selectedRows.append(row);
1376 qSort( selectedRows );
1377 QListIterator<int> it( selectedRows );
1379 while ( it.hasPrevious() ) {
1380 row = it.previous();
1381 MESSAGE("delete row #"<< row);
1382 myEnforcedTableWidget->removeRow(row );
1385 myEnforcedTableWidget->selectionModel()->clearSelection();
1388 void GHS3DPluginGUI_HypothesisCreator::onToMeshHoles(bool isOn)
1390 myToMakeGroupsOfDomains->setEnabled( isOn );
1392 myToMakeGroupsOfDomains->setChecked( false );
1395 void GHS3DPluginGUI_HypothesisCreator::onDirBtnClicked()
1397 QString dir = SUIT_FileDlg::getExistingDirectory( dlg(), myWorkingDir->text(), QString() );
1398 if ( !dir.isEmpty() )
1399 myWorkingDir->setText( dir );
1402 void GHS3DPluginGUI_HypothesisCreator::updateWidgets()
1404 myToMakeGroupsOfDomains->setEnabled( myToMeshHolesCheck->isChecked() );
1405 myMaximumMemorySpin->setEnabled( myMaximumMemoryCheck->isChecked() );
1406 myInitialMemoryCheck->setEnabled( !myBoundaryRecoveryCheck->isChecked() );
1407 myInitialMemorySpin->setEnabled( myInitialMemoryCheck->isChecked() && !myBoundaryRecoveryCheck->isChecked() );
1408 myOptimizationLevelCombo->setEnabled( !myBoundaryRecoveryCheck->isChecked() );
1411 bool GHS3DPluginGUI_HypothesisCreator::checkParams(QString& msg) const
1413 MESSAGE("GHS3DPluginGUI_HypothesisCreator::checkParams");
1415 if ( !QFileInfo( myWorkingDir->text().trimmed() ).isWritable() ) {
1416 SUIT_MessageBox::warning( dlg(),
1417 tr( "SMESH_WRN_WARNING" ),
1418 tr( "GHS3D_PERMISSION_DENIED" ) );
1425 void GHS3DPluginGUI_HypothesisCreator::retrieveParams() const
1427 MESSAGE("GHS3DPluginGUI_HypothesisCreator::retrieveParams");
1428 GHS3DPluginGUI_HypothesisCreator* that = (GHS3DPluginGUI_HypothesisCreator*)this;
1429 GHS3DHypothesisData data;
1430 readParamsFromHypo( data );
1433 myName->setText( data.myName );
1435 myToMeshHolesCheck ->setChecked ( data.myToMeshHoles );
1436 myToMakeGroupsOfDomains ->setChecked ( data.myToMakeGroupsOfDomains );
1437 myOptimizationLevelCombo ->setCurrentIndex( data.myOptimizationLevel );
1438 myMaximumMemoryCheck ->setChecked ( data.myMaximumMemory > 0 );
1439 myMaximumMemorySpin ->setValue ( qMax( data.myMaximumMemory,
1440 myMaximumMemorySpin->minimum() ));
1441 myInitialMemoryCheck ->setChecked ( data.myInitialMemory > 0 );
1442 myInitialMemorySpin ->setValue ( qMax( data.myInitialMemory,
1443 myInitialMemorySpin->minimum() ));
1444 myWorkingDir ->setText ( data.myWorkingDir );
1445 myKeepFiles ->setChecked ( data.myKeepFiles );
1446 myVerboseLevelSpin ->setValue ( data.myVerboseLevel );
1447 myToCreateNewNodesCheck ->setChecked ( data.myToCreateNewNodes );
1448 myRemoveInitialCentralPointCheck ->setChecked ( data.myRemoveInitialCentralPoint );
1449 myBoundaryRecoveryCheck ->setChecked ( data.myBoundaryRecovery );
1450 myFEMCorrectionCheck ->setChecked ( data.myFEMCorrection );
1451 myGradation ->setValue ( data.myGradation );
1452 myTextOption ->setText ( data.myTextOption );
1454 TEnfVertexList::const_iterator it;
1456 myEnforcedTableWidget->clearContents();
1457 myEnforcedTableWidget->setSortingEnabled(false);
1458 myEnforcedTableWidget->disconnect(SIGNAL( itemChanged(QTableWidgetItem *)));
1459 for(it = data.myEnforcedVertices.begin() ; it != data.myEnforcedVertices.end(); it++ )
1461 TEnfVertex* enfVertex = (*it);
1462 myEnforcedTableWidget->setRowCount(rowCount+1);
1464 for (int col=0;col<ENF_VER_NB_COLUMNS;col++) {
1465 MESSAGE("Column: " << col);
1466 // MESSAGE("enfVertex->isCompound: " << enfVertex->isCompound);
1467 QTableWidgetItem* item = new QTableWidgetItem();
1468 item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled);
1470 case ENF_VER_NAME_COLUMN:
1471 item->setData( 0, enfVertex->name.c_str() );
1472 if (!enfVertex->geomEntry.empty()) {
1473 if (enfVertex->isCompound)
1474 item->setIcon(QIcon(iconCompound.scaled(iconCompound.size()*0.7,Qt::KeepAspectRatio,Qt::SmoothTransformation)));
1476 item->setIcon(QIcon(iconVertex.scaled(iconVertex.size()*0.7,Qt::KeepAspectRatio,Qt::SmoothTransformation)));
1478 MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
1481 case ENF_VER_X_COLUMN:
1482 if (!enfVertex->isCompound) {
1483 item->setData( 0, enfVertex->coords.at(0) );
1484 MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
1487 case ENF_VER_Y_COLUMN:
1488 if (!enfVertex->isCompound) {
1489 item->setData( 0, enfVertex->coords.at(1) );
1490 MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
1493 case ENF_VER_Z_COLUMN:
1494 if (!enfVertex->isCompound) {
1495 item->setData( 0, enfVertex->coords.at(2) );
1496 MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
1499 case ENF_VER_SIZE_COLUMN:
1500 item->setData( 0, enfVertex->size );
1501 MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
1503 case ENF_VER_ENTRY_COLUMN:
1504 item->setData( 0, enfVertex->geomEntry.c_str() );
1505 MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
1507 case ENF_VER_COMPOUND_COLUMN:
1508 item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable);
1509 item->setData( Qt::CheckStateRole, enfVertex->isCompound );
1510 MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << enfVertex->isCompound);
1512 case ENF_VER_GROUP_COLUMN:
1513 item->setData( 0, enfVertex->groupName.c_str() );
1514 MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
1520 myEnforcedTableWidget->setItem(rowCount,col,item);
1523 that->updateEnforcedVertexValues(myEnforcedTableWidget->item(rowCount,ENF_VER_NAME_COLUMN));
1527 connect( myEnforcedTableWidget,SIGNAL( itemChanged(QTableWidgetItem *)), this, SLOT( updateEnforcedVertexValues(QTableWidgetItem *) ) );
1528 myEnforcedTableWidget->setSortingEnabled(true);
1530 for (int column = 0; column < myEnforcedTableWidget->columnCount(); ++column)
1531 myEnforcedTableWidget->resizeColumnToContents(column);
1533 // Update Enforced meshes QTableWidget
1534 TEnfMeshList::const_iterator itMesh;
1536 myEnforcedMeshTableWidget->clearContents();
1537 myEnforcedMeshTableWidget->setSortingEnabled(false);
1538 // myEnforcedMeshTableWidget->disconnect(SIGNAL( itemChanged(QTableWidgetItem *)));
1539 for(itMesh = data.myEnforcedMeshes.begin() ; itMesh != data.myEnforcedMeshes.end(); itMesh++ )
1541 TEnfMesh* enfMesh = (*itMesh);
1542 myEnforcedMeshTableWidget->setRowCount(rowCount+1);
1544 for (int col=0;col<ENF_MESH_NB_COLUMNS;col++) {
1545 MESSAGE("Column: " << col);
1546 if (col == ENF_MESH_CONSTRAINT_COLUMN) {
1547 QComboBox* comboBox = new QComboBox();
1548 QPalette pal = comboBox->palette();
1549 pal.setColor(QPalette::Button, Qt::white);
1550 comboBox->setPalette(pal);
1551 comboBox->insertItems(0,myEnfMeshConstraintLabels);
1552 comboBox->setEditable(false);
1553 comboBox->setCurrentIndex(enfMesh->elementType);
1554 MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << comboBox->currentText().toStdString());
1555 myEnforcedMeshTableWidget->setCellWidget(rowCount,col,comboBox);
1558 QTableWidgetItem* item = new QTableWidgetItem();
1559 item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled);
1561 case ENF_MESH_NAME_COLUMN:
1562 item->setData( 0, enfMesh->name.c_str() );
1563 item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled);
1564 MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
1565 myEnforcedMeshTableWidget->setItem(rowCount,col,item);
1567 case ENF_MESH_ENTRY_COLUMN:
1568 item->setData( 0, enfMesh->entry.c_str() );
1569 item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled);
1570 MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
1571 myEnforcedMeshTableWidget->setItem(rowCount,col,item);
1573 case ENF_MESH_GROUP_COLUMN:
1574 item->setData( 0, enfMesh->groupName.c_str() );
1575 MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
1576 myEnforcedMeshTableWidget->setItem(rowCount,col,item);
1583 // myEnforcedMeshTableWidget->setItem(rowCount,col,item);
1586 // that->updateEnforcedVertexValues(myEnforcedTableWidget->item(rowCount,ENF_VER_NAME_COLUMN));
1590 // connect( myEnforcedMeshTableWidget,SIGNAL( itemChanged(QTableWidgetItem *)), this, SLOT( updateEnforcedVertexValues(QTableWidgetItem *) ) );
1591 myEnforcedMeshTableWidget->setSortingEnabled(true);
1593 for (int col=0;col<ENF_MESH_NB_COLUMNS;col++)
1594 myEnforcedMeshTableWidget->resizeColumnToContents(col);
1596 that->updateWidgets();
1597 that->checkVertexIsDefined();
1600 QString GHS3DPluginGUI_HypothesisCreator::storeParams() const
1602 MESSAGE("GHS3DPluginGUI_HypothesisCreator::storeParams");
1603 GHS3DHypothesisData data;
1604 readParamsFromWidgets( data );
1605 storeParamsToHypo( data );
1607 QString valStr = "";
1609 if ( !data.myBoundaryRecovery )
1610 valStr = "-c " + QString::number( !data.myToMeshHoles );
1612 if ( data.myOptimizationLevel >= 0 && data.myOptimizationLevel < 5 && !data.myBoundaryRecovery) {
1613 const char* level[] = { "none" , "light" , "standard" , "standard+" , "strong" };
1615 valStr += level[ data.myOptimizationLevel ];
1617 if ( data.myMaximumMemory > 0 ) {
1619 valStr += QString::number( data.myMaximumMemory );
1621 if ( data.myInitialMemory > 0 && !data.myBoundaryRecovery ) {
1623 valStr += QString::number( data.myInitialMemory );
1626 valStr += QString::number( data.myVerboseLevel );
1628 if ( !data.myToCreateNewNodes )
1631 if ( data.myRemoveInitialCentralPoint )
1632 valStr += " -no_initial_central_point";
1634 if ( data.myBoundaryRecovery )
1637 if ( data.myFEMCorrection )
1640 if ( data.myGradation != 1.05 ) {
1641 valStr += " -Dcpropa=";
1642 valStr += QString::number( data.myGradation );
1646 valStr += data.myTextOption;
1648 // valStr += " #BEGIN ENFORCED VERTICES#";
1649 // // Add size map parameters storage
1650 // for (int i=0 ; i<mySmpModel->rowCount() ; i++) {
1652 // double x = mySmpModel->data(mySmpModel->index(i,ENF_VER_X_COLUMN)).toDouble();
1653 // double y = mySmpModel->data(mySmpModel->index(i,ENF_VER_Y_COLUMN)).toDouble();
1654 // double z = mySmpModel->data(mySmpModel->index(i,ENF_VER_Z_COLUMN)).toDouble();
1655 // double size = mySmpModel->data(mySmpModel->index(i,ENF_VER_SIZE_COLUMN)).toDouble();
1656 // valStr += QString::number( x );
1658 // valStr += QString::number( y );
1660 // valStr += QString::number( z );
1662 // valStr += QString::number( size );
1663 // if (i!=mySmpModel->rowCount()-1)
1666 // valStr += " #END ENFORCED VERTICES#";
1667 // MESSAGE(valStr.toStdString());
1671 bool GHS3DPluginGUI_HypothesisCreator::readParamsFromHypo( GHS3DHypothesisData& h_data ) const
1673 MESSAGE("GHS3DPluginGUI_HypothesisCreator::readParamsFromHypo");
1674 GHS3DPlugin::GHS3DPlugin_Hypothesis_var h =
1675 GHS3DPlugin::GHS3DPlugin_Hypothesis::_narrow( initParamsHypothesis() );
1677 HypothesisData* data = SMESH::GetHypothesisData( hypType() );
1678 h_data.myName = isCreation() && data ? hypName() : "";
1680 h_data.myToMeshHoles = h->GetToMeshHoles();
1681 h_data.myToMakeGroupsOfDomains = h->GetToMeshHoles() && h->GetToMakeGroupsOfDomains();
1682 h_data.myMaximumMemory = h->GetMaximumMemory();
1683 h_data.myInitialMemory = h->GetInitialMemory();
1684 h_data.myInitialMemory = h->GetInitialMemory();
1685 h_data.myOptimizationLevel = h->GetOptimizationLevel();
1686 h_data.myKeepFiles = h->GetKeepFiles();
1687 h_data.myWorkingDir = h->GetWorkingDirectory();
1688 h_data.myVerboseLevel = h->GetVerboseLevel();
1689 h_data.myToCreateNewNodes = h->GetToCreateNewNodes();
1690 h_data.myRemoveInitialCentralPoint = h->GetToRemoveCentralPoint();
1691 h_data.myBoundaryRecovery = h->GetToUseBoundaryRecoveryVersion();
1692 h_data.myFEMCorrection = h->GetFEMCorrection();
1693 h_data.myGradation = h->GetGradation();
1694 h_data.myTextOption = h->GetTextOption();
1696 GHS3DPlugin::GHS3DEnforcedVertexList_var vertices = h->GetEnforcedVertices();
1697 MESSAGE("vertices->length(): " << vertices->length());
1698 h_data.myEnforcedVertices.clear();
1699 for (int i=0 ; i<vertices->length() ; i++) {
1700 TEnfVertex* myVertex = new TEnfVertex();
1701 myVertex->name = CORBA::string_dup(vertices[i].name.in());
1702 myVertex->geomEntry = CORBA::string_dup(vertices[i].geomEntry.in());
1703 myVertex->groupName = CORBA::string_dup(vertices[i].groupName.in());
1704 myVertex->size = vertices[i].size;
1705 myVertex->isCompound = vertices[i].isCompound;
1706 if (vertices[i].coords.length()) {
1707 for (int c = 0; c < vertices[i].coords.length() ; c++)
1708 myVertex->coords.push_back(vertices[i].coords[c]);
1709 MESSAGE("Add enforced vertex ("<< myVertex->coords.at(0) << ","<< myVertex->coords.at(1) << ","<< myVertex->coords.at(2) << ") ="<< myVertex->size);
1711 h_data.myEnforcedVertices.insert(myVertex);
1714 GHS3DPlugin::GHS3DEnforcedMeshList_var enfMeshes = h->GetEnforcedMeshes();
1715 MESSAGE("enfMeshes->length(): " << enfMeshes->length());
1716 h_data.myEnforcedMeshes.clear();
1717 for (int i=0 ; i<enfMeshes->length() ; i++) {
1718 TEnfMesh* myEnfMesh = new TEnfMesh();
1719 myEnfMesh->name = CORBA::string_dup(enfMeshes[i].name.in());
1720 myEnfMesh->entry = CORBA::string_dup(enfMeshes[i].entry.in());
1721 myEnfMesh->groupName = CORBA::string_dup(enfMeshes[i].groupName.in());
1722 switch (enfMeshes[i].elementType) {
1724 myEnfMesh->elementType = 0;
1727 myEnfMesh->elementType = 1;
1730 myEnfMesh->elementType = 2;
1735 // myEnfMesh->elementType = enfMeshes[i].elementType;
1736 h_data.myEnforcedMeshes.insert(myEnfMesh);
1741 bool GHS3DPluginGUI_HypothesisCreator::storeParamsToHypo( const GHS3DHypothesisData& h_data ) const
1743 MESSAGE("GHS3DPluginGUI_HypothesisCreator::storeParamsToHypo");
1744 GHS3DPlugin::GHS3DPlugin_Hypothesis_var h =
1745 GHS3DPlugin::GHS3DPlugin_Hypothesis::_narrow( hypothesis() );
1751 SMESH::SetName( SMESH::FindSObject( h ), h_data.myName.toLatin1().constData() );
1753 if ( h->GetToMeshHoles() != h_data.myToMeshHoles ) // avoid duplication of DumpPython commands
1754 h->SetToMeshHoles ( h_data.myToMeshHoles );
1755 if ( h->GetToMakeGroupsOfDomains() != h_data.myToMakeGroupsOfDomains )
1756 h->SetToMakeGroupsOfDomains( h_data.myToMakeGroupsOfDomains );
1757 if ( h->GetMaximumMemory() != h_data.myMaximumMemory )
1758 h->SetMaximumMemory ( h_data.myMaximumMemory );
1759 if ( h->GetInitialMemory() != h_data.myInitialMemory )
1760 h->SetInitialMemory ( h_data.myInitialMemory );
1761 if ( h->GetInitialMemory() != h_data.myInitialMemory )
1762 h->SetInitialMemory ( h_data.myInitialMemory );
1763 if ( h->GetOptimizationLevel() != h_data.myOptimizationLevel )
1764 h->SetOptimizationLevel( h_data.myOptimizationLevel );
1765 if ( h->GetKeepFiles() != h_data.myKeepFiles )
1766 h->SetKeepFiles ( h_data.myKeepFiles );
1767 if ( h->GetWorkingDirectory() != h_data.myWorkingDir )
1768 h->SetWorkingDirectory ( h_data.myWorkingDir.toLatin1().constData() );
1769 if ( h->GetVerboseLevel() != h_data.myVerboseLevel )
1770 h->SetVerboseLevel ( h_data.myVerboseLevel );
1771 if ( h->GetToCreateNewNodes() != h_data.myToCreateNewNodes )
1772 h->SetToCreateNewNodes( h_data.myToCreateNewNodes );
1773 if ( h->GetToRemoveCentralPoint() != h_data.myRemoveInitialCentralPoint )
1774 h->SetToRemoveCentralPoint( h_data.myRemoveInitialCentralPoint );
1775 if ( h->GetToUseBoundaryRecoveryVersion() != h_data.myBoundaryRecovery )
1776 h->SetToUseBoundaryRecoveryVersion( h_data.myBoundaryRecovery );
1777 if ( h->GetFEMCorrection() != h_data.myFEMCorrection )
1778 h->SetFEMCorrection( h_data.myFEMCorrection );
1779 if ( h->GetGradation() != h_data.myGradation )
1780 h->SetGradation ( h_data.myGradation );
1781 if ( h->GetTextOption() != h_data.myTextOption )
1782 h->SetTextOption ( h_data.myTextOption.toLatin1().constData() );
1784 // Enforced vertices
1785 int nbVertex = (int) h_data.myEnforcedVertices.size();
1786 GHS3DPlugin::GHS3DEnforcedVertexList_var vertexHyp = h->GetEnforcedVertices();
1787 int nbVertexHyp = vertexHyp->length();
1789 MESSAGE("Store params for size maps: " << nbVertex << " enforced vertices");
1790 MESSAGE("h->GetEnforcedVertices()->length(): " << nbVertexHyp);
1792 // 1. Clear all enforced vertices in hypothesis
1793 // 2. Add new enforced vertex according to h_data
1794 if ( nbVertexHyp > 0)
1795 h->ClearEnforcedVertices();
1797 TEnfVertexList::const_iterator it;
1798 double x = 0, y = 0, z = 0;
1799 for(it = h_data.myEnforcedVertices.begin() ; it != h_data.myEnforcedVertices.end(); it++ ) {
1800 TEnfVertex* enfVertex = (*it);
1802 if (enfVertex->coords.size()) {
1803 x = enfVertex->coords.at(0);
1804 y = enfVertex->coords.at(1);
1805 z = enfVertex->coords.at(2);
1807 ok = h->p_SetEnforcedVertex( enfVertex->size, x, y, z, enfVertex->name.c_str(), enfVertex->geomEntry.c_str(), enfVertex->groupName.c_str(), enfVertex->isCompound);
1811 int nbEnfMeshes = (int) h_data.myEnforcedMeshes.size();
1812 GHS3DPlugin::GHS3DEnforcedMeshList_var enfMeshListHyp = h->GetEnforcedMeshes();
1813 int nbEnfMeshListHyp = enfMeshListHyp->length();
1815 MESSAGE("Store params for size maps: " << nbEnfMeshes << " enforced meshes");
1816 MESSAGE("h->GetEnforcedMeshes()->length(): " << nbEnfMeshListHyp);
1818 // 1. Clear all enforced vertices in hypothesis
1819 // 2. Add new enforced vertex according to h_data
1820 if ( nbEnfMeshListHyp > 0)
1821 h->ClearEnforcedMeshes();
1823 TEnfMeshList::const_iterator itEnfMesh;
1825 _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
1827 for(itEnfMesh = h_data.myEnforcedMeshes.begin() ; itEnfMesh != h_data.myEnforcedMeshes.end(); itEnfMesh++ ) {
1828 TEnfMesh* enfMesh = (*itEnfMesh);
1830 _PTR(SObject) aSObj = aStudy->FindObjectID(enfMesh->entry.c_str());
1831 SMESH::SMESH_IDSource_var theSource = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( aSObj );
1833 MESSAGE("enfMesh->elementType: " << enfMesh->elementType);
1834 SMESH::ElementType elementType;
1835 switch(enfMesh->elementType) {
1837 elementType = SMESH::NODE;
1840 elementType = SMESH::EDGE;
1843 elementType = SMESH::FACE;
1849 std::cout << "h->p_SetEnforcedMesh(theSource, "<< elementType <<", \""<< enfMesh->name << "\", \"" << enfMesh->groupName.c_str() <<"\")"<<std::endl;
1850 ok = h->p_SetEnforcedMesh(theSource, elementType, enfMesh->name.c_str(), enfMesh->groupName.c_str());
1853 // catch(const std::exception& ex) {
1854 // std::cout << "Exception: " << ex.what() << std::endl;
1857 catch ( const SALOME::SALOME_Exception& ex )
1859 SalomeApp_Tools::QtCatchCorbaException( ex );
1865 bool GHS3DPluginGUI_HypothesisCreator::readParamsFromWidgets( GHS3DHypothesisData& h_data ) const
1867 MESSAGE("GHS3DPluginGUI_HypothesisCreator::readParamsFromWidgets");
1868 h_data.myName = myName ? myName->text() : "";
1869 h_data.myToMeshHoles = myToMeshHolesCheck->isChecked();
1870 h_data.myToMakeGroupsOfDomains = myToMakeGroupsOfDomains->isChecked();
1871 h_data.myMaximumMemory = myMaximumMemoryCheck->isChecked() ? myMaximumMemorySpin->value() : -1;
1872 h_data.myInitialMemory = myInitialMemoryCheck->isChecked() ? myInitialMemorySpin->value() : -1;
1873 h_data.myOptimizationLevel = myOptimizationLevelCombo->currentIndex();
1874 h_data.myKeepFiles = myKeepFiles->isChecked();
1875 h_data.myWorkingDir = myWorkingDir->text().trimmed();
1876 h_data.myVerboseLevel = myVerboseLevelSpin->value();
1877 h_data.myToCreateNewNodes = myToCreateNewNodesCheck->isChecked();
1878 h_data.myRemoveInitialCentralPoint = myRemoveInitialCentralPointCheck->isChecked();
1879 h_data.myBoundaryRecovery = myBoundaryRecoveryCheck->isChecked();
1880 h_data.myFEMCorrection = myFEMCorrectionCheck->isChecked();
1881 h_data.myGradation = myGradation->value();
1882 h_data.myTextOption = myTextOption->text();
1884 // Enforced vertices
1885 h_data.myEnforcedVertices.clear();
1886 QVariant valueX, valueY, valueZ;
1887 for (int row=0 ; row<myEnforcedTableWidget->rowCount() ; row++) {
1889 TEnfVertex *myVertex = new TEnfVertex();
1890 myVertex->name = myEnforcedTableWidget->item(row,ENF_VER_NAME_COLUMN)->data(Qt::EditRole).toString().toStdString();
1891 MESSAGE("Add new enforced vertex \"" << myVertex->name << "\"" );
1892 myVertex->geomEntry = myEnforcedTableWidget->item(row,ENF_VER_ENTRY_COLUMN)->data(Qt::EditRole).toString().toStdString();
1893 if (myVertex->geomEntry.size())
1894 MESSAGE("Geom entry is \"" << myVertex->geomEntry << "\"" );
1895 myVertex->groupName = myEnforcedTableWidget->item(row,ENF_VER_GROUP_COLUMN)->data(Qt::EditRole).toString().toStdString();
1896 if (myVertex->groupName.size())
1897 MESSAGE("Group name is \"" << myVertex->groupName << "\"" );
1898 valueX = myEnforcedTableWidget->item(row,ENF_VER_X_COLUMN)->data(Qt::EditRole);
1899 valueY = myEnforcedTableWidget->item(row,ENF_VER_Y_COLUMN)->data(Qt::EditRole);
1900 valueZ = myEnforcedTableWidget->item(row,ENF_VER_Z_COLUMN)->data(Qt::EditRole);
1901 if (!valueX.isNull() && !valueY.isNull() && !valueZ.isNull()) {
1902 myVertex->coords.push_back(valueX.toDouble());
1903 myVertex->coords.push_back(valueY.toDouble());
1904 myVertex->coords.push_back(valueZ.toDouble());
1905 MESSAGE("Coords are (" << myVertex->coords.at(0) << ", "
1906 << myVertex->coords.at(1) << ", "
1907 << myVertex->coords.at(2) << ")");
1909 myVertex->size = myEnforcedTableWidget->item(row,ENF_VER_SIZE_COLUMN)->data(Qt::EditRole).toDouble();
1910 MESSAGE("Size is " << myVertex->size);
1911 myVertex->isCompound = myEnforcedTableWidget->item(row,ENF_VER_COMPOUND_COLUMN)->data(Qt::CheckStateRole).toBool();
1912 MESSAGE("Is compound ? " << myVertex->isCompound);
1913 h_data.myEnforcedVertices.insert(myVertex);
1917 h_data.myEnforcedMeshes.clear();
1919 for (int row=0 ; row<myEnforcedMeshTableWidget->rowCount() ; row++) {
1921 TEnfMesh *myEnfMesh = new TEnfMesh();
1922 myEnfMesh->name = myEnforcedMeshTableWidget->item(row,ENF_MESH_NAME_COLUMN)->data(Qt::EditRole).toString().toStdString();
1923 MESSAGE("Add new enforced mesh \"" << myEnfMesh->name << "\"" );
1924 myEnfMesh->entry = myEnforcedMeshTableWidget->item(row,ENF_MESH_ENTRY_COLUMN)->data(Qt::EditRole).toString().toStdString();
1925 MESSAGE("Entry is \"" << myEnfMesh->entry << "\"" );
1926 myEnfMesh->groupName = myEnforcedMeshTableWidget->item(row,ENF_MESH_GROUP_COLUMN)->data(Qt::EditRole).toString().toStdString();
1927 MESSAGE("Group name is \"" << myEnfMesh->groupName << "\"" );
1928 QComboBox* combo = qobject_cast<QComboBox*>(myEnforcedMeshTableWidget->cellWidget(row,ENF_MESH_CONSTRAINT_COLUMN));
1929 myEnfMesh->elementType = combo->currentIndex();
1930 MESSAGE("Element type: " << myEnfMesh->elementType);
1931 h_data.myEnforcedMeshes.insert(myEnfMesh);
1932 std::cout << "h_data.myEnforcedMeshes.size(): " << h_data.myEnforcedMeshes.size() << std::endl;
1938 QString GHS3DPluginGUI_HypothesisCreator::caption() const
1940 return tr( "GHS3D_TITLE" );
1943 QPixmap GHS3DPluginGUI_HypothesisCreator::icon() const
1945 return SUIT_Session::session()->resourceMgr()->loadPixmap( "GHS3DPlugin", tr( "ICON_DLG_GHS3D_PARAMETERS" ) );
1948 QString GHS3DPluginGUI_HypothesisCreator::type() const
1950 return tr( "GHS3D_HYPOTHESIS" );
1953 QString GHS3DPluginGUI_HypothesisCreator::helpPage() const
1955 return "ghs3d_hypo_page.html";