Mercurial > hg > svgui
comparison layer/Layer.h @ 947:e53a87a5efb2
Allow layers to be loaded without models if their layer class explicitly says it's OK (otherwise default template won't load, as it has an empty waveform layer)
author | Chris Cannam |
---|---|
date | Mon, 20 Apr 2015 10:10:26 +0100 |
parents | 251dd0abc7b7 |
children | e3c7da3d896e |
comparison
equal
deleted
inserted
replaced
944:78c152e4db95 | 947:e53a87a5efb2 |
---|---|
60 | 60 |
61 virtual const Model *getModel() const = 0; | 61 virtual const Model *getModel() const = 0; |
62 Model *getModel() { | 62 Model *getModel() { |
63 return const_cast<Model *>(const_cast<const Layer *>(this)->getModel()); | 63 return const_cast<Model *>(const_cast<const Layer *>(this)->getModel()); |
64 } | 64 } |
65 | 65 |
66 /** | 66 /** |
67 * Return a zoom constraint object defining the supported zoom | 67 * Return a zoom constraint object defining the supported zoom |
68 * levels for this layer. If this returns zero, the layer will | 68 * levels for this layer. If this returns zero, the layer will |
69 * support any integer zoom level. | 69 * support any integer zoom level. |
70 */ | 70 */ |
516 * returned value is allocated on the heap and will be deleted by | 516 * returned value is allocated on the heap and will be deleted by |
517 * the caller. | 517 * the caller. |
518 */ | 518 */ |
519 virtual RangeMapper *getNewVerticalZoomRangeMapper() const { return 0; } | 519 virtual RangeMapper *getNewVerticalZoomRangeMapper() const { return 0; } |
520 | 520 |
521 /** | |
522 * Return true if this layer type can function without a model | |
523 * being set. If false (the default), the layer will not be loaded | |
524 * from a session if its model cannot be found. | |
525 */ | |
526 virtual bool canExistWithoutModel() const { return false; } | |
527 | |
521 public slots: | 528 public slots: |
522 void showLayer(View *, bool show); | 529 void showLayer(View *, bool show); |
523 | 530 |
524 signals: | 531 signals: |
525 void modelChanged(); | 532 void modelChanged(); |