anatomist  5.0.5
3D neuroimaging data viewer
glwidget.h
Go to the documentation of this file.
1 /* This software and supporting documentation are distributed by
2  * Institut Federatif de Recherche 49
3  * CEA/NeuroSpin, Batiment 145,
4  * 91191 Gif-sur-Yvette cedex
5  * France
6  *
7  * This software is governed by the CeCILL-B license under
8  * French law and abiding by the rules of distribution of free software.
9  * You can use, modify and/or redistribute the software under the
10  * terms of the CeCILL-B license as circulated by CEA, CNRS
11  * and INRIA at the following URL "http://www.cecill.info".
12  *
13  * As a counterpart to the access to the source code and rights to copy,
14  * modify and redistribute granted by the license, users are provided only
15  * with a limited warranty and the software's author, the holder of the
16  * economic rights, and the successive licensors have only limited
17  * liability.
18  *
19  * In this respect, the user's attention is drawn to the risks associated
20  * with loading, using, modifying and/or developing or reproducing the
21  * software by the user in light of its specific status of free software,
22  * that may mean that it is complicated to manipulate, and that also
23  * therefore means that it is reserved for developers and experienced
24  * professionals having in-depth computer knowledge. Users are therefore
25  * encouraged to load and test the software's suitability as regards their
26  * requirements in conditions enabling the security of their systems and/or
27  * data to be ensured and, more generally, to use and operate it in the
28  * same conditions as regards security.
29  *
30  * The fact that you are presently reading this means that you have had
31  * knowledge of the CeCILL-B license and that you accept its terms.
32  */
33 
34 
35 #ifndef ANATOMIST_WINDOW_GLWIDGET_H
36 #define ANATOMIST_WINDOW_GLWIDGET_H
37 
40 
41 
42 class QAGLWidget : public carto::GLWidget,
44 {
45  Q_OBJECT
46 
47 public:
48  QAGLWidget( anatomist::AWindow* win, QWidget* parent = 0,
49  const char* name = 0,
50  const QGLWidget * shareWidget = 0, Qt::WindowFlags f=0 );
51  virtual ~QAGLWidget();
52 
53  virtual QSize sizeHint() const;
54  virtual QSize minimumSizeHint() const;
55  virtual std::string name() const;
56 
57  int width()
58  {
59  return carto::GLWidget::width();
60  }
61  void setBackgroundAlpha( float a );
62 
63  int height()
64  {
65  return carto::GLWidget::height();
66  }
67 
68 public slots:
70  virtual void updateGL();
71 
72 protected:
73 #if QT_VERSION >= 0x040600
74  virtual bool event( QEvent * );
75 #endif
76  virtual void initializeGL();
77  virtual void resizeGL( int w, int h );
78  virtual void paintGL();
79  virtual void mousePressEvent( QMouseEvent* me );
80  virtual void mouseReleaseEvent( QMouseEvent* me );
81  virtual void mouseMoveEvent( QMouseEvent* me );
82  virtual void mouseDoubleClickEvent( QMouseEvent * );
83  virtual void keyPressEvent( QKeyEvent* ev );
84  virtual void keyReleaseEvent( QKeyEvent* ev );
85  virtual void focusInEvent( QFocusEvent * );
86  virtual void focusOutEvent( QFocusEvent * );
87  virtual void wheelEvent( QWheelEvent * );
88 };
89 
90 
91 #endif
virtual void updateGL()
to be reimplemented in "public slots"
virtual std::string name() const
QAGLWidget(anatomist::AWindow *win, QWidget *parent=0, const char *name=0, const QGLWidget *shareWidget=0, Qt::WindowFlags f=0)
virtual void resizeGL(int w, int h)
virtual QSize minimumSizeHint() const
virtual void keyReleaseEvent(QKeyEvent *ev)
Base class for OpenGL-rendering widget.
virtual void mousePressEvent(QMouseEvent *me)
virtual QSize sizeHint() const
virtual void mouseMoveEvent(QMouseEvent *me)
Abstract base class Anatomist window.
Definition: Window.h:57
int width()
Definition: glwidget.h:57
#define slots
virtual void mouseDoubleClickEvent(QMouseEvent *)
int height()
Definition: glwidget.h:63
virtual void focusOutEvent(QFocusEvent *)
virtual void mouseReleaseEvent(QMouseEvent *me)
virtual ~QAGLWidget()
virtual void keyPressEvent(QKeyEvent *ev)
virtual void focusInEvent(QFocusEvent *)
virtual void initializeGL()
virtual void paintGL()
void setBackgroundAlpha(float a)
virtual void wheelEvent(QWheelEvent *)