12#include "TGLIncludes.h"
55 fAxis->SetNdivisions(710);
56 fAxis->SetLabelSize(0.018);
57 fAxis->SetLabelOffset(0.01);
115 std::pair<Bool_t, TGLVertex3> intersection;
118 if (intersection.first)
122 glMatrixMode(GL_PROJECTION);
126 glMatrixMode(GL_MODELVIEW);
134 const char* txt =
Form(
"(%f, %f, %f)",
v[0],
v[1],
v[2]);
143 glVertex2f(0 +w*ce, 0);
146 glVertex2f(0 -w*ce, 0);
150 glVertex2f(0, 0 +
h*ce);
153 glVertex2f(0, 0 -
h*ce);
158 glMatrixMode(GL_PROJECTION);
160 glMatrixMode(GL_MODELVIEW);
175 GLint vp[4]; glGetIntegerv(GL_VIEWPORT, vp);
176 Float_t rl = 0.5 *((vp[2]-vp[0]) + (vp[3]-vp[1]));
179 Float_t tlY = 0.015*rl/(vp[2]-vp[0]);
180 Float_t tlX = 0.015*rl/(vp[3]-vp[1]);
213 Int_t secSteps =
fAxis->GetNdivisions() % 100;
214 GLushort stipple = 0x5555;
219 fAxis->SetTickLength(tlX);
221 fAxis->SetLimits(minX, maxX);
226 glTranslated(vy1.
X(), vy1.
Y(), vy1.
Z());
233 glTranslated(vy2.
X(), vy2.
Y(), vy2.
Z());
248 for (TGLAxisPainter::LabVec_t::iterator i = labs.begin(); i != labs.end(); ++i) {
249 tmp = vy1 + xdir * (i->first);
250 glVertex3dv(tmp.
Arr());
251 tmp = vy2 + xdir * (i->first);
252 glVertex3dv(tmp.
Arr());
260 glPushAttrib(GL_ENABLE_BIT | GL_LINE_BIT);
261 glEnable(GL_LINE_STIPPLE);
262 glLineStipple(1, stipple);
266 Double_t omin = 0, omax = 0, bw1 = 0;
271 for (
Int_t k=0; k<ondiv; k++)
274 tmp = vy1 + xdir * val;
275 glVertex3dv(tmp.
Arr());
276 tmp = vy2 + xdir * val;
277 glVertex3dv(tmp.
Arr());
280 val = labs[0].second - bw1;
283 tmp = vy1 + xdir * val;
284 glVertex3dv(tmp.
Arr());
285 tmp = vy2 + xdir * val;
286 glVertex3dv(tmp.
Arr());
298 fAxis->SetTickLength(tlY);
300 fAxis->SetLimits(minY, maxY);
304 glTranslated(vx1.
X(), vx1.
Y(), vx1.
Z());
310 glTranslated(vx2.
X(), vx2.
Y(), vx2.
Z());
324 for (TGLAxisPainter::LabVec_t::iterator i = labs.begin(); i != labs.end(); ++i) {
325 tmp = vx1 + ydir *(i->first);
326 glVertex3dv(tmp.
Arr());
327 tmp = vx2 + ydir *(i->first);
328 glVertex3dv(tmp.
Arr());
336 glPushAttrib(GL_ENABLE_BIT | GL_LINE_BIT);
337 glEnable(GL_LINE_STIPPLE);
338 glLineStipple(1, stipple);
342 Double_t omin = 0, omax = 0, bw1 = 0;
345 val = labs[0].second;
348 for(
Int_t k=0; k<ondiv; k++)
351 tmp = vx1 + ydir *val;
352 glVertex3dv(tmp.
Arr());
353 tmp = vx2 + ydir * val;
354 glVertex3dv(tmp.
Arr());
358 val = labs[0].second - bw1;
361 tmp = vx1 + ydir *val;
362 glVertex3dv(tmp.
Arr());
363 tmp = vx2 + ydir * val;
364 glVertex3dv(tmp.
Arr());
404 const char* txt =
Form(
"%.*f", (exp < 0) ? -exp : 0, red);
408 font.
BBox(txt, bb[0], bb[1], bb[2], bb[3], bb[4], bb[5]);
413 glTranslated(
v.X(),
v.Y(),
v.Z());
418 glPushAttrib(GL_ENABLE_BIT | GL_LINE_BIT);
423 v = xdir*xt + ydir*yt;
424 glTranslated(
v.X(),
v.Y(),
v.Z());
429 glVertex3dv(
v.Arr());
431 glVertex3dv(
v.Arr());
433 v = xdir*barsize + ydir*mH;
434 glVertex3dv(
v.Arr());
435 v = xdir*barsize - ydir*mH;
436 glVertex3dv(
v.Arr());
440 glVertex3dv(
v.Arr());
442 glVertex3dv(
v.Arr());
445 glVertex3dv(
v.Arr());
447 glVertex3dv(
v.Arr());
449 glVertex3d(0, 0., 0.);
451 glVertex3dv(
v.Arr());
471 glPushAttrib(GL_ENABLE_BIT | GL_LINE_BIT);
473 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
478 glGetFloatv(GL_DEPTH_RANGE, old_depth_range);
487 glDepthRange(0, 0.1);
491 glDepthRange(0, 0.1);
495 glDepthRange(0, 0.1);
499 glDepthRange(1, 0.9);
511 glDepthRange(old_depth_range[0], old_depth_range[1]);
int Int_t
Signed integer 4 bytes (int).
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).
Double_t Dot(const TGLVector3 &v1, const TGLVector3 &v2)
std::pair< Bool_t, TGLLine3 > Intersection(const TGLPlane &p1, const TGLPlane &p2)
Find 3D line interestion of this plane with 'other'.
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Manages histogram axis attributes.
Class to manage histogram axis.
Utility class to paint axis in GL.
std::vector< Lab_t > LabVec_t
void RenderAxis(TGLRnrCtx &rnrCtx, Bool_t drawGrid)
Draw axis on four edges and a transparent grid.
TGLAxisPainter * fAxisPainter
Bool_t fUseExternalRefPlane
TGLPlane fExternalRefPlane
void SetFrustum(TGLCamera &cam)
Set frustum values from given camera.
~TGLCameraOverlay() override
Destructor.
void RenderPlaneIntersect(TGLRnrCtx &rnrCtx)
Draw cross section coordinates in top right corner of screen.
TAttAxis * GetAttAxis()
Get axis attributes.
void Render(TGLRnrCtx &rnrCtx) override
Display coordinates info of current frustum.
TGLCameraOverlay(const TGLCameraOverlay &)=delete
void RenderBar(TGLRnrCtx &rnrCtx)
Show frustum size with fixed screen line length and printed value.
Abstract base camera class - concrete classes for orthographic and perspective cameras derive from it...
virtual Bool_t IsPerspective() const
const TGLMatrix & GetCamBase() const
const TGLMatrix & GetCamTrans() const
virtual Bool_t IsOrthographic() const
const TGLPlane & FrustumPlane(EFrustumPlane plane) 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
3D space, fixed length, line class, with direction / length 'vector', passing through point 'vertex'.
16 component (4x4) transform matrix - column MAJOR as per GL.
TGLVector3 GetBaseVec(Int_t b) const
TGLVector3 GetTranslation() const
Return the translation component of matrix.
TGLOverlayElement(const TGLOverlayElement &)=delete
3D plane class - of format Ax + By + Cz + D = 0
Viewport (pixel base) 2D rectangle class.
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).
void RegisterFont(Int_t size, Int_t file, Int_t mode, TGLFont &out)
Get font in the GL rendering context.
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 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.
Double_t Floor(Double_t x)
Rounds x downward, returning the largest integral value that is not greater than x.
Double_t Sqrt(Double_t x)
Returns the square root of x.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.
Double_t Log10(Double_t x)
Returns the common (base-10) logarithm of x.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.