From 2e79453d3665a68e93de2dfa33d5ce49e0ad4807 Mon Sep 17 00:00:00 2001 From: mtadel Date: Tue, 16 Sep 2008 14:00:43 +0000 Subject: [PATCH] auto_rotate.C ------------- New macro - rotate camera in the default GL viewer. binalieve.pkg ------------- Remove cleanup of .d/.so files for TRD - Alex will put it in some TRD pkg file. --- EVE/binalieve.pkg | 2 -- EVE/macros/auto_rotate.C | 61 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 EVE/macros/auto_rotate.C diff --git a/EVE/binalieve.pkg b/EVE/binalieve.pkg index 17c97b451cb..39a0993cb70 100644 --- a/EVE/binalieve.pkg +++ b/EVE/binalieve.pkg @@ -34,8 +34,6 @@ alieve_clean_compiled_macros: @echo "***** Removing .d and .$(SOEXT) files from EVE/alice-macros/ *****" $(MUTE)rm -f $(ALICE_ROOT)/EVE/alice-macros/*_C.d $(MUTE)rm -f $(ALICE_ROOT)/EVE/alice-macros/*_C.$(SOEXT) - $(MUTE)rm -f $(ALICE_ROOT)/TRD/qaRec/macros/*_C.d - $(MUTE)rm -f $(ALICE_ROOT)/TRD/qaRec/macros/*_C.$(SOEXT) ifeq (macosx,$(ALICE_TARGET)) diff --git a/EVE/macros/auto_rotate.C b/EVE/macros/auto_rotate.C new file mode 100644 index 00000000000..c6c396a202e --- /dev/null +++ b/EVE/macros/auto_rotate.C @@ -0,0 +1,61 @@ +// $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 +#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->GetGLViewer(); + TGLCamera &cam = v->CurrentCamera(); + cam.RotateRad(hRotateStep * g_rotate_speed, vRotateStep * g_rotate_speed); + v->RequestDraw(TGLRnrCtx::kLODHigh); +} -- 2.43.0