#include "SVTK_Renderer.h"
#include "SVTK_RenderWindowInteractor.h"
-#include "SVTK_Selector.h"
+
+#include "VTKViewer_Algorithm.h"
+#include "SVTK_Functor.h"
+
#include "SALOME_ListIteratorOfListIO.hxx"
#include "VISU_Actor.h"
/*!
Constructor
*/
-VisuGUI_Slider::VisuGUI_Slider( VVTK_MainWindow* parent )
- : QtxDockWindow( InDock, parent ),
- myMainWindow( parent )
+VisuGUI_Slider::VisuGUI_Slider( VVTK_ViewWindow* theViewWondow,
+ LightApp_SelectionMgr* theSelectionMgr )
+ : QtxDockWindow( InDock, theViewWondow->getMainWindow1() ),
+ myMainWindow( theViewWondow->getMainWindow1() ),
+ mySelectionMgr( theSelectionMgr )
{
//SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
new QLabel( tr( "SPEED" ), aBottomBox );
mySpeedBox = new QSpinBox( 1, 100, 1, aBottomBox );
- mySpeedBox->setValue( 10 );
+ mySpeedBox->setValue( 50 );
myAVIBox = new QCheckBox( tr( "AVI" ), aBottomBox );
myAVIBox->setEnabled( false );
aLayout->addWidget( aTopBox );
aLayout->addWidget( aBottomBox );
+ connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ), SLOT( onSelectionChanged() ) );
+
connect( myTimeStampStrings, SIGNAL( activated( int ) ), SLOT( onTimeStampActivated( int ) ) );
connect( myTimeStampIndices, SIGNAL( activated( int ) ), SLOT( onTimeStampActivated( int ) ) );
connect( myTimer, SIGNAL( timeout() ), SLOT( onTimeout() ) );
enableControls( false );
+
+ myMainWindow->addDockWindow( this, Qt::DockBottom );
}
/*!
{
}
-void VisuGUI_Slider::addToWindow( VVTK_MainWindow* theMainWindow )
-{
- theMainWindow->addDockWindow( this, Qt::DockBottom );
-
- connect( theMainWindow->GetInteractor(), SIGNAL( selectionChanged() ),
- SLOT( onSelectionChanged() ) );
-}
-
void VisuGUI_Slider::enableControls( bool on )
{
myTimeStampStrings->clear();
VISU::ColoredPrs3d_i* aPrs = myPrsList[0];
CORBA::Long aTimeStampNumber = aPrs->GetTimeStampNumber();
- VISU::ColoredPrs3d::TimeStampsRange aTimeStampsRange = *(aPrs->GetTimeStampsRange());
- CORBA::Long aLength = aTimeStampsRange.length();
+ VISU::ColoredPrs3d::TimeStampsRange_var aTimeStampsRange = aPrs->GetTimeStampsRange();
+ CORBA::Long aLength = aTimeStampsRange->length();
mySlider->setMinValue( 0 );
mySlider->setMaxValue( aLength-1 );
void VisuGUI_Slider::onSelectionChanged()
{
- //cout << "VisuGUI_Slider::onSelectionChanged" << endl;
-
myPrsList.resize(0);
- SVTK_Selector* aSelector = myMainWindow->GetSelector();
- const SALOME_ListIO& aListIO = aSelector->StoredIObjects();
+ SALOME_ListIO aListIO;
+ mySelectionMgr->selectedObjects(aListIO);
SALOME_ListIteratorOfListIO anIter( aListIO );
+ vtkActorCollection* anActorCollection = myMainWindow->getRenderer()->GetActors();
for( int k = 0; anIter.More(); anIter.Next() )
{
- if( VISU_Actor* anActor = dynamic_cast<VISU_Actor*>( aSelector->GetActor( anIter.Value() ) ) )
+ VISU_Actor* anActor =
+ SVTK::Find<VISU_Actor>(anActorCollection, SVTK::TIsSameIObject<VISU_Actor>(anIter.Value()));
+ if( anActor )
{
if( !anActor->GetVisibility() )
continue;
if( VISU::ColoredPrs3d_i* aPrs = dynamic_cast<VISU::ColoredPrs3d_i*>( anActor->GetPrs3d() ) )
{
- CORBA::Long aTimeStampNumber = aPrs->GetTimeStampNumber();
- VISU::ColoredPrs3d::TimeStampsRange aTimeStampsRange = *(aPrs->GetTimeStampsRange());
- CORBA::Long aLength = aTimeStampsRange.length();
- if( aLength > 1 )
+ if( !aPrs->IsTimeStampFixed() )
{
//cout << "ColoredPrs3d" << endl;
myPrsList.resize(k+1);
{
myPlayButton->setText( "||" );
- double delay = 5000.0 / ( double )mySpeedBox->value();
+ int delay = int(5000.0 / double(mySpeedBox->value()));
myTimer->start( delay );
}
else
myTimeStampIndices->setCurrentItem( value );
VISU::ColoredPrs3d_i* aPrs = myPrsList[0];
- VISU::ColoredPrs3d::TimeStampsRange aTimeStampsRange = *(aPrs->GetTimeStampsRange());
+ VISU::ColoredPrs3d::TimeStampsRange_var aTimeStampsRange = aPrs->GetTimeStampsRange();
CORBA::Long aNumber = aTimeStampsRange[ value ].myNumber;
for( int i = 0, n = myPrsList.size(); i < n; i++ )
#define VisuGUI_Slider_HeaderFile
#include "VisuGUI.h"
-
-#include "QtxDockWindow.h"
-
#include "VISU_ColoredPrs3d_i.hh"
+#include "VVTK_ViewWindow.h"
+#include "LightApp_SelectionMgr.h"
+#include "QtxDockWindow.h"
typedef std::vector<VISU::ColoredPrs3d_i*> PrsList;
class QTimer;
class VVTK_MainWindow;
+class LightApp_SelectionMgr;
class VisuGUI_Slider : public QtxDockWindow
{
enum { First = 0, Previous, Next, Last };
public:
- VisuGUI_Slider( VVTK_MainWindow* );
+ VisuGUI_Slider( VVTK_ViewWindow* theViewWondow,
+ LightApp_SelectionMgr* theSelectionMgr );
virtual ~VisuGUI_Slider();
public:
- virtual void addToWindow( VVTK_MainWindow* );
virtual void enableControls( bool );
private:
VVTK_MainWindow* myMainWindow;
+ LightApp_SelectionMgr* mySelectionMgr;
QSlider* mySlider;
QLabel* myFirstTimeStamp;