graphwidget.h
1 /***************************************************************************
2  Copyright (C) 2002-2015 Kentaro Kitagawa
3  kitagawa@phys.s.u-tokyo.ac.jp
4 
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  You should have received a copy of the GNU Library General
11  Public License and a list of authors along with this program;
12  see the files COPYING and AUTHORS.
13 ***************************************************************************/
14 #ifndef GRAPHWIDGET_H
15 #define GRAPHWIDGET_H
16 
17 class XGraph;
18 class XQGraphPainter;
19 
20 #include "support.h"
21 #include "xnodeconnector.h"
22 #include <QOpenGLWidget>
23 
24 //! Graph widget with a dialog which is initially hidden.
25 //! \sa XGraph, XQGraphPainter
26 class DECLSPEC_KAME XQGraph : public QOpenGLWidget {
27  Q_OBJECT
28 public:
29  XQGraph( QWidget* parent = 0, Qt::WindowFlags fl = 0 );
30  virtual ~XQGraph();
31  //! register XGraph instance just after creating
32  void setGraph(const shared_ptr<XGraph> &);
33 
34 protected:
35  virtual void mousePressEvent ( QMouseEvent*) override;
36  virtual void mouseReleaseEvent ( QMouseEvent*) override;
37  virtual void mouseDoubleClickEvent ( QMouseEvent*) override;
38  virtual void mouseMoveEvent ( QMouseEvent*) override;
39  virtual void wheelEvent ( QWheelEvent *) override;
40  virtual void showEvent ( QShowEvent * ) override;
41  virtual void hideEvent ( QHideEvent * ) override;
42  virtual void paintGL() override;
43  //! openGL stuff
44  virtual void initializeGL() override;
45  virtual void resizeGL ( int width, int height ) override;
46 private:
47  friend class XQGraphPainter;
48  shared_ptr<XGraph> m_graph;
49  shared_ptr<XQGraphPainter> m_painter;
50  xqcon_ptr m_conDialog;
51 };
52 
53 class Ui_FrmGraph;
55 
56 #endif // GRAPHWIDGET_H

Generated for KAME4 by  doxygen 1.8.3