Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TX11GL.h
Go to the documentation of this file.
1// @(#)root/gl:$Id$
2// Author: Timur Pocheptsov 09/08/2004
3
4/*************************************************************************
5 * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TX11GL
13#define ROOT_TX11GL
14
15
16//////////////////////////////////////////////////////////////////////////
17// //
18// TX11GL //
19// //
20// The TX11GL is X11 implementation of TVirtualGLImp class. //
21// //
22//////////////////////////////////////////////////////////////////////////
23
24#include "TVirtualGL.h"
25
26#if !defined(__CLING__)
27#include <GL/glx.h>
28#else
29typedef struct _XDisplay Display;
30struct XVisualInfo;
31#endif
32
33
34class TX11GLManager : public TGLManager {
35private:
36 class TX11GLImpl;
38
39public:
41 ~TX11GLManager() override;
42
43 //All public functions are TGLManager's final-overriders
44
45 //index returned can be used as a result of gVirtualX->InitWindow
46 Int_t InitGLWindow(Window_t winID) override;
47 //winInd is the index, returned by InitGLWindow
49
50 //[ Off-screen rendering part
51 //create pixmap to read GL buffer into it,
52 //ctxInd is the index, returned by CreateGLContext
55 //analog of gVirtualX->SelectWindow(fPixmapID) => gVirtualGL->SelectOffScreenDevice(fPixmapID)
56 void SelectOffScreenDevice(Int_t devInd) override;
57 //Index of pixmap, valid for gVirtualX
59 //copy pixmap into window directly/by pad
60 void MarkForDirectCopy(Int_t devInd, Bool_t) override;
61 //Off-screen device holds sizes for glViewport
62 void ExtractViewport(Int_t devInd, Int_t *vp) override;
63 //Read GL buffer into pixmap
64 void ReadGLBuffer(Int_t devInd) override;
65 //]
66
67 //Make the gl context current
69 //Sswap buffers or copies pixmap (XCopyArea)
70 void Flush(Int_t ctxInd) override;
71 //Generic function for gl context and off-screen device deletion
72 void DeleteGLContext(Int_t devInd) override;
73
74 //used by viewer
75 Bool_t SelectManip(TVirtualGLManip *manip, const TGLCamera *camera, const TGLRect *rect, const TGLBoundingBox *sceneBox) override;
76 //
78 char *GetPlotInfo(TVirtualGLPainter *plot, Int_t px, Int_t py) override;
79 //
80 void PaintSingleObject(TVirtualGLPainter *) override;
81 void PanObject(TVirtualGLPainter *o, Int_t x, Int_t y) override;
82 void PrintViewer(TVirtualViewer3D *vv) override;
83
84 Bool_t HighColorFormat(Int_t /*ctxInd*/) override{return kFALSE;}
85
86 struct TGLContext_t;
87
88private:
89 Bool_t CreateGLPixmap(TGLContext_t &);
90
91 //implicit copy-ctor/assignment generation
92 // was already disabled by base class, but to be explicit ...
95
96 ClassDefOverride(TX11GLManager, 0) //X11-specific version of TGLManager
97};
98
99
100
101#endif
Handle_t Window_t
Window handle.
Definition GuiTypes.h:29
#define h(i)
Definition RSha256.hxx:106
bool Bool_t
Definition RtypesCore.h:63
constexpr Bool_t kFALSE
Definition RtypesCore.h:94
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
winID h Flush
winID h PrintViewer
winID AttachOffScreenDevice
winID h TVirtualViewer3D PanObject
winID h DeleteGLContext
winID winInd
winID h TVirtualViewer3D vv
winID h devInd
winID h SelectOffScreenDevice
winID h TVirtualViewer3D TVirtualGLPainter char TVirtualGLPainter plot
winID h TVirtualViewer3D TVirtualGLPainter char GetPlotInfo
winID h MarkForDirectCopy
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t rect
Concrete class describing an orientated (free) or axis aligned box of 8 vertices.
Abstract base camera class - concrete classes for orthographic and perspective cameras derive from it...
Definition TGLCamera.h:44
Viewport (pixel base) 2D rectangle class.
Definition TGLUtil.h:422
Abstract 3D shapes viewer.
The TX11GLManager is X11 implementation of TGLManager.
Definition TX11GL.h:34
TX11GLManager & operator=(const TX11GLManager &)
~TX11GLManager() override
Destructor.
Definition TX11GL.cxx:194
void ReadGLBuffer(Int_t devInd) override
GL buffer is read info buffer, after that lines are reordered into XImage, XImage copied into pixmap.
Definition TX11GL.cxx:453
Bool_t HighColorFormat(Int_t) override
Definition TX11GL.h:84
Bool_t MakeCurrent(Int_t devInd) override
Make GL context current.
Definition TX11GL.cxx:286
Int_t GetVirtualXInd(Int_t devInd) override
Returns an index suitable for gVirtualX.
Definition TX11GL.cxx:517
Bool_t ResizeOffScreenDevice(Int_t devInd, Int_t x, Int_t y, UInt_t w, UInt_t h) override
Resize off screen device.
Definition TX11GL.cxx:395
Int_t CreateGLContext(Int_t winInd) override
Context creation requires Display * and XVisualInfo (was saved for such winInd).
Definition TX11GL.cxx:253
Bool_t CreateGLPixmap(TGLContext_t &)
Create GL pixmap.
Definition TX11GL.cxx:321
void PaintSingleObject(TVirtualGLPainter *) override
Paint a single object.
Definition TX11GL.cxx:542
Bool_t PlotSelected(TVirtualGLPainter *plot, Int_t px, Int_t py) override
Analog of TObject::DistancetoPrimitive.
Definition TX11GL.cxx:576
TX11GLManager()
Constructor.
Definition TX11GL.cxx:184
Bool_t SelectManip(TVirtualGLManip *manip, const TGLCamera *camera, const TGLRect *rect, const TGLBoundingBox *sceneBox) override
Select manipulator.
Definition TX11GL.cxx:559
TX11GLManager(const TX11GLManager &)
TX11GLImpl * fPimpl
Definition TX11GL.h:37
void ExtractViewport(Int_t devInd, Int_t *vp) override
Returns the current dimensions of a GL pixmap.
Definition TX11GL.cxx:526
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17