52 fScaleColor(-1), fScaleTransparency(0),
53 fScaleCoordX(0.85), fScaleCoordY(0.65),
54 fScaleW(0), fScaleH(0),
55 fCellX(-1), fCellY(-1),
57 fFrameColor(-1), fFrameLineTransp(70), fFrameBgTransp(90),
59 fMouseX(0), fMouseY(0),
64 fPlaneAxis(0), fAxisPlaneColor(
kGray),
74 fActiveID(-1), fActiveCol(
kRed-4)
113 switch (event->
fType)
154 switch (event->
fType)
263 glVertex2f(1, y/ vp.
Height());
265 glVertex2f(x/vp.
Width(), 1);
273 glBitmap(0, 0, 0, 0, x, y, 0);
284 glPushAttrib(GL_ENABLE_BIT | GL_POLYGON_BIT | GL_LINE_BIT | GL_POINT_BIT);
285 glEnable(GL_POINT_SMOOTH);
286 glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
287 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
288 glEnable(GL_POLYGON_OFFSET_FILL);
289 glPolygonOffset(0.1, 1);
290 glDisable(GL_CULL_FACE);
292 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
311 glVertex2f( bwt, bh);
312 glVertex2f(-bwt, bh);
319 glVertex2f(0, 0); glVertex2f(0, bh);
320 glVertex2f((bw+bwt)*0.5, bh*0.5); glVertex2f(-(bw+bwt)*0.5, bh*0.5);
324 glBegin(GL_LINE_LOOP);
327 glVertex2f( bwt, bh);
328 glVertex2f(-bwt, bh);
399 while(cellY > scaleStepY)
411 glPushAttrib(GL_ENABLE_BIT | GL_POLYGON_BIT | GL_LINE_BIT | GL_POINT_BIT);
413 glDisable(GL_CULL_FACE);
414 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
415 glEnable(GL_POLYGON_OFFSET_FILL);
416 glPolygonOffset(0.1, 1);
428 for (
Int_t i=0; i < ne; ++i)
431 dx = 0.5* cellX * valFac;
432 dy = 0.5* cellY * valFac;
434 glVertex2f( - dx, pos - dy);
435 glVertex2f( - dx, pos + dy);
436 glVertex2f( + dx, pos + dy);
437 glVertex2f( + dx, pos - dy);
443 for (
Int_t i=0; i < ne; ++i)
444 glVertex2f(0, i* scaleStepY);
455 Float_t llx, lly, llz, urx, ury, urz;
456 fontB.
BBox(
"10", llx, lly, llz, urx, ury, urz);
463 glTranslatef(0.5*scaleStepX, 0, 0.1);
464 for (
Int_t i = 0; i < ne; ++i)
470 else if ( i == (maxe -1))
477 fontB.
BBox(
Form(
"%d", maxe-i), llx, lly, llz, urx, ury, urz);
478 if (expOff > urx/vp.
Width()) expOff = urx/vp.
Width();
485 if (expOff < 1) expX += expOff;
490 fScaleW = scaleStepX + expX+ frameOff*2;
491 fScaleH = scaleStepY * ne + frameOff*2;
501 glBegin(GL_LINE_LOOP);
502 glVertex3f(x0, y0, zf); glVertex3f(x1, y0, zf);
503 glVertex3f(x1, y1, zf); glVertex3f(x0, y1, zf);
508 glVertex2f(x0, y0); glVertex2f(x1, y0);
509 glVertex2f(x1, y1); glVertex2f(x0, y1);
523 glPushAttrib(GL_ENABLE_BIT | GL_POLYGON_BIT | GL_LINE_BIT);
525 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
526 glEnable(GL_POLYGON_OFFSET_FILL);
527 glPolygonOffset(0.1, 1);
570 for (TGLAxisPainter::LabVec_t::iterator it = labVec.begin(); it != labVec.end(); ++it)
573 glColor4ub( c[0], c[1], c[2], c[3]);
576 glVertex3f( -w, y - h, zf); glVertex3f( +w, y - h, zf);
577 glVertex3f( +w, y + h, zf); glVertex3f( -w, y + h, zf);
582 glBegin(GL_LINE_LOOP);
583 for (TGLAxisPainter::LabVec_t::iterator it = labVec.begin(); it != labVec.end(); ++it)
586 glVertex3f( -w, y - h, zf); glVertex3f( +w, y - h, zf);
587 glVertex3f( +w, y + h, zf); glVertex3f( -w, y + h, zf);
605 glGetFloatv(GL_DEPTH_RANGE, old_depth_range);
606 glDepthRange(0, 0.001);
608 glMatrixMode(GL_PROJECTION);
615 gluPickMatrix(rect.X(), rect.Y(), rect.Width(), rect.Height(),
618 glMatrixMode(GL_MODELVIEW);
622 glTranslatef(-1, -1, 0);
660 for (
Int_t i=1 ; i<=nb; i++)
667 for (
Int_t i=1 ; i<=nb; i++)
702 glMatrixMode(GL_PROJECTION);
704 glMatrixMode(GL_MODELVIEW);
706 glDepthRange(old_depth_range[0], old_depth_range[1]);
TEveCaloData * GetData() const
TGLAxisPainter * fAxisPainter
A GL overlay element which displays camera furstum.
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
virtual void PreRender(Bool_t autoLight=kTRUE, Bool_t lightOn=kFALSE) const
Set-up GL state before FTFont rendering.
virtual Bool_t Handle(TGLRnrCtx &rnrCtx, TGLOvlSelectRecord &selRec, Event_t *event)
Handle overlay event.
virtual TAxis * GetEtaBins() const
Abstract base camera class - concrete classes for orthographic and perspective cameras derive from it...
static void Color(const TGLColor &color)
Set color from TGLColor.
void Render(const char *txt, Double_t x, Double_t y, Double_t angle, Double_t mgn) const
virtual void SetLimits(Double_t xmin, Double_t xmax)
static void ColorTransparency(Color_t color_index, Char_t transparency=0)
Set color from color_index and ROOT-style transparency (default 0).
OpenGL renderer class for TEveCaloLego.
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.
Bool_t SetSliderVal(Event_t *event, TGLRnrCtx &rnrCtx)
virtual void SetNdivisions(Int_t n=510, Bool_t optim=kTRUE)
Set the number of divisions for this axis.
Float_t GetPhiMax() const
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
void RenderLogaritmicScales(TGLRnrCtx &rnrCtx)
void SetFrustum(TGLCamera &cam)
Set frustum values from given camera.
void SetScalePosition(Double_t x, Double_t y)
Set scale coordinates in range [0,1].
void RegisterFontNoScale(Int_t size, Int_t file, Int_t mode, TGLFont &out)
Get font in the GL rendering context.
virtual Float_t GetLabelSize() const
Manages histogram axis attributes.
void Set(Double_t x, Double_t y, Double_t z)
virtual void Render(TGLRnrCtx &rnrCtx)
Display coordinates info of current frustum.
virtual void SetLabelOffset(Float_t offset=0.005)
Set distance between the axis and the labels The distance is expressed in per cent of the pad width...
TGLRect * GetPickRectangle()
Return current pick rectangle.
Float_t GetEtaRng() const
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Float_t GetEtaMin() const
virtual void Render(TGLRnrCtx &rnrCtx)
Display coordinates info of current frustum.
TGLVector3 & RefTMOff(Int_t i)
Bool_t fInDrag
last mouse position
virtual void SetRangeUser(Double_t ufirst, Double_t ulast)
Set the viewing range for the axis from ufirst to ulast (in user coordinates).
virtual Bool_t IsPerspective() const
Char_t fScaleTransparency
static struct mg_connection * fc(struct mg_context *ctx)
std::pair< Float_t, Float_t > Lab_t
std::vector< Lab_t > LabVec_t
3 component (x/y/z) vertex class.
TEveCaloLegoOverlay()
Constructor.
Double_t Log10(Double_t x)
Float_t GetPhiMin() const
Viewport (pixel base) 2D rectangle class.
virtual void MouseLeave()
Mouse has left overlay area.
3 component (x/y/z) vector class.
virtual Bool_t MouseEnter(TGLOvlSelectRecord &selRec)
Mouse has entered overlay area.
void RenderPlaneInterface(TGLRnrCtx &rnrCtx)
Render menu for plane-value and the plane if marked.
TEveRGBAPalette * GetPalette() const
const UChar_t * ColorFromValue(Int_t val) const
void PaintAxis(TGLRnrCtx &ctx, TAxis *ax)
GL render TAxis.
TGLLogicalShape * FindLogicalInScenes(TObject *id)
Find logical-shape representing object id in the list of scenes.
void WindowToViewport(Int_t &, Int_t &y) const
Class to manage histogram axis.
static void Color4f(Float_t r, Float_t g, Float_t b, Float_t a)
Wrapper for glColor4f.
char * Form(const char *fmt,...)
void RnrLabels() const
Render label reading prepared list ov value-pos pairs.
TEveCaloData::vCellId_t fCellList
virtual void GetCellData(const CellId_t &id, CellData_t &data) const =0
static Float_t PointSize()
Get the point-size, taking the global scaling into account.
Color_t GetFontColor() const
void SetHPlaneVal(Float_t s)
void SetLabelAlign(TGLFont::ETextAlignH_e, TGLFont::ETextAlignV_e)
Set label align.
virtual void SetLabelSize(Float_t size=0.04)
Set size of axis labels The size is expressed in per cent of the pad width.
TGLViewerBase & RefViewer()
virtual Bool_t IsOrthographic() const
void RenderPaletteScales(TGLRnrCtx &rnrCtx)
void SetFrameAttribs(Color_t frameCol, Char_t lineTransp, Char_t bgTransp)
Set frame attributes.
void SetScaleColorTransparency(Color_t colIdx, Char_t transp)
Set color and transparency of scales.
void RenderHeader(TGLRnrCtx &rnrCtx)
static const double x1[5]
TGLVector3 WorldDeltaToViewport(const TGLVertex3 &worldRef, const TGLVector3 &worldDelta) const
Convert a 3D vector worldDelta (shift) about vertex worldRef to a viewport (screen) '3D' vector...
Float_t GetEtaMax() const
UInt_t GetItem(Int_t i) const
Color_t GetColorIndex() const
Returns color-index representing the color.
virtual TAxis * GetPhiBins() const
Float_t GetMaxVal() const
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width.
virtual void PostRender() const
Reset GL state after FTFont rendering.
Short_t Max(Short_t a, Short_t b)
Float_t GetPhiRng() const
void SetLabelPixelFontSize(Int_t fs)
virtual void SetTickLength(Float_t length=0.03)
Set tick mark length The length is expressed in per cent of the pad width.
Cell data inner structure.
void SetLabelFont(TGLRnrCtx &rnrCtx, const char *fontName, Int_t pixelSize=64, Double_t font3DSize=-1)
Set label font derived from TAttAxis.
void SetDrawHPlane(Bool_t s)
static Float_t LineWidth()
Get the line-width, taking the global scaling into account.
A wrapper class for FTFont.
Selection record for overlay objects.
void SetTextFormat(Double_t min, Double_t max, Double_t binWidth)
Construct print format from given primary bin width.
TGLColorSet & ColorSet()
Return reference to current color-set (top of the stack).
GL-overlay control GUI for TEveCaloLego.
Int_t CeilNint(Double_t x)
TAttAxis * GetAttAxis()
Get axis attributes.
void SetAttAxis(TAttAxis *a)
const Int_t * CArr() const
const char * Data() const