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