comparison layer/Layer.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 98157ea8a3d2
children 232262e38051
comparison
equal deleted inserted replaced
1468:de41a11cabc2 1469:11a150e65ee1
18 18
19 #include "base/PropertyContainer.h" 19 #include "base/PropertyContainer.h"
20 #include "base/XmlExportable.h" 20 #include "base/XmlExportable.h"
21 #include "base/Selection.h" 21 #include "base/Selection.h"
22 22
23 #include "data/model/Model.h"
24
23 #include "widgets/CommandHistory.h" 25 #include "widgets/CommandHistory.h"
24 26
25 #include "system/System.h" 27 #include "system/System.h"
26 28
27 #include <QObject> 29 #include <QObject>
34 #include <set> 36 #include <set>
35 37
36 #include <iostream> 38 #include <iostream>
37 39
38 class ZoomConstraint; 40 class ZoomConstraint;
39 class Model;
40 class QPainter; 41 class QPainter;
41 class View; 42 class View;
42 class LayerGeometryProvider; 43 class LayerGeometryProvider;
43 class QMouseEvent; 44 class QMouseEvent;
44 class Clipboard; 45 class Clipboard;
57 58
58 public: 59 public:
59 Layer(); 60 Layer();
60 virtual ~Layer(); 61 virtual ~Layer();
61 62
62 virtual const Model *getModel() const = 0; 63 /**
63 Model *getModel() { 64 * Return the ID of the model represented in this layer.
64 return const_cast<Model *>(const_cast<const Layer *>(this)->getModel()); 65 */
65 } 66 virtual ModelId getModel() const = 0;
66 67
67 /** 68 /**
68 * Return a zoom constraint object defining the supported zoom 69 * Return a zoom constraint object defining the supported zoom
69 * levels for this layer. If this returns zero, the layer will 70 * levels for this layer. If this returns zero, the layer will
70 * support any integer zoom level. 71 * support any integer zoom level.
568 void layerNameChanged(); 569 void layerNameChanged();
569 570
570 void verticalZoomChanged(); 571 void verticalZoomChanged();
571 572
572 protected: 573 protected:
573 void connectSignals(const Model *); 574 void connectSignals(ModelId);
574 575
575 virtual sv_frame_t alignToReference(LayerGeometryProvider *v, sv_frame_t frame) const; 576 virtual sv_frame_t alignToReference(LayerGeometryProvider *v, sv_frame_t frame) const;
576 virtual sv_frame_t alignFromReference(LayerGeometryProvider *v, sv_frame_t frame) const; 577 virtual sv_frame_t alignFromReference(LayerGeometryProvider *v, sv_frame_t frame) const;
577 bool clipboardHasDifferentAlignment(LayerGeometryProvider *v, const Clipboard &clip) const; 578 bool clipboardHasDifferentAlignment(LayerGeometryProvider *v, const Clipboard &clip) const;
578 579