19#include "TGLIncludes.h"
110 switch (event->
fType)
151 switch (event->
fType)
251 font.
BBox(
fHeaderTxt.Data(), bb[0], bb[1], bb[2], bb[3], bb[4], bb[5]);
262 glVertex2f(
x/vp.
Width(), 1);
270 glBitmap(0, 0, 0, 0,
x,
y,
nullptr);
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);
289 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
308 glVertex2f( bwt, bh);
309 glVertex2f(-bwt, bh);
316 glVertex2f(0, 0); glVertex2f(0, bh);
317 glVertex2f((bw+bwt)*0.5, bh*0.5); glVertex2f(-(bw+bwt)*0.5, bh*0.5);
321 glBegin(GL_LINE_LOOP);
324 glVertex2f( bwt, bh);
325 glVertex2f(-bwt, bh);
396 while(cellY > scaleStepY)
408 glPushAttrib(GL_ENABLE_BIT | GL_POLYGON_BIT | GL_LINE_BIT | GL_POINT_BIT);
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);
425 for (
Int_t i=0; i < ne; ++i)
428 dx = 0.5* cellX * valFac;
429 dy = 0.5* cellY * valFac;
431 glVertex2f( - dx, pos - dy);
432 glVertex2f( - dx, pos + dy);
433 glVertex2f( + dx, pos + dy);
434 glVertex2f( + dx, pos - dy);
440 for (
Int_t i=0; i < ne; ++i)
441 glVertex2f(0, i* scaleStepY);
452 Float_t llx, lly, llz, urx, ury, urz;
453 fontB.
BBox(
"10", llx, lly, llz, urx, ury, urz);
460 glTranslatef(0.5*scaleStepX, 0, 0.1);
461 for (
Int_t i = 0; i < ne; ++i)
467 else if ( i == (maxe -1))
474 fontB.
BBox(
Form(
"%d", maxe-i), llx, lly, llz, urx, ury, urz);
475 if (expOff > urx/vp.
Width()) expOff = urx/vp.
Width();
482 if (expOff < 1) expX += expOff;
487 fScaleW = scaleStepX + expX+ frameOff*2;
488 fScaleH = scaleStepY * ne + frameOff*2;
498 glBegin(GL_LINE_LOOP);
499 glVertex3f(x0, y0, zf); glVertex3f(x1, y0, zf);
500 glVertex3f(x1, y1, zf); glVertex3f(x0, y1, zf);
505 glVertex2f(x0, y0); glVertex2f(x1, y0);
506 glVertex2f(x1, y1); glVertex2f(x0, y1);
520 glPushAttrib(GL_ENABLE_BIT | GL_POLYGON_BIT | GL_LINE_BIT);
522 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
523 glEnable(GL_POLYGON_OFFSET_FILL);
524 glPolygonOffset(0.1, 1);
567 for (TGLAxisPainter::LabVec_t::iterator it = labVec.begin(); it != labVec.end(); ++it)
569 fCalo->GetPalette()->ColorFromValue((
Int_t)((*it).first),
c);
570 glColor4ub(
c[0],
c[1],
c[2],
c[3]);
573 glVertex3f( -w,
y -
h, zf); glVertex3f( +w,
y -
h, zf);
574 glVertex3f( +w,
y +
h, zf); glVertex3f( -w,
y +
h, zf);
579 glBegin(GL_LINE_LOOP);
580 for (TGLAxisPainter::LabVec_t::iterator it = labVec.begin(); it != labVec.end(); ++it)
583 glVertex3f( -w,
y -
h, zf); glVertex3f( +w,
y -
h, zf);
584 glVertex3f( +w,
y +
h, zf); glVertex3f( -w,
y +
h, zf);
599 if (
fCalo ==
nullptr ||
fCalo->GetData()->Empty())
return;
602 glGetFloatv(GL_DEPTH_RANGE, old_depth_range);
603 glDepthRange(0, 0.001);
605 glMatrixMode(GL_PROJECTION);
612 gluPickMatrix(rect.
X(), rect.
Y(), rect.
Width(), rect.
Height(),
615 glMatrixMode(GL_MODELVIEW);
619 glTranslatef(-1, -1, 0);
644 for ( TEveCaloData::vCellId_t::iterator i =
fCalo->fCellList.begin(); i !=
fCalo->fCellList.end(); ++i)
646 fCalo->fData->GetCellData(*i, cellData);
655 a =
fCalo->GetData()->GetEtaBins();
657 for (
Int_t i=1 ; i<=nb; i++)
659 if (sq >
a->GetBinWidth(i)) sq =
a->GetBinWidth(i);
662 a =
fCalo->GetData()->GetPhiBins();
664 for (
Int_t i=1 ; i<=nb; i++)
666 if (sq >
a->GetBinWidth(i)) sq =
a->GetBinWidth(i);
676 else if (
fCalo->GetPalette())
699 glMatrixMode(GL_PROJECTION);
701 glMatrixMode(GL_MODELVIEW);
703 glDepthRange(old_depth_range[0], old_depth_range[1]);
int Int_t
Signed integer 4 bytes (int).
unsigned char UChar_t
Unsigned Character 1 byte (unsigned char).
char Char_t
Character 1 byte (char).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
short Color_t
Color number (short).
float Float_t
Float 4 bytes (float).
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Manages histogram axis attributes.
Class to manage histogram axis.
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.
Char_t fScaleTransparency
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...
virtual Bool_t IsPerspective() const
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
virtual Bool_t IsOrthographic() const
Color_t GetColorIndex() const
Returns color-index representing the color.
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.
const Int_t * CArr() const
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
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).
TGLViewerBase & RefViewer()
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.
static void ColorTransparency(Color_t color_index, Char_t transparency=0)
Set color from color_index and ROOT-style transparency (default 0).
static void Color(const TGLColor &color)
Set color from TGLColor.
static Float_t PointSize()
Get the point-size, taking the global scaling into account.
static Float_t LineWidth()
Get the line-width, taking the global scaling into account.
3 component (x/y/z) vector class.
3 component (x/y/z) vertex class.
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.
Int_t Nint(T x)
Round to nearest integer. Rounds half integers to the nearest even integer.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.
Int_t CeilNint(Double_t x)
Returns the nearest integer of TMath::Ceil(x).
Double_t Log10(Double_t x)
Returns the common (base-10) logarithm of x.
EGEventType fType
of event (see EGEventType)
Int_t fY
pointer x, y coordinates in event window
UInt_t fState
key or button mask
UInt_t fCode
key or button code
Cell data inner structure.