Attached Files | VCRSTopPatch.diff [^] (5,540 bytes) 2009-05-14 14:24 [Show Content] [Hide Content]Index: Applications/Client/MainWindow.cxx
===================================================================
--- Applications/Client/MainWindow.cxx (revision 3998)
+++ Applications/Client/MainWindow.cxx (working copy)
@@ -394,6 +394,11 @@
connect(this->Implementation->UI.actionVCRPlay, SIGNAL(triggered()),
&this->Implementation->Core.VCRController(), SLOT(onPlay()));
+ connect(this->Implementation->UI.actionVCRStop, SIGNAL(triggered()),
+ &this->Implementation->Core.VCRController(), SLOT(onStop()));
+
+
+
connect(this->Implementation->UI.actionVCRFirstFrame,
SIGNAL(triggered()), &this->Implementation->Core.VCRController(), SLOT(onFirstFrame()));
@@ -429,6 +434,9 @@
connect(vcrcontroller, SIGNAL(playing(bool)),
this, SLOT(onPlaying(bool)));
+ //Stop button not visible until playing
+ this->Implementation->UI.actionVCRStop->setVisible(false);
+
pqProgressManager* progress_manager =
pqApplicationCore::instance()->getProgressManager();
progress_manager->addNonBlockableObject(
@@ -1755,12 +1763,16 @@
&this->Implementation->Core.VCRController(), SLOT(onPlay()));
connect(this->Implementation->UI.actionVCRPlay, SIGNAL(triggered()),
&this->Implementation->Core.VCRController(), SLOT(onPause()));
+
+ this->Implementation->UI.actionVCRStop->setVisible(true);
+
this->Implementation->UI.actionVCRPlay->setIcon(
QIcon(":/pqWidgets/Icons/pqVcrPause24.png"));
this->Implementation->UI.actionVCRPlay->setText("Pa&use");
}
else
{
+ this->Implementation->UI.actionVCRStop->setVisible(false);
connect(this->Implementation->UI.actionVCRPlay, SIGNAL(triggered()),
&this->Implementation->Core.VCRController(), SLOT(onPlay()));
disconnect(this->Implementation->UI.actionVCRPlay, SIGNAL(triggered()),
Index: Applications/Client/MainWindow.ui
===================================================================
--- Applications/Client/MainWindow.ui (revision 3998)
+++ Applications/Client/MainWindow.ui (working copy)
@@ -313,6 +313,7 @@
<addaction name="actionVCRFirstFrame" />
<addaction name="actionVCRPreviousFrame" />
<addaction name="actionVCRPlay" />
+ <addaction name="actionVCRStop" />
<addaction name="actionVCRNextFrame" />
<addaction name="actionVCRLastFrame" />
<addaction name="actionVCRLoop" />
@@ -1614,6 +1615,15 @@
<string>Restore Toolbars</string>
</property>
</action>
+ <action name="actionVCRStop" >
+ <property name="icon" >
+ <iconset resource="../../Qt/Components/Resources/pqComponents.qrc" >
+ <normaloff>:/pqWidgets/Icons/pqCancel24.png</normaloff>:/pqWidgets/Icons/pqCancel24.png</iconset>
+ </property>
+ <property name="text" >
+ <string>Stop</string>
+ </property>
+ </action>
</widget>
<resources>
<include location="../../Qt/Components/Resources/pqComponents.qrc" />
Index: Qt/Components/pqVCRController.cxx
===================================================================
--- Qt/Components/pqVCRController.cxx (revision 3987)
+++ Qt/Components/pqVCRController.cxx (working copy)
@@ -172,6 +172,19 @@
this->Scene->getProxy()->InvokeCommand("Pause");
}
+
+//-----------------------------------------------------------------------------
+void pqVCRController::onStop()
+{
+ if (!this->Scene)
+ {
+ qDebug() << "No active scene. Cannot play.";
+ return;
+ }
+
+ this->Scene->getProxy()->InvokeCommand("Stop");
+
+}
//-----------------------------------------------------------------------------
void pqVCRController::onFirstFrame()
Index: Qt/Components/pqVCRController.h
===================================================================
--- Qt/Components/pqVCRController.h (revision 3987)
+++ Qt/Components/pqVCRController.h (working copy)
@@ -93,6 +93,7 @@
void onNextFrame();
void onLastFrame();
void onPlay();
+ void onStop();
void onPause();
void onLoop(bool checked);
Index: Servers/Filters/vtkAnimationPlayer.cxx
===================================================================
--- Servers/Filters/vtkAnimationPlayer.cxx (revision 3998)
+++ Servers/Filters/vtkAnimationPlayer.cxx (working copy)
@@ -28,6 +28,7 @@
this->CurrentTime = 0;
this->StopPlay = false;
this->Loop = false;
+ this->FullStop = false;
}
//----------------------------------------------------------------------------
@@ -57,14 +58,19 @@
double endtime = this->AnimationScene->GetEndTime();
this->CurrentTime = this->AnimationScene->GetSceneTime();
- this->CurrentTime = (this->CurrentTime < starttime ||
- this->CurrentTime >= endtime)? starttime : this->CurrentTime;
+
+ this->CurrentTime = (this->CurrentTime < starttime ||
+ this->CurrentTime >= endtime ||
+ this->FullStop)? starttime : this->CurrentTime;
this->InPlay = true;
this->StopPlay = false;
-
+ this->FullStop = false;
+
do
{
+
+
this->StartLoop(starttime, endtime, this->CurrentTime);
this->AnimationScene->Initialize();
double deltatime = 0.0;
@@ -101,6 +107,7 @@
{
if (this->InPlay)
{
+ this->FullStop = true;
this->StopPlay = true;
}
}
Index: Servers/Filters/vtkAnimationPlayer.h
===================================================================
--- Servers/Filters/vtkAnimationPlayer.h (revision 3998)
+++ Servers/Filters/vtkAnimationPlayer.h (working copy)
@@ -96,6 +96,7 @@
bool InPlay;
bool StopPlay;
bool Loop;
+ bool FullStop;
double CurrentTime;
//ETX
|