16 #ifndef _IMAGE_LAYER_H_ 17 #define _IMAGE_LAYER_H_ 20 #include "data/model/ImageModel.h" 61 virtual void copy(
View *v, Selection s, Clipboard &to);
62 virtual bool paste(
View *v,
const Clipboard &from,
int frameOffset,
74 int *min,
int *max,
int *deflt)
const;
77 virtual void setProperty(
const PropertyName &,
int value);
90 bool &logarithmic, QString &unit)
const;
92 virtual void toXml(QTextStream &stream, QString indent =
"",
93 QString extraAttributes =
"")
const;
101 virtual bool addImage(
int frame, QString url);
111 QImage
getImage(
View *v, QString name, QSize maxSize)
const;
114 int x,
int nx)
const;
137 void finish(ImageModel::EditCommand *command) {
138 Command *c = command->finish();
virtual void editDrag(View *v, QMouseEvent *)
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...
The base class for visual representations of the data found in a Model.
QImage getImage(View *v, QString name, QSize maxSize) const
void drawImage(View *v, QPainter &paint, const ImageModel::Point &p, int x, int nx) const
virtual bool getValueExtents(float &min, float &max, bool &logarithmic, 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< const View *, ImageMap > ViewImageMap
virtual void drawDrag(View *v, QMouseEvent *)
virtual void deleteSelection(Selection s)
virtual void resizeSelection(Selection s, Selection newSize)
FileSourceMap m_fileSources
virtual void setProperty(const PropertyName &, int value)
virtual void copy(View *v, Selection s, Clipboard &to)
void addCommand(Command *command)
Add a command to the command history.
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,...
ImageModel::Point m_editingPoint
virtual void editEnd(View *v, QMouseEvent *)
std::map< QString, QImage > ImageMap
!! how to reap no-longer-used images?
std::map< QString, FileSource * > FileSourceMap
virtual void drawEnd(View *v, QMouseEvent *)
virtual QString getPropertyLabel(const PropertyName &) const
virtual bool snapToFeatureFrame(View *v, int &frame, int &resolution, SnapType snap) const
!! too much overlap with TimeValueLayer/TimeInstantLayer/TextLayer
bool getImageOriginalSize(QString name, QSize &size) const
!! how to reap no-longer-used images?
virtual int getPropertyRangeAndValue(const PropertyName &, int *min, int *max, int *deflt) const
virtual void drawStart(View *v, QMouseEvent *)
ImageModel::Point m_originalPoint
virtual bool addImage(int frame, QString url)
ImageModel::EditCommand * m_editingCommand
void checkAddSource(QString img) 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.
static CommandHistory * getInstance()
virtual bool isLayerEditable() const
This should return true if the layer can be edited by the user.
virtual int getCompletion(View *) const
Return the proportion of background work complete in drawing this view, as a percentage – in most cas...
QString getLocalFilename(QString img) const
virtual const Model * getModel() const
void setProperties(const QXmlAttributes &attributes)
Set the particular properties of a layer (those specific to the subclass) from a set of XML attribute...
virtual QString getFeatureDescription(View *v, QPoint &) const
void setModel(ImageModel *model)
virtual int getVerticalScaleWidth(View *, bool, QPainter &) const
virtual PropertyList getProperties() const
View is the base class of widgets that display one or more overlaid views of data against a horizonta...
void finish(ImageModel::EditCommand *command)
virtual bool editOpen(View *, QMouseEvent *)
Open an editor on the item under the mouse (e.g.
virtual void moveSelection(Selection s, int newStartFrame)
virtual void editStart(View *v, QMouseEvent *)
static QMutex m_imageMapMutex
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 QString getPropertyValueLabel(const PropertyName &, int value) const
ImageModel::PointList getLocalPoints(View *v, int x, int y) const
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.
virtual PropertyType getPropertyType(const PropertyName &) const
virtual ColourSignificance getLayerColourSignificance() const
This should return the degree of meaning associated with colour in this layer.