ROOT  6.06/09
Reference Guide
TGOSXGL.h
Go to the documentation of this file.
1 #ifndef ROOT_TGOSXGL
2 #define ROOT_TGOSXGL
3 
4 #include <map>
5 
6 #ifndef ROOT_TVirtualGL
7 #include "TVirtualGL.h"
8 #endif
9 
10 //
11 //TGLManager is a legacy interface (gl-context/window management):
12 //at some point we had to use OpenGL in our TCanvas/TPad classes which do not
13 //have direct access to low-level APIs + on Windows we had quite tricky
14 //mt-problems to deal with.
15 //TODO: in principle, we can get rid of gl-managers and work with TGLWidget,
16 //as it was demonstrated in glpad dev-branch 5 years ago.
17 //
18 
19 class TGOSXGLManager : public TGLManager {
20 public:
23 
24  //TGLManager's final-overriders (window + context management):
26  Int_t CreateGLContext(Int_t winInd);
27  void DeleteGLContext(Int_t devInd);
28  Bool_t MakeCurrent(Int_t devInd);
29  void Flush(Int_t ctxInd);
30 
31  //In case of Cocoa 'VirtulXInd' == devInd (again, legacy).
32  Int_t GetVirtualXInd(Int_t devInd);
33 
34  //These are empty overriders, we do not have/use off-screen renreding in TCanvas/TPad anymore
35  //(before we had 1) non-hardware glpixmaps/DIB sections and later 2) a hack with double buffer).
38  void SelectOffScreenDevice(Int_t devInd);
39  void MarkForDirectCopy(Int_t devInd, Bool_t);
40  void ExtractViewport(Int_t devInd, Int_t *vp);
41  void ReadGLBuffer(Int_t devInd);
42 
43  //Used by our OpenGL viewer.
44  //In the past we had to implement this functions to deal with mt-issues on Windows.
45  Bool_t SelectManip(TVirtualGLManip *manip, const TGLCamera *camera, const TGLRect *rect, const TGLBoundingBox *sceneBox);
47  char *GetPlotInfo(TVirtualGLPainter *plot, Int_t px, Int_t py);
49  void PanObject(TVirtualGLPainter *o, Int_t x, Int_t y);
50  void PrintViewer(TVirtualViewer3D *vv);
51 
52  Bool_t HighColorFormat(Int_t /*ctxInd*/){return kFALSE;}
53 
54 private:
55  typedef std::map<Handle_t, Window_t> CtxToWindowMap_t;
56  CtxToWindowMap_t fCtxToWin;
57 
60 
61  ClassDef(TGOSXGLManager, 0) //Cocoa specific version of TGLManager.
62 };
63 
64 #endif
Bool_t ResizeOffScreenDevice(Int_t devInd, Int_t x, Int_t y, UInt_t w, UInt_t h)
Definition: TGOSXGL.mm:138
Abstract base camera class - concrete classes for orthographic and perspective cameras derive from it...
Definition: TGLCamera.h:43
void Flush(Int_t ctxInd)
Definition: TGOSXGL.mm:114
Int_t GetVirtualXInd(Int_t devInd)
Definition: TGOSXGL.mm:121
TH1 * h
Definition: legend2.C:5
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
void ReadGLBuffer(Int_t devInd)
const Bool_t kFALSE
Definition: Rtypes.h:92
Bool_t HighColorFormat(Int_t)
Definition: TGOSXGL.h:52
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:254
Bool_t SelectManip(TVirtualGLManip *manip, const TGLCamera *camera, const TGLRect *rect, const TGLBoundingBox *sceneBox)
Definition: TGOSXGL.mm:173
Int_t InitGLWindow(Window_t winID)
Definition: TGOSXGL.mm:48
Viewport (pixel base) 2D rectangle class.
Definition: TGLUtil.h:426
Abstract 3D shapes viewer.
Bool_t PlotSelected(TVirtualGLPainter *plot, Int_t px, Int_t py)
Definition: TGOSXGL.mm:187
void SelectOffScreenDevice(Int_t devInd)
CtxToWindowMap_t fCtxToWin
Definition: TGOSXGL.h:56
Int_t CreateGLContext(Int_t winInd)
Definition: TGOSXGL.mm:86
Bool_t MakeCurrent(Int_t devInd)
Definition: TGOSXGL.mm:105
unsigned int UInt_t
Definition: RtypesCore.h:42
void DeleteGLContext(Int_t devInd)
Definition: TGOSXGL.mm:98
void ExtractViewport(Int_t devInd, Int_t *vp)
Definition: TGOSXGL.mm:159
void PaintSingleObject(TVirtualGLPainter *)
Definition: TGOSXGL.mm:205
Bool_t AttachOffScreenDevice(Int_t ctxInd, Int_t x, Int_t y, UInt_t w, UInt_t h)
Definition: TGOSXGL.mm:130
Double_t y[n]
Definition: legend1.C:17
std::map< Handle_t, Window_t > CtxToWindowMap_t
Definition: TGOSXGL.h:55
Concrete class describing an orientated (free) or axis aligned box of 8 vertices. ...
char * GetPlotInfo(TVirtualGLPainter *plot, Int_t px, Int_t py)
Definition: TGOSXGL.mm:196
TGOSXGLManager & operator=(const TGOSXGLManager &)
Handle_t Window_t
Definition: GuiTypes.h:30
void PrintViewer(TVirtualViewer3D *vv)
Definition: TGOSXGL.mm:223
void PanObject(TVirtualGLPainter *o, Int_t x, Int_t y)
Definition: TGOSXGL.mm:214
void MarkForDirectCopy(Int_t devInd, Bool_t)
Definition: TGOSXGL.mm:153