Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TGLAutoRotator.h
Go to the documentation of this file.
1 // @(#)root/eve:$Id$
2 // Author: Matevz Tadel 2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2007, 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_TGLAutoRotator
13 #define ROOT_TGLAutoRotator
14 
15 #include "TObject.h"
16 #include "TString.h"
17 
18 class TGLCamera;
19 class TGLViewer;
20 class TTimer;
21 class TStopwatch;
22 
23 class TGLAutoRotator : public TObject
24 {
25 private:
26  TGLAutoRotator(const TGLAutoRotator&); // Not implemented
27  TGLAutoRotator& operator=(const TGLAutoRotator&); // Not implemented
28 
29 protected:
30  TGLViewer *fViewer;
31  TGLCamera *fCamera;
32  TTimer *fTimer;
33  TStopwatch *fWatch;
34 
35  Bool_t fRotateScene;
36 
37  Double_t fDeltaPhi;
38 
39  Double_t fDt;
40  Double_t fWPhi;
41  Double_t fWTheta, fATheta;
42  Double_t fWDolly, fADolly;
43 
44  Double_t fThetaA0, fDollyA0;
45  Bool_t fTimerRunning;
46 
47  TString fImageName;
48  Int_t fImageCount;
49  Bool_t fImageAutoSave;
50 
51  TString fImageGUIBaseName;
52  Int_t fImageGUIOutMode;
53 
54 public:
55  TGLAutoRotator(TGLViewer* v);
56  virtual ~TGLAutoRotator();
57 
58  TGLViewer* GetViewer() const { return fViewer; }
59  TGLCamera* GetCamera() const { return fCamera; }
60 
61  // --------------------------------
62 
63  void Start();
64  void Stop();
65 
66  void Timeout();
67  void RotateScene();
68 
69  // --------------------------------
70 
71  Bool_t IsRunning() const { return fTimerRunning; }
72 
73  Bool_t GetRotateScene() const { return fRotateScene; }
74  void SetRotateScene(Bool_t rotateScene) {Stop(); fRotateScene = rotateScene; }
75 
76  Double_t GetDeltaPhi() const {return fDeltaPhi; }
77  void SetDeltaPhi(Double_t dPhi) {fDeltaPhi = dPhi; }
78 
79  Double_t GetDt() const { return fDt; }
80  void SetDt(Double_t dt);
81 
82  Double_t GetWPhi() const { return fWPhi; }
83  void SetWPhi(Double_t w) { fWPhi = w; }
84 
85  Double_t GetWTheta() const { return fWTheta; }
86  void SetWTheta(Double_t w) { fWTheta = w; }
87  Double_t GetATheta() const { return fATheta; }
88  void SetATheta(Double_t a);
89 
90  Double_t GetWDolly() const { return fWDolly; }
91  void SetWDolly(Double_t w) { fWDolly = w; }
92  Double_t GetADolly() const { return fADolly; }
93  void SetADolly(Double_t a);
94 
95  TString GetImageName() const { return fImageName; }
96  void SetImageName(const TString& name) { fImageName = name; }
97  Int_t GetImageCount() const { return fImageCount; }
98  void SetImageCount(Int_t ic) { fImageCount = ic; }
99  Bool_t GetImageAutoSave() const { return fImageAutoSave; }
100  void SetImageAutoSave(Bool_t s) { fImageAutoSave = s; }
101 
102  void StartImageAutoSaveAnimatedGif(const TString& filename);
103  void StartImageAutoSave(const TString& filename);
104  void StopImageAutoSave();
105 
106  TString GetImageGUIBaseName() const { return fImageGUIBaseName; }
107  void SetImageGUIBaseName(const TString& gname) { fImageGUIBaseName = gname; }
108 
109  Int_t GetImageGUIOutMode() const { return fImageGUIOutMode; }
110  void SetImageGUIOutMode(Int_t m);
111 
112  void StartImageAutoSaveWithGUISettings();
113 
114  ClassDef(TGLAutoRotator, 0); // Automatic, timer-based, rotation of GL-viewer's camera.
115 };
116 
117 #endif