7433907df35a909db215c331ca9cee6a25b907f5
[mussa.git] / qui / PathScene.hpp
1 #ifndef _PATHSCENE_H_
2 #define _PATHSCENE_H_
3
4 #include <QGLWidget>
5 #include <QRectF>
6 #include <QPoint>
7 #include <vector>
8 #include <GL/gl.h>
9
10 #include "alg/mussa.hpp"
11 #include "alg/glsequence.hpp"
12 #include "alg/gltracks.hpp"
13
14 class QMouseEvent;
15 class QRubberBand;
16
17 /*! \brief Render mussa sequences and paths 
18  */
19 class PathScene: public QGLWidget, public GlTracks
20 {
21   Q_OBJECT
22
23 public: 
24   PathScene(QWidget *parent=0);
25
26   QSize sizeHint() const;
27     
28 public slots:
29   void setClipPlane(int z);
30   //! set the center of the current viewport
31   void setViewportCenter(float x);
32   //! set our magnification level
33   void setZoom(int);
34
35 signals:
36   //! emitted when our analysis has changed
37   void analysisUpdated();
38   void viewportChanged();
39
40 private:
41   void initializeGL();
42   void resizeGL(int height, int width);
43   void paintGL();
44
45   //! \defgroup Selection
46   QRubberBand *rubberBand;
47   QPoint bandOrigin;
48   bool drawingBand;
49   void mousePressEvent(QMouseEvent *);
50   void mouseMoveEvent(QMouseEvent *);
51   void mouseReleaseEvent(QMouseEvent *);
52 };
53 #endif