diff layer/Colour3DPlotLayer.cpp @ 1481:e540aa5d89cd by-id

Update for removal of (public) getId from Model
author Chris Cannam
date Fri, 05 Jul 2019 15:34:50 +0100
parents 886c1cd48f9d
children 0e971e3d93e2
line wrap: on
line diff
--- a/layer/Colour3DPlotLayer.cpp	Thu Jul 04 18:04:44 2019 +0100
+++ b/layer/Colour3DPlotLayer.cpp	Fri Jul 05 15:34:50 2019 +0100
@@ -155,10 +155,10 @@
     if (newModel) {
         connectSignals(m_model);
 
-        connect(newModel.get(), SIGNAL(modelChanged()),
-                this, SLOT(handleModelChanged()));
-        connect(newModel.get(), SIGNAL(modelChangedWithin(sv_frame_t, sv_frame_t)),
-                this, SLOT(handleModelChangedWithin(sv_frame_t, sv_frame_t)));
+        connect(newModel.get(), SIGNAL(modelChanged(ModelId)),
+                this, SLOT(handleModelChanged(ModelId)));
+        connect(newModel.get(), SIGNAL(modelChangedWithin(ModelId, sv_frame_t, sv_frame_t)),
+                this, SLOT(handleModelChangedWithin(ModelId, sv_frame_t, sv_frame_t)));
 
         m_peakResolution = 256;
         if (newModel->getResolution() > 512) {
@@ -214,14 +214,13 @@
     if (m_peakCache.isNone()) {
         auto peakCache = std::make_shared<Dense3DModelPeakCache>
             (m_model, m_peakCacheDivisor);
-        ModelById::add(peakCache);
-        m_peakCache = peakCache->getId();
+        m_peakCache = ModelById::add(peakCache);
     }
     return m_peakCache;
 }
 
 void
-Colour3DPlotLayer::handleModelChanged()
+Colour3DPlotLayer::handleModelChanged(ModelId modelId)
 {
     if (!m_colourScaleSet && m_colourScale == ColourScaleType::Linear) {
         auto model = ModelById::getAs<DenseThreeDimensionalModel>(m_model);
@@ -234,11 +233,13 @@
         }
     }
     invalidatePeakCache();
-    emit modelChanged();
+    emit modelChanged(modelId);
 }
 
 void
-Colour3DPlotLayer::handleModelChangedWithin(sv_frame_t startFrame, sv_frame_t endFrame)
+Colour3DPlotLayer::handleModelChangedWithin(ModelId modelId,
+                                            sv_frame_t startFrame,
+                                            sv_frame_t endFrame)
 {
     if (!m_colourScaleSet && m_colourScale == ColourScaleType::Linear) {
         auto model = ModelById::getAs<DenseThreeDimensionalModel>(m_model);
@@ -250,7 +251,7 @@
             }
         }
     }
-    emit modelChangedWithin(startFrame, endFrame);
+    emit modelChangedWithin(modelId, startFrame, endFrame);
 }
 
 Layer::PropertyList