Logo ROOT  
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 #include "TVirtualGL.h"
7 
8 //
9 //TGLManager is a legacy interface (gl-context/window management):
10 //at some point we had to use OpenGL in our TCanvas/TPad classes which do not
11 //have direct access to low-level APIs + on Windows we had quite tricky
12 //mt-problems to deal with.
13 //
14 
15 class TGOSXGLManager : public TGLManager {
16 public:
19 
20  //TGLManager's final-overriders (window + context management):
22  Int_t CreateGLContext(Int_t winInd);
23  void DeleteGLContext(Int_t devInd);
24  Bool_t MakeCurrent(Int_t devInd);
25  void Flush(Int_t ctxInd);
26 
27  //In case of Cocoa 'VirtulXInd' == devInd (again, legacy).
28  Int_t GetVirtualXInd(Int_t devInd);
29 
30  //These are empty overriders, we do not have/use off-screen renreding in TCanvas/TPad anymore
31  //(before we had 1) non-hardware glpixmaps/DIB sections and later 2) a hack with double buffer).
34  void SelectOffScreenDevice(Int_t devInd);
35  void MarkForDirectCopy(Int_t devInd, Bool_t);
36  void ExtractViewport(Int_t devInd, Int_t *vp);
37  void ReadGLBuffer(Int_t devInd);
38 
39  //Used by our OpenGL viewer.
40  //In the past we had to implement this functions to deal with mt-issues on Windows.
41  Bool_t SelectManip(TVirtualGLManip *manip, const TGLCamera *camera, const TGLRect *rect, const TGLBoundingBox *sceneBox);
43  char *GetPlotInfo(TVirtualGLPainter *plot, Int_t px, Int_t py);
46  void PrintViewer(TVirtualViewer3D *vv);
47 
48  Bool_t HighColorFormat(Int_t /*ctxInd*/){return kFALSE;}
49 
50 private:
51  typedef std::map<Handle_t, Window_t> CtxToWindowMap_t;
53 
56 
57  ClassDef(TGOSXGLManager, 0) //Cocoa specific version of TGLManager.
58 };
59 
60 #endif
TGOSXGLManager::ExtractViewport
void ExtractViewport(Int_t devInd, Int_t *vp)
Definition: TGOSXGL.mm:154
TGOSXGLManager::GetPlotInfo
char * GetPlotInfo(TVirtualGLPainter *plot, Int_t px, Int_t py)
Definition: TGOSXGL.mm:191
TGOSXGLManager::MakeCurrent
Bool_t MakeCurrent(Int_t devInd)
Definition: TGOSXGL.mm:100
TGOSXGLManager::operator=
TGOSXGLManager & operator=(const TGOSXGLManager &)
TGOSXGLManager::GetVirtualXInd
Int_t GetVirtualXInd(Int_t devInd)
Definition: TGOSXGL.mm:116
TGOSXGLManager::SelectOffScreenDevice
void SelectOffScreenDevice(Int_t devInd)
Definition: TGOSXGL.mm:141
TVirtualGLPainter
Definition: TVirtualGL.h:45
TGOSXGLManager::AttachOffScreenDevice
Bool_t AttachOffScreenDevice(Int_t ctxInd, Int_t x, Int_t y, UInt_t w, UInt_t h)
Definition: TGOSXGL.mm:125
TGOSXGLManager::InitGLWindow
Int_t InitGLWindow(Window_t winID)
Definition: TGOSXGL.mm:46
TGLCamera
Definition: TGLCamera.h:43
x
Double_t x[n]
Definition: legend1.C:17
TGLBoundingBox
Definition: TGLBoundingBox.h:32
bool
TGOSXGLManager::TGOSXGLManager
TGOSXGLManager()
Definition: TGOSXGL.mm:19
TGOSXGLManager::PanObject
void PanObject(TVirtualGLPainter *o, Int_t x, Int_t y)
Definition: TGOSXGL.mm:209
TGOSXGLManager::SelectManip
Bool_t SelectManip(TVirtualGLManip *manip, const TGLCamera *camera, const TGLRect *rect, const TGLBoundingBox *sceneBox)
Definition: TGOSXGL.mm:168
h
#define h(i)
Definition: RSha256.hxx:124
TGOSXGLManager::MarkForDirectCopy
void MarkForDirectCopy(Int_t devInd, Bool_t)
Definition: TGOSXGL.mm:148
TGOSXGLManager::fCtxToWin
CtxToWindowMap_t fCtxToWin
Definition: TGOSXGL.h:52
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TGOSXGLManager::ResizeOffScreenDevice
Bool_t ResizeOffScreenDevice(Int_t devInd, Int_t x, Int_t y, UInt_t w, UInt_t h)
Definition: TGOSXGL.mm:133
TGOSXGLManager::Flush
void Flush(Int_t ctxInd)
Definition: TGOSXGL.mm:109
TGOSXGLManager::DeleteGLContext
void DeleteGLContext(Int_t devInd)
Definition: TGOSXGL.mm:93
TGLManager
Definition: TVirtualGL.h:70
Window_t
Handle_t Window_t
Definition: GuiTypes.h:28
y
Double_t y[n]
Definition: legend1.C:17
TGOSXGLManager::~TGOSXGLManager
~TGOSXGLManager()
Definition: TGOSXGL.mm:36
unsigned int
TGOSXGLManager::ReadGLBuffer
void ReadGLBuffer(Int_t devInd)
Definition: TGOSXGL.mm:160
TGLRect
Definition: TGLUtil.h:421
TGOSXGLManager
Definition: TGOSXGL.h:15
TVirtualGL.h
TGOSXGLManager::PlotSelected
Bool_t PlotSelected(TVirtualGLPainter *plot, Int_t px, Int_t py)
Definition: TGOSXGL.mm:182
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TVirtualViewer3D
Definition: TVirtualViewer3D.h:33
TGOSXGLManager::PrintViewer
void PrintViewer(TVirtualViewer3D *vv)
Definition: TGOSXGL.mm:218
TVirtualGLManip
Definition: TVirtualGL.h:59
TGOSXGLManager::HighColorFormat
Bool_t HighColorFormat(Int_t)
Definition: TGOSXGL.h:48
TGOSXGLManager::CreateGLContext
Int_t CreateGLContext(Int_t winInd)
Definition: TGOSXGL.mm:81
TGOSXGLManager::CtxToWindowMap_t
std::map< Handle_t, Window_t > CtxToWindowMap_t
Definition: TGOSXGL.h:51
TGOSXGLManager::PaintSingleObject
void PaintSingleObject(TVirtualGLPainter *)
Definition: TGOSXGL.mm:200
int