1 // Copyright (C) 2007-2011 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
23 // VISU VISUGUI : GUI of VISU component
24 // File : VisuGUI_Slider.cxx
25 // Author : Oleg UVAROV
28 #include "VisuGUI_Slider.h"
29 #include "VisuGUI_Tools.h"
31 #include "SUIT_ResourceMgr.h"
32 #include "SUIT_Session.h"
34 #include "SalomeApp_Application.h"
35 #include "SalomeApp_Study.h"
36 #include <SalomeApp_DoubleSpinBox.h>
38 #include "LightApp_SelectionMgr.h"
40 #include "SALOME_ListIteratorOfListIO.hxx"
42 #include "VISU_PipeLine.hxx"
44 #include "VISU_Actor.h"
46 #include "VISU_Gen_i.hh"
48 #include "VisuGUI_Tools.h"
49 #include "VisuGUI_Prs3dTools.h"
51 #include "VTKViewer_Algorithm.h"
52 #include "SVTK_Functor.h"
54 #include "QtxDockWidget.h"
56 #include <vtkActorCollection.h>
57 #include <vtkRenderer.h>
59 #include <QMainWindow>
65 #include <QToolButton>
71 #include <QRadioButton>
80 VisuGUI_Slider::VisuGUI_Slider( VisuGUI* theModule,
81 QMainWindow* theParent,
82 LightApp_SelectionMgr* theSelectionMgr )
83 : QWidget( theParent )
84 , myViewManager( VISU::GetVisuGen( theModule )->GetViewManager() )
85 , mySelectionMgr( theSelectionMgr )
86 , myModule( theModule )
88 setWindowTitle( tr("TITLE") );
89 setObjectName( tr("TITLE") );
91 SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
93 //----------------------------------------------------------------------------
94 QVBoxLayout* aVBoxLayout = new QVBoxLayout( this );
96 QTabWidget* aTabWidget = new QTabWidget( this );
97 aTabWidget->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed );
99 aVBoxLayout->addWidget( aTabWidget );
102 QWidget* aParent = new QWidget();
104 QGridLayout* aGridLayout = new QGridLayout( aParent );
106 myFirstTimeStamp = new QLabel( aParent );
107 myFirstTimeStamp->setAlignment( Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter );
108 myFirstTimeStamp->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
109 aGridLayout->addWidget( myFirstTimeStamp, 0, 0, 1, 1 );
111 mySlider = new QSlider( aParent );
112 mySlider->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
113 mySlider->setFocusPolicy( Qt::StrongFocus );
114 mySlider->setOrientation( Qt::Horizontal );
115 mySlider->setTracking( false );
116 mySlider->setMinimum( 0 );
117 aGridLayout->addWidget( mySlider, 0, 1, 1, 3 );
119 myLastTimeStamp = new QLabel( aParent );
120 aGridLayout->addWidget( myLastTimeStamp, 0, 4, 1, 1 );
123 myFirstButton = new QToolButton( aParent );
124 myFirstButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_FIRST" ) ) );
125 myFirstButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
126 aGridLayout->addWidget( myFirstButton, 1, 0, 1, 1 );
128 myPreviousButton = new QToolButton( aParent );
129 myPreviousButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PREVIOUS" ) ) );
130 myPreviousButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
131 aGridLayout->addWidget( myPreviousButton, 1, 1, 1, 1 );
133 myPlayButton = new QToolButton( aParent );
134 myPlayButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PLAY" ) ) );
135 myPlayButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
136 myPlayButton->setCheckable( true );
137 aGridLayout->addWidget( myPlayButton, 1, 2, 1, 1 );
139 myNextButton = new QToolButton( aParent );
140 myNextButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_NEXT" ) ) );
141 myNextButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
142 aGridLayout->addWidget( myNextButton, 1, 3, 1, 1 );
144 myLastButton = new QToolButton( aParent );
145 myLastButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_LAST" ) ) );
146 myLastButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
147 aGridLayout->addWidget( myLastButton, 1, 4, 1, 1 );
150 myTimeStampIndexes = new QComboBox( aParent );
151 myTimeStampIndexes->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
152 myTimeStampIndexes->setFocusPolicy( Qt::StrongFocus );
153 aGridLayout->addWidget( myTimeStampIndexes, 2, 0, 1, 2 );
155 myIsCycled = new QToolButton( aParent );
156 myIsCycled->setText( tr( "IS_CYCLED" ) );
157 myIsCycled->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
158 myIsCycled->setLayoutDirection( Qt::LeftToRight );
159 myIsCycled->setCheckable( true );
160 //myIsCycled->setEnabled( false );
161 aGridLayout->addWidget( myIsCycled, 2, 2, 1, 1 );
163 myTimeStampStrings = new QComboBox( aParent );
164 myTimeStampStrings->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
165 myTimeStampStrings->setFocusPolicy( Qt::StrongFocus );
166 aGridLayout->addWidget( myTimeStampStrings, 2, 3, 1, 2 );
170 aTabWidget->addTab( aParent, tr( "NAVIGATION_TAB" ) );
175 QWidget* aParent = new QWidget();
177 QVBoxLayout* aVBoxLayout = new QVBoxLayout( aParent );
179 QHBoxLayout* aHBoxLayout = new QHBoxLayout();
181 myMinimalMemoryButton = new QRadioButton( tr( "MINIMAL_MEMORY" ), aParent );
182 aHBoxLayout->addWidget( myMinimalMemoryButton );
184 QSpacerItem* aSpacerItem = new QSpacerItem( 16, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
185 aHBoxLayout->addItem( aSpacerItem );
187 myLimitedMemoryButton = new QRadioButton( tr( "LIMITED_MEMORY" ), aParent );
188 myLimitedMemoryButton->setChecked( true );
189 aHBoxLayout->addWidget( myLimitedMemoryButton );
191 myLimitedMemory = new SalomeApp_DoubleSpinBox( aParent );
192 VISU::initSpinBox( myLimitedMemory, 0., 10000., 1., "memory_precision" );
193 myLimitedMemory->setValue( 512 );
194 aHBoxLayout->addWidget( myLimitedMemory );
196 QLabel* aMemoryDimensionLabel = new QLabel( aParent );
197 aMemoryDimensionLabel->setText( tr( "MEMORY_UNITS" ) );
198 aHBoxLayout->addWidget( aMemoryDimensionLabel );
200 aVBoxLayout->addLayout( aHBoxLayout );
203 QHBoxLayout* aHBoxLayout = new QHBoxLayout();
205 QLabel* aUsedMemoryLabel = new QLabel( tr( "USED_BY_CACHE" ), aParent );
206 aUsedMemoryLabel->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
207 aHBoxLayout->addWidget( aUsedMemoryLabel );
209 myUsedMemory = new QLineEdit( aParent );
210 myUsedMemory->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed );
211 //myUsedMemory->setEnabled( false );
212 aHBoxLayout->addWidget( myUsedMemory );
214 QSpacerItem* aSpacerItem = new QSpacerItem( 16, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
215 aHBoxLayout->addItem( aSpacerItem );
217 QLabel* aFreeMemoryLabel = new QLabel( tr( "AVAILABLE_MEMORY" ), aParent );
218 aHBoxLayout->addWidget( aFreeMemoryLabel );
220 myFreeMemory = new QLineEdit( aParent );
221 myFreeMemory->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed );
222 //myFreeMemory->setEnabled( false );
223 aHBoxLayout->addWidget( myFreeMemory );
225 aVBoxLayout->addLayout( aHBoxLayout );
228 QHBoxLayout* aHBoxLayout = new QHBoxLayout();
230 QLabel* aLabel = new QLabel( tr( "SPEED" ), aParent );
231 aLabel->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
232 aHBoxLayout->addWidget( aLabel );
234 mySpeedSlider = new QSlider( aParent );
235 mySpeedSlider->setMinimum( 1 );
236 mySpeedSlider->setMaximum( 100 );
237 mySpeedSlider->setValue( mySpeedSlider->maximum() / 2 );
238 mySpeedSlider->setPageStep( mySpeedSlider->maximum() / 5 );
239 mySpeedSlider->setTickInterval( mySpeedSlider->pageStep() );
240 mySpeedSlider->setOrientation( Qt::Horizontal );
241 mySpeedSlider->setTickPosition( QSlider::TicksBelow );
242 aHBoxLayout->addWidget( mySpeedSlider );
244 aVBoxLayout->addLayout( aHBoxLayout );
247 aTabWidget->addTab( aParent, tr( "PROPERTIES_TAB" ) );
252 QSpacerItem* aSpacerItem = new QSpacerItem( 16, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
253 aVBoxLayout->addItem( aSpacerItem );
257 //----------------------------------------------------------------------------
258 myPlayPixmap = aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PLAY" ) );
259 myPausePixmap = aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PAUSE" ) );
261 myTimer = new QTimer( this );
264 connect( theModule, SIGNAL( moduleDeactivated() ), SLOT( onModuleDeactivated() ) );
266 connect( theModule, SIGNAL( moduleActivated() ), SLOT( onModuleActivated() ) );
268 connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ), SLOT( onSelectionChanged() ) );
270 connect( myTimeStampStrings, SIGNAL( activated( int ) ), SLOT( onTimeStampActivated( int ) ) );
271 connect( myTimeStampIndexes, SIGNAL( activated( int ) ), SLOT( onTimeStampActivated( int ) ) );
273 connect( myFirstButton, SIGNAL( clicked() ), SLOT( onFirst() ) );
274 connect( myPreviousButton, SIGNAL( clicked() ), SLOT( onPrevious() ) );
275 connect( myPlayButton, SIGNAL( toggled( bool ) ), SLOT( onPlay( bool ) ) );
276 connect( myNextButton, SIGNAL( clicked() ), SLOT( onNext() ) );
277 connect( myLastButton, SIGNAL( clicked() ), SLOT( onLast() ) );
279 connect( mySlider, SIGNAL( valueChanged( int ) ), SLOT( onValueChanged( int ) ) );
281 connect( mySpeedSlider, SIGNAL( valueChanged( int ) ), SLOT( onSpeedChanged( int ) ) );
283 connect( myTimer, SIGNAL( timeout() ), SLOT( onTimeout() ) );
285 //----------------------------------------------------------------------------
286 connect( myLimitedMemoryButton, SIGNAL( toggled( bool ) ), this, SLOT( onMemoryModeChanged( bool ) ) );
287 connect( myLimitedMemory, SIGNAL( valueChanged( double ) ), this, SLOT( onMemorySizeChanged( double ) ) );
289 //----------------------------------------------------------------------------
290 enableControls( false );
292 QtxDockWidget* aQtxDockWidget = new QtxDockWidget( true, theParent );
293 theParent->addDockWidget( Qt::BottomDockWidgetArea , aQtxDockWidget );
294 aQtxDockWidget->setObjectName( objectName() );
295 aQtxDockWidget->setWidget( this );
297 myToggleViewAction = aQtxDockWidget->toggleViewAction();
298 myToggleViewAction->setIcon( QIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PANEL" ) ) ) );
299 myToggleViewAction->setToolTip( tr( "MEN_SLIDER_PANE" ) );
300 myToggleViewAction->setText( tr( "MEN_SLIDER_PANE" ) );
301 myToggleViewAction->setCheckable( true );
302 aQtxDockWidget->setVisible( false );
304 connect( myToggleViewAction, SIGNAL( toggled( bool ) ), this, SLOT( onToggleView( bool ) ) );
308 //----------------------------------------------------------------------------
309 VisuGUI_Slider::~VisuGUI_Slider()
314 //----------------------------------------------------------------------------
315 QAction* VisuGUI_Slider::toggleViewAction()
317 return myToggleViewAction;
321 //----------------------------------------------------------------------------
322 void VisuGUI_Slider::onModuleDeactivated()
328 //----------------------------------------------------------------------------
329 void VisuGUI_Slider::onModuleActivated()
335 //----------------------------------------------------------------------------
336 void VisuGUI_Slider::onMemoryModeChanged( bool )
338 using namespace VISU;
339 SALOMEDS::Study_var aStudy = GetDSStudy( GetCStudy( GetAppStudy( myModule ) ) );
340 VISU::ColoredPrs3dCache_var aCache = GetVisuGen( myModule )->GetColoredPrs3dCache( aStudy );
342 if ( myLimitedMemoryButton->isChecked() ) {
343 aCache->SetMemoryMode( VISU::ColoredPrs3dCache::LIMITED );
344 aCache->SetLimitedMemory( myLimitedMemory->value() );
346 aCache->SetMemoryMode( VISU::ColoredPrs3dCache::MINIMAL );
348 myLimitedMemory->setEnabled( myLimitedMemoryButton->isChecked() );
352 //----------------------------------------------------------------------------
353 void VisuGUI_Slider::onMemorySizeChanged( double )
355 onMemoryModeChanged( myLimitedMemoryButton->isChecked() );
359 //----------------------------------------------------------------------------
360 bool VisuGUI_Slider::checkHolderList()
362 THolderList aHolderList;
363 THolderList::const_iterator anIter = myHolderList.begin();
364 THolderList::const_iterator anIterEnd = myHolderList.end();
365 for(; anIter != anIterEnd; anIter++){
366 VISU::ColoredPrs3dHolder_var aHolder = *anIter;
367 if(!aHolder->_non_existent())
368 aHolderList.push_back(aHolder);
370 myHolderList.swap(aHolderList);
371 return myHolderList.empty();
375 //----------------------------------------------------------------------------
376 void VisuGUI_Slider::enableControls( bool on )
378 myPlayTab->setEnabled( on );
382 if( checkHolderList() )
385 myTimeStampStrings->clear();
386 myTimeStampIndexes->clear();
388 VISU::ColoredPrs3dHolder_var aHolder = myHolderList.front();
390 VISU::ColoredPrs3dHolder::TimeStampsRange_var aTimeStampsRange = aHolder->GetTimeStampsRange();
391 CORBA::Long aLength = aTimeStampsRange->length();
393 VISU::ColoredPrs3dHolder::BasicInput_var anInput = aHolder->GetBasicInput();
394 CORBA::Long aTimeStampNumber = anInput->myTimeStampNumber;
396 myFirstTimeStamp->setText( aTimeStampsRange[0].myTime.in() );
397 myLastTimeStamp->setText( aTimeStampsRange[aLength-1].myTime.in() );
399 int aPageStep = aLength / 10;
400 aPageStep = std::max(aPageStep, 1);
401 mySlider->setPageStep(aPageStep);
403 CORBA::Long a_current_index = 0;
404 for( CORBA::Long an_index = 0; an_index < aLength; an_index++ )
406 VISU::ColoredPrs3dHolder::TimeStampInfo anInfo = aTimeStampsRange[ an_index ];
407 CORBA::Long aNumber = anInfo.myNumber;
408 QString aTime = anInfo.myTime.in();
410 myTimeStampStrings->addItem( aTime );
411 myTimeStampIndexes->addItem( QString::number( aNumber ) );
413 if( aNumber == aTimeStampNumber )
414 a_current_index = an_index;
416 // work around - to update controls' sizes
417 myTimeStampStrings->setFont(myTimeStampStrings->font());
418 myTimeStampStrings->updateGeometry();
420 myTimeStampIndexes->setFont(myTimeStampStrings->font());
421 myTimeStampIndexes->updateGeometry();
423 if( a_current_index > mySlider->maximum() )
424 mySlider->setMaximum( aLength-1 );
426 myTimeStampStrings->setCurrentIndex( a_current_index );
427 myTimeStampIndexes->setCurrentIndex( a_current_index );
428 mySlider->setValue( a_current_index );
430 if( a_current_index <= mySlider->maximum() )
431 mySlider->setMaximum( aLength-1 );
433 using namespace VISU;
434 SALOMEDS::Study_var aStudy = GetDSStudy( GetCStudy( GetAppStudy( myModule ) ) );
435 VISU::ColoredPrs3dCache_var aCache = GetVisuGen( myModule )->GetColoredPrs3dCache( aStudy );
437 long aMb = 1024 * 1024;
438 double aLimitedMemory = aCache->GetLimitedMemory();
439 myLimitedMemory->setValue( aLimitedMemory );
441 double aFreeMemory = (double)VISU_PipeLine::GetAvailableMemory( 2048 * aMb ) / (double)aMb;
442 double anUsedMemory = aCache->GetMemorySize();
443 double aLimitedMemoryMax = max( anUsedMemory + aFreeMemory, aLimitedMemory );
444 myLimitedMemory->setMaximum( aLimitedMemoryMax );
448 myPlayButton->setChecked( false );
454 //----------------------------------------------------------------------------
455 void VisuGUI_Slider::updateMemoryState()
457 if( checkHolderList() )
460 VISU::ColoredPrs3dHolder_var aHolder = myHolderList.front();
461 VISU::ColoredPrs3dCache_var aCache = aHolder->GetCache();
463 CORBA::Float aCacheMemory = aCache->GetMemorySize();
464 myUsedMemory->setText( QString::number( double( aCacheMemory ), 'E', 2 ) + " Mb" );
465 myUsedMemory->setFont( myUsedMemory->font() );
466 myUsedMemory->updateGeometry();
469 long aMb = 1024 * 1024;
470 double aFreeMemory = (double)VISU_PipeLine::GetAvailableMemory( 2048 * aMb ) / (double)aMb;
471 myFreeMemory->setText( QString::number( double( aFreeMemory ), 'E', 2 ) + " Mb" );
472 myFreeMemory->setFont( myFreeMemory->font() );
473 myFreeMemory->updateGeometry();
477 //----------------------------------------------------------------------------
478 void VisuGUI_Slider::onSelectionChanged()
480 //cout << "VisuGUI_Slider::onSelectionChanged()" << endl;
481 myHolderList.clear();
483 _PTR(SObject) aSObject;
485 SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>
486 (SUIT_Session::session()->activeApplication());
488 SALOME_ListIO aListIO;
489 mySelectionMgr->selectedObjects(aListIO);
490 SALOME_ListIteratorOfListIO anIter(aListIO);
491 for(; anIter.More(); anIter.Next() ){
492 Handle(SALOME_InteractiveObject) anIO = anIter.Value();
493 if (anIO->hasEntry()) {
494 SalomeApp_Study* theStudy = dynamic_cast<SalomeApp_Study*>(anApp->activeStudy());
495 _PTR(Study) aStudy = theStudy->studyDS();
496 aSObject = aStudy->FindObjectID(anIO->getEntry());
499 CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObject);
500 if (!CORBA::is_nil(anObject)) {
501 VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(anObject);
503 if(!CORBA::is_nil(aHolder))
505 //cout << "ColoredPrs3dHolder" << endl;
506 myHolderList.push_back(aHolder);
513 VISU::View_var aView = myViewManager->GetCurrentView();
515 enableControls( !checkHolderList() && !CORBA::is_nil( aView.in() ) );
521 //----------------------------------------------------------------------------
522 void VisuGUI_Slider::onTimeStampActivated( int value )
524 mySlider->setValue( value );
525 onValueChanged( value );
529 //----------------------------------------------------------------------------
530 void VisuGUI_Slider::onFirst()
532 int value = mySlider->minimum();
533 mySlider->setValue( value );
537 //----------------------------------------------------------------------------
538 void VisuGUI_Slider::onPrevious()
540 int value = mySlider->value() - 1;
541 if( value >= mySlider->minimum() )
542 mySlider->setValue( value );
546 //----------------------------------------------------------------------------
547 void VisuGUI_Slider::onPlay( bool on )
551 myPlayButton->setIcon( myPausePixmap );
553 int delay = int( 50.0 * mySpeedSlider->maximum() / mySpeedSlider->value() );
554 myTimer->start( delay );
559 myPlayButton->setIcon( myPlayPixmap );
564 //----------------------------------------------------------------------------
565 void VisuGUI_Slider::onToggleView( bool on )
573 //----------------------------------------------------------------------------
574 void VisuGUI_Slider::onNext()
576 int value = mySlider->value() + 1;
577 if( value <= mySlider->maximum() )
578 mySlider->setValue( value );
582 //----------------------------------------------------------------------------
583 void VisuGUI_Slider::onLast()
585 int value = mySlider->maximum();
586 mySlider->setValue( value );
590 //----------------------------------------------------------------------------
591 void VisuGUI_Slider::onValueChanged( int value )
593 if ( checkHolderList() ) {
594 enableControls( false );
598 myTimeStampStrings->setCurrentIndex( value );
599 myTimeStampIndexes->setCurrentIndex( value );
601 VISU::ColoredPrs3dHolder_var aHolder = myHolderList.front();
603 VISU::ColoredPrs3dHolder::TimeStampsRange_var aTimeStampsRange = aHolder->GetTimeStampsRange();
604 CORBA::Long aLength = aTimeStampsRange->length();
605 if ( value < 0 || aLength <= value )
608 VISU::ColoredPrs3dHolder::BasicInput_var anInput = aHolder->GetBasicInput();
609 CORBA::Long aTimeStampNumber = anInput->myTimeStampNumber;
610 CORBA::Long aNumber = aTimeStampsRange[ value ].myNumber;
611 if ( aNumber == aTimeStampNumber )
614 VISU::View_var aView = myViewManager->GetCurrentView();
615 if ( CORBA::is_nil( aView.in() ) ) {
616 enableControls( false );
620 VISU::View3D_var aView3D = VISU::View3D::_narrow( aView );
622 THolderList::const_iterator anIter = myHolderList.begin();
623 THolderList::const_iterator anIterEnd = myHolderList.end();
624 for( ; anIter != anIterEnd; anIter++ )
626 VISU::ColoredPrs3dHolder_var aHolder = *anIter;
627 if( CORBA::is_nil( aHolder.in() ) )
630 VISU::ColoredPrs3d_var aPrs3d = aHolder->GetDevice();
631 VISU::ColoredPrs3dHolder::BasicInput_var anInput = aHolder->GetBasicInput();
632 anInput->myTimeStampNumber = aNumber;
634 QApplication::setOverrideCursor(Qt::WaitCursor);
636 aHolder->Apply( aPrs3d, anInput, aView3D );
638 QApplication::restoreOverrideCursor();
641 aView3D->UnRegister();
647 //----------------------------------------------------------------------------
648 void VisuGUI_Slider::onSpeedChanged( int value )
650 if(myPlayButton->isChecked()){
651 int delay = int( 50.0 * mySpeedSlider->maximum() / mySpeedSlider->value() );
652 myTimer->start( delay );
657 //----------------------------------------------------------------------------
658 void VisuGUI_Slider::onTimeout()
660 int value = mySlider->value();
661 if ( value < mySlider->maximum() ) {
664 if ( myIsCycled->isChecked() )
667 myPlayButton->setChecked( false );
672 //----------------------------------------------------------------------------