TX11GL.h

Go to the documentation of this file.
00001 // @(#)root/gl:$Id: TX11GL.h 33579 2010-05-19 12:43:08Z rdm $
00002 // Author: Timur Pocheptsov 09/08/2004
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TX11GL
00013 #define ROOT_TX11GL
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TX11GL                                                               //
00019 //                                                                      //
00020 // The TX11GL is X11 implementation of TVirtualGLImp class.             //
00021 //                                                                      //
00022 //////////////////////////////////////////////////////////////////////////
00023 
00024 #ifndef ROOT_TVirtualGL
00025 #include "TVirtualGL.h"
00026 #endif
00027 
00028 #if !defined(__CINT__)
00029 #include <GL/glx.h>
00030 #else
00031 struct Display;
00032 struct XVisualInfo;
00033 #endif
00034 
00035 
00036 class TX11GLManager : public TGLManager {
00037 private:
00038    class TX11GLImpl;
00039    TX11GLImpl *fPimpl;
00040 
00041 public:
00042    TX11GLManager();
00043    ~TX11GLManager();
00044 
00045    //All public functions are TGLManager's final-overriders
00046 
00047    //index returned can be used as a result of gVirtualX->InitWindow
00048    Int_t    InitGLWindow(Window_t winID);
00049    //winInd is the index, returned by InitGLWindow
00050    Int_t    CreateGLContext(Int_t winInd);
00051 
00052    //[            Off-screen rendering part
00053    //create pixmap to read GL buffer into it,
00054    //ctxInd is the index, returned by CreateGLContext
00055    Bool_t   AttachOffScreenDevice(Int_t ctxInd, Int_t x, Int_t y, UInt_t w, UInt_t h);
00056    Bool_t   ResizeOffScreenDevice(Int_t devInd, Int_t x, Int_t y, UInt_t w, UInt_t h);
00057    //analog of gVirtualX->SelectWindow(fPixmapID) => gVirtualGL->SelectOffScreenDevice(fPixmapID)
00058    void     SelectOffScreenDevice(Int_t devInd);
00059    //Index of pixmap, valid for gVirtualX
00060    Int_t    GetVirtualXInd(Int_t devInd);
00061    //copy pixmap into window directly/by pad
00062    void     MarkForDirectCopy(Int_t devInd, Bool_t);
00063    //Off-screen device holds sizes for glViewport
00064    void     ExtractViewport(Int_t devInd, Int_t *vp);
00065    //Read GL buffer into pixmap
00066    void     ReadGLBuffer(Int_t devInd);
00067    //]
00068 
00069    //Make the gl context current
00070    Bool_t   MakeCurrent(Int_t devInd);
00071    //Sswap buffers or copies pixmap (XCopyArea)
00072    void     Flush(Int_t ctxInd);
00073    //Generic function for gl context and off-screen device deletion
00074    void     DeleteGLContext(Int_t devInd);
00075 
00076    //used by viewer
00077    Bool_t   SelectManip(TVirtualGLManip *manip, const TGLCamera *camera, const TGLRect *rect, const TGLBoundingBox *sceneBox);
00078    //
00079    Bool_t   PlotSelected(TVirtualGLPainter *plot, Int_t px, Int_t py);
00080    char    *GetPlotInfo(TVirtualGLPainter *plot, Int_t px, Int_t py);
00081    //
00082    void     PaintSingleObject(TVirtualGLPainter *);
00083    void     PanObject(TVirtualGLPainter *o, Int_t x, Int_t y);
00084    void     PrintViewer(TVirtualViewer3D *vv);
00085 
00086    Bool_t   HighColorFormat(Int_t /*ctxInd*/){return kFALSE;}
00087 
00088    struct TGLContext_t;
00089 
00090 private:
00091    Bool_t CreateGLPixmap(TGLContext_t &);
00092 
00093    //implicit copy-ctor/assignment generation
00094    // was already disabled by base class, but to be explicit ...
00095    TX11GLManager(const TX11GLManager &);
00096    TX11GLManager &operator = (const TX11GLManager &);
00097 
00098    ClassDef(TX11GLManager, 0) //X11-specific version of TGLManager
00099 };
00100 
00101 
00102 
00103 #endif

Generated on Tue Jul 5 14:16:57 2011 for ROOT_528-00b_version by  doxygen 1.5.1