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