TridAnimator Class Reference

#include <TridAnimator.h>

List of all members.

Public Member Functions

 TridAnimator (void)
 TridAnimator (TridControl &tridControl)
virtual ~TridAnimator (void)
Bool_t Animating ()
Double_t GetAnimTimeMin ()
Double_t GetAnimTimeMax ()
Bool_t AnimatingModels ()
Bool_t AnimatingViews ()
Double_t GetViewSpeed ()
Double_t GetViewIncrement ()
Double_t GetRangeMin ()
Double_t GetRangeMax ()
Bool_t Printing ()
Int_t GetFrame ()
void StartAnimation ()
void StopAnimation ()
void SetAnimateModels (bool on=true)
void SetAnimateViews (bool on=true)
void SetViewAnimSpeed (double speed)
void SetTimeRange (double min, double max)
void OpenWindow ()
void ShowConfigFrame (GuiBox &box)
void CloseConfigFrame ()

Private Member Functions

Bool_t HandleTimer (TTimer *timer)
void StartStopHandler ()
void StopAndResetHandler ()
void ParamChangedHandler ()
void ReadFromGui (void)
void UpdateGui (void)
 ClassDef (TridAnimator, 0)

Private Attributes

TridControlfTridControl
TTimer fAnimTimer
Bool_t fAnimating
Double_t fAnimFPS
Bool_t fPrinting
Int_t fFrame
Bool_t fAnimateModels
Bool_t fAnimateViews
Bool_t fUseTimeWindow
RangeDouble fTimeRange
Double_t fAnimSecPerFrame
Double_t fAnimTimeMin
Double_t fAnimTimeMax
Double_t fAnimTimeWindow
Double_t fViewAnimSpeed
SigC::Ptr< GuiMainWindowfMainWindow
SigC::Ptr< GuiTextButtonfButtonStartStop
SigC::Ptr< GuiLabelfLabelAnimTime
SigC::Ptr< GuiLabelfLabelAnimFrame
SigC::Ptr< GuiCheckButtonfButtonAnimateViews
SigC::Ptr< GuiCheckButtonfButtonAnimateModels
SigC::Ptr< GuiCheckButtonfButtonUseTimeWindow
SigC::Ptr< GuiCheckButtonfButtonPrinting
SigC::Ptr< GuiTextEntryfTextEntryFPS
SigC::Ptr< GuiTextEntryfTextEntryViewSpeed
SigC::Ptr< GuiTextEntryfTextEntryTimeWindow
SigC::Ptr< GuiTextEntryfTextEntryTimeRangeStart
SigC::Ptr< GuiTextEntryfTextEntryTimeRangeEnd
SigC::Ptr< GuiTextEntryfTextEntrySecPerFrame

Friends

class TridControl

Detailed Description

Definition at line 18 of file TridAnimator.h.


Constructor & Destructor Documentation

TridAnimator::TridAnimator ( void   ) 

Definition at line 38 of file TridAnimator.cxx.

00038                                 :
00039   fTridControl(NULL),
00040   fAnimating(false),
00041   fAnimFPS(10),
00042   fPrinting(false),
00043   fFrame(0),
00044   fAnimateModels(true),
00045   fAnimateViews(false),
00046   fUseTimeWindow(false),
00047   fTimeRange(0,150),
00048   fAnimSecPerFrame(1e-6),
00049   fAnimTimeMin(-1e99),
00050   fAnimTimeMax( 1e99),
00051   fAnimTimeWindow(1e-6), // ns  
00052   fViewAnimSpeed(0.1)
00053 {
00054 }

TridAnimator::TridAnimator ( TridControl tridControl  ) 

Definition at line 20 of file TridAnimator.cxx.

00020                                                     :
00021   fTridControl(&tridControl),
00022   fAnimating(false),
00023   fAnimFPS(30),
00024   fPrinting(false),
00025   fFrame(0),
00026   fAnimateModels(true),
00027   fAnimateViews(false),
00028   fUseTimeWindow(false),
00029   fTimeRange(0,150),
00030   fAnimSecPerFrame(1e-6), // sec/sec
00031   fAnimTimeMin(-1e99),
00032   fAnimTimeMax( 1e99),
00033   fAnimTimeWindow(1e-6), // sec  
00034   fViewAnimSpeed(0.1)
00035 {
00036 }

TridAnimator::~TridAnimator ( void   )  [virtual]

Definition at line 56 of file TridAnimator.cxx.

References CloseConfigFrame().

00057 {
00058   CloseConfigFrame();
00059 }


Member Function Documentation

Bool_t TridAnimator::Animating (  )  [inline]

Definition at line 28 of file TridAnimator.h.

References fAnimating.

Referenced by TridControl::Animating().

00028 { return fAnimating; };

Bool_t TridAnimator::AnimatingModels (  )  [inline]

Definition at line 31 of file TridAnimator.h.

References fAnimateModels.

Referenced by TridPage::AnimationRedraw(), HandleTimer(), and StartAnimation().

00031 { return fAnimateModels; };

Bool_t TridAnimator::AnimatingViews (  )  [inline]

Definition at line 32 of file TridAnimator.h.

References fAnimateViews.

Referenced by TridControl::AnimatingViews(), and TridPage::AnimationRedraw().

00032 { return fAnimateViews; };

TridAnimator::ClassDef ( TridAnimator  ,
 
) [private]
void TridAnimator::CloseConfigFrame (  ) 
Double_t TridAnimator::GetAnimTimeMax (  )  [inline]

Definition at line 30 of file TridAnimator.h.

References fAnimTimeMax.

Referenced by TridPage::AnimationRedraw(), TridControl::CurrentAnimTimeMax(), and HandleTimer().

00030 { return fAnimTimeMax; }; //if(fUseTimeWindow) return fAnimTime+fAnimTimeWindow; return fAnimTime; };

Double_t TridAnimator::GetAnimTimeMin (  )  [inline]

Definition at line 29 of file TridAnimator.h.

References fAnimTimeMin.

Referenced by TridPage::AnimationRedraw(), TridControl::CurrentAnimTimeMin(), and HandleTimer().

00029 { return fAnimTimeMin; }; //if(fUseTimeWindow) return fAnimTime; return -2e9; };

Int_t TridAnimator::GetFrame (  )  [inline]

Definition at line 38 of file TridAnimator.h.

References fFrame.

Referenced by TridPage::AnimationRedraw(), HandleTimer(), ShowConfigFrame(), and UpdateGui().

00038 { return fFrame; };

Double_t TridAnimator::GetRangeMax (  )  [inline]

Definition at line 36 of file TridAnimator.h.

References fTimeRange, and Range< TYPE >::Max().

00036 { return fTimeRange.Max(); };

Double_t TridAnimator::GetRangeMin (  )  [inline]

Definition at line 35 of file TridAnimator.h.

References fTimeRange, and Range< TYPE >::Min().

Referenced by TridPage::AnimationRedraw().

00035 { return fTimeRange.Min(); };

Double_t TridAnimator::GetViewIncrement (  )  [inline]

Definition at line 34 of file TridAnimator.h.

References fViewAnimSpeed.

Referenced by TridPage::AnimationRedraw(), and TridControl::GetAnimViewIncrement().

00034 { return fViewAnimSpeed; };

Double_t TridAnimator::GetViewSpeed (  )  [inline]

Definition at line 33 of file TridAnimator.h.

References fViewAnimSpeed.

00033 { return fViewAnimSpeed; };

Bool_t TridAnimator::HandleTimer ( TTimer *  timer  )  [private]

Definition at line 80 of file TridAnimator.cxx.

References AnimatingModels(), fAnimating, fAnimFPS, fAnimSecPerFrame, fAnimTimeMax, fAnimTimeMin, fAnimTimer, fAnimTimeWindow, fFrame, TridControl::FireAnimationTrigger(), fLabelAnimFrame, fLabelAnimTime, Form(), fTimeRange, fTridControl, fUseTimeWindow, GetAnimTimeMax(), GetAnimTimeMin(), GetFrame(), Msg::kDebug, Range< TYPE >::Max(), Range< TYPE >::Min(), Munits::ms, MSG, and Munits::ns.

