source: trunk/source/visualization/OpenGL/include/G4OpenGLXViewer.hh @ 914

Last change on this file since 914 was 914, checked in by garnier, 15 years ago

test avec des predefined headers...mais +10% de temps de compilation....

  • Property svn:mime-type set to text/cpp
File size: 4.1 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer                                           *
4// *                                                                  *
5// * The  Geant4 software  is  copyright of the Copyright Holders  of *
6// * the Geant4 Collaboration.  It is provided  under  the terms  and *
7// * conditions of the Geant4 Software License,  included in the file *
8// * LICENSE and available at  http://cern.ch/geant4/license .  These *
9// * include a list of copyright holders.                             *
10// *                                                                  *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work  make  any representation or  warranty, express or implied, *
14// * regarding  this  software system or assume any liability for its *
15// * use.  Please see the license in the file  LICENSE  and URL above *
16// * for the full disclaimer and the limitation of liability.         *
17// *                                                                  *
18// * This  code  implementation is the result of  the  scientific and *
19// * technical work of the GEANT4 collaboration.                      *
20// * By using,  copying,  modifying or  distributing the software (or *
21// * any work based  on the software)  you  agree  to acknowledge its *
22// * use  in  resulting  scientific  publications,  and indicate your *
23// * acceptance of all terms of the Geant4 Software license.          *
24// ********************************************************************
25//
26//
27// $Id: G4OpenGLXViewer.hh,v 1.29 2009/01/19 16:08:47 lgarnier Exp $
28// GEANT4 tag $Name:  $
29//
30//
31// Andrew Walkden  7th February 1997
32// G4OpenGLXViewer : Class to provide XWindows specific
33//                   functionality for OpenGL in GEANT4
34
35#ifdef G4VIS_BUILD_OPENGLX_DRIVER
36
37#ifndef G4OPENGLXVIEWER_HH
38#define G4OPENGLXVIEWER_HH
39
40#include "G4OpenGLViewer.hh"
41#include "globals.hh"
42
43#include <X11/Xlib.h>
44#include <X11/Intrinsic.h>
45#include <X11/Xmu/StdCmap.h>
46
47#include <GL/glx.h>
48
49class G4OpenGLSceneHandler;
50
51class G4OpenGLXViewer: virtual public G4OpenGLViewer {
52
53  friend class G4OpenGLXViewerMessenger;
54  friend class G4OpenGLXmViewer;
55
56public:
57  G4OpenGLXViewer (G4OpenGLSceneHandler& scene);
58  virtual ~G4OpenGLXViewer ();
59  void SetView ();
60  void ShowView ();
61
62protected:
63  void GetXConnection ();
64  void CreateGLXContext (XVisualInfo* vi);
65  virtual void CreateMainWindow ();
66  virtual void CreateFontLists ();
67  void print();
68
69  static int snglBuf_RGBA[12];
70  static int dblBuf_RGBA[13];
71
72//////////////////////////////Pixmap (screen dump) production functions/////
73  GLXContext create_GL_print_context (XVisualInfo*& pvi);
74
75  XWindowAttributes                 xwa;
76  Display                           *dpy;
77  static XVisualInfo                *vi_single_buffer;
78  static XVisualInfo                *vi_double_buffer;
79  XVisualInfo                       *vi_immediate,
80                                    *vi_stored,
81                                    *vi;
82  Colormap                          cmap;
83  XSetWindowAttributes              swa;
84  GLXDrawable                       win;
85  GLXContext                        cx;
86  XEvent                            event;
87  G4int                             *attributeList,
88                                    errorBase,
89                                    eventBase,
90                                    major,
91                                    minor;
92  XSizeHints                        *norm_hints;
93  XWMHints                          *wm_hints;
94  XClassHint                        *class_hints;
95  Pixmap                            icon_pixmap;
96  XSizeHints                        *size_hints;
97  Atom                              Xatom;
98  XTextProperty                     windowName,
99                                    iconName;
100  char                              charViewName [100];
101
102private:
103  G4OpenGLXViewer (const G4OpenGLXViewer&);
104  G4OpenGLXViewer& operator = (const G4OpenGLXViewer&);
105};
106
107#endif
108
109#endif
Note: See TracBrowser for help on using the repository browser.