From 5bbfb1ecd93d13082d67a7266146bad032487d8d Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Tue, 16 Nov 2021 22:03:27 -0600 Subject: [PATCH] Use lambas for single-statement signals within radar product layer --- .../scwx/qt/map/radar_product_layer.cpp | 25 +++---------------- .../scwx/qt/map/radar_product_layer.hpp | 4 --- 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/scwx-qt/source/scwx/qt/map/radar_product_layer.cpp b/scwx-qt/source/scwx/qt/map/radar_product_layer.cpp index 3e7a9530..aca0f8e3 100644 --- a/scwx-qt/source/scwx/qt/map/radar_product_layer.cpp +++ b/scwx-qt/source/scwx/qt/map/radar_product_layer.cpp @@ -146,11 +146,11 @@ void RadarProductLayer::initialize() connect(p->radarProductView_.get(), &view::RadarProductView::ColorTableUpdated, this, - &RadarProductLayer::UpdateColorTableNextFrame); + [=]() { p->colorTableNeedsUpdate_ = true; }); connect(p->radarProductView_.get(), &view::RadarProductView::SweepComputed, this, - &RadarProductLayer::UpdateSweepNextFrame); + [=]() { p->sweepNeedsUpdate_ = true; }); } void RadarProductLayer::UpdateSweep() @@ -302,7 +302,7 @@ void RadarProductLayer::deinitialize() BOOST_LOG_TRIVIAL(debug) << logPrefix_ << "deinitialize()"; gl.glDeleteVertexArrays(1, &p->vao_); - gl.glDeleteBuffers(2, p->vbo_.data()); + gl.glDeleteBuffers(3, p->vbo_.data()); p->uMVPMatrixLocation_ = GL_INVALID_INDEX; p->uMapScreenCoordLocation_ = GL_INVALID_INDEX; @@ -312,15 +312,6 @@ void RadarProductLayer::deinitialize() p->vao_ = GL_INVALID_INDEX; p->vbo_ = {GL_INVALID_INDEX}; p->texture_ = GL_INVALID_INDEX; - - disconnect(p->radarProductView_.get(), - &view::RadarProductView::ColorTableUpdated, - this, - &RadarProductLayer::UpdateColorTableNextFrame); - disconnect(p->radarProductView_.get(), - &view::RadarProductView::SweepComputed, - this, - &RadarProductLayer::UpdateSweepNextFrame); } void RadarProductLayer::UpdateColorTable() @@ -356,16 +347,6 @@ void RadarProductLayer::UpdateColorTable() gl.glUniform1f(p->uDataMomentScaleLocation_, scale); } -void RadarProductLayer::UpdateColorTableNextFrame() -{ - p->colorTableNeedsUpdate_ = true; -} - -void RadarProductLayer::UpdateSweepNextFrame() -{ - p->sweepNeedsUpdate_ = true; -} - static glm::vec2 LatLongToScreenCoordinate(const QMapbox::Coordinate& coordinate) { diff --git a/scwx-qt/source/scwx/qt/map/radar_product_layer.hpp b/scwx-qt/source/scwx/qt/map/radar_product_layer.hpp index 9264176c..9f928247 100644 --- a/scwx-qt/source/scwx/qt/map/radar_product_layer.hpp +++ b/scwx-qt/source/scwx/qt/map/radar_product_layer.hpp @@ -34,10 +34,6 @@ private: void UpdateColorTable(); void UpdateSweep(); -private slots: - void UpdateColorTableNextFrame(); - void UpdateSweepNextFrame(); - private: std::unique_ptr p; };