00081 {
00082   if(fAnimating) {
00083     // Change the clock.
00084     fFrame++;
00085     if(fLabelAnimFrame.get()) {
00086       fLabelAnimFrame->SetText(Form("Frame: %d",GetFrame()));
00087       fLabelAnimFrame->Resize(fLabelAnimFrame->GetDefaultSize());
00088     }
00089 
00090     if(AnimatingModels()){
00091 
00092       fAnimTimeMax += fAnimSecPerFrame;
00093       if(fAnimTimeMax>fTimeRange.Max()) fAnimTimeMax = fTimeRange.Min();
00094 
00095       if(fUseTimeWindow) fAnimTimeMin = fAnimTimeMax - fAnimTimeWindow;
00096       else               fAnimTimeMin = -1e99;
00097 
00098       if(fLabelAnimTime.get()) {
00099         fLabelAnimTime->SetText(Form("Time: %5.2f ns to %5.2f ns",GetAnimTimeMin()/Munits::ns, GetAnimTimeMax()/Munits::ns));
00100         fLabelAnimTime->Resize(fLabelAnimTime->GetDefaultSize());
00101       }
00102       MSG("TriD",Msg::kDebug) << "Refresing anim at t="<< fAnimTimeMin << endl;      
00103     } else {
00104       MSG("TriD",Msg::kDebug) << "Refresing views only"<< endl;      
00105     }
00106     // Emit the update call.
00107     Long_t ms = (Long_t)(1000./fAnimFPS);  
00108     fAnimTimer.Start(ms,true);
00109     if(fTridControl) fTridControl->FireAnimationTrigger();
00110   } else {
00111     MSG("TriD",Msg::kDebug) << "Stopping animation." << endl;
00112     fAnimTimer.Stop();
00113     fAnimTimer.TurnOff();
00114     fAnimTimeMin = -1e99;
00115     fAnimTimeMax =  1e99;
00116     if(fTridControl) fTridControl->FireAnimationTrigger();  
00117   }
00118   return true;
00119 }

void TridAnimator::OpenWindow (  ) 

Definition at line 125 of file TridAnimator.cxx.

References CloseConfigFrame(), fMainWindow, GuiBase::GetLayoutHints(), GuiMainWindow::KillMe(), GuiBase::SetLayoutHints(), and ShowConfigFrame().

Referenced by TridControl::TridControl().

00126 {
00127   fMainWindow = manage(new GuiMainWindow(300,500));
00128   fMainWindow->SetWindowName("TriD Animation Control");
00129   fMainWindow->SetLayoutHints( kLHintsTop | kLHintsExpandX);
00130   GuiBox* vbox = manage(new GuiVBox(*fMainWindow));
00131   vbox->SetLayoutHints(vbox->GetLayoutHints() | kLHintsExpandX);
00132   fMainWindow->Add(*vbox);
00133   ShowConfigFrame(*vbox);
00134   fMainWindow->ShowAll();
00135   fMainWindow->ConnectClose();
00136   fMainWindow->Resize(fMainWindow->GetDefaultWidth(),fMainWindow->GetDefaultHeight());
00137   fMainWindow->close_window.connect(SigC::slot(*fMainWindow,&GuiMainWindow::KillMe));
00138   fMainWindow->close_window.connect(SigC::slot_class(*this,&TridAnimator::CloseConfigFrame));
00139 }

void TridAnimator::ParamChangedHandler (  )  [private]

Definition at line 321 of file TridAnimator.cxx.

References ReadFromGui().

Referenced by ShowConfigFrame().

00322 {
00323   ReadFromGui();
00324 }

Bool_t TridAnimator::Printing (  )  [inline]

Definition at line 37 of file TridAnimator.h.

References fPrinting.

Referenced by TridPage::AnimationRedraw().

00037 { return fPrinting; };

void TridAnimator::ReadFromGui ( void   )  [private]

Definition at line 327 of file TridAnimator.cxx.

References fAnimateModels, fAnimateViews, fAnimFPS, fAnimSecPerFrame, fAnimTimeWindow, fButtonAnimateModels, fButtonAnimateViews, fButtonPrinting, fButtonStartStop, fButtonUseTimeWindow, fPrinting, fTextEntryFPS, fTextEntrySecPerFrame, fTextEntryTimeRangeEnd, fTextEntryTimeRangeStart, fTextEntryTimeWindow, fTextEntryViewSpeed, fTimeRange, fUseTimeWindow, fViewAnimSpeed, GetValueFromString(), Range< TYPE >::Max(), Range< TYPE >::Min(), Munits::ns, and Range< TYPE >::Set().

