15#ifndef TRGCDCDisplayDrawingAreaRphi_FLAG_
16#define TRGCDCDisplayDrawingAreaRphi_FLAG_
18#include "trg/cdc/DisplayDrawingArea.h"
20#ifdef TRGCDC_SHORT_NAMES
21#define TCDDAreaRphi TRGCDCDisplayDrawingAreaRphi
33 class TRGCDCSegmentHit;
41 class TRGCDCDisplayDrawingAreaRphi :
public TRGCDCDisplayDrawingArea {
46 TRGCDCDisplayDrawingAreaRphi(TRGCDCDisplay&,
52 virtual ~TRGCDCDisplayDrawingAreaRphi();
55 double scale(
void)
const;
56 void resetPosition(
void)
override;
57 bool axial(
void)
const;
59 bool stereo(
void)
const;
61 bool wireName(
void)
const;
63 bool oldCDC(
void)
const;
66 void clear(
void)
override;
69 void append(
const std::vector<const TRGCDCWire*>&,
70 Gdk::Color color = Gdk::Color(
"grey"));
71 void append(
const std::vector<const TRGCDCWireHit*>&,
72 Gdk::Color color = Gdk::Color(
"grey"));
73 void append(
const TRGCDCSegment&,
74 Gdk::Color color = Gdk::Color(
"#6600FF009900"));
75 void append(
const std::vector<const TRGCDCSegment*>&,
76 Gdk::Color color = Gdk::Color(
"#6600FF009900"));
77 void append(
const std::vector<const TRGCDCSegmentHit*>&,
78 Gdk::Color color = Gdk::Color(
"#6600FF009900"));
79 void append(
const TRGCDCCircle&,
80 Gdk::Color color = Gdk::Color(
"#FF0066009900"));
81 void append(
const std::vector<const TRGCDCCircle*>&,
82 Gdk::Color color = Gdk::Color(
"#FF0066009900"));
83 void append(
const TRGCDCTrack&,
84 Gdk::Color color = Gdk::Color(
"#99006600FF00"));
85 void append(
const std::vector<const TRGCDCTrack*>&,
86 Gdk::Color color = Gdk::Color(
"#99006600FF00"));
87 void append(
const TRGCDCFrontEnd&,
88 Gdk::Color color = Gdk::Color(
"grey"));
89 void append(
const TRGCDCMerger&,
90 Gdk::Color color = Gdk::Color(
"grey"));
93 void oneShot(
const std::vector<const TRGCDCSegment*>&,
94 Gdk::Color color = Gdk::Color(
"#6600FF009900"));
96 virtual bool on_expose_event(GdkEventExpose*)
override;
97 virtual bool on_button_press_event(GdkEventButton*)
override;
100 virtual void on_realize()
override;
103 void drawWires(
void);
105 void drawSegmentHits(
void);
107 void drawWire(
const TRGCDCWire& w,
111 void drawSegment(
const TRGCDCSegment& w,
115 void drawCircle(
const TRGCDCCircle& w,
119 void drawTrack(
const TRGCDCTrack& w,
123 void drawFrontEnd(
const TRGCDCFrontEnd& w,
127 void drawMerger(
const TRGCDCMerger& w,
133 int x(
double x)
const;
134 int y(
double y)
const;
135 int xR(
double x)
const;
136 int yR(
double y)
const;
148 std::vector<const TRGCDCWire*> _wires;
149 std::vector<Gdk::Color> _wiresColor;
151 std::vector<const TRGCDCWireHit*> _hits;
152 std::vector<Gdk::Color> _hitsColor;
154 std::vector<const TRGCDCSegment*> _segments;
155 std::vector<Gdk::Color> _segmentsColor;
157 std::vector<const TRGCDCSegmentHit*> _segmentHits;
158 std::vector<Gdk::Color> _segmentHitsColor;
160 std::vector<const TRGCDCCircle*> _circles;
161 std::vector<Gdk::Color> _circlesColor;
163 std::vector<const TRGCDCTrack*> _tracks;
164 std::vector<Gdk::Color> _tracksColor;
166 std::vector<const TRGCDCFrontEnd*> _fronts;
167 std::vector<Gdk::Color> _frontColors;
169 std::vector<const TRGCDCMerger*> _mergers;
170 std::vector<Gdk::Color> _mergerColors;
172 Glib::RefPtr<Gdk::Window> _window;
173 int _winx, _winy, _winw, _winh, _wind;
175 Glib::RefPtr<Gdk::GC> _gc;
176 Gdk::Color _blue, _red, _green, _black, _white, _grey, _yellow, _grey0;
178 Glib::RefPtr<Pango::Layout> _pl;
185 TRGCDCDisplayDrawingAreaRphi::scale(
double a)
192 TRGCDCDisplayDrawingAreaRphi::scale(
void)
const
199 TRGCDCDisplayDrawingAreaRphi::axial(
void)
const
206 TRGCDCDisplayDrawingAreaRphi::axial(
bool a)
213 TRGCDCDisplayDrawingAreaRphi::stereo(
void)
const
220 TRGCDCDisplayDrawingAreaRphi::stereo(
bool a)
227 TRGCDCDisplayDrawingAreaRphi::wireName(
void)
const
234 TRGCDCDisplayDrawingAreaRphi::wireName(
bool a)
236 return _wireName = a;
241 TRGCDCDisplayDrawingAreaRphi::oldCDC(
void)
const
248 TRGCDCDisplayDrawingAreaRphi::oldCDC(
bool a)
255 TRGCDCDisplayDrawingAreaRphi::x(
double a)
const
259 return int((a - _x) * _scale + _winw / 2);
264 TRGCDCDisplayDrawingAreaRphi::y(
double a)
const
266 return int((- a - _y) * _scale + _winh / 2);
271 TRGCDCDisplayDrawingAreaRphi::xR(
double a)
const
273 return int((a - _winw / 2) / _scale + _x);
278 TRGCDCDisplayDrawingAreaRphi::yR(
double a)
const
280 return int((- a - _winh / 2) / _scale + _y);
Abstract base class for different kinds of events.