Mercurial > hg > svgui
comparison layer/TimeValueLayer.h @ 946:36cddc3de023 alignment_view
Merge from default branch
author | Chris Cannam |
---|---|
date | Mon, 20 Apr 2015 09:19:52 +0100 |
parents | 251dd0abc7b7 |
children | 94e4952a6774 |
comparison
equal
deleted
inserted
replaced
897:499b637f2a26 | 946:36cddc3de023 |
---|---|
41 | 41 |
42 virtual int getVerticalScaleWidth(View *v, bool, QPainter &) const; | 42 virtual int getVerticalScaleWidth(View *v, bool, QPainter &) const; |
43 virtual void paintVerticalScale(View *v, bool, QPainter &paint, QRect rect) const; | 43 virtual void paintVerticalScale(View *v, bool, QPainter &paint, QRect rect) const; |
44 | 44 |
45 virtual QString getFeatureDescription(View *v, QPoint &) const; | 45 virtual QString getFeatureDescription(View *v, QPoint &) const; |
46 virtual QString getLabelPreceding(int) const; | 46 virtual QString getLabelPreceding(sv_frame_t) const; |
47 | 47 |
48 virtual bool snapToFeatureFrame(View *v, int &frame, | 48 virtual bool snapToFeatureFrame(View *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, int &frame, | 51 virtual bool snapToSimilarFeature(View *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(View *v, QMouseEvent *); |
56 virtual void drawDrag(View *v, QMouseEvent *); | 56 virtual void drawDrag(View *v, QMouseEvent *); |
64 virtual void editDrag(View *v, QMouseEvent *); | 64 virtual void editDrag(View *v, QMouseEvent *); |
65 virtual void editEnd(View *v, QMouseEvent *); | 65 virtual void editEnd(View *v, QMouseEvent *); |
66 | 66 |
67 virtual bool editOpen(View *v, QMouseEvent *); | 67 virtual bool editOpen(View *v, QMouseEvent *); |
68 | 68 |
69 virtual void moveSelection(Selection s, int 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(View *v, Selection s, Clipboard &to); |
74 virtual bool paste(View *v, const Clipboard &from, int frameOffset, | 74 virtual bool paste(View *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 |
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 |
133 virtual bool getValueExtents(float &min, float &max, | 133 virtual bool getValueExtents(double &min, double &max, |
134 bool &logarithmic, QString &unit) const; | 134 bool &logarithmic, QString &unit) const; |
135 | 135 |
136 virtual bool getDisplayExtents(float &min, float &max) const; | 136 virtual bool getDisplayExtents(double &min, double &max) const; |
137 virtual bool setDisplayExtents(float min, float max); | 137 virtual bool setDisplayExtents(double min, double max); |
138 | 138 |
139 virtual int getVerticalZoomSteps(int &defaultStep) const; | 139 virtual int getVerticalZoomSteps(int &defaultStep) const; |
140 virtual int getCurrentVerticalZoomStep() const; | 140 virtual int getCurrentVerticalZoomStep() const; |
141 virtual void setVerticalZoomStep(int); | 141 virtual void setVerticalZoomStep(int); |
142 virtual RangeMapper *getNewVerticalZoomRangeMapper() const; | 142 virtual RangeMapper *getNewVerticalZoomRangeMapper() const; |
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 *, float value) const; | 158 virtual int getYForValue(View *, double value) const; |
159 virtual float getValueForY(View *, int y) const; | 159 virtual double getValueForY(View *, int y) const; |
160 virtual QString getScaleUnits() const; | 160 virtual QString getScaleUnits() const; |
161 virtual QColor getColourForValue(View *v, float value) const; | 161 virtual QColor getColourForValue(View *v, double value) const; |
162 | 162 |
163 protected: | 163 protected: |
164 void getScaleExtents(View *, float &min, float &max, bool &log) const; | 164 void getScaleExtents(View *, 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(View *v, int) const; |
168 | 168 |
169 virtual int getDefaultColourHint(bool dark, bool &impose); | 169 virtual int getDefaultColourHint(bool dark, bool &impose); |
177 PlotStyle m_plotStyle; | 177 PlotStyle m_plotStyle; |
178 VerticalScale m_verticalScale; | 178 VerticalScale m_verticalScale; |
179 bool m_drawSegmentDivisions; | 179 bool m_drawSegmentDivisions; |
180 bool m_derivative; | 180 bool m_derivative; |
181 | 181 |
182 mutable float m_scaleMinimum; | 182 mutable double m_scaleMinimum; |
183 mutable float m_scaleMaximum; | 183 mutable double m_scaleMaximum; |
184 | 184 |
185 void finish(SparseTimeValueModel::EditCommand *command) { | 185 void finish(SparseTimeValueModel::EditCommand *command) { |
186 Command *c = command->finish(); | 186 Command *c = command->finish(); |
187 if (c) CommandHistory::getInstance()->addCommand(c, false); | 187 if (c) CommandHistory::getInstance()->addCommand(c, false); |
188 } | 188 } |