diff layer/ImageLayer.h @ 1469:11a150e65ee1 by-id

Some work on updating layers for ModelId bits
author Chris Cannam
date Thu, 27 Jun 2019 13:16:25 +0100
parents 09d008b5c8f4
children 696e569ff21b
line wrap: on
line diff
--- a/layer/ImageLayer.h	Thu Jun 13 15:35:01 2019 +0100
+++ b/layer/ImageLayer.h	Thu Jun 27 13:16:25 2019 +0100
@@ -43,8 +43,8 @@
     QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const override;
 
     bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame,
-                                    int &resolution,
-                                    SnapType snap) const override;
+                            int &resolution,
+                            SnapType snap) const override;
 
     void drawStart(LayerGeometryProvider *v, QMouseEvent *) override;
     void drawDrag(LayerGeometryProvider *v, QMouseEvent *) override;
@@ -64,16 +64,16 @@
 
     bool editOpen(LayerGeometryProvider *, QMouseEvent *) override; // on double-click
 
-    const Model *getModel() const override { return m_model; }
-    void setModel(ImageModel *model);
+    ModelId getModel() const override { return m_model; }
+    void setModel(ModelId model); // an ImageModel please
 
     PropertyList getProperties() const override;
     QString getPropertyLabel(const PropertyName &) const override;
     PropertyType getPropertyType(const PropertyName &) const override;
     int getPropertyRangeAndValue(const PropertyName &,
-                                         int *min, int *max, int *deflt) const override;
+                                 int *min, int *max, int *deflt) const override;
     QString getPropertyValueLabel(const PropertyName &,
-                                          int value) const override;
+                                  int value) const override;
     void setProperty(const PropertyName &, int value) override;
 
     ColourSignificance getLayerColourSignificance() const override {
@@ -84,13 +84,13 @@
 
     bool isLayerEditable() const override { return true; }
 
-    int getCompletion(LayerGeometryProvider *) const override { return m_model->getCompletion(); }
+    int getCompletion(LayerGeometryProvider *) const override;
 
     bool getValueExtents(double &min, double &max,
-                                 bool &logarithmic, QString &unit) const override;
+                         bool &logarithmic, QString &unit) const override;
 
     void toXml(QTextStream &stream, QString indent = "",
-                       QString extraAttributes = "") const override;
+               QString extraAttributes = "") const override;
 
     int getVerticalScaleWidth(LayerGeometryProvider *, bool, QPainter &) const override { return 0; }
 
@@ -127,14 +127,14 @@
     QString getLocalFilename(QString img) const;
     void checkAddSource(QString img) const;
 
-    ImageModel *m_model;
+    ModelId m_model; // an ImageModel
     bool m_editing;
     QPoint m_editOrigin;
     Event m_originalPoint;
     Event m_editingPoint;
-    ChangeEventsCommand *m_editingCommand;
+    ChangeEventsCommand<Model> *m_editingCommand;
 
-    void finish(ChangeEventsCommand *command) {
+    void finish(ChangeEventsCommand<Model> *command) {
         Command *c = command->finish();
         if (c) CommandHistory::getInstance()->addCommand(c, false);
     }