12#include "TGLIncludes.h"
37 fShowOrthographic(showOrtho),
38 fShowPerspective(showPersp),
40 fOrthographicMode(
kAxis),
41 fPerspectiveMode(kPlaneIntersect),
49 fUseExternalRefPlane(
kFALSE)
116 std::pair<Bool_t, TGLVertex3> intersection;
119 if (intersection.first)
123 glMatrixMode(GL_PROJECTION);
127 glMatrixMode(GL_MODELVIEW);
135 const char* txt =
Form(
"(%f, %f, %f)",
v[0],
v[1],
v[2]);
144 glVertex2f(0 +w*ce, 0);
147 glVertex2f(0 -w*ce, 0);
151 glVertex2f(0, 0 +
h*ce);
154 glVertex2f(0, 0 -
h*ce);
159 glMatrixMode(GL_PROJECTION);
161 glMatrixMode(GL_MODELVIEW);
176 GLint vp[4]; glGetIntegerv(GL_VIEWPORT, vp);
177 Float_t rl = 0.5 *((vp[2]-vp[0]) + (vp[3]-vp[1]));
180 Float_t tlY = 0.015*rl/(vp[2]-vp[0]);
181 Float_t tlX = 0.015*rl/(vp[3]-vp[1]);
227 glTranslated(vy1.
X(), vy1.
Y(), vy1.
Z());
234 glTranslated(vy2.
X(), vy2.
Y(), vy2.
Z());
249 for (TGLAxisPainter::LabVec_t::iterator i = labs.begin(); i != labs.end(); ++i) {
250 tmp = vy1 + xdir * (i->first);
251 glVertex3dv(tmp.
Arr());
252 tmp = vy2 + xdir * (i->first);
253 glVertex3dv(tmp.
Arr());
261 glPushAttrib(GL_ENABLE_BIT | GL_LINE_BIT);
262 glEnable(GL_LINE_STIPPLE);
263 glLineStipple(1, stipple);
267 Double_t omin = 0, omax = 0, bw1 = 0;
272 for (
Int_t k=0; k<ondiv; k++)
275 tmp = vy1 + xdir * val;
276 glVertex3dv(tmp.
Arr());
277 tmp = vy2 + xdir * val;
278 glVertex3dv(tmp.
Arr());
281 val = labs[0].second - bw1;
284 tmp = vy1 + xdir * val;
285 glVertex3dv(tmp.
Arr());
286 tmp = vy2 + xdir * val;
287 glVertex3dv(tmp.
Arr());
305 glTranslated(vx1.
X(), vx1.
Y(), vx1.
Z());
311 glTranslated(vx2.
X(), vx2.
Y(), vx2.
Z());
325 for (TGLAxisPainter::LabVec_t::iterator i = labs.begin(); i != labs.end(); ++i) {
326 tmp = vx1 + ydir *(i->first);
327 glVertex3dv(tmp.
Arr());
328 tmp = vx2 + ydir *(i->first);
329 glVertex3dv(tmp.
Arr());
337 glPushAttrib(GL_ENABLE_BIT | GL_LINE_BIT);
338 glEnable(GL_LINE_STIPPLE);
339 glLineStipple(1, stipple);
343 Double_t omin = 0, omax = 0, bw1 = 0;
346 val = labs[0].second;
349 for(
Int_t k=0; k<ondiv; k++)
352 tmp = vx1 + ydir *val;
353 glVertex3dv(tmp.
Arr());
354 tmp = vx2 + ydir * val;
355 glVertex3dv(tmp.
Arr());
359 val = labs[0].second - bw1;
362 tmp = vx1 + ydir *val;
363 glVertex3dv(tmp.
Arr());
364 tmp = vx2 + ydir * val;
365 glVertex3dv(tmp.
Arr());
405 const char* txt =
Form(
"%.*f", (
exp < 0) ? -
exp : 0, red);
409 font.
BBox(txt, bb[0], bb[1], bb[2], bb[3], bb[4], bb[5]);
414 glTranslated(
v.X(),
v.Y(),
v.Z());
419 glPushAttrib(GL_ENABLE_BIT | GL_LINE_BIT);
424 v = xdir*xt + ydir*yt;
425 glTranslated(
v.X(),
v.Y(),
v.Z());
430 glVertex3dv(
v.Arr());
432 glVertex3dv(
v.Arr());
434 v = xdir*barsize + ydir*mH;
435 glVertex3dv(
v.Arr());
436 v = xdir*barsize - ydir*mH;
437 glVertex3dv(
v.Arr());
441 glVertex3dv(
v.Arr());
443 glVertex3dv(
v.Arr());
446 glVertex3dv(
v.Arr());
448 glVertex3dv(
v.Arr());
450 glVertex3d(0, 0., 0.);
452 glVertex3dv(
v.Arr());
472 glPushAttrib(GL_ENABLE_BIT | GL_LINE_BIT);
474 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
479 glGetFloatv(GL_DEPTH_RANGE, old_depth_range);
488 glDepthRange(0, 0.1);
492 glDepthRange(0, 0.1);
496 glDepthRange(0, 0.1);
500 glDepthRange(1, 0.9);
512 glDepthRange(old_depth_range[0], old_depth_range[1]);
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,...)
Manages histogram axis attributes.
virtual Int_t GetNdivisions() const
virtual Color_t GetAxisColor() const
virtual void SetAxisColor(Color_t color=1, Float_t alpha=1.)
Set color of the line axis and tick marks.
virtual void SetLabelSize(Float_t size=0.04)
Set size of axis labels.
virtual void SetLabelOffset(Float_t offset=0.005)
Set distance between the axis and the labels.
virtual Float_t GetLabelSize() const
virtual void SetTickLength(Float_t length=0.03)
Set tick mark length.
virtual void SetNdivisions(Int_t n=510, Bool_t optim=kTRUE)
Set the number of divisions for this axis.
virtual void SetLabelColor(Color_t color=1, Float_t alpha=1.)
Set color of labels.
Class to manage histogram axis.
virtual void SetLimits(Double_t xmin, Double_t xmax)
void RnrLabels() const
Render label reading prepared list ov value-pos pairs.
void RnrLines() const
Render axis main line and tick-marks.
void SetLabelAlign(TGLFont::ETextAlignH_e, TGLFont::ETextAlignV_e)
Set label align.
std::vector< Lab_t > LabVec_t
void SetUseAxisColors(Bool_t x)
void SetAttAxis(TAttAxis *a)
void SetLabelPixelFontSize(Int_t fs)
TGLVector3 & RefTMOff(Int_t i)
void SetFontMode(TGLFont::EMode m)
void PaintAxis(TGLRnrCtx &ctx, TAxis *ax)
GL render TAxis.
A GL overlay element which displays camera furstum.
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.
virtual void Render(TGLRnrCtx &rnrCtx)
Display coordinates info of current frustum.
void RenderPlaneIntersect(TGLRnrCtx &rnrCtx)
Draw cross section coordinates in top right corner of screen.
TAttAxis * GetAttAxis()
Get axis attributes.
TGLCameraOverlay(const TGLCameraOverlay &)
void RenderBar(TGLRnrCtx &rnrCtx)
Show frustum size with fixed screen line length and printed value.
virtual ~TGLCameraOverlay()
Destructor.
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.
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)
Double_t Sqrt(Double_t x)
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Double_t Log10(Double_t x)