Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGLAnnotation.cxx
Go to the documentation of this file.
1// @(#)root/gl:$Id$
2// Author: Matevz and Alja Tadel 20/02/2009
3
4/*************************************************************************
5 * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#include "TGLAnnotation.h"
13
14#include "TGLIncludes.h"
15#include "TROOT.h"
16#include "TColor.h"
17#include "TGLUtil.h"
18#include "TGLCamera.h"
19#include "TGLRnrCtx.h"
20#include "TGLSelectRecord.h"
21#include "TGLViewerBase.h"
22#include "TObjString.h"
23#include "TGTextEdit.h"
24#include "TGButton.h"
25#include "TGLViewer.h"
26
27#include "TMath.h"
28
29#include <KeySymbols.h>
30
31/** \class TGLAnnotation
32\ingroup opengl
33GL-overlay annotation.
34*/
35
37
40
41////////////////////////////////////////////////////////////////////////////////
42
45
46 fPosX(posx), fPosY(posy),
47 fMouseX(0), fMouseY(0),
48 fDrag(kNone),
49 fDrawW(0), fDrawH(0), fTextSizeDrag(0),
50 fActive(kFALSE),
51 fMainFrame(0), fTextEdit(0),
52
53 fParent(0),
54
55 fText(text),
56 fTextSize(0.03),
57 fTextAlign(TGLFont::kLeft),
58 fBackColor(fgBackColor),
59 fTextColor(fgTextColor),
60 fTransparency(100),
61 fDrawRefLine(kFALSE),
62 fUseColorSet(kTRUE),
63 fAllowClose(kTRUE)
64{
65 // Constructor.
66 // Create annotation as plain text
67
68 parent->AddOverlayElement(this);
69 fParent = (TGLViewer*)parent;
70}
71
72////////////////////////////////////////////////////////////////////////////////
73
76 fPosX(posx), fPosY(posy),
77 fMouseX(0), fMouseY(0),
78 fDrag(kNone),
79 fDrawW(0), fDrawH(0), fTextSizeDrag(0),
80 fActive(kFALSE),
81 fMainFrame(0), fTextEdit(0),
82
83 fParent(0),
84
85 fText(text),
86 fTextSize(0.03),
87 fTextAlign(TGLFont::kLeft),
88 fBackColor(fgBackColor),
89 fTextColor(fgTextColor),
90 fTransparency(40),
91 fDrawRefLine(kTRUE),
92 fUseColorSet(kTRUE),
93 fAllowClose(kTRUE)
94{
95 // Constructor.
96 // Create annotation by picking an object.
97
98 fPointer = ref;
99 parent->AddOverlayElement(this);
100 fParent = (TGLViewer*)parent;
101}
102
103////////////////////////////////////////////////////////////////////////////////
104/// Destructor.
105
107{
109 delete fMainFrame;
110}
111
112////////////////////////////////////////////////////////////////////////////////
113/// Handle overlay event.
114/// Return TRUE if event was handled.
115
117 TGLOvlSelectRecord& selRec,
118 Event_t* event)
119{
120 if (selRec.GetN() < 2) return kFALSE;
121 Int_t recID = selRec.GetItem(1);
122 switch (event->fType)
123 {
124 case kButtonPress:
125 {
126 fMouseX = event->fX;
127 fMouseY = event->fY;
128 fDrag = (recID == kResizeID) ? kResize : kMove;
130 return kTRUE;
131 }
132 case kButtonRelease:
133 {
134 fDrag = kNone;
135 if (recID == kDeleteID)
136 {
138 delete this;
139 v->RequestDraw(rnrCtx.ViewerLOD());
140 }
141 else if (recID == kEditID)
142 {
143 MakeEditor();
144 }
145 return kTRUE;
146 }
147 case kMotionNotify:
148 {
149 const TGLRect& vp = rnrCtx.RefCamera().RefViewport();
150 if (vp.Width() == 0 || vp.Height() == 0) return kFALSE;
151
152 if (fDrag == kMove)
153 {
154 fPosX += (Float_t)(event->fX - fMouseX) / vp.Width();
155 fPosY -= (Float_t)(event->fY - fMouseY) / vp.Height();
156 fMouseX = event->fX;
157 fMouseY = event->fY;
158 // Make sure we don't go offscreen (use fDraw variables set in draw)
159 if (fPosX < 0)
160 fPosX = 0;
161 else if (fPosX + fDrawW > 1.0f)
162 fPosX = 1.0f - fDrawW;
163 if (fPosY < fDrawH)
164 fPosY = fDrawH;
165 else if (fPosY > 1.0f)
166 fPosY = 1.0f;
167 }
168 else if (fDrag == kResize)
169 {
170 using namespace TMath;
171 Float_t oovpw = 1.0f / vp.Width(), oovph = 1.0f / vp.Height();
172
173 Float_t xw = oovpw * Min(Max(0, event->fX), vp.Width());
174 Float_t yw = oovph * Min(Max(0, vp.Height() - event->fY), vp.Height());
175
176 Float_t rx = Max((xw - fPosX) / (oovpw * fMouseX - fPosX), 0.0f);
177 Float_t ry = Max((yw - fPosY) / (oovph*(vp.Height() - fMouseY) - fPosY), 0.0f);
178
179 fTextSize = Max(fTextSizeDrag * Min(rx, ry), 0.01f);
180 }
181 return kTRUE;
182 }
183 default:
184 {
185 return kFALSE;
186 }
187 }
188}
189
190////////////////////////////////////////////////////////////////////////////////
191/// Mouse has entered overlay area.
192
194{
195 fActive = kTRUE;
196 return kTRUE;
197}
198
199////////////////////////////////////////////////////////////////////////////////
200/// Mouse has left overlay area.
201
203{
204 fActive = kFALSE;
205}
206
207////////////////////////////////////////////////////////////////////////////////
208/// Render the annotation.
209
211{
212 const TGLRect& vp = rnrCtx.RefCamera().RefViewport();
213 if (vp.Width() == 0 && vp.Height() == 0)
214 return;
215
216 Float_t old_depth_range[2];
217 glGetFloatv(GL_DEPTH_RANGE, old_depth_range);
218 glDepthRange(0, 0.001);
219
220
221 glPushAttrib(GL_ENABLE_BIT | GL_LINE_BIT | GL_POLYGON_BIT);
222 TGLCapabilitySwitch lights_off(GL_LIGHTING, kFALSE);
223 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
224 glDisable(GL_CULL_FACE);
225 glEnable(GL_BLEND);
226 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
227
228 // prepare colors
229 Color_t bgCol = fBackColor;
230 Color_t fgCol = fTextColor;
231
232 if (fUseColorSet)
233 {
234 fgCol = rnrCtx.ColorSet().Markup().GetColorIndex();
235
238
239 if (c1 && c2) {
240 Float_t f1 = 0.5, f2 = 0.5;
241 bgCol = TColor::GetColor(c1->GetRed() *f1 + c2->GetRed() *f2,
242 c1->GetGreen()*f1 + c2->GetGreen()*f2,
243 c1->GetBlue() *f1 + c2->GetBlue() *f2);
244 }
245 }
246
247 // reset matrix
249
250 glPushMatrix();
251 // set ortho camera to [0,1] [0.1]
252 glLoadIdentity();
253 glTranslatef(-1.0f, -1.0f, 0.0f);
254 glScalef(2.0f, 2.0f, 1.0f);
255
256 glEnable(GL_POLYGON_OFFSET_FILL);
257 glPolygonOffset(0.1f, 1.0f);
258
259 glPushMatrix();
260
261 TGLUtil::LineWidth(1.0f);
262
263 // move to pos
264 glTranslatef(fPosX, fPosY, 0.0f);
265
266 TObjArray *lines = fText.Tokenize("\n");
267 TIter line_iter(lines);
268 TObjString *osl;
269
270 Float_t widthTxt, heightTxt, sx, sy, descent, line_height;
271 {
272 // get unscaled text size
274 rnrCtx.RegisterFontNoScale(fs, "arial", TGLFont::kTexture, fFont);
275 descent = fFont.GetDescent();
276 line_height = fFont.GetLineHeight();
277
278 Float_t llx, lly, llz, urx, ury, urz;
279 widthTxt = heightTxt = 0;
280 while ((osl = (TObjString*) line_iter()) != 0)
281 {
282 fFont.BBox(osl->GetString().Data(), llx, lly, llz, urx, ury, urz);
283 widthTxt = TMath::Max(widthTxt, urx);
284 heightTxt += line_height;
285 }
286 widthTxt += 2.0f * descent;
287 heightTxt += 2.0f * descent;
288
289 // keep proportions
290 sy = fTextSize / (line_height + descent);
291 sx = sy / vp.Aspect();
292 fDrawW = sx*widthTxt;
293 fDrawH = sy*heightTxt;
294 }
295 glScalef(sx, sy, 1.0f);
296
297 glPushName(kMoveID);
298
299 Float_t x1, x2, y1, y2;
300 Float_t z3 = 0.0f; // main background
301 Float_t z2 = -0.01f; // outlines and text
302 Float_t z1 = -0.02f; // button on top of text
303 Float_t z0 = -0.03f; // button on top of text
304
305 // main background
306 glLoadName(kMoveID);
307 x1 = 0.0f;
308 x2 = widthTxt;
309 y1 = -heightTxt;
310 y2 = 0.0f;
312 glBegin(GL_QUADS);
313 glVertex3f(x1, y1, z3);
314 glVertex3f(x2, y1, z3);
315 glVertex3f(x2, y2, z3);
316 glVertex3f(x1, y2, z3);
317 glEnd();
318 // main polygon outline
320 glBegin(GL_LINE_LOOP);
321 glVertex3f(x1, y1, z2);
322 glVertex3f(x2, y1, z2);
323 glVertex3f(x2, y2, z2);
324 glVertex3f(x1, y2, z2);
325 glEnd();
326
327 // annotation text
328 TGLUtil::Color(fgCol);
330 glPushMatrix();
331 Float_t tx = 0;
332 line_iter.Reset();
333 while ((osl = (TObjString*) line_iter()) != 0)
334 {
335 if (fTextAlign == TGLFont::kLeft) {
336 tx = 0;
337 }
338 else if (fTextAlign == TGLFont::kCenterH) {
339 tx = 0.5f * widthTxt - descent ;
340 }
341 else {
342 tx = widthTxt - 2.0f * descent;
343 }
344 glTranslatef(0.0f, -line_height, 0.0f);
345 fFont.Render(osl->GetString(), tx+descent, 0, z2, fTextAlign, TGLFont::kTop) ;
346 }
347 glPopMatrix();
349
350 delete lines;
351
352 // buttons
353 if (fActive)
354 {
355 Float_t bbox[6];
357 fFont.BBox("X", bbox[0], bbox[1], bbox[2], bbox[3], bbox[4], bbox[5]);
358 glLoadName(kEditID);
359 fFont.Render("E", descent, descent, z2, fTextAlign, TGLFont::kTop);
360 x2 = bbox[3] + 2.0f * descent;
361 if (fAllowClose)
362 {
363 glLoadName(kDeleteID);
364 fFont.Render("X", x2 + descent, descent, z2, fTextAlign, TGLFont::kTop);
365 }
367
368 x1 = 0.0f;
369 y1 = 0.0f;
370 y2 = line_height + descent;
371 {
372 // edit button
373 glLoadName(kEditID);
374 // polygon
376 glBegin(GL_QUADS);
377 glVertex3f(x1, y1, z3);
378 glVertex3f(x2, y1, z3);
379 glVertex3f(x2, y2, z3);
380 glVertex3f(x1, y2, z3);
381 glEnd();
382 // outline
384 glBegin(GL_LINE_LOOP);
385 glVertex3f(x1, y1, z0);
386 glVertex3f(x2, y1, z0);
387 glVertex3f(x2, y2, z0);
388 glVertex3f(x1, y2, z0);
389 glEnd();
390 }
391 x1 += x2;
392 x2 += x2;
393 if (fAllowClose)
394 {
395 // close button
396 glLoadName(kDeleteID);
397 // polygon
399 glBegin(GL_QUADS);
400 glVertex3f(x1, y1, z3);
401 glVertex3f(x2, y1, z3);
402 glVertex3f(x2, y2, z3);
403 glVertex3f(x1, y2, z3);
404 glEnd();
405 // outline
407 glBegin(GL_LINE_LOOP);
408 glVertex3f(x1, y1, z0);
409 glVertex3f(x2, y1, z0);
410 glVertex3f(x2, y2, z0);
411 glVertex3f(x1, y2, z0);
412 glEnd();
413 }
414 {
415 // resize button
416 glLoadName(kResizeID);
417 // polygon
418 x1 = widthTxt - line_height;
419 x2 = widthTxt;
420 y1 = -heightTxt;
421 y2 = -heightTxt + line_height;
423 glBegin(GL_QUADS);
424 glVertex3f(x1, y1, z1);
425 glVertex3f(x2, y1, z1);
426 glVertex3f(x2, y2, z1);
427 glVertex3f(x1, y2, z1);
428 glEnd();
429 // draw resize corner lines
431 glBegin(GL_LINES);
432 Float_t aOff = 0.25*line_height;
433 glVertex3f(x1+aOff, y1+aOff, z0);
434 glVertex3f(x2-aOff, y1+aOff, z0);
435 glVertex3f(x2-aOff, y1+aOff, z0);
436 glVertex3f(x2-aOff, y2-aOff, z0);
437 glEnd();
438 }
439 }
440
441 glPopName();
442
443 glPopMatrix();
444
445 if (fDrawRefLine)
446 {
448 op[0] /= vp.Width(); op[1] /= vp.Height();
449
450 Float_t fx = op[0] < fPosX ? 0.0f : (op[0] > fPosX + fDrawW ? 1.0f : 0.5f);
451 Float_t fy = op[1] < fPosY-fDrawH ? 1.0f : (op[1] > fPosY ? 0.0f : 0.5f);
452
453 if (fx != 0.5f || fy != 0.5f)
454 {
457 glBegin(GL_LINES);
458 glVertex3f(fPosX + fx*fDrawW, fPosY - fy*fDrawH, z3);
459 glVertex3f(op[0], op[1], z3);
460 glEnd();
461 }
462 }
463
464 glPopMatrix();
465 rnrCtx.ProjectionMatrixPop();
466
467 glDepthRange(old_depth_range[0], old_depth_range[1]);
468 glPopAttrib();
469}
470
471////////////////////////////////////////////////////////////////////////////////
472/// Returns transparency of annotation outline.
473/// If annotation is selected enforce visibility of outline.
474
476{
477 if (fActive)
478 return TMath::Min(70, fTransparency);
479 else
480 return fTransparency;
481}
482
483////////////////////////////////////////////////////////////////////////////////
484/// Show the annotation editor.
485
487{
488 if (fMainFrame == 0)
489 {
490 fMainFrame = new TGMainFrame(gClient->GetRoot(), 1000, 1000);
491 fMainFrame->SetWindowName("Annotation Editor");
492
494
495 fTextEdit = new TGTextEdit(vf, 1000, 1000, kSunkenFrame);
497
499
500 TGTextButton* btt1 = new TGTextButton(hf, "OK");
501 hf->AddFrame(btt1, new TGLayoutHints(kLHintsExpandX, 2, 2, 2, 2));
502
503 TGTextButton* btt2 = new TGTextButton(hf, "Cancel");
504 hf->AddFrame(btt2, new TGLayoutHints(kLHintsExpandX, 2, 2, 2, 2));
505
506 btt1->Connect("Clicked()", "TGLAnnotation", this, "UpdateText()");
507 btt2->Connect("Clicked()", "TGLAnnotation", this, "CloseEditor()");
508
509 vf->AddFrame(hf, new TGLayoutHints(kLHintsBottom | kLHintsRight | kLHintsExpandX, 2, 2, 5, 1));
510
514 }
515
516 TGText *tgt = new TGText();
517 tgt->LoadBuffer(fText.Data());
518 fTextEdit->SetText(tgt);
519
520 Int_t nrow = tgt->RowCount();
521 Int_t h = nrow*20;
523 fMainFrame->Resize(TMath::Max(100, w+30), TMath::Max(100, h+40));
524
527}
528
529////////////////////////////////////////////////////////////////////////////////
530/// Close the annotation editor.
531
533{
535}
536
537////////////////////////////////////////////////////////////////////////////////
538/// Modify the annotation text from the text-edit widget.
539
541{
545}
#define GL_QUADS
Definition GL_glu.h:290
#define GL_LINES
Definition GL_glu.h:284
#define GL_LINE_LOOP
Definition GL_glu.h:285
@ kButtonRelease
Definition GuiTypes.h:60
@ kButtonPress
Definition GuiTypes.h:60
@ kMotionNotify
Definition GuiTypes.h:61
@ kSunkenFrame
Definition GuiTypes.h:383
const Handle_t kNone
Definition GuiTypes.h:88
#define h(i)
Definition RSha256.hxx:106
static const double x2[5]
static const double x1[5]
char Char_t
Definition RtypesCore.h:37
const Bool_t kFALSE
Definition RtypesCore.h:92
short Color_t
Definition RtypesCore.h:83
float Float_t
Definition RtypesCore.h:57
const Bool_t kTRUE
Definition RtypesCore.h:91
#define ClassImp(name)
Definition Rtypes.h:364
@ kOrange
Definition Rtypes.h:67
@ kAzure
Definition Rtypes.h:67
#define gClient
Definition TGClient.h:166
@ kDeepCleanup
Definition TGFrame.h:50
@ kLHintsRight
Definition TGLayout.h:33
@ kLHintsExpandY
Definition TGLayout.h:38
@ kLHintsBottom
Definition TGLayout.h:36
@ kLHintsExpandX
Definition TGLayout.h:37
#define gROOT
Definition TROOT.h:406
The color creation and management class.
Definition TColor.h:19
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
Definition TColor.cxx:1769
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1102
virtual void Layout()
Layout the elements of the composite frame.
Definition TGFrame.cxx:1242
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
Definition TGFrame.cxx:1057
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1149
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition TGFrame.cxx:590
virtual void MapWindow()
map window
Definition TGFrame.h:228
virtual void UnmapWindow()
unmap window
Definition TGFrame.h:230
GL-overlay annotation.
static Color_t fgBackColor
static Color_t fgTextColor
TGMainFrame * fMainFrame
Float_t fTextSize
Bool_t fDrawRefLine
void MakeEditor()
Show the annotation editor.
void UpdateText()
Modify the annotation text from the text-edit widget.
Color_t fTextColor
TGTextEdit * fTextEdit
TGLViewer * fParent
void CloseEditor()
Close the annotation editor.
TGLFont::ETextAlignH_e fTextAlign
virtual ~TGLAnnotation()
Destructor.
virtual Bool_t MouseEnter(TGLOvlSelectRecord &selRec)
Mouse has entered overlay area.
virtual void Render(TGLRnrCtx &rnrCtx)
Render the annotation.
Char_t GetLineTransparency() const
Returns transparency of annotation outline.
TGLAnnotation(const TGLAnnotation &)
Bool_t fUseColorSet
virtual void MouseLeave()
Mouse has left overlay area.
EDrag fDrag
last mouse position
Float_t fTextSizeDrag
width and height when drawing
Char_t fTransparency
virtual Bool_t Handle(TGLRnrCtx &rnrCtx, TGLOvlSelectRecord &selRec, Event_t *event)
Handle overlay event.
Color_t fBackColor
TGLVector3 fPointer
text-size at start of drag
TGLVertex3 WorldToViewport(const TGLVertex3 &worldVertex, TGLMatrix *modviewMat=0) const
Convert a 3D world vertex to '3D' viewport (screen) one.
TGLRect & RefViewport()
Definition TGLCamera.h:128
TGLColor & Markup()
Definition TGLUtil.h:854
TGLColor & Background()
Definition TGLUtil.h:851
Color_t GetColorIndex() const
Returns color-index representing the color.
Definition TGLUtil.cxx:1217
static Int_t GetFontSize(Int_t ds)
Get availabe font size.
A wrapper class for FTFont.
Float_t GetDescent() const
Get font's descent. The returned value is positive.
Float_t GetLineHeight() const
Get font's line-height.
void BBox(const char *txt, Float_t &llx, Float_t &lly, Float_t &llz, Float_t &urx, Float_t &ury, Float_t &urz) const
Get bounding box.
void Render(const char *txt, Double_t x, Double_t y, Double_t angle, Double_t mgn) const
virtual void PostRender() const
Reset GL state after FTFont rendering.
virtual void PreRender(Bool_t autoLight=kTRUE, Bool_t lightOn=kFALSE) const
Set-up GL state before FTFont rendering.
An overlay element.
Definition TGLOverlay.h:23
Selection record for overlay objects.
Viewport (pixel base) 2D rectangle class.
Definition TGLUtil.h:422
Int_t Height() const
Definition TGLUtil.h:452
Int_t Width() const
Definition TGLUtil.h:450
Double_t Aspect() const
Definition TGLUtil.h:500
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
Definition TGLRnrCtx.h:41
void RegisterFontNoScale(Int_t size, Int_t file, Int_t mode, TGLFont &out)
Get font in the GL rendering context.
TGLColorSet & ColorSet()
Return reference to current color-set (top of the stack).
TGLCamera & RefCamera()
Definition TGLRnrCtx.h:157
Short_t ViewerLOD() const
Definition TGLRnrCtx.h:171
void ProjectionMatrixPushIdentity()
void ProjectionMatrixPop()
UInt_t GetItem(Int_t i) const
static void ColorTransparency(Color_t color_index, Char_t transparency=0)
Set color from color_index and ROOT-style transparency (default 0).
Definition TGLUtil.cxx:1735
static void Color(const TGLColor &color)
Set color from TGLColor.
Definition TGLUtil.cxx:1691
static Float_t LineWidth()
Get the line-width, taking the global scaling into account.
Definition TGLUtil.cxx:1937
3 component (x/y/z) vector class.
Definition TGLUtil.h:248
3 component (x/y/z) vertex class.
Definition TGLUtil.h:84
Base class for GL viewers.
virtual void AddOverlayElement(TGLOverlayElement *el)
Add overlay element.
Base GL viewer object - used by both standalone and embedded (in pad) GL.
Definition TGLViewer.h:55
virtual void RemoveOverlayElement(TGLOverlayElement *el)
Remove overlay element.
void RequestDraw(Short_t LOD=TGLRnrCtx::kLODMed)
Post request for redraw of viewer at level of detail 'LOD' Request is directed via cross thread gVirt...
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition TGFrame.cxx:1749
virtual Long_t ReturnLongestLineWidth()
Return width of longest line in widget.
TGText * GetText() const
Definition TGTextView.h:127
virtual void SetText(TGText *text)
Adopt a new text buffer. The text will be deleted by this object.
Long_t RowCount() const
Definition TGText.h:116
Bool_t LoadBuffer(const char *txtbuf)
Load a 0 terminated buffer. Lines will be split at ' '.
Definition TGText.cxx:513
TString AsString()
Returns content as ROOT string.
Definition TGText.cxx:1238
void Reset()
An array of TObjects.
Definition TObjArray.h:37
Collectable string class.
Definition TObjString.h:28
const TString & GetString() const
Definition TObjString.h:46
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
Definition TQObject.cxx:866
const char * Data() const
Definition TString.h:369
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
Definition TString.cxx:2217
TText * text
return c1
Definition legend1.C:41
TF1 * f1
Definition legend1.C:11
return c2
Definition legend2.C:14
TMath.
Definition TMathBase.h:35
Int_t Nint(T x)
Round to nearest integer. Rounds half integers to the nearest even integer.
Definition TMath.h:713
Short_t Max(Short_t a, Short_t b)
Definition TMathBase.h:212
Short_t Min(Short_t a, Short_t b)
Definition TMathBase.h:180
Event structure.
Definition GuiTypes.h:174
EGEventType fType
of event (see EGEventType)
Definition GuiTypes.h:175
Int_t fY
pointer x, y coordinates in event window
Definition GuiTypes.h:178
Int_t fX
Definition GuiTypes.h:178