GNU Octave  4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GLCanvas.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2011-2015 Michael Goffioul
4 
5 This file is part of Octave.
6 
7 Octave is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <http://www.gnu.org/licenses/>.
20 
21 */
22 
23 #ifndef __QtHandles_GLCanvas__
24 #define __QtHandles_GLCanvas__ 1
25 
26 #include <QGLWidget>
27 
28 #include "Canvas.h"
29 
30 namespace QtHandles
31 {
32 
33 class GLCanvas : public QGLWidget, public Canvas
34 {
35 public:
36  GLCanvas (QWidget* parent, const graphics_handle& handle);
37  ~GLCanvas (void);
38 
39  void draw (const graphics_handle& handle);
40  void toggleAxes (const graphics_handle& handle);
41  void toggleGrid (const graphics_handle& handle);
42  void autoAxes (const graphics_handle& handle);
43  void drawZoomBox (const QPoint& p1, const QPoint& p2);
44  void resize (int /* x */, int /* y */,
45  int /* width */, int /* height */) { }
47  const QPoint& pt);
48  QWidget* qWidget (void) { return this; }
49 
50 protected:
51  void paintGL (void);
52  void mouseDoubleClickEvent (QMouseEvent* event);
53  void mouseMoveEvent (QMouseEvent* event);
54  void mousePressEvent (QMouseEvent* event);
55  void mouseReleaseEvent (QMouseEvent* event);
56  void wheelEvent (QWheelEvent* event);
57  void keyPressEvent (QKeyEvent* event);
58  void keyReleaseEvent (QKeyEvent* event);
59 };
60 
61 }; // namespace QtHandles
62 
63 #endif
void autoAxes(const graphics_handle &handle)
Definition: GLCanvas.cc:83
void mouseDoubleClickEvent(QMouseEvent *event)
Definition: GLCanvas.cc:151
graphics_object selectFromAxes(const graphics_object &ax, const QPoint &pt)
Definition: GLCanvas.cc:89
GLCanvas(QWidget *parent, const graphics_handle &handle)
Definition: GLCanvas.cc:40
void wheelEvent(QWheelEvent *event)
Definition: GLCanvas.cc:175
void mouseMoveEvent(QMouseEvent *event)
Definition: GLCanvas.cc:157
void draw(const graphics_handle &handle)
Definition: GLCanvas.cc:56
void keyReleaseEvent(QKeyEvent *event)
Definition: GLCanvas.cc:188
void toggleAxes(const graphics_handle &handle)
Definition: GLCanvas.cc:71
QWidget * qWidget(void)
Definition: GLCanvas.h:48
void paintGL(void)
Definition: GLCanvas.cc:145
void toggleGrid(const graphics_handle &handle)
Definition: GLCanvas.cc:77
void mousePressEvent(QMouseEvent *event)
Definition: GLCanvas.cc:163
void drawZoomBox(const QPoint &p1, const QPoint &p2)
Definition: GLCanvas.cc:115
void resize(int, int, int, int)
Definition: GLCanvas.h:44
void mouseReleaseEvent(QMouseEvent *event)
Definition: GLCanvas.cc:169
void keyPressEvent(QKeyEvent *event)
Definition: GLCanvas.cc:181