Referenced by ParamChangedHandler(), and StartStopHandler().

00328 {
00329   // Assume that if one widget exists, they all exist.
00330   if(fButtonStartStop.get())   {
00331     fAnimFPS = GetValueFromString(fTextEntryFPS->GetText(),fAnimFPS);
00332     fTimeRange.Set(GetValueFromString(fTextEntryTimeRangeStart->GetText(),fTimeRange.Min()),
00333                    GetValueFromString(fTextEntryTimeRangeEnd  ->GetText(),fTimeRange.Max())
00334                    );
00335                    
00336     fAnimSecPerFrame = GetValueFromString(fTextEntrySecPerFrame->GetText(),fAnimSecPerFrame);
00337     fAnimTimeWindow    = GetValueFromString(fTextEntryTimeWindow->GetText(), fAnimTimeWindow );
00338     fViewAnimSpeed     = GetValueFromString(fTextEntryViewSpeed->GetText(), fViewAnimSpeed);
00339 
00340     // Convert:
00341     fTimeRange.Set(fTimeRange.Min()*Munits::ns,
00342                    fTimeRange.Max()*Munits::ns);
00343     fAnimSecPerFrame*=Munits::ns;
00344     fAnimTimeWindow*=Munits::ns;
00345     
00346     fAnimateModels = (fButtonAnimateModels->GetState() == kButtonDown);
00347     fPrinting      = (fButtonPrinting->GetState() == kButtonDown);
00348     fAnimateViews  = (fButtonAnimateViews->GetState() == kButtonDown);
00349     fUseTimeWindow = (fButtonUseTimeWindow->GetState() == kButtonDown);
00350   }
00351 }

void TridAnimator::SetAnimateModels ( bool  on = true  )  [inline]

Definition at line 43 of file TridAnimator.h.

References fAnimateModels, and UpdateGui().

00043 { fAnimateModels = on; UpdateGui(); };

void TridAnimator::SetAnimateViews ( bool  on = true  )  [inline]

Definition at line 44 of file TridAnimator.h.

References fAnimateViews, and UpdateGui().

00044 { fAnimateViews  = on; UpdateGui(); };

void TridAnimator::SetTimeRange ( double  min,
double  max 
) [inline]

Definition at line 46 of file TridAnimator.h.

References fTimeRange, Range< TYPE >::Set(), and UpdateGui().

00046 { fTimeRange.Set(min,max); UpdateGui(); };

void TridAnimator::SetViewAnimSpeed ( double  speed  )  [inline]

Definition at line 45 of file TridAnimator.h.

References fViewAnimSpeed, and UpdateGui().

00045 { fViewAnimSpeed = speed; UpdateGui(); };

void TridAnimator::ShowConfigFrame ( GuiBox box  ) 

Definition at line 142 of file TridAnimator.cxx.

References GuiCompositeFrameBase::Add(), fAnimating, fAnimFPS, fAnimSecPerFrame, fAnimTimeMin, fAnimTimeWindow, fButtonAnimateModels, fButtonAnimateViews, fButtonPrinting, fButtonStartStop, fButtonUseTimeWindow, fLabelAnimFrame, fLabelAnimTime, Form(), fTextEntryFPS, fTextEntrySecPerFrame, fTextEntryTimeRangeEnd, fTextEntryTimeRangeStart, fTextEntryTimeWindow, fTextEntryViewSpeed, fTimeRange, fViewAnimSpeed, GetFrame(), Range< TYPE >::Max(), Range< TYPE >::Min(), ParamChangedHandler(), GuiBase::SetLayoutHints(), StartStopHandler(), and UpdateGui().

Referenced by OpenWindow().

