Layer.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2 
3 /*
4  Sonic Visualiser
5  An audio file viewer and annotation editor.
6  Centre for Digital Music, Queen Mary, University of London.
7  This file copyright 2006 Chris Cannam and QMUL.
8 
9  This program is free software; you can redistribute it and/or
10  modify it under the terms of the GNU General Public License as
11  published by the Free Software Foundation; either version 2 of the
12  License, or (at your option) any later version. See the file
13  COPYING included with this distribution for more information.
14 */
15 
16 #ifndef SV_LAYER_H
17 #define SV_LAYER_H
18 
19 #include "base/PropertyContainer.h"
20 #include "base/XmlExportable.h"
21 #include "base/Selection.h"
22 
23 #include "data/model/Model.h"
24 
25 #include "widgets/CommandHistory.h"
26 
27 #include "system/System.h"
28 
29 #include <QObject>
30 #include <QRect>
31 #include <QXmlAttributes>
32 #include <QMutex>
33 #include <QPixmap>
34 
35 #include <map>
36 #include <set>
37 
38 #include <iostream>
39 
40 class ZoomConstraint;
41 class QPainter;
42 class View;
44 class QMouseEvent;
45 class Clipboard;
46 class RangeMapper;
47 
54 class Layer : public PropertyContainer,
55  public XmlExportable
56 {
57  Q_OBJECT
58 
59 public:
60  Layer();
61  virtual ~Layer();
62 
66  virtual ModelId getModel() const = 0;
67 
73  ModelId getSourceModel() const;
74 
95  virtual ModelId getExportModel(LayerGeometryProvider *) const {
96  return getModel();
97  }
98 
104  virtual const ZoomConstraint *getZoomConstraint() const { return 0; }
105 
114  virtual bool supportsOtherZoomLevels() const { return true; }
115 
125  virtual void paint(LayerGeometryProvider *, QPainter &, QRect) const = 0;
126 
138  virtual void setSynchronousPainting(bool /* synchronous */) { }
139 
142  };
144  return PositionMiddle;
145  }
147  return PositionBottom;
148  }
149  virtual bool hasLightBackground() const {
150  return true;
151  }
152 
153  QString getPropertyContainerIconName() const override;
154 
155  QString getPropertyContainerName() const override {
156  if (m_presentationName != "") return m_presentationName;
157  else return objectName();
158  }
159 
160  virtual void setPresentationName(QString name);
161 
162  virtual bool isPresentationNameSet() const;
163 
164  virtual QString getLayerPresentationName() const;
165  virtual QPixmap getLayerPresentationPixmap(QSize) const { return QPixmap(); }
166 
167  virtual int getVerticalScaleWidth(LayerGeometryProvider *, bool detailed,
168  QPainter &) const = 0;
169 
170  virtual void paintVerticalScale(LayerGeometryProvider *, bool /* detailed */,
171  QPainter &, QRect) const { }
172 
173  virtual int getHorizontalScaleHeight(LayerGeometryProvider *, QPainter &) const { return 0; }
174 
175  virtual bool getCrosshairExtents(LayerGeometryProvider *, QPainter &, QPoint /* cursorPos */,
176  std::vector<QRect> &) const {
177  return false;
178  }
179  virtual void paintCrosshairs(LayerGeometryProvider *, QPainter &, QPoint) const { }
180 
181  virtual void paintMeasurementRects(LayerGeometryProvider *, QPainter &,
182  bool showFocus, QPoint focusPoint) const;
183 
184  virtual bool nearestMeasurementRectChanged(LayerGeometryProvider *, QPoint prev,
185  QPoint now) const;
186 
187  virtual QString getFeatureDescription(LayerGeometryProvider *, QPoint &) const {
188  return "";
189  }
190 
191  virtual QString getLabelPreceding(sv_frame_t /* frame */) const {
192  return "";
193  }
194 
195  enum SnapType {
199  };
200 
227  sv_frame_t & /* frame */,
228  int &resolution,
229  SnapType /* snap */,
230  int /* ycoord */) const {
231  resolution = 1;
232  return false;
233  }
234 
252  sv_frame_t & /* source frame */,
253  int &resolution,
254  SnapType /* snap */) const {
255  resolution = 1;
256  return false;
257  }
258 
259  // Draw, erase, and edit modes:
260  //
261  // Layer needs to get actual mouse events, I guess. Draw mode is
262  // probably the easier.
263 
264  virtual void drawStart(LayerGeometryProvider *, QMouseEvent *) { }
265  virtual void drawDrag(LayerGeometryProvider *, QMouseEvent *) { }
266  virtual void drawEnd(LayerGeometryProvider *, QMouseEvent *) { }
267 
268  virtual void eraseStart(LayerGeometryProvider *, QMouseEvent *) { }
269  virtual void eraseDrag(LayerGeometryProvider *, QMouseEvent *) { }
270  virtual void eraseEnd(LayerGeometryProvider *, QMouseEvent *) { }
271 
272  virtual void editStart(LayerGeometryProvider *, QMouseEvent *) { }
273  virtual void editDrag(LayerGeometryProvider *, QMouseEvent *) { }
274  virtual void editEnd(LayerGeometryProvider *, QMouseEvent *) { }
275 
276  virtual void splitStart(LayerGeometryProvider *, QMouseEvent *) { }
277  virtual void splitEnd(LayerGeometryProvider *, QMouseEvent *) { }
278  virtual void addNote(LayerGeometryProvider *, QMouseEvent *) { };
279 
280  // Measurement rectangle (or equivalent). Unlike draw and edit,
281  // the base Layer class can provide working implementations of
282  // these for most situations.
283  //
284  virtual void measureStart(LayerGeometryProvider *, QMouseEvent *);
285  virtual void measureDrag(LayerGeometryProvider *, QMouseEvent *);
286  virtual void measureEnd(LayerGeometryProvider *, QMouseEvent *);
287  virtual void measureDoubleClick(LayerGeometryProvider *, QMouseEvent *);
288 
289  virtual bool haveCurrentMeasureRect() const {
291  }
292  virtual void deleteCurrentMeasureRect(); // using a command
293 
299  virtual bool editOpen(LayerGeometryProvider *, QMouseEvent *) { return false; }
300 
301  virtual void moveSelection(Selection, sv_frame_t /* newStartFrame */) { }
302  virtual void resizeSelection(Selection, Selection /* newSize */) { }
303  virtual void deleteSelection(Selection) { }
304 
305  virtual void copy(LayerGeometryProvider *, Selection, Clipboard & /* to */) { }
306 
314  virtual bool paste(LayerGeometryProvider *,
315  const Clipboard & /* from */,
316  sv_frame_t /* frameOffset */,
317  bool /* interactive */) { return false; }
318 
319  // Text mode:
320  //
321  // Label nearest feature. We need to get the feature coordinates
322  // and current label from the layer, and then the pane can pop up
323  // a little text entry dialog at the right location. Or we edit
324  // in place? Probably the dialog is easier.
325 
336  virtual bool isLayerScrollable(const LayerGeometryProvider *) const { return true; }
337 
346  virtual bool isLayerOpaque() const { return false; }
347 
354  };
355 
375 
382  virtual bool isLayerEditable() const { return false; }
383 
391  virtual int getCompletion(LayerGeometryProvider *) const { return 100; }
392 
398  virtual QString getError(LayerGeometryProvider *) const { return ""; }
399 
400  virtual void setObjectName(const QString &name);
401 
409  void toXml(QTextStream &stream, QString indent = "",
410  QString extraAttributes = "") const override;
411 
417  virtual void setProperties(const QXmlAttributes &) = 0;
418 
425  virtual void toBriefXml(QTextStream &stream,
426  QString indent = "",
427  QString extraAttributes = "") const;
428 
434  virtual void addMeasurementRect(const QXmlAttributes &);
435 
447  virtual void setLayerDormant(const LayerGeometryProvider *v, bool dormant);
448 
453  virtual bool isLayerDormant(const LayerGeometryProvider *v) const;
454 
460  std::shared_ptr<PlayParameters> getPlayParameters() override;
461 
468  virtual bool needsTextLabelHeight() const { return false; }
469 
475  virtual bool hasTimeXAxis() const { return true; }
476 
483  virtual void zoomToRegion(const LayerGeometryProvider *, QRect) {
484  return;
485  }
486 
497  virtual bool getValueExtents(double &min, double &max,
498  bool &logarithmic, QString &unit) const = 0;
499 
509  virtual bool getDisplayExtents(double & /* min */,
510  double & /* max */) const {
511  return false;
512  }
513 
521  virtual bool setDisplayExtents(double /* min */,
522  double /* max */) {
523  return false;
524  }
525 
532  virtual bool adoptExtents(double /* min */, double /* max */,
533  QString /* unit */) {
534  return false;
535  }
536 
543  virtual bool getXScaleValue(const LayerGeometryProvider *v, int x,
544  double &value, QString &unit) const;
545 
550  virtual bool getYScaleValue(const LayerGeometryProvider *, int /* y */,
551  double &/* value */, QString &/* unit */) const {
552  return false;
553  }
554 
561  virtual bool getYScaleDifference(const LayerGeometryProvider *v, int y0, int y1,
562  double &diff, QString &unit) const;
563 
578  virtual int getVerticalZoomSteps(int & /* defaultStep */) const { return 0; }
579 
586  virtual int getCurrentVerticalZoomStep() const { return 0; }
587 
594  virtual void setVerticalZoomStep(int) { }
595 
602  virtual RangeMapper *getNewVerticalZoomRangeMapper() const { return 0; }
603 
609  virtual bool canExistWithoutModel() const { return false; }
610 
611 public slots:
616  void showLayer(LayerGeometryProvider *, bool show);
617 
618 signals:
619  void modelChanged(ModelId);
620  void modelCompletionChanged(ModelId);
621  void modelAlignmentCompletionChanged(ModelId);
622  void modelChangedWithin(ModelId, sv_frame_t startFrame, sv_frame_t endFrame);
623  void modelReplaced();
624 
625  void layerParametersChanged();
628  void layerNameChanged();
629 
630  void verticalZoomChanged();
631 
632 protected:
633  void connectSignals(ModelId);
634 
635  virtual sv_frame_t alignToReference(LayerGeometryProvider *v, sv_frame_t frame) const;
636  virtual sv_frame_t alignFromReference(LayerGeometryProvider *v, sv_frame_t frame) const;
637  bool clipboardHasDifferentAlignment(LayerGeometryProvider *v, const Clipboard &clip) const;
638 
639  struct MeasureRect {
640 
641  mutable QRect pixrect;
643  sv_frame_t startFrame; // only valid if haveFrames
644  sv_frame_t endFrame; // ditto
645  double startY;
646  double endY;
647 
648  bool operator<(const MeasureRect &mr) const;
649  void toXml(QTextStream &stream, QString indent) const;
650  };
651 
652  class AddMeasurementRectCommand : public Command
653  {
654  public:
656  m_layer(layer), m_rect(rect) { }
657 
658  QString getName() const override;
659  void execute() override;
660  void unexecute() override;
661 
662  private:
665  };
666 
667  class DeleteMeasurementRectCommand : public Command
668  {
669  public:
671  m_layer(layer), m_rect(rect) { }
672 
673  QString getName() const override;
674  void execute() override;
675  void unexecute() override;
676 
677  private:
680  };
681 
683  m_measureRects.insert(r);
685  }
686 
688  m_measureRects.erase(r);
690  }
691 
692  typedef std::set<MeasureRect> MeasureRectSet;
693  MeasureRectSet m_measureRects;
698 
699  // Note that pixrects are only correct for a single view.
700  // So we should update them at the start of the paint procedure
701  // (painting is single threaded) and only use them after that.
703 
704  virtual void updateMeasureRectYCoords(LayerGeometryProvider *v, const MeasureRect &r) const;
705  virtual void setMeasureRectYCoord(LayerGeometryProvider *v, MeasureRect &r, bool start, int y) const;
706  virtual void setMeasureRectFromPixrect(LayerGeometryProvider *v, MeasureRect &r, QRect pixrect) const;
707 
708  // This assumes updateMeasurementPixrects has been called
709  MeasureRectSet::const_iterator findFocusedMeasureRect(QPoint) const;
710 
712  const MeasureRect &r, bool focus) const;
713 
715 
717 
718 private:
719  mutable QMutex m_dormancyMutex;
720  mutable std::map<const void *, bool> m_dormancy;
721 };
722 
723 #endif
724 
MeasureRectSet m_measureRects
Definition: Layer.h:693
virtual void setSynchronousPainting(bool)
Enable or disable synchronous painting.
Definition: Layer.h:138
QString getPropertyContainerName() const override
Definition: Layer.h:155
virtual bool isLayerDormant(const LayerGeometryProvider *v) const
Return whether the layer is dormant (i.e.
Definition: Layer.cpp:144
virtual void paintVerticalScale(LayerGeometryProvider *, bool, QPainter &, QRect) const
Definition: Layer.h:170
QPoint m_currentMeasureRectPoint
Definition: Layer.h:697
virtual bool snapToFeatureFrame(LayerGeometryProvider *, sv_frame_t &, int &resolution, SnapType, int) const
Adjust the given frame to snap to the nearest feature, if possible.
Definition: Layer.h:226
virtual bool isPresentationNameSet() const
Definition: Layer.cpp:93
void deleteMeasureRectFromSet(const MeasureRect &r)
Definition: Layer.h:687
The base class for visual representations of the data found in a Model.
Definition: Layer.h:54
void modelCompletionChanged(ModelId)
bool m_haveCurrentMeasureRect
Definition: Layer.h:696
virtual void addMeasurementRect(const QXmlAttributes &)
Add a measurement rectangle from the given XML attributes (presumably taken from a measurement elemen...
Definition: Layer.cpp:333
virtual bool getCrosshairExtents(LayerGeometryProvider *, QPainter &, QPoint, std::vector< QRect > &) const
Definition: Layer.h:175
Layer()
Definition: Layer.cpp:37
virtual void setProperties(const QXmlAttributes &)=0
Set the particular properties of a layer (those specific to the subclass) from a set of XML attribute...
MeasureRect m_draggingRect
Definition: Layer.h:694
virtual bool getXScaleValue(const LayerGeometryProvider *v, int x, double &value, QString &unit) const
Return the value and unit at the given x coordinate in the given view.
Definition: Layer.cpp:160
virtual void eraseDrag(LayerGeometryProvider *, QMouseEvent *)
Definition: Layer.h:269
AddMeasurementRectCommand(Layer *layer, MeasureRect rect)
Definition: Layer.h:655
virtual ModelId getExportModel(LayerGeometryProvider *) const
Return the ID of a model representing the contents of this layer in a form suitable for export to a t...
Definition: Layer.h:95
virtual VerticalPosition getPreferredFrameCountPosition() const
Definition: Layer.h:146
void toXml(QTextStream &stream, QString indent="", QString extraAttributes="") const override
Convert the layer&#39;s data (though not those of the model it refers to) into XML for file output...
Definition: Layer.cpp:653
virtual void drawDrag(LayerGeometryProvider *, QMouseEvent *)
Definition: Layer.h:265
virtual void eraseStart(LayerGeometryProvider *, QMouseEvent *)
Definition: Layer.h:268
void modelReplaced()
DeleteMeasurementRectCommand(Layer *layer, MeasureRect rect)
Definition: Layer.h:670
QMutex m_dormancyMutex
Definition: Layer.h:719
virtual QPixmap getLayerPresentationPixmap(QSize) const
Definition: Layer.h:165
virtual void updateMeasureRectYCoords(LayerGeometryProvider *v, const MeasureRect &r) const
Definition: Layer.cpp:546
virtual QString getFeatureDescription(LayerGeometryProvider *, QPoint &) const
Definition: Layer.h:187
virtual bool needsTextLabelHeight() const
True if this layer will need to place text labels when it is painted.
Definition: Layer.h:468
void layerMeasurementRectsChanged()
virtual bool haveCurrentMeasureRect() const
Definition: Layer.h:289
virtual void drawEnd(LayerGeometryProvider *, QMouseEvent *)
Definition: Layer.h:266
virtual VerticalPosition getPreferredTimeRulerPosition() const
Definition: Layer.h:143
virtual bool getValueExtents(double &min, double &max, bool &logarithmic, QString &unit) const =0
Return the minimum and maximum values for the y axis of the model in this layer, as well as whether t...
virtual void setLayerDormant(const LayerGeometryProvider *v, bool dormant)
Indicate that a layer is not currently visible in the given view and is not expected to become visibl...
Definition: Layer.cpp:136
ColourSignificance
Definition: Layer.h:348
ModelId getSourceModel() const
Return the ID of the source model for the model represented in this layer.
Definition: Layer.cpp:68
virtual void paint(LayerGeometryProvider *, QPainter &, QRect) const =0
Paint the given rectangle of this layer onto the given view using the given painter, superimposing it on top of any existing material in that view.
virtual RangeMapper * getNewVerticalZoomRangeMapper() const
Create and return a range mapper for vertical zoom step values.
Definition: Layer.h:602
void toXml(QTextStream &stream, QString indent) const
Definition: Layer.cpp:315
virtual ColourSignificance getLayerColourSignificance() const =0
This should return the degree of meaning associated with colour in this layer.
VerticalPosition
Definition: Layer.h:140
virtual void measureDoubleClick(LayerGeometryProvider *, QMouseEvent *)
Definition: Layer.cpp:444
bool operator<(const MeasureRect &mr) const
Definition: Layer.cpp:285
void layerParameterRangesChanged()
virtual void moveSelection(Selection, sv_frame_t)
Definition: Layer.h:301
virtual void measureDrag(LayerGeometryProvider *, QMouseEvent *)
Definition: Layer.cpp:414
virtual bool canExistWithoutModel() const
Return true if this layer type can function without a model being set.
Definition: Layer.h:609
virtual bool snapToSimilarFeature(LayerGeometryProvider *, sv_frame_t &, int &resolution, SnapType) const
Adjust the given frame to snap to the next feature that has "effectively" the same value as the featu...
Definition: Layer.h:251
virtual void setObjectName(const QString &name)
Definition: Layer.cpp:122
void modelChanged(ModelId)
Interface for classes that provide geometry information (such as size, start frame, and a large number of other properties) about the disposition of a layer.
virtual bool paste(LayerGeometryProvider *, const Clipboard &, sv_frame_t, bool)
Paste from the given clipboard onto the layer at the given frame offset.
Definition: Layer.h:314
virtual void zoomToRegion(const LayerGeometryProvider *, QRect)
Update the X and Y axis scales, where appropriate, to focus on the given rectangular region...
Definition: Layer.h:483
virtual void deleteCurrentMeasureRect()
Definition: Layer.cpp:450
virtual sv_frame_t alignFromReference(LayerGeometryProvider *v, sv_frame_t frame) const
Definition: Layer.cpp:198
std::shared_ptr< PlayParameters > getPlayParameters() override
Return the play parameters for this layer, if any.
Definition: Layer.cpp:129
virtual void setMeasureRectYCoord(LayerGeometryProvider *v, MeasureRect &r, bool start, int y) const
Definition: Layer.cpp:554
virtual int getHorizontalScaleHeight(LayerGeometryProvider *, QPainter &) const
Definition: Layer.h:173
virtual bool adoptExtents(double, double, QString)
Consider using the given value extents and units for this layer.
Definition: Layer.h:532
virtual void addNote(LayerGeometryProvider *, QMouseEvent *)
Definition: Layer.h:278
virtual void setVerticalZoomStep(int)
Set the vertical zoom step.
Definition: Layer.h:594
sv_frame_t endFrame
Definition: Layer.h:644
virtual QString getLayerPresentationName() const
Definition: Layer.cpp:99
virtual bool isLayerOpaque() const
This should return true if the layer completely obscures any underlying layers.
Definition: Layer.h:346
virtual bool getYScaleValue(const LayerGeometryProvider *, int, double &, QString &) const
Return the value and unit at the given y coordinate in the given view.
Definition: Layer.h:550
void layerParametersChanged()
void verticalZoomChanged()
bool clipboardHasDifferentAlignment(LayerGeometryProvider *v, const Clipboard &clip) const
Definition: Layer.cpp:209
virtual QString getLabelPreceding(sv_frame_t) const
Definition: Layer.h:191
SnapType
Definition: Layer.h:195
virtual void deleteSelection(Selection)
Definition: Layer.h:303
virtual sv_frame_t alignToReference(LayerGeometryProvider *v, sv_frame_t frame) const
Definition: Layer.cpp:187
virtual void measureEnd(LayerGeometryProvider *, QMouseEvent *)
Definition: Layer.cpp:430
std::map< const void *, bool > m_dormancy
Definition: Layer.h:720
virtual void toBriefXml(QTextStream &stream, QString indent="", QString extraAttributes="") const
Produce XML containing the layer&#39;s ID and type.
Definition: Layer.cpp:691
void connectSignals(ModelId)
Definition: Layer.cpp:49
virtual void editEnd(LayerGeometryProvider *, QMouseEvent *)
Definition: Layer.h:274
bool valueExtentsMatchMine(LayerGeometryProvider *v) const
Definition: Layer.cpp:628
virtual void paintCrosshairs(LayerGeometryProvider *, QPainter &, QPoint) const
Definition: Layer.h:179
MeasureRectSet::const_iterator findFocusedMeasureRect(QPoint) const
Definition: Layer.cpp:578
virtual bool supportsOtherZoomLevels() const
Return true if this layer can handle zoom levels other than those supported by its zoom constraint (p...
Definition: Layer.h:114
virtual void editDrag(LayerGeometryProvider *, QMouseEvent *)
Definition: Layer.h:273
virtual void splitEnd(LayerGeometryProvider *, QMouseEvent *)
Definition: Layer.h:277
virtual bool isLayerScrollable(const LayerGeometryProvider *) const
This should return true if the layer can safely be scrolled automatically by a given view (simply cop...
Definition: Layer.h:336
bool m_haveDraggingRect
Definition: Layer.h:695
std::set< MeasureRect > MeasureRectSet
Definition: Layer.h:692
virtual bool setDisplayExtents(double, double)
Set the displayed minimum and maximum values for the y axis to the given range, if supported...
Definition: Layer.h:521
void updateMeasurePixrects(LayerGeometryProvider *v) const
Definition: Layer.cpp:507
View is the base class of widgets that display one or more overlaid views of data against a horizonta...
Definition: View.h:55
virtual ~Layer()
Definition: Layer.cpp:43
virtual void editStart(LayerGeometryProvider *, QMouseEvent *)
Definition: Layer.h:272
virtual void splitStart(LayerGeometryProvider *, QMouseEvent *)
Definition: Layer.h:276
virtual int getCurrentVerticalZoomStep() const
Get the current vertical zoom step.
Definition: Layer.h:586
void showLayer(LayerGeometryProvider *, bool show)
Change the visibility status (dormancy) of the layer in the given view.
Definition: Layer.cpp:153
virtual bool isLayerEditable() const
This should return true if the layer can be edited by the user.
Definition: Layer.h:382
virtual void setPresentationName(QString name)
Definition: Layer.cpp:87
void modelAlignmentCompletionChanged(ModelId)
virtual void copy(LayerGeometryProvider *, Selection, Clipboard &)
Definition: Layer.h:305
virtual const ZoomConstraint * getZoomConstraint() const
Return a zoom constraint object defining the supported zoom levels for this layer.
Definition: Layer.h:104
double startY
Definition: Layer.h:645
virtual int getVerticalZoomSteps(int &) const
Get the number of vertical zoom steps available for this layer.
Definition: Layer.h:578
virtual bool hasTimeXAxis() const
Return true if the X axis on the layer is time proportional to audio frames, false otherwise...
Definition: Layer.h:475
virtual void setMeasureRectFromPixrect(LayerGeometryProvider *v, MeasureRect &r, QRect pixrect) const
Definition: Layer.cpp:565
virtual bool getDisplayExtents(double &, double &) const
Return the minimum and maximum values within the visible area for the y axis of this layer...
Definition: Layer.h:509
sv_frame_t startFrame
Definition: Layer.h:643
QString m_presentationName
Definition: Layer.h:716
virtual ModelId getModel() const =0
Return the ID of the model represented in this layer.
virtual void measureStart(LayerGeometryProvider *, QMouseEvent *)
Definition: Layer.cpp:390
virtual QString getError(LayerGeometryProvider *) const
Return an error string if any errors have occurred while loading or processing data for the given vie...
Definition: Layer.h:398
void addMeasureRectToSet(const MeasureRect &r)
Definition: Layer.h:682
void modelChangedWithin(ModelId, sv_frame_t startFrame, sv_frame_t endFrame)
virtual void resizeSelection(Selection, Selection)
Definition: Layer.h:302
QString getPropertyContainerIconName() const override
Definition: Layer.cpp:80
virtual int getVerticalScaleWidth(LayerGeometryProvider *, bool detailed, QPainter &) const =0
virtual bool hasLightBackground() const
Definition: Layer.h:149
virtual int getCompletion(LayerGeometryProvider *) const
Return the proportion of background work complete in drawing this view, as a percentage – in most ca...
Definition: Layer.h:391
virtual void paintMeasurementRects(LayerGeometryProvider *, QPainter &, bool showFocus, QPoint focusPoint) const
Definition: Layer.cpp:464
virtual bool getYScaleDifference(const LayerGeometryProvider *v, int y0, int y1, double &diff, QString &unit) const
Return the difference between the values at the given y coordinates in the given view, and the unit of the difference.
Definition: Layer.cpp:173
virtual bool nearestMeasurementRectChanged(LayerGeometryProvider *, QPoint prev, QPoint now) const
Definition: Layer.cpp:496
void layerNameChanged()
virtual bool editOpen(LayerGeometryProvider *, QMouseEvent *)
Open an editor on the item under the mouse (e.g.
Definition: Layer.h:299
void paintMeasurementRect(LayerGeometryProvider *v, QPainter &paint, const MeasureRect &r, bool focus) const
Definition: Layer.cpp:605
virtual void drawStart(LayerGeometryProvider *, QMouseEvent *)
Definition: Layer.h:264
virtual void eraseEnd(LayerGeometryProvider *, QMouseEvent *)
Definition: Layer.h:270