1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // VISU VISUGUI : GUI of VISU component
23 // File : VisuGUI_Slider.cxx
24 // Author : Oleg UVAROV
27 #include "VisuGUI_Slider.h"
29 #include "SUIT_ResourceMgr.h"
30 #include "SUIT_Session.h"
32 #include "SalomeApp_Application.h"
33 #include "SalomeApp_Study.h"
35 #include "LightApp_SelectionMgr.h"
37 #include "SALOME_ListIteratorOfListIO.hxx"
39 #include "VISU_PipeLine.hxx"
41 #include "VISU_Actor.h"
43 #include "VISU_Gen_i.hh"
45 #include "VisuGUI_Tools.h"
46 #include "VisuGUI_Prs3dTools.h"
48 #include "VTKViewer_Algorithm.h"
49 #include "SVTK_Functor.h"
51 #include "QtxDockWidget.h"
52 #include "QtxDoubleSpinBox.h"
54 #include <vtkActorCollection.h>
55 #include <vtkRenderer.h>
57 #include <QMainWindow>
63 #include <QToolButton>
69 #include <QRadioButton>
78 VisuGUI_Slider::VisuGUI_Slider( VisuGUI* theModule,
79 QMainWindow* theParent,
80 LightApp_SelectionMgr* theSelectionMgr )
81 : QWidget( theParent )
82 , myViewManager( VISU::GetVisuGen( theModule )->GetViewManager() )
83 , mySelectionMgr( theSelectionMgr )
84 , myModule( theModule )
86 setWindowTitle( tr("TITLE") );
87 setObjectName( tr("TITLE") );
89 SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
91 //----------------------------------------------------------------------------
92 QVBoxLayout* aVBoxLayout = new QVBoxLayout( this );
94 QTabWidget* aTabWidget = new QTabWidget( this );
95 aTabWidget->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed );
97 aVBoxLayout->addWidget( aTabWidget );
100 QWidget* aParent = new QWidget();
102 QGridLayout* aGridLayout = new QGridLayout( aParent );
104 myFirstTimeStamp = new QLabel( aParent );
105 myFirstTimeStamp->setAlignment( Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter );
106 myFirstTimeStamp->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
107 aGridLayout->addWidget( myFirstTimeStamp, 0, 0, 1, 1 );
109 mySlider = new QSlider( aParent );
110 mySlider->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
111 mySlider->setFocusPolicy( Qt::StrongFocus );
112 mySlider->setOrientation( Qt::Horizontal );
113 mySlider->setTracking( false );
114 mySlider->setMinimum( 0 );
115 aGridLayout->addWidget( mySlider, 0, 1, 1, 3 );
117 myLastTimeStamp = new QLabel( aParent );
118 aGridLayout->addWidget( myLastTimeStamp, 0, 4, 1, 1 );
121 myFirstButton = new QToolButton( aParent );
122 myFirstButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_FIRST" ) ) );
123 myFirstButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
124 aGridLayout->addWidget( myFirstButton, 1, 0, 1, 1 );
126 myPreviousButton = new QToolButton( aParent );
127 myPreviousButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PREVIOUS" ) ) );
128 myPreviousButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
129 aGridLayout->addWidget( myPreviousButton, 1, 1, 1, 1 );
131 myPlayButton = new QToolButton( aParent );
132 myPlayButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PLAY" ) ) );
133 myPlayButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
134 myPlayButton->setCheckable( true );
135 aGridLayout->addWidget( myPlayButton, 1, 2, 1, 1 );
137 myNextButton = new QToolButton( aParent );
138 myNextButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_NEXT" ) ) );
139 myNextButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
140 aGridLayout->addWidget( myNextButton, 1, 3, 1, 1 );
142 myLastButton = new QToolButton( aParent );
143 myLastButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_LAST" ) ) );
144 myLastButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
145 aGridLayout->addWidget( myLastButton, 1, 4, 1, 1 );
148 myTimeStampIndexes = new QComboBox( aParent );
149 myTimeStampIndexes->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
150 myTimeStampIndexes->setFocusPolicy( Qt::StrongFocus );
151 aGridLayout->addWidget( myTimeStampIndexes, 2, 0, 1, 2 );
153 myIsCycled = new QToolButton( aParent );
154 myIsCycled->setText( tr( "IS_CYCLED" ) );
155 myIsCycled->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
156 myIsCycled->setLayoutDirection( Qt::LeftToRight );
157 myIsCycled->setCheckable( true );
158 //myIsCycled->setEnabled( false );
159 aGridLayout->addWidget( myIsCycled, 2, 2, 1, 1 );
161 myTimeStampStrings = new QComboBox( aParent );
162 myTimeStampStrings->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
163 myTimeStampStrings->setFocusPolicy( Qt::StrongFocus );
164 aGridLayout->addWidget( myTimeStampStrings, 2, 3, 1, 2 );
168 aTabWidget->addTab( aParent, tr( "NAVIGATION_TAB" ) );
173 QWidget* aParent = new QWidget();
175 QVBoxLayout* aVBoxLayout = new QVBoxLayout( aParent );
177 QHBoxLayout* aHBoxLayout = new QHBoxLayout();
179 myMinimalMemoryButton = new QRadioButton( tr( "MINIMAL_MEMORY" ), aParent );
180 aHBoxLayout->addWidget( myMinimalMemoryButton );
182 QSpacerItem* aSpacerItem = new QSpacerItem( 16, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
183 aHBoxLayout->addItem( aSpacerItem );
185 myLimitedMemoryButton = new QRadioButton( tr( "LIMITED_MEMORY" ), aParent );
186 myLimitedMemoryButton->setChecked( true );
187 aHBoxLayout->addWidget( myLimitedMemoryButton );
189 myLimitedMemory = new QtxDoubleSpinBox( aParent );
190 myLimitedMemory->setMaximum( 10000 );
191 myLimitedMemory->setValue( 512 );
192 aHBoxLayout->addWidget( myLimitedMemory );
194 QLabel* aMemoryDimensionLabel = new QLabel( aParent );
195 aMemoryDimensionLabel->setText( tr( "MEMORY_UNITS" ) );
196 aHBoxLayout->addWidget( aMemoryDimensionLabel );
198 aVBoxLayout->addLayout( aHBoxLayout );
201 QHBoxLayout* aHBoxLayout = new QHBoxLayout();
203 QLabel* aUsedMemoryLabel = new QLabel( tr( "USED_BY_CACHE" ), aParent );
204 aUsedMemoryLabel->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
205 aHBoxLayout->addWidget( aUsedMemoryLabel );
207 myUsedMemory = new QLineEdit( aParent );
208 myUsedMemory->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed );
209 //myUsedMemory->setEnabled( false );
210 aHBoxLayout->addWidget( myUsedMemory );
212 QSpacerItem* aSpacerItem = new QSpacerItem( 16, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
213 aHBoxLayout->addItem( aSpacerItem );
215 QLabel* aFreeMemoryLabel = new QLabel( tr( "AVAILABLE_MEMORY" ), aParent );
216 aHBoxLayout->addWidget( aFreeMemoryLabel );
218 myFreeMemory = new QLineEdit( aParent );
219 myFreeMemory->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed );
220 //myFreeMemory->setEnabled( false );
221 aHBoxLayout->addWidget( myFreeMemory );
223 aVBoxLayout->addLayout( aHBoxLayout );
226 QHBoxLayout* aHBoxLayout = new QHBoxLayout();
228 QLabel* aLabel = new QLabel( tr( "SPEED" ), aParent );
229 aLabel->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
230 aHBoxLayout->addWidget( aLabel );
232 mySpeedSlider = new QSlider( aParent );
233 mySpeedSlider->setMinimum( 1 );
234 mySpeedSlider->setMaximum( 100 );
235 mySpeedSlider->setValue( mySpeedSlider->maximum() / 2 );
236 mySpeedSlider->setPageStep( mySpeedSlider->maximum() / 5 );
237 mySpeedSlider->setTickInterval( mySpeedSlider->pageStep() );
238 mySpeedSlider->setOrientation( Qt::Horizontal );
239 mySpeedSlider->setTickPosition( QSlider::TicksBelow );
240 aHBoxLayout->addWidget( mySpeedSlider );
242 aVBoxLayout->addLayout( aHBoxLayout );
245 aTabWidget->addTab( aParent, tr( "PROPERTIES_TAB" ) );
250 QSpacerItem* aSpacerItem = new QSpacerItem( 16, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
251 aVBoxLayout->addItem( aSpacerItem );
255 //----------------------------------------------------------------------------
256 myPlayPixmap = aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PLAY" ) );
257 myPausePixmap = aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PAUSE" ) );
259 myTimer = new QTimer( this );
262 connect( theModule, SIGNAL( moduleDeactivated() ), SLOT( onModuleDeactivated() ) );
264 connect( theModule, SIGNAL( moduleActivated() ), SLOT( onModuleActivated() ) );
266 connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ), SLOT( onSelectionChanged() ) );
268 connect( myTimeStampStrings, SIGNAL( activated( int ) ), SLOT( onTimeStampActivated( int ) ) );
269 connect( myTimeStampIndexes, SIGNAL( activated( int ) ), SLOT( onTimeStampActivated( int ) ) );
271 connect( myFirstButton, SIGNAL( clicked() ), SLOT( onFirst() ) );
272 connect( myPreviousButton, SIGNAL( clicked() ), SLOT( onPrevious() ) );
273 connect( myPlayButton, SIGNAL( toggled( bool ) ), SLOT( onPlay( bool ) ) );
274 connect( myNextButton, SIGNAL( clicked() ), SLOT( onNext() ) );
275 connect( myLastButton, SIGNAL( clicked() ), SLOT( onLast() ) );
277 connect( mySlider, SIGNAL( valueChanged( int ) ), SLOT( onValueChanged( int ) ) );
279 connect( mySpeedSlider, SIGNAL( valueChanged( int ) ), SLOT( onSpeedChanged( int ) ) );
281 connect( myTimer, SIGNAL( timeout() ), SLOT( onTimeout() ) );
283 //----------------------------------------------------------------------------
284 connect( myLimitedMemoryButton, SIGNAL( toggled( bool ) ), this, SLOT( onMemoryModeChanged( bool ) ) );
285 connect( myLimitedMemory, SIGNAL( valueChanged( double ) ), this, SLOT( onMemorySizeChanged( double ) ) );
287 //----------------------------------------------------------------------------
288 enableControls( false );
290 QtxDockWidget* aQtxDockWidget = new QtxDockWidget( true, theParent );
291 theParent->addDockWidget( Qt::BottomDockWidgetArea , aQtxDockWidget );
292 aQtxDockWidget->setObjectName( objectName() );
293 aQtxDockWidget->setWidget( this );
295 myToggleViewAction = aQtxDockWidget->toggleViewAction();
296 myToggleViewAction->setIcon( QIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PANEL" ) ) ) );
297 myToggleViewAction->setToolTip( tr( "MEN_SLIDER_PANE" ) );
298 myToggleViewAction->setText( tr( "MEN_SLIDER_PANE" ) );
299 myToggleViewAction->setCheckable( true );
300 aQtxDockWidget->setVisible( false );
302 connect( myToggleViewAction, SIGNAL( toggled( bool ) ), this, SLOT( onToggleView( bool ) ) );
306 //----------------------------------------------------------------------------
307 VisuGUI_Slider::~VisuGUI_Slider()
312 //----------------------------------------------------------------------------
313 QAction* VisuGUI_Slider::toggleViewAction()
315 return myToggleViewAction;
319 //----------------------------------------------------------------------------
320 void VisuGUI_Slider::onModuleDeactivated()
326 //----------------------------------------------------------------------------
327 void VisuGUI_Slider::onModuleActivated()
333 //----------------------------------------------------------------------------
334 void VisuGUI_Slider::onMemoryModeChanged( bool )
336 using namespace VISU;
337 SALOMEDS::Study_var aStudy = GetDSStudy( GetCStudy( GetAppStudy( myModule ) ) );
338 VISU::ColoredPrs3dCache_var aCache = GetVisuGen( myModule )->GetColoredPrs3dCache( aStudy );
340 if ( myLimitedMemoryButton->isChecked() ) {
341 aCache->SetMemoryMode( VISU::ColoredPrs3dCache::LIMITED );
342 aCache->SetLimitedMemory( myLimitedMemory->value() );
344 aCache->SetMemoryMode( VISU::ColoredPrs3dCache::MINIMAL );
346 myLimitedMemory->setEnabled( myLimitedMemoryButton->isChecked() );
350 //----------------------------------------------------------------------------
351 void VisuGUI_Slider::onMemorySizeChanged( double )
353 onMemoryModeChanged( myLimitedMemoryButton->isChecked() );
357 //----------------------------------------------------------------------------
358 bool VisuGUI_Slider::checkHolderList()
360 THolderList aHolderList;
361 THolderList::const_iterator anIter = myHolderList.begin();
362 THolderList::const_iterator anIterEnd = myHolderList.end();
363 for(; anIter != anIterEnd; anIter++){
364 VISU::ColoredPrs3dHolder_var aHolder = *anIter;
365 if(!aHolder->_non_existent())
366 aHolderList.push_back(aHolder);
368 myHolderList.swap(aHolderList);
369 return myHolderList.empty();
373 //----------------------------------------------------------------------------
374 void VisuGUI_Slider::enableControls( bool on )
376 myPlayTab->setEnabled( on );
380 if( checkHolderList() )
383 myTimeStampStrings->clear();
384 myTimeStampIndexes->clear();
386 VISU::ColoredPrs3dHolder_var aHolder = myHolderList.front();
388 VISU::ColoredPrs3dHolder::TimeStampsRange_var aTimeStampsRange = aHolder->GetTimeStampsRange();
389 CORBA::Long aLength = aTimeStampsRange->length();
391 VISU::ColoredPrs3dHolder::BasicInput_var anInput = aHolder->GetBasicInput();
392 CORBA::Long aTimeStampNumber = anInput->myTimeStampNumber;
394 myFirstTimeStamp->setText( aTimeStampsRange[0].myTime.in() );
395 myLastTimeStamp->setText( aTimeStampsRange[aLength-1].myTime.in() );
397 int aPageStep = aLength / 10;
398 aPageStep = std::max(aPageStep, 1);
399 mySlider->setPageStep(aPageStep);
401 CORBA::Long a_current_index = 0;
402 for( CORBA::Long an_index = 0; an_index < aLength; an_index++ )
404 VISU::ColoredPrs3dHolder::TimeStampInfo anInfo = aTimeStampsRange[ an_index ];
405 CORBA::Long aNumber = anInfo.myNumber;
406 QString aTime = anInfo.myTime.in();
408 myTimeStampStrings->addItem( aTime );
409 myTimeStampIndexes->addItem( QString::number( aNumber ) );
411 if( aNumber == aTimeStampNumber )
412 a_current_index = an_index;
414 // work around - to update controls' sizes
415 myTimeStampStrings->setFont(myTimeStampStrings->font());
416 myTimeStampStrings->updateGeometry();
418 myTimeStampIndexes->setFont(myTimeStampStrings->font());
419 myTimeStampIndexes->updateGeometry();
421 if( a_current_index > mySlider->maximum() )
422 mySlider->setMaximum( aLength-1 );
424 myTimeStampStrings->setCurrentIndex( a_current_index );
425 myTimeStampIndexes->setCurrentIndex( a_current_index );
426 mySlider->setValue( a_current_index );
428 if( a_current_index <= mySlider->maximum() )
429 mySlider->setMaximum( aLength-1 );
431 using namespace VISU;
432 SALOMEDS::Study_var aStudy = GetDSStudy( GetCStudy( GetAppStudy( myModule ) ) );
433 VISU::ColoredPrs3dCache_var aCache = GetVisuGen( myModule )->GetColoredPrs3dCache( aStudy );
435 long aMb = 1024 * 1024;
436 double aLimitedMemory = aCache->GetLimitedMemory();
437 myLimitedMemory->setValue( aLimitedMemory );
439 double aFreeMemory = (double)VISU_PipeLine::GetAvailableMemory( 2048 * aMb ) / (double)aMb;
440 double anUsedMemory = aCache->GetMemorySize();
441 double aLimitedMemoryMax = max( anUsedMemory + aFreeMemory, aLimitedMemory );
442 myLimitedMemory->setMaximum( aLimitedMemoryMax );
446 myPlayButton->setChecked( false );
452 //----------------------------------------------------------------------------
453 void VisuGUI_Slider::updateMemoryState()
455 if( checkHolderList() )
458 VISU::ColoredPrs3dHolder_var aHolder = myHolderList.front();
459 VISU::ColoredPrs3dCache_var aCache = aHolder->GetCache();
461 CORBA::Float aCacheMemory = aCache->GetMemorySize();
462 myUsedMemory->setText( QString::number( double( aCacheMemory ), 'E', 2 ) + " Mb" );
463 myUsedMemory->setFont( myUsedMemory->font() );
464 myUsedMemory->updateGeometry();
467 long aMb = 1024 * 1024;
468 double aFreeMemory = (double)VISU_PipeLine::GetAvailableMemory( 2048 * aMb ) / (double)aMb;
469 myFreeMemory->setText( QString::number( double( aFreeMemory ), 'E', 2 ) + " Mb" );
470 myFreeMemory->setFont( myFreeMemory->font() );
471 myFreeMemory->updateGeometry();
475 //----------------------------------------------------------------------------
476 void VisuGUI_Slider::onSelectionChanged()
478 //cout << "VisuGUI_Slider::onSelectionChanged()" << endl;
479 myHolderList.clear();
481 _PTR(SObject) aSObject;
483 SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>
484 (SUIT_Session::session()->activeApplication());
486 SALOME_ListIO aListIO;
487 mySelectionMgr->selectedObjects(aListIO);
488 SALOME_ListIteratorOfListIO anIter(aListIO);
489 for(; anIter.More(); anIter.Next() ){
490 Handle(SALOME_InteractiveObject) anIO = anIter.Value();
491 if (anIO->hasEntry()) {
492 SalomeApp_Study* theStudy = dynamic_cast<SalomeApp_Study*>(anApp->activeStudy());
493 _PTR(Study) aStudy = theStudy->studyDS();
494 aSObject = aStudy->FindObjectID(anIO->getEntry());
497 CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObject);
498 if (!CORBA::is_nil(anObject)) {
499 VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(anObject);
501 if(!CORBA::is_nil(aHolder))
503 //cout << "ColoredPrs3dHolder" << endl;
504 myHolderList.push_back(aHolder);
511 VISU::View_var aView = myViewManager->GetCurrentView();
513 enableControls( !checkHolderList() && !CORBA::is_nil( aView.in() ) );
519 //----------------------------------------------------------------------------
520 void VisuGUI_Slider::onTimeStampActivated( int value )
522 mySlider->setValue( value );
523 onValueChanged( value );
527 //----------------------------------------------------------------------------
528 void VisuGUI_Slider::onFirst()
530 int value = mySlider->minimum();
531 mySlider->setValue( value );
535 //----------------------------------------------------------------------------
536 void VisuGUI_Slider::onPrevious()
538 int value = mySlider->value() - 1;
539 if( value >= mySlider->minimum() )
540 mySlider->setValue( value );
544 //----------------------------------------------------------------------------
545 void VisuGUI_Slider::onPlay( bool on )
549 myPlayButton->setIcon( myPausePixmap );
551 int delay = int( 50.0 * mySpeedSlider->maximum() / mySpeedSlider->value() );
552 myTimer->start( delay );
557 myPlayButton->setIcon( myPlayPixmap );
562 //----------------------------------------------------------------------------
563 void VisuGUI_Slider::onToggleView( bool on )
571 //----------------------------------------------------------------------------
572 void VisuGUI_Slider::onNext()
574 int value = mySlider->value() + 1;
575 if( value <= mySlider->maximum() )
576 mySlider->setValue( value );
580 //----------------------------------------------------------------------------
581 void VisuGUI_Slider::onLast()
583 int value = mySlider->maximum();
584 mySlider->setValue( value );
588 //----------------------------------------------------------------------------
589 void VisuGUI_Slider::onValueChanged( int value )
591 if ( checkHolderList() ) {
592 enableControls( false );
596 myTimeStampStrings->setCurrentIndex( value );
597 myTimeStampIndexes->setCurrentIndex( value );
599 VISU::ColoredPrs3dHolder_var aHolder = myHolderList.front();
601 VISU::ColoredPrs3dHolder::TimeStampsRange_var aTimeStampsRange = aHolder->GetTimeStampsRange();
602 CORBA::Long aLength = aTimeStampsRange->length();
603 if ( value < 0 || aLength <= value )
606 VISU::ColoredPrs3dHolder::BasicInput_var anInput = aHolder->GetBasicInput();
607 CORBA::Long aTimeStampNumber = anInput->myTimeStampNumber;
608 CORBA::Long aNumber = aTimeStampsRange[ value ].myNumber;
609 if ( aNumber == aTimeStampNumber )
612 VISU::View_var aView = myViewManager->GetCurrentView();
613 if ( CORBA::is_nil( aView.in() ) ) {
614 enableControls( false );
618 VISU::View3D_var aView3D = VISU::View3D::_narrow( aView );
620 THolderList::const_iterator anIter = myHolderList.begin();
621 THolderList::const_iterator anIterEnd = myHolderList.end();
622 for( ; anIter != anIterEnd; anIter++ )
624 VISU::ColoredPrs3dHolder_var aHolder = *anIter;
625 if( CORBA::is_nil( aHolder.in() ) )
628 VISU::ColoredPrs3d_var aPrs3d = aHolder->GetDevice();
629 VISU::ColoredPrs3dHolder::BasicInput_var anInput = aHolder->GetBasicInput();
630 anInput->myTimeStampNumber = aNumber;
632 QApplication::setOverrideCursor(Qt::WaitCursor);
634 aHolder->Apply( aPrs3d, anInput, aView3D );
636 QApplication::restoreOverrideCursor();
645 //----------------------------------------------------------------------------
646 void VisuGUI_Slider::onSpeedChanged( int value )
648 if(myPlayButton->isChecked()){
649 int delay = int( 50.0 * mySpeedSlider->maximum() / mySpeedSlider->value() );
650 myTimer->start( delay );
655 //----------------------------------------------------------------------------
656 void VisuGUI_Slider::onTimeout()
658 int value = mySlider->value();
659 if ( value < mySlider->maximum() ) {
662 if ( myIsCycled->isChecked() )
665 myPlayButton->setChecked( false );
670 //----------------------------------------------------------------------------