00143 {
00144   GuiBox& box = *(manage(new GuiBox(inbox,kVerticalFrame)));
00145   inbox.Add(box);
00146 
00147   fButtonStartStop = SigC::manage(new GuiTextButton(box,(fAnimating ? "Stop Animation" : "Start Animation")));
00148   fButtonStartStop->SetLayoutHints(kLHintsCenterX);
00149   box.Add(*fButtonStartStop);  
00150 
00151 
00152   fLabelAnimTime = SigC::manage(new GuiLabel(box,Form("Time: %5.2g ns",fAnimTimeMin)));
00153   fLabelAnimTime->SetLayoutHints(kLHintsExpandX|kLHintsCenterX|kLHintsTop);
00154   fLabelAnimTime->Resize(fLabelAnimTime->GetDefaultSize());
00155   box.Add(*fLabelAnimTime);
00156 
00157   fLabelAnimFrame = SigC::manage(new GuiLabel(box,Form("Frame: %d",GetFrame())));
00158   fLabelAnimFrame->SetLayoutHints(kLHintsExpandX|kLHintsCenterX|kLHintsTop);
00159   fLabelAnimFrame->Resize(fLabelAnimFrame->GetDefaultSize());
00160   box.Add(*fLabelAnimFrame);
00161 
00162   fButtonPrinting  = SigC::manage(new GuiCheckButton(box,"Print Animation:"));
00163   fButtonPrinting->SetLayoutHints(kLHintsLeft|kLHintsTop);
00164   box.Add(*fButtonPrinting);
00165   
00166   {
00167     GuiBox* hbox = manage(new GuiBox(box,kHorizontalFrame));
00168     hbox->SetLayoutHints(kLHintsTop | kLHintsRight);
00169     box.Add(*hbox);
00170       
00171     GuiLabel* glabel = manage(new GuiLabel(*hbox,"Display Rate (fps):"));
00172     hbox->Add(*glabel);
00173     
00174     fTextEntryFPS = SigC::manage(new GuiTextEntry(*hbox,Form("%.1f",fAnimFPS)));
00175     hbox->Add(*fTextEntryFPS);
00176   }
00177     
00178   fButtonAnimateViews  = SigC::manage(new GuiCheckButton(box,"Animate View Angle"));
00179   fButtonAnimateViews->SetLayoutHints(kLHintsLeft|kLHintsTop);
00180   box.Add(*fButtonAnimateViews);
00181 
00182   GuiGroup* viewGroup = SigC::manage(new GuiGroup(box,"View Animation"));
00183   viewGroup->SetLayoutHints(kLHintsTop|kLHintsExpandX);
00184   box.Add(*viewGroup);
00185   {
00186     GuiBox* hbox = manage(new GuiBox(*viewGroup,kHorizontalFrame));
00187     hbox->SetLayoutHints(kLHintsTop | kLHintsRight);
00188     viewGroup->Add(*hbox);
00189     
00190     GuiLabel* glabel = manage(new GuiLabel(*hbox,"View Rotation Rev/frame:"));
00191     hbox->Add(*glabel);
00192 
00193     fTextEntryViewSpeed = SigC::manage(new GuiTextEntry(*hbox,Form("%.3f",fViewAnimSpeed)));
00194     hbox->Add(*fTextEntryViewSpeed);
00195   }
00196   viewGroup->Layout();
00197   viewGroup->Resize(viewGroup->GetDefaultSize());
00198 
00199 
00200   fButtonAnimateModels = SigC::manage(new GuiCheckButton(box,"Animate Event"));
00201   fButtonAnimateModels->SetLayoutHints(kLHintsLeft|kLHintsTop);
00202   box.Add(*fButtonAnimateModels);
00203 
00204   GuiGroup* eventGroup = SigC::manage(new GuiGroup(box,"Event Animation"));
00205   box.Add(*eventGroup);
00206 
00207   fButtonUseTimeWindow = SigC::manage(new GuiCheckButton(*eventGroup,"Use Time Window"));
00208   eventGroup->SetLayoutHints(kLHintsTop|kLHintsExpandX);  
00209   eventGroup->Add(*fButtonUseTimeWindow);
00210   
00211   {
00212     GuiBox* hbox = manage(new GuiBox(*eventGroup,kHorizontalFrame));
00213     hbox->SetLayoutHints(kLHintsTop | kLHintsRight);
00214     eventGroup->Add(*hbox);
00215     
00216     GuiLabel* glabel = manage(new GuiLabel(*hbox,"Time Window (ns):"));
00217     hbox->Add(*glabel);
00218 
00219     fTextEntryTimeWindow = SigC::manage(new GuiTextEntry(*hbox,Form("%.1f",fAnimTimeWindow)));
00220     hbox->Add(*fTextEntryTimeWindow);
00221   }
00222   
00223   {
00224     GuiBox* hbox = manage(new GuiBox(*eventGroup,kHorizontalFrame));
00225     eventGroup->Add(*hbox);
00226     
00227     GuiLabel* glabel = manage(new GuiLabel(*hbox,"From:"));
00228     glabel->SetLayoutHints(kLHintsTop);
00229     hbox->Add(*glabel);
00230 
00231     fTextEntryTimeRangeStart = SigC::manage(new GuiTextEntry(*hbox,Form("%.1f",fTimeRange.Min())));
00232     hbox->Add(*fTextEntryTimeRangeStart);
00233 
00234     GuiLabel* glabel2 = manage(new GuiLabel(*hbox,"To:"));
00235     glabel2->SetLayoutHints(kLHintsTop);
00236     hbox->Add(*glabel2);
00237 
00238     fTextEntryTimeRangeEnd = SigC::manage(new GuiTextEntry(*hbox,Form("%.1f",fTimeRange.Max())));
00239     hbox->Add(*fTextEntryTimeRangeEnd);
00240 
00241     hbox->Layout();
00242   }
00243   
00244   {
00245     GuiBox* hbox = manage(new GuiBox(*eventGroup,kHorizontalFrame));
00246     hbox->SetLayoutHints(kLHintsTop | kLHintsRight);
00247     eventGroup->Add(*hbox);
00248     
00249     GuiLabel* glabel = manage(new GuiLabel(*hbox,"Event Speed (ns/frame):"));
00250     hbox->Add(*glabel);
00251 
00252     fTextEntrySecPerFrame = SigC::manage(new GuiTextEntry(*hbox,Form("%.1f",fAnimSecPerFrame)));
00253     hbox->Add(*fTextEntrySecPerFrame);
00254    
00255     hbox->Layout();
00256   }
00257   eventGroup->Layout();
00258   eventGroup->Resize(eventGroup->GetDefaultSize());
00259 
00260   box.Layout();
00261 
00262   // Setup hit signals.
00263   fButtonStartStop   ->clicked.connect(slot_class(*this,&TridAnimator::StartStopHandler));
00264 
00265   fButtonPrinting     ->clicked.connect(slot_class(*this,&TridAnimator::ParamChangedHandler));
00266   fButtonAnimateViews ->clicked.connect(slot_class(*this,&TridAnimator::ParamChangedHandler));
00267   fButtonAnimateModels->clicked.connect(slot_class(*this,&TridAnimator::ParamChangedHandler));
00268   fButtonUseTimeWindow->clicked.connect(slot_class(*this,&TridAnimator::ParamChangedHandler));
00269   fTextEntryFPS           ->activated.connect(slot_class(*this,&TridAnimator::ParamChangedHandler));
00270   fTextEntryViewSpeed     ->activated.connect(slot_class(*this,&TridAnimator::ParamChangedHandler));
00271   fTextEntryTimeWindow    ->activated.connect(slot_class(*this,&TridAnimator::ParamChangedHandler));
00272   fTextEntryTimeRangeStart->activated.connect(slot_class(*this,&TridAnimator::ParamChangedHandler)); 
00273   fTextEntryTimeRangeEnd  ->activated.connect(slot_class(*this,&TridAnimator::ParamChangedHandler));
00274   fTextEntrySecPerFrame ->activated.connect(slot_class(*this,&TridAnimator::ParamChangedHandler));
00275   
00276   UpdateGui();
00277 }

