Belle II Software  release-05-01-25
DisplayDrawingArea.h
1 //-----------------------------------------------------------------------------
2 // $Id$
3 //-----------------------------------------------------------------------------
4 // Filename : DisplayDrawingArea.h
5 // Section : TRG CDC
6 // Owner : Yoshihito Iwasaki
7 // Email : yoshihito.iwasaki@kek.jp
8 //-----------------------------------------------------------------------------
9 // Description : A class to display CDC trigger objects.
10 //-----------------------------------------------------------------------------
11 // $Log$
12 //-----------------------------------------------------------------------------
13 
14 #ifdef TRGCDC_DISPLAY
15 
16 #ifndef TRGCDCDisplayDrawingArea_FLAG_
17 #define TRGCDCDisplayDrawingArea_FLAG_
18 
19 #include <vector>
20 #include <gtkmm.h>
21 
22 #ifdef TRGCDC_SHORT_NAMES
23 #define TCDDArea TRGCDCDisplayDrawingArea
24 #endif
25 
26 namespace Belle2 {
32  class TRGCDCDisplay;
33 
35  class TRGCDCDisplayDrawingArea : public Gtk::DrawingArea {
36 
37  public:
38 
40  TRGCDCDisplayDrawingArea(TRGCDCDisplay&, int size, double outerR);
41 
43  virtual ~TRGCDCDisplayDrawingArea();
44 
45  public:
46 
48  TRGCDCDisplay& display(void);
49 
50  double scale(double);
51  double scale(void) const;
52  virtual void resetPosition(void) = 0;
53  bool axial(void) const;
54  bool axial(bool);
55  bool stereo(void) const;
56  bool stereo(bool);
57  bool wireName(void) const;
58  bool wireName(bool);
59  bool oldCDC(void) const;
60  bool oldCDC(bool);
61 
62  virtual void clear(void) = 0;
63 
64  virtual bool on_expose_event(GdkEventExpose*) = 0;
65  virtual bool on_button_press_event(GdkEventButton*) = 0;
66 
67  private:
68  virtual void on_realize() = 0;
69 
70  private:
71 
73  TRGCDCDisplay& _w;
74 
75  double _scale;
76  bool _axial;
77  bool _stereo;
78  bool _wireName;
79  bool _oldCDC;
80  };
81 
82 //-----------------------------------------------------------------------------
83 
84  inline
85  double
86  TRGCDCDisplayDrawingArea::scale(double a)
87  {
88  return _scale = a;
89  }
90 
91  inline
92  double
93  TRGCDCDisplayDrawingArea::scale(void) const
94  {
95  return _scale;
96  }
97 
98  inline
99  bool
100  TRGCDCDisplayDrawingArea::axial(void) const
101  {
102  return _axial;
103  }
104 
105  inline
106  bool
107  TRGCDCDisplayDrawingArea::axial(bool a)
108  {
109  return _axial = a;
110  }
111 
112  inline
113  bool
114  TRGCDCDisplayDrawingArea::stereo(void) const
115  {
116  return _stereo;
117  }
118 
119  inline
120  bool
121  TRGCDCDisplayDrawingArea::stereo(bool a)
122  {
123  return _stereo = a;
124  }
125 
126  inline
127  bool
128  TRGCDCDisplayDrawingArea::wireName(void) const
129  {
130  return _wireName;
131  }
132 
133  inline
134  bool
135  TRGCDCDisplayDrawingArea::wireName(bool a)
136  {
137  return _wireName = a;
138  }
139 
140  inline
141  bool
142  TRGCDCDisplayDrawingArea::oldCDC(void) const
143  {
144  return _oldCDC;
145  }
146 
147  inline
148  bool
149  TRGCDCDisplayDrawingArea::oldCDC(bool a)
150  {
151  return _oldCDC = a;
152  }
153 
154  inline
155  TRGCDCDisplay&
156  TRGCDCDisplayDrawingArea::display(void)
157  {
158  return _w;
159  }
160 
162 } // namespace Belle2
163 
164 #endif // TRGCDCDisplayDrawingArea_FLAG_
165 #endif
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19