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]);
203 Double_t rngY = fFrustum[3] - fFrustum[1];
215 GLushort stipple = 0x5555;
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++)
251 tmp = vy1 + xdir * (i->first);
252 glVertex3dv(tmp.
Arr());
253 tmp = vy2 + xdir * (i->first);
254 glVertex3dv(tmp.Arr());
262 glPushAttrib(GL_ENABLE_BIT | GL_LINE_BIT);
263 glEnable(GL_LINE_STIPPLE);
264 glLineStipple(1, stipple);
268 Double_t omin = 0, omax = 0, bw1 = 0;
271 while (val < fFrustum[2])
273 for (
Int_t k=0; k<ondiv; k++)
276 tmp = vy1 + xdir * val;
277 glVertex3dv(tmp.
Arr());
278 tmp = vy2 + xdir * val;
279 glVertex3dv(tmp.Arr());
282 val = labs[0].second - bw1;
283 while(val > fFrustum[0])
285 tmp = vy1 + xdir * val;
286 glVertex3dv(tmp.
Arr());
287 tmp = vy2 + xdir * val;
288 glVertex3dv(tmp.Arr());
306 glTranslated(vx1.
X(), vx1.
Y(), vx1.
Z());
312 glTranslated(vx2.
X(), vx2.
Y(), vx2.
Z());
326 for ( TGLAxisPainter::LabVec_t::iterator i = labs.begin(); i != labs.end(); i++)
328 tmp = vx1 + ydir *(i->first);
329 glVertex3dv(tmp.
Arr());
330 tmp = vx2 + ydir *(i->first);
331 glVertex3dv(tmp.Arr());
339 glPushAttrib(GL_ENABLE_BIT | GL_LINE_BIT);
340 glEnable(GL_LINE_STIPPLE);
341 glLineStipple(1, stipple);
345 Double_t omin = 0, omax = 0, bw1 = 0;
348 val = labs[0].second;
349 while(val < fFrustum[3])
351 for(
Int_t k=0; k<ondiv; k++)
354 tmp = vx1 + ydir *val;
355 glVertex3dv(tmp.
Arr());
356 tmp = vx2 + ydir * val;
357 glVertex3dv(tmp.Arr());
361 val = labs[0].second - bw1;
362 while(val > fFrustum[1])
364 tmp = vx1 + ydir *val;
365 glVertex3dv(tmp.
Arr());
366 tmp = vx2 + ydir * val;
367 glVertex3dv(tmp.Arr());
407 const char* txt =
Form(
"%.*f", (exp < 0) ? -exp : 0, red);
411 font.
BBox(txt, bb[0], bb[1], bb[2], bb[3], bb[4], bb[5]);
416 glTranslated(v.
X(), v.
Y(), v.
Z());
421 glPushAttrib(GL_ENABLE_BIT | GL_LINE_BIT);
426 v = xdir*xt + ydir*yt;
427 glTranslated(v.
X(), v.
Y(), v.
Z());
432 glVertex3dv(v.
Arr());
434 glVertex3dv(v.Arr());
436 v = xdir*barsize + ydir*mH;
437 glVertex3dv(v.Arr());
438 v = xdir*barsize - ydir*mH;
439 glVertex3dv(v.Arr());
443 glVertex3dv(v.Arr());
445 glVertex3dv(v.Arr());
448 glVertex3dv(v.Arr());
450 glVertex3dv(v.Arr());
452 glVertex3d(0, 0., 0.);
454 glVertex3dv(v.Arr());
474 glPushAttrib(GL_ENABLE_BIT | GL_LINE_BIT);
476 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
481 glGetFloatv(GL_DEPTH_RANGE, old_depth_range);
490 glDepthRange(0, 0.1);
494 glDepthRange(0, 0.1);
498 glDepthRange(0, 0.1);
502 glDepthRange(1, 0.9);
514 glDepthRange(old_depth_range[0], old_depth_range[1]);
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...
Double_t Floor(Double_t x)
Abstract base camera class - concrete classes for orthographic and perspective cameras derive from it...
void SetUseAxisColors(Bool_t x)
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).
16 component (4x4) transform matrix - column MAJOR as per GL.
TGLPlane fExternalRefPlane
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.
virtual Color_t GetAxisColor() const
virtual void SetLabelColor(Color_t color=1, Float_t alpha=1.)
Set color of labels.
void RenderAxis(TGLRnrCtx &rnrCtx, Bool_t drawGrid)
Draw axis on four edges and a transparent grid.
virtual void SetNdivisions(Int_t n=510, Bool_t optim=kTRUE)
Set the number of divisions for this axis.
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
const TGLMatrix & GetCamTrans() const
void SetFontMode(TGLFont::EMode m)
void SetFrustum(TGLCamera &cam)
Set frustum values from given camera.
TGLCameraOverlay(const TGLCameraOverlay &)
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.
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...
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
TGLVector3 & RefTMOff(Int_t i)
virtual Bool_t IsPerspective() const
std::vector< Lab_t > LabVec_t
virtual ~TGLCameraOverlay()
Destructor.
3 component (x/y/z) vertex class.
Double_t Log10(Double_t x)
Viewport (pixel base) 2D rectangle class.
3 component (x/y/z) vector class.
void RegisterFont(Int_t size, Int_t file, Int_t mode, TGLFont &out)
Get font in the GL rendering context.
const TGLMatrix & GetCamBase() const
virtual Int_t GetNdivisions() const
void PaintAxis(TGLRnrCtx &ctx, TAxis *ax)
GL render TAxis.
TGLVector3 GetTranslation() const
Return the translation component of matrix.
Class to manage histogram axis.
char * Form(const char *fmt,...)
void RnrLabels() const
Render label reading prepared list ov value-pos pairs.
3D space, fixed length, line class, with direction / length 'vector', passing through point 'vertex'...
void RenderBar(TGLRnrCtx &rnrCtx)
Show frustum size with fixed screen line length and printed value.
virtual void SetAxisColor(Color_t color=1, Float_t alpha=1.)
Set color of the line axis and tick marks.
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.
virtual Bool_t IsOrthographic() const
Double_t Dot(const TGLVector3 &v1, const TGLVector3 &v2)
Bool_t fUseExternalRefPlane
Color_t GetColorIndex() const
Returns color-index representing the color.
void RnrLines() const
Render axis main line and tick-marks.
void RenderPlaneIntersect(TGLRnrCtx &rnrCtx)
Draw cross section coordinates in top right corner of screen.
const TGLPlane & FrustumPlane(EFrustumPlane plane) const
void SetLabelPixelFontSize(Int_t fs)
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
virtual void SetTickLength(Float_t length=0.03)
Set tick mark length The length is expressed in per cent of the pad width.
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)
TGLColorSet & ColorSet()
Return reference to current color-set (top of the stack).
3D plane class - of format Ax + By + Cz + D = 0
TAttAxis * GetAttAxis()
Get axis attributes.
TGLVector3 GetBaseVec(Int_t b) const
void SetAttAxis(TAttAxis *a)
std::pair< Bool_t, TGLLine3 > Intersection(const TGLPlane &p1, const TGLPlane &p2)
Find 3D line interestion of this plane with 'other'.