Mercurial > hg > svgui
comparison layer/Colour3DPlotLayer.h @ 0:2a4f26e85b4c
initial import
author | Chris Cannam |
---|---|
date | Tue, 10 Jan 2006 16:33:16 +0000 |
parents | |
children | 37b110168acf |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:2a4f26e85b4c |
---|---|
1 /* -*- c-basic-offset: 4 -*- vi:set ts=8 sts=4 sw=4: */ | |
2 | |
3 /* | |
4 A waveform viewer and audio annotation editor. | |
5 Chris Cannam, Queen Mary University of London, 2005 | |
6 | |
7 This is experimental software. Not for distribution. | |
8 */ | |
9 | |
10 #ifndef _COLOUR_3D_PLOT_H_ | |
11 #define _COLOUR_3D_PLOT_H_ | |
12 | |
13 #include "base/Layer.h" | |
14 | |
15 #include "model/DenseThreeDimensionalModel.h" | |
16 | |
17 class View; | |
18 class QPainter; | |
19 class QImage; | |
20 | |
21 /** | |
22 * This is a view that displays dense 3-D data (time, some sort of | |
23 * binned y-axis range, value) as a colour plot with value mapped to | |
24 * colour range. Its source is a DenseThreeDimensionalModel. | |
25 * | |
26 * This was the original implementation for the spectrogram view, but | |
27 * it was replaced with a more efficient implementation that derived | |
28 * the spectrogram itself from a DenseTimeValueModel instead of using | |
29 * a three-dimensional model. This class is retained in case it | |
30 * becomes useful, but it will probably need some cleaning up if it's | |
31 * ever actually used. | |
32 */ | |
33 | |
34 class Colour3DPlotLayer : public Layer | |
35 { | |
36 Q_OBJECT | |
37 | |
38 public: | |
39 Colour3DPlotLayer(View *w); | |
40 ~Colour3DPlotLayer(); | |
41 | |
42 virtual const ZoomConstraint *getZoomConstraint() const { return m_model; } | |
43 virtual const Model *getModel() const { return m_model; } | |
44 virtual void paint(QPainter &paint, QRect rect) const; | |
45 | |
46 void setModel(const DenseThreeDimensionalModel *model); | |
47 | |
48 | |
49 /* | |
50 virtual PropertyList getProperties() const; | |
51 virtual PropertyType getPropertyType(const PropertyName &) const; | |
52 virtual int getPropertyRangeAndValue(const PropertyName &, | |
53 int *min, int *max) const; | |
54 virtual QString getPropertyValueLabel(const PropertyName &, | |
55 int value) const; | |
56 virtual void setProperty(const PropertyName &, int value); | |
57 */ | |
58 | |
59 virtual QString getPropertyContainerIconName() const { return "colour3d"; } | |
60 | |
61 protected slots: | |
62 void cacheInvalid(); | |
63 void cacheInvalid(size_t startFrame, size_t endFrame); | |
64 | |
65 protected: | |
66 const DenseThreeDimensionalModel *m_model; // I do not own this | |
67 | |
68 mutable QImage *m_cache; | |
69 }; | |
70 | |
71 #endif |