ROOT logo
// $Header: /soft/cvsroot/AliRoot/EVE/test-macros/tpc_gui.C,v 1.7 2006/10/26 13:24:33 mtadel Exp $

// Function to spawn a gui for reading rootified raw-data from TPC sector test.
//
// To use:
// a) select TPCLoader entry in the list-tree view;
//    you'll get a dialog to steer the data-loading process in an adjacent window
// b) to select a ROOT file containing the raw-data double-click on 'File:'
//    text entry to spawn a file-dialog or type in the name
// c) click open to actually open the file and load an event

#ifndef __CINT__

#include <TEveUtil.h>
#include "TGLViewer.h"
#include "TTimer.h"

#endif

TTimer   *g_rotate_timer = 0;
Double_t  g_rotate_speed = 1;
Double_t  g_rotate_theta = 0;

void auto_rotate(Long_t time=25, Double_t speed=1)
{
  if (g_rotate_timer == 0)
  {
    g_rotate_timer = new TTimer;
  }
  g_rotate_speed = speed;
  g_rotate_theta = 0;
  g_rotate_timer->SetCommand("auto_rotate_camera()");
  g_rotate_timer->Start(time);
}

void auto_rotate_stop()
{
  if (g_rotate_timer == 0)
  {
    Error("auto_rotate_stop", "timer not initialized.");
    return;
  }
  g_rotate_timer->Stop();
}

void auto_rotate_camera()
{
   static Double_t hRotateStep = 0.005;
   static Double_t vRotateStep = 0.025;

   g_rotate_theta += hRotateStep * g_rotate_speed;
   if (g_rotate_theta >= 0.8 || g_rotate_theta <= -0.8) 
   {
     hRotateStep = -hRotateStep;
   }

   TGLViewer *v   = gEve->GetDefaultGLViewer();
   TGLCamera &cam = v->CurrentCamera();
   cam.RotateRad(hRotateStep * g_rotate_speed, vRotateStep * g_rotate_speed);
   v->RequestDraw(TGLRnrCtx::kLODHigh);
}
 auto_rotate.C:1
 auto_rotate.C:2
 auto_rotate.C:3
 auto_rotate.C:4
 auto_rotate.C:5
 auto_rotate.C:6
 auto_rotate.C:7
 auto_rotate.C:8
 auto_rotate.C:9
 auto_rotate.C:10
 auto_rotate.C:11
 auto_rotate.C:12
 auto_rotate.C:13
 auto_rotate.C:14
 auto_rotate.C:15
 auto_rotate.C:16
 auto_rotate.C:17
 auto_rotate.C:18
 auto_rotate.C:19
 auto_rotate.C:20
 auto_rotate.C:21
 auto_rotate.C:22
 auto_rotate.C:23
 auto_rotate.C:24
 auto_rotate.C:25
 auto_rotate.C:26
 auto_rotate.C:27
 auto_rotate.C:28
 auto_rotate.C:29
 auto_rotate.C:30
 auto_rotate.C:31
 auto_rotate.C:32
 auto_rotate.C:33
 auto_rotate.C:34
 auto_rotate.C:35
 auto_rotate.C:36
 auto_rotate.C:37
 auto_rotate.C:38
 auto_rotate.C:39
 auto_rotate.C:40
 auto_rotate.C:41
 auto_rotate.C:42
 auto_rotate.C:43
 auto_rotate.C:44
 auto_rotate.C:45
 auto_rotate.C:46
 auto_rotate.C:47
 auto_rotate.C:48
 auto_rotate.C:49
 auto_rotate.C:50
 auto_rotate.C:51
 auto_rotate.C:52
 auto_rotate.C:53
 auto_rotate.C:54
 auto_rotate.C:55
 auto_rotate.C:56
 auto_rotate.C:57
 auto_rotate.C:58
 auto_rotate.C:59
 auto_rotate.C:60
 auto_rotate.C:61
 auto_rotate.C:62