diff layer/TimeInstantLayer.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 e175ade2d6b0
children cda569dfbdfe
line wrap: on
line diff
--- a/layer/TimeInstantLayer.h	Wed Jul 11 20:46:37 2007 +0000
+++ b/layer/TimeInstantLayer.h	Thu Jul 12 16:14:59 2007 +0000
@@ -16,7 +16,7 @@
 #ifndef _TIME_INSTANT_LAYER_H_
 #define _TIME_INSTANT_LAYER_H_
 
-#include "Layer.h"
+#include "SingleColourLayer.h"
 #include "data/model/SparseOneDimensionalModel.h"
 
 #include <QObject>
@@ -25,7 +25,7 @@
 class View;
 class QPainter;
 
-class TimeInstantLayer : public Layer
+class TimeInstantLayer : public SingleColourLayer
 {
     Q_OBJECT
 
@@ -70,9 +70,6 @@
 					  int value) const;
     virtual void setProperty(const PropertyName &, int value);
 
-    void setBaseColour(QColor);
-    QColor getBaseColour() const { return m_colour; }
-
     enum PlotStyle {
 	PlotInstants,
 	PlotSegmentation
@@ -101,11 +98,12 @@
 protected:
     SparseOneDimensionalModel::PointList getLocalPoints(View *v, int) const;
 
+    virtual int getDefaultColourHint(bool dark, bool &impose);
+
     SparseOneDimensionalModel *m_model;
     bool m_editing;
     SparseOneDimensionalModel::Point m_editingPoint;
     SparseOneDimensionalModel::EditCommand *m_editingCommand;
-    QColor m_colour;
     PlotStyle m_plotStyle;
 };