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