void TridAnimator::StartAnimation (  ) 

Definition at line 61 of file TridAnimator.cxx.

References AnimatingModels(), fAnimating, fAnimFPS, fAnimTimeMax, fAnimTimer, fFrame, fTimeRange, fTridControl, Msg::kDebug, Msg::kWarning, Range< TYPE >::Min(), Munits::ms, and MSG.

Referenced by StartStopHandler().

00062 {
00063   fAnimating = true;
00064   Long_t ms = (Long_t)(1000./fAnimFPS);
00065   if(AnimatingModels()) fAnimTimeMax = fTimeRange.Min();
00066   fAnimTimer.SetObject(this);
00067   fAnimTimer.Start(ms,true);
00068   fAnimTimer.TurnOn();
00069   fFrame = 0;
00070 
00071   MSG("TriD",Msg::kDebug) << "Starting anim." << endl;
00072   if(!fTridControl) MSG("TriD",Msg::kWarning) << "Animator has no control object???" << endl;
00073 }

void TridAnimator::StartStopHandler (  )  [private]

Definition at line 305 of file TridAnimator.cxx.

References fAnimating, ReadFromGui(), StartAnimation(), StopAnimation(), and UpdateGui().

Referenced by ShowConfigFrame().

00306 {
00307   fAnimating = (!fAnimating);
00308 
00309   ReadFromGui(); // Just to make sure.
00310 
00311   if(fAnimating) {
00312     StartAnimation();
00313   } else {
00314     StopAnimation();
00315   }
00316   
00317   TridAnimator::UpdateGui();
00318 }

