Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-18 09:33:47

0001 // @(#)root/hist:$Id$
0002 // Author: Rene Brun 13/07/2009
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2009, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TGraphTime
0013 #define ROOT_TGraphTime
0014 
0015 
0016 //////////////////////////////////////////////////////////////////////////
0017 //                                                                      //
0018 // TGraphTime                                                           //
0019 //                                                                      //
0020 // An array of objects evolving with time                               //
0021 //                                                                      //
0022 //////////////////////////////////////////////////////////////////////////
0023 
0024 #include "TNamed.h"
0025 
0026 class TH1;
0027 class TObjArray;
0028 class TTimer;
0029 
0030 class TGraphTime : public TNamed {
0031 
0032 protected:
0033    Int_t fSleepTime = 0;        ///< Time (msec) to wait between time steps
0034    Int_t fNsteps = 0;           ///< Number of time steps
0035    Double_t fXmin = 0.;         ///< Minimum for X axis
0036    Double_t fXmax = 0.;         ///< Maximum for X axis
0037    Double_t fYmin = 0.;         ///< Minimum for Y axis
0038    Double_t fYmax = 0.;         ///< Maximum for Y axis
0039    TObjArray *fSteps = nullptr; ///< Array of TLists for each time step
0040    TH1 *fFrame = nullptr;       ///< TH1 object used for the pad range
0041    Int_t fAnimateCnt = -1;      ///<! counter used in Animate() method
0042    TTimer *fAnimateTimer = nullptr; ///<! timer to implement animation
0043 
0044    Bool_t DrawStep(Int_t nstep) const;
0045 
0046 public:
0047 
0048    TGraphTime();
0049    TGraphTime(Int_t nsteps, Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax);
0050    TGraphTime(const TGraphTime &gr);
0051    ~TGraphTime() override;
0052 
0053    virtual Int_t Add(const TObject *obj, Int_t slot, Option_t *option = "");
0054    void Animate(Bool_t enable = kTRUE);
0055    void Draw(Option_t *chopt = "") override;
0056    TObjArray *GetSteps() const { return fSteps; }
0057    Bool_t HandleTimer(TTimer *) override;
0058    void Paint(Option_t *chopt = "") override;
0059    virtual void SaveAnimatedGif(const char *filename = "") const;
0060    virtual void SetSleepTime(Int_t stime = 0) { fSleepTime = stime; }
0061 
0062    ClassDefOverride(TGraphTime,1)  //An array of objects evolving with time
0063 };
0064 
0065 #endif