diff data/model/EditableDenseThreeDimensionalModel.h @ 1365:3382d914e110

Merge from branch 3.0-integration
author Chris Cannam
date Fri, 13 Jan 2017 10:29:44 +0000
parents 2ff5e411151d
children 48e9f538e6e9
line wrap: on
line diff
--- a/data/model/EditableDenseThreeDimensionalModel.h	Mon Nov 21 16:32:58 2016 +0000
+++ b/data/model/EditableDenseThreeDimensionalModel.h	Fri Jan 13 10:29:44 2017 +0000
@@ -44,7 +44,7 @@
 
     EditableDenseThreeDimensionalModel(sv_samplerate_t sampleRate,
 				       int resolution,
-				       int yBinCount,
+				       int height,
                                        CompressionType compression,
 				       bool notifyOnAdd = true);
 
@@ -75,12 +75,19 @@
     virtual int getWidth() const;
 
     /**
-     * Return the number of bins in each set of bins.
+     * Return the number of bins in each column.
      */
     virtual int getHeight() const; 
 
     /**
-     * Set the number of bins in each set of bins.
+     * Set the number of bins in each column.
+     *
+     * You can set (via setColumn) a vector of any length as a column,
+     * but any column being retrieved will be resized to this height
+     * (or the height that was supplied to the constructor, if this is
+     * never called) on retrieval. That is, the model owner determines
+     * the height of the model at a single stroke; the columns
+     * themselves don't have any effect on the height of the model.
      */
     virtual void setHeight(int sz);
 
@@ -105,11 +112,6 @@
     virtual void setMaximumLevel(float sz);
 
     /**
-     * Return true if there are data available for the given column.
-     */
-    virtual bool isColumnAvailable(int x) const { return x < getWidth(); }
-
-    /**
      * Get the set of bin values at the given column.
      */
     virtual Column getColumn(int x) const;
@@ -194,7 +196,7 @@
                        QString extraAttributes = "") const;
 
 protected:
-    typedef QVector<Column> ValueMatrix;
+    typedef std::vector<Column> ValueMatrix;
     ValueMatrix m_data;
 
     // m_trunc is used for simple compression.  If at least the top N
@@ -208,6 +210,7 @@
     std::vector<signed char> m_trunc;
     void truncateAndStore(int index, const Column & values);
     Column expandAndRetrieve(int index) const;
+    Column rightHeight(const Column &c) const;
 
     std::vector<QString> m_binNames;
     std::vector<float> m_binValues;