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"));
119 GMSHPluginGUI_HypothesisCreator::~GMSHPluginGUI_HypothesisCreator()
123 bool GMSHPluginGUI_HypothesisCreator::checkParams(QString& msg) const
125 GmshHypothesisData data_old, data_new;
126 readParamsFromHypo( data_old );
127 readParamsFromWidgets( data_new );
128 bool res = storeParamsToHypo( data_new );
129 msg = data_new.myErrorMsg;
130 storeParamsToHypo( data_old );
134 QFrame* GMSHPluginGUI_HypothesisCreator::buildFrame()
136 QFrame* fr = new QFrame( 0 );
137 fr->setObjectName( "myframe" );
138 QVBoxLayout* lay = new QVBoxLayout( fr );
140 lay->setSpacing( 0 );
142 QTabWidget* tab = new QTabWidget( fr );
143 tab->setTabShape( QTabWidget::Rounded );
144 tab->setTabPosition( QTabWidget::North );
145 lay->addWidget( tab );
146 QWidget* GroupC1 = new QWidget();
147 tab->insertTab( 0, GroupC1, tr( "SMESH_ARGUMENTS" ) );
149 QGridLayout* aGroupLayout = new QGridLayout( GroupC1 );
150 aGroupLayout->setSpacing( 6 );
151 aGroupLayout->setMargin( 11 );
157 aGroupLayout->addWidget( new QLabel( tr( "SMESH_NAME" ), GroupC1 ), row, 0 );
158 myName = new QLineEdit( GroupC1 );
159 myName->setMinimumWidth(160);
160 aGroupLayout->addWidget( myName, row, 1 );
164 aGroupLayout->addWidget( new QLabel( tr( "GMSH_2D_ALGO" ), GroupC1 ), row, 0 );
165 my2DAlgo = new QComboBox( GroupC1 );
166 QStringList types2DAlgo;
167 types2DAlgo << tr( "GMSH_AUTOMATIC" )
168 << tr( "GMSH_MESH_ADAPT" )
169 << tr( "GMSH_DELAUNAY" )
170 << tr( "GMSH_FRONTAL" )
171 << tr( "GMSH_DELAUNAY_FOR_QUAD" )
172 #if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=10
173 << tr( "GMSH_PACKING_OF_PARALLELOGRAMS" )
174 << tr( "GMSH_QUASI_STRUCTURED_QUAD" );
176 << tr( "GMSH_PACKING_OF_PARALLELOGRAMS" );
178 my2DAlgo->addItems( types2DAlgo );
179 aGroupLayout->addWidget( my2DAlgo, row, 1 );
185 aGroupLayout->addWidget( new QLabel( tr( "GMSH_3D_ALGO" ), GroupC1 ), row, 0 );
186 my3DAlgo = new QComboBox( GroupC1 );
187 QStringList types3DAlgo;
188 types3DAlgo << tr( "GMSH_DELAUNAY3" ) << tr( "GMSH_FRONTAL_DELAUNAY" ) << tr( "GMSH_MMG3D" ) <<
189 tr( "GMSH_R_TREE" ) << tr( "GMSH_HXT" );
190 my3DAlgo->addItems( types3DAlgo );
191 aGroupLayout->addWidget( my3DAlgo, row, 1 );
195 aGroupLayout->addWidget( new QLabel( tr( "GMSH_2D_RECOMB_ALGO" ), GroupC1 ), row, 0 );
196 myRecomb2DAlgo = new QComboBox( GroupC1 );
197 QStringList typesRecomb2DAlgo;
198 #if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=8
199 typesRecomb2DAlgo << tr( "GMSH_SIMPLE" ) << tr( "GMSH_BLOSSOM" ) << tr( "GMSH_SIMPLE_FULL_QUADS" ) << tr( "GMSH_BLOSSOM_FULL_QUADS" );
201 typesRecomb2DAlgo << tr( "GMSH_STANDARD" ) << tr( "GMSH_BLOSSOM" );
203 myRecomb2DAlgo->addItems( typesRecomb2DAlgo );
204 aGroupLayout->addWidget( myRecomb2DAlgo, row, 1 );
207 myRecombineAll = new QCheckBox( tr( "GMSH_RECOMBINE_ALL" ), GroupC1 );
208 aGroupLayout->addWidget( myRecombineAll, row, 0 );
211 aGroupLayout->addWidget( new QLabel( tr( "GMSH_SUBDIV_ALGO" ), GroupC1 ), row, 0 );
212 mySubdivAlgo = new QComboBox( GroupC1 );
213 QStringList typesSubdivAlgo;
214 typesSubdivAlgo << tr( "GMSH_NONE" ) << tr( "GMSH_ALL_QUADS" ) << tr( "GMSH_ALL_HEXAS" );
215 mySubdivAlgo->addItems( typesSubdivAlgo );
216 aGroupLayout->addWidget( mySubdivAlgo, row, 1 );
219 aGroupLayout->addWidget( new QLabel( tr( "GMSH_REMESH_ALGO" ), GroupC1 ), row, 0 );
220 myRemeshAlgo = new QComboBox( GroupC1 );
221 QStringList typesRemeshAlgo;
222 typesRemeshAlgo << tr( "GMSH_NO_SPLIT" ) << tr( "GMSH_AUTO" ) << tr( "GMSH_AUTO_ONLY_WITH_METIS" );
223 myRemeshAlgo->addItems( typesRemeshAlgo );
224 aGroupLayout->addWidget( myRemeshAlgo, row, 1 );
227 aGroupLayout->addWidget( new QLabel( tr( "GMSH_REMESH_PARA" ), GroupC1 ), row, 0 );
228 myRemeshPara = new QComboBox( GroupC1 );
229 QStringList typesRemeshPara;
230 typesRemeshPara << tr( "GMSH_HARMONIC" ) << tr( "GMSH_CONFORMAL" ) << tr( "GMSH_RBF_HARMONIC" );
231 myRemeshPara->addItems( typesRemeshPara );
232 aGroupLayout->addWidget( myRemeshPara, row, 1 );
235 aGroupLayout->addWidget( new QLabel( tr( "GMSH_SMOOTHING_STEPS" ), GroupC1 ), row, 0 );
236 mySmouthSteps = new SMESHGUI_SpinBox( GroupC1 );
237 mySmouthSteps->RangeStepAndValidator( 1, 1000, 1, "length_precision" );
238 aGroupLayout->addWidget( mySmouthSteps, row, 1 );
241 aGroupLayout->addWidget( new QLabel( tr( "GMSH_SIZE_FACTOR" ), GroupC1 ), row, 0 );
242 mySizeFactor = new SMESHGUI_SpinBox( GroupC1 );
243 mySizeFactor->RangeStepAndValidator( 1e-06, 1e+06, 0.1, "length_precision" );
244 aGroupLayout->addWidget( mySizeFactor, row, 1 );
247 #if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=10
248 aGroupLayout->addWidget( new QLabel( tr( "GMSH_SIZE_FROM_CURVATURE" ), GroupC1 ), row, 0 );
249 myMeshCurvatureSize = new SMESHGUI_SpinBox( GroupC1 );
250 myMeshCurvatureSize->RangeStepAndValidator( 0.0, 1e+22, 1.0, "length_precision" );
251 aGroupLayout->addWidget( myMeshCurvatureSize, row, 1 );
255 aGroupLayout->addWidget( new QLabel( tr( "GMSH_MIN_SIZE" ), GroupC1 ), row, 0 );
256 myMinSize = new SMESHGUI_SpinBox( GroupC1 );
257 myMinSize->RangeStepAndValidator( 0.0, 1e+22, 1., "length_precision" );
258 aGroupLayout->addWidget( myMinSize, row, 1 );
261 aGroupLayout->addWidget( new QLabel( tr( "GMSH_MAX_SIZE" ), GroupC1 ), row, 0 );
262 myMaxSize = new SMESHGUI_SpinBox( GroupC1 );
263 myMaxSize->RangeStepAndValidator( 0.0, 1e+22, 1e+21, "length_precision" );
264 aGroupLayout->addWidget( myMaxSize, row, 1 );
267 mySecondOrder = new QCheckBox( tr( "GMSH_SECOND_ORDER" ), GroupC1 );
268 aGroupLayout->addWidget( mySecondOrder, row, 0 );
270 myUseIncomplElem = new QCheckBox( tr( "GMSH_USE_INCOMPLETE_ELEMENT" ), GroupC1 );
271 aGroupLayout->addWidget( myUseIncomplElem, row, 1 );
274 connect( mySecondOrder, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
277 QWidget* compoundGroup = new QWidget();
278 tab->insertTab(1, compoundGroup, tr("GMSH_COMPOUND"));
280 myCompoundTable = new QTableWidget(0, 2, compoundGroup);
281 QGridLayout* compoundLayout = new QGridLayout(compoundGroup);
282 compoundLayout->addWidget(myCompoundTable, 1, 0, 8, 1);
284 QStringList compoundHeaders;
285 compoundHeaders << tr( "GMSH_COMPOUND_ENTRY_COLUMN" ) << tr( "GMSH_COMPOUND_NAME_COLUMN" );
286 myCompoundTable->setHorizontalHeaderLabels(compoundHeaders);
287 myCompoundTable->horizontalHeader()->hideSection(0);
288 myCompoundTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive);
289 myCompoundTable->resizeColumnToContents(1);
290 myCompoundTable->setAlternatingRowColors(true);
291 myCompoundTable->verticalHeader()->hide();
293 QPushButton* addCompoundButton = new QPushButton(tr("GMSH_COMPOUND_ADD"), compoundGroup);
294 compoundLayout->addWidget(addCompoundButton, 1, 1, 1, 1);
295 QFrame *line2 = new QFrame(compoundGroup);
297 line2->setFrameShape(QFrame::HLine);
298 line2->setFrameShadow(QFrame::Sunken);
299 compoundLayout->addWidget(line2, 2, 1, 1, 1);
301 QPushButton* removeButton = new QPushButton(tr("GMSH_COMPOUND_REMOVE"), compoundGroup);
302 compoundLayout->addWidget(removeButton, 3, 1, 1, 1);
304 connect( addCompoundButton, SIGNAL(clicked()), this, SLOT(onAddCompound()));
305 connect( removeButton, SIGNAL(clicked()), this, SLOT(onRemoveCompound()));
310 void GMSHPluginGUI_HypothesisCreator::updateWidgets()
312 myUseIncomplElem->setEnabled(mySecondOrder->isChecked());
315 void GMSHPluginGUI_HypothesisCreator::onAddCompound()
317 GMSHPlugin::GMSHPlugin_Hypothesis_var h = GMSHPlugin::GMSHPlugin_Hypothesis::_narrow(initParamsHypothesis());
318 GeomSelectionTools* geomSelectionTools = getGeomSelectionTools();
319 LightApp_SelectionMgr* mySel = geomSelectionTools->selectionMgr();
320 SALOME_ListIO ListSelectedObjects;
321 mySel->selectedObjects(ListSelectedObjects, NULL, false );
322 SALOME_ListIteratorOfListIO Object_It(ListSelectedObjects);
323 for ( ; Object_It.More() ; Object_It.Next())
325 Handle(SALOME_InteractiveObject) anObject = Object_It.Value();
326 std::string entry, shapeName;
327 entry = geomSelectionTools->getEntryOfObject(anObject);
328 shapeName = anObject->getName();
329 TopAbs_ShapeEnum shapeType;
330 shapeType = geomSelectionTools->entryToShapeType(entry);
331 if ((shapeType == TopAbs_SHAPE) || (shapeType != TopAbs_EDGE && shapeType != TopAbs_FACE))
333 myCompoundTable->setFocus();
335 shapeEntry = QString::fromStdString(entry);
336 if (myCompoundSet.contains(shapeEntry))
338 int row = myCompoundTable->rowCount() ;
339 myCompoundTable->setRowCount(row+1);
340 myCompoundTable->setItem(row, 0, new QTableWidgetItem(shapeEntry));
341 myCompoundTable->item(row, 0 )->setFlags(0);
342 myCompoundTable->setItem(row, 1, new QTableWidgetItem(QString::fromStdString(shapeName)));
343 myCompoundTable->item(row, 1 )->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled);
344 myCompoundTable->resizeColumnToContents(1);
345 myCompoundTable->clearSelection();
346 myCompoundTable->scrollToItem( myCompoundTable->item( row, 1 ) );
347 myCompoundSet.insert(shapeEntry);
348 myCompoundToRemove.remove(shapeEntry);
352 void GMSHPluginGUI_HypothesisCreator::onRemoveCompound()
354 QList<int> selectedRows;
355 QList<QTableWidgetItem*> selected = myCompoundTable->selectedItems();
356 QTableWidgetItem* item;
358 foreach(item, selected)
361 if (!selectedRows.contains(row))
362 selectedRows.append( row );
364 qSort( selectedRows );
365 QListIterator<int> it( selectedRows );
367 while (it.hasPrevious())
370 QString entry = myCompoundTable->item(row,0)->text();
371 if (myCompoundSet.contains(entry))
373 myCompoundSet.remove(entry);
374 myCompoundToRemove.insert(entry);
376 myCompoundTable->removeRow(row );
378 myCompoundTable->resizeColumnToContents(1);
381 void GMSHPluginGUI_HypothesisCreator::retrieveParams() const
383 GmshHypothesisData data;
384 readParamsFromHypo( data );
387 myName->setText( data.myName );
388 my2DAlgo->setCurrentIndex( data.my2DAlgo );
390 my3DAlgo->setCurrentIndex( data.my3DAlgo );
391 myRecomb2DAlgo->setCurrentIndex( data.myRecomb2DAlgo );
392 if ( myRecombineAll )
393 myRecombineAll->setChecked( data.myRecombineAll );
395 mySubdivAlgo->setCurrentIndex( data.mySubdivAlgo );
396 myRemeshAlgo->setCurrentIndex( data.myRemeshAlgo);
397 myRemeshPara->setCurrentIndex( data.myRemeshPara);
398 if(data.mySmouthStepsVar.isEmpty())
399 mySmouthSteps->setValue( data.mySmouthSteps );
401 mySmouthSteps->setText( data.mySmouthStepsVar );
402 if(data.mySizeFactorVar.isEmpty())
403 mySizeFactor->setValue( data.mySizeFactor );
405 mySizeFactor->setText( data.mySizeFactorVar );
406 #if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=10
407 if(data.myMeshCurvatureSizeVar.isEmpty())
408 myMeshCurvatureSize->setValue( data.myMeshCurvatureSize );
410 myMeshCurvatureSize->setText( data.myMeshCurvatureSizeVar );
412 if(data.myMaxSizeVar.isEmpty())
413 myMaxSize->setValue( data.myMaxSize );
415 myMaxSize->setText( data.myMaxSizeVar );
416 if(data.myMinSizeVar.isEmpty())
417 myMinSize->setValue( data.myMinSize );
419 myMinSize->setText( data.myMinSizeVar );
421 mySecondOrder->setChecked( data.mySecondOrder );
422 if ( myUseIncomplElem )
423 myUseIncomplElem->setChecked( data.myUseIncomplElem );
425 GMSHPluginGUI_HypothesisCreator* that = (GMSHPluginGUI_HypothesisCreator*)this;
426 that->updateWidgets();
428 GeomSelectionTools* geomSelectionTools = that->getGeomSelectionTools();
429 for (QSet<QString>::const_iterator i = myCompoundSet.begin(); i != myCompoundSet.end(); ++i)
431 const QString entry = *i;
432 std::string shapeName = geomSelectionTools->getNameFromEntry(entry.toStdString());
433 int row = myCompoundTable->rowCount();
434 myCompoundTable->setRowCount(row+1);
435 myCompoundTable->setItem(row, 0, new QTableWidgetItem(entry));
436 myCompoundTable->item(row, 0)->setFlags(0);
437 myCompoundTable->setItem(row, 1, new QTableWidgetItem(QString::fromStdString(shapeName)));
438 myCompoundTable->item(row, 1)->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled);
440 myCompoundTable->resizeColumnToContents(1);
443 QString GMSHPluginGUI_HypothesisCreator::storeParams() const
445 GmshHypothesisData data;
446 readParamsFromWidgets( data );
447 storeParamsToHypo( data );
449 QString valStr = tr("GMSH_MAX_SIZE") + " = " + QString::number( data.myMaxSize ) + "; ";
450 valStr += tr("GMSH_MIN_SIZE") + " = " + QString::number( data.myMinSize ) + "; ";
451 #if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=10
452 valStr += tr("GMSH_SIZE_FROM_CURVATURE") + " = " + QString::number( data.myMeshCurvatureSize ) + "; ";
454 if ( data.mySecondOrder )
455 valStr += tr("GMSH_SECOND_ORDER") + "; ";
460 bool GMSHPluginGUI_HypothesisCreator::readParamsFromHypo( GmshHypothesisData& h_data ) const
462 GMSHPlugin::GMSHPlugin_Hypothesis_var h =
463 GMSHPlugin::GMSHPlugin_Hypothesis::_narrow( initParamsHypothesis() );
465 HypothesisData* data = SMESH::GetHypothesisData( hypType() );
466 h_data.myName = isCreation() && data ? data->Label : "";
468 h_data.my2DAlgo = (int) h->Get2DAlgo();
470 h_data.my3DAlgo = (int) h->Get3DAlgo();
471 h_data.myRecomb2DAlgo = (int) h->GetRecomb2DAlgo();
472 h_data.myRecombineAll = h->GetRecombineAll();
473 h_data.mySubdivAlgo = (int) h->GetSubdivAlgo();
474 h_data.myRemeshAlgo = (int) h->GetRemeshAlgo();
475 h_data.myRemeshPara = (int) h->GetRemeshPara();
476 h_data.mySmouthSteps = h->GetSmouthSteps();
477 h_data.mySizeFactor = h->GetSizeFactor();
478 #if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=10
479 h_data.myMeshCurvatureSize = h->GetMeshCurvatureSize();
480 h_data.myMeshCurvatureSizeVar = getVariableName("SetMeshCurvatureSize");
482 h_data.myMinSize = h->GetMinSize();
483 h_data.myMaxSize = h->GetMaxSize();
484 h_data.mySmouthStepsVar = getVariableName("SmouthSteps");
485 h_data.mySizeFactorVar = getVariableName("SizeFactor");
486 h_data.myMinSizeVar = getVariableName("SetMinSize");
487 h_data.myMaxSizeVar = getVariableName("SetMaxSize");
488 h_data.mySecondOrder = h->GetSecondOrder();
489 h_data.myUseIncomplElem = h->GetUseIncomplElem();
491 GMSHPluginGUI_HypothesisCreator* that = (GMSHPluginGUI_HypothesisCreator*)this;
492 GMSHPlugin::string_array_var myEntries = h->GetCompoundOnEntries();
493 for ( CORBA::ULong i=0 ; i<myEntries->length() ; i++ )
495 QString entry = myEntries[i].in();
496 that->myCompoundSet.insert(entry);
502 bool GMSHPluginGUI_HypothesisCreator::storeParamsToHypo( const GmshHypothesisData& h_data ) const
504 GMSHPlugin::GMSHPlugin_Hypothesis_var h =
505 GMSHPlugin::GMSHPlugin_Hypothesis::_narrow( hypothesis() );
511 SMESH::SetName( SMESH::FindSObject( h ), h_data.myName.toLatin1().data() );
513 h->Set2DAlgo( h_data.my2DAlgo );
515 h->Set3DAlgo( h_data.my3DAlgo );
516 h->SetRecomb2DAlgo( h_data.myRecomb2DAlgo );
517 h->SetRecombineAll( h_data.myRecombineAll );
518 h->SetSubdivAlgo( h_data.mySubdivAlgo );
519 h->SetRemeshAlgo( h_data.myRemeshAlgo );
520 h->SetRemeshPara( h_data.myRemeshPara );
521 h->SetSmouthSteps( h_data.mySmouthSteps );
522 h->SetSizeFactor( h_data.mySizeFactor );
523 #if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=10
524 h->SetMeshCurvatureSize( h_data.myMeshCurvatureSize );
526 h->SetMinSize( h_data.myMinSize );
527 h->SetMaxSize( h_data.myMaxSize );
528 h->SetVarParameter( h_data.mySmouthStepsVar.toLatin1().constData(), "SmouthSteps");
529 h->SetVarParameter( h_data.mySizeFactorVar.toLatin1().constData(), "SizeFactor");
530 #if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=10
531 h->SetVarParameter( h_data.myMeshCurvatureSizeVar.toLatin1().constData(), "SetMeshCurvatureSize");
533 h->SetVarParameter( h_data.myMinSizeVar.toLatin1().constData(), "SetMinSize");
534 h->SetVarParameter( h_data.myMaxSizeVar.toLatin1().constData(), "SetMaxSize");
535 h->SetSecondOrder( h_data.mySecondOrder );
536 h->SetUseIncomplElem( h_data.myUseIncomplElem );
537 h->SetIs2d( myIs2D );
539 QString mainEntry = getMainShapeEntry();
540 for (QSet<QString>::const_iterator i = myCompoundSet.begin(); i != myCompoundSet.end(); ++i)
543 if ( myCompoundToRemove.contains( entry ))
545 if ( !mainEntry.isEmpty() && !entry.startsWith( mainEntry ))
547 h_data.myErrorMsg = "Compound group is not defined on the main geometry";
551 h->SetCompoundOnEntry(entry.toLatin1().constData());
553 for (QSet<QString>::const_iterator i = myCompoundToRemove.begin(); i != myCompoundToRemove.end(); ++i)
555 const QString entry = *i;
556 h->UnsetCompoundOnEntry(entry.toLatin1().constData());
559 catch(const SALOME::SALOME_Exception& ex)
561 SalomeApp_Tools::QtCatchCorbaException(ex);
567 bool GMSHPluginGUI_HypothesisCreator::readParamsFromWidgets( GmshHypothesisData& h_data ) const
569 h_data.myName = myName ? myName->text() : "";
570 h_data.my2DAlgo = my2DAlgo->currentIndex();
572 h_data.my3DAlgo = my3DAlgo->currentIndex();
573 h_data.myRecomb2DAlgo = myRecomb2DAlgo->currentIndex();
574 h_data.myRecombineAll = myRecombineAll->isChecked();
575 h_data.mySubdivAlgo = mySubdivAlgo->currentIndex();
576 h_data.myRemeshAlgo = myRemeshAlgo->currentIndex();
577 h_data.myRemeshPara = myRemeshPara->currentIndex();
578 h_data.mySmouthSteps = mySmouthSteps->value();
579 h_data.mySizeFactor = mySizeFactor->value();
580 #if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=10
581 h_data.myMeshCurvatureSize = myMeshCurvatureSize->value();
582 h_data.myMeshCurvatureSizeVar = myMeshCurvatureSize->text();
584 h_data.myMinSize = myMinSize->value();
585 h_data.myMaxSize = myMaxSize->value();
586 h_data.mySmouthStepsVar = mySmouthSteps->text();
587 h_data.mySizeFactorVar = mySizeFactor->text();
588 h_data.myMinSizeVar = myMinSize->text();
589 h_data.myMaxSizeVar = myMaxSize->text();
590 h_data.mySecondOrder = mySecondOrder->isChecked();
591 h_data.myUseIncomplElem = myUseIncomplElem->isChecked();
593 // ne semble pas utile dans la mesure ou myCompoundSet n'a pas besoin d'etre modifier
595 GMSHPluginGUI_HypothesisCreator* that = (GMSHPluginGUI_HypothesisCreator*)this;
596 int nbRows = myCompoundTable->rowCount();
597 for(int row=0 ; row < nbRows ; row++)
599 QString entry = myLocalSizeTable->item(row, 1)->text();
600 that->myCompoundSet.insert(entry);
606 // on ne modifie rien à partir de là
608 GeomSelectionTools* GMSHPluginGUI_HypothesisCreator::getGeomSelectionTools()
610 if (myGeomSelectionTools == NULL) {
611 myGeomSelectionTools = new GeomSelectionTools();
613 return myGeomSelectionTools;
616 QString GMSHPluginGUI_HypothesisCreator::caption() const
618 return tr( QString( "GMSH_%1_TITLE" ).arg(myIs2D?QString("2D"):QString("3D")).toLatin1().data() );
621 QPixmap GMSHPluginGUI_HypothesisCreator::icon() const
623 QString hypIconName = tr( QString("ICON_DLG_GMSH_PARAMETERS%1").arg(myIs2D?QString("_2D"):QString("")).toLatin1().data() );
624 return SUIT_Session::session()->resourceMgr()->loadPixmap( "GMSHPlugin", hypIconName );
627 QString GMSHPluginGUI_HypothesisCreator::type() const
629 return tr( QString( "GMSH_%1_HYPOTHESIS" ).arg(myIs2D?QString("2D"):QString("3D")).toLatin1().data() );
632 QString GMSHPluginGUI_HypothesisCreator::helpPage() const
634 return "gmsh_2d_3d_hypo_page.html";