42 fAttAxis(0), fUseAxisColors(
kTRUE),
47 fLabelPixelFontSize(14), fLabel3DFontSize(1.0),
48 fTitlePixelFontSize(14), fTitle3DFontSize(1.0),
50 fLabelAlignH(
TGLFont::kCenterH),
51 fLabelAlignV(
TGLFont::kCenterV),
81 last = strlen(label) - 1;
82 for (
Int_t i = 0; i <= last; i++) {
83 if (strchr(
"1234567890-+.", label[i])) {
88 Error(
"LabelsLimits",
"attempt to draw a blank label");
99 if (s ==
"-." || s ==
"-0")
128 if (bw1 < xmicros && absMaxLog < 0) {
152 if (
fExp % 3 == 0 && absMax >= rne)
break;
163 if (size / ndyn <= 0.999 && na <
fMaxDigits - 2) {
178 while (dwlabel < TMath::Power(10, -if2)) {
182 if (if1 > 14) if1 = 14;
183 if (if2 > 14) if2 = 14;
189 chtemp.
Form(
"%g", dwlabel);
204 font.
Render(txt, p.
X(), p.
Y(), p.
Z(), aH, aV);
212 glTranslated(p.
X(), p.
Y(), p.
Z());
215 font.
Render(txt, 0, 0, 0, aH, aV);
242 glTranslated(offVec.
X(), offVec.
Y(), offVec.
Z());
247 for (LabVec_t::const_iterator it =
fLabVec.begin(); it !=
fLabVec.end(); ++it) {
299 glVertex3dv(start.
Arr());
300 glVertex3dv(end.
Arr());
306 Float_t tmsOrderSecond = tmsOrderFirst * 0.5;
308 TMVec_t::const_iterator it =
fTMVec.begin();
311 for (
Int_t t = 1; t < nt; ++t, ++it) {
312 pos =
fDir * ((*it).first);
314 glVertex3dv(pos.
Arr());
316 glVertex3dv((pos +
fTMOff[dim]*tmsOrderSecond).Arr());
318 glVertex3dv((pos +
fTMOff[dim]*tmsOrderFirst).Arr());
334 Error(
"TGLAxisPainter::PaintAxis",
"axis without range");
345 Double_t bl1=0, bh1=0, bl2=0, bh2=0;
367 for (
Int_t t2 = 1; t2 < bn2; t2++)
391 for (
Int_t i = 0; i <= bn1; i++) {
407 GLdouble
mm[16], pm[16];
409 glGetDoublev(GL_MODELVIEW_MATRIX, mm);
410 glGetDoublev(GL_PROJECTION_MATRIX, pm);
411 glGetIntegerv(GL_VIEWPORT, vp);
413 GLdouble dn[3], up[3];
414 gluProject(
fDir.
X()*min,
fDir.
Y()*min,
fDir.
Z()*min,
mm, pm, vp, &dn[0], &dn[1], &dn[2]);
415 gluProject(
fDir.
X()*max,
fDir.
Y()*max,
fDir.
Z()*max,
mm, pm, vp, &up[0], &up[1], &up[2]);
417 (up[1] - dn[1]) * (up[1] - dn[1]) +
418 (up[2] - dn[2]) * (up[2] - dn[2]));
433 glDisable(GL_LIGHTING);
483 glGetDoublev(GL_MODELVIEW_MATRIX, mm);
484 glGetIntegerv(GL_VIEWPORT, vp);
485 GLdouble projX[4], projY[4], projZ[4];
488 cornerX[0] = x0; cornerY[0] = y0;
489 cornerX[1] =
x1; cornerY[1] = y0;
490 cornerX[2] =
x1; cornerY[2] = y1;
491 cornerX[3] = x0; cornerY[3] = y1;
492 gluProject(cornerX[0], cornerY[0], z0, mm, pm, vp, &projX[0], &projY[0], &projZ[0]);
493 gluProject(cornerX[1], cornerY[1], z0, mm, pm, vp, &projX[1], &projY[1], &projZ[1]);
494 gluProject(cornerX[2], cornerY[2], z0, mm, pm, vp, &projX[2], &projY[2], &projZ[2]);
495 gluProject(cornerX[3], cornerY[3], z0, mm, pm, vp, &projX[3], &projY[3], &projZ[3]);
502 for (
Int_t i = 1; i < 4; ++i) {
516 for (
Int_t i = 0; i < 4; ++i) {
521 if (projZ[i] > zMin) zMin = projZ[i];
523 Int_t xyIdx = idxFront;
524 if (zMin - zt < 1
e-2) xyIdx = 0;
556 glGetDoublev(GL_MODELVIEW_MATRIX, mm.
Arr());
557 glGetDoublev(GL_PROJECTION_MATRIX, pm);
558 glGetIntegerv(GL_VIEWPORT, vp);
566 (up[1] - dn[1]) * (up[1] - dn[1]) +
567 (up[2] - dn[2]) * (up[2] - dn[2]));
635 glScaled(sx, sy, sz);
virtual Float_t GetTickLength() const
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
void RnrText(const TString &txt, const TGLVector3 &pos, TGLFont::ETextAlignH_e aH, TGLFont::ETextAlignV_e aV, const TGLFont &font) const
Render text at the given position. Offset depends of text alignment.
virtual void PreRender(Bool_t autoLight=kTRUE, Bool_t lightOn=kFALSE) const
Set-up GL state before FTFont rendering.
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
static const char * GetFontNameFromId(Int_t)
Get font name from TAttAxis font id.
virtual Float_t GetLabelOffset() const
void SetTitlePixelFontSize(Int_t fs)
16 component (4x4) transform matrix - column MAJOR as per GL.
virtual Color_t GetAxisColor() const
void PlotStandard(TGLRnrCtx &rnrCtx, TH1 *histo, const TGLBoundingBox &bbox)
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.
Short_t Min(Short_t a, Short_t b)
Int_t fTitlePixelFontSize
std::pair< Float_t, Int_t > TM_t
void RegisterFontNoScale(Int_t size, Int_t file, Int_t mode, TGLFont &out)
Get font in the GL rendering context.
Int_t FloorNint(Double_t x)
virtual Float_t GetLabelSize() const
static constexpr double mm
void Set(Double_t x, Double_t y, Double_t z)
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
void FormAxisValue(Double_t x, TString &s) const
Returns formatted text suitable for display of value.
TGLVector3 & RefTMOff(Int_t i)
virtual Style_t GetTitleFont() const
std::pair< Float_t, Float_t > Lab_t
TGLAxisPainterBox()
Constructor.
3 component (x/y/z) vertex class.
Double_t Log10(Double_t x)
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
Utility class to paint axis in GL.
TGLVector3 & RefTitlePos()
Ssiz_t First(char c) const
Find first occurrence of a character c.
3 component (x/y/z) vector class.
void Error(const char *location, const char *msgfmt,...)
virtual Color_t GetLabelColor() const
virtual Int_t GetNdivisions() const
TGLVector3 ViewportDeltaToWorld(const TGLVertex3 &worldRef, Double_t viewportXDelta, Double_t viewportYDelta, TGLMatrix *modviewMat=0) const
Apply a 2D viewport delta (shift) to the projection of worldRef onto viewport, returning the resultan...
void PaintAxis(TGLRnrCtx &ctx, TAxis *ax)
GL render TAxis.
const char * GetTitle() const
Returns title of object.
Class to manage histogram axis.
Int_t fLabelPixelFontSize
const Double_t * CArr() const
TPMERegexp * fAllZeroesRE
TGLVector3 fAxisTitlePos[3]
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
char * Form(const char *fmt,...)
void RnrLabels() const
Render label reading prepared list ov value-pos pairs.
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
virtual Color_t GetTitleColor() const
void SetLabelAlign(TGLFont::ETextAlignH_e, TGLFont::ETextAlignV_e)
Set label align.
TString & Remove(Ssiz_t pos)
static const double x1[5]
void SetTitleFont(TGLRnrCtx &rnrCtx, const char *fontName, Int_t pixelSize=64, Double_t font3DSize=-1)
Set title font derived from TAttAxis.
Ssiz_t Last(char c) const
Find last occurrence of a character c.
virtual ~TGLAxisPainterBox()
Destructor.
void RnrLines() const
Render axis main line and tick-marks.
static constexpr double s
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
Double_t fTitle3DFontSize
virtual Float_t GetTitleSize() const
void RnrTitle(const TString &title, TGLVector3 &pos, TGLFont::ETextAlignH_e aH, TGLFont::ETextAlignV_e aV) const
Draw title at given position.
Concrete class describing an orientated (free) or axis aligned box of 8 vertices. ...
virtual void PostRender() const
Reset GL state after FTFont rendering.
Wrapper for PCRE library (Perl Compatible Regular Expressions).
Short_t Max(Short_t a, Short_t b)
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.
void SetAxis3DTitlePos(TGLRnrCtx &rnrCtx)
Get position of axes and titles from projected corners.
void SetLabelFont(TGLRnrCtx &rnrCtx, const char *fontName, Int_t pixelSize=64, Double_t font3DSize=-1)
Set label font derived from TAttAxis.
static Float_t LineWidth()
Get the line-width, taking the global scaling into account.
A wrapper class for FTFont.
Double_t Sqrt(Double_t x)
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).
Int_t Substitute(TString &s, const TString &r, Bool_t doDollarSubst=kTRUE)
Substitute matching part of s with r, dollar back-ref substitution is performed if doDollarSubst is t...
void LabelsLimits(const char *label, Int_t &first, Int_t &last) const
Find first and last character of a label.
TGLMatrix & RefLastNoPickProjM() const
Double_t fLabel3DFontSize
virtual ~TGLAxisPainter()
Destructor.
TGLFont::ETextAlignH_e fLabelAlignH
void DrawAxis3D(TGLRnrCtx &rnrCtx)
Draw XYZ axis with bitmap font.
Int_t CeilNint(Double_t x)
TGLFont::ETextAlignV_e fLabelAlignV
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
virtual Style_t GetLabelFont() const
const char * Data() const