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")
111 s.Remove(
s.Length() -1);
128 if (bw1 < xmicros && absMaxLog < 0) {
152 if (
fExp % 3 == 0 && absMax >= rne)
break;
163 if (size / ndyn <= 0.999 && na <
fMaxDigits - 2) {
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);
static const double x1[5]
void Error(const char *location, const char *msgfmt,...)
char * Form(const char *fmt,...)
virtual Color_t GetTitleColor() const
virtual Color_t GetLabelColor() const
virtual Int_t GetNdivisions() const
virtual Color_t GetAxisColor() const
virtual Style_t GetTitleFont() const
virtual Float_t GetLabelOffset() const
virtual Style_t GetLabelFont() const
virtual Float_t GetTitleSize() const
virtual Float_t GetLabelSize() const
virtual Float_t GetTickLength() const
virtual void SetTickLength(Float_t length=0.03)
Set tick mark length The length is expressed in per cent of the pad width.
Class to manage histogram axis.
const char * GetTitle() const
Returns title of object.
Utility class to paint axis in GL.
void SetAxis3DTitlePos(TGLRnrCtx &rnrCtx)
Get position of axes and titles from projected corners.
void PlotStandard(TGLRnrCtx &rnrCtx, TH1 *histo, const TGLBoundingBox &bbox)
void DrawAxis3D(TGLRnrCtx &rnrCtx)
Draw XYZ axis with bitmap font.
TGLAxisPainterBox()
Constructor.
TGLVector3 fAxisTitlePos[3]
virtual ~TGLAxisPainterBox()
Destructor.
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.
TPMERegexp * fAllZeroesRE
void LabelsLimits(const char *label, Int_t &first, Int_t &last) const
Find first and last character of a label.
void RnrLines() const
Render axis main line and tick-marks.
Int_t fLabelPixelFontSize
TGLFont::ETextAlignV_e fLabelAlignV
std::pair< Float_t, Int_t > TM_t
void SetLabelAlign(TGLFont::ETextAlignH_e, TGLFont::ETextAlignV_e)
Set label align.
Double_t fLabel3DFontSize
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.
TGLVector3 & RefTitlePos()
TGLFont::ETextAlignH_e fLabelAlignH
Int_t fTitlePixelFontSize
void SetTitleFont(TGLRnrCtx &rnrCtx, const char *fontName, Int_t pixelSize=64, Double_t font3DSize=-1)
Set title font derived from TAttAxis.
void FormAxisValue(Double_t x, TString &s) const
Returns formatted text suitable for display of value.
void SetTextFormat(Double_t min, Double_t max, Double_t binWidth)
Construct print format from given primary bin width.
void SetLabelPixelFontSize(Int_t fs)
void RnrTitle(const TString &title, TGLVector3 &pos, TGLFont::ETextAlignH_e aH, TGLFont::ETextAlignV_e aV) const
Draw title at given position.
std::pair< Float_t, Float_t > Lab_t
TGLVector3 & RefTMOff(Int_t i)
Double_t fTitle3DFontSize
virtual ~TGLAxisPainter()
Destructor.
void PaintAxis(TGLRnrCtx &ctx, TAxis *ax)
GL render TAxis.
void SetTitlePixelFontSize(Int_t fs)
Concrete class describing an orientated (free) or axis aligned box of 8 vertices.
TGLMatrix & RefLastNoPickProjM() 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...
static const char * GetFontNameFromId(Int_t)
Get font name from TAttAxis font id.
A wrapper class for FTFont.
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.
16 component (4x4) transform matrix - column MAJOR as per GL.
const Double_t * CArr() const
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
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).
static void Color(const TGLColor &color)
Set color from TGLColor.
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.
void Set(Double_t x, Double_t y, Double_t z)
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
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.
Wrapper for PCRE library (Perl Compatible Regular Expressions).
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...
Ssiz_t First(char c) const
Find first occurrence of a character c.
const char * Data() const
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
static constexpr double s
static constexpr double mm
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)
Int_t FloorNint(Double_t x)
Double_t Sqrt(Double_t x)
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Int_t CeilNint(Double_t x)
Short_t Min(Short_t a, Short_t b)
Double_t Log10(Double_t x)