Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TEveCaloLegoOverlay.cxx
Go to the documentation of this file.
1// @(#)root/eve:$Id$
2// Author: Alja Mrak-Tadel 2007
3
4/*************************************************************************
5 * Copyright (C) 1995-2007, 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 "TEveCaloLegoOverlay.h"
13#include "TEveCaloLegoGL.h"
14
15#include "TAxis.h"
16#include "THLimitsFinder.h"
17
18#include "TGLRnrCtx.h"
19#include "TGLIncludes.h"
20#include "TGLSelectRecord.h"
21#include "TGLUtil.h"
22#include "TGLViewerBase.h"
23#include "TGLCamera.h"
24#include "TGLAxisPainter.h"
25#include "TGLFontManager.h"
26
27#include "TEveCalo.h"
28#include "TEveCaloData.h"
29#include "TEveRGBAPalette.h"
30
31#include <KeySymbols.h>
32
33
34/** \class TEveCaloLegoOverlay
35\ingroup TEve
36GL-overlay control GUI for TEveCaloLego.
37*/
38
40
41////////////////////////////////////////////////////////////////////////////////
42/// Constructor.
43
46
47 fCalo(nullptr),
48
49 fShowScales(kTRUE),
50 fScaleColor(-1), fScaleTransparency(0),
51 fScaleCoordX(0.85), fScaleCoordY(0.65),
52 fScaleW(0), fScaleH(0),
53 fCellX(-1), fCellY(-1),
54
55 fFrameColor(-1), fFrameLineTransp(70), fFrameBgTransp(90),
56
57 fMouseX(0), fMouseY(0),
58 fInDrag(kFALSE),
59
60 fHeaderSelected(kFALSE),
61
62 fPlaneAxis(nullptr), fAxisPlaneColor(kGray),
63 fShowPlane(kFALSE),
64
65 fMenuW(0.08),
66 fButtonW(0.5),
67 fShowSlider(kFALSE),
68 fSliderH(0.6),
69 fSliderPosY(0.15),
70 fSliderVal(0),
71
72 fActiveID(-1), fActiveCol(kRed-4)
73{
74 fPlaneAxis = new TAxis();
75}
76
77/******************************************************************************/
78// Virtual event handlers from TGLOverlayElement
79/******************************************************************************/
80
82{
83 // Set height of horizontal plane in the calorimeter.
84
85 TGLRect& wprt = rnrCtx.RefCamera().RefViewport();
86 fSliderVal = (1 -event->fY*1./wprt.Height() -fSliderPosY)/fSliderH;
87
88 if (fSliderVal < 0 )
89 fSliderVal = 0;
90 else if (fSliderVal > 1)
91 fSliderVal = 1;
92
94
95 return kTRUE;
96}
97
98////////////////////////////////////////////////////////////////////////////////
99/// Handle overlay event.
100/// Return TRUE if event was handled.
101
103 TGLOvlSelectRecord & selRec,
104 Event_t * event)
105{
106 if (selRec.GetN() < 2) return kFALSE;
107
108
109 if (rnrCtx.RefCamera().IsOrthographic())
110 {
111 switch (event->fType)
112 { case kButtonPress:
113 {
114 fMouseX = event->fX;
115 fMouseY = event->fY;
116 fInDrag = kTRUE;
117 return kTRUE;
118 }
119 case kButtonRelease:
120 {
121 fInDrag = kFALSE;
122 return kTRUE;
123 }
124 case kMotionNotify:
125 {
126 if (fInDrag)
127 {
128 const TGLRect& vp = rnrCtx.RefCamera().RefViewport();
129 fScaleCoordX += (Float_t)(event->fX - fMouseX) / vp.Width();
130 fScaleCoordY -= (Float_t)(event->fY - fMouseY) / vp.Height();
131 fMouseX = event->fX;
132 fMouseY = event->fY;
133 // Make sure we don't go offscreen (use fDraw variables set in draw)
134 if (fScaleCoordX < 0)
135 fScaleCoordX = 0;
136 else if (fScaleCoordX + fScaleW > 1.0f)
137 fScaleCoordX = 1.0f - fScaleW;
138 if (fScaleCoordY < 0)
139 fScaleCoordY = 0;
140 else if (fScaleCoordY + fScaleH > 1.0f)
141 fScaleCoordY = 1.0f - fScaleH;
142 }
143 return kTRUE;
144 }
145 default:
146 break;
147 }
148 }
149
150 else
151 {
152 switch (event->fType)
153 {
154 case kMotionNotify:
155 {
156 Int_t item = selRec.GetN() < 2 ? -1 : (Int_t)selRec.GetItem(1);
157 if (fActiveID != item) {
158 fActiveID = item;
159 return kTRUE;
160 } else {
161 if (fActiveID == 2 && event->fState == 256)
162 return SetSliderVal(event, rnrCtx);
163
164 return kFALSE;
165 }
166 break;
167 }
168 case kButtonPress:
169 {
170 if (event->fCode != kButton1) {
171 return kFALSE;
172 }
173 switch (selRec.GetItem(1))
174 {
175 case 1:
178 break;
179 case 2:
180 return SetSliderVal(event, rnrCtx);
181 case 3:
183 default:
184 break;
185 }
186 }
187 default:
188 break;
189 }
190 }
191
192 return kFALSE;
193}
194
195////////////////////////////////////////////////////////////////////////////////
196/// Mouse has entered overlay area.
197
199{
200 return kTRUE;
201}
202
203////////////////////////////////////////////////////////////////////////////////
204/// Mouse has left overlay area.
205
207{
208 fActiveID = -1;
209}
210
211////////////////////////////////////////////////////////////////////////////////
212/// Set color and transparency of scales.
213
215{
216 fScaleColor = colIdx;
217 fScaleTransparency = transp;
218}
219
220////////////////////////////////////////////////////////////////////////////////
221/// Set scale coordinates in range [0,1].
222
224{
225 fScaleCoordX = x;
226 fScaleCoordY = y;
227}
228
229////////////////////////////////////////////////////////////////////////////////
230/// Set frame attributes.
231
232void TEveCaloLegoOverlay:: SetFrameAttribs(Color_t frameColor, Char_t lineTransp, Char_t bgTransp)
233{
234 fFrameColor = frameColor;
235 fFrameLineTransp = lineTransp;
236 fFrameBgTransp = bgTransp;
237}
238
239//==============================================================================
241{
242 // Render text on top right corner of the screen.
243
244 TGLRect &vp = rnrCtx.GetCamera()->RefViewport();
245
246 TGLFont font;
247 Int_t fs = TMath::Max(TMath::Nint(vp.Height()*0.035), 12);
248 rnrCtx.RegisterFontNoScale(fs, "arial", TGLFont::kPixmap, font);
249 font.PreRender();
250 Float_t off = fs*0.2;
251 Float_t bb[6];
252 font.BBox(fHeaderTxt.Data(), bb[0], bb[1], bb[2], bb[3], bb[4], bb[5]);
253 Float_t x = vp.Width() -bb[3] -off;
254 Float_t y = vp.Height() -bb[4] -off;
255 if (rnrCtx.Selection())
256 {
257 glPushName(0);
258 glLoadName(3);
259 glBegin(GL_QUADS);
260 glVertex2f(x/vp.Width(), y/ vp.Height());
261 glVertex2f(1, y/ vp.Height());
262 glVertex2f(1, 1);
263 glVertex2f(x/vp.Width(), 1);
264 glEnd();
265 glPopName();
266 }
267 else
268 {
270 glRasterPos2i(0, 0);
271 glBitmap(0, 0, 0, 0, x, y, nullptr);
272 font.Render(fHeaderTxt.Data());
273 }
274 font.PostRender();
275}
276
277////////////////////////////////////////////////////////////////////////////////
278/// Render menu for plane-value and the plane if marked.
279
281{
282 glPushAttrib(GL_ENABLE_BIT | GL_POLYGON_BIT | GL_LINE_BIT | GL_POINT_BIT);
283 glEnable(GL_POINT_SMOOTH);
284 glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
285 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
286 glEnable(GL_POLYGON_OFFSET_FILL);
287 glPolygonOffset(0.1, 1);
288 glDisable(GL_CULL_FACE);
289 glEnable(GL_BLEND);
290 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
291
292 // move to the center of menu
293 Double_t maxVal = fCalo->GetMaxVal();
294
295 // button
296 glPushMatrix();
297 glTranslatef(1 -fMenuW, (1-fButtonW )*fMenuW*0.8, 0);
298
299 glPushName(0);
300 glLoadName(1);
301 Float_t a=0.6;
303 Float_t bw = fButtonW*fMenuW*0.5;
304 Float_t bwt = bw*0.8;
306 glBegin(GL_QUADS);
307 glVertex2f(-bw, 0);
308 glVertex2f( bw, 0);
309 glVertex2f( bwt, bh);
310 glVertex2f(-bwt, bh);
311 glEnd();
312
313
315 glBegin(GL_LINES);
317 glVertex2f(0, 0); glVertex2f(0, bh);
318 glVertex2f((bw+bwt)*0.5, bh*0.5); glVertex2f(-(bw+bwt)*0.5, bh*0.5);
319 glEnd();
320
322 glBegin(GL_LINE_LOOP);
323 glVertex2f(-bw, 0);
324 glVertex2f( bw, 0);
325 glVertex2f( bwt, bh);
326 glVertex2f(-bwt, bh);
327 glEnd();
329
330 glTranslatef(0, fSliderPosY, 0.5);
331
332 if (fShowSlider)
333 {
334 // event handler
335 if (rnrCtx.Selection())
336 {
337 glLoadName(2);
338 Float_t w = fButtonW*fMenuW*0.5f;
339 glBegin(GL_QUADS);
340 glVertex2f(-w, 0);
341 glVertex2f( w, 0);
342 glVertex2f( w, fSliderH);
343 glVertex2f(-w, fSliderH);
344 glEnd();
345 }
346
347 // slider axis
349 fAxisPainter->RefDir().Set(0, 1, 0);
350 fAxisPainter->RefTMOff(0).Set(1, 0, 0);
352 fPlaneAxis->SetRangeUser(0, maxVal);
353 fPlaneAxis->SetLimits(0, maxVal);
355 fPlaneAxis->SetTickLength(0.02*maxVal);
356 fPlaneAxis->SetLabelOffset(0.02*maxVal);
358
359 glPushMatrix();
360 glScalef(fSliderH/(maxVal), fSliderH/maxVal, 1.);
362 glPopMatrix();
363
364 // marker
365 TGLUtil::Color((fActiveID == 2) ? fActiveCol : 3);
367 glBegin(GL_POINTS);
368 glVertex3f(0, fSliderVal*fSliderH, -0.1);
369 glEnd();
370 }
371
372 glPopName();
373 glPopMatrix();
374 glPopAttrib();
375}
376
377/******************************************************************************/
379{
380 // Draw slider of calo 2D in mode TEveCalo:fValSize.
381
382 TGLRect &vp = rnrCtx.GetCamera()->RefViewport();
383
384 Double_t maxVal = fCalo->GetMaxVal();
385 Int_t maxe = TMath::CeilNint(TMath::Log10(maxVal+1)); // max round exponent
386 Double_t sqv = TMath::Power(10, maxe)+1; // starting max square value
388 Double_t cellX = fCellX*fc;
389 Double_t cellY = fCellY*fc;
390
391 Double_t scaleStepY = 0.1; // step is 10% of screen
392 Double_t scaleStepX = scaleStepY*vp.Height()/vp.Width(); // step is 10% of screen
393
394 Double_t frameOff = 0.01;
395
396 // define max starting exponent not to take more than scalStepY height
397 while(cellY > scaleStepY)
398 {
399 fc = TMath::Log10(TMath::Power(10, maxe-1)+1)/TMath::Log10(TMath::Power(10, maxe)+1);
400 maxe --;
401 cellX *= fc;
402 cellY *= fc;
403 }
404
405 sqv = TMath::Power(10, maxe)+1;
406 glPushMatrix();
407 glTranslatef(fScaleCoordX + 0.5*scaleStepX + frameOff, fScaleCoordY + 0.5*scaleStepY + frameOff, 0); // translate to lower left corner
408
409 glPushAttrib(GL_ENABLE_BIT | GL_POLYGON_BIT | GL_LINE_BIT | GL_POINT_BIT);
410 glEnable(GL_BLEND);
411 glDisable(GL_CULL_FACE);
412 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
413 glEnable(GL_POLYGON_OFFSET_FILL);
414 glPolygonOffset(0.1, 1);
415
416 glPushName(0);
417 glLoadName(1);
418
419 // draw cells
420 Color_t color = fScaleColor > -1 ? fScaleColor : rnrCtx.ColorSet().Markup().GetColorIndex();
422
423 Float_t pos, dx, dy;
424 glBegin(GL_QUADS);
425 Int_t ne = 3; // max number of columns
426 for (Int_t i=0; i < ne; ++i)
427 {
428 Float_t valFac = TMath::Log10(TMath::Power(10, maxe-i)+1)/TMath::Log10(sqv);
429 dx = 0.5* cellX * valFac;
430 dy = 0.5* cellY * valFac;
431 pos = i* scaleStepY;
432 glVertex2f( - dx, pos - dy);
433 glVertex2f( - dx, pos + dy);
434 glVertex2f( + dx, pos + dy);
435 glVertex2f( + dx, pos - dy);
436 }
437 glEnd();
438
439 // draw points in case square is below pixels
440 glBegin(GL_POINTS);
441 for (Int_t i=0; i < ne; ++i)
442 glVertex2f(0, i* scaleStepY);
443 glEnd();
444
445 // draw numbers
446 TGLFont fontB;
447 Int_t fsb = TMath::Max(TMath::Nint(vp.Height()*0.03), 12);
448 rnrCtx.RegisterFontNoScale(fsb, "arial", TGLFont::kPixmap, fontB);
449 TGLFont fontE;
450 Int_t fsE = TMath::Max(TMath::Nint(vp.Height()*0.01), 8);
451 rnrCtx.RegisterFontNoScale(fsE, "arial", TGLFont::kPixmap, fontE);
452
453 Float_t llx, lly, llz, urx, ury, urz;
454 fontB.BBox("10", llx, lly, llz, urx, ury, urz);
455 Float_t expX = urx/vp.Width();
456 Float_t expY = (ury-lly)*0.5/vp.Height();
457 Float_t expOff = 1;
458 fontB.PreRender();
459 fontE.PreRender();
460 glPushMatrix();
461 glTranslatef(0.5*scaleStepX, 0, 0.1);
462 for (Int_t i = 0; i < ne; ++i)
463 {
464 if (i == maxe)
465 {
466 fontB.Render("1", 0, i*scaleStepY, 0, TGLFont::kLeft, TGLFont::kCenterV);
467 }
468 else if ( i == (maxe -1))
469 {
470 fontB.Render("10", 0, i*scaleStepY, 0, TGLFont::kLeft, TGLFont::kCenterV);
471 }
472 else
473 {
474 fontB.Render("10", 0, i*scaleStepY, 0, TGLFont::kLeft, TGLFont::kCenterV);
475 fontB.BBox(Form("%d", maxe-i), llx, lly, llz, urx, ury, urz);
476 if (expOff > urx/vp.Width()) expOff = urx/vp.Width();
477 fontE.Render(Form("%d", maxe-i), expX , i*scaleStepY+expY, 0, TGLFont::kLeft, TGLFont::kCenterV);
478 }
479 }
480 glPopMatrix();
481 fontB.PostRender();
482 fontE.PostRender();
483 if (expOff < 1) expX += expOff;
484 glPopMatrix();
485
486 // draw frame
487 {
488 fScaleW = scaleStepX + expX+ frameOff*2;
489 fScaleH = scaleStepY * ne + frameOff*2;
491 Double_t x1 = x0 + fScaleW;
493 Double_t y1 = y0 + fScaleH;
494 Double_t zf = +0.2;
495
496 color = fFrameColor > -1 ? fFrameColor : rnrCtx.ColorSet().Markup().GetColorIndex();
498
499 glBegin(GL_LINE_LOOP);
500 glVertex3f(x0, y0, zf); glVertex3f(x1, y0, zf);
501 glVertex3f(x1, y1, zf); glVertex3f(x0, y1, zf);
502 glEnd();
503
505 glBegin(GL_QUADS);
506 glVertex2f(x0, y0); glVertex2f(x1, y0);
507 glVertex2f(x1, y1); glVertex2f(x0, y1);
508 glEnd();
509 }
510 glPopName();
511
512 glPopAttrib();
513} // end draw scales
514
515////////////////////////////////////////////////////////////////////////////////
516
518{
519 // Draw slider of calo 2D in mode TEveCalo:fValColor.
520
521 glPushAttrib(GL_ENABLE_BIT | GL_POLYGON_BIT | GL_LINE_BIT);
522 glEnable(GL_BLEND);
523 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
524 glEnable(GL_POLYGON_OFFSET_FILL);
525 glPolygonOffset(0.1, 1);
526
527 TGLRect& vp = rnrCtx.RefCamera().RefViewport();
528 Double_t maxVal = fCalo->GetMaxVal();
529 Int_t bn = 0;
530 Double_t bw = 0; // bin with first second order
531 Double_t bl = 0, bh = 0; // bin low, high first
532 THLimitsFinder::Optimize(0, maxVal, 10, bl, bh, bn, bw);
533 bn = TMath::CeilNint(maxVal/bw) + 1;
534
535 fScaleH = 0.25; // relative height of the scale
536 fScaleW = fScaleH*1.5/(bn*vp.Aspect());
537 Float_t h = 0.5 * bw ;
538 Float_t w = h * 1.5/ vp.Aspect();
539
540 glPushMatrix();
541 glTranslatef(fScaleCoordX + fScaleW*0.5, fScaleCoordY + fScaleH/bn*0.5, 0); // translate to lower left corner
542 glScalef(fScaleH/(bn*bw), fScaleH/(bn*bw), 1.);
543
544 glPushName(0);
545 glLoadName(1);
547 labVec.clear();
548 Float_t val = 0;
549 for (Int_t l= 0; l<bn; l++) {
550 labVec.push_back( TGLAxisPainter::Lab_t(val, val));
551 val += bw;
552 }
553
555 fAxisPainter->RefDir().Set(0, 1, 0);
556 Int_t fs = TMath::CeilNint(rnrCtx.GetCamera()->RefViewport().Height()*0.02);
557 fAxisPainter->SetLabelFont(rnrCtx, "arial", fs);
558 fAxisPainter->SetTextFormat(0, maxVal, bw);
560 TAttAxis att;
563
564 UChar_t c[4];
565 Float_t y;
566 Double_t zf = +0.2;
567 glBegin(GL_QUADS);
568 for (TGLAxisPainter::LabVec_t::iterator it = labVec.begin(); it != labVec.end(); ++it)
569 {
570 fCalo->GetPalette()->ColorFromValue((Int_t)((*it).first), c);
571 glColor4ub( c[0], c[1], c[2], c[3]);
572
573 y = (*it).second;
574 glVertex3f( -w, y - h, zf); glVertex3f( +w, y - h, zf);
575 glVertex3f( +w, y + h, zf); glVertex3f( -w, y + h, zf);
576 }
577 glEnd();
578
580 glBegin(GL_LINE_LOOP);
581 for (TGLAxisPainter::LabVec_t::iterator it = labVec.begin(); it != labVec.end(); ++it)
582 {
583 y = (*it).second;
584 glVertex3f( -w, y - h, zf); glVertex3f( +w, y - h, zf);
585 glVertex3f( +w, y + h, zf); glVertex3f( -w, y + h, zf);
586 }
587 glEnd();
588
589 glPopName();
590 glPopMatrix();
591 glPopAttrib();
592}
593
594////////////////////////////////////////////////////////////////////////////////
595
597{
598 // Draw calorimeter scale info and plane interface.
599
600 if ( fCalo == nullptr || fCalo->GetData()->Empty()) return;
601
602 Float_t old_depth_range[2];
603 glGetFloatv(GL_DEPTH_RANGE, old_depth_range);
604 glDepthRange(0, 0.001);
605
606 glMatrixMode(GL_PROJECTION);
607 glPushMatrix();
608 glLoadIdentity();
609 if (rnrCtx.Selection())
610 {
611 TGLRect rect(*rnrCtx.GetPickRectangle());
613 gluPickMatrix(rect.X(), rect.Y(), rect.Width(), rect.Height(),
614 (Int_t*) rnrCtx.GetCamera()->RefViewport().CArr());
615 }
616 glMatrixMode(GL_MODELVIEW);
617 glPushMatrix();
618 glLoadIdentity();
619
620 glTranslatef(-1, -1, 0);
621 glScalef(2, 2, 1);
622
623
624 TGLCapabilitySwitch lights_off(GL_LIGHTING, kFALSE);
625 TGLCamera& cam = rnrCtx.RefCamera();
626 Bool_t drawOverlayAxis = kTRUE;
627
628 if (cam.IsOrthographic())
629 {
630 // in 2D need pixel cell dimension
631 // project lego eta-phi boundaries
634 TGLVector3 res = cam.WorldDeltaToViewport(p, rng);
635
636 TEveCaloLegoGL* lgl = dynamic_cast<TEveCaloLegoGL*>(rnrCtx.RefViewer().FindLogicalInScenes(fCalo));
637 if (fShowScales && lgl)
638 {
639
640 // get smallest bin
641 Double_t sq = 1e4;
642 if (lgl->fBinStep == 1)
643 {
645 for ( TEveCaloData::vCellId_t::iterator i = fCalo->fCellList.begin(); i != fCalo->fCellList.end(); ++i)
646 {
647 fCalo->fData->GetCellData(*i, cellData);
648 if (sq > cellData.EtaDelta()) sq = cellData.EtaDelta();
649 if (sq > cellData.PhiDelta()) sq = cellData.PhiDelta();
650 }
651 }
652 else
653 {
654 TAxis* a;
655 Int_t nb;
656 a = fCalo->GetData()->GetEtaBins();
657 nb = a->GetNbins();
658 for (Int_t i=1 ; i<=nb; i++)
659 {
660 if (sq > a->GetBinWidth(i)) sq = a->GetBinWidth(i);
661 }
662
663 a = fCalo->GetData()->GetPhiBins();
664 nb = a->GetNbins();
665 for (Int_t i=1 ; i<=nb; i++)
666 {
667 if (sq > a->GetBinWidth(i)) sq = a->GetBinWidth(i);
668 }
669
670 sq *= lgl->fBinStep;
671 }
672 fCellX = (res.X()*sq)/(fCalo->GetEtaRng()*1.*cam.RefViewport().Width());
673 fCellY = (res.Y()*sq)/(fCalo->GetPhiRng()*1.*cam.RefViewport().Height());
674 // printf("bin width %f cells size %f %f\n", sq, fCellX, fCellY);
677 else if (fCalo->GetPalette())
678 RenderPaletteScales(rnrCtx);
679 }
680
681 // draw camera overlay if projected lego bbox to large
682 SetFrustum(cam);
683 if ( fCalo->GetEtaMin() > fFrustum[0] && fCalo->GetEtaMax() < fFrustum[2]
684 && fCalo->GetPhiMin() > fFrustum[1] && fCalo->GetPhiMax() < fFrustum[3])
685 drawOverlayAxis = kFALSE;
686 }
687
688 if (cam.IsPerspective() && fShowPlane)
689 {
690 RenderPlaneInterface(rnrCtx);
691 }
692
693 // draw info text on top right corner
694 if (fHeaderTxt.Length())
695 {
696 RenderHeader(rnrCtx);
697 }
698
699 glPopMatrix();
700 glMatrixMode(GL_PROJECTION);
701 glPopMatrix();
702 glMatrixMode(GL_MODELVIEW);
703
704 glDepthRange(old_depth_range[0], old_depth_range[1]);
705
706 if (drawOverlayAxis) TGLCameraOverlay::Render(rnrCtx);
707}
#define GL_QUADS
Definition GL_glu.h:290
#define GL_LINES
Definition GL_glu.h:284
#define GL_POINTS
Definition GL_glu.h:283
#define GL_LINE_LOOP
Definition GL_glu.h:285
@ kButtonRelease
Definition GuiTypes.h:60
@ kButtonPress
Definition GuiTypes.h:60
@ kMotionNotify
Definition GuiTypes.h:61
@ kButton1
Definition GuiTypes.h:214
#define c(i)
Definition RSha256.hxx:101
#define a(i)
Definition RSha256.hxx:99
#define h(i)
Definition RSha256.hxx:106
int Int_t
Definition RtypesCore.h:45
short Color_t
Definition RtypesCore.h:92
unsigned char UChar_t
Definition RtypesCore.h:38
char Char_t
Definition RtypesCore.h:37
float Float_t
Definition RtypesCore.h:57
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
#define ClassImp(name)
Definition Rtypes.h:377
@ kGray
Definition Rtypes.h:65
@ kRed
Definition Rtypes.h:66
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t rect
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize fs
Option_t Option_t TPoint TPoint const char y1
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2489
Manages histogram axis attributes.
Definition TAttAxis.h:18
virtual void SetLabelSize(Float_t size=0.04)
Set size of axis labels.
Definition TAttAxis.cxx:203
virtual void SetLabelOffset(Float_t offset=0.005)
Set distance between the axis and the labels.
Definition TAttAxis.cxx:191
virtual void SetTickLength(Float_t length=0.03)
Set tick mark length.
Definition TAttAxis.cxx:284
virtual void SetNdivisions(Int_t n=510, Bool_t optim=kTRUE)
Set the number of divisions for this axis.
Definition TAttAxis.cxx:233
Class to manage histogram axis.
Definition TAxis.h:31
virtual void SetLimits(Double_t xmin, Double_t xmax)
Definition TAxis.h:164
virtual void SetRangeUser(Double_t ufirst, Double_t ulast)
Set the viewing range for the axis from ufirst to ulast (in user coordinates, that is,...
Definition TAxis.cxx:1080
Bool_t Empty() const
virtual void GetCellData(const CellId_t &id, CellData_t &data) const =0
virtual TAxis * GetEtaBins() const
virtual TAxis * GetPhiBins() const
OpenGL renderer class for TEveCaloLego.
GL-overlay control GUI for TEveCaloLego.
Bool_t fInDrag
last mouse position
void RenderPlaneInterface(TGLRnrCtx &rnrCtx)
Render menu for plane-value and the plane if marked.
void RenderHeader(TGLRnrCtx &rnrCtx)
void SetScaleColorTransparency(Color_t colIdx, Char_t transp)
Set color and transparency of scales.
Bool_t MouseEnter(TGLOvlSelectRecord &selRec) override
Mouse has entered overlay area.
void Render(TGLRnrCtx &rnrCtx) override
void MouseLeave() override
Mouse has left overlay area.
TEveCaloLegoOverlay()
Constructor.
void RenderPaletteScales(TGLRnrCtx &rnrCtx)
Bool_t SetSliderVal(Event_t *event, TGLRnrCtx &rnrCtx)
void SetScalePosition(Double_t x, Double_t y)
Set scale coordinates in range [0,1].
void RenderLogaritmicScales(TGLRnrCtx &rnrCtx)
Bool_t Handle(TGLRnrCtx &rnrCtx, TGLOvlSelectRecord &selRec, Event_t *event) override
Handle overlay event.
void SetFrameAttribs(Color_t frameCol, Char_t lineTransp, Char_t bgTransp)
Set frame attributes.
Color_t GetFontColor() const
Definition TEveCalo.h:301
void SetHPlaneVal(Float_t s)
Definition TEveCalo.h:344
TEveCaloData::vCellId_t fCellList
Definition TEveCalo.h:265
E2DMode_e Get2DMode()
Definition TEveCalo.h:329
void SetDrawHPlane(Bool_t s)
Definition TEveCalo.h:341
Float_t GetEtaMin() const
Definition TEveCalo.h:137
TEveRGBAPalette * GetPalette() const
Definition TEveCalo.h:125
Float_t GetPhiRng() const
Definition TEveCalo.h:147
Float_t GetMaxVal() const
Definition TEveCalo.cxx:159
TEveCaloData * GetData() const
Definition TEveCalo.h:87
Float_t GetEtaMax() const
Definition TEveCalo.h:138
TEveCaloData * fData
Definition TEveCalo.h:40
Float_t GetPhiMax() const
Definition TEveCalo.h:146
Float_t GetEtaRng() const
Definition TEveCalo.h:139
Float_t GetPhiMin() const
Definition TEveCalo.h:145
const UChar_t * ColorFromValue(Int_t val) const
void RnrLabels() const
Render label reading prepared list ov value-pos pairs.
void SetLabelFont(TGLRnrCtx &rnrCtx, const char *fontName, Int_t pixelSize=64, Double_t font3DSize=-1)
Set label font derived from TAttAxis.
TGLVector3 & RefDir()
void SetLabelAlign(TGLFont::ETextAlignH_e, TGLFont::ETextAlignV_e)
Set label align.
std::vector< Lab_t > LabVec_t
LabVec_t & RefLabVec()
void SetTextFormat(Double_t min, Double_t max, Double_t binWidth)
Construct print format from given primary bin width.
void SetAttAxis(TAttAxis *a)
void SetLabelPixelFontSize(Int_t fs)
std::pair< Float_t, Float_t > Lab_t
TGLVector3 & RefTMOff(Int_t i)
void PaintAxis(TGLRnrCtx &ctx, TAxis *ax)
GL render TAxis.
A GL overlay element which displays camera furstum.
TGLAxisPainter * fAxisPainter
void SetFrustum(TGLCamera &cam)
Set frustum values from given camera.
TAttAxis * GetAttAxis()
Get axis attributes.
void Render(TGLRnrCtx &rnrCtx) override
Display coordinates info of current frustum.
Abstract base camera class - concrete classes for orthographic and perspective cameras derive from it...
Definition TGLCamera.h:44
virtual Bool_t IsPerspective() const
Definition TGLCamera.h:119
TGLVector3 WorldDeltaToViewport(const TGLVertex3 &worldRef, const TGLVector3 &worldDelta) const
Convert a 3D vector worldDelta (shift) about vertex worldRef to a viewport (screen) '3D' vector.
void WindowToViewport(Int_t &, Int_t &y) const
Definition TGLCamera.h:198
virtual Bool_t IsOrthographic() const
Definition TGLCamera.h:118
TGLRect & RefViewport()
Definition TGLCamera.h:128
TGLColor & Markup()
Definition TGLUtil.h:854
Color_t GetColorIndex() const
Returns color-index representing the color.
Definition TGLUtil.cxx:1217
A wrapper class for FTFont.
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.
Selection record for overlay objects.
Viewport (pixel base) 2D rectangle class.
Definition TGLUtil.h:422
const Int_t * CArr() const
Definition TGLUtil.h:443
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
TGLRect * GetPickRectangle()
Return current pick rectangle.
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
TGLViewerBase & RefViewer()
Definition TGLRnrCtx.h:155
TGLCamera * GetCamera()
Definition TGLRnrCtx.h:156
Bool_t Selection() const
Definition TGLRnrCtx.h:222
UInt_t GetItem(Int_t i) const
static void Color4f(Float_t r, Float_t g, Float_t b, Float_t a)
Wrapper for glColor4f.
Definition TGLUtil.cxx:1795
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:1741
static void Color(const TGLColor &color)
Set color from TGLColor.
Definition TGLUtil.cxx:1697
static Float_t PointSize()
Get the point-size, taking the global scaling into account.
Definition TGLUtil.cxx:1935
static Float_t LineWidth()
Get the line-width, taking the global scaling into account.
Definition TGLUtil.cxx:1943
3 component (x/y/z) vector class.
Definition TGLUtil.h:248
3 component (x/y/z) vertex class.
Definition TGLUtil.h:84
Double_t X() const
Definition TGLUtil.h:119
void Set(Double_t x, Double_t y, Double_t z)
Definition TGLUtil.h:210
Double_t Y() const
Definition TGLUtil.h:121
TGLLogicalShape * FindLogicalInScenes(TObject *id)
Find logical-shape representing object id in the list of scenes.
static void Optimize(Double_t A1, Double_t A2, Int_t nold, Double_t &BinLow, Double_t &BinHigh, Int_t &nbins, Double_t &BWID, Option_t *option="")
Static function to compute reasonable axis limits.
Ssiz_t Length() const
Definition TString.h:417
const char * Data() const
Definition TString.h:376
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
Int_t Nint(T x)
Round to nearest integer. Rounds half integers to the nearest even integer.
Definition TMath.h:693
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Definition TMathBase.h:250
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.
Definition TMath.h:721
Int_t CeilNint(Double_t x)
Returns the nearest integer of TMath::Ceil(x).
Definition TMath.h:674
Double_t Log10(Double_t x)
Returns the common (base-10) logarithm of x.
Definition TMath.h:762
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
UInt_t fState
key or button mask
Definition GuiTypes.h:181
Int_t fX
Definition GuiTypes.h:178
UInt_t fCode
key or button code
Definition GuiTypes.h:180
Cell data inner structure.
Float_t PhiDelta() const
Float_t EtaDelta() const
TLine l
Definition textangle.C:4