comparison layer/TimeValueLayer.h @ 918:4fe7a09be0fe osx-retina

Many fixes for the previous stuff
author Chris Cannam
date Tue, 17 Mar 2015 16:56:03 +0000
parents 94e4952a6774
children 42217d9c5920
comparison
equal deleted inserted replaced
917:77a1d42353ce 918:4fe7a09be0fe
37 public: 37 public:
38 TimeValueLayer(); 38 TimeValueLayer();
39 39
40 virtual void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const; 40 virtual void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const;
41 41
42 virtual int getVerticalScaleWidth(View *v, bool, QPainter &) const; 42 virtual int getVerticalScaleWidth(LayerGeometryProvider *v, bool, QPainter &) const;
43 virtual void paintVerticalScale(View *v, bool, QPainter &paint, QRect rect) const; 43 virtual void paintVerticalScale(LayerGeometryProvider *v, bool, QPainter &paint, QRect rect) const;
44 44
45 virtual QString getFeatureDescription(View *v, QPoint &) const; 45 virtual QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const;
46 virtual QString getLabelPreceding(sv_frame_t) const; 46 virtual QString getLabelPreceding(sv_frame_t) const;
47 47
48 virtual bool snapToFeatureFrame(View *v, sv_frame_t &frame, 48 virtual bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame,
49 int &resolution, 49 int &resolution,
50 SnapType snap) const; 50 SnapType snap) const;
51 virtual bool snapToSimilarFeature(View *v, sv_frame_t &frame, 51 virtual bool snapToSimilarFeature(LayerGeometryProvider *v, sv_frame_t &frame,
52 int &resolution, 52 int &resolution,
53 SnapType snap) const; 53 SnapType snap) const;
54 54
55 virtual void drawStart(View *v, QMouseEvent *); 55 virtual void drawStart(LayerGeometryProvider *v, QMouseEvent *);
56 virtual void drawDrag(View *v, QMouseEvent *); 56 virtual void drawDrag(LayerGeometryProvider *v, QMouseEvent *);
57 virtual void drawEnd(View *v, QMouseEvent *); 57 virtual void drawEnd(LayerGeometryProvider *v, QMouseEvent *);
58 58
59 virtual void eraseStart(View *v, QMouseEvent *); 59 virtual void eraseStart(LayerGeometryProvider *v, QMouseEvent *);
60 virtual void eraseDrag(View *v, QMouseEvent *); 60 virtual void eraseDrag(LayerGeometryProvider *v, QMouseEvent *);
61 virtual void eraseEnd(View *v, QMouseEvent *); 61 virtual void eraseEnd(LayerGeometryProvider *v, QMouseEvent *);
62 62
63 virtual void editStart(View *v, QMouseEvent *); 63 virtual void editStart(LayerGeometryProvider *v, QMouseEvent *);
64 virtual void editDrag(View *v, QMouseEvent *); 64 virtual void editDrag(LayerGeometryProvider *v, QMouseEvent *);
65 virtual void editEnd(View *v, QMouseEvent *); 65 virtual void editEnd(LayerGeometryProvider *v, QMouseEvent *);
66 66
67 virtual bool editOpen(View *v, QMouseEvent *); 67 virtual bool editOpen(LayerGeometryProvider *v, QMouseEvent *);
68 68
69 virtual void moveSelection(Selection s, sv_frame_t newStartFrame); 69 virtual void moveSelection(Selection s, sv_frame_t newStartFrame);
70 virtual void resizeSelection(Selection s, Selection newSize); 70 virtual void resizeSelection(Selection s, Selection newSize);
71 virtual void deleteSelection(Selection s); 71 virtual void deleteSelection(Selection s);
72 72
73 virtual void copy(View *v, Selection s, Clipboard &to); 73 virtual void copy(LayerGeometryProvider *v, Selection s, Clipboard &to);
74 virtual bool paste(View *v, const Clipboard &from, sv_frame_t frameOffset, 74 virtual bool paste(LayerGeometryProvider *v, const Clipboard &from, sv_frame_t frameOffset,
75 bool interactive); 75 bool interactive);
76 76
77 virtual const Model *getModel() const { return m_model; } 77 virtual const Model *getModel() const { return m_model; }
78 void setModel(SparseTimeValueModel *model); 78 void setModel(SparseTimeValueModel *model);
79 79
118 bool getDrawSegmentDivisions() const { return m_drawSegmentDivisions; } 118 bool getDrawSegmentDivisions() const { return m_drawSegmentDivisions; }
119 119
120 void setShowDerivative(bool); 120 void setShowDerivative(bool);
121 bool getShowDerivative() const { return m_derivative; } 121 bool getShowDerivative() const { return m_derivative; }
122 122
123 virtual bool isLayerScrollable(const View *v) const; 123 virtual bool isLayerScrollable(const LayerGeometryProvider *v) const;
124 124
125 virtual bool isLayerEditable() const { return true; } 125 virtual bool isLayerEditable() const { return true; }
126 126
127 virtual int getCompletion(View *) const { return m_model->getCompletion(); } 127 virtual int getCompletion(LayerGeometryProvider *) const { return m_model->getCompletion(); }
128 128
129 virtual bool needsTextLabelHeight() const { 129 virtual bool needsTextLabelHeight() const {
130 return m_plotStyle == PlotSegmentation && m_model->hasTextLabels(); 130 return m_plotStyle == PlotSegmentation && m_model->hasTextLabels();
131 } 131 }
132 132
153 return ColourDistinguishes; 153 return ColourDistinguishes;
154 } 154 }
155 } 155 }
156 156
157 /// VerticalScaleLayer and ColourScaleLayer methods 157 /// VerticalScaleLayer and ColourScaleLayer methods
158 virtual int getYForValue(View *, double value) const; 158 virtual int getYForValue(LayerGeometryProvider *, double value) const;
159 virtual double getValueForY(View *, int y) const; 159 virtual double getValueForY(LayerGeometryProvider *, int y) const;
160 virtual QString getScaleUnits() const; 160 virtual QString getScaleUnits() const;
161 virtual QColor getColourForValue(View *v, double value) const; 161 virtual QColor getColourForValue(LayerGeometryProvider *v, double value) const;
162 162
163 protected: 163 protected:
164 void getScaleExtents(View *, double &min, double &max, bool &log) const; 164 void getScaleExtents(LayerGeometryProvider *, double &min, double &max, bool &log) const;
165 bool shouldAutoAlign() const; 165 bool shouldAutoAlign() const;
166 166
167 SparseTimeValueModel::PointList getLocalPoints(View *v, int) const; 167 SparseTimeValueModel::PointList getLocalPoints(LayerGeometryProvider *v, int) const;
168 168
169 virtual int getDefaultColourHint(bool dark, bool &impose); 169 virtual int getDefaultColourHint(bool dark, bool &impose);
170 170
171 SparseTimeValueModel *m_model; 171 SparseTimeValueModel *m_model;
172 bool m_editing; 172 bool m_editing;