comparison view/Pane.h @ 267:4ed1446ad604

* more on measurement tool -- pull out some logic from pane to layer &c still more to do
author Chris Cannam
date Thu, 21 Jun 2007 16:12:00 +0000
parents aee39d8c0b83
children 21c7152ddba8
comparison
equal deleted inserted replaced
266:aee39d8c0b83 267:4ed1446ad604
86 virtual void mouseDoubleClickEvent(QMouseEvent *e); 86 virtual void mouseDoubleClickEvent(QMouseEvent *e);
87 virtual void leaveEvent(QEvent *e); 87 virtual void leaveEvent(QEvent *e);
88 virtual void wheelEvent(QWheelEvent *e); 88 virtual void wheelEvent(QWheelEvent *e);
89 virtual void resizeEvent(QResizeEvent *e); 89 virtual void resizeEvent(QResizeEvent *e);
90 90
91 // pull this out into another class at some point
92
93 struct MeasureRect {
94 QPoint start;
95 QPoint end;
96 long startFrame; // only valid for a layer that hasTimeXAxis
97 long endFrame; // ditto
98 };
99
100 typedef std::vector<MeasureRect> MeasureRectList; // should be x-ordered
101 typedef std::map<Layer *, MeasureRectList> MeasureRectMap;
102
103 void drawVerticalScale(QRect r, Layer *, QPainter &); 91 void drawVerticalScale(QRect r, Layer *, QPainter &);
104 void drawFeatureDescription(Layer *, QPainter &); 92 void drawFeatureDescription(Layer *, QPainter &);
105 void drawCentreLine(int, QPainter &); 93 void drawCentreLine(int, QPainter &);
106 void drawDurationAndRate(QRect, const Model *, int, QPainter &); 94 void drawDurationAndRate(QRect, const Model *, int, QPainter &);
107 void drawLayerNames(QRect, QPainter &); 95 void drawLayerNames(QRect, QPainter &);
108 void drawMeasurementRects(Layer *, QPainter &);
109 void drawMeasurementRect(Layer *, MeasureRect &, QPainter &);
110 void drawEditingSelection(QPainter &); 96 void drawEditingSelection(QPainter &);
111 97
112 virtual bool render(QPainter &paint, int x0, size_t f0, size_t f1); 98 virtual bool render(QPainter &paint, int x0, size_t f0, size_t f1);
113 99
114 Selection getSelectionAt(int x, bool &closeToLeft, bool &closeToRight) const; 100 Selection getSelectionAt(int x, bool &closeToLeft, bool &closeToRight) const;
139 QPoint m_mousePos; 125 QPoint m_mousePos;
140 bool m_clickedInRange; 126 bool m_clickedInRange;
141 bool m_shiftPressed; 127 bool m_shiftPressed;
142 bool m_ctrlPressed; 128 bool m_ctrlPressed;
143 129
144 MeasureRectMap m_measureRects;
145 MeasureRect m_draggingRect;
146 bool m_haveDraggingRect;
147
148 bool m_navigating; 130 bool m_navigating;
149 bool m_resizing; 131 bool m_resizing;
150 size_t m_dragCentreFrame; 132 size_t m_dragCentreFrame;
151 float m_dragStartMinValue; 133 float m_dragStartMinValue;
152 bool m_centreLineVisible; 134 bool m_centreLineVisible;
167 Panner *m_vpan; 149 Panner *m_vpan;
168 Thumbwheel *m_hthumb; 150 Thumbwheel *m_hthumb;
169 Thumbwheel *m_vthumb; 151 Thumbwheel *m_vthumb;
170 NotifyingPushButton *m_reset; 152 NotifyingPushButton *m_reset;
171 153
172 static QCursor m_measureCursor1; 154 static QCursor *m_measureCursor1;
173 static QCursor m_measureCursor2; 155 static QCursor *m_measureCursor2;
174 static bool m_measureCursorsCreated;
175 }; 156 };
176 157
177 #endif 158 #endif
178 159