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