diff data/model/EditableDenseThreeDimensionalModel.h @ 1777:d484490cdf69

Split EditableDenseThreeDimensionalModel into explicitly compressed and uncompressed variants. Simplifies the uncompressed version, and we may want to consider whether we need the compressed one at all.
author Chris Cannam
date Tue, 10 Sep 2019 16:34:47 +0100
parents 78fe29adfd16
children c546429d4c2f
line wrap: on
line diff
--- a/data/model/EditableDenseThreeDimensionalModel.h	Mon Sep 09 10:25:16 2019 +0100
+++ b/data/model/EditableDenseThreeDimensionalModel.h	Tue Sep 10 16:34:47 2019 +0100
@@ -18,7 +18,7 @@
 
 #include "DenseThreeDimensionalModel.h"
 
-#include <QReadWriteLock>
+#include <QMutex>
 
 #include <vector>
 
@@ -27,25 +27,9 @@
     Q_OBJECT
 
 public:
-
-    // EditableDenseThreeDimensionalModel supports a basic compression
-    // method that reduces the size of multirate data (e.g. wavelet
-    // transform outputs) that are stored as plain 3d grids by about
-    // 60% or thereabouts.  However, it can only be used for models
-    // whose columns are set in order from 0 and never subsequently
-    // changed.  If the model is going to be actually edited, it must
-    // have NoCompression.
-
-    enum CompressionType
-    {
-        NoCompression,
-        BasicMultirateCompression
-    };
-
     EditableDenseThreeDimensionalModel(sv_samplerate_t sampleRate,
                                        int resolution,
                                        int height,
-                                       CompressionType compression,
                                        bool notifyOnAdd = true);
 
     bool isOK() const override;
@@ -201,19 +185,6 @@
     typedef std::vector<Column> ValueMatrix;
     ValueMatrix m_data;
 
-    // m_trunc is used for simple compression.  If at least the top N
-    // elements of column x (for N = some proportion of the column
-    // height) are equal to those of an earlier column x', then
-    // m_trunc[x] will contain x-x' and column x will be truncated so
-    // as to remove the duplicate elements.  If the equal elements are
-    // at the bottom, then m_trunc[x] will contain x'-x (a negative
-    // value).  If m_trunc[x] is 0 then the whole of column x is
-    // stored.
-    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;
     QString m_binValueUnit;
@@ -222,7 +193,6 @@
     sv_samplerate_t m_sampleRate;
     int m_resolution;
     int m_yBinCount;
-    CompressionType m_compression;
     float m_minimum;
     float m_maximum;
     bool m_haveExtents;
@@ -231,7 +201,7 @@
     sv_frame_t m_sinceLastNotifyMax;
     int m_completion;
 
-    mutable QReadWriteLock m_lock;
+    mutable QMutex m_mutex;
 };
 
 #endif