GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LoupeOnPad.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (c) IPNL, IN2P3, CNRS *
3  * Contibutor(s) : *
4  * Jeremie Dudouet dudouet(AT)ipnl.in2p3.fr [2014] *
5  * Olivier Stezowski stezow(AT)ipnl.in2p3.fr [2014] *
6  * *
7  * This program is free software; you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation; either version 2 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * This program is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU General Public License *
18  * along with this program; if not, write to the *
19  * Free Software Foundation, Inc., *
20  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21  ***************************************************************************/
22 
23 #ifndef LOUPEONPAD_H
24 #define LOUPEONPAD_H
25 
26 #include "TObject.h"
27 #include "TCanvas.h"
28 #include "TROOT.h"
29 #include "KeySymbols.h"
30 #include "TPave.h"
31 
32 #include <iostream>
33 
35 
76 class LoupeOnPad : public TObject
77 {
78 
79 private:
81  TCanvas *fCanvas;
83  Int_t fCurrentPadNumber;
85  Int_t fLastX;
86  Int_t fLastY;
88  Int_t fDeltaX;
89  Int_t fDeltaY;
91  Bool_t fToggleLoupe;
92  Bool_t fToggleMouse;
93 
94 protected:
96  Int_t GetPadNumber(Int_t add_x, Int_t add_y);
97 
98 public:
99  LoupeOnPad(TCanvas *c = 0x0);
100  virtual ~LoupeOnPad();
101 
103  void ChangeCurrentPad(Int_t padnumber = 1);
104 
106  TCanvas *CheckLoupeIsThere();
107 
109  void HandleMovement(Int_t, Int_t, Int_t, TObject *select);
110 
112  void Clear(Option_t * = "");
113 
115  void SetLoupeActive(Bool_t b = true){fToggleLoupe = b;}
116 
117  ClassDef(LoupeOnPad, 0) // LoupeOnPad facility
118 };
119 
120 void RunLoupeOnPad(TCanvas *c = 0x0);
121 
122 #endif
TBrowser * b
TCanvas * CheckLoupeIsThere()
To be sure the Canvas to display loupe is there.
Definition: LoupeOnPad.cpp:115
void HandleMovement(Int_t, Int_t, Int_t, TObject *select)
Handle mouse/keyboad catchings.
Definition: LoupeOnPad.cpp:252
void ChangeCurrentPad(Int_t padnumber=1)
Change current pad number under loupe.
Definition: LoupeOnPad.cpp:187
void RunLoupeOnPad(TCanvas *c=0x0)
void Clear(Option_t *="")
Remove any sign of Loupe on the pad.
Definition: LoupeOnPad.cpp:158
LoupOnPad, a class to Loupe on a Pad in a Canvas with many pads in it.
Definition: LoupeOnPad.h:76
LoupeOnPad(TCanvas *c=0x0)
Definition: LoupeOnPad.cpp:27
void SetLoupeActive(Bool_t b=true)
Enable/Disable the Loupe on the pad.
Definition: LoupeOnPad.h:115
Int_t GetPadNumber(Int_t add_x, Int_t add_y)
return pad number depending of increntation on x,y from the current position i.e the current pad ...
Definition: LoupeOnPad.cpp:81
virtual ~LoupeOnPad()
Definition: LoupeOnPad.cpp:65