/usr/include/root/TVirtualGL.h is in libroot-core-dev 5.34.19+dfsg-1.2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | // @(#)root/base:$Id$
// Author: Valery Fine(fine@vxcern.cern.ch) 05/03/97
/*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_TVirtualGL
#define ROOT_TVirtualGL
//////////////////////////////////////////////////////////////////////////
// //
// TVirtualGL //
// //
// The TVirtualGL class is an abstract base class defining the //
// OpenGL interface protocol. All interactions with OpenGL should be //
// done via the global pointer gVirtualGL. If the OpenGL library is //
// available this pointer is pointing to an instance of the TGLKernel //
// class which provides the actual interface to OpenGL. Using this //
// scheme of ABC we can use OpenGL in other parts of the framework //
// without having to link with the OpenGL library in case we don't //
// use the classes using OpenGL. //
// //
//////////////////////////////////////////////////////////////////////////
#ifndef ROOT_TNamed
#include "TNamed.h"
#endif
#ifndef ROOT_GuiTypes
#include "GuiTypes.h"
#endif
#ifndef ROOT_GLConstants
#include "GLConstants.h"
#endif
class TVirtualViewer3D;
class TPoints3DABC;
class TGLViewer;
class TGLCamera;
class TGLManip;
class TGLBoundingBox;
class TGLRect;
//TVirtualGLPainter is the base for histogramm painters.
class TVirtualGLPainter {
public:
virtual ~TVirtualGLPainter(){}
virtual void Paint() = 0;
virtual void Pan(Int_t px, Int_t py) = 0;
virtual Bool_t PlotSelected(Int_t px, Int_t py) = 0;
//Used by status bar in a canvas.
virtual char *GetPlotInfo(Int_t px, Int_t py) = 0;
ClassDef(TVirtualGLPainter, 0); // Interface for OpenGL painter
};
//We need this class to implement TGWin32GLManager's SelectManip
class TVirtualGLManip {
public:
virtual ~TVirtualGLManip(){}
virtual Bool_t Select(const TGLCamera & camera, const TGLRect & rect, const TGLBoundingBox & sceneBox) = 0;
ClassDef(TVirtualGLManip, 0); //Interface for GL manipulator
};
//This class (and its descendants) in future will replace (?)
//TVirtualGL/TGLKernel/TGWin32GL/TGX11GL
class TGLManager : public TNamed {
public:
TGLManager();
//index returned can be used as a result of gVirtualX->InitWindow
virtual Int_t InitGLWindow(Window_t winID) = 0;
//winInd is the index, returned by InitGLWindow
virtual Int_t CreateGLContext(Int_t winInd) = 0;
//[ Off-screen rendering part
//create DIB section/pixmap to read GL buffer into it,
//ctxInd is the index, returned by CreateGLContext
virtual Bool_t AttachOffScreenDevice(Int_t ctxInd, Int_t x, Int_t y, UInt_t w, UInt_t h) = 0;
virtual Bool_t ResizeOffScreenDevice(Int_t ctxInd, Int_t x, Int_t y, UInt_t w, UInt_t h) = 0;
//analog of gVirtualX->SelectWindow(fPixmapID) => gVirtualGL->SelectOffScreenDevice(fPixmapID)
virtual void SelectOffScreenDevice(Int_t ctxInd) = 0;
//Index of DIB/pixmap, valid for gVirtualX
virtual Int_t GetVirtualXInd(Int_t ctxInd) = 0;
//copy pixmap into window directly
virtual void MarkForDirectCopy(Int_t ctxInd, Bool_t) = 0;
//Off-screen device holds sizes for glViewport
virtual void ExtractViewport(Int_t ctxInd, Int_t *vp) = 0;
//Read GL buffer into off-screen device
virtual void ReadGLBuffer(Int_t ctxInd) = 0;
//]
//Make the gl context current
virtual Bool_t MakeCurrent(Int_t ctxInd) = 0;
//Swap buffers or copies DIB/pixmap (via BitBlt/XCopyArea)
virtual void Flush(Int_t ctxInd) = 0;
//GL context and off-screen device deletion
virtual void DeleteGLContext(Int_t ctxInd) = 0;
//functions to switch between threads in win32
virtual Bool_t SelectManip(TVirtualGLManip *manip, const TGLCamera *camera, const TGLRect *rect, const TGLBoundingBox *sceneBox) = 0;
//
virtual void PaintSingleObject(TVirtualGLPainter *) = 0;
virtual void PanObject(TVirtualGLPainter *o, Int_t x, Int_t y) = 0;
//EPS/PDF output
virtual void PrintViewer(TVirtualViewer3D *vv) = 0;
virtual Bool_t PlotSelected(TVirtualGLPainter *plot, Int_t px, Int_t py) = 0;
virtual char *GetPlotInfo(TVirtualGLPainter *plot, Int_t px, Int_t py) = 0;
virtual Bool_t HighColorFormat(Int_t ctxInd) = 0;
static TGLManager *&Instance();
private:
TGLManager(const TGLManager &);
TGLManager &operator = (const TGLManager &);
ClassDef(TGLManager, 0)// Interface for OpenGL manager
};
namespace Rgl {
//I would prefer to use C++11's strong typed enums insted, but ...
enum EFormatOptions
{
kNone = 0,
kDoubleBuffer = 1,
kDepth = 2,
kAccum = 4,
kStencil = 8,
kStereo = 16,
kMultiSample = 32
};
}
class TGLContext;
class TGLFormat;
class TGLPaintDevice {
friend class TGLContext;
public:
virtual ~TGLPaintDevice(){}
virtual Bool_t MakeCurrent() = 0;
virtual void SwapBuffers() = 0;
virtual const TGLFormat *GetPixelFormat()const = 0;
virtual const TGLContext *GetContext()const = 0;
virtual void ExtractViewport(Int_t *vp)const = 0;
private:
virtual void AddContext(TGLContext *ctx) = 0;
virtual void RemoveContext(TGLContext *ctx) = 0;
ClassDef(TGLPaintDevice, 0) // Base class for GL widgets and GL off-screen rendering
};
#ifndef __CINT__
#define gGLManager (TGLManager::Instance())
R__EXTERN TGLManager *(*gPtr2GLManager)();
#endif
#endif
|