Salome HOME
0020321: EDF : Some windows do not appear depending on the platform (MinimumSizeHint())
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_Hypotheses.cxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 // SMESH SMESHGUI : GUI for SMESH component
23 // File   : SMESHGUI_Hypotheses.cxx
24 // Author : Julia DOROVSKIKH, Open CASCADE S.A.S.
25 // SMESH includes
26 //
27 #include "SMESHGUI_Hypotheses.h"
28
29 #include "SMESHGUI.h"
30 #include "SMESHGUI_HypothesesUtils.h"
31 #include "SMESHGUI_Utils.h"
32 #include "SMESHGUI_SpinBox.h"
33
34 // SALOME KERNEL includes
35 #include <SALOMEDSClient_Study.hxx>
36 #include <utilities.h>
37
38 // SALOME GUI includes
39 #include <SUIT_Session.h>
40 #include <SUIT_MessageBox.h>
41 #include <SUIT_ResourceMgr.h>
42 #include <LightApp_Application.h>
43 #include <SalomeApp_IntSpinBox.h>
44
45 // Qt includes
46 #include <QFrame>
47 #include <QLineEdit>
48 #include <QLabel>
49 #include <QGroupBox>
50 #include <QVBoxLayout>
51 #include <QEventLoop>
52
53 #define SPACING 6
54 #define MARGIN  11
55
56 SMESHGUI_GenericHypothesisCreator::SMESHGUI_GenericHypothesisCreator( const QString& theHypType )
57   : myHypType( theHypType ), myIsCreate( false ), myDlg( 0 ), myEventLoop( 0 )
58 {
59 }
60
61 SMESHGUI_GenericHypothesisCreator::~SMESHGUI_GenericHypothesisCreator()
62 {
63 }
64
65 void SMESHGUI_GenericHypothesisCreator::setInitParamsHypothesis(SMESH::SMESH_Hypothesis_ptr hyp)
66 {
67   if ( !CORBA::is_nil( hyp ) && hypType() == hyp->GetName() )
68     myInitParamsHypo = SMESH::SMESH_Hypothesis::_duplicate( hyp );
69 }
70
71 void SMESHGUI_GenericHypothesisCreator::create( SMESH::SMESH_Hypothesis_ptr initParamsHyp,
72                                                 const QString& theHypName,
73                                                 QWidget* parent)
74 {
75   MESSAGE( "Creation of hypothesis with initial params" );
76   setInitParamsHypothesis( initParamsHyp );
77   create( false, theHypName, parent );
78 }
79
80 void SMESHGUI_GenericHypothesisCreator::create( bool isAlgo,
81                                                 const QString& theHypName,
82                                                 QWidget* theParent )
83 {
84   MESSAGE( "Creation of hypothesis" );
85
86   myIsCreate = true;
87
88   // Create hypothesis/algorithm
89   if (isAlgo)
90     SMESH::CreateHypothesis( hypType(), theHypName, isAlgo );
91   else
92   {
93     SMESH::SMESH_Hypothesis_var aHypothesis = 
94       SMESH::CreateHypothesis( hypType(), theHypName, false );
95     if( !editHypothesis( aHypothesis.in(), theHypName, theParent ) )
96     { //remove just created hypothesis
97       _PTR(SObject) aHypSObject = SMESH::FindSObject( aHypothesis.in() );
98       _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
99       if( aStudy && !aStudy->GetProperties()->IsLocked() )
100       {
101         _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
102         aBuilder->RemoveObjectWithChildren( aHypSObject );
103       }
104     }
105   }
106   SMESHGUI::GetSMESHGUI()->updateObjBrowser( true, 0 );
107 }
108
109 void SMESHGUI_GenericHypothesisCreator::edit( SMESH::SMESH_Hypothesis_ptr theHypothesis,
110                                               const QString& theHypName,
111                                               QWidget* theParent )
112 {
113   if( CORBA::is_nil( theHypothesis ) )
114     return;
115
116   MESSAGE("Edition of hypothesis");
117
118   myIsCreate = false;
119
120   if( !editHypothesis( theHypothesis, theHypName, theParent ) )
121     return;
122
123   SMESH::SObjectList listSOmesh = SMESH::GetMeshesUsingAlgoOrHypothesis( theHypothesis );
124   if( listSOmesh.size() > 0 )
125     for( int i = 0; i < listSOmesh.size(); i++ )
126     {
127       _PTR(SObject) submSO = listSOmesh[i];
128       SMESH::SMESH_Mesh_var aMesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( submSO );
129       SMESH::SMESH_subMesh_var aSubMesh = SMESH::SObjectToInterface<SMESH::SMESH_subMesh>( submSO );
130       if( !aSubMesh->_is_nil() )
131         aMesh = aSubMesh->GetFather();
132       _PTR(SObject) meshSO = SMESH::FindSObject( aMesh );
133       SMESH::ModifiedMesh( meshSO, false, aMesh->NbNodes()==0);
134     }
135   SMESHGUI::GetSMESHGUI()->updateObjBrowser( true, 0 );
136 }
137
138 bool SMESHGUI_GenericHypothesisCreator::editHypothesis( SMESH::SMESH_Hypothesis_ptr h, 
139                                                         const QString& theHypName,
140                                                         QWidget* theParent )
141 {
142   if( CORBA::is_nil( h ) )
143     return false;
144
145   bool res = true;
146   myHypName = theHypName;
147   myHypo = SMESH::SMESH_Hypothesis::_duplicate( h );
148
149   SMESHGUI_HypothesisDlg* Dlg = new SMESHGUI_HypothesisDlg( this, theParent );
150   connect( Dlg, SIGNAL( finished( int ) ), this, SLOT( onDialogFinished( int ) ) );
151   myDlg = Dlg;
152   QFrame* fr = buildFrame();
153   if( fr )
154   {
155     Dlg->setCustomFrame( fr );
156     Dlg->setWindowTitle( caption() );
157     Dlg->setObjectName( theHypName );
158     Dlg->setHIcon( icon() );
159     Dlg->setType( type() );
160     retrieveParams();
161     Dlg->show();
162     if ( !myEventLoop )
163       myEventLoop = new QEventLoop( this );
164     myEventLoop->exec(); // make myDlg not modal
165     res = myDlg->result();
166     if( res ) {
167       /*QString paramValues = */storeParams();
168       // No longer needed since NoteBook appears and "Value" OB field shows names of variable
169 //       if ( !paramValues.isEmpty() ) {
170 //         if ( _PTR(SObject) SHyp = SMESH::FindSObject( myHypo ))
171 //           SMESH::SetValue( SHyp, paramValues );
172 //       }
173     }
174   }
175   delete Dlg; myDlg = 0;
176   changeWidgets().clear();
177   myHypo = SMESH::SMESH_Hypothesis::_nil();
178   myInitParamsHypo = SMESH::SMESH_Hypothesis::_nil();
179   return res;
180 }
181   
182 QFrame* SMESHGUI_GenericHypothesisCreator::buildStdFrame()
183 {
184   if( CORBA::is_nil( hypothesis() ) )
185     return 0;
186
187   ListOfStdParams params;
188   if( !stdParams( params ) || params.isEmpty() )
189     return 0;
190
191   QFrame* fr = new QFrame( 0 );
192   QVBoxLayout* lay = new QVBoxLayout( fr );
193   lay->setMargin( 5 );
194   lay->setSpacing( 0 );
195
196   QGroupBox* GroupC1 = new QGroupBox( tr( "SMESH_ARGUMENTS" ), fr );
197   lay->addWidget( GroupC1 );
198
199   QGridLayout* GroupC1Layout = new QGridLayout( GroupC1 );
200   GroupC1Layout->setSpacing( SPACING );
201   GroupC1Layout->setMargin( MARGIN );
202
203   ListOfStdParams::const_iterator anIt = params.begin(), aLast = params.end();
204   for( int i=0; anIt!=aLast; anIt++, i++ )
205   {
206     QLabel* lab = new QLabel( (*anIt).myName, GroupC1 );
207     GroupC1Layout->addWidget( lab, i, 0 );
208
209     QWidget* w = getCustomWidget( *anIt, GroupC1, i );
210     if ( !w ) 
211       switch( (*anIt).myValue.type() )
212       {
213       case QVariant::Int:
214         {
215           SalomeApp_IntSpinBox* sb = new SalomeApp_IntSpinBox( GroupC1 );
216           sb->setObjectName( (*anIt).myName );
217           attuneStdWidget( sb, i );
218           sb->setValue( (*anIt).myValue.toInt() );
219           connect( sb, SIGNAL( valueChanged( int ) ), this, SLOT( onValueChanged() ) );
220           w = sb;
221         }
222         break;
223       case QVariant::Double:
224         {
225           SalomeApp_DoubleSpinBox* sb = new SMESHGUI_SpinBox( GroupC1 );
226           sb->setObjectName( (*anIt).myName );
227           attuneStdWidget( sb, i );
228           sb->setValue( (*anIt).myValue.toDouble() );
229           connect( sb, SIGNAL( valueChanged( double ) ), this, SLOT( onValueChanged() ) );
230           w = sb;
231         }
232         break;
233       case QVariant::String:
234         {
235           if((*anIt).isVariable) {
236             _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
237             QString aVar = (*anIt).myValue.toString();
238             if(aStudy->IsInteger(aVar.toLatin1().constData())){
239               SalomeApp_IntSpinBox* sb = new SalomeApp_IntSpinBox( GroupC1 );
240               sb->setObjectName( (*anIt).myName );
241               attuneStdWidget( sb, i );
242               sb->setText( aVar );
243               connect( sb, SIGNAL( valueChanged( int ) ), this, SLOT( onValueChanged() ) );
244               w = sb;
245             }
246             else if(aStudy->IsReal(aVar.toLatin1().constData())){
247               SalomeApp_DoubleSpinBox* sb = new SMESHGUI_SpinBox( GroupC1 );
248               sb->setObjectName( (*anIt).myName );
249               attuneStdWidget( sb, i );
250               sb->setText( aVar );
251               connect( sb, SIGNAL( valueChanged( double ) ), this, SLOT( onValueChanged() ) );
252               w = sb;
253             }
254           }
255           else {
256             QLineEdit* le = new QLineEdit( GroupC1 );
257             le->setObjectName( (*anIt).myName );
258             attuneStdWidget( le, i );
259             le->setText( (*anIt).myValue.toString() );
260             connect( le, SIGNAL( textChanged( const QString& ) ), this, SLOT( onValueChanged() ) );
261             w = le;
262           }
263         }
264         break;
265       }
266
267     if( w )
268     {
269       GroupC1Layout->addWidget( w, i, 1 );
270       changeWidgets().append( w );
271     }
272   }
273
274   return fr;
275 }
276
277 void SMESHGUI_GenericHypothesisCreator::onValueChanged()
278 {
279   valueChanged( (QWidget*) sender() );
280 }
281
282 void SMESHGUI_GenericHypothesisCreator::valueChanged( QWidget* )
283 {
284 }
285
286 void SMESHGUI_GenericHypothesisCreator::onDialogFinished( int /*result*/ )
287 {
288   if ( myEventLoop )
289     myEventLoop->exit();
290 }
291
292 bool SMESHGUI_GenericHypothesisCreator::stdParams( ListOfStdParams& ) const
293 {
294   return false;
295 }
296
297 bool SMESHGUI_GenericHypothesisCreator::getStdParamFromDlg( ListOfStdParams& params ) const
298 {
299   bool res = true;
300   StdParam item;
301   ListOfWidgets::const_iterator anIt = widgets().begin(), aLast = widgets().end();
302   for( ; anIt!=aLast; anIt++ )
303   {
304     item.myName = (*anIt)->objectName();
305     if( (*anIt)->inherits( "SalomeApp_IntSpinBox" ) )
306     {
307       SalomeApp_IntSpinBox* sb = ( SalomeApp_IntSpinBox* )( *anIt );
308       item.myValue = sb->value();
309       params.append( item );
310     }
311     
312     else if( (*anIt)->inherits( "SalomeApp_DoubleSpinBox" ) )
313     {
314       SalomeApp_DoubleSpinBox* sb = ( SalomeApp_DoubleSpinBox* )( *anIt );
315       item.myValue = sb->value();
316       params.append( item );
317     }
318
319     else if( (*anIt)->inherits( "QLineEdit" ) )
320     {
321       QLineEdit* line = ( QLineEdit* )( *anIt );
322       item.myValue = line->text();
323       params.append( item );
324     }
325
326     else if ( getParamFromCustomWidget( item, *anIt ))
327     {
328       params.append( item );
329     }
330
331     else
332       res = false;
333   }
334   return res;
335 }
336
337
338 QStringList SMESHGUI_GenericHypothesisCreator::getVariablesFromDlg() const
339 {
340   QStringList aResult;
341   ListOfWidgets::const_iterator anIt = widgets().begin(), aLast = widgets().end();
342   for( ; anIt!=aLast; anIt++ ) {
343     if( (*anIt)->inherits( "QAbstractSpinBox" ) ) {
344       QAbstractSpinBox* sb = ( QAbstractSpinBox* )( *anIt );
345       aResult.append(sb->text());
346     } 
347   }
348   return aResult;
349 }
350
351 QString SMESHGUI_GenericHypothesisCreator::stdParamValues( const ListOfStdParams& params)
352 {
353   QString valueStr = "";
354   ListOfStdParams::const_iterator param = params.begin(), aLast = params.end();
355   uint len0 = 0;
356   for( int i=0; param!=aLast; param++, i++ )
357   {
358     if ( valueStr.length() > len0 ) {
359       valueStr += "; ";
360       len0 = valueStr.length();
361     }
362     switch( (*param).myValue.type() )
363     {
364     case QVariant::Int:
365       valueStr += valueStr.number( (*param).myValue.toInt() );
366       break;
367     case QVariant::Double:
368       valueStr += valueStr.number( (*param).myValue.toDouble() );
369       break;
370     case QVariant::String:
371       valueStr += (*param).myValue.toString();
372       break;
373     default:
374       QVariant valCopy = (*param).myValue;
375       valueStr += valCopy.toString();
376     }
377   }
378   return valueStr;
379 }
380
381 SMESH::SMESH_Hypothesis_var SMESHGUI_GenericHypothesisCreator::hypothesis() const
382 {
383   return myHypo;
384 }
385
386 //================================================================================
387 /*!
388  * \brief Return hypothesis containing initial parameters
389  *  \param strictly - if true, always return myInitParamsHypo,
390  *                    else, return myInitParamsHypo only in creation mode and if it
391  *                    is non-nil
392  */
393 //================================================================================
394
395 SMESH::SMESH_Hypothesis_var SMESHGUI_GenericHypothesisCreator::initParamsHypothesis(const bool strictly) const
396 {
397   if ( strictly )
398     return myInitParamsHypo;
399   if ( !isCreation() || CORBA::is_nil( myInitParamsHypo ))
400     return myHypo;
401   return myInitParamsHypo;
402 }
403
404 bool SMESHGUI_GenericHypothesisCreator::hasInitParamsHypothesis() const
405 {
406   return !CORBA::is_nil( myInitParamsHypo );
407 }
408
409 QString SMESHGUI_GenericHypothesisCreator::hypType() const
410 {
411   return myHypType;
412 }
413
414 QString SMESHGUI_GenericHypothesisCreator::hypName() const
415 {
416   return myHypName;
417 }
418
419 const SMESHGUI_GenericHypothesisCreator::ListOfWidgets& SMESHGUI_GenericHypothesisCreator::widgets() const
420 {
421   return myParamWidgets;
422 }
423
424 SMESHGUI_GenericHypothesisCreator::ListOfWidgets& SMESHGUI_GenericHypothesisCreator::changeWidgets()
425 {
426   return myParamWidgets;
427 }
428
429 QtxDialog* SMESHGUI_GenericHypothesisCreator:: dlg() const
430
431   return myDlg;
432 }
433
434 bool SMESHGUI_GenericHypothesisCreator::isCreation() const
435 {
436   return myIsCreate;
437 }
438
439 void SMESHGUI_GenericHypothesisCreator::attuneStdWidget( QWidget*, const int ) const
440 {
441 }
442
443 QString SMESHGUI_GenericHypothesisCreator::caption() const
444 {
445   return QString();
446 }
447
448 QPixmap SMESHGUI_GenericHypothesisCreator::icon() const
449 {
450   return QPixmap();
451 }
452
453 QString SMESHGUI_GenericHypothesisCreator::type() const
454 {
455   return QString();
456 }
457 QWidget* SMESHGUI_GenericHypothesisCreator::getCustomWidget( const StdParam & /*param*/,
458                                                              QWidget*   /*parent*/,
459                                                              const int  /*index*/) const
460 {
461   return 0;
462 }
463 bool SMESHGUI_GenericHypothesisCreator::getParamFromCustomWidget( StdParam&, QWidget* ) const
464 {
465   return false;
466 }
467
468 bool SMESHGUI_GenericHypothesisCreator::checkParams( QString& msg ) const
469 {
470   bool ok = true;
471   ListOfWidgets::const_iterator anIt = widgets().begin(), aLast = widgets().end();
472   for( ; anIt!=aLast; anIt++ )
473   {
474     if( (*anIt)->inherits( "SalomeApp_IntSpinBox" ) )
475     {
476       SalomeApp_IntSpinBox* sb = ( SalomeApp_IntSpinBox* )( *anIt );
477       ok = sb->isValid( msg, true ) && ok;
478     }
479     else if( (*anIt)->inherits( "SalomeApp_DoubleSpinBox" ) )
480     {
481       SalomeApp_DoubleSpinBox* sb = ( SalomeApp_DoubleSpinBox* )( *anIt );
482       ok = sb->isValid( msg, true ) && ok;
483     }
484   }
485   return ok;
486 }
487
488 void SMESHGUI_GenericHypothesisCreator::onReject()
489 {
490 }
491
492 QString SMESHGUI_GenericHypothesisCreator::helpPage() const
493 {
494   QString aHypType = hypType();
495   QString aHelpFileName;
496   if ( aHypType == "LocalLength" )
497     aHelpFileName = "a1d_meshing_hypo_page.html#average_length_anchor";
498   if ( aHypType == "MaxLength" )
499     aHelpFileName = "a1d_meshing_hypo_page.html#max_length_anchor";
500   else if ( aHypType == "Arithmetic1D")
501     aHelpFileName = "a1d_meshing_hypo_page.html#arithmetic_1d_anchor";
502   else if ( aHypType == "MaxElementArea")
503     aHelpFileName = "a2d_meshing_hypo_page.html#max_element_area_anchor";
504   else if ( aHypType == "MaxElementVolume")
505     aHelpFileName = "max_element_volume_hypo_page.html";
506   else if ( aHypType == "StartEndLength")
507     aHelpFileName = "a1d_meshing_hypo_page.html#start_and_end_length_anchor";
508   else if ( aHypType == "Deflection1D")
509     aHelpFileName = "a1d_meshing_hypo_page.html#deflection_1d_anchor";
510   else if ( aHypType == "AutomaticLength")
511     aHelpFileName = "a1d_meshing_hypo_page.html#automatic_length_anchor";
512   else if ( aHypType == "NumberOfSegments")
513     aHelpFileName = "a1d_meshing_hypo_page.html#number_of_segments_anchor";
514   else if ( aHypType == "ProjectionSource1D")
515     aHelpFileName = "projection_algos_page.html";
516   else if ( aHypType == "ProjectionSource2D")
517     aHelpFileName = "projection_algos_page.html";
518   else if ( aHypType == "ProjectionSource3D")
519     aHelpFileName = "projection_algos_page.html";
520   else if ( aHypType == "NumberOfLayers")
521     aHelpFileName = "radial_prism_algo_page.html";
522   else if ( aHypType == "LayerDistribution")
523     aHelpFileName = "radial_prism_algo_page.html";
524   else if ( aHypType == "SegmentLengthAroundVertex")
525     aHelpFileName = "segments_around_vertex_algo.html";
526   else
527     aHelpFileName = "";
528   return aHelpFileName;
529 }
530
531
532
533
534 SMESHGUI_HypothesisDlg::SMESHGUI_HypothesisDlg( SMESHGUI_GenericHypothesisCreator* creator, QWidget* parent )
535 : QtxDialog( parent, false, true ),
536   myCreator( creator )
537 {
538   setMinimumSize( 300, height() );
539 //  setFixedSize( 300, height() );
540   QVBoxLayout* topLayout = new QVBoxLayout( mainFrame() );
541   topLayout->setMargin( 0 );
542   topLayout->setSpacing( 0 );
543
544   QFrame* titFrame = new QFrame( mainFrame() );
545   QHBoxLayout* titLay = new QHBoxLayout( titFrame );
546   titLay->setMargin( 0 );
547   titLay->setSpacing( SPACING );
548   
549   myIconLabel = new QLabel( titFrame );
550   myIconLabel->setScaledContents( false );
551   myIconLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
552   myTypeLabel = new QLabel( titFrame );
553   if( creator )
554     myTypeLabel->setText( creator->hypType() );
555
556   titLay->addWidget( myIconLabel, 0 );
557   titLay->addWidget( myTypeLabel, 0 );
558   titLay->addStretch( 1 );
559
560   topLayout->addWidget( titFrame, 0 );
561
562   myHelpFileName = creator->helpPage();
563
564   connect( this, SIGNAL( dlgHelp() ), this, SLOT( onHelp() ) );
565 }
566
567 SMESHGUI_HypothesisDlg::~SMESHGUI_HypothesisDlg()
568 {
569 }
570
571 void SMESHGUI_HypothesisDlg::setCustomFrame( QFrame* f )
572 {
573   if( f )
574   {
575     f->setParent( mainFrame() );
576     qobject_cast<QVBoxLayout*>( mainFrame()->layout() )->insertWidget( 1, f, 1 );
577   }
578 }
579
580 void SMESHGUI_HypothesisDlg::accept()
581 {
582   QString msg;
583   if ( myCreator && !myCreator->checkParams( msg ) )
584   {
585     QString str( tr( "SMESH_INCORRECT_INPUT" ) );
586     if ( !msg.isEmpty() )
587       str += "\n" + msg;
588     SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
589     return;
590   }
591   QtxDialog::accept();
592 }
593
594 void SMESHGUI_HypothesisDlg::reject()
595 {
596   if ( myCreator ) myCreator->onReject();
597   QtxDialog::reject();
598 }
599
600 void SMESHGUI_HypothesisDlg::onHelp()
601 {
602   LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
603   if (app) {
604     SMESHGUI* aSMESHGUI = dynamic_cast<SMESHGUI*>( app->activeModule() );
605     app->onHelpContextModule(aSMESHGUI ? app->moduleName(aSMESHGUI->moduleName()) : QString(""), myHelpFileName);
606   }
607   else {
608     QString platform;
609 #ifdef WIN32
610     platform = "winapplication";
611 #else
612     platform = "application";
613 #endif
614     SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
615                              tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
616                              arg(app->resourceMgr()->stringValue("ExternalBrowser", 
617                                                                  platform)).
618                              arg(myHelpFileName));
619   }
620 }
621
622 void SMESHGUI_HypothesisDlg::setHIcon( const QPixmap& p )
623 {
624   myIconLabel->setPixmap( p );  
625 }
626
627 void SMESHGUI_HypothesisDlg::setType( const QString& t )
628 {
629   myTypeLabel->setText( t );
630 }
631
632 HypothesisData::HypothesisData( const QString& theTypeName,
633                                 const QString& thePluginName,
634                                 const QString& theServerLibName,
635                                 const QString& theClientLibName,
636                                 const QString& theLabel,
637                                 const QString& theIconId,
638                                 const QList<int>& theDim,
639                                 const bool theIsAux,
640                                 const QStringList& theNeededHypos,
641                                 const QStringList& theOptionalHypos,
642                                 const QStringList& theInputTypes,
643                                 const QStringList& theOutputTypes,
644                                 const bool theIsNeedGeometry,
645                                 const bool supportSub)
646   : TypeName( theTypeName ),
647     PluginName( thePluginName ),
648     ServerLibName( theServerLibName ),
649     ClientLibName( theClientLibName ),
650     Label( theLabel ),
651     IconId( theIconId ),
652     Dim( theDim ),
653     IsAux( theIsAux ),
654     NeededHypos( theNeededHypos ), 
655     OptionalHypos( theOptionalHypos ),
656     InputTypes( theInputTypes ),
657     OutputTypes( theOutputTypes ),
658     IsNeedGeometry( theIsNeedGeometry ),
659     IsSupportSubmeshes( supportSub )
660 {
661 }
662
663 HypothesesSet::HypothesesSet( const QString& theSetName ) 
664   : HypoSetName( theSetName )
665 {
666 }
667
668 HypothesesSet::HypothesesSet( const QString&     theSetName,
669                               const QStringList& theHypoList,
670                               const QStringList& theAlgoList )
671   : HypoSetName( theSetName ), 
672     HypoList( theHypoList ), 
673     AlgoList( theAlgoList )
674 {
675 }