diff view/Pane.h @ 266:aee39d8c0b83

* more on measurement tool
author Chris Cannam
date Thu, 21 Jun 2007 14:05:23 +0000
parents dae479593572
children 4ed1446ad604
line wrap: on
line diff
--- a/view/Pane.h	Fri Jun 15 15:48:11 2007 +0000
+++ b/view/Pane.h	Thu Jun 21 14:05:23 2007 +0000
@@ -88,12 +88,25 @@
     virtual void wheelEvent(QWheelEvent *e);
     virtual void resizeEvent(QResizeEvent *e);
 
+    // pull this out into another class at some point
+
+    struct MeasureRect {
+        QPoint start;
+        QPoint end;
+        long startFrame; // only valid for a layer that hasTimeXAxis
+        long endFrame;   // ditto
+    };
+
+    typedef std::vector<MeasureRect> MeasureRectList; // should be x-ordered
+    typedef std::map<Layer *, MeasureRectList> MeasureRectMap;
+
     void drawVerticalScale(QRect r, Layer *, QPainter &);
     void drawFeatureDescription(Layer *, QPainter &);
     void drawCentreLine(int, QPainter &);
     void drawDurationAndRate(QRect, const Model *, int, QPainter &);
     void drawLayerNames(QRect, QPainter &);
-    void drawMeasurementRect(Layer *, QPainter &);
+    void drawMeasurementRects(Layer *, QPainter &);
+    void drawMeasurementRect(Layer *, MeasureRect &, QPainter &);
     void drawEditingSelection(QPainter &);
 
     virtual bool render(QPainter &paint, int x0, size_t f0, size_t f1);
@@ -124,13 +137,14 @@
     QPoint m_identifyPoint;
     QPoint m_clickPos;
     QPoint m_mousePos;
-    QPoint m_measureStart;
-    QPoint m_measureEnd;
     bool m_clickedInRange;
     bool m_shiftPressed;
     bool m_ctrlPressed;
-    bool m_haveMeasureRect;
-    size_t m_measureCentreFrame;
+
+    MeasureRectMap m_measureRects;
+    MeasureRect m_draggingRect;
+    bool m_haveDraggingRect;
+
     bool m_navigating;
     bool m_resizing;
     size_t m_dragCentreFrame;