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
39
40////////////////////////////////////////////////////////////////////////////////
41/// Constructor.
42
45
46 fCalo(nullptr),
47
50 fScaleCoordX(0.85), fScaleCoordY(0.65),
51 fScaleW(0), fScaleH(0),
52 fCellX(-1), fCellY(-1),
53
55
56 fMouseX(0), fMouseY(0),
58
60
63
64 fMenuW(0.08),
65 fButtonW(0.5),
67 fSliderH(0.6),
68 fSliderPosY(0.15),
69 fSliderVal(0),
70
72{
73 fPlaneAxis = new TAxis();
74}
75
76/******************************************************************************/
77// Virtual event handlers from TGLOverlayElement
78/******************************************************************************/
79
81{
82 // Set height of horizontal plane in the calorimeter.
83
84 TGLRect& wprt = rnrCtx.RefCamera().RefViewport();
85 fSliderVal = (1 -event->fY*1./wprt.Height() -fSliderPosY)/fSliderH;
86
87 if (fSliderVal < 0 )
88 fSliderVal = 0;
89 else if (fSliderVal > 1)
90 fSliderVal = 1;
91
92 fCalo->SetHPlaneVal(fSliderVal);
93
94 return kTRUE;
95}
96
97////////////////////////////////////////////////////////////////////////////////
98/// Handle overlay event.
99/// Return TRUE if event was handled.
100
102 TGLOvlSelectRecord & selRec,
103 Event_t * event)
104{
105 if (selRec.GetN() < 2) return kFALSE;
106
107
108 if (rnrCtx.RefCamera().IsOrthographic())
109 {
110 switch (event->fType)
111 { case kButtonPress:
112 {
113 fMouseX = event->fX;
114 fMouseY = event->fY;
115 fInDrag = kTRUE;
116 return kTRUE;
117 }
118 case kButtonRelease:
119 {
120 fInDrag = kFALSE;
121 return kTRUE;
122 }
123 case kMotionNotify:
124 {
125 if (fInDrag)
126 {
127 const TGLRect& vp = rnrCtx.RefCamera().RefViewport();
128 fScaleCoordX += (Float_t)(event->fX - fMouseX) / vp.Width();
129 fScaleCoordY -= (Float_t)(event->fY - fMouseY) / vp.Height();
130 fMouseX = event->fX;
131 fMouseY = event->fY;
132 // Make sure we don't go offscreen (use fDraw variables set in draw)
133 if (fScaleCoordX < 0)
134 fScaleCoordX = 0;
135 else if (fScaleCoordX + fScaleW > 1.0f)
136 fScaleCoordX = 1.0f - fScaleW;
137 if (fScaleCoordY < 0)
138 fScaleCoordY = 0;
139 else if (fScaleCoordY + fScaleH > 1.0f)
140 fScaleCoordY = 1.0f - fScaleH;
141 }
142 return kTRUE;
143 }
144 default:
145 break;
146 }
147 }
148
149 else
150 {
151 switch (event->fType)
152 {
153 case kMotionNotify:
154 {
155 Int_t item = selRec.GetN() < 2 ? -1 : (Int_t)selRec.GetItem(1);
156 if (fActiveID != item) {
157 fActiveID = item;
158 return kTRUE;
159 } else {
160 if (fActiveID == 2 && event->fState == 256)
161 return SetSliderVal(event, rnrCtx);
162
163 return kFALSE;
164 }
165 break;
166 }
167 case kButtonPress:
168 {
169 if (event->fCode != kButton1) {
170 return kFALSE;
171 }
172 switch (selRec.GetItem(1))
173 {
174 case 1:
176 fCalo->SetDrawHPlane(fShowSlider);
177 break;
178 case 2:
179 return SetSliderVal(event, rnrCtx);
180 case 3:
182 default:
183 break;
184 }
185 }
186 default:
187 break;
188 }
189 }
190
191 return kFALSE;
192}
193
194////////////////////////////////////////////////////////////////////////////////
195/// Mouse has entered overlay area.
196
201
202////////////////////////////////////////////////////////////////////////////////
203/// Mouse has left overlay area.
204
209
210////////////////////////////////////////////////////////////////////////////////
211/// Set color and transparency of scales.
212
214{
215 fScaleColor = colIdx;
216 fScaleTransparency = transp;
217}
218
219////////////////////////////////////////////////////////////////////////////////
220/// Set scale coordinates in range [0,1].
221
227
228////////////////////////////////////////////////////////////////////////////////
229/// Set frame attributes.
230
231void TEveCaloLegoOverlay:: SetFrameAttribs(Color_t frameColor, Char_t lineTransp, Char_t bgTransp)
232{
233 fFrameColor = frameColor;
234 fFrameLineTransp = lineTransp;
235 fFrameBgTransp = bgTransp;
236}
237
238//==============================================================================
240{
241 // Render text on top right corner of the screen.
242
243 TGLRect &vp = rnrCtx.GetCamera()->RefViewport();
244
245 TGLFont font;
246 Int_t fs = TMath::Max(TMath::Nint(vp.Height()*0.035), 12);
247 rnrCtx.RegisterFontNoScale(fs, "arial", TGLFont::kPixmap, font);
248 font.PreRender();
249 Float_t off = fs*0.2;
250 Float_t bb[6];
251 font.BBox(fHeaderTxt.Data(), bb[0], bb[1], bb[2], bb[3], bb[4], bb[5]);
252 Float_t x = vp.Width() -bb[3] -off;
253 Float_t y = vp.Height() -bb[4] -off;
254 if (rnrCtx.Selection())
255 {
256 glPushName(0);
257 glLoadName(3);
258 glBegin(GL_QUADS);
259 glVertex2f(x/vp.Width(), y/ vp.Height());
260 glVertex2f(1, y/ vp.Height());
261 glVertex2f(1, 1);
262 glVertex2f(x/vp.Width(), 1);
263 glEnd();
264 glPopName();
265 }
266 else
267 {
268 TGLUtil::Color(fHeaderSelected ? fActiveCol : fCalo->GetFontColor());
269 glRasterPos2i(0, 0);
270 glBitmap(0, 0, 0, 0, x, y, nullptr);
271 font.Render(fHeaderTxt.Data());
272 }
273 font.PostRender();
274}
275
276////////////////////////////////////////////////////////////////////////////////
277/// Render menu for plane-value and the plane if marked.
278
280{
281 glPushAttrib(GL_ENABLE_BIT | GL_POLYGON_BIT | GL_LINE_BIT | GL_POINT_BIT);
282 glEnable(GL_POINT_SMOOTH);
283 glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
284 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
285 glEnable(GL_POLYGON_OFFSET_FILL);
286 glPolygonOffset(0.1, 1);
287 glDisable(GL_CULL_FACE);
288 glEnable(GL_BLEND);
289 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
290
291 // move to the center of menu
292 Double_t maxVal = fCalo->GetMaxVal();
293
294 // button
295 glPushMatrix();
296 glTranslatef(1 -fMenuW, (1-fButtonW )*fMenuW*0.8, 0);
297
298 glPushName(0);
299 glLoadName(1);
300 Float_t a=0.6;
302 Float_t bw = fButtonW*fMenuW*0.5;
303 Float_t bwt = bw*0.8;
305 glBegin(GL_QUADS);
306 glVertex2f(-bw, 0);
307 glVertex2f( bw, 0);
308 glVertex2f( bwt, bh);
309 glVertex2f(-bwt, bh);
310 glEnd();
311
312
314 glBegin(GL_LINES);
316 glVertex2f(0, 0); glVertex2f(0, bh);
317 glVertex2f((bw+bwt)*0.5, bh*0.5); glVertex2f(-(bw+bwt)*0.5, bh*0.5);
318 glEnd();
319
321 glBegin(GL_LINE_LOOP);
322 glVertex2f(-bw, 0);
323 glVertex2f( bw, 0);
324 glVertex2f( bwt, bh);
325 glVertex2f(-bwt, bh);
326 glEnd();
328
329 glTranslatef(0, fSliderPosY, 0.5);
330
331 if (fShowSlider)
332 {
333 // event handler
334 if (rnrCtx.Selection())
335 {
336 glLoadName(2);
337 Float_t w = fButtonW*fMenuW*0.5f;
338 glBegin(GL_QUADS);
339 glVertex2f(-w, 0);
340 glVertex2f( w, 0);
341 glVertex2f( w, fSliderH);
342 glVertex2f(-w, fSliderH);
343 glEnd();
344 }
345
346 // slider axis
347 fAxisPainter->SetLabelPixelFontSize(TMath::CeilNint(rnrCtx.GetCamera()->RefViewport().Height()*GetAttAxis()->GetLabelSize()));
348 fAxisPainter->RefDir().Set(0, 1, 0);
349 fAxisPainter->RefTMOff(0).Set(1, 0, 0);
351 fPlaneAxis->SetRangeUser(0, maxVal);
352 fPlaneAxis->SetLimits(0, maxVal);
353 fPlaneAxis->SetNdivisions(710);
354 fPlaneAxis->SetTickLength(0.02*maxVal);
355 fPlaneAxis->SetLabelOffset(0.02*maxVal);
356 fPlaneAxis->SetLabelSize(0.05);
357
358 glPushMatrix();
359 glScalef(fSliderH/(maxVal), fSliderH/maxVal, 1.);
360 fAxisPainter->PaintAxis(rnrCtx, fPlaneAxis);
361 glPopMatrix();
362
363 // marker
364 TGLUtil::Color((fActiveID == 2) ? fActiveCol : 3);
366 glBegin(GL_POINTS);
367 glVertex3f(0, fSliderVal*fSliderH, -0.1);
368 glEnd();
369 }
370
371 glPopName();
372 glPopMatrix();
373 glPopAttrib();
374}
375
376/******************************************************************************/
378{
379 // Draw slider of calo 2D in mode TEveCalo:fValSize.
380
381 TGLRect &vp = rnrCtx.GetCamera()->RefViewport();
382
383 Double_t maxVal = fCalo->GetMaxVal();
384 Int_t maxe = TMath::CeilNint(TMath::Log10(maxVal+1)); // max round exponent
385 Double_t sqv = TMath::Power(10, maxe)+1; // starting max square value
386 Double_t fc = TMath::Log10(sqv)/TMath::Log10(fCalo->GetMaxVal()+1);
387 Double_t cellX = fCellX*fc;
388 Double_t cellY = fCellY*fc;
389
390 Double_t scaleStepY = 0.1; // step is 10% of screen
391 Double_t scaleStepX = scaleStepY*vp.Height()/vp.Width(); // step is 10% of screen
392
393 Double_t frameOff = 0.01;
394
395 // define max starting exponent not to take more than scalStepY height
396 while(cellY > scaleStepY)
397 {
398 fc = TMath::Log10(TMath::Power(10, maxe-1)+1)/TMath::Log10(TMath::Power(10, maxe)+1);
399 maxe --;
400 cellX *= fc;
401 cellY *= fc;
402 }
403
404 sqv = TMath::Power(10, maxe)+1;
405 glPushMatrix();
406 glTranslatef(fScaleCoordX + 0.5*scaleStepX + frameOff, fScaleCoordY + 0.5*scaleStepY + frameOff, 0); // translate to lower left corner
407
408 glPushAttrib(GL_ENABLE_BIT | GL_POLYGON_BIT | GL_LINE_BIT | GL_POINT_BIT);
409 glEnable(GL_BLEND);
410 glDisable(GL_CULL_FACE);
411 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
412 glEnable(GL_POLYGON_OFFSET_FILL);
413 glPolygonOffset(0.1, 1);
414
415 glPushName(0);
416 glLoadName(1);
417
418 // draw cells
419 Color_t color = fScaleColor > -1 ? fScaleColor : rnrCtx.ColorSet().Markup().GetColorIndex();
421
422 Float_t pos, dx, dy;
423 glBegin(GL_QUADS);
424 Int_t ne = 3; // max number of columns
425 for (Int_t i=0; i < ne; ++i)
426 {
427 Float_t valFac = TMath::Log10(TMath::Power(10, maxe-i)+1)/TMath::Log10(sqv);
428 dx = 0.5* cellX * valFac;
429 dy = 0.5* cellY * valFac;
430 pos = i* scaleStepY;
431 glVertex2f( - dx, pos - dy);
432 glVertex2f( - dx, pos + dy);
433 glVertex2f( + dx, pos + dy);
434 glVertex2f( + dx, pos - dy);
435 }
436 glEnd();
437
438 // draw points in case square is below pixels
439 glBegin(GL_POINTS);
440 for (Int_t i=0; i < ne; ++i)
441 glVertex2f(0, i* scaleStepY);
442 glEnd();
443
444 // draw numbers
445 TGLFont fontB;
446 Int_t fsb = TMath::Max(TMath::Nint(vp.Height()*0.03), 12);
447 rnrCtx.RegisterFontNoScale(fsb, "arial", TGLFont::kPixmap, fontB);
448 TGLFont fontE;
449 Int_t fsE = TMath::Max(TMath::Nint(vp.Height()*0.01), 8);
450 rnrCtx.RegisterFontNoScale(fsE, "arial", TGLFont::kPixmap, fontE);
451
452 Float_t llx, lly, llz, urx, ury, urz;
453 fontB.BBox("10", llx, lly, llz, urx, ury, urz);
454 Float_t expX = urx/vp.Width();
455 Float_t expY = (ury-lly)*0.5/vp.Height();
456 Float_t expOff = 1;
457 fontB.PreRender();
458 fontE.PreRender();
459 glPushMatrix();
460 glTranslatef(0.5*scaleStepX, 0, 0.1);
461 for (Int_t i = 0; i < ne; ++i)
462 {
463 if (i == maxe)
464 {
465 fontB.Render("1", 0, i*scaleStepY, 0, TGLFont::kLeft, TGLFont::kCenterV);
466 }
467 else if ( i == (maxe -1))
468 {
469 fontB.Render("10", 0, i*scaleStepY, 0, TGLFont::kLeft, TGLFont::kCenterV);
470 }
471 else
472 {
473 fontB.Render("10", 0, i*scaleStepY, 0, TGLFont::kLeft, TGLFont::kCenterV);
474 fontB.BBox(Form("%d", maxe-i), llx, lly, llz, urx, ury, urz);
475 if (expOff > urx/vp.Width()) expOff = urx/vp.Width();
476 fontE.Render(Form("%d", maxe-i), expX , i*scaleStepY+expY, 0, TGLFont::kLeft, TGLFont::kCenterV);
477 }
478 }
479 glPopMatrix();
480 fontB.PostRender();
481 fontE.PostRender();
482 if (expOff < 1) expX += expOff;
483 glPopMatrix();
484
485 // draw frame
486 {
487 fScaleW = scaleStepX + expX+ frameOff*2;
488 fScaleH = scaleStepY * ne + frameOff*2;
490 Double_t x1 = x0 + fScaleW;
492 Double_t y1 = y0 + fScaleH;
493 Double_t zf = +0.2;
494
495 color = fFrameColor > -1 ? fFrameColor : rnrCtx.ColorSet().Markup().GetColorIndex();
497
498 glBegin(GL_LINE_LOOP);
499 glVertex3f(x0, y0, zf); glVertex3f(x1, y0, zf);
500 glVertex3f(x1, y1, zf); glVertex3f(x0, y1, zf);
501 glEnd();
502
504 glBegin(GL_QUADS);
505 glVertex2f(x0, y0); glVertex2f(x1, y0);
506 glVertex2f(x1, y1); glVertex2f(x0, y1);
507 glEnd();
508 }
509 glPopName();
510
511 glPopAttrib();
512} // end draw scales
513
514////////////////////////////////////////////////////////////////////////////////
515
517{
518 // Draw slider of calo 2D in mode TEveCalo:fValColor.
519
520 glPushAttrib(GL_ENABLE_BIT | GL_POLYGON_BIT | GL_LINE_BIT);
521 glEnable(GL_BLEND);
522 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
523 glEnable(GL_POLYGON_OFFSET_FILL);
524 glPolygonOffset(0.1, 1);
525
526 TGLRect& vp = rnrCtx.RefCamera().RefViewport();
527 Double_t maxVal = fCalo->GetMaxVal();
528 Int_t bn = 0;
529 Double_t bw = 0; // bin with first second order
530 Double_t bl = 0, bh = 0; // bin low, high first
531 THLimitsFinder::Optimize(0, maxVal, 10, bl, bh, bn, bw);
532 bn = TMath::CeilNint(maxVal/bw) + 1;
533
534 fScaleH = 0.25; // relative height of the scale
535 fScaleW = fScaleH*1.5/(bn*vp.Aspect());
536 Float_t h = 0.5 * bw ;
537 Float_t w = h * 1.5/ vp.Aspect();
538
539 glPushMatrix();
540 glTranslatef(fScaleCoordX + fScaleW*0.5, fScaleCoordY + fScaleH/bn*0.5, 0); // translate to lower left corner
541 glScalef(fScaleH/(bn*bw), fScaleH/(bn*bw), 1.);
542
543 glPushName(0);
544 glLoadName(1);
545 TGLAxisPainter::LabVec_t &labVec = fAxisPainter->RefLabVec();
546 labVec.clear();
547 Float_t val = 0;
548 for (Int_t l= 0; l<bn; l++) {
549 labVec.push_back( TGLAxisPainter::Lab_t(val, val));
550 val += bw;
551 }
552
554 fAxisPainter->RefDir().Set(0, 1, 0);
555 Int_t fs = TMath::CeilNint(rnrCtx.GetCamera()->RefViewport().Height()*0.02);
556 fAxisPainter->SetLabelFont(rnrCtx, "arial", fs);
557 fAxisPainter->SetTextFormat(0, maxVal, bw);
559 TAttAxis att;
560 fAxisPainter->SetAttAxis(&att);
561 fAxisPainter->RnrLabels();
562
563 UChar_t c[4];
564 Float_t y;
565 Double_t zf = +0.2;
566 glBegin(GL_QUADS);
567 for (TGLAxisPainter::LabVec_t::iterator it = labVec.begin(); it != labVec.end(); ++it)
568 {
569 fCalo->GetPalette()->ColorFromValue((Int_t)((*it).first), c);
570 glColor4ub( c[0], c[1], c[2], c[3]);
571
572 y = (*it).second;
573 glVertex3f( -w, y - h, zf); glVertex3f( +w, y - h, zf);
574 glVertex3f( +w, y + h, zf); glVertex3f( -w, y + h, zf);
575 }
576 glEnd();
577
579 glBegin(GL_LINE_LOOP);
580 for (TGLAxisPainter::LabVec_t::iterator it = labVec.begin(); it != labVec.end(); ++it)
581 {
582 y = (*it).second;
583 glVertex3f( -w, y - h, zf); glVertex3f( +w, y - h, zf);
584 glVertex3f( +w, y + h, zf); glVertex3f( -w, y + h, zf);
585 }
586 glEnd();
587
588 glPopName();
589 glPopMatrix();
590 glPopAttrib();
591}
592
593////////////////////////////////////////////////////////////////////////////////
594
596{
597 // Draw calorimeter scale info and plane interface.
598
599 if ( fCalo == nullptr || fCalo->GetData()->Empty()) return;
600
601 Float_t old_depth_range[2];
602 glGetFloatv(GL_DEPTH_RANGE, old_depth_range);
603 glDepthRange(0, 0.001);
604
605 glMatrixMode(GL_PROJECTION);
606 glPushMatrix();
607 glLoadIdentity();
608 if (rnrCtx.Selection())
609 {
610 TGLRect rect(*rnrCtx.GetPickRectangle());
611 rnrCtx.GetCamera()->WindowToViewport(rect);
612 gluPickMatrix(rect.X(), rect.Y(), rect.Width(), rect.Height(),
613 (Int_t*) rnrCtx.GetCamera()->RefViewport().CArr());
614 }
615 glMatrixMode(GL_MODELVIEW);
616 glPushMatrix();
617 glLoadIdentity();
618
619 glTranslatef(-1, -1, 0);
620 glScalef(2, 2, 1);
621
622
623 TGLCapabilitySwitch lights_off(GL_LIGHTING, kFALSE);
624 TGLCamera& cam = rnrCtx.RefCamera();
625 Bool_t drawOverlayAxis = kTRUE;
626
627 if (cam.IsOrthographic())
628 {
629 // in 2D need pixel cell dimension
630 // project lego eta-phi boundaries
631 TGLVector3 rng(fCalo->GetEtaRng(), fCalo->GetPhiRng(), 0);
632 TGLVertex3 p;
633 TGLVector3 res = cam.WorldDeltaToViewport(p, rng);
634
635 TEveCaloLegoGL* lgl = dynamic_cast<TEveCaloLegoGL*>(rnrCtx.RefViewer().FindLogicalInScenes(fCalo));
636 if (fShowScales && lgl)
637 {
638
639 // get smallest bin
640 Double_t sq = 1e4;
641 if (lgl->fBinStep == 1)
642 {
644 for ( TEveCaloData::vCellId_t::iterator i = fCalo->fCellList.begin(); i != fCalo->fCellList.end(); ++i)
645 {
646 fCalo->fData->GetCellData(*i, cellData);
647 if (sq > cellData.EtaDelta()) sq = cellData.EtaDelta();
648 if (sq > cellData.PhiDelta()) sq = cellData.PhiDelta();
649 }
650 }
651 else
652 {
653 TAxis* a;
654 Int_t nb;
655 a = fCalo->GetData()->GetEtaBins();
656 nb = a->GetNbins();
657 for (Int_t i=1 ; i<=nb; i++)
658 {
659 if (sq > a->GetBinWidth(i)) sq = a->GetBinWidth(i);
660 }
661
662 a = fCalo->GetData()->GetPhiBins();
663 nb = a->GetNbins();
664 for (Int_t i=1 ; i<=nb; i++)
665 {
666 if (sq > a->GetBinWidth(i)) sq = a->GetBinWidth(i);
667 }
668
669 sq *= lgl->fBinStep;
670 }
671 fCellX = (res.X()*sq)/(fCalo->GetEtaRng()*1.*cam.RefViewport().Width());
672 fCellY = (res.Y()*sq)/(fCalo->GetPhiRng()*1.*cam.RefViewport().Height());
673 // printf("bin width %f cells size %f %f\n", sq, fCellX, fCellY);
674 if (fCalo->Get2DMode() == TEveCaloLego::kValSize)
676 else if (fCalo->GetPalette())
677 RenderPaletteScales(rnrCtx);
678 }
679
680 // draw camera overlay if projected lego bbox to large
681 SetFrustum(cam);
682 if ( fCalo->GetEtaMin() > fFrustum[0] && fCalo->GetEtaMax() < fFrustum[2]
683 && fCalo->GetPhiMin() > fFrustum[1] && fCalo->GetPhiMax() < fFrustum[3])
684 drawOverlayAxis = kFALSE;
685 }
686
687 if (cam.IsPerspective() && fShowPlane)
688 {
689 RenderPlaneInterface(rnrCtx);
690 }
691
692 // draw info text on top right corner
693 if (fHeaderTxt.Length())
694 {
695 RenderHeader(rnrCtx);
696 }
697
698 glPopMatrix();
699 glMatrixMode(GL_PROJECTION);
700 glPopMatrix();
701 glMatrixMode(GL_MODELVIEW);
702
703 glDepthRange(old_depth_range[0], old_depth_range[1]);
704
705 if (drawOverlayAxis) TGLCameraOverlay::Render(rnrCtx);
706}
@ kButtonRelease
Definition GuiTypes.h:61
@ kButtonPress
Definition GuiTypes.h:61
@ kMotionNotify
Definition GuiTypes.h:62
@ kButton1
Definition GuiTypes.h:215
#define c(i)
Definition RSha256.hxx:101
#define a(i)
Definition RSha256.hxx:99
#define h(i)
Definition RSha256.hxx:106
int Int_t
Signed integer 4 bytes (int).
Definition RtypesCore.h:59
unsigned char UChar_t
Unsigned Character 1 byte (unsigned char).
Definition RtypesCore.h:52
char Char_t
Character 1 byte (char).
Definition RtypesCore.h:51
bool Bool_t
Boolean (0=false, 1=true) (bool).
Definition RtypesCore.h:77
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
double Double_t
Double 8 bytes.
Definition RtypesCore.h:73
short Color_t
Color number (short).
Definition RtypesCore.h:99
float Float_t
Float 4 bytes (float).
Definition RtypesCore.h:71
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
@ kGray
Definition Rtypes.h:66
@ kRed
Definition Rtypes.h:67
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2496
Manages histogram axis attributes.
Definition TAttAxis.h:19
Class to manage histogram axis.
Definition TAxis.h:32
OpenGL renderer class for TEveCaloLego.
Int_t fMouseY
! 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.
std::vector< Lab_t > LabVec_t
std::pair< Float_t, Float_t > Lab_t
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.
TGLCameraOverlay(const TGLCameraOverlay &)=delete
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:1210
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
Int_t Y() const
Definition TGLUtil.h:448
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
Int_t X() const
Definition TGLUtil.h:446
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:1786
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:1732
static void Color(const TGLColor &color)
Set color from TGLColor.
Definition TGLUtil.cxx:1688
static Float_t PointSize()
Get the point-size, taking the global scaling into account.
Definition TGLUtil.cxx:1926
static Float_t LineWidth()
Get the line-width, taking the global scaling into account.
Definition TGLUtil.cxx:1934
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
Double_t Y() const
Definition TGLUtil.h:121
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.
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:704
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Definition TMathBase.h:249
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.
Definition TMath.h:732
Int_t CeilNint(Double_t x)
Returns the nearest integer of TMath::Ceil(x).
Definition TMath.h:685
Double_t Log10(Double_t x)
Returns the common (base-10) logarithm of x.
Definition TMath.h:773
Event structure.
Definition GuiTypes.h:175
EGEventType fType
of event (see EGEventType)
Definition GuiTypes.h:176
Int_t fY
pointer x, y coordinates in event window
Definition GuiTypes.h:179
UInt_t fState
key or button mask
Definition GuiTypes.h:182
Int_t fX
Definition GuiTypes.h:179
UInt_t fCode
key or button code
Definition GuiTypes.h:181
Cell data inner structure.
Float_t PhiDelta() const
Float_t EtaDelta() const
TLine l
Definition textangle.C:4