void TridAnimator::StopAndResetHandler (  )  [private]
void TridAnimator::StopAnimation (  ) 

Definition at line 75 of file TridAnimator.cxx.

References fAnimating.

Referenced by StartStopHandler().

00076 {
00077   fAnimating = false;
00078 }

void TridAnimator::UpdateGui ( void   )  [private]

Definition at line 353 of file TridAnimator.cxx.

References fAnimateModels, fAnimateViews, fAnimating, fAnimFPS, fAnimSecPerFrame, fAnimTimeMin, fAnimTimeWindow, fButtonAnimateModels, fButtonAnimateViews, fButtonPrinting, fButtonStartStop, fLabelAnimFrame, fLabelAnimTime, Form(), fPrinting, fTextEntryFPS, fTextEntrySecPerFrame, fTextEntryTimeRangeEnd, fTextEntryTimeRangeStart, fTextEntryTimeWindow, fTextEntryViewSpeed, fTimeRange, fViewAnimSpeed, GetFrame(), Range< TYPE >::Max(), Range< TYPE >::Min(), and Munits::ns.

Referenced by SetAnimateModels(), SetAnimateViews(), SetTimeRange(), SetViewAnimSpeed(), ShowConfigFrame(), and StartStopHandler().

00354 {
00355   // Assume that if one widget exists, they all exist.
00356   if(fButtonStartStop.get())   {
00357     if(fAnimating) fButtonStartStop->SetText(TString("Stop Animation"));
00358     else  fButtonStartStop->SetText(TString("Start Animation"));
00359     
00360     fButtonStartStop->Resize(fButtonStartStop->GetDefaultSize());
00361 
00362     fLabelAnimTime->SetText(Form("Time: %7.2g ns",fAnimTimeMin/Munits::ns));
00363     fLabelAnimTime->Resize(fLabelAnimTime->GetDefaultSize());
00364     fLabelAnimFrame->SetText(Form("Frame: %d",GetFrame()));
00365     fLabelAnimFrame->Resize(fLabelAnimFrame->GetDefaultSize());
00366   
00367     fTextEntryFPS->SetText(Form("%.1f",fAnimFPS));
00368 
00369     fButtonPrinting    ->SetState(fPrinting     ? kButtonDown : kButtonUp );
00370     fButtonAnimateViews->SetState(fAnimateViews ? kButtonDown : kButtonUp );
00371 
00372     fTextEntryViewSpeed->SetText(Form("%.3f",fViewAnimSpeed));
00373 
00374     fButtonAnimateModels->SetState(fAnimateModels ? kButtonDown : kButtonUp );
00375 
00376     fTextEntryTimeWindow->SetText(Form("%.1f",fAnimTimeWindow/Munits::ns));
00377   
00378     fTextEntryTimeRangeStart->SetText(Form("%.1f",fTimeRange.Min()/Munits::ns));
00379     fTextEntryTimeRangeEnd->  SetText(Form("%.1f",fTimeRange.Max()/Munits::ns));
00380     
00381     fTextEntrySecPerFrame->SetText(Form("%.1f",fAnimSecPerFrame/Munits::ns));    
00382   }
00383 }


Friends And Related Function Documentation

friend class TridControl [friend]

Definition at line 21 of file TridAnimator.h.


Member Data Documentation

Bool_t TridAnimator::fAnimateModels [private]

Definition at line 70 of file TridAnimator.h.

Referenced by AnimatingModels(), ReadFromGui(), SetAnimateModels(), and UpdateGui().

Bool_t TridAnimator::fAnimateViews [private]

Definition at line 71 of file TridAnimator.h.

Referenced by AnimatingViews(), ReadFromGui(), SetAnimateViews(), and UpdateGui().

