Salome HOME
Using files from package LightApp instead of files from package SalomeApp
[modules/visu.git] / src / VISUGUI / VisuGUI_StreamLinesDlg.cxx
1 //  VISU VISUGUI : GUI of VISU component
2 //
3 //  Copyright (C) 2003  CEA/DEN, EDF R&D
4 //
5 //
6 //
7 //  File   : VisuGUI_StreamLinesDlg.cxx
8 //  Author : Vitaly SMETANNIKOV
9 //  Module : VISU
10
11 #include "VisuGUI_StreamLinesDlg.h"
12
13 #include "VisuGUI.h"
14 #include "VisuGUI_Tools.h"
15
16 #include "VISU_Mesh_i.hh"
17 #include "VISU_Gen_i.hh"
18 #include "VISU_StreamLines_i.hh"
19 #include "VISU_StreamLinesPL.hxx"
20 #include "VISU_Actor.h"
21
22 #include "SalomeApp_Application.h"
23 #include "LightApp_SelectionMgr.h"
24
25 #include "SVTK_ViewWindow.h"
26
27 #include "SUIT_Desktop.h"
28 #include "SUIT_ResourceMgr.h"
29 #include "SUIT_MessageBox.h"
30
31 #include "SALOME_ListIO.hxx"
32
33 #include <SALOMEDSClient_SObject.hxx>
34
35 #include <limits.h>
36 #include <qlayout.h>
37 #include <qgroupbox.h>
38 #include <qcolordialog.h>
39 #include <qtabwidget.h>
40
41 using namespace std;
42
43 VisuGUI_StreamLinesDlg::VisuGUI_StreamLinesDlg (SalomeApp_Module* theModule)
44      : QDialog(VISU::GetDesktop(theModule), "VisuGUI_StreamLinesDlg", false,
45                WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
46        myVisuGUI(theModule)
47 {
48   myPrs = NULL;
49   setCaption(tr("DLG_TITLE"));
50   setSizeGripEnabled(TRUE);
51
52   QVBoxLayout* aBoxLayout = new QVBoxLayout(this);
53   aBoxLayout->setSpacing( 6 );
54   aBoxLayout->setMargin( 11 );
55
56   QTabWidget* aTabBox = new QTabWidget(this);
57
58   QFrame* aTopBox = new QFrame(this);
59   aTopBox->setMargin( 11 );
60   QGridLayout* TopLayout = new QGridLayout( aTopBox );
61   TopLayout->setAlignment( Qt::AlignTop );
62   TopLayout->setSpacing( 8 );
63   TopLayout->setMargin( 11 );
64
65   // Source box
66   QGroupBox* aSourceBox = new QGroupBox (tr("SOURCE_GRP"), aTopBox);
67   aSourceBox->setColumnLayout(0, Qt::Vertical);
68   QGridLayout* aSrcLayout = new QGridLayout( aSourceBox->layout() );
69   aSrcLayout->setSpacing( 6 );
70   aSrcLayout->setMargin( 0 );
71
72   QLabel* aTypeLbl = new QLabel( tr( "LBL_SOURCE_TYPE" ), aSourceBox);
73   aSrcLayout->addWidget(aTypeLbl, 0, 0);
74
75   myUseSrcCombo = new QComboBox(aSourceBox);
76   const char* aChoise[] = { "None", "Entity", "Family", "Group", "Presentation", 0 };
77   myUseSrcCombo->insertStrList(aChoise);
78   aSrcLayout->addWidget(myUseSrcCombo, 0, 1);
79
80   mySrcCombo = new QComboBox(aSourceBox);
81   mySrcCombo->setEnabled((myUseSrcCombo->currentItem() == 0));
82
83   connect(myUseSrcCombo, SIGNAL(activated(int)), this, SLOT(onSourceTypeChange(int)));
84
85   // Find All prs obj
86   //SUIT_Study* aActiveStudy = VISU::(myVisuGUI);
87   _PTR(Study) aActiveStudy = VISU::GetCStudy(VISU::GetAppStudy(myVisuGUI));
88   LightApp_SelectionMgr* aSel = VISU::GetSelectionMgr(myVisuGUI);
89   SALOME_ListIO selected;
90   aSel->selectedObjects(selected);
91   if (selected.Extent() > 0) {
92     Handle(SALOME_InteractiveObject) aIO = selected.First();
93     if (aIO->hasEntry()) {
94       _PTR(SObject) aSObject = aActiveStudy->FindObjectID(aIO->getEntry());
95       aSObject = aSObject->GetFather();
96       aSObject = aSObject->GetFather();
97       aSObject = aSObject->GetFather();
98       aSObject = aSObject->GetFather();
99       mySelectionObj = aSObject;
100       CORBA::Object_var anObject = VISU::ClientSObjectToObject(mySelectionObj);
101       VISU::Result_var aResult;
102       if (CORBA::is_nil(anObject)) {
103         mySelectionObj = mySelectionObj->GetFather();
104       }
105       _PTR(ChildIterator) aIter = aActiveStudy->NewChildIterator(mySelectionObj);
106
107       for (aIter->InitEx(true); aIter->More(); aIter->Next()) {
108         _PTR(SObject) aChildSObj = aIter->Value();
109         CORBA::Object_var aChildObject = VISU::ClientSObjectToObject(aChildSObj);
110
111         if (!CORBA::is_nil(aChildObject)) {
112           VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject);
113           if (!CORBA::is_nil(aPrsObj)) { // if this is a Prs object
114             if ((aPrsObj->GetType() != VISU::TSTREAMLINES) &&
115                 (aPrsObj->GetType() != VISU::TMESH)) {
116               _PTR(GenericAttribute) anAttr;
117               if (aChildSObj->FindAttribute(anAttr, "AttributeName")) {
118                 _PTR(AttributeName) aName (anAttr);
119                 myPrsLst += QString(aName->Value().c_str());
120                 myPrsList.append(aPrsObj);
121                 continue;
122               }
123             }
124           }
125         }
126         // else { // This is not a Prs object
127         _PTR(GenericAttribute) anAttr;
128         if (aChildSObj->FindAttribute(anAttr, "AttributeComment")) {
129           _PTR(AttributeComment) aComment (anAttr);
130           string aComm = aComment->Value();
131           QString strIn (aComm.c_str());
132           VISU::Storable::TRestoringMap aMap;
133           VISU::Storable::StrToMap(strIn,aMap);
134           bool isExist;
135           VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt();
136           if (isExist) {
137             if ((aType == VISU::TFAMILY) || (aType == VISU::TGROUP) || (aType == VISU::TENTITY)) {
138               _PTR(GenericAttribute) aNameAttr;
139               if (aChildSObj->FindAttribute(aNameAttr, "AttributeName")) {
140                 _PTR(AttributeName) aName (aNameAttr);
141                 VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject);
142                 switch (aType) {
143                 case VISU::TFAMILY:
144                   myFamilisLst += QString(aName->Value().c_str());
145                   myFamilyList.append(aPrsObj);
146                   break;
147                 case VISU::TGROUP:
148                   myGroupsLst += QString(aName->Value().c_str());
149                   myGroupList.append(aPrsObj);
150                   break;
151                 case VISU::TENTITY:
152                   myEntitiesLst += QString(aName->Value().c_str());
153                   myEntityList.append(aPrsObj);
154                   break;
155                 }
156               }
157             }
158           }
159         }
160       }
161     }
162   }
163
164   //  connect(myUseSrcChk, SIGNAL(toggled(bool)), mySrcCombo, SLOT(setEnabled(bool)));
165   aSrcLayout->addMultiCellWidget(mySrcCombo, 1, 1, 0, 1);
166
167   QLabel* aPercentLbl = new QLabel (tr("LBL_USED_POINTS"), aSourceBox);
168   aSrcLayout->addWidget(aPercentLbl, 2, 0);
169
170   myPntPercent = new QtxDblSpinBox( 0, 1, 0.1, aSourceBox );
171   aSrcLayout->addWidget(myPntPercent, 2, 1);
172
173   TopLayout->addMultiCellWidget(aSourceBox, 0, 0, 0, 1);
174
175   QLabel* aStepLenLbl = new QLabel (tr("LBL_STEP_LENGTH"), aTopBox);
176   TopLayout->addWidget(aStepLenLbl, 1, 0);
177   myStepLen = new QtxDblSpinBox( DBL_MIN, DBL_MAX, 0.1, aTopBox );
178   myStepLen->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
179   TopLayout->addWidget(myStepLen, 1, 1);
180   connect(myStepLen, SIGNAL(valueChanged(double)), this, SLOT(StepLengthChanged(double)));
181
182   QLabel* aIntegStepLenLbl = new QLabel (tr("LBL_INTEGRATION_STEP"), aTopBox);
183   TopLayout->addWidget(aIntegStepLenLbl, 2, 0);
184   myIntegStepLen = new QtxDblSpinBox( DBL_MIN, DBL_MAX, 0.1, aTopBox );
185   myIntegStepLen->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
186   TopLayout->addWidget(myIntegStepLen, 2, 1);
187   connect(myIntegStepLen, SIGNAL(valueChanged(double)), this, SLOT(IntegrationStepChanged(double)));
188
189   QLabel* aPropagationLbl = new QLabel (tr("LBL_PROPAGATION_TIME"), aTopBox);
190   TopLayout->addWidget(aPropagationLbl, 3, 0);
191   myPropTime = new QtxDblSpinBox( DBL_MIN, DBL_MAX, 1, aTopBox );
192   myPropTime->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
193   TopLayout->addWidget(myPropTime, 3, 1);
194   connect(myPropTime, SIGNAL(valueChanged(double)), this, SLOT(PropagationTimeChanged(double)));
195
196   QLabel* aDirLbl = new QLabel (tr("LBL_DIRECTION"),aTopBox);
197   TopLayout->addWidget(aDirLbl, 4, 0);
198   myDirCombo = new QComboBox(aTopBox);
199   myDirCombo->insertItem("Forward");
200   myDirCombo->insertItem("Backward");
201   myDirCombo->insertItem("Both");
202   TopLayout->addWidget(myDirCombo, 4, 1);
203
204   myUseScalar = new QCheckBox (tr("MAGNITUDE_COLORING_CHK"), aTopBox, "UseMagn");
205   connect( myUseScalar, SIGNAL( clicked() ), this, SLOT( enableSetColor() ) );
206   TopLayout->addWidget(myUseScalar, 5, 0);
207
208   SelColor = new QPushButton (tr("USE_COLOR_BTN"), aTopBox, "SelColor");
209   connect( SelColor,     SIGNAL( clicked() ), this, SLOT( setVColor() ) );
210   TopLayout->addWidget( SelColor, 5, 1);
211
212   aTabBox->addTab(aTopBox, "Stream Lines");
213   myScalarPane = new VisuGUI_ScalarBarPane(this, false);
214   myScalarPane->setMargin( 5 );
215   aTabBox->addTab(myScalarPane, "Scalar Bar");
216
217   aBoxLayout->addWidget(aTabBox);
218
219   QGroupBox* aGroupButtons = new QGroupBox( this, "GroupButtons" );
220   aGroupButtons->setColumnLayout(0, Qt::Vertical );
221   aGroupButtons->layout()->setSpacing( 0 );
222   aGroupButtons->layout()->setMargin( 0 );
223
224   QGridLayout* aGroupButtonsLayout = new QGridLayout( aGroupButtons->layout() );
225   aGroupButtonsLayout->setAlignment( Qt::AlignTop );
226   aGroupButtonsLayout->setSpacing( 6 );
227   aGroupButtonsLayout->setMargin( 11 );
228
229   QPushButton* aOkBtn = new QPushButton( tr( "&OK" ), aGroupButtons, "buttonOk" );
230   aOkBtn->setAutoDefault( TRUE );
231   aOkBtn->setDefault( TRUE );
232   aGroupButtonsLayout->addWidget( aOkBtn, 0, 0 );
233   aGroupButtonsLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
234
235   QPushButton* aCancelBtn = new QPushButton( tr( "&Cancel" ) , aGroupButtons, "buttonCancel" );
236   aCancelBtn->setAutoDefault( TRUE );
237   aGroupButtonsLayout->addWidget( aCancelBtn, 0, 2 );
238   connect( aOkBtn,     SIGNAL( clicked() ), this, SLOT( accept() ) );
239   connect( aCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
240
241   aBoxLayout->addWidget(aGroupButtons);
242
243   enableSetColor();
244 }
245
246
247
248 void VisuGUI_StreamLinesDlg::initFromPrsObject (VISU::StreamLines_i* thePrs)
249 {
250   myScalarPane->initFromPrsObject(thePrs);
251
252   myPrs = thePrs;
253   static int aNbOfSteps = 30;
254   VISU_StreamLinesPL* aStreamLinesPL = thePrs->GetStreamLinesPL();
255   float aMin, aMax;
256   aMin = aStreamLinesPL->GetMinPropagationTime();
257   aMax = aStreamLinesPL->GetMaxPropagationTime();
258   myPropTime->setRange(aMin,aMax);
259   myPropTime->setValue(aStreamLinesPL->GetPropagationTime());
260   myPropTime->setLineStep((aMax-aMin)/aNbOfSteps);
261
262   aMin = aStreamLinesPL->GetMinStepLength();
263   aMax = aStreamLinesPL->GetMaxStepLength();
264   myStepLen->setRange(aMin,aMax);
265   myStepLen->setValue(aStreamLinesPL->GetStepLength());
266   myStepLen->setLineStep((aMax-aMin)/aNbOfSteps);
267
268   aMin = aStreamLinesPL->GetMinIntegrationStep();
269   aMax = aStreamLinesPL->GetMaxIntegrationStep();
270   myIntegStepLen->setRange(aMin,aMax);
271   myIntegStepLen->setValue(aStreamLinesPL->GetIntegrationStep());
272   myIntegStepLen->setLineStep((aMax-aMin)/aNbOfSteps);
273
274   switch (thePrs->GetDirection()) {
275   case VISU::StreamLines::FORWARD:
276     myDirCombo->setCurrentItem(0);
277     break;
278   case VISU::StreamLines::BACKWARD:
279     myDirCombo->setCurrentItem(1);
280     break;
281   case VISU::StreamLines::BOTH:
282     myDirCombo->setCurrentItem(2);
283   }
284   myUseScalar->setChecked(thePrs->IsColored());
285   myPntPercent->setValue(thePrs->GetUsedPoints());
286
287   mySrcCombo->setEnabled(false);
288   QString aSrcEntry = thePrs->GetSourceEntry();
289
290   SALOMEDS::Color anOldColor = thePrs->GetColor();
291   QColor aColor = QColor(int(255*anOldColor.R),int(255*anOldColor.G),int(255*anOldColor.B));
292   setColor(aColor);
293   enableSetColor();
294
295 #define INITPRS(PRSLIST, PRSNUM) \
296     for (int i = 0; i < PRSLIST.count(); i++) { \
297       VISU::Prs3d_i* aPrs = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(PRSLIST[i]).in()); \
298       if (aPrs == NULL) continue; \
299       if (aSrcEntry == aPrs->GetEntry()) { \
300         onSourceTypeChange(PRSNUM); \
301         myUseSrcCombo->setCurrentItem(PRSNUM); \
302         mySrcCombo->setEnabled(true); \
303         mySrcCombo->setCurrentItem(i); \
304         return; \
305       } \
306     }
307
308   if (!aSrcEntry.isEmpty()) {
309     INITPRS(myEntityList, 1);
310     INITPRS(myFamilyList, 2);
311     INITPRS(myGroupList, 3);
312     INITPRS(myPrsList, 4);
313   }
314 #undef INITPRS
315 }
316
317 int VisuGUI_StreamLinesDlg::storeToPrsObject (VISU::StreamLines_i* thePrs)
318 {
319   bool isAccepted = myScalarPane->storeToPrsObject(thePrs);
320   if (isAccepted) {
321     thePrs->ShowColored(myUseScalar->isChecked());
322     if (!thePrs->IsColored()) {
323       SALOMEDS::Color aColor;
324       aColor.R = myColor.red()/255.;
325       aColor.G = myColor.green()/255.;
326       aColor.B = myColor.blue()/255.;
327       thePrs->SetColor(aColor);
328     }
329
330     VISU::StreamLines::Direction aDirection = VISU::StreamLines::BOTH;
331     switch (myDirCombo->currentItem()) {
332     case 0:
333       aDirection = VISU::StreamLines::FORWARD;
334       break;
335     case 1:
336       aDirection = VISU::StreamLines::BACKWARD;
337       break;
338     case 2:
339       aDirection = VISU::StreamLines::BOTH;
340     }
341
342     VISU::Prs3d_var aPrs;
343     int aSrcSelection = myUseSrcCombo->currentItem();
344     int aSrcItem = (mySrcCombo->count() > 0)? mySrcCombo->currentItem() : -1;
345     if ((aSrcSelection > 0) && (aSrcItem > -1)) {
346       VISU::VISUType aType;
347       QString aName;
348       switch (aSrcSelection) {
349       case 1: // Entity
350         aPrs = myEntityList[aSrcItem];
351         aType = VISU::TENTITY;
352         aName = myEntitiesLst[aSrcItem];
353         break;
354       case 2: // Family
355         aPrs = myFamilyList[aSrcItem];
356         aType = VISU::TFAMILY;
357         aName = myFamilisLst[aSrcItem];
358         break;
359       case 3: // Group
360         aPrs = myGroupList[aSrcItem];
361         aType = VISU::TGROUP;
362         aName = myGroupsLst[aSrcItem];
363         break;
364       case 4: // Presentation
365         aPrs = myPrsList[aSrcItem];
366         break;
367       }
368       if (CORBA::is_nil(aPrs) && aSrcSelection != 4) {
369         aPrs = createMesh(aType, aName);
370       }
371     }
372     isAccepted = thePrs->SetParams(myIntegStepLen->value(),
373                                    myPropTime->value(),
374                                    myStepLen->value(),
375                                    aPrs,
376                                    myPntPercent->value(),
377                                    aDirection);
378   }
379   //if (!isAccepted)
380   //  SUIT_MessageBox::warn1(VisuGUI::application()->desktop(), tr("WRN_VISU"),
381   //                         tr("ERR_CANT_BUILD_PRESENTATION"),
382   //                         tr("BUT_OK"));
383   return isAccepted;
384 }
385
386 /*!
387   Sets color
388 */
389 void VisuGUI_StreamLinesDlg::setColor( QColor color )
390 {
391   myColor = color;
392   SelColor->setPaletteBackgroundColor(myColor);
393 }
394
395
396 /*!
397   Called when "Select Color" buttonx clicked
398 */
399 void VisuGUI_StreamLinesDlg::setVColor()
400 {
401   QColor cnew = QColorDialog::getColor( myColor, this );
402   if ( cnew.isValid() )
403     setColor( cnew );
404 }
405
406
407 /*!
408   Enbled/disables magnitude coloring
409 */
410 void VisuGUI_StreamLinesDlg::enableMagnColor( bool enable )
411 {
412   myUseScalar->setEnabled( enable );
413   enableSetColor();
414 }
415
416 /*!
417   Called when "Magnitude Coloring" check box clicked
418 */
419 void VisuGUI_StreamLinesDlg::enableSetColor()
420 {
421   SelColor->setEnabled(!myUseScalar->isChecked() );
422 }
423
424 void VisuGUI_StreamLinesDlg::StepLengthChanged(double theValue){
425 }
426
427 void VisuGUI_StreamLinesDlg::IntegrationStepChanged(double theValue) {
428 }
429
430 void VisuGUI_StreamLinesDlg::PropagationTimeChanged(double theValue) {
431   myStepLen->setMaxValue(theValue);
432 }
433
434 void VisuGUI_StreamLinesDlg::onSourceTypeChange(int theIndex) {
435   mySrcCombo->clear();
436   if (theIndex == 0) {
437     mySrcCombo->setEnabled(false);
438     return;
439   } else
440     mySrcCombo->setEnabled(true);
441
442   switch(theIndex) {
443   case 1: // Entity
444     mySrcCombo->insertStringList(myEntitiesLst);
445     return;
446   case 2: // Family
447     mySrcCombo->insertStringList(myFamilisLst);
448     return;
449   case 3: // Group
450     mySrcCombo->insertStringList(myGroupsLst);
451     return;
452   case 4: // Presentation
453     mySrcCombo->insertStringList(myPrsLst);
454     return;
455   }
456 }
457
458
459 VISU::Mesh_ptr VisuGUI_StreamLinesDlg::createMesh (VISU::VISUType theType, QString theName)
460 {
461   return VISU::Mesh::_nil();
462 /*
463   CORBA::Object_var anObject = VISU::ClientSObjectToObject(mySelectionObj);
464   VISU::Result_var aResult;
465   if (!CORBA::is_nil(anObject)) {
466     aResult = VISU::Result::_narrow(anObject);
467   }
468   if (CORBA::is_nil(aResult)) {
469     SUIT_MessageBox::warn1(VisuGUI::application()->desktop(), tr("VISU_WARNING"),
470                            tr("WRN_NO_AVAILABLE_DATA"),
471                            tr("BUT_OK"));
472     return VISU::Mesh::_nil();
473   }
474   SALOMEDSClient_ChildIterator* aIter = VisuGUI::GetStudyDocument()->NewChildIterator( mySelectionObj );
475   VISU::Storable::TRestoringMap aMap;
476
477   for (aIter->InitEx(true); aIter->More(); aIter->Next() ) {
478     SALOMEDSClient_SObject* aChildSObj = aIter->Value();
479     SALOMEDSClient_GenericAttribute* anAttr;
480     if (aChildSObj->FindAttribute(anAttr, "AttributeComment")) {
481       SALOMEDSClient_AttributeComment* aComment = dynamic_cast<SALOMEDSClient_AttributeComment*>( anAttr );
482       CORBA::String_var aComm = aComment->Value().c_str();
483       QString strIn(aComm.in());
484       aMap.clear();
485       VISU::Storable::StrToMap(strIn,aMap);
486       bool isExist;
487       VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt();
488       if (isExist) {
489         if (aType != theType) continue;
490
491         SALOMEDSClient_GenericAttribute* aNameAttr;
492         if ( aChildSObj->FindAttribute(aNameAttr, "AttributeName") ) {
493           SALOMEDSClient_AttributeName* aName = dynamic_cast<SALOMEDSClient_AttributeName*>(aNameAttr);
494           if (QString(aName->Value()) == theName) break; //use current map
495         }
496       }
497     }
498   }
499   VISU::Mesh_var aMesh;
500   QString aMeshName = VISU::Storable::FindValue(aMap,"myMeshName");
501   switch (theType) {
502   case VISU::TFAMILY:
503     {
504       VISU::Entity anEntity = (VISU::Entity)VISU::Storable::FindValue(aMap,"myEntityId").toInt();
505       aMesh = VisuGUI::GetVisuGen()->FamilyMeshOnEntity(aResult,aMeshName.latin1(),anEntity,theName.latin1());
506     }
507     break;
508   case VISU::TGROUP:
509     {
510       aMesh = VisuGUI::GetVisuGen()->GroupMesh(aResult,aMeshName.latin1(), theName.latin1());
511     }
512     break;
513   case VISU::TENTITY:
514     {
515       VISU::Entity anEntity = (VISU::Entity)VISU::Storable::FindValue(aMap,"myId").toInt();
516       aMesh = VisuGUI::GetVisuGen()->MeshOnEntity(aResult,aMeshName.latin1(),anEntity);
517     }
518     break;
519   }
520   if(!CORBA::is_nil(aMesh)){ // Create Actor
521     VISU::Mesh_i* pPresent = dynamic_cast<VISU::Mesh_i*>(VISU::GetServant(aMesh).in());
522     if(SVTK_ViewWindow* vf = VISU::GetViewWindow()){
523       try{
524         pPresent->SetPresentationType(VISU::POINT);
525         VISU_Actor *anActor = pPresent->CreateActor();
526         vf->AddActor(anActor);
527       }catch(...){
528         SUIT_MessageBox::warn1 ( VisuGUI::application()->desktop(), tr("VISU_WARNING"),
529                                 tr("ERR_CANT_CREATE_ACTOR"),
530                                 tr("BUT_OK") );
531       }
532     }
533   } else {
534     SUIT_MessageBox::warn1(VisuGUI::application()->desktop(), tr("VISU_WARNING"),
535                            tr("ERR_CANT_BUILD_PRESENTATION"),
536                            tr("BUT_OK"));
537   }
538   return aMesh._retn();
539 */
540 }
541
542 void VisuGUI_StreamLinesDlg::accept() {
543   if (myScalarPane->check())
544     QDialog::accept();
545 }