comparison layer/SliceLayer.h @ 1486:ac0a8addabcf

Merge from branch by-id
author Chris Cannam
date Wed, 17 Jul 2019 14:25:16 +0100
parents 696e569ff21b
children
comparison
equal deleted inserted replaced
1468:de41a11cabc2 1486:ac0a8addabcf
30 30
31 public: 31 public:
32 SliceLayer(); 32 SliceLayer();
33 ~SliceLayer(); 33 ~SliceLayer();
34 34
35 const Model *getModel() const override { return 0; } 35 ModelId getModel() const override { return {}; }
36 36
37 void setSliceableModel(const Model *model); 37 void setSliceableModel(ModelId model);
38 38
39 void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const override; 39 void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const override;
40 40
41 QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const override; 41 QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const override;
42 42
115 115
116 void toXml(QTextStream &stream, QString indent = "", 116 void toXml(QTextStream &stream, QString indent = "",
117 QString extraAttributes = "") const override; 117 QString extraAttributes = "") const override;
118 118
119 public slots: 119 public slots:
120 void sliceableModelReplaced(const Model *, const Model *); 120 void sliceableModelReplaced(ModelId, ModelId);
121 void modelAboutToBeDeleted(Model *);
122 121
123 protected: 122 protected:
124 /// Convert a (possibly non-integral) bin into x-coord. May be overridden 123 /// Convert a (possibly non-integral) bin into x-coord. May be overridden
125 virtual double getXForBin(const LayerGeometryProvider *, double bin) const; 124 virtual double getXForBin(const LayerGeometryProvider *, double bin) const;
126 125
169 enum BinAlignment { 168 enum BinAlignment {
170 BinsCentredOnScalePoints, 169 BinsCentredOnScalePoints,
171 BinsSpanScalePoints 170 BinsSpanScalePoints
172 }; 171 };
173 172
174 const DenseThreeDimensionalModel *m_sliceableModel; 173 ModelId m_sliceableModel; // a DenseThreeDimensionalModel
175 BinAlignment m_binAlignment; 174 BinAlignment m_binAlignment;
176 int m_colourMap; 175 int m_colourMap;
177 bool m_colourInverted; 176 bool m_colourInverted;
178 EnergyScale m_energyScale; 177 EnergyScale m_energyScale;
179 SamplingMode m_samplingMode; 178 SamplingMode m_samplingMode;
180 PlotStyle m_plotStyle; 179 PlotStyle m_plotStyle;
181 BinScale m_binScale; 180 BinScale m_binScale;
182 bool m_normalize; 181 bool m_normalize;
183 float m_threshold; 182 float m_threshold;
184 float m_initialThreshold; 183 float m_initialThreshold;
185 float m_gain; 184 float m_gain;
186 int m_minbin; 185 int m_minbin;
187 int m_maxbin; 186 int m_maxbin;
188 mutable std::vector<int> m_scalePoints; 187 mutable std::vector<int> m_scalePoints;
189 mutable int m_scalePaintHeight; 188 mutable int m_scalePaintHeight;
190 mutable std::map<int, int> m_xorigins; // LayerGeometryProvider id -> x 189 mutable std::map<int, int> m_xorigins; // LayerGeometryProvider id -> x
191 mutable std::map<int, int> m_yorigins; // LayerGeometryProvider id -> y 190 mutable std::map<int, int> m_yorigins; // LayerGeometryProvider id -> y
192 mutable std::map<int, int> m_heights; // LayerGeometryProvider id -> h 191 mutable std::map<int, int> m_heights; // LayerGeometryProvider id -> h
193 mutable sv_frame_t m_currentf0; 192 mutable sv_frame_t m_currentf0;
194 mutable sv_frame_t m_currentf1; 193 mutable sv_frame_t m_currentf1;
195 mutable std::vector<float> m_values; 194 mutable std::vector<float> m_values;
196 }; 195 };
197 196
198 #endif 197 #endif