Bool_t TridAnimator::fAnimating [private]
Double_t TridAnimator::fAnimFPS [private]

Definition at line 65 of file TridAnimator.h.

Referenced by HandleTimer(), ReadFromGui(), ShowConfigFrame(), StartAnimation(), and UpdateGui().

Double_t TridAnimator::fAnimSecPerFrame [private]

Definition at line 77 of file TridAnimator.h.

Referenced by HandleTimer(), ReadFromGui(), ShowConfigFrame(), and UpdateGui().

Double_t TridAnimator::fAnimTimeMax [private]

Definition at line 79 of file TridAnimator.h.

Referenced by GetAnimTimeMax(), HandleTimer(), and StartAnimation().

Double_t TridAnimator::fAnimTimeMin [private]

Definition at line 78 of file TridAnimator.h.

Referenced by GetAnimTimeMin(), HandleTimer(), ShowConfigFrame(), and UpdateGui().

TTimer TridAnimator::fAnimTimer [private]

Definition at line 58 of file TridAnimator.h.

Referenced by HandleTimer(), and StartAnimation().

Double_t TridAnimator::fAnimTimeWindow [private]

Definition at line 80 of file TridAnimator.h.

Referenced by HandleTimer(), ReadFromGui(), ShowConfigFrame(), and UpdateGui().

Definition at line 103 of file TridAnimator.h.

Referenced by CloseConfigFrame(), ReadFromGui(), ShowConfigFrame(), and UpdateGui().

Definition at line 103 of file TridAnimator.h.

Referenced by CloseConfigFrame(), ReadFromGui(), ShowConfigFrame(), and UpdateGui().

Definition at line 103 of file TridAnimator.h.

Referenced by CloseConfigFrame(), ReadFromGui(), ShowConfigFrame(), and UpdateGui().

Definition at line 100 of file TridAnimator.h.

Referenced by CloseConfigFrame(), ReadFromGui(), ShowConfigFrame(), and UpdateGui().

Definition at line 103 of file TridAnimator.h.

Referenced by CloseConfigFrame(), ReadFromGui(), and ShowConfigFrame().

Int_t TridAnimator::fFrame [private]

Definition at line 67 of file TridAnimator.h.

Referenced by GetFrame(), HandleTimer(), and StartAnimation().

Definition at line 102 of file TridAnimator.h.

Referenced by CloseConfigFrame(), HandleTimer(), ShowConfigFrame(), and UpdateGui().

SigC::Ptr<GuiLabel> TridAnimator::fLabelAnimTime [private]

Definition at line 101 of file TridAnimator.h.

Referenced by CloseConfigFrame(), HandleTimer(), ShowConfigFrame(), and UpdateGui().

Definition at line 98 of file TridAnimator.h.

Referenced by CloseConfigFrame(), and OpenWindow().

Bool_t TridAnimator::fPrinting [private]

Definition at line 66 of file TridAnimator.h.

Referenced by Printing(), ReadFromGui(), and UpdateGui().

Definition at line 105 of file TridAnimator.h.

Referenced by CloseConfigFrame(), ReadFromGui(), ShowConfigFrame(), and UpdateGui().

Definition at line 105 of file TridAnimator.h.

Referenced by CloseConfigFrame(), ReadFromGui(), ShowConfigFrame(), and UpdateGui().

Definition at line 105 of file TridAnimator.h.

Referenced by CloseConfigFrame(), ReadFromGui(), ShowConfigFrame(), and UpdateGui().

Definition at line 105 of file TridAnimator.h.

Referenced by CloseConfigFrame(), ReadFromGui(), ShowConfigFrame(), and UpdateGui().

Definition at line 105 of file TridAnimator.h.

Referenced by CloseConfigFrame(), ReadFromGui(), ShowConfigFrame(), and UpdateGui().

Definition at line 105 of file TridAnimator.h.

Referenced by CloseConfigFrame(), ReadFromGui(), ShowConfigFrame(), and UpdateGui().

Definition at line 55 of file TridAnimator.h.

Referenced by HandleTimer(), and StartAnimation().

Bool_t TridAnimator::fUseTimeWindow [private]

Definition at line 74 of file TridAnimator.h.

Referenced by HandleTimer(), and ReadFromGui().

Double_t TridAnimator::fViewAnimSpeed [private]

The documentation for this class was generated from the following files:

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1