Commit 90944d08 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit
Browse files

COMP: reverting patch...will commit it with rest of the changes for this fix.

parent af902085
......@@ -17,7 +17,7 @@
#include "vtkObjectFactory.h"
#include "vtkCommand.h"
vtkCxxRevisionMacro(vtkAnimationCue, "1.6");
vtkCxxRevisionMacro(vtkAnimationCue, "1.7");
vtkStandardNewMacro(vtkAnimationCue);
//----------------------------------------------------------------------------
......@@ -28,7 +28,6 @@ vtkAnimationCue::vtkAnimationCue()
this->TimeMode = TIMEMODE_RELATIVE;
this->AnimationTime = 0;
this->DeltaTime = 0;
this->ClockTime = 0;
}
//----------------------------------------------------------------------------
......@@ -44,7 +43,6 @@ void vtkAnimationCue::StartCueInternal()
info.EndTime = this->EndTime;
info.AnimationTime = 0.0;
info.DeltaTime = 0.0;
info.ClockTime = 0.0;
this->InvokeEvent(vtkCommand::StartAnimationCueEvent, &info);
}
......@@ -56,35 +54,30 @@ void vtkAnimationCue::EndCueInternal()
info.EndTime = this->EndTime;
info.AnimationTime = this->EndTime;
info.DeltaTime = 0.0;
info.ClockTime = 0.0;
this->InvokeEvent(vtkCommand::EndAnimationCueEvent, &info);
}
//----------------------------------------------------------------------------
void vtkAnimationCue::TickInternal(
double currenttime, double deltatime, double clocktime)
void vtkAnimationCue::TickInternal(double currenttime, double deltatime)
{
vtkAnimationCue::AnimationCueInfo info;
info.StartTime = this->StartTime;
info.EndTime = this->EndTime;
info.DeltaTime = deltatime;
info.AnimationTime = currenttime;
info.ClockTime =clocktime;
this->AnimationTime = currenttime;
this->DeltaTime = deltatime;
this->ClockTime = clocktime;
this->InvokeEvent(vtkCommand::AnimationCueTickEvent, &info);
this->AnimationTime = 0;
this->DeltaTime = 0;
this->ClockTime = 0;
}
//----------------------------------------------------------------------------
void vtkAnimationCue::Tick(double currenttime, double deltatime, double clocktime)
void vtkAnimationCue::Tick(double currenttime, double deltatime)
{
// Check to see if we have crossed the Cue start.
if (currenttime >= this->StartTime &&
......@@ -100,7 +93,7 @@ void vtkAnimationCue::Tick(double currenttime, double deltatime, double clocktim
{
if (currenttime <= this->EndTime)
{
this->TickInternal(currenttime, deltatime, clocktime);
this->TickInternal(currenttime, deltatime);
}
if (currenttime >= this->EndTime)
{
......@@ -142,5 +135,4 @@ void vtkAnimationCue::PrintSelf(ostream& os, vtkIndent indent)
os << indent << "TimeMode: " << this->TimeMode << endl;
os << indent << "AnimationTime: " << this->AnimationTime << endl;
os << indent << "DeltaTime: " << this->DeltaTime << endl;
os << indent << "ClockTime: " << this->ClockTime << endl;
}
......@@ -57,9 +57,8 @@ public:
public:
double StartTime;
double EndTime;
double AnimationTime;// valid only in AnimationCueTickEvent handler
double DeltaTime; // valid only in AnimationCueTickEvent handler
double ClockTime; // valid only in AnimationCueTickEvent handler
double AnimationTime;// valid only on AnimationCueTickEvent
double DeltaTime; // valid only on AnimationCueTickEvent
};
//ETX
......@@ -112,11 +111,9 @@ public:
// deltatime is the time since last call to Tick. deltatime also can be in seconds
// relative to the start of the container Scene or normalized depending upon the
// cue's Time mode.
// clocktime is the time from the scene i.e. it does not depend on the time
// mode for the cue.
// For the first call to Tick
// after a call to Initialize(), the deltatime is 0;
virtual void Tick(double currenttime, double deltatime, double clocktime);
virtual void Tick(double currenttime, double deltatime);
// Description:
// Called when the playing of the scene begins.
......@@ -140,14 +137,6 @@ public:
// Before firing the event the animation cue sets the DeltaTime
// to the difference in time between the current tick and the last tick.
vtkGetMacro(DeltaTime, double);
// Description:
// This is valid only in a AnimationCueTickEvent handler.
// Before firing the event the animation cue sets the ClockTime to
// the time of the tick. ClockTime is directly the time from the animation
// scene neither normalized nor offsetted to the start of the scene.
vtkGetMacro(ClockTime, double);
//BTX
enum TimeCodes
{
......@@ -174,7 +163,6 @@ protected:
// the AnimationCueInfo struct in wrapped languages.
double AnimationTime;
double DeltaTime;
double ClockTime;
// Description:
// Current state of the Cue.
......@@ -185,8 +173,7 @@ protected:
// corresponding events. Subclasses can override these to
// do extra processing at start/end or on tick.
virtual void StartCueInternal();
virtual void TickInternal(double currenttime, double deltatime,
double clocktime);
virtual void TickInternal(double currenttime, double deltatime);
virtual void EndCueInternal();
private:
......
......@@ -20,7 +20,7 @@
#include "vtkObjectFactory.h"
#include "vtkTimerLog.h"
vtkCxxRevisionMacro(vtkAnimationScene, "1.13");
vtkCxxRevisionMacro(vtkAnimationScene, "1.14");
vtkStandardNewMacro(vtkAnimationScene);
//----------------------------------------------------------------------------
......@@ -179,7 +179,7 @@ void vtkAnimationScene::Play()
double deltatime = 0.0;
do
{
this->Tick(currenttime, deltatime, currenttime);
this->Tick(currenttime, deltatime);
// needed to compute delta times.
double previous_tick_time = currenttime;
......@@ -227,11 +227,9 @@ void vtkAnimationScene::Stop()
}
//----------------------------------------------------------------------------
void vtkAnimationScene::TickInternal(
double currenttime, double deltatime, double clocktime)
void vtkAnimationScene::TickInternal(double currenttime, double deltatime)
{
this->AnimationTime = currenttime;
this->ClockTime = clocktime;
vtkCollectionIterator* iter = this->AnimationCuesIterator;
for (iter->InitTraversal(); !iter->IsDoneWithTraversal(); iter->GoToNextItem())
......@@ -243,21 +241,18 @@ void vtkAnimationScene::TickInternal(
switch(cue->GetTimeMode())
{
case vtkAnimationCue::TIMEMODE_RELATIVE:
cue->Tick(currenttime - this->StartTime, deltatime, clocktime);
cue->Tick(currenttime - this->StartTime, deltatime);
break;
case vtkAnimationCue::TIMEMODE_NORMALIZED:
cue->Tick( (currenttime - this->StartTime) / (this->EndTime - this->StartTime),
deltatime / (this->EndTime - this->StartTime), clocktime);
deltatime / (this->EndTime - this->StartTime));
break;
default:
vtkErrorMacro("Invalid cue time mode");
}
}
}
this->Superclass::TickInternal(currenttime, deltatime, clocktime);
this->Superclass::TickInternal(currenttime, deltatime);
}
//----------------------------------------------------------------------------
......@@ -283,7 +278,7 @@ void vtkAnimationScene::SetAnimationTime(double currenttime)
return;
}
this->Initialize();
this->Tick(currenttime, 0.0, currenttime);
this->Tick(currenttime,0.0);
if (this->CueState == vtkAnimationCue::INACTIVE)
{
this->Finalize();
......
......@@ -110,7 +110,7 @@ protected:
// Description:
// Called on every valid tick.
// Calls ticks on all the contained cues.
virtual void TickInternal(double currenttime, double deltatime, double clocktime);
virtual void TickInternal(double currenttime, double deltatime);
virtual void StartCueInternal();
virtual void EndCueInternal();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment