diff layer/SliceLayer.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 1284955856ab
children c0b9eec70639
line wrap: on
line diff
--- a/layer/SliceLayer.h	Wed Jul 11 20:46:37 2007 +0000
+++ b/layer/SliceLayer.h	Thu Jul 12 16:14:59 2007 +0000
@@ -17,7 +17,7 @@
 #ifndef _SLICE_LAYER_H_
 #define _SLICE_LAYER_H_
 
-#include "Layer.h"
+#include "SingleColourLayer.h"
 
 #include "base/Window.h"
 
@@ -25,7 +25,7 @@
 
 #include <QColor>
 
-class SliceLayer : public Layer
+class SliceLayer : public SingleColourLayer
 {
     Q_OBJECT
 
@@ -46,6 +46,10 @@
     virtual int getVerticalScaleWidth(View *v, QPainter &) const;
     virtual void paintVerticalScale(View *v, QPainter &paint, QRect rect) const;
 
+    virtual ColourSignificance getLayerColourSignificance() const {
+        return ColourAndBackgroundSignificant;
+    }
+
     virtual PropertyList getProperties() const;
     virtual QString getPropertyLabel(const PropertyName &) const;
     virtual PropertyType getPropertyType(const PropertyName &) const;
@@ -73,9 +77,6 @@
 
     enum BinScale { LinearBins, LogBins, InvertedLogBins };
 
-    void setBaseColour(QColor);
-    QColor getBaseColour() const { return m_colour; }
-
     void setFillColourMap(int);
     int getFillColourMap() const { return m_colourMap; }
 
@@ -127,8 +128,9 @@
 
     virtual float getThresholdDb() const;
 
+    virtual int getDefaultColourHint(bool dark, bool &impose);
+
     const DenseThreeDimensionalModel *m_sliceableModel;
-    QColor                            m_colour;
     int                               m_colourMap;
     EnergyScale                       m_energyScale;
     SamplingMode                      m_samplingMode;