GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ClickCollector.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005-2006 by Christophe Theisen & Olivier Stezowski *
3  * christophe.theisen(AT)cea.fr, stezow(AT)ipnl.in2p3.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
20 
23 #ifndef GW_CLICKCOLLECTOR_H
24 #define GW_CLICKCOLLECTOR_H
25 
26 
27 #include "TMarker.h"
28 #include "RQ_OBJECT.h"
29 #include "TROOT.h"
30 #include "TCanvas.h"
31 
32 namespace GwD {
33 
35 {
36 RQ_OBJECT("ClickCollector")
37 
38 private:
39  static ClickCollector *gfCollector; // the click collector
40 
41 private:
42  Int_t fLastPx, fLastPy; // to keep track of the last postion of the mouse in the pad
43 
44  EEventType fCollectMode; // type of event needed to collect
45 
46  TMarker fMarker; // Marker attribute used to draw markers
47 
48  Bool_t fIsActive; // true if collect mode is on
49 
50 private:
52 
53 public:
54  virtual ~ClickCollector() {;}
55 
56  void SetMode(Bool_t mode = true) { fIsActive = mode; }
57  void SetMarker(TMarker m) { fMarker = m; }
58 
59  // the unique collector
60  static ClickCollector * TheCollector();
61 
62  // action to be performed for any events
63  void DoCollect(Int_t event, Int_t px, Int_t py, TObject *obj);
64 
66  ClassDef(ClickCollector,0); // a ClickCollector
67 
68 };
69 
70 }
71 
72 #endif
void SetMarker(TMarker m)
ClassDef(ClickCollector, 0)
rootcint dictionary
void SetMode(Bool_t mode=true)
void DoCollect(Int_t event, Int_t px, Int_t py, TObject *obj)
static ClickCollector * TheCollector()
virtual ~ClickCollector()