Salome HOME
Merge from BR_V5_DEV 16Feb09
[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       if ( !paramValues.isEmpty() ) {
169         if ( _PTR(SObject) SHyp = SMESH::FindSObject( myHypo ))
170           SMESH::SetValue( SHyp, paramValues );
171       }
172     }
173   }
174   delete Dlg; myDlg = 0;
175   changeWidgets().clear();
176   myHypo = SMESH::SMESH_Hypothesis::_nil();
177   myInitParamsHypo = SMESH::SMESH_Hypothesis::_nil();
178   return res;
179 }
180   
181 QFrame* SMESHGUI_GenericHypothesisCreator::buildStdFrame()
182 {
183   if( CORBA::is_nil( hypothesis() ) )
184     return 0;
185
186   ListOfStdParams params;
187   if( !stdParams( params ) || params.isEmpty() )
188     return 0;
189
190   QFrame* fr = new QFrame( 0 );
191   QVBoxLayout* lay = new QVBoxLayout( fr );
192   lay->setMargin( 5 );
193   lay->setSpacing( 0 );
194
195   QGroupBox* GroupC1 = new QGroupBox( tr( "SMESH_ARGUMENTS" ), fr );
196   lay->addWidget( GroupC1 );
197
198   QGridLayout* GroupC1Layout = new QGridLayout( GroupC1 );
199   GroupC1Layout->setSpacing( SPACING );
200   GroupC1Layout->setMargin( MARGIN );
201
202   ListOfStdParams::const_iterator anIt = params.begin(), aLast = params.end();
203   for( int i=0; anIt!=aLast; anIt++, i++ )
204   {
205     QLabel* lab = new QLabel( (*anIt).myName, GroupC1 );
206     GroupC1Layout->addWidget( lab, i, 0 );
207
208     QWidget* w = getCustomWidget( *anIt, GroupC1, i );
209     if ( !w ) 
210       switch( (*anIt).myValue.type() )
211       {
212       case QVariant::Int:
213         {
214           SalomeApp_IntSpinBox* sb = new SalomeApp_IntSpinBox( GroupC1 );
215           sb->setObjectName( (*anIt).myName );
216           attuneStdWidget( sb, i );
217           sb->setValue( (*anIt).myValue.toInt() );
218           connect( sb, SIGNAL( valueChanged( int ) ), this, SLOT( onValueChanged() ) );
219           w = sb;
220         }
221         break;
222       case QVariant::Double:
223         {
224           SalomeApp_DoubleSpinBox* sb = new SMESHGUI_SpinBox( GroupC1 );
225           sb->setObjectName( (*anIt).myName );
226           attuneStdWidget( sb, i );
227           sb->setValue( (*anIt).myValue.toDouble() );
228           connect( sb, SIGNAL( valueChanged( double ) ), this, SLOT( onValueChanged() ) );
229           w = sb;
230         }
231         break;
232       case QVariant::String:
233         {
234           if((*anIt).isVariable) {
235             _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
236             QString aVar = (*anIt).myValue.toString();
237             if(aStudy->IsInteger(aVar.toLatin1().constData())){
238               SalomeApp_IntSpinBox* sb = new SalomeApp_IntSpinBox( GroupC1 );
239               sb->setObjectName( (*anIt).myName );
240               attuneStdWidget( sb, i );
241               sb->setText( aVar );
242               connect( sb, SIGNAL( valueChanged( int ) ), this, SLOT( onValueChanged() ) );
243               w = sb;
244             }
245             else if(aStudy->IsReal(aVar.toLatin1().constData())){
246               SalomeApp_DoubleSpinBox* sb = new SalomeApp_DoubleSpinBox( GroupC1 );
247               sb->setObjectName( (*anIt).myName );
248               attuneStdWidget( sb, i );
249               sb->setText( aVar );
250               connect( sb, SIGNAL( valueChanged( double ) ), this, SLOT( onValueChanged() ) );
251               w = sb;
252             }
253           }
254           else {
255             QLineEdit* le = new QLineEdit( GroupC1 );
256             le->setObjectName( (*anIt).myName );
257             attuneStdWidget( le, i );
258             le->setText( (*anIt).myValue.toString() );
259             connect( le, SIGNAL( textChanged( const QString& ) ), this, SLOT( onValueChanged() ) );
260             w = le;
261           }
262         }
263         break;
264       }
265
266     if( w )
267     {
268       GroupC1Layout->addWidget( w, i, 1 );
269       changeWidgets().append( w );
270     }
271   }
272
273   return fr;
274 }
275
276 void SMESHGUI_GenericHypothesisCreator::onValueChanged()
277 {
278   valueChanged( (QWidget*) sender() );
279 }
280
281 void SMESHGUI_GenericHypothesisCreator::valueChanged( QWidget* )
282 {
283 }
284
285 void SMESHGUI_GenericHypothesisCreator::onDialogFinished( int /*result*/ )
286 {
287   if ( myEventLoop )
288     myEventLoop->exit();
289 }
290
291 bool SMESHGUI_GenericHypothesisCreator::stdParams( ListOfStdParams& ) const
292 {
293   return false;
294 }
295
296 bool SMESHGUI_GenericHypothesisCreator::getStdParamFromDlg( ListOfStdParams& params ) const
297 {
298   bool res = true;
299   StdParam item;
300   ListOfWidgets::const_iterator anIt = widgets().begin(), aLast = widgets().end();
301   for( ; anIt!=aLast; anIt++ )
302   {
303     item.myName = (*anIt)->objectName();
304     if( (*anIt)->inherits( "SalomeApp_IntSpinBox" ) )
305     {
306       SalomeApp_IntSpinBox* sb = ( SalomeApp_IntSpinBox* )( *anIt );
307       item.myValue = sb->value();
308       params.append( item );
309     }
310     
311     else if( (*anIt)->inherits( "SalomeApp_DoubleSpinBox" ) )
312     {
313       SalomeApp_DoubleSpinBox* sb = ( SalomeApp_DoubleSpinBox* )( *anIt );
314       item.myValue = sb->value();
315       params.append( item );
316     }
317
318     else if( (*anIt)->inherits( "QLineEdit" ) )
319     {
320       QLineEdit* line = ( QLineEdit* )( *anIt );
321       item.myValue = line->text();
322       params.append( item );
323     }
324
325     else if ( getParamFromCustomWidget( item, *anIt ))
326     {
327       params.append( item );
328     }
329
330     else
331       res = false;
332   }
333   return res;
334 }
335
336
337 QStringList SMESHGUI_GenericHypothesisCreator::getVariablesFromDlg() const
338 {
339   QStringList aResult;
340   ListOfWidgets::const_iterator anIt = widgets().begin(), aLast = widgets().end();
341   for( ; anIt!=aLast; anIt++ ) {
342     if( (*anIt)->inherits( "SalomeApp_IntSpinBox" ) ) {
343       SalomeApp_IntSpinBox* sb = ( SalomeApp_IntSpinBox* )( *anIt );
344       aResult.append(sb->text());
345     } 
346     else if( (*anIt)->inherits( "QtxDoubleSpinBox" ) ) {
347       QtxDoubleSpinBox* sb = ( QtxDoubleSpinBox* )( *anIt );
348       aResult.append(sb->text());
349     } 
350   }
351   return aResult;
352 }
353
354 QString SMESHGUI_GenericHypothesisCreator::stdParamValues( const ListOfStdParams& params)
355 {
356   QString valueStr = "";
357   ListOfStdParams::const_iterator param = params.begin(), aLast = params.end();
358   uint len0 = 0;
359   for( int i=0; param!=aLast; param++, i++ )
360   {
361     if ( valueStr.length() > len0 ) {
362       valueStr += "; ";
363       len0 = valueStr.length();
364     }
365     switch( (*param).myValue.type() )
366     {
367     case QVariant::Int:
368       valueStr += valueStr.number( (*param).myValue.toInt() );
369       break;
370     case QVariant::Double:
371       valueStr += valueStr.number( (*param).myValue.toDouble() );
372       break;
373     case QVariant::String:
374       valueStr += (*param).myValue.toString();
375       break;
376     default:
377       QVariant valCopy = (*param).myValue;
378       valueStr += valCopy.toString();
379     }
380   }
381   return valueStr;
382 }
383
384 SMESH::SMESH_Hypothesis_var SMESHGUI_GenericHypothesisCreator::hypothesis() const
385 {
386   return myHypo;
387 }
388
389 //================================================================================
390 /*!
391  * \brief Return hypothesis containing initial parameters
392  *  \param strictly - if true, always return myInitParamsHypo,
393  *                    else, return myInitParamsHypo only in creation mode and if it
394  *                    is non-nil
395  */
396 //================================================================================
397
398 SMESH::SMESH_Hypothesis_var SMESHGUI_GenericHypothesisCreator::initParamsHypothesis(const bool strictly) const
399 {
400   if ( strictly )
401     return myInitParamsHypo;
402   if ( !isCreation() || CORBA::is_nil( myInitParamsHypo ))
403     return myHypo;
404   return myInitParamsHypo;
405 }
406
407 bool SMESHGUI_GenericHypothesisCreator::hasInitParamsHypothesis() const
408 {
409   return !CORBA::is_nil( myInitParamsHypo );
410 }
411
412 QString SMESHGUI_GenericHypothesisCreator::hypType() const
413 {
414   return myHypType;
415 }
416
417 QString SMESHGUI_GenericHypothesisCreator::hypName() const
418 {
419   return myHypName;
420 }
421
422 const SMESHGUI_GenericHypothesisCreator::ListOfWidgets& SMESHGUI_GenericHypothesisCreator::widgets() const
423 {
424   return myParamWidgets;
425 }
426
427 SMESHGUI_GenericHypothesisCreator::ListOfWidgets& SMESHGUI_GenericHypothesisCreator::changeWidgets()
428 {
429   return myParamWidgets;
430 }
431
432 QtxDialog* SMESHGUI_GenericHypothesisCreator:: dlg() const
433
434   return myDlg;
435 }
436
437 bool SMESHGUI_GenericHypothesisCreator::isCreation() const
438 {
439   return myIsCreate;
440 }
441
442 void SMESHGUI_GenericHypothesisCreator::attuneStdWidget( QWidget*, const int ) const
443 {
444 }
445
446 QString SMESHGUI_GenericHypothesisCreator::caption() const
447 {
448   return QString();
449 }
450
451 QPixmap SMESHGUI_GenericHypothesisCreator::icon() const
452 {
453   return QPixmap();
454 }
455
456 QString SMESHGUI_GenericHypothesisCreator::type() const
457 {
458   return QString();
459 }
460 QWidget* SMESHGUI_GenericHypothesisCreator::getCustomWidget( const StdParam & /*param*/,
461                                                              QWidget*   /*parent*/,
462                                                              const int  /*index*/) const
463 {
464   return 0;
465 }
466 bool SMESHGUI_GenericHypothesisCreator::getParamFromCustomWidget( StdParam&, QWidget* ) const
467 {
468   return false;
469 }
470
471 bool SMESHGUI_GenericHypothesisCreator::checkParams( QString& msg ) const
472 {
473   bool ok = true;
474   ListOfWidgets::const_iterator anIt = widgets().begin(), aLast = widgets().end();
475   for( ; anIt!=aLast; anIt++ )
476   {
477     if( (*anIt)->inherits( "SalomeApp_IntSpinBox" ) )
478     {
479       SalomeApp_IntSpinBox* sb = ( SalomeApp_IntSpinBox* )( *anIt );
480       ok = sb->isValid( msg, true ) && ok;
481     }
482     else if( (*anIt)->inherits( "SalomeApp_DoubleSpinBox" ) )
483     {
484       SalomeApp_DoubleSpinBox* sb = ( SalomeApp_DoubleSpinBox* )( *anIt );
485       ok = sb->isValid( msg, true ) && ok;
486     }
487   }
488   return ok;
489 }
490
491 void SMESHGUI_GenericHypothesisCreator::onReject()
492 {
493 }
494
495 QString SMESHGUI_GenericHypothesisCreator::helpPage() const
496 {
497   QString aHypType = hypType();
498   QString aHelpFileName;
499   if ( aHypType == "LocalLength" )
500     aHelpFileName = "a1d_meshing_hypo_page.html#average_length_anchor";
501   else if ( aHypType == "Arithmetic1D")
502     aHelpFileName = "a1d_meshing_hypo_page.html#arithmetic_1d_anchor";
503   else if ( aHypType == "MaxElementArea")
504     aHelpFileName = "a2d_meshing_hypo_page.html#max_element_area_anchor";
505   else if ( aHypType == "MaxElementVolume")
506     aHelpFileName = "max_element_volume_hypo_page.html";
507   else if ( aHypType == "StartEndLength")
508     aHelpFileName = "a1d_meshing_hypo_page.html#start_and_end_length_anchor";
509   else if ( aHypType == "Deflection1D")
510     aHelpFileName = "a1d_meshing_hypo_page.html#deflection_1d_anchor";
511   else if ( aHypType == "AutomaticLength")
512     aHelpFileName = "a1d_meshing_hypo_page.html#automatic_length_anchor";
513   else if ( aHypType == "NumberOfSegments")
514     aHelpFileName = "a1d_meshing_hypo_page.html#number_of_segments_anchor";
515   else if ( aHypType == "ProjectionSource1D")
516     aHelpFileName = "projection_algos_page.html";
517   else if ( aHypType == "ProjectionSource2D")
518     aHelpFileName = "projection_algos_page.html";
519   else if ( aHypType == "ProjectionSource3D")
520     aHelpFileName = "projection_algos_page.html";
521   else if ( aHypType == "NumberOfLayers")
522     aHelpFileName = "radial_prism_algo_page.html";
523   else if ( aHypType == "LayerDistribution")
524     aHelpFileName = "radial_prism_algo_page.html";
525   else if ( aHypType == "SegmentLengthAroundVertex")
526     aHelpFileName = "segments_around_vertex_algo.html";
527   else
528     aHelpFileName = "";
529   return aHelpFileName;
530 }
531
532
533
534
535 SMESHGUI_HypothesisDlg::SMESHGUI_HypothesisDlg( SMESHGUI_GenericHypothesisCreator* creator, QWidget* parent )
536 : QtxDialog( parent, false, true ),
537   myCreator( creator )
538 {
539   setMinimumSize( 300, height() );
540 //  setFixedSize( 300, height() );
541   QVBoxLayout* topLayout = new QVBoxLayout( mainFrame() );
542   topLayout->setMargin( 0 );
543   topLayout->setSpacing( 0 );
544
545   QFrame* titFrame = new QFrame( mainFrame() );
546   QHBoxLayout* titLay = new QHBoxLayout( titFrame );
547   titLay->setMargin( 0 );
548   titLay->setSpacing( SPACING );
549   
550   myIconLabel = new QLabel( titFrame );
551   myIconLabel->setScaledContents( false );
552   myIconLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
553   myTypeLabel = new QLabel( titFrame );
554   if( creator )
555     myTypeLabel->setText( creator->hypType() );
556
557   titLay->addWidget( myIconLabel, 0 );
558   titLay->addWidget( myTypeLabel, 0 );
559   titLay->addStretch( 1 );
560
561   topLayout->addWidget( titFrame, 0 );
562
563   myHelpFileName = creator->helpPage();
564
565   connect( this, SIGNAL( dlgHelp() ), this, SLOT( onHelp() ) );
566 }
567
568 SMESHGUI_HypothesisDlg::~SMESHGUI_HypothesisDlg()
569 {
570 }
571
572 void SMESHGUI_HypothesisDlg::setCustomFrame( QFrame* f )
573 {
574   if( f )
575   {
576     f->setParent( mainFrame() );
577     qobject_cast<QVBoxLayout*>( mainFrame()->layout() )->insertWidget( 1, f, 1 );
578   }
579 }
580
581 void SMESHGUI_HypothesisDlg::accept()
582 {
583   QString msg;
584   if ( myCreator && !myCreator->checkParams( msg ) )
585   {
586     QString str( tr( "SMESH_INCORRECT_INPUT" ) );
587     if ( !msg.isEmpty() )
588       str += "\n" + msg;
589     SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
590     return;
591   }
592   QtxDialog::accept();
593 }
594
595 void SMESHGUI_HypothesisDlg::reject()
596 {
597   if ( myCreator ) myCreator->onReject();
598   QtxDialog::reject();
599 }
600
601 void SMESHGUI_HypothesisDlg::onHelp()
602 {
603   LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
604   if (app) {
605     SMESHGUI* aSMESHGUI = dynamic_cast<SMESHGUI*>( app->activeModule() );
606     app->onHelpContextModule(aSMESHGUI ? app->moduleName(aSMESHGUI->moduleName()) : QString(""), myHelpFileName);
607   }
608   else {
609     QString platform;
610 #ifdef WIN32
611     platform = "winapplication";
612 #else
613     platform = "application";
614 #endif
615     SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
616                              tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
617                              arg(app->resourceMgr()->stringValue("ExternalBrowser", 
618                                                                  platform)).
619                              arg(myHelpFileName));
620   }
621 }
622
623 void SMESHGUI_HypothesisDlg::setHIcon( const QPixmap& p )
624 {
625   myIconLabel->setPixmap( p );  
626 }
627
628 void SMESHGUI_HypothesisDlg::setType( const QString& t )
629 {
630   myTypeLabel->setText( t );
631 }
632
633 HypothesisData::HypothesisData( const QString& theTypeName,
634                                 const QString& thePluginName,
635                                 const QString& theServerLibName,
636                                 const QString& theClientLibName,
637                                 const QString& theLabel,
638                                 const QString& theIconId,
639                                 const QList<int>& theDim,
640                                 const bool theIsAux,
641                                 const QStringList& theNeededHypos,
642                                 const QStringList& theOptionalHypos,
643                                 const QStringList& theInputTypes,
644                                 const QStringList& theOutputTypes,
645                                 const bool theIsNeedGeometry,
646                                 const bool supportSub)
647   : TypeName( theTypeName ),
648     PluginName( thePluginName ),
649     ServerLibName( theServerLibName ),
650     ClientLibName( theClientLibName ),
651     Label( theLabel ),
652     IconId( theIconId ),
653     Dim( theDim ),
654     IsAux( theIsAux ),
655     NeededHypos( theNeededHypos ), 
656     OptionalHypos( theOptionalHypos ),
657     InputTypes( theInputTypes ),
658     OutputTypes( theOutputTypes ),
659     IsNeedGeometry( theIsNeedGeometry ),
660     IsSupportSubmeshes( supportSub )
661 {
662 }
663
664 HypothesesSet::HypothesesSet( const QString& theSetName ) 
665   : HypoSetName( theSetName )
666 {
667 }
668
669 HypothesesSet::HypothesesSet( const QString&     theSetName,
670                               const QStringList& theHypoList,
671                               const QStringList& theAlgoList )
672   : HypoSetName( theSetName ), 
673     HypoList( theHypoList ), 
674     AlgoList( theAlgoList )
675 {
676 }