refactored PathScene into SequenceBrowserWidget
[mussa.git] / qui / seqbrowser / SequenceBrowser.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/glseqbrowser.hpp"
13
14 class QMouseEvent;
15 class QRubberBand;
16
17 /*! \brief Render mussa sequences and paths 
18  */
19 class SequenceBrowser: public QGLWidget, public GlSeqBrowser
20 {
21   Q_OBJECT
22
23 public: 
24   SequenceBrowser(QWidget *parent=0);
25
26   QSize sizeHint() const;
27
28   void clear();
29   void push_sequence(const Sequence &s);
30   void push_sequence(GlSequence &);
31       
32 public slots:
33   void setClipPlane(int z);
34   //! set the center of the current viewport
35   void setViewportCenter(float x);
36   //! set our magnification level
37   void setZoom(int);
38
39 signals:
40   //! emited when someone adds to our list of tracks
41   void tracksChanged();
42   void viewportChanged();
43
44 private:
45   void initializeGL();
46   void resizeGL(int height, int width);
47   void paintGL();
48
49   //! \defgroup Selection
50   QRubberBand *rubberBand;
51   QPoint bandOrigin;
52   bool drawingBand;
53   void mousePressEvent(QMouseEvent *);
54   void mouseMoveEvent(QMouseEvent *);
55   void mouseReleaseEvent(QMouseEvent *);
56 };
57 #endif