1 // $Header: /soft/cvsroot/AliRoot/EVE/test-macros/tpc_gui.C,v 1.7 2006/10/26 13:24:33 mtadel Exp $
3 // Function to spawn a gui for reading rootified raw-data from TPC sector test.
6 // a) select TPCLoader entry in the list-tree view;
7 // you'll get a dialog to steer the data-loading process in an adjacent window
8 // b) to select a ROOT file containing the raw-data double-click on 'File:'
9 // text entry to spawn a file-dialog or type in the name
10 // c) click open to actually open the file and load an event
15 #include "TGLViewer.h"
20 TTimer *g_rotate_timer = 0;
21 Double_t g_rotate_speed = 1;
22 Double_t g_rotate_theta = 0;
24 void auto_rotate(Long_t time=25, Double_t speed=1)
26 if (g_rotate_timer == 0)
28 g_rotate_timer = new TTimer;
30 g_rotate_speed = speed;
32 g_rotate_timer->SetCommand("auto_rotate_camera()");
33 g_rotate_timer->Start(time);
36 void auto_rotate_stop()
38 if (g_rotate_timer == 0)
40 Error("auto_rotate_stop", "timer not initialized.");
43 g_rotate_timer->Stop();
46 void auto_rotate_camera()
48 static Double_t hRotateStep = 0.005;
49 static Double_t vRotateStep = 0.025;
51 g_rotate_theta += hRotateStep * g_rotate_speed;
52 if (g_rotate_theta >= 0.8 || g_rotate_theta <= -0.8)
54 hRotateStep = -hRotateStep;
57 TGLViewer *v = gEve->GetGLViewer();
58 TGLCamera &cam = v->CurrentCamera();
59 cam.RotateRad(hRotateStep * g_rotate_speed, vRotateStep * g_rotate_speed);
60 v->RequestDraw(TGLRnrCtx::kLODHigh);