Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGraphTime.h
Go to the documentation of this file.
1// @(#)root/hist:$Id$
2// Author: Rene Brun 13/07/2009
3
4/*************************************************************************
5 * Copyright (C) 1995-2009, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TGraphTime
13#define ROOT_TGraphTime
14
15
16//////////////////////////////////////////////////////////////////////////
17// //
18// TGraphTime //
19// //
20// An array of objects evolving with time //
21// //
22//////////////////////////////////////////////////////////////////////////
23
24#include "TNamed.h"
25
26class TH1;
27class TObjArray;
28class TTimer;
29
30class TGraphTime : public TNamed {
31
32protected:
33 Int_t fSleepTime = 0; ///< Time (msec) to wait between time steps
34 Int_t fNsteps = 0; ///< Number of time steps
35 Double_t fXmin = 0.; ///< Minimum for X axis
36 Double_t fXmax = 0.; ///< Maximum for X axis
37 Double_t fYmin = 0.; ///< Minimum for Y axis
38 Double_t fYmax = 0.; ///< Maximum for Y axis
39 TObjArray *fSteps = nullptr; ///< Array of TLists for each time step
40 TH1 *fFrame = nullptr; ///< TH1 object used for the pad range
41 Int_t fAnimateCnt = -1; ///<! counter used in Animate() method
42 TTimer *fAnimateTimer = nullptr; ///<! timer to implement animation
43
44 Bool_t DrawStep(Int_t nstep) const;
45
46public:
47
48 TGraphTime();
50 TGraphTime(const TGraphTime &gr);
51 ~TGraphTime() override;
52
53 virtual Int_t Add(const TObject *obj, Int_t slot, Option_t *option = "");
54 void Animate(Bool_t enable = kTRUE);
55 void Draw(Option_t *chopt = "") override;
56 TObjArray *GetSteps() const { return fSteps; }
57 Bool_t HandleTimer(TTimer *) override;
58 void Paint(Option_t *chopt = "") override;
59 virtual void SaveAnimatedGif(const char *filename = "") const;
60 virtual void SetSleepTime(Int_t stime = 0) { fSleepTime = stime; }
61
62 ClassDefOverride(TGraphTime,1) //An array of objects evolving with time
63};
64
65#endif
bool Bool_t
Definition RtypesCore.h:63
constexpr Bool_t kTRUE
Definition RtypesCore.h:93
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
float xmin
float ymin
float xmax
float ymax
TGraphTime is used to draw a set of objects evolving with nsteps in time between tmin and tmax.
Definition TGraphTime.h:30
void Animate(Bool_t enable=kTRUE)
Start animation of TGraphTime.
virtual Int_t Add(const TObject *obj, Int_t slot, Option_t *option="")
Add one object to a time slot.
Double_t fXmin
Minimum for X axis.
Definition TGraphTime.h:35
void Paint(Option_t *chopt="") override
Paint all objects added to each time step.
Int_t fSleepTime
Time (msec) to wait between time steps.
Definition TGraphTime.h:33
virtual void SetSleepTime(Int_t stime=0)
Definition TGraphTime.h:60
Int_t fAnimateCnt
! counter used in Animate() method
Definition TGraphTime.h:41
~TGraphTime() override
GraphTime default destructor.
TH1 * fFrame
TH1 object used for the pad range.
Definition TGraphTime.h:40
Double_t fYmin
Minimum for Y axis.
Definition TGraphTime.h:37
TObjArray * GetSteps() const
Definition TGraphTime.h:56
virtual void SaveAnimatedGif(const char *filename="") const
Save this object to filename as an animated gif file if filename is specified it must be of the form ...
Double_t fXmax
Maximum for X axis.
Definition TGraphTime.h:36
TTimer * fAnimateTimer
! timer to implement animation
Definition TGraphTime.h:42
Bool_t DrawStep(Int_t nstep) const
Draw single step.
TGraphTime()
default constructor.
Double_t fYmax
Maximum for Y axis.
Definition TGraphTime.h:38
TObjArray * fSteps
Array of TLists for each time step.
Definition TGraphTime.h:39
Bool_t HandleTimer(TTimer *) override
Method used for implementing animation of TGraphTime.
Int_t fNsteps
Number of time steps.
Definition TGraphTime.h:34
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:59
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
An array of TObjects.
Definition TObjArray.h:31
Mother of all ROOT objects.
Definition TObject.h:41
Handles synchronous and a-synchronous timer events.
Definition TTimer.h:51
TGraphErrors * gr
Definition legend1.C:25
th1 Draw()