19 #include "base/PropertyContainer.h" 20 #include "base/XmlExportable.h" 21 #include "base/Selection.h" 25 #include "system/System.h" 29 #include <QXmlAttributes> 52 class Layer :
public PropertyContainer,
61 virtual const Model *
getModel()
const = 0;
63 return const_cast<Model *>(const_cast<const Layer *>(
this)->
getModel());
91 virtual void paint(
View *, QPainter &, QRect)
const = 0;
123 else return objectName();
132 QPainter &)
const = 0;
135 QPainter &, QRect)
const { }
138 std::vector<QRect> &)
const {
144 bool showFocus, QPoint focusPoint)
const;
261 virtual void copy(
View *, Selection, Clipboard & ) { }
273 bool ) {
return false; }
365 virtual void toXml(QTextStream &stream, QString indent =
"",
366 QString extraAttributes =
"")
const;
383 QString extraAttributes =
"")
const;
427 bool &logarithmic, QString &unit)
const = 0;
461 float &value, QString &unit)
const;
468 float &, QString &)
const {
479 float &diff, QString &unit)
const;
555 void toXml(QTextStream &stream, QString indent)
const;
564 virtual QString
getName()
const;
579 virtual QString
getName()
const;
MeasureRectSet m_measureRects
void toXml(QTextStream &stream, QString indent) const
virtual void setSynchronousPainting(bool)
Enable or disable synchronous painting.
void modelChangedWithin(int startFrame, int endFrame)
QPoint m_currentMeasureRectPoint
void deleteMeasureRectFromSet(const MeasureRect &r)
The base class for visual representations of the data found in a Model.
bool m_haveCurrentMeasureRect
virtual void paintVerticalScale(View *, bool, QPainter &, QRect) const
virtual QString getLabelPreceding(int) const
virtual void addMeasurementRect(const QXmlAttributes &)
Add a measurement rectangle from the given XML attributes (presumably taken from a measurement elemen...
virtual bool isLayerScrollable(const View *) const
This should return true if the layer can safely be scrolled automatically by a given view (simply cop...
virtual bool hasTimeXAxis() const
virtual void setProperties(const QXmlAttributes &)=0
Set the particular properties of a layer (those specific to the subclass) from a set of XML attribute...
virtual void drawStart(View *, QMouseEvent *)
MeasureRect m_draggingRect
virtual QString getPropertyContainerName() const
AddMeasurementRectCommand(Layer *layer, MeasureRect rect)
virtual bool snapToFeatureFrame(View *, int &, int &resolution, SnapType) const
Adjust the given frame to snap to the nearest feature, if possible.
virtual void eraseDrag(View *, QMouseEvent *)
virtual void splitEnd(View *, QMouseEvent *)
void connectSignals(const Model *)
virtual int getCurrentVerticalZoomStep() const
Get the current vertical zoom step.
virtual QPixmap getLayerPresentationPixmap(QSize) const
void showLayer(View *, bool show)
virtual void toXml(QTextStream &stream, QString indent="", QString extraAttributes="") const
Convert the layer's data (though not those of the model it refers to) into XML for file output.
void updateMeasurePixrects(View *v) const
virtual bool snapToSimilarFeature(View *, int &, int &resolution, SnapType) const
Adjust the given frame to snap to the next feature that has "effectively" the same value as the featu...
virtual void measureDoubleClick(View *, QMouseEvent *)
DeleteMeasurementRectCommand(Layer *layer, MeasureRect rect)
virtual QString getName() const
void layerMeasurementRectsChanged()
virtual bool nearestMeasurementRectChanged(View *, QPoint prev, QPoint now) const
virtual void measureDrag(View *, QMouseEvent *)
virtual void toBriefXml(QTextStream &stream, QString indent="", QString extraAttributes="") const
Produce XML containing the layer's ID and type.
void paintMeasurementRect(View *v, QPainter &paint, const MeasureRect &r, bool focus) const
virtual bool getCrosshairExtents(View *, QPainter &, QPoint, std::vector< QRect > &) const
virtual bool getYScaleValue(const View *, int, float &, QString &) const
Return the value and unit at the given y coordinate in the given view.
virtual ColourSignificance getLayerColourSignificance() const =0
This should return the degree of meaning associated with colour in this layer.
virtual void drawEnd(View *, QMouseEvent *)
virtual void updateMeasureRectYCoords(View *v, const MeasureRect &r) const
virtual VerticalPosition getPreferredFrameCountPosition() const
virtual void setLayerDormant(const View *v, bool dormant)
Indicate that a layer is not currently visible in the given view and is not expected to become visibl...
virtual void eraseStart(View *, QMouseEvent *)
virtual void splitStart(View *, QMouseEvent *)
void layerParameterRangesChanged()
virtual void setObjectName(const QString &name)
virtual bool isLayerEditable() const
This should return true if the layer can be edited by the user.
virtual void addNote(View *, QMouseEvent *)
bool operator<(const MeasureRect &mr) const
virtual QString getName() const
virtual void setMeasureRectFromPixrect(View *v, MeasureRect &r, QRect pixrect) const
virtual void moveSelection(Selection, int)
virtual void deleteCurrentMeasureRect()
virtual bool getDisplayExtents(float &, float &) const
Return the minimum and maximum values within the displayed range for the y axis, if only a subset of ...
virtual void paintMeasurementRects(View *, QPainter &, bool showFocus, QPoint focusPoint) const
virtual void setVerticalZoomStep(int)
Set the vertical zoom step.
virtual void setMeasureRectYCoord(View *v, MeasureRect &r, bool start, int y) const
void layerParametersChanged()
void verticalZoomChanged()
virtual bool setDisplayExtents(float, float)
Set the displayed minimum and maximum values for the y axis to the given range, if supported.
virtual void deleteSelection(Selection)
virtual bool haveCurrentMeasureRect() const
virtual bool paste(View *, const Clipboard &, int, bool)
Paste from the given clipboard onto the layer at the given frame offset.
std::map< const void *, bool > m_dormancy
virtual int getCompletion(View *) const
Return the proportion of background work complete in drawing this view, as a percentage – in most cas...
bool clipboardHasDifferentAlignment(View *v, const Clipboard &clip) const
virtual QString getPropertyContainerIconName() const
virtual bool hasLightBackground() const
virtual void eraseEnd(View *, QMouseEvent *)
virtual RangeMapper * getNewVerticalZoomRangeMapper() const
Create and return a range mapper for vertical zoom step values.
virtual bool isLayerOpaque() const
This should return true if the layer completely obscures any underlying layers.
virtual bool supportsOtherZoomLevels() const
Return true if this layer can handle zoom levels other than those supported by its zoom constraint (p...
virtual void measureEnd(View *, QMouseEvent *)
virtual int getVerticalZoomSteps(int &) const
Get the number of vertical zoom steps available for this layer.
virtual void editDrag(View *, QMouseEvent *)
virtual bool getYScaleDifference(const View *v, int y0, int y1, float &diff, QString &unit) const
Return the difference between the values at the given y coordinates in the given view,...
std::set< MeasureRect > MeasureRectSet
void modelAlignmentCompletionChanged()
virtual int alignFromReference(View *v, int frame) const
virtual int alignToReference(View *v, int frame) const
virtual bool getValueExtents(float &min, float &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 QString getError(View *) const
Return an error string if any errors have occurred while loading or processing data for the given vie...
virtual const Model * getModel() const =0
View is the base class of widgets that display one or more overlaid views of data against a horizonta...
virtual void editStart(View *, QMouseEvent *)
virtual void copy(View *, Selection, Clipboard &)
virtual QString getFeatureDescription(View *, QPoint &) const
virtual bool getXScaleValue(const View *v, int x, float &value, QString &unit) const
Return the value and unit at the given x coordinate in the given view.
virtual void setPresentationName(QString name)
void modelCompletionChanged()
QString m_presentationName
virtual void paint(View *, QPainter &, QRect) const =0
Paint the given rectangle of this layer onto the given view using the given painter,...
virtual void measureStart(View *, QMouseEvent *)
void addMeasureRectToSet(const MeasureRect &r)
virtual void resizeSelection(Selection, Selection)
virtual void drawDrag(View *, QMouseEvent *)
virtual void editEnd(View *, QMouseEvent *)
virtual void paintCrosshairs(View *, QPainter &, QPoint) const
virtual int getVerticalScaleWidth(View *, bool detailed, QPainter &) const =0
MeasureRectSet::const_iterator findFocusedMeasureRect(QPoint) const
virtual QString getLayerPresentationName() const
virtual bool editOpen(View *, QMouseEvent *)
Open an editor on the item under the mouse (e.g.
virtual VerticalPosition getPreferredTimeRulerPosition() const
virtual PlayParameters * getPlayParameters()
virtual bool isLayerDormant(const View *v) const
Return whether the layer is dormant (i.e.
virtual bool needsTextLabelHeight() const
virtual const ZoomConstraint * getZoomConstraint() const
Return a zoom constraint object defining the supported zoom levels for this layer.