comparison data/model/EditableDenseThreeDimensionalModel.h @ 182:f75f8a1cd7b1

* Some dull work to continue unifying the fft model and editable dense 3d model interfaces
author Chris Cannam
date Mon, 09 Oct 2006 10:49:46 +0000
parents 21792a550ec9
children 91fdc752e540
comparison
equal deleted inserted replaced
181:9c652f2c39b1 182:f75f8a1cd7b1
46 * Set the number of sample frames covered by each set of bins. 46 * Set the number of sample frames covered by each set of bins.
47 */ 47 */
48 virtual void setResolution(size_t sz); 48 virtual void setResolution(size_t sz);
49 49
50 /** 50 /**
51 * Return the number of columns.
52 */
53 virtual size_t getWidth() const;
54
55 /**
51 * Return the number of bins in each set of bins. 56 * Return the number of bins in each set of bins.
52 */ 57 */
53 virtual size_t getYBinCount() const; 58 virtual size_t getHeight() const;
54 59
55 /** 60 /**
56 * Set the number of bins in each set of bins. 61 * Set the number of bins in each set of bins.
57 */ 62 */
58 virtual void setYBinCount(size_t sz); 63 virtual void setHeight(size_t sz);
59 64
60 /** 65 /**
61 * Return the minimum value of the value in each bin. 66 * Return the minimum value of the value in each bin.
62 */ 67 */
63 virtual float getMinimumLevel() const; 68 virtual float getMinimumLevel() const;
75 /** 80 /**
76 * Set the maximum value of the value in a bin. 81 * Set the maximum value of the value in a bin.
77 */ 82 */
78 virtual void setMaximumLevel(float sz); 83 virtual void setMaximumLevel(float sz);
79 84
80 typedef std::vector<float> BinValueSet; 85 /**
86 * Return true if there are data available for the given column.
87 */
88 virtual bool isColumnAvailable(size_t x) const { return x < getWidth(); }
81 89
82 /** 90 /**
83 * Get the set of bin values at the given sample frame (i.e. the 91 * Get the set of bin values at the given column.
84 * windowStartFrame/getResolution()'th set of bins).
85 */ 92 */
86 virtual void getBinValues(long windowStartFrame, BinValueSet &result) const; 93 virtual void getColumn(size_t x, Column &) const;
87 94
88 /** 95 /**
89 * Get a single value, the one at the n'th bin of the set of bins 96 * Get a single value, from the n'th bin of the given column.
90 * starting at the given sample frame.
91 */ 97 */
92 virtual float getBinValue(long windowStartFrame, size_t n) const; 98 virtual float getValueAt(size_t x, size_t n) const;
93 99
94 /** 100 /**
95 * Set the entire set of bin values at the given sample frame. 101 * Set the entire set of bin values at the given column.
96 */ 102 */
97 virtual void setBinValues(long windowStartFrame, const BinValueSet &values); 103 virtual void setColumn(size_t x, const Column &values);
98 104
99 virtual QString getBinName(size_t n) const; 105 virtual QString getBinName(size_t n) const;
100 virtual void setBinName(size_t n, QString); 106 virtual void setBinName(size_t n, QString);
101 virtual void setBinNames(std::vector<QString> names); 107 virtual void setBinNames(std::vector<QString> names);
102 108
109 115
110 virtual QString toXmlString(QString indent = "", 116 virtual QString toXmlString(QString indent = "",
111 QString extraAttributes = "") const; 117 QString extraAttributes = "") const;
112 118
113 protected: 119 protected:
114 typedef std::vector<BinValueSet> ValueMatrix; 120 typedef std::vector<Column> ValueMatrix;
115 ValueMatrix m_data; 121 ValueMatrix m_data;
116 122
117 std::vector<QString> m_binNames; 123 std::vector<QString> m_binNames;
118 124
119 size_t m_sampleRate; 125 size_t m_sampleRate;