comparison layer/Layer.h @ 287:cd2492c5fe45

* Add SingleColourLayer to manage colours for layers that have a single predominant colour (i.e. most of them).
author Chris Cannam
date Thu, 12 Jul 2007 16:14:59 +0000
parents 86a112b5b319
children 5c59c433b358
comparison
equal deleted inserted replaced
286:7554ae119882 287:cd2492c5fe45
227 * therefore needs to be redrawn each time (so that the selection 227 * therefore needs to be redrawn each time (so that the selection
228 * rectangle can be cached). 228 * rectangle can be cached).
229 */ 229 */
230 virtual bool isLayerOpaque() const { return false; } 230 virtual bool isLayerOpaque() const { return false; }
231 231
232 /** 232 enum ColourSignificance {
233 * This should return true if the layer uses colours to indicate 233 ColourAbsent,
234 * meaningful information (as opposed to just using a single 234 ColourIrrelevant,
235 * colour of the user's choice). If this is the case, the view 235 ColourDistinguishes,
236 * will show selections using unfilled rectangles instead of 236 ColourAndBackgroundSignificant,
237 * translucent filled rectangles, so as not to disturb the colours 237 ColourHasMeaningfulValue
238 * underneath. 238 };
239 */ 239
240 virtual bool isLayerColourSignificant() const { return false; } 240 /**
241 * This should return the degree of meaning associated with colour
242 * in this layer.
243 *
244 * If ColourAbsent, the layer does not use colour. If
245 * ColourIrrelevant, the layer is coloured and the colour may be
246 * set by the user, but it doesn't really matter what the colour
247 * is (for example, in a time ruler layer). If
248 * ColourDistinguishes, then the colour is used to distinguish
249 * this layer from other similar layers (e.g. for data layers).
250 * If ColourAndBackgroundSignificant, then the layer should be
251 * given greater weight than ColourDistinguishes layers when
252 * choosing a background colour (e.g. for waveforms). If
253 * ColourHasMeaningfulValue, colours are actually meaningful --
254 * the view will then show selections using unfilled rectangles
255 * instead of translucent filled rectangles, so as not to disturb
256 * the colours underneath.
257 */
258 virtual ColourSignificance getLayerColourSignificance() const = 0;
241 259
242 /** 260 /**
243 * This should return true if the layer can be edited by the user. 261 * This should return true if the layer can be edited by the user.
244 * If this is the case, the appropriate edit tools may be made 262 * If this is the case, the appropriate edit tools may be made
245 * available by the application and the layer's drawStart/Drag/End 263 * available by the application and the layer's drawStart/Drag/End