Salome HOME
Update copyrights
[plugins/gmshplugin.git] / src / GUI / GMSHPluginGUI_HypothesisCreator.cxx
1 // Copyright (C) 2012-2015  ALNEOS
2 // Copyright (C) 2016-2019  EDF R&D
3 //
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.
8 //
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.
13 //
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
17 //
18 // See http://www.alneos.com/ or email : contact@alneos.fr
19 //
20 #include "GMSHPluginGUI_HypothesisCreator.h"
21
22 #include <SMESHGUI_Utils.h>
23 #include <SMESHGUI_HypothesesUtils.h>
24 #include <SMESHGUI_SpinBox.h>
25 #include <GeomSelectionTools.h>
26
27 #include CORBA_SERVER_HEADER(GMSHPlugin_Algorithm)
28
29 #include <SUIT_Session.h>
30 #include <SUIT_ResourceMgr.h>
31
32 #include <SalomeApp_Tools.h>
33 #include <LightApp_SelectionMgr.h>
34 #include <SALOME_ListIO.hxx>
35
36 #include <QComboBox>
37 #include <QLabel>
38 #include <QGroupBox>
39 #include <QFrame>
40 #include <QLayout>
41 #include <QLineEdit>
42 #include <QCheckBox>
43 #include <QPixmap>
44 #include <QTableWidget>
45 #include <QHeaderView>
46 #include <QPushButton>
47
48 enum Algo2D
49   {
50    automatic,
51    meshadapt,
52    delaunay,
53    frontal,
54    delaunayforquad,
55    packingparallelograms
56   };
57
58 enum Algo3D
59   {
60    frontal3,
61    frontaldelaunay,
62    fontalhex,
63    mmg3d,
64    rtree
65   };
66
67 enum Recomb2DAlgo
68   {
69    standard,
70    blossom
71   };
72
73 enum SubdivAlgo
74   {
75    none,
76    allquads,
77    allhexas
78   };
79
80 enum RemeshAlgo
81   {
82    nosplit,
83    automaticR,
84    automaticmetis
85   };
86
87 enum RemeshPara
88   {
89    harmonic,
90    conformal,
91    rbfharmonic
92   };
93
94
95 GMSHPluginGUI_HypothesisCreator::GMSHPluginGUI_HypothesisCreator( const QString& theHypType )
96   : SMESHGUI_GenericHypothesisCreator( theHypType )
97 {
98   myGeomSelectionTools = NULL;
99   myCompoundSet.clear();
100   myIs2D = ( theHypType.endsWith("2D"));
101 }
102
103 GMSHPluginGUI_HypothesisCreator::~GMSHPluginGUI_HypothesisCreator()
104 {
105 }
106
107 bool GMSHPluginGUI_HypothesisCreator::checkParams(QString& msg) const
108 {
109   GmshHypothesisData data_old, data_new;
110   readParamsFromHypo( data_old );
111   readParamsFromWidgets( data_new );
112   bool res = storeParamsToHypo( data_new );
113   storeParamsToHypo( data_old );
114   return res;
115 }
116
117 QFrame* GMSHPluginGUI_HypothesisCreator::buildFrame()
118 {
119   QFrame* fr = new QFrame( 0 );
120   fr->setObjectName( "myframe" );
121   QVBoxLayout* lay = new QVBoxLayout( fr );
122   lay->setMargin( 5 );
123   lay->setSpacing( 0 );
124
125   QTabWidget* tab = new QTabWidget( fr );
126   tab->setTabShape( QTabWidget::Rounded );
127   tab->setTabPosition( QTabWidget::North );
128   lay->addWidget( tab );
129   QWidget* GroupC1 = new QWidget();
130   tab->insertTab( 0, GroupC1, tr( "SMESH_ARGUMENTS" ) );
131   
132   QGridLayout* aGroupLayout = new QGridLayout( GroupC1 );
133   aGroupLayout->setSpacing( 6 );
134   aGroupLayout->setMargin( 11 );
135   
136   int row = 0;
137   myName = 0;
138   if( isCreation() )
139   {
140     aGroupLayout->addWidget( new QLabel( tr( "SMESH_NAME" ), GroupC1 ), row, 0 );
141     myName = new QLineEdit( GroupC1 );
142     myName->setMinimumWidth(160);
143     aGroupLayout->addWidget( myName, row, 1 );
144     row++;
145   }
146
147   aGroupLayout->addWidget( new QLabel( tr( "GMSH_2D_ALGO" ), GroupC1 ), row, 0 );
148   my2DAlgo = new QComboBox( GroupC1 );
149   QStringList types2DAlgo;
150   types2DAlgo << tr( "GMSH_AUTOMATIC" ) << tr( "GMSH_MESH_ADAPT" )   << tr( "GMSH_DELAUNAY" ) <<
151                  tr( "GMSH_FRONTAL" )       << tr( "GMSH_DELAUNAY_FOR_QUAD" ) << tr( "GMSH_PACKING_OF_PARALLELOGRAMS" );
152   my2DAlgo->addItems( types2DAlgo );
153   aGroupLayout->addWidget( my2DAlgo, row, 1 );
154   row++;
155   
156   my3DAlgo = 0;
157   if ( !myIs2D )
158   {
159     aGroupLayout->addWidget( new QLabel( tr( "GMSH_3D_ALGO" ), GroupC1 ), row, 0 );
160     my3DAlgo = new QComboBox( GroupC1 );
161     QStringList types3DAlgo;
162     types3DAlgo << tr( "GMSH_FRONTAL_DELAUNAY" ) << tr( "GMSH_FRONTAL_HEX" )   << tr( "GMSH_MMG3D" ) <<
163                    tr( "GMSH_R_TREE" );
164     my3DAlgo->addItems( types3DAlgo );
165     aGroupLayout->addWidget( my3DAlgo, row, 1 );
166     row++;
167   }
168   
169   aGroupLayout->addWidget( new QLabel( tr( "GMSH_2D_RECOMB_ALGO" ), GroupC1 ), row, 0 );
170   myRecomb2DAlgo = new QComboBox( GroupC1 );
171   QStringList typesRecomb2DAlgo;
172   typesRecomb2DAlgo << tr( "GMSH_STANDARD" ) << tr( "GMSH_BLOSSOM" );
173   myRecomb2DAlgo->addItems( typesRecomb2DAlgo );
174   aGroupLayout->addWidget( myRecomb2DAlgo, row, 1 );
175   row++;
176   
177   myRecombineAll = new QCheckBox( tr( "GMSH_RECOMBINE_ALL" ), GroupC1 );
178   aGroupLayout->addWidget( myRecombineAll, row, 0 );
179   row++;
180   
181   aGroupLayout->addWidget( new QLabel( tr( "GMSH_SUBDIV_ALGO" ), GroupC1 ), row, 0 );
182   mySubdivAlgo = new QComboBox( GroupC1 );
183   QStringList typesSubdivAlgo;
184   typesSubdivAlgo << tr( "GMSH_NONE" ) << tr( "GMSH_ALL_QUADS" )   << tr( "GMSH_ALL_HEXAS" );
185   mySubdivAlgo->addItems( typesSubdivAlgo );
186   aGroupLayout->addWidget( mySubdivAlgo, row, 1 );
187   row++;
188   
189   aGroupLayout->addWidget( new QLabel( tr( "GMSH_REMESH_ALGO" ), GroupC1 ), row, 0 );
190   myRemeshAlgo = new QComboBox( GroupC1 );
191   QStringList typesRemeshAlgo;
192   typesRemeshAlgo << tr( "GMSH_NO_SPLIT" ) << tr( "GMSH_AUTO" )   << tr( "GMSH_AUTO_ONLY_WITH_METIS" );
193   myRemeshAlgo->addItems( typesRemeshAlgo );
194   aGroupLayout->addWidget( myRemeshAlgo, row, 1 );
195   row++;
196   
197   aGroupLayout->addWidget( new QLabel( tr( "GMSH_REMESH_PARA" ), GroupC1 ), row, 0 );
198   myRemeshPara = new QComboBox( GroupC1 );
199   QStringList typesRemeshPara;
200   typesRemeshPara << tr( "GMSH_HARMONIC" ) << tr( "GMSH_CONFORMAL" )   << tr( "GMSH_RBF_HARMONIC" );
201   myRemeshPara->addItems( typesRemeshPara );
202   aGroupLayout->addWidget( myRemeshPara, row, 1 );
203   row++;
204   
205   aGroupLayout->addWidget( new QLabel( tr( "GMSH_SMOOTHING_STEPS" ), GroupC1 ), row, 0 );
206   mySmouthSteps = new SMESHGUI_SpinBox( GroupC1 );
207   mySmouthSteps->RangeStepAndValidator( 1, 1000, 1, "length_precision" );
208   aGroupLayout->addWidget( mySmouthSteps, row, 1 );
209   row++;
210
211   aGroupLayout->addWidget( new QLabel( tr( "GMSH_SIZE_FACTOR" ), GroupC1 ), row, 0 );
212   mySizeFactor = new SMESHGUI_SpinBox( GroupC1 );
213   mySizeFactor->RangeStepAndValidator( 1e-06, 1e+06, 0.1, "length_precision" );
214   aGroupLayout->addWidget( mySizeFactor, row, 1 );
215   row++;
216   
217   aGroupLayout->addWidget( new QLabel( tr( "GMSH_MIN_SIZE" ), GroupC1 ), row, 0 );
218   myMinSize = new SMESHGUI_SpinBox( GroupC1 );
219   myMinSize->RangeStepAndValidator( 0.0, 1e+22, 1., "length_precision" );
220   aGroupLayout->addWidget( myMinSize, row, 1 );
221   row++;
222   
223   aGroupLayout->addWidget( new QLabel( tr( "GMSH_MAX_SIZE" ), GroupC1 ), row, 0 );
224   myMaxSize = new SMESHGUI_SpinBox( GroupC1 );
225   myMaxSize->RangeStepAndValidator( 0.0, 1e+22, 1e+21, "length_precision" );
226   aGroupLayout->addWidget( myMaxSize, row, 1 );
227   row++;
228   
229   mySecondOrder = new QCheckBox( tr( "GMSH_SECOND_ORDER" ), GroupC1 );
230   aGroupLayout->addWidget( mySecondOrder, row, 0 );
231   
232   myUseIncomplElem = new QCheckBox( tr( "GMSH_USE_INCOMPLETE_ELEMENT" ), GroupC1 );
233   aGroupLayout->addWidget( myUseIncomplElem, row, 1 );
234   row++;
235   
236   connect( mySecondOrder, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
237   
238   // Compounds
239   QWidget* compoundGroup = new QWidget();
240   tab->insertTab(1, compoundGroup, tr("GMSH_COMPOUND"));
241   
242   myCompoundTable = new QTableWidget(0, 2, compoundGroup);
243   QGridLayout* compoundLayout = new QGridLayout(compoundGroup);
244   compoundLayout->addWidget(myCompoundTable, 1, 0, 8, 1);
245   
246   QStringList compoundHeaders;
247   compoundHeaders << tr( "GMSH_COMPOUND_ENTRY_COLUMN" ) << tr( "GMSH_COMPOUND_NAME_COLUMN" );
248   myCompoundTable->setHorizontalHeaderLabels(compoundHeaders);
249   myCompoundTable->horizontalHeader()->hideSection(0);
250 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
251   myCompoundTable->horizontalHeader()->setResizeMode(QHeaderView::Interactive);
252 #else
253   myCompoundTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive);
254 #endif
255   myCompoundTable->resizeColumnToContents(1);
256   myCompoundTable->setAlternatingRowColors(true);
257   myCompoundTable->verticalHeader()->hide();
258   
259   QPushButton* addCompoundButton = new QPushButton(tr("GMSH_COMPOUND_ADD"), compoundGroup);
260   compoundLayout->addWidget(addCompoundButton, 1, 1, 1, 1);
261   QFrame *line2 = new QFrame(compoundGroup);
262   
263   line2->setFrameShape(QFrame::HLine);
264   line2->setFrameShadow(QFrame::Sunken);
265   compoundLayout->addWidget(line2, 2, 1, 1, 1);
266   
267   QPushButton* removeButton = new QPushButton(tr("GMSH_COMPOUND_REMOVE"), compoundGroup);
268   compoundLayout->addWidget(removeButton, 3, 1, 1, 1);
269
270   connect( addCompoundButton, SIGNAL(clicked()), this, SLOT(onAddCompound()));
271   connect( removeButton, SIGNAL(clicked()), this, SLOT(onRemoveCompound()));
272   
273   return fr;
274 }
275
276 void GMSHPluginGUI_HypothesisCreator::updateWidgets()
277 {
278   myUseIncomplElem->setEnabled(mySecondOrder->isChecked());
279 }
280
281 void GMSHPluginGUI_HypothesisCreator::onAddCompound()
282 {
283   GMSHPlugin::GMSHPlugin_Hypothesis_var h = GMSHPlugin::GMSHPlugin_Hypothesis::_narrow(initParamsHypothesis());
284   GeomSelectionTools* geomSelectionTools = getGeomSelectionTools();
285   LightApp_SelectionMgr* mySel = geomSelectionTools->selectionMgr();
286   SALOME_ListIO ListSelectedObjects;
287   mySel->selectedObjects(ListSelectedObjects, NULL, false );
288   SALOME_ListIteratorOfListIO Object_It(ListSelectedObjects);
289   for (Object_It ; Object_It.More() ; Object_It.Next())
290   {
291     Handle(SALOME_InteractiveObject) anObject = Object_It.Value();
292     std::string entry, shapeName;
293     entry = geomSelectionTools->getEntryOfObject(anObject);
294     shapeName = anObject->getName();
295     TopAbs_ShapeEnum shapeType;
296     shapeType = geomSelectionTools->entryToShapeType(entry);
297     if ((shapeType == TopAbs_SHAPE) || (shapeType != TopAbs_EDGE && shapeType != TopAbs_FACE))
298       continue;
299     myCompoundTable->setFocus();
300     QString shapeEntry;
301     shapeEntry = QString::fromStdString(entry);
302     if (myCompoundSet.contains(shapeEntry))
303       continue;
304     int row = myCompoundTable->rowCount() ;
305     myCompoundTable->setRowCount(row+1);
306     myCompoundTable->setItem(row, 0, new QTableWidgetItem(shapeEntry));
307     myCompoundTable->item(row, 0 )->setFlags(0);
308     myCompoundTable->setItem(row, 1, new QTableWidgetItem(QString::fromStdString(shapeName)));
309     myCompoundTable->item(row, 1 )->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled);
310     myCompoundTable->resizeColumnToContents(1);
311     myCompoundTable->clearSelection();
312     myCompoundTable->scrollToItem( myCompoundTable->item( row, 1 ) );
313     myCompoundSet.insert(shapeEntry);
314     myCompoundToRemove.remove(shapeEntry);
315   }
316 }
317
318 void GMSHPluginGUI_HypothesisCreator::onRemoveCompound()
319 {
320   QList<int> selectedRows;
321   QList<QTableWidgetItem*> selected = myCompoundTable->selectedItems();
322   QTableWidgetItem* item;
323   int row;
324   foreach(item, selected)
325   {
326     row = item->row();
327     if (!selectedRows.contains(row))
328       selectedRows.append( row );
329   }
330   qSort( selectedRows );
331   QListIterator<int> it( selectedRows );
332   it.toBack();
333   while (it.hasPrevious())
334   {
335     row = it.previous();
336     QString entry = myCompoundTable->item(row,0)->text();
337     if (myCompoundSet.contains(entry))
338     {
339       myCompoundSet.remove(entry);
340       myCompoundToRemove.insert(entry);
341     }
342     myCompoundTable->removeRow(row );
343   }
344   myCompoundTable->resizeColumnToContents(1);
345 }
346
347 void GMSHPluginGUI_HypothesisCreator::retrieveParams() const
348 {
349   GmshHypothesisData data;
350   readParamsFromHypo( data );
351   
352   if( myName )
353     myName->setText( data.myName );
354   my2DAlgo->setCurrentIndex( data.my2DAlgo );
355   if ( !myIs2D )
356     my3DAlgo->setCurrentIndex( data.my3DAlgo );
357   myRecomb2DAlgo->setCurrentIndex( data.myRecomb2DAlgo );
358   if ( myRecombineAll )
359     myRecombineAll->setChecked( data.myRecombineAll );
360   if ( mySubdivAlgo )
361   mySubdivAlgo->setCurrentIndex( data.mySubdivAlgo );
362   myRemeshAlgo->setCurrentIndex( data.myRemeshAlgo);
363   myRemeshPara->setCurrentIndex( data.myRemeshPara);
364   if(data.mySmouthStepsVar.isEmpty())
365     mySmouthSteps->setValue( data.mySmouthSteps );
366   else
367     mySmouthSteps->setText( data.mySmouthStepsVar );
368   if(data.mySizeFactorVar.isEmpty())
369     mySizeFactor->setValue( data.mySizeFactor );
370   else
371     mySizeFactor->setText( data.mySizeFactorVar );
372   if(data.myMaxSizeVar.isEmpty())
373     myMaxSize->setValue( data.myMaxSize );
374   else
375     myMaxSize->setText( data.myMaxSizeVar );
376   if(data.myMinSizeVar.isEmpty())
377     myMinSize->setValue( data.myMinSize );
378   else
379     myMinSize->setText( data.myMinSizeVar );
380   if ( mySecondOrder )
381     mySecondOrder->setChecked( data.mySecondOrder );
382   if ( myUseIncomplElem )
383     myUseIncomplElem->setChecked( data.myUseIncomplElem );
384   
385   GMSHPluginGUI_HypothesisCreator* that = (GMSHPluginGUI_HypothesisCreator*)this;
386   that->updateWidgets();
387   
388   GeomSelectionTools* geomSelectionTools = that->getGeomSelectionTools();
389   for (QSet<QString>::const_iterator i = myCompoundSet.begin(); i != myCompoundSet.end(); ++i)
390   {
391     const QString entry = *i;
392     std::string shapeName = geomSelectionTools->getNameFromEntry(entry.toStdString());
393     int row = myCompoundTable->rowCount();
394     myCompoundTable->setRowCount(row+1);
395     myCompoundTable->setItem(row, 0, new QTableWidgetItem(entry));
396     myCompoundTable->item(row, 0)->setFlags(0);
397     myCompoundTable->setItem(row, 1, new QTableWidgetItem(QString::fromStdString(shapeName)));
398     myCompoundTable->item(row, 1)->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled);
399   }
400   myCompoundTable->resizeColumnToContents(1);
401 }
402
403 QString GMSHPluginGUI_HypothesisCreator::storeParams() const
404 {
405   GmshHypothesisData data;
406   readParamsFromWidgets( data );
407   storeParamsToHypo( data );
408   
409   QString valStr = tr("GMSH_MAX_SIZE") + " = " + QString::number( data.myMaxSize ) + "; ";
410   valStr += tr("GMSH_MIN_SIZE") + " = " + QString::number( data.myMinSize ) + "; ";
411   if ( data.mySecondOrder )
412     valStr +=  tr("GMSH_SECOND_ORDER") + "; ";
413   
414   return valStr;
415 }
416
417 bool GMSHPluginGUI_HypothesisCreator::readParamsFromHypo( GmshHypothesisData& h_data ) const
418 {
419   GMSHPlugin::GMSHPlugin_Hypothesis_var h =
420     GMSHPlugin::GMSHPlugin_Hypothesis::_narrow( initParamsHypothesis() );
421
422   HypothesisData* data = SMESH::GetHypothesisData( hypType() );
423   h_data.myName = isCreation() && data ? data->Label : "";
424   
425   h_data.my2DAlgo = (int) h->Get2DAlgo();
426   if ( !myIs2D )
427     h_data.my3DAlgo = (int) h->Get3DAlgo();
428   h_data.myRecomb2DAlgo = (int) h->GetRecomb2DAlgo();
429   h_data.myRecombineAll = h->GetRecombineAll();
430   h_data.mySubdivAlgo = (int) h->GetSubdivAlgo();
431   h_data.myRemeshAlgo = (int) h->GetRemeshAlgo();
432   h_data.myRemeshPara = (int) h->GetRemeshPara();
433   h_data.mySmouthSteps = h->GetSmouthSteps();
434   h_data.mySizeFactor = h->GetSizeFactor();
435   h_data.myMinSize = h->GetMinSize();
436   h_data.myMaxSize = h->GetMaxSize();
437   h_data.mySmouthStepsVar = getVariableName("SmouthSteps");
438   h_data.mySizeFactorVar = getVariableName("SizeFactor");
439   h_data.myMinSizeVar = getVariableName("SetMinSize");
440   h_data.myMaxSizeVar = getVariableName("SetMaxSize");
441   h_data.mySecondOrder = h->GetSecondOrder();
442   h_data.myUseIncomplElem = h->GetUseIncomplElem();
443   
444   GMSHPluginGUI_HypothesisCreator* that = (GMSHPluginGUI_HypothesisCreator*)this;
445   GMSHPlugin::string_array_var myEntries = h->GetCompoundOnEntries();
446   for ( int i=0 ; i<myEntries->length() ; i++ )
447     {
448       QString entry = myEntries[i].in();
449       that->myCompoundSet.insert(entry);
450     }
451   
452   return true;
453 }
454
455 bool GMSHPluginGUI_HypothesisCreator::storeParamsToHypo( const GmshHypothesisData& h_data ) const
456 {
457   GMSHPlugin::GMSHPlugin_Hypothesis_var h =
458     GMSHPlugin::GMSHPlugin_Hypothesis::_narrow( hypothesis() );
459
460   bool ok = true;
461   try
462   {
463     if( isCreation() )
464       SMESH::SetName( SMESH::FindSObject( h ), h_data.myName.toLatin1().data() );
465
466     h->Set2DAlgo( h_data.my2DAlgo );
467     if ( !myIs2D )
468       h->Set3DAlgo( h_data.my3DAlgo );
469     h->SetRecomb2DAlgo( h_data.myRecomb2DAlgo );
470     h->SetRecombineAll( h_data.myRecombineAll );
471     h->SetSubdivAlgo( h_data.mySubdivAlgo );
472     h->SetRemeshAlgo( h_data.myRemeshAlgo );
473     h->SetRemeshPara( h_data.myRemeshPara );
474     h->SetSmouthSteps( h_data.mySmouthSteps );
475     h->SetSizeFactor( h_data.mySizeFactor );
476     h->SetMinSize( h_data.myMinSize );
477     h->SetMaxSize( h_data.myMaxSize );
478     h->SetVarParameter( h_data.mySmouthStepsVar.toLatin1().constData(), "SmouthSteps");
479     h->SetVarParameter( h_data.mySizeFactorVar.toLatin1().constData(), "SizeFactor");
480     h->SetVarParameter( h_data.myMinSizeVar.toLatin1().constData(), "SetMinSize");
481     h->SetVarParameter( h_data.myMaxSizeVar.toLatin1().constData(), "SetMaxSize");
482     h->SetSecondOrder( h_data.mySecondOrder );
483     h->SetUseIncomplElem( h_data.myUseIncomplElem );
484     h->SetIs2d( myIs2D );
485     
486     for (QSet<QString>::const_iterator i = myCompoundSet.begin(); i != myCompoundSet.end(); ++i)
487     {
488       const QString entry = *i;
489       h->SetCompoundOnEntry(entry.toLatin1().constData());
490     }
491     for (QSet<QString>::const_iterator i = myCompoundToRemove.begin(); i != myCompoundToRemove.end(); ++i)
492     {
493       const QString entry = *i;
494       h->UnsetCompoundOnEntry(entry.toLatin1().constData());
495     }
496   }
497   catch(const SALOME::SALOME_Exception& ex)
498   {
499     SalomeApp_Tools::QtCatchCorbaException(ex);
500     ok = false;
501   }
502   return ok;
503 }
504
505 bool GMSHPluginGUI_HypothesisCreator::readParamsFromWidgets( GmshHypothesisData& h_data ) const
506 {
507   h_data.myName           = myName ? myName->text() : "";
508   h_data.my2DAlgo         = my2DAlgo->currentIndex();
509   if (my3DAlgo)
510     h_data.my3DAlgo       = my3DAlgo->currentIndex();
511   h_data.myRecomb2DAlgo   = myRecomb2DAlgo->currentIndex();
512   h_data.myRecombineAll   = myRecombineAll->isChecked();
513   h_data.mySubdivAlgo     = mySubdivAlgo->currentIndex();
514   h_data.myRemeshAlgo     = myRemeshAlgo->currentIndex();
515   h_data.myRemeshPara     = myRemeshPara->currentIndex();
516   h_data.mySmouthSteps    = mySmouthSteps->value();
517   h_data.mySizeFactor     = mySizeFactor->value();
518   h_data.myMinSize        = myMinSize->value();
519   h_data.myMaxSize        = myMaxSize->value();
520   h_data.mySmouthStepsVar = mySmouthSteps->text();
521   h_data.mySizeFactorVar  = mySizeFactor->text();
522   h_data.myMinSizeVar     = myMinSize->text();
523   h_data.myMaxSizeVar     = myMaxSize->text();
524   h_data.mySecondOrder    = mySecondOrder->isChecked();
525   h_data.myUseIncomplElem = myUseIncomplElem->isChecked();
526   
527   // ne semble pas utile dans la mesure ou myCompoundSet n'a pas besoin d'etre modifier
528   /*
529   GMSHPluginGUI_HypothesisCreator* that = (GMSHPluginGUI_HypothesisCreator*)this;
530   int nbRows = myCompoundTable->rowCount();
531   for(int row=0 ; row < nbRows ; row++)
532   {
533     QString entry = myLocalSizeTable->item(row, 1)->text();
534     that->myCompoundSet.insert(entry);
535   }
536   */
537   return true;
538 }
539
540 // on ne modifie rien à partir de là
541
542 GeomSelectionTools* GMSHPluginGUI_HypothesisCreator::getGeomSelectionTools()
543 {
544   if (myGeomSelectionTools == NULL) {
545     myGeomSelectionTools = new GeomSelectionTools();
546   }
547   return myGeomSelectionTools;
548 }
549
550 QString GMSHPluginGUI_HypothesisCreator::caption() const
551 {
552   return tr( QString( "GMSH_%1_TITLE" ).arg(myIs2D?QString("2D"):QString("3D")).toLatin1().data() );
553 }
554
555 QPixmap GMSHPluginGUI_HypothesisCreator::icon() const
556 {
557   QString hypIconName = tr( QString("ICON_DLG_GMSH_PARAMETERS%1").arg(myIs2D?QString("_2D"):QString("")).toLatin1().data() );
558   return SUIT_Session::session()->resourceMgr()->loadPixmap( "GMSHPlugin", hypIconName );
559 }
560
561 QString GMSHPluginGUI_HypothesisCreator::type() const
562 {
563   return tr( QString( "GMSH_%1_HYPOTHESIS" ).arg(myIs2D?QString("2D"):QString("3D")).toLatin1().data() );
564 }
565
566 QString GMSHPluginGUI_HypothesisCreator::helpPage() const
567 {
568   return "gmsh_2d_3d_hypo_page.html";
569 }