1 // Copyright (C) 2012-2015 ALNEOS
2 // Copyright (C) 2016-2022 EDF R&D
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.alneos.com/ or email : contact@alneos.fr
19 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #include "GMSHPluginGUI_HypothesisCreator.h"
23 #include <SMESHGUI_Utils.h>
24 #include <SMESHGUI_HypothesesUtils.h>
25 #include <SMESHGUI_SpinBox.h>
26 #include <GeomSelectionTools.h>
28 #include CORBA_SERVER_HEADER(GMSHPlugin_Algorithm)
30 #include <SUIT_Session.h>
31 #include <SUIT_ResourceMgr.h>
33 #include <SalomeApp_Tools.h>
34 #include <LightApp_SelectionMgr.h>
35 #include <SALOME_ListIO.hxx>
45 #include <QTableWidget>
46 #include <QHeaderView>
47 #include <QPushButton>
56 #if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=10
57 packingparallelograms,
73 #if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=8
111 GMSHPluginGUI_HypothesisCreator::GMSHPluginGUI_HypothesisCreator( const QString& theHypType )
112 : SMESHGUI_GenericHypothesisCreator( theHypType )
114 myGeomSelectionTools = NULL;
115 myCompoundSet.clear();
116 myIs2D = ( theHypType.endsWith("2D"));
117 myIs3D = (theHypType.endsWith("3D"));
120 GMSHPluginGUI_HypothesisCreator::~GMSHPluginGUI_HypothesisCreator()
124 bool GMSHPluginGUI_HypothesisCreator::checkParams(QString& msg) const
126 GmshHypothesisData data_old, data_new;
127 readParamsFromHypo( data_old );
128 readParamsFromWidgets( data_new );
129 bool res = storeParamsToHypo( data_new );
130 msg = data_new.myErrorMsg;
131 storeParamsToHypo( data_old );
135 QFrame* GMSHPluginGUI_HypothesisCreator::buildFrame()
137 QFrame* fr = new QFrame( 0 );
138 fr->setObjectName( "myframe" );
139 QVBoxLayout* lay = new QVBoxLayout( fr );
141 lay->setSpacing( 0 );
143 QTabWidget* tab = new QTabWidget( fr );
144 tab->setTabShape( QTabWidget::Rounded );
145 tab->setTabPosition( QTabWidget::North );
146 lay->addWidget( tab );
147 QWidget* GroupC1 = new QWidget();
148 tab->insertTab( 0, GroupC1, tr( "SMESH_ARGUMENTS" ) );
150 QGridLayout* aGroupLayout = new QGridLayout( GroupC1 );
151 aGroupLayout->setSpacing( 6 );
152 aGroupLayout->setMargin( 11 );
158 aGroupLayout->addWidget( new QLabel( tr( "SMESH_NAME" ), GroupC1 ), row, 0 );
159 myName = new QLineEdit( GroupC1 );
160 myName->setMinimumWidth(160);
161 aGroupLayout->addWidget( myName, row, 1 );
168 aGroupLayout->addWidget(new QLabel(tr("GMSH_2D_ALGO"), GroupC1), row, 0);
169 my2DAlgo = new QComboBox(GroupC1);
170 QStringList types2DAlgo;
171 types2DAlgo << tr("GMSH_AUTOMATIC")
172 << tr("GMSH_MESH_ADAPT")
173 << tr("GMSH_DELAUNAY")
174 << tr("GMSH_FRONTAL")
175 << tr("GMSH_DELAUNAY_FOR_QUAD")
176 #if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=10
177 << tr("GMSH_PACKING_OF_PARALLELOGRAMS")
178 << tr("GMSH_QUASI_STRUCTURED_QUAD");
180 << tr("GMSH_PACKING_OF_PARALLELOGRAMS");
182 my2DAlgo->addItems(types2DAlgo);
183 aGroupLayout->addWidget(my2DAlgo, row, 1);
190 aGroupLayout->addWidget( new QLabel( tr( "GMSH_3D_ALGO" ), GroupC1 ), row, 0 );
191 my3DAlgo = new QComboBox( GroupC1 );
192 QStringList types3DAlgo;
193 types3DAlgo << tr( "GMSH_DELAUNAY3" ) << tr( "GMSH_FRONTAL_DELAUNAY" ) << tr( "GMSH_MMG3D" ) <<
194 tr( "GMSH_R_TREE" ) << tr( "GMSH_HXT" );
195 my3DAlgo->addItems( types3DAlgo );
196 aGroupLayout->addWidget( my3DAlgo, row, 1 );
203 aGroupLayout->addWidget(new QLabel(tr("GMSH_2D_RECOMB_ALGO"), GroupC1), row, 0);
204 myRecomb2DAlgo = new QComboBox(GroupC1);
205 QStringList typesRecomb2DAlgo;
206 #if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=8
207 typesRecomb2DAlgo << tr("GMSH_SIMPLE") << tr("GMSH_BLOSSOM") << tr("GMSH_SIMPLE_FULL_QUADS") << tr("GMSH_BLOSSOM_FULL_QUADS");
209 typesRecomb2DAlgo << tr("GMSH_STANDARD") << tr("GMSH_BLOSSOM");
211 myRecomb2DAlgo->addItems(typesRecomb2DAlgo);
212 aGroupLayout->addWidget(myRecomb2DAlgo, row, 1);
215 myRecombineAll = new QCheckBox( tr( "GMSH_RECOMBINE_ALL" ), GroupC1 );
216 aGroupLayout->addWidget( myRecombineAll, row, 0 );
221 aGroupLayout->addWidget(new QLabel(tr("GMSH_SUBDIV_ALGO"), GroupC1), row, 0);
222 mySubdivAlgo = new QComboBox(GroupC1);
223 QStringList typesSubdivAlgo;
224 typesSubdivAlgo << tr("GMSH_NONE") << tr("GMSH_ALL_QUADS") << tr("GMSH_ALL_HEXAS");
225 mySubdivAlgo->addItems(typesSubdivAlgo);
226 aGroupLayout->addWidget(mySubdivAlgo, row, 1);
233 aGroupLayout->addWidget(new QLabel(tr("GMSH_REMESH_ALGO"), GroupC1), row, 0);
234 myRemeshAlgo = new QComboBox(GroupC1);
235 QStringList typesRemeshAlgo;
236 typesRemeshAlgo << tr("GMSH_NO_SPLIT") << tr("GMSH_AUTO") << tr("GMSH_AUTO_ONLY_WITH_METIS");
237 myRemeshAlgo->addItems(typesRemeshAlgo);
238 aGroupLayout->addWidget(myRemeshAlgo, row, 1);
241 aGroupLayout->addWidget(new QLabel(tr("GMSH_REMESH_PARA"), GroupC1), row, 0);
242 myRemeshPara = new QComboBox(GroupC1);
243 QStringList typesRemeshPara;
244 typesRemeshPara << tr("GMSH_HARMONIC") << tr("GMSH_CONFORMAL") << tr("GMSH_RBF_HARMONIC");
245 myRemeshPara->addItems(typesRemeshPara);
246 aGroupLayout->addWidget(myRemeshPara, row, 1);
250 aGroupLayout->addWidget( new QLabel( tr( "GMSH_SMOOTHING_STEPS" ), GroupC1 ), row, 0 );
251 mySmouthSteps = new SMESHGUI_SpinBox( GroupC1 );
252 mySmouthSteps->RangeStepAndValidator( 1, 1000, 1, "length_precision" );
253 aGroupLayout->addWidget( mySmouthSteps, row, 1 );
256 aGroupLayout->addWidget( new QLabel( tr( "GMSH_SIZE_FACTOR" ), GroupC1 ), row, 0 );
257 mySizeFactor = new SMESHGUI_SpinBox( GroupC1 );
258 mySizeFactor->RangeStepAndValidator( 1e-06, 1e+06, 0.1, "length_precision" );
259 aGroupLayout->addWidget( mySizeFactor, row, 1 );
262 #if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=10
263 aGroupLayout->addWidget( new QLabel( tr( "GMSH_SIZE_FROM_CURVATURE" ), GroupC1 ), row, 0 );
264 myMeshCurvatureSize = new SMESHGUI_SpinBox( GroupC1 );
265 myMeshCurvatureSize->RangeStepAndValidator( 0.0, 1e+22, 1.0, "length_precision" );
266 aGroupLayout->addWidget( myMeshCurvatureSize, row, 1 );
270 aGroupLayout->addWidget( new QLabel( tr( "GMSH_MIN_SIZE" ), GroupC1 ), row, 0 );
271 myMinSize = new SMESHGUI_SpinBox( GroupC1 );
272 myMinSize->RangeStepAndValidator( 0.0, 1e+22, 1., "length_precision" );
273 aGroupLayout->addWidget( myMinSize, row, 1 );
276 aGroupLayout->addWidget( new QLabel( tr( "GMSH_MAX_SIZE" ), GroupC1 ), row, 0 );
277 myMaxSize = new SMESHGUI_SpinBox( GroupC1 );
278 myMaxSize->RangeStepAndValidator( 0.0, 1e+22, 1e+21, "length_precision" );
279 aGroupLayout->addWidget( myMaxSize, row, 1 );
282 mySecondOrder = new QCheckBox( tr( "GMSH_SECOND_ORDER" ), GroupC1 );
283 aGroupLayout->addWidget( mySecondOrder, row, 0 );
285 myUseIncomplElem = new QCheckBox( tr( "GMSH_USE_INCOMPLETE_ELEMENT" ), GroupC1 );
286 aGroupLayout->addWidget( myUseIncomplElem, row, 1 );
289 connect( mySecondOrder, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
294 QWidget* compoundGroup = new QWidget();
295 tab->insertTab(1, compoundGroup, tr("GMSH_COMPOUND"));
297 myCompoundTable = new QTableWidget(0, 2, compoundGroup);
298 QGridLayout* compoundLayout = new QGridLayout(compoundGroup);
299 compoundLayout->addWidget(myCompoundTable, 1, 0, 8, 1);
301 QStringList compoundHeaders;
302 compoundHeaders << tr("GMSH_COMPOUND_ENTRY_COLUMN") << tr("GMSH_COMPOUND_NAME_COLUMN");
303 myCompoundTable->setHorizontalHeaderLabels(compoundHeaders);
304 myCompoundTable->horizontalHeader()->hideSection(0);
305 myCompoundTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive);
306 myCompoundTable->resizeColumnToContents(1);
307 myCompoundTable->setAlternatingRowColors(true);
308 myCompoundTable->verticalHeader()->hide();
310 QPushButton* addCompoundButton = new QPushButton(tr("GMSH_COMPOUND_ADD"), compoundGroup);
311 compoundLayout->addWidget(addCompoundButton, 1, 1, 1, 1);
312 QFrame *line2 = new QFrame(compoundGroup);
314 line2->setFrameShape(QFrame::HLine);
315 line2->setFrameShadow(QFrame::Sunken);
316 compoundLayout->addWidget(line2, 2, 1, 1, 1);
318 QPushButton* removeButton = new QPushButton(tr("GMSH_COMPOUND_REMOVE"), compoundGroup);
319 compoundLayout->addWidget(removeButton, 3, 1, 1, 1);
321 connect(addCompoundButton, SIGNAL(clicked()), this, SLOT(onAddCompound()));
322 connect(removeButton, SIGNAL(clicked()), this, SLOT(onRemoveCompound()));
327 void GMSHPluginGUI_HypothesisCreator::updateWidgets()
329 myUseIncomplElem->setEnabled(mySecondOrder->isChecked());
332 void GMSHPluginGUI_HypothesisCreator::onAddCompound()
334 GMSHPlugin::GMSHPlugin_Hypothesis_var h = GMSHPlugin::GMSHPlugin_Hypothesis::_narrow(initParamsHypothesis());
335 GeomSelectionTools* geomSelectionTools = getGeomSelectionTools();
336 LightApp_SelectionMgr* mySel = geomSelectionTools->selectionMgr();
337 SALOME_ListIO ListSelectedObjects;
338 mySel->selectedObjects(ListSelectedObjects, NULL, false );
339 SALOME_ListIteratorOfListIO Object_It(ListSelectedObjects);
340 for ( ; Object_It.More() ; Object_It.Next())
342 Handle(SALOME_InteractiveObject) anObject = Object_It.Value();
343 std::string entry, shapeName;
344 entry = geomSelectionTools->getEntryOfObject(anObject);
345 shapeName = anObject->getName();
346 TopAbs_ShapeEnum shapeType;
347 shapeType = geomSelectionTools->entryToShapeType(entry);
348 if ((shapeType == TopAbs_SHAPE) || (shapeType != TopAbs_EDGE && shapeType != TopAbs_FACE))
350 myCompoundTable->setFocus();
352 shapeEntry = QString::fromStdString(entry);
353 if (myCompoundSet.contains(shapeEntry))
355 int row = myCompoundTable->rowCount() ;
356 myCompoundTable->setRowCount(row+1);
357 myCompoundTable->setItem(row, 0, new QTableWidgetItem(shapeEntry));
358 myCompoundTable->item(row, 0 )->setFlags(0);
359 myCompoundTable->setItem(row, 1, new QTableWidgetItem(QString::fromStdString(shapeName)));
360 myCompoundTable->item(row, 1 )->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled);
361 myCompoundTable->resizeColumnToContents(1);
362 myCompoundTable->clearSelection();
363 myCompoundTable->scrollToItem( myCompoundTable->item( row, 1 ) );
364 myCompoundSet.insert(shapeEntry);
365 myCompoundToRemove.remove(shapeEntry);
369 void GMSHPluginGUI_HypothesisCreator::onRemoveCompound()
371 QList<int> selectedRows;
372 QList<QTableWidgetItem*> selected = myCompoundTable->selectedItems();
373 QTableWidgetItem* item;
375 foreach(item, selected)
378 if (!selectedRows.contains(row))
379 selectedRows.append( row );
381 qSort( selectedRows );
382 QListIterator<int> it( selectedRows );
384 while (it.hasPrevious())
387 QString entry = myCompoundTable->item(row,0)->text();
388 if (myCompoundSet.contains(entry))
390 myCompoundSet.remove(entry);
391 myCompoundToRemove.insert(entry);
393 myCompoundTable->removeRow(row );
395 myCompoundTable->resizeColumnToContents(1);
398 void GMSHPluginGUI_HypothesisCreator::retrieveParams() const
400 GmshHypothesisData data;
401 readParamsFromHypo( data );
404 myName->setText( data.myName );
406 my2DAlgo->setCurrentIndex( data.my2DAlgo );
408 my3DAlgo->setCurrentIndex( data.my3DAlgo );
410 myRecomb2DAlgo->setCurrentIndex( data.myRecomb2DAlgo );
411 if ( myRecombineAll )
412 myRecombineAll->setChecked( data.myRecombineAll );
414 mySubdivAlgo->setCurrentIndex( data.mySubdivAlgo );
417 myRemeshAlgo->setCurrentIndex(data.myRemeshAlgo);
418 myRemeshPara->setCurrentIndex(data.myRemeshPara);
420 if(data.mySmouthStepsVar.isEmpty())
421 mySmouthSteps->setValue( data.mySmouthSteps );
423 mySmouthSteps->setText( data.mySmouthStepsVar );
424 if(data.mySizeFactorVar.isEmpty())
425 mySizeFactor->setValue( data.mySizeFactor );
427 mySizeFactor->setText( data.mySizeFactorVar );
428 #if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=10
429 if(data.myMeshCurvatureSizeVar.isEmpty())
430 myMeshCurvatureSize->setValue( data.myMeshCurvatureSize );
432 myMeshCurvatureSize->setText( data.myMeshCurvatureSizeVar );
434 if(data.myMaxSizeVar.isEmpty())
435 myMaxSize->setValue( data.myMaxSize );
437 myMaxSize->setText( data.myMaxSizeVar );
438 if(data.myMinSizeVar.isEmpty())
439 myMinSize->setValue( data.myMinSize );
441 myMinSize->setText( data.myMinSizeVar );
443 mySecondOrder->setChecked( data.mySecondOrder );
444 if ( myUseIncomplElem )
445 myUseIncomplElem->setChecked( data.myUseIncomplElem );
447 GMSHPluginGUI_HypothesisCreator* that = (GMSHPluginGUI_HypothesisCreator*)this;
448 that->updateWidgets();
452 GeomSelectionTools* geomSelectionTools = that->getGeomSelectionTools();
453 for (QSet<QString>::const_iterator i = myCompoundSet.begin(); i != myCompoundSet.end(); ++i)
455 const QString entry = *i;
456 std::string shapeName = geomSelectionTools->getNameFromEntry(entry.toStdString());
457 int row = myCompoundTable->rowCount();
458 myCompoundTable->setRowCount(row + 1);
459 myCompoundTable->setItem(row, 0, new QTableWidgetItem(entry));
460 myCompoundTable->item(row, 0)->setFlags(0);
461 myCompoundTable->setItem(row, 1, new QTableWidgetItem(QString::fromStdString(shapeName)));
462 myCompoundTable->item(row, 1)->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
464 myCompoundTable->resizeColumnToContents(1);
468 QString GMSHPluginGUI_HypothesisCreator::storeParams() const
470 GmshHypothesisData data;
471 readParamsFromWidgets( data );
472 storeParamsToHypo( data );
474 QString valStr = tr("GMSH_MAX_SIZE") + " = " + QString::number( data.myMaxSize ) + "; ";
475 valStr += tr("GMSH_MIN_SIZE") + " = " + QString::number( data.myMinSize ) + "; ";
476 #if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=10
477 valStr += tr("GMSH_SIZE_FROM_CURVATURE") + " = " + QString::number( data.myMeshCurvatureSize ) + "; ";
479 if ( data.mySecondOrder )
480 valStr += tr("GMSH_SECOND_ORDER") + "; ";
485 bool GMSHPluginGUI_HypothesisCreator::readParamsFromHypo( GmshHypothesisData& h_data ) const
487 GMSHPlugin::GMSHPlugin_Hypothesis_var h =
488 GMSHPlugin::GMSHPlugin_Hypothesis::_narrow( initParamsHypothesis() );
490 HypothesisData* data = SMESH::GetHypothesisData( hypType() );
491 h_data.myName = isCreation() && data ? data->Label : "";
493 h_data.my2DAlgo = (int) h->Get2DAlgo();
495 h_data.my3DAlgo = (int) h->Get3DAlgo();
496 h_data.myRecomb2DAlgo = (int) h->GetRecomb2DAlgo();
497 h_data.myRecombineAll = h->GetRecombineAll();
498 h_data.mySubdivAlgo = (int) h->GetSubdivAlgo();
499 h_data.myRemeshAlgo = (int) h->GetRemeshAlgo();
500 h_data.myRemeshPara = (int) h->GetRemeshPara();
501 h_data.mySmouthSteps = h->GetSmouthSteps();
502 h_data.mySizeFactor = h->GetSizeFactor();
503 #if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=10
504 h_data.myMeshCurvatureSize = h->GetMeshCurvatureSize();
505 h_data.myMeshCurvatureSizeVar = getVariableName("SetMeshCurvatureSize");
507 h_data.myMinSize = h->GetMinSize();
508 h_data.myMaxSize = h->GetMaxSize();
509 h_data.mySmouthStepsVar = getVariableName("SmouthSteps");
510 h_data.mySizeFactorVar = getVariableName("SizeFactor");
511 h_data.myMinSizeVar = getVariableName("SetMinSize");
512 h_data.myMaxSizeVar = getVariableName("SetMaxSize");
513 h_data.mySecondOrder = h->GetSecondOrder();
514 h_data.myUseIncomplElem = h->GetUseIncomplElem();
516 GMSHPluginGUI_HypothesisCreator* that = (GMSHPluginGUI_HypothesisCreator*)this;
517 GMSHPlugin::string_array_var myEntries = h->GetCompoundOnEntries();
518 for ( CORBA::ULong i=0 ; i<myEntries->length() ; i++ )
520 QString entry = myEntries[i].in();
521 that->myCompoundSet.insert(entry);
527 bool GMSHPluginGUI_HypothesisCreator::storeParamsToHypo( const GmshHypothesisData& h_data ) const
529 GMSHPlugin::GMSHPlugin_Hypothesis_var h =
530 GMSHPlugin::GMSHPlugin_Hypothesis::_narrow( hypothesis() );
536 SMESH::SetName( SMESH::FindSObject( h ), h_data.myName.toLatin1().data() );
538 h->Set2DAlgo( h_data.my2DAlgo );
540 h->Set3DAlgo( h_data.my3DAlgo );
542 h->SetRecomb2DAlgo( h_data.myRecomb2DAlgo );
543 h->SetRecombineAll( h_data.myRecombineAll );
544 h->SetSubdivAlgo( h_data.mySubdivAlgo );
547 h->SetRemeshAlgo(h_data.myRemeshAlgo);
548 h->SetRemeshPara(h_data.myRemeshPara);
550 h->SetSmouthSteps( h_data.mySmouthSteps );
551 h->SetSizeFactor( h_data.mySizeFactor );
552 #if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=10
553 h->SetMeshCurvatureSize( h_data.myMeshCurvatureSize );
555 h->SetMinSize( h_data.myMinSize );
556 h->SetMaxSize( h_data.myMaxSize );
557 h->SetVarParameter( h_data.mySmouthStepsVar.toLatin1().constData(), "SmouthSteps");
558 h->SetVarParameter( h_data.mySizeFactorVar.toLatin1().constData(), "SizeFactor");
559 #if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=10
560 h->SetVarParameter( h_data.myMeshCurvatureSizeVar.toLatin1().constData(), "SetMeshCurvatureSize");
562 h->SetVarParameter( h_data.myMinSizeVar.toLatin1().constData(), "SetMinSize");
563 h->SetVarParameter( h_data.myMaxSizeVar.toLatin1().constData(), "SetMaxSize");
564 h->SetSecondOrder( h_data.mySecondOrder );
565 h->SetUseIncomplElem( h_data.myUseIncomplElem );
566 h->SetIs2d( myIs2D );
568 QString mainEntry = getMainShapeEntry();
569 for (QSet<QString>::const_iterator i = myCompoundSet.begin(); i != myCompoundSet.end(); ++i)
572 if ( myCompoundToRemove.contains( entry ))
574 if ( !mainEntry.isEmpty() && !entry.startsWith( mainEntry ))
576 h_data.myErrorMsg = "Compound group is not defined on the main geometry";
580 h->SetCompoundOnEntry(entry.toLatin1().constData());
582 for (QSet<QString>::const_iterator i = myCompoundToRemove.begin(); i != myCompoundToRemove.end(); ++i)
584 const QString entry = *i;
585 h->UnsetCompoundOnEntry(entry.toLatin1().constData());
588 catch(const SALOME::SALOME_Exception& ex)
590 SalomeApp_Tools::QtCatchCorbaException(ex);
596 bool GMSHPluginGUI_HypothesisCreator::readParamsFromWidgets( GmshHypothesisData& h_data ) const
598 h_data.myName = myName ? myName->text() : "";
600 h_data.my2DAlgo = my2DAlgo->currentIndex();
602 h_data.my3DAlgo = my3DAlgo->currentIndex();
604 h_data.myRecomb2DAlgo = myRecomb2DAlgo->currentIndex();
605 h_data.myRecombineAll = myRecombineAll->isChecked();
606 h_data.mySubdivAlgo = mySubdivAlgo->currentIndex();
608 h_data.myRemeshAlgo = myRemeshAlgo->currentIndex();
610 h_data.myRemeshPara = myRemeshPara->currentIndex();
611 h_data.mySmouthSteps = mySmouthSteps->value();
612 h_data.mySizeFactor = mySizeFactor->value();
613 #if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=10
614 h_data.myMeshCurvatureSize = myMeshCurvatureSize->value();
615 h_data.myMeshCurvatureSizeVar = myMeshCurvatureSize->text();
617 h_data.myMinSize = myMinSize->value();
618 h_data.myMaxSize = myMaxSize->value();
619 h_data.mySmouthStepsVar = mySmouthSteps->text();
620 h_data.mySizeFactorVar = mySizeFactor->text();
621 h_data.myMinSizeVar = myMinSize->text();
622 h_data.myMaxSizeVar = myMaxSize->text();
623 h_data.mySecondOrder = mySecondOrder->isChecked();
624 h_data.myUseIncomplElem = myUseIncomplElem->isChecked();
626 // ne semble pas utile dans la mesure ou myCompoundSet n'a pas besoin d'etre modifier
628 GMSHPluginGUI_HypothesisCreator* that = (GMSHPluginGUI_HypothesisCreator*)this;
629 int nbRows = myCompoundTable->rowCount();
630 for(int row=0 ; row < nbRows ; row++)
632 QString entry = myLocalSizeTable->item(row, 1)->text();
633 that->myCompoundSet.insert(entry);
639 // on ne modifie rien à partir de là
641 GeomSelectionTools* GMSHPluginGUI_HypothesisCreator::getGeomSelectionTools()
643 if (myGeomSelectionTools == NULL) {
644 myGeomSelectionTools = new GeomSelectionTools();
646 return myGeomSelectionTools;
649 QString GMSHPluginGUI_HypothesisCreator::caption() const
651 return tr( QString( "GMSH_%1_TITLE" ).arg(myIs2D?QString("2D"):QString("3D")).toLatin1().data() );
654 QPixmap GMSHPluginGUI_HypothesisCreator::icon() const
656 QString hypIconName = tr( QString("ICON_DLG_GMSH_PARAMETERS%1").arg(myIs2D?QString("_2D"):QString("")).toLatin1().data() );
657 return SUIT_Session::session()->resourceMgr()->loadPixmap( "GMSHPlugin", hypIconName );
660 QString GMSHPluginGUI_HypothesisCreator::type() const
662 return tr( QString( "GMSH_%1_HYPOTHESIS" ).arg(myIs2D?QString("2D"):QString("3D")).toLatin1().data() );
665 QString GMSHPluginGUI_HypothesisCreator::helpPage() const
667 return "gmsh_2d_3d_hypo_page.html";