g4tools  5.4.0
plots_glarea
Go to the documentation of this file.
1 // Copyright (C) 2010, Guy Barrand. All rights reserved.
2 // See the file tools.license for terms.
3 
4 #ifndef tools_Qt_plots_glarea
5 #define tools_Qt_plots_glarea
6 
7 #include <QtOpenGL/qgl.h>
8 
9 #include "../sg/GL_plots_viewer"
10 
11 namespace tools {
12 namespace Qt {
13 
14 class plots_glarea : public QGLWidget {
15  typedef QGLWidget parent;
16 public:
17  virtual void initialieGL() {}
18  virtual void resizeGL(int a_w,int a_h){
19  //::printf("debug : resize : %d %d\n",a_w,a_h);
20 #if QT_VERSION < 0x050000
21 #else
22  m_width = a_w;
23  m_height = a_h;
24 #endif
25  }
26  //virtual void paintGL();
27  virtual void paintGL() {
28 #if QT_VERSION < 0x050000
29  //::printf("debug : tools::Qt::plots_glarea::paintGL %d %d\n",width(),height());
30  m_viewer.set_size(width(),height());
31 #else
32  //::printf("debug : tools::Qt::plots_glarea::paintGL %d %d\n",m_width,m_height);
33  m_viewer.set_size(m_width,m_height);
34 #endif
35  m_viewer.render();
36  }
37 
38 public:
39  plots_glarea(QWidget* a_parent,tools::sg::GL_plots_viewer& a_viewer):parent(a_parent),m_viewer(a_viewer){}
40  virtual ~plots_glarea(){}
41 protected:
43 #if QT_VERSION < 0x050000
44 #else
45 protected:
46  int m_width;
47  int m_height;
48 #endif
49 };
50 
51 }}
52 
53 #endif
54 
tools::Qt::plots_glarea::plots_glarea
plots_glarea(QWidget *a_parent, tools::sg::GL_plots_viewer &a_viewer)
Definition: plots_glarea:39
tools::Qt::plots_glarea::initialieGL
virtual void initialieGL()
Definition: plots_glarea:17
tools::sg::plots_viewer::set_size
virtual void set_size(unsigned int a_width, unsigned int a_height)
Definition: plots_viewer:31
tools::sg::GL_plots_viewer
Definition: GL_plots_viewer:19
tools::Qt::plots_glarea::m_viewer
tools::sg::GL_plots_viewer & m_viewer
Definition: plots_glarea:42
tools::sg::GL_plots_viewer::render
void render()
Definition: GL_plots_viewer:22
tools::Qt::plots_glarea
Definition: plots_glarea:14
tools::Qt::plots_glarea::~plots_glarea
virtual ~plots_glarea()
Definition: plots_glarea:40
tools
inlined C code : ///////////////////////////////////
Definition: aida_ntuple:26
tools::Qt::plots_glarea::paintGL
virtual void paintGL()
Definition: plots_glarea:27
tools::Qt::plots_glarea::resizeGL
virtual void resizeGL(int a_w, int a_h)
Definition: plots_glarea:18