comparison 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
comparison
equal deleted inserted replaced
286:7554ae119882 287:cd2492c5fe45
15 */ 15 */
16 16
17 #ifndef _SLICE_LAYER_H_ 17 #ifndef _SLICE_LAYER_H_
18 #define _SLICE_LAYER_H_ 18 #define _SLICE_LAYER_H_
19 19
20 #include "Layer.h" 20 #include "SingleColourLayer.h"
21 21
22 #include "base/Window.h" 22 #include "base/Window.h"
23 23
24 #include "data/model/DenseThreeDimensionalModel.h" 24 #include "data/model/DenseThreeDimensionalModel.h"
25 25
26 #include <QColor> 26 #include <QColor>
27 27
28 class SliceLayer : public Layer 28 class SliceLayer : public SingleColourLayer
29 { 29 {
30 Q_OBJECT 30 Q_OBJECT
31 31
32 public: 32 public:
33 SliceLayer(); 33 SliceLayer();
43 43
44 virtual QString getFeatureDescription(View *v, QPoint &) const; 44 virtual QString getFeatureDescription(View *v, QPoint &) const;
45 45
46 virtual int getVerticalScaleWidth(View *v, QPainter &) const; 46 virtual int getVerticalScaleWidth(View *v, QPainter &) const;
47 virtual void paintVerticalScale(View *v, QPainter &paint, QRect rect) const; 47 virtual void paintVerticalScale(View *v, QPainter &paint, QRect rect) const;
48
49 virtual ColourSignificance getLayerColourSignificance() const {
50 return ColourAndBackgroundSignificant;
51 }
48 52
49 virtual PropertyList getProperties() const; 53 virtual PropertyList getProperties() const;
50 virtual QString getPropertyLabel(const PropertyName &) const; 54 virtual QString getPropertyLabel(const PropertyName &) const;
51 virtual PropertyType getPropertyType(const PropertyName &) const; 55 virtual PropertyType getPropertyType(const PropertyName &) const;
52 virtual QString getPropertyGroupName(const PropertyName &) const; 56 virtual QString getPropertyGroupName(const PropertyName &) const;
70 enum SamplingMode { NearestSample, SampleMean, SamplePeak }; 74 enum SamplingMode { NearestSample, SampleMean, SamplePeak };
71 75
72 enum PlotStyle { PlotLines, PlotSteps, PlotBlocks, PlotFilledBlocks }; 76 enum PlotStyle { PlotLines, PlotSteps, PlotBlocks, PlotFilledBlocks };
73 77
74 enum BinScale { LinearBins, LogBins, InvertedLogBins }; 78 enum BinScale { LinearBins, LogBins, InvertedLogBins };
75
76 void setBaseColour(QColor);
77 QColor getBaseColour() const { return m_colour; }
78 79
79 void setFillColourMap(int); 80 void setFillColourMap(int);
80 int getFillColourMap() const { return m_colourMap; } 81 int getFillColourMap() const { return m_colourMap; }
81 82
82 void setEnergyScale(EnergyScale); 83 void setEnergyScale(EnergyScale);
125 typedef std::vector<float> BiasCurve; 126 typedef std::vector<float> BiasCurve;
126 virtual void getBiasCurve(BiasCurve &) const { return; } 127 virtual void getBiasCurve(BiasCurve &) const { return; }
127 128
128 virtual float getThresholdDb() const; 129 virtual float getThresholdDb() const;
129 130
131 virtual int getDefaultColourHint(bool dark, bool &impose);
132
130 const DenseThreeDimensionalModel *m_sliceableModel; 133 const DenseThreeDimensionalModel *m_sliceableModel;
131 QColor m_colour;
132 int m_colourMap; 134 int m_colourMap;
133 EnergyScale m_energyScale; 135 EnergyScale m_energyScale;
134 SamplingMode m_samplingMode; 136 SamplingMode m_samplingMode;
135 PlotStyle m_plotStyle; 137 PlotStyle m_plotStyle;
136 BinScale m_binScale; 138 BinScale m_binScale;