G4OpenGLXViewer.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id$
00028 //
00029 // 
00030 // Andrew Walkden  7th February 1997
00031 // G4OpenGLXViewer : Class to provide XWindows specific
00032 //                   functionality for OpenGL in GEANT4
00033 
00034 #ifdef G4VIS_BUILD_OPENGLX_DRIVER
00035 
00036 #ifndef G4OPENGLXVIEWER_HH
00037 #define G4OPENGLXVIEWER_HH
00038 
00039 #include "G4OpenGLViewer.hh"
00040 #include "globals.hh"
00041 
00042 #include <X11/Intrinsic.h>
00043 
00044 #include "G4OpenGL.hh"
00045 #include <GL/glx.h>
00046 
00047 class G4OpenGLSceneHandler;
00048 class G4Text;
00049 
00050 class G4OpenGLXViewer: virtual public G4OpenGLViewer {
00051 
00052   friend class G4OpenGLXViewerMessenger;
00053   friend class G4OpenGLXmViewer;
00054 
00055 public:
00056   G4OpenGLXViewer (G4OpenGLSceneHandler& scene);
00057   virtual ~G4OpenGLXViewer ();
00058   void SetView ();
00059   void ShowView ();
00060   void DrawText(const G4Text&);
00061 
00062 protected:
00063   void GetXConnection ();
00064   void CreateGLXContext (XVisualInfo* vi);
00065   virtual void CreateMainWindow ();
00066   virtual void CreateFontLists ();
00067 
00068   static int snglBuf_RGBA[12];
00069   static int dblBuf_RGBA[13];
00070 
00072 
00073   XWindowAttributes                 xwa;
00074   Display                           *dpy;
00075   static XVisualInfo                *vi_single_buffer;
00076   static XVisualInfo                *vi_double_buffer;
00077   XVisualInfo                       *vi_immediate,
00078                                     *vi_stored,
00079                                     *vi;
00080   Colormap                          cmap;
00081   XSetWindowAttributes              swa;
00082   GLXDrawable                       win;
00083   GLXContext                        cx;
00084   XEvent                            event;
00085   G4int                             *attributeList,
00086                                     errorBase,
00087                                     eventBase,
00088                                     major,
00089                                     minor;
00090   XSizeHints                        *norm_hints;
00091   XWMHints                          *wm_hints;
00092   XClassHint                        *class_hints;
00093   Pixmap                            icon_pixmap;
00094   XSizeHints                        *size_hints;
00095   Atom                              Xatom;
00096   XTextProperty                     windowName,
00097                                     iconName;
00098   char                              charViewName [100];
00099 
00100 
00101 private:
00102   G4OpenGLXViewer (const G4OpenGLXViewer&);
00103   G4OpenGLXViewer& operator = (const G4OpenGLXViewer&);
00104   GLXContext                        tmp_cx;
00105 };
00106 
00107 #endif
00108 
00109 #endif

Generated on Mon May 27 17:49:12 2013 for Geant4 by  doxygen 1.4.7