Chris@0: /* -*- c-basic-offset: 4 -*- vi:set ts=8 sts=4 sw=4: */ Chris@0: Chris@0: /* Chris@0: A waveform viewer and audio annotation editor. Chris@5: Chris Cannam, Queen Mary University of London, 2005-2006 Chris@0: Chris@0: This is experimental software. Not for distribution. Chris@0: */ Chris@0: Chris@0: #ifndef _COLOUR_3D_PLOT_H_ Chris@0: #define _COLOUR_3D_PLOT_H_ Chris@0: Chris@0: #include "base/Layer.h" Chris@0: Chris@0: #include "model/DenseThreeDimensionalModel.h" Chris@0: Chris@0: class View; Chris@0: class QPainter; Chris@0: class QImage; Chris@0: Chris@0: /** Chris@0: * This is a view that displays dense 3-D data (time, some sort of Chris@0: * binned y-axis range, value) as a colour plot with value mapped to Chris@0: * colour range. Its source is a DenseThreeDimensionalModel. Chris@0: * Chris@0: * This was the original implementation for the spectrogram view, but Chris@0: * it was replaced with a more efficient implementation that derived Chris@0: * the spectrogram itself from a DenseTimeValueModel instead of using Chris@0: * a three-dimensional model. This class is retained in case it Chris@0: * becomes useful, but it will probably need some cleaning up if it's Chris@0: * ever actually used. Chris@0: */ Chris@0: Chris@0: class Colour3DPlotLayer : public Layer Chris@0: { Chris@0: Q_OBJECT Chris@0: Chris@0: public: Chris@0: Colour3DPlotLayer(View *w); Chris@0: ~Colour3DPlotLayer(); Chris@0: Chris@0: virtual const ZoomConstraint *getZoomConstraint() const { return m_model; } Chris@0: virtual const Model *getModel() const { return m_model; } Chris@0: virtual void paint(QPainter &paint, QRect rect) const; Chris@0: Chris@0: void setModel(const DenseThreeDimensionalModel *model); Chris@0: Chris@0: Chris@0: /* Chris@0: virtual PropertyList getProperties() const; Chris@0: virtual PropertyType getPropertyType(const PropertyName &) const; Chris@0: virtual int getPropertyRangeAndValue(const PropertyName &, Chris@0: int *min, int *max) const; Chris@0: virtual QString getPropertyValueLabel(const PropertyName &, Chris@0: int value) const; Chris@0: virtual void setProperty(const PropertyName &, int value); Chris@0: */ Chris@0: Chris@0: virtual QString getPropertyContainerIconName() const { return "colour3d"; } Chris@0: Chris@11: void setProperties(const QXmlAttributes &attributes) { } Chris@11: Chris@0: protected slots: Chris@0: void cacheInvalid(); Chris@0: void cacheInvalid(size_t startFrame, size_t endFrame); Chris@0: Chris@0: protected: Chris@0: const DenseThreeDimensionalModel *m_model; // I do not own this Chris@0: Chris@0: mutable QImage *m_cache; Chris@0: }; Chris@0: Chris@0: #endif