16 #ifndef _REGION_LAYER_H_ 17 #define _REGION_LAYER_H_ 23 #include "data/model/RegionModel.h" 75 virtual void copy(
View *v, Selection s, Clipboard &to);
76 virtual bool paste(
View *v,
const Clipboard &from,
int frameOffset,
87 int *min,
int *max,
int *deflt)
const;
90 virtual void setProperty(
const PropertyName &,
int value);
120 bool &log, QString &unit)
const;
124 virtual void toXml(QTextStream &stream, QString indent =
"",
125 QString extraAttributes =
"")
const;
172 void finish(RegionModel::EditCommand *command) {
173 Command *c = command->finish();
void getScaleExtents(View *, float &min, float &max, bool &log) const
virtual bool editOpen(View *v, QMouseEvent *)
Open an editor on the item under the mouse (e.g.
virtual bool snapToFeatureFrame(View *v, int &frame, int &resolution, SnapType snap) const
Adjust the given frame to snap to the nearest feature, if possible.
float getValueForY(View *v, int y) const
VerticalScale getVerticalScale() const
void setPlotStyle(PlotStyle style)
void setProperties(const QXmlAttributes &attributes)
Set the particular properties of a layer (those specific to the subclass) from a set of XML attribute...
virtual void deleteSelection(Selection s)
virtual void drawStart(View *v, QMouseEvent *)
void addCommand(Command *command)
Add a command to the command history.
virtual const Model * getModel() const
virtual QString getFeatureDescription(View *v, QPoint &) const
virtual void editEnd(View *v, QMouseEvent *)
RegionModel::Point m_originalPoint
void setVerticalScale(VerticalScale scale)
RegionModel::EditCommand * m_editingCommand
virtual QString getScaleUnits() const
virtual int getPropertyRangeAndValue(const PropertyName &, int *min, int *max, int *deflt) const
virtual QString getPropertyValueLabel(const PropertyName &, int value) const
virtual void editStart(View *v, QMouseEvent *)
VerticalScale m_verticalScale
virtual bool isLayerScrollable(const View *v) const
This should return true if the layer can safely be scrolled automatically by a given view (simply cop...
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.
int spacingIndexToY(View *v, int i) const
virtual QString getPropertyGroupName(const PropertyName &) const
virtual int getCompletion(View *) const
Return the proportion of background work complete in drawing this view, as a percentage – in most cas...
void setModel(RegionModel *model)
int getFillColourMap() const
virtual void editDrag(View *v, QMouseEvent *)
virtual void drawDrag(View *v, QMouseEvent *)
virtual void setProperty(const PropertyName &, int value)
PlotStyle getPlotStyle() const
static CommandHistory * getInstance()
virtual PropertyType getPropertyType(const PropertyName &) const
virtual void moveSelection(Selection s, int newStartFrame)
int getYForValue(View *v, float value) const
VerticalScaleLayer and ColourScaleLayer methods.
float yToSpacingIndex(View *v, int y) const
SpacingMap m_distributionMap
virtual void eraseEnd(View *v, QMouseEvent *)
virtual PropertyList getProperties() const
virtual bool isLayerEditable() const
This should return true if the layer can be edited by the user.
bool getPointToDrag(View *v, int x, int y, RegionModel::Point &) const
virtual bool getDisplayExtents(float &min, float &max) const
Return the minimum and maximum values within the displayed range for the y axis, if only a subset of ...
virtual void resizeSelection(Selection s, Selection newSize)
RegionModel::PointList getLocalPoints(View *v, int x) const
View is the base class of widgets that display one or more overlaid views of data against a horizonta...
virtual bool snapToSimilarFeature(View *v, int &frame, int &resolution, SnapType snap) const
Adjust the given frame to snap to the next feature that has "effectively" the same value as the featu...
RegionModel::Point m_editingPoint
virtual QString getLabelPreceding(int) const
virtual bool paste(View *v, const Clipboard &from, int frameOffset, bool interactive)
Paste from the given clipboard onto the layer at the given frame offset.
virtual void drawEnd(View *v, QMouseEvent *)
virtual void eraseDrag(View *v, QMouseEvent *)
void finish(RegionModel::EditCommand *command)
QColor getColourForValue(View *v, float value) const
void setFillColourMap(int)
virtual void copy(View *v, Selection s, Clipboard &to)
virtual bool getValueExtents(float &min, float &max, bool &log, QString &unit) const
Return the minimum and maximum values for the y axis of the model in this layer, as well as whether t...
std::map< float, int > SpacingMap
virtual void eraseStart(View *v, QMouseEvent *)
virtual int getVerticalScaleWidth(View *v, bool, QPainter &) const
virtual void paint(View *v, QPainter &paint, QRect rect) const
Paint the given rectangle of this layer onto the given view using the given painter,...
virtual int getDefaultColourHint(bool dark, bool &impose)
virtual void paintVerticalScale(View *v, bool, QPainter &paint, QRect rect) const
virtual QString getPropertyLabel(const PropertyName &) const