From 1fd52f771cf9e98b6e005b90a192dfa67a01bc65 Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Tue, 27 Feb 2024 23:33:57 -0600 Subject: [PATCH] Refactor QMapLibreGL to QMapLibre --- scwx-qt/source/scwx/qt/gl/draw/draw_item.cpp | 20 +++---- scwx-qt/source/scwx/qt/gl/draw/draw_item.hpp | 24 ++++---- scwx-qt/source/scwx/qt/gl/draw/geo_icons.cpp | 4 +- scwx-qt/source/scwx/qt/gl/draw/geo_icons.hpp | 12 ++-- scwx-qt/source/scwx/qt/gl/draw/geo_lines.cpp | 4 +- scwx-qt/source/scwx/qt/gl/draw/geo_lines.hpp | 12 ++-- scwx-qt/source/scwx/qt/gl/draw/icons.cpp | 8 +-- scwx-qt/source/scwx/qt/gl/draw/icons.hpp | 12 ++-- .../source/scwx/qt/gl/draw/linked_vectors.cpp | 15 +++-- .../source/scwx/qt/gl/draw/linked_vectors.hpp | 12 ++-- .../scwx/qt/gl/draw/placefile_icons.cpp | 6 +- .../scwx/qt/gl/draw/placefile_icons.hpp | 12 ++-- .../scwx/qt/gl/draw/placefile_images.cpp | 4 +- .../scwx/qt/gl/draw/placefile_images.hpp | 2 +- .../scwx/qt/gl/draw/placefile_lines.cpp | 4 +- .../scwx/qt/gl/draw/placefile_lines.hpp | 12 ++-- .../scwx/qt/gl/draw/placefile_polygons.cpp | 2 +- .../scwx/qt/gl/draw/placefile_polygons.hpp | 2 +- .../source/scwx/qt/gl/draw/placefile_text.cpp | 33 ++++++----- .../source/scwx/qt/gl/draw/placefile_text.hpp | 12 ++-- .../scwx/qt/gl/draw/placefile_triangles.cpp | 2 +- .../scwx/qt/gl/draw/placefile_triangles.hpp | 2 +- scwx-qt/source/scwx/qt/gl/draw/rectangle.cpp | 2 +- scwx-qt/source/scwx/qt/gl/draw/rectangle.hpp | 2 +- scwx-qt/source/scwx/qt/main/main_window.cpp | 8 +-- .../scwx/qt/manager/radar_product_manager.cpp | 6 +- scwx-qt/source/scwx/qt/map/alert_layer.cpp | 56 +++++++++---------- .../source/scwx/qt/map/color_table_layer.cpp | 2 +- .../source/scwx/qt/map/color_table_layer.hpp | 2 +- scwx-qt/source/scwx/qt/map/draw_layer.cpp | 14 ++--- scwx-qt/source/scwx/qt/map/draw_layer.hpp | 13 ++--- scwx-qt/source/scwx/qt/map/generic_layer.cpp | 2 +- scwx-qt/source/scwx/qt/map/generic_layer.hpp | 20 +++---- scwx-qt/source/scwx/qt/map/layer_wrapper.cpp | 3 +- scwx-qt/source/scwx/qt/map/layer_wrapper.hpp | 4 +- scwx-qt/source/scwx/qt/map/map_context.cpp | 22 ++++---- scwx-qt/source/scwx/qt/map/map_context.hpp | 12 ++-- scwx-qt/source/scwx/qt/map/map_provider.cpp | 4 +- scwx-qt/source/scwx/qt/map/map_provider.hpp | 10 ++-- scwx-qt/source/scwx/qt/map/map_widget.cpp | 42 +++++++------- scwx-qt/source/scwx/qt/map/map_widget.hpp | 6 +- scwx-qt/source/scwx/qt/map/overlay_layer.cpp | 15 +++-- scwx-qt/source/scwx/qt/map/overlay_layer.hpp | 12 ++-- .../scwx/qt/map/overlay_product_layer.cpp | 14 ++--- .../scwx/qt/map/overlay_product_layer.hpp | 12 ++-- .../source/scwx/qt/map/placefile_layer.cpp | 2 +- .../source/scwx/qt/map/placefile_layer.hpp | 2 +- .../scwx/qt/map/radar_product_layer.cpp | 4 +- .../scwx/qt/map/radar_product_layer.hpp | 12 ++-- .../source/scwx/qt/map/radar_range_layer.cpp | 38 ++++++------- .../source/scwx/qt/map/radar_range_layer.hpp | 16 +++--- .../source/scwx/qt/map/radar_site_layer.cpp | 11 ++-- .../source/scwx/qt/map/radar_site_layer.hpp | 12 ++-- scwx-qt/source/scwx/qt/util/maplibre.cpp | 12 ++-- scwx-qt/source/scwx/qt/util/maplibre.hpp | 10 ++-- 55 files changed, 305 insertions(+), 313 deletions(-) diff --git a/scwx-qt/source/scwx/qt/gl/draw/draw_item.cpp b/scwx-qt/source/scwx/qt/gl/draw/draw_item.cpp index 861007c6..c6737a10 100644 --- a/scwx-qt/source/scwx/qt/gl/draw/draw_item.cpp +++ b/scwx-qt/source/scwx/qt/gl/draw/draw_item.cpp @@ -43,18 +43,18 @@ DrawItem::DrawItem(DrawItem&&) noexcept = default; DrawItem& DrawItem::operator=(DrawItem&&) noexcept = default; void DrawItem::Render( - const QMapLibreGL::CustomLayerRenderParameters& /* params */) + const QMapLibre::CustomLayerRenderParameters& /* params */) { } -void DrawItem::Render(const QMapLibreGL::CustomLayerRenderParameters& params, +void DrawItem::Render(const QMapLibre::CustomLayerRenderParameters& params, bool /* textureAtlasChanged */) { Render(params); } bool DrawItem::RunMousePicking( - const QMapLibreGL::CustomLayerRenderParameters& /* params */, + const QMapLibre::CustomLayerRenderParameters& /* params */, const QPointF& /* mouseLocalPos */, const QPointF& /* mouseGlobalPos */, const glm::vec2& /* mouseCoords */, @@ -66,8 +66,8 @@ bool DrawItem::RunMousePicking( } void DrawItem::UseDefaultProjection( - const QMapLibreGL::CustomLayerRenderParameters& params, - GLint uMVPMatrixLocation) + const QMapLibre::CustomLayerRenderParameters& params, + GLint uMVPMatrixLocation) { glm::mat4 projection = glm::ortho(0.0f, static_cast(params.width), @@ -79,8 +79,8 @@ void DrawItem::UseDefaultProjection( } void DrawItem::UseRotationProjection( - const QMapLibreGL::CustomLayerRenderParameters& params, - GLint uMVPMatrixLocation) + const QMapLibre::CustomLayerRenderParameters& params, + GLint uMVPMatrixLocation) { glm::mat4 projection = glm::ortho(0.0f, static_cast(params.width), @@ -96,9 +96,9 @@ void DrawItem::UseRotationProjection( } void DrawItem::UseMapProjection( - const QMapLibreGL::CustomLayerRenderParameters& params, - GLint uMVPMatrixLocation, - GLint uMapScreenCoordLocation) + const QMapLibre::CustomLayerRenderParameters& params, + GLint uMVPMatrixLocation, + GLint uMapScreenCoordLocation) { OpenGLFunctions& gl = p->gl_; diff --git a/scwx-qt/source/scwx/qt/gl/draw/draw_item.hpp b/scwx-qt/source/scwx/qt/gl/draw/draw_item.hpp index 809c5b1a..f7df44c4 100644 --- a/scwx-qt/source/scwx/qt/gl/draw/draw_item.hpp +++ b/scwx-qt/source/scwx/qt/gl/draw/draw_item.hpp @@ -6,8 +6,8 @@ #include -#include #include +#include namespace scwx { @@ -31,8 +31,8 @@ public: DrawItem& operator=(DrawItem&&) noexcept; virtual void Initialize() = 0; - virtual void Render(const QMapLibreGL::CustomLayerRenderParameters& params); - virtual void Render(const QMapLibreGL::CustomLayerRenderParameters& params, + virtual void Render(const QMapLibre::CustomLayerRenderParameters& params); + virtual void Render(const QMapLibre::CustomLayerRenderParameters& params, bool textureAtlasChanged); virtual void Deinitialize() = 0; @@ -49,21 +49,21 @@ public: * @return true if the draw item was picked, otherwise false */ virtual bool - RunMousePicking(const QMapLibreGL::CustomLayerRenderParameters& params, - const QPointF& mouseLocalPos, - const QPointF& mouseGlobalPos, - const glm::vec2& mouseCoords, - const common::Coordinate& mouseGeoCoords, - std::shared_ptr& eventHandler); + RunMousePicking(const QMapLibre::CustomLayerRenderParameters& params, + const QPointF& mouseLocalPos, + const QPointF& mouseGlobalPos, + const glm::vec2& mouseCoords, + const common::Coordinate& mouseGeoCoords, + std::shared_ptr& eventHandler); protected: void - UseDefaultProjection(const QMapLibreGL::CustomLayerRenderParameters& params, + UseDefaultProjection(const QMapLibre::CustomLayerRenderParameters& params, GLint uMVPMatrixLocation); void - UseRotationProjection(const QMapLibreGL::CustomLayerRenderParameters& params, + UseRotationProjection(const QMapLibre::CustomLayerRenderParameters& params, GLint uMVPMatrixLocation); - void UseMapProjection(const QMapLibreGL::CustomLayerRenderParameters& params, + void UseMapProjection(const QMapLibre::CustomLayerRenderParameters& params, GLint uMVPMatrixLocation, GLint uMapScreenCoordLocation); diff --git a/scwx-qt/source/scwx/qt/gl/draw/geo_icons.cpp b/scwx-qt/source/scwx/qt/gl/draw/geo_icons.cpp index 1f38d9c8..503960fb 100644 --- a/scwx-qt/source/scwx/qt/gl/draw/geo_icons.cpp +++ b/scwx-qt/source/scwx/qt/gl/draw/geo_icons.cpp @@ -243,7 +243,7 @@ void GeoIcons::Initialize() p->dirty_ = true; } -void GeoIcons::Render(const QMapLibreGL::CustomLayerRenderParameters& params, +void GeoIcons::Render(const QMapLibre::CustomLayerRenderParameters& params, bool textureAtlasChanged) { if (!p->visible_) @@ -732,7 +732,7 @@ void GeoIcons::Impl::Update(bool textureAtlasChanged) } bool GeoIcons::RunMousePicking( - const QMapLibreGL::CustomLayerRenderParameters& params, + const QMapLibre::CustomLayerRenderParameters& params, const QPointF& /* mouseLocalPos */, const QPointF& mouseGlobalPos, const glm::vec2& mouseCoords, diff --git a/scwx-qt/source/scwx/qt/gl/draw/geo_icons.hpp b/scwx-qt/source/scwx/qt/gl/draw/geo_icons.hpp index f61443e1..455f4bd5 100644 --- a/scwx-qt/source/scwx/qt/gl/draw/geo_icons.hpp +++ b/scwx-qt/source/scwx/qt/gl/draw/geo_icons.hpp @@ -33,16 +33,16 @@ public: void set_thresholded(bool thresholded); void Initialize() override; - void Render(const QMapLibreGL::CustomLayerRenderParameters& params, + void Render(const QMapLibre::CustomLayerRenderParameters& params, bool textureAtlasChanged) override; void Deinitialize() override; bool - RunMousePicking(const QMapLibreGL::CustomLayerRenderParameters& params, - const QPointF& mouseLocalPos, - const QPointF& mouseGlobalPos, - const glm::vec2& mouseCoords, - const common::Coordinate& mouseGeoCoords, + RunMousePicking(const QMapLibre::CustomLayerRenderParameters& params, + const QPointF& mouseLocalPos, + const QPointF& mouseGlobalPos, + const glm::vec2& mouseCoords, + const common::Coordinate& mouseGeoCoords, std::shared_ptr& eventHandler) override; /** diff --git a/scwx-qt/source/scwx/qt/gl/draw/geo_lines.cpp b/scwx-qt/source/scwx/qt/gl/draw/geo_lines.cpp index 32125039..0f9dd191 100644 --- a/scwx-qt/source/scwx/qt/gl/draw/geo_lines.cpp +++ b/scwx-qt/source/scwx/qt/gl/draw/geo_lines.cpp @@ -218,7 +218,7 @@ void GeoLines::Initialize() p->dirty_ = true; } -void GeoLines::Render(const QMapLibreGL::CustomLayerRenderParameters& params) +void GeoLines::Render(const QMapLibre::CustomLayerRenderParameters& params) { if (!p->visible_) { @@ -513,7 +513,7 @@ void GeoLines::Impl::Update() } bool GeoLines::RunMousePicking( - const QMapLibreGL::CustomLayerRenderParameters& params, + const QMapLibre::CustomLayerRenderParameters& params, const QPointF& /* mouseLocalPos */, const QPointF& mouseGlobalPos, const glm::vec2& mouseCoords, diff --git a/scwx-qt/source/scwx/qt/gl/draw/geo_lines.hpp b/scwx-qt/source/scwx/qt/gl/draw/geo_lines.hpp index e7564698..6422ab4a 100644 --- a/scwx-qt/source/scwx/qt/gl/draw/geo_lines.hpp +++ b/scwx-qt/source/scwx/qt/gl/draw/geo_lines.hpp @@ -32,15 +32,15 @@ public: void set_thresholded(bool thresholded); void Initialize() override; - void Render(const QMapLibreGL::CustomLayerRenderParameters& params) override; + void Render(const QMapLibre::CustomLayerRenderParameters& params) override; void Deinitialize() override; bool - RunMousePicking(const QMapLibreGL::CustomLayerRenderParameters& params, - const QPointF& mouseLocalPos, - const QPointF& mouseGlobalPos, - const glm::vec2& mouseCoords, - const common::Coordinate& mouseGeoCoords, + RunMousePicking(const QMapLibre::CustomLayerRenderParameters& params, + const QPointF& mouseLocalPos, + const QPointF& mouseGlobalPos, + const glm::vec2& mouseCoords, + const common::Coordinate& mouseGeoCoords, std::shared_ptr& eventHandler) override; /** diff --git a/scwx-qt/source/scwx/qt/gl/draw/icons.cpp b/scwx-qt/source/scwx/qt/gl/draw/icons.cpp index ec32bde0..86e7e542 100644 --- a/scwx-qt/source/scwx/qt/gl/draw/icons.cpp +++ b/scwx-qt/source/scwx/qt/gl/draw/icons.cpp @@ -182,7 +182,7 @@ void Icons::Initialize() p->dirty_ = true; } -void Icons::Render(const QMapLibreGL::CustomLayerRenderParameters& params, +void Icons::Render(const QMapLibre::CustomLayerRenderParameters& params, bool textureAtlasChanged) { if (!p->visible_) @@ -575,9 +575,9 @@ void Icons::Impl::Update(bool textureAtlasChanged) } bool Icons::RunMousePicking( - const QMapLibreGL::CustomLayerRenderParameters& params, - const QPointF& mouseLocalPos, - const QPointF& mouseGlobalPos, + const QMapLibre::CustomLayerRenderParameters& params, + const QPointF& mouseLocalPos, + const QPointF& mouseGlobalPos, const glm::vec2& /* mouseCoords */, const common::Coordinate& /* mouseGeoCoords */, std::shared_ptr& eventHandler) diff --git a/scwx-qt/source/scwx/qt/gl/draw/icons.hpp b/scwx-qt/source/scwx/qt/gl/draw/icons.hpp index 081e22f1..d7207a11 100644 --- a/scwx-qt/source/scwx/qt/gl/draw/icons.hpp +++ b/scwx-qt/source/scwx/qt/gl/draw/icons.hpp @@ -32,16 +32,16 @@ public: Icons& operator=(Icons&&) noexcept; void Initialize() override; - void Render(const QMapLibreGL::CustomLayerRenderParameters& params, + void Render(const QMapLibre::CustomLayerRenderParameters& params, bool textureAtlasChanged) override; void Deinitialize() override; bool - RunMousePicking(const QMapLibreGL::CustomLayerRenderParameters& params, - const QPointF& mouseLocalPos, - const QPointF& mouseGlobalPos, - const glm::vec2& mouseCoords, - const common::Coordinate& mouseGeoCoords, + RunMousePicking(const QMapLibre::CustomLayerRenderParameters& params, + const QPointF& mouseLocalPos, + const QPointF& mouseGlobalPos, + const glm::vec2& mouseCoords, + const common::Coordinate& mouseGeoCoords, std::shared_ptr& eventHandler) override; /** diff --git a/scwx-qt/source/scwx/qt/gl/draw/linked_vectors.cpp b/scwx-qt/source/scwx/qt/gl/draw/linked_vectors.cpp index 9e4b664f..be053e00 100644 --- a/scwx-qt/source/scwx/qt/gl/draw/linked_vectors.cpp +++ b/scwx-qt/source/scwx/qt/gl/draw/linked_vectors.cpp @@ -103,8 +103,7 @@ void LinkedVectors::Initialize() p->geoLines_->Initialize(); } -void LinkedVectors::Render( - const QMapLibreGL::CustomLayerRenderParameters& params) +void LinkedVectors::Render(const QMapLibre::CustomLayerRenderParameters& params) { if (!p->visible_) { @@ -337,12 +336,12 @@ void LinkedVectors::FinishVectors() } bool LinkedVectors::RunMousePicking( - const QMapLibreGL::CustomLayerRenderParameters& params, - const QPointF& mouseLocalPos, - const QPointF& mouseGlobalPos, - const glm::vec2& mouseCoords, - const common::Coordinate& mouseGeoCoords, - std::shared_ptr& eventHandler) + const QMapLibre::CustomLayerRenderParameters& params, + const QPointF& mouseLocalPos, + const QPointF& mouseGlobalPos, + const glm::vec2& mouseCoords, + const common::Coordinate& mouseGeoCoords, + std::shared_ptr& eventHandler) { return p->geoLines_->RunMousePicking(params, mouseLocalPos, diff --git a/scwx-qt/source/scwx/qt/gl/draw/linked_vectors.hpp b/scwx-qt/source/scwx/qt/gl/draw/linked_vectors.hpp index 9e8eef6c..06c0128d 100644 --- a/scwx-qt/source/scwx/qt/gl/draw/linked_vectors.hpp +++ b/scwx-qt/source/scwx/qt/gl/draw/linked_vectors.hpp @@ -43,15 +43,15 @@ public: void set_thresholded(bool thresholded); void Initialize() override; - void Render(const QMapLibreGL::CustomLayerRenderParameters& params) override; + void Render(const QMapLibre::CustomLayerRenderParameters& params) override; void Deinitialize() override; bool - RunMousePicking(const QMapLibreGL::CustomLayerRenderParameters& params, - const QPointF& mouseLocalPos, - const QPointF& mouseGlobalPos, - const glm::vec2& mouseCoords, - const common::Coordinate& mouseGeoCoords, + RunMousePicking(const QMapLibre::CustomLayerRenderParameters& params, + const QPointF& mouseLocalPos, + const QPointF& mouseGlobalPos, + const glm::vec2& mouseCoords, + const common::Coordinate& mouseGeoCoords, std::shared_ptr& eventHandler) override; /** diff --git a/scwx-qt/source/scwx/qt/gl/draw/placefile_icons.cpp b/scwx-qt/source/scwx/qt/gl/draw/placefile_icons.cpp index 1daddd9f..d343acf3 100644 --- a/scwx-qt/source/scwx/qt/gl/draw/placefile_icons.cpp +++ b/scwx-qt/source/scwx/qt/gl/draw/placefile_icons.cpp @@ -255,8 +255,8 @@ void PlacefileIcons::Initialize() } void PlacefileIcons::Render( - const QMapLibreGL::CustomLayerRenderParameters& params, - bool textureAtlasChanged) + const QMapLibre::CustomLayerRenderParameters& params, + bool textureAtlasChanged) { std::unique_lock lock {p->iconMutex_}; @@ -685,7 +685,7 @@ void PlacefileIcons::Impl::Update(bool textureAtlasChanged) } bool PlacefileIcons::RunMousePicking( - const QMapLibreGL::CustomLayerRenderParameters& params, + const QMapLibre::CustomLayerRenderParameters& params, const QPointF& /* mouseLocalPos */, const QPointF& mouseGlobalPos, const glm::vec2& mouseCoords, diff --git a/scwx-qt/source/scwx/qt/gl/draw/placefile_icons.hpp b/scwx-qt/source/scwx/qt/gl/draw/placefile_icons.hpp index f34f5ffe..c70966e3 100644 --- a/scwx-qt/source/scwx/qt/gl/draw/placefile_icons.hpp +++ b/scwx-qt/source/scwx/qt/gl/draw/placefile_icons.hpp @@ -31,16 +31,16 @@ public: void set_thresholded(bool thresholded); void Initialize() override; - void Render(const QMapLibreGL::CustomLayerRenderParameters& params, + void Render(const QMapLibre::CustomLayerRenderParameters& params, bool textureAtlasChanged) override; void Deinitialize() override; bool - RunMousePicking(const QMapLibreGL::CustomLayerRenderParameters& params, - const QPointF& mouseLocalPos, - const QPointF& mouseGlobalPos, - const glm::vec2& mouseCoords, - const common::Coordinate& mouseGeoCoords, + RunMousePicking(const QMapLibre::CustomLayerRenderParameters& params, + const QPointF& mouseLocalPos, + const QPointF& mouseGlobalPos, + const glm::vec2& mouseCoords, + const common::Coordinate& mouseGeoCoords, std::shared_ptr& eventHandler) override; /** diff --git a/scwx-qt/source/scwx/qt/gl/draw/placefile_images.cpp b/scwx-qt/source/scwx/qt/gl/draw/placefile_images.cpp index 1b46bd99..a1fbe032 100644 --- a/scwx-qt/source/scwx/qt/gl/draw/placefile_images.cpp +++ b/scwx-qt/source/scwx/qt/gl/draw/placefile_images.cpp @@ -224,8 +224,8 @@ void PlacefileImages::Initialize() } void PlacefileImages::Render( - const QMapLibreGL::CustomLayerRenderParameters& params, - bool textureAtlasChanged) + const QMapLibre::CustomLayerRenderParameters& params, + bool textureAtlasChanged) { std::unique_lock lock {p->imageMutex_}; diff --git a/scwx-qt/source/scwx/qt/gl/draw/placefile_images.hpp b/scwx-qt/source/scwx/qt/gl/draw/placefile_images.hpp index d99c43a0..0603bb99 100644 --- a/scwx-qt/source/scwx/qt/gl/draw/placefile_images.hpp +++ b/scwx-qt/source/scwx/qt/gl/draw/placefile_images.hpp @@ -29,7 +29,7 @@ public: void set_thresholded(bool thresholded); void Initialize() override; - void Render(const QMapLibreGL::CustomLayerRenderParameters& params, + void Render(const QMapLibre::CustomLayerRenderParameters& params, bool textureAtlasChanged) override; void Deinitialize() override; diff --git a/scwx-qt/source/scwx/qt/gl/draw/placefile_lines.cpp b/scwx-qt/source/scwx/qt/gl/draw/placefile_lines.cpp index f8815a22..ced0a41a 100644 --- a/scwx-qt/source/scwx/qt/gl/draw/placefile_lines.cpp +++ b/scwx-qt/source/scwx/qt/gl/draw/placefile_lines.cpp @@ -213,7 +213,7 @@ void PlacefileLines::Initialize() } void PlacefileLines::Render( - const QMapLibreGL::CustomLayerRenderParameters& params) + const QMapLibre::CustomLayerRenderParameters& params) { std::unique_lock lock {p->lineMutex_}; @@ -496,7 +496,7 @@ void PlacefileLines::Impl::Update() } bool PlacefileLines::RunMousePicking( - const QMapLibreGL::CustomLayerRenderParameters& params, + const QMapLibre::CustomLayerRenderParameters& params, const QPointF& /* mouseLocalPos */, const QPointF& mouseGlobalPos, const glm::vec2& mouseCoords, diff --git a/scwx-qt/source/scwx/qt/gl/draw/placefile_lines.hpp b/scwx-qt/source/scwx/qt/gl/draw/placefile_lines.hpp index 65ec03f0..c77c5bbd 100644 --- a/scwx-qt/source/scwx/qt/gl/draw/placefile_lines.hpp +++ b/scwx-qt/source/scwx/qt/gl/draw/placefile_lines.hpp @@ -29,15 +29,15 @@ public: void set_thresholded(bool thresholded); void Initialize() override; - void Render(const QMapLibreGL::CustomLayerRenderParameters& params) override; + void Render(const QMapLibre::CustomLayerRenderParameters& params) override; void Deinitialize() override; bool - RunMousePicking(const QMapLibreGL::CustomLayerRenderParameters& params, - const QPointF& mouseLocalPos, - const QPointF& mouseGlobalPos, - const glm::vec2& mouseCoords, - const common::Coordinate& mouseGeoCoords, + RunMousePicking(const QMapLibre::CustomLayerRenderParameters& params, + const QPointF& mouseLocalPos, + const QPointF& mouseGlobalPos, + const glm::vec2& mouseCoords, + const common::Coordinate& mouseGeoCoords, std::shared_ptr& eventHandler) override; /** diff --git a/scwx-qt/source/scwx/qt/gl/draw/placefile_polygons.cpp b/scwx-qt/source/scwx/qt/gl/draw/placefile_polygons.cpp index 24a96fe6..2944fa20 100644 --- a/scwx-qt/source/scwx/qt/gl/draw/placefile_polygons.cpp +++ b/scwx-qt/source/scwx/qt/gl/draw/placefile_polygons.cpp @@ -221,7 +221,7 @@ void PlacefilePolygons::Initialize() } void PlacefilePolygons::Render( - const QMapLibreGL::CustomLayerRenderParameters& params) + const QMapLibre::CustomLayerRenderParameters& params) { if (!p->currentBuffer_.empty()) { diff --git a/scwx-qt/source/scwx/qt/gl/draw/placefile_polygons.hpp b/scwx-qt/source/scwx/qt/gl/draw/placefile_polygons.hpp index 3c607b72..873805c9 100644 --- a/scwx-qt/source/scwx/qt/gl/draw/placefile_polygons.hpp +++ b/scwx-qt/source/scwx/qt/gl/draw/placefile_polygons.hpp @@ -31,7 +31,7 @@ public: void set_thresholded(bool thresholded); void Initialize() override; - void Render(const QMapLibreGL::CustomLayerRenderParameters& params) override; + void Render(const QMapLibre::CustomLayerRenderParameters& params) override; void Deinitialize() override; /** diff --git a/scwx-qt/source/scwx/qt/gl/draw/placefile_text.cpp b/scwx-qt/source/scwx/qt/gl/draw/placefile_text.cpp index e996bdfc..b8faa8f8 100644 --- a/scwx-qt/source/scwx/qt/gl/draw/placefile_text.cpp +++ b/scwx-qt/source/scwx/qt/gl/draw/placefile_text.cpp @@ -34,14 +34,14 @@ public: ~Impl() {} void RenderTextDrawItem( - const QMapLibreGL::CustomLayerRenderParameters& params, + const QMapLibre::CustomLayerRenderParameters& params, const std::shared_ptr& di); - void RenderText(const QMapLibreGL::CustomLayerRenderParameters& params, - const std::string& text, - const std::string& hoverText, - boost::gil::rgba8_pixel_t color, - float x, - float y); + void RenderText(const QMapLibre::CustomLayerRenderParameters& params, + const std::string& text, + const std::string& hoverText, + boost::gil::rgba8_pixel_t color, + float x, + float y); std::shared_ptr context_; @@ -98,8 +98,7 @@ void PlacefileText::set_thresholded(bool thresholded) void PlacefileText::Initialize() {} -void PlacefileText::Render( - const QMapLibreGL::CustomLayerRenderParameters& params) +void PlacefileText::Render(const QMapLibre::CustomLayerRenderParameters& params) { std::unique_lock lock {p->listMutex_}; @@ -128,7 +127,7 @@ void PlacefileText::Render( } void PlacefileText::Impl::RenderTextDrawItem( - const QMapLibreGL::CustomLayerRenderParameters& params, + const QMapLibre::CustomLayerRenderParameters& params, const std::shared_ptr& di) { // If no time has been selected, use the current time @@ -191,12 +190,12 @@ void PlacefileText::Impl::RenderTextDrawItem( } void PlacefileText::Impl::RenderText( - const QMapLibreGL::CustomLayerRenderParameters& params, - const std::string& text, - const std::string& hoverText, - boost::gil::rgba8_pixel_t color, - float x, - float y) + const QMapLibre::CustomLayerRenderParameters& params, + const std::string& text, + const std::string& hoverText, + boost::gil::rgba8_pixel_t color, + float x, + float y) { const std::string windowName { fmt::format("PlacefileText-{}-{}", placefileName_, ++textId_)}; @@ -238,7 +237,7 @@ void PlacefileText::Deinitialize() } bool PlacefileText::RunMousePicking( - const QMapLibreGL::CustomLayerRenderParameters& /* params */, + const QMapLibre::CustomLayerRenderParameters& /* params */, const QPointF& /* mouseLocalPos */, const QPointF& mouseGlobalPos, const glm::vec2& /* mouseCoords */, diff --git a/scwx-qt/source/scwx/qt/gl/draw/placefile_text.hpp b/scwx-qt/source/scwx/qt/gl/draw/placefile_text.hpp index ee0ac0c8..4cbaf0af 100644 --- a/scwx-qt/source/scwx/qt/gl/draw/placefile_text.hpp +++ b/scwx-qt/source/scwx/qt/gl/draw/placefile_text.hpp @@ -34,15 +34,15 @@ public: void set_thresholded(bool thresholded); void Initialize() override; - void Render(const QMapLibreGL::CustomLayerRenderParameters& params) override; + void Render(const QMapLibre::CustomLayerRenderParameters& params) override; void Deinitialize() override; bool - RunMousePicking(const QMapLibreGL::CustomLayerRenderParameters& params, - const QPointF& mouseLocalPos, - const QPointF& mouseGlobalPos, - const glm::vec2& mouseCoords, - const common::Coordinate& mouseGeoCoords, + RunMousePicking(const QMapLibre::CustomLayerRenderParameters& params, + const QPointF& mouseLocalPos, + const QPointF& mouseGlobalPos, + const glm::vec2& mouseCoords, + const common::Coordinate& mouseGeoCoords, std::shared_ptr& eventHandler) override; /** diff --git a/scwx-qt/source/scwx/qt/gl/draw/placefile_triangles.cpp b/scwx-qt/source/scwx/qt/gl/draw/placefile_triangles.cpp index dc0bc781..0b5f9c30 100644 --- a/scwx-qt/source/scwx/qt/gl/draw/placefile_triangles.cpp +++ b/scwx-qt/source/scwx/qt/gl/draw/placefile_triangles.cpp @@ -169,7 +169,7 @@ void PlacefileTriangles::Initialize() } void PlacefileTriangles::Render( - const QMapLibreGL::CustomLayerRenderParameters& params) + const QMapLibre::CustomLayerRenderParameters& params) { if (!p->currentBuffer_.empty()) { diff --git a/scwx-qt/source/scwx/qt/gl/draw/placefile_triangles.hpp b/scwx-qt/source/scwx/qt/gl/draw/placefile_triangles.hpp index daacc120..c5c8be0a 100644 --- a/scwx-qt/source/scwx/qt/gl/draw/placefile_triangles.hpp +++ b/scwx-qt/source/scwx/qt/gl/draw/placefile_triangles.hpp @@ -29,7 +29,7 @@ public: void set_thresholded(bool thresholded); void Initialize() override; - void Render(const QMapLibreGL::CustomLayerRenderParameters& params) override; + void Render(const QMapLibre::CustomLayerRenderParameters& params) override; void Deinitialize() override; /** diff --git a/scwx-qt/source/scwx/qt/gl/draw/rectangle.cpp b/scwx-qt/source/scwx/qt/gl/draw/rectangle.cpp index eebb333b..800e199f 100644 --- a/scwx-qt/source/scwx/qt/gl/draw/rectangle.cpp +++ b/scwx-qt/source/scwx/qt/gl/draw/rectangle.cpp @@ -122,7 +122,7 @@ void Rectangle::Initialize() p->dirty_ = true; } -void Rectangle::Render(const QMapLibreGL::CustomLayerRenderParameters& params) +void Rectangle::Render(const QMapLibre::CustomLayerRenderParameters& params) { if (p->visible_) { diff --git a/scwx-qt/source/scwx/qt/gl/draw/rectangle.hpp b/scwx-qt/source/scwx/qt/gl/draw/rectangle.hpp index 2c1cc69c..50a53281 100644 --- a/scwx-qt/source/scwx/qt/gl/draw/rectangle.hpp +++ b/scwx-qt/source/scwx/qt/gl/draw/rectangle.hpp @@ -27,7 +27,7 @@ public: Rectangle& operator=(Rectangle&&) noexcept; void Initialize() override; - void Render(const QMapLibreGL::CustomLayerRenderParameters& params) override; + void Render(const QMapLibre::CustomLayerRenderParameters& params) override; void Deinitialize() override; void SetBorder(float width, boost::gil::rgba8_pixel_t color); diff --git a/scwx-qt/source/scwx/qt/main/main_window.cpp b/scwx-qt/source/scwx/qt/main/main_window.cpp index 179c1020..3aa17d92 100644 --- a/scwx-qt/source/scwx/qt/main/main_window.cpp +++ b/scwx-qt/source/scwx/qt/main/main_window.cpp @@ -164,10 +164,10 @@ public: boost::asio::thread_pool threadPool_ {1u}; - MainWindow* mainWindow_; - QMapLibreGL::Settings settings_; - map::MapProvider mapProvider_; - map::MapWidget* activeMap_; + MainWindow* mainWindow_; + QMapLibre::Settings settings_; + map::MapProvider mapProvider_; + map::MapWidget* activeMap_; ui::CollapsibleGroup* mapSettingsGroup_; ui::CollapsibleGroup* level2ProductsGroup_; diff --git a/scwx-qt/source/scwx/qt/manager/radar_product_manager.cpp b/scwx-qt/source/scwx/qt/manager/radar_product_manager.cpp index 80fb4242..f79f1013 100644 --- a/scwx-qt/source/scwx/qt/manager/radar_product_manager.cpp +++ b/scwx-qt/source/scwx/qt/manager/radar_product_manager.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #if defined(_MSC_VER) # pragma warning(pop) @@ -423,8 +423,8 @@ void RadarProductManager::Initialize() const GeographicLib::Geodesic& geodesic( util::GeographicLib::DefaultGeodesic()); - const QMapLibreGL::Coordinate radar(p->radarSite_->latitude(), - p->radarSite_->longitude()); + const QMapLibre::Coordinate radar(p->radarSite_->latitude(), + p->radarSite_->longitude()); const float gateSize = gate_size(); diff --git a/scwx-qt/source/scwx/qt/map/alert_layer.cpp b/scwx-qt/source/scwx/qt/map/alert_layer.cpp index d1676d7a..c7a8f1bd 100644 --- a/scwx-qt/source/scwx/qt/map/alert_layer.cpp +++ b/scwx-qt/source/scwx/qt/map/alert_layer.cpp @@ -24,22 +24,22 @@ static const std::string logPrefix_ = "scwx::qt::map::alert_layer"; static const auto logger_ = scwx::util::Logger::Create(logPrefix_); static std::vector -AddAlertLayer(std::shared_ptr map, - awips::Phenomenon phenomenon, - bool alertActive, - const QString& beforeLayer); -static QMapLibreGL::Feature +AddAlertLayer(std::shared_ptr map, + awips::Phenomenon phenomenon, + bool alertActive, + const QString& beforeLayer); +static QMapLibre::Feature CreateFeature(const awips::CodedLocation& codedLocation); -static QMapLibreGL::Coordinate +static QMapLibre::Coordinate GetMapboxCoordinate(const common::Coordinate& coordinate); -static QMapLibreGL::Coordinates +static QMapLibre::Coordinates GetMapboxCoordinates(const awips::CodedLocation& codedLocation); static QString GetSourceId(awips::Phenomenon phenomenon, bool alertActive); static QString GetSuffix(awips::Phenomenon phenomenon, bool alertActive); static const QVariantMap kEmptyFeatureCollection_ { {"type", "geojson"}, - {"data", QVariant::fromValue(std::list {})}}; + {"data", QVariant::fromValue(std::list {})}}; static const std::vector kAlertPhenomena_ { awips::Phenomenon::Marine, awips::Phenomenon::FlashFlood, @@ -87,8 +87,8 @@ class AlertLayerHandler : public QObject static std::shared_ptr Instance(); - std::list* FeatureList(awips::Phenomenon phenomenon, - bool alertActive); + std::list* FeatureList(awips::Phenomenon phenomenon, + bool alertActive); void HandleAlert(const types::TextEventKey& key, size_t messageIndex); void UpdateAlerts(); @@ -103,7 +103,7 @@ class AlertLayerHandler : public QObject std::unordered_multimap::iterator, + std::list::iterator, std::chrono::system_clock::time_point>, types::TextEventHash> featureMap_; @@ -166,16 +166,16 @@ std::vector AlertLayer::AddLayers(awips::Phenomenon phenomenon, return layers; } -std::list* +std::list* AlertLayerHandler::FeatureList(awips::Phenomenon phenomenon, bool alertActive) { - std::list* featureList = nullptr; + std::list* featureList = nullptr; auto key = std::make_pair(phenomenon, alertActive); auto it = alertSourceMap_.find(key); if (it != alertSourceMap_.cend()) { - featureList = reinterpret_cast*>( + featureList = reinterpret_cast*>( it->second["data"].data()); } @@ -371,10 +371,10 @@ std::shared_ptr AlertLayerHandler::Instance() } static std::vector -AddAlertLayer(std::shared_ptr map, - awips::Phenomenon phenomenon, - bool alertActive, - const QString& beforeLayer) +AddAlertLayer(std::shared_ptr map, + awips::Phenomenon phenomenon, + bool alertActive, + const QString& beforeLayer) { settings::PaletteSettings& paletteSettings = settings::PaletteSettings::Instance(); @@ -426,33 +426,33 @@ AddAlertLayer(std::shared_ptr map, return {bgLayerId.toStdString(), fgLayerId.toStdString()}; } -static QMapLibreGL::Feature +static QMapLibre::Feature CreateFeature(const awips::CodedLocation& codedLocation) { auto mapboxCoordinates = GetMapboxCoordinates(codedLocation); - return {QMapLibreGL::Feature::PolygonType, - std::initializer_list { - std::initializer_list { - {mapboxCoordinates}}}}; + return { + QMapLibre::Feature::PolygonType, + std::initializer_list { + std::initializer_list {{mapboxCoordinates}}}}; } -static QMapLibreGL::Coordinate +static QMapLibre::Coordinate GetMapboxCoordinate(const common::Coordinate& coordinate) { return {coordinate.latitude_, coordinate.longitude_}; } -static QMapLibreGL::Coordinates +static QMapLibre::Coordinates GetMapboxCoordinates(const awips::CodedLocation& codedLocation) { - auto scwxCoordinates = codedLocation.coordinates(); - QMapLibreGL::Coordinates mapboxCoordinates(scwxCoordinates.size() + 1u); + auto scwxCoordinates = codedLocation.coordinates(); + QMapLibre::Coordinates mapboxCoordinates(scwxCoordinates.size() + 1u); std::transform(scwxCoordinates.cbegin(), scwxCoordinates.cend(), mapboxCoordinates.begin(), - [](auto& coordinate) -> QMapLibreGL::Coordinate + [](auto& coordinate) -> QMapLibre::Coordinate { return GetMapboxCoordinate(coordinate); }); mapboxCoordinates.back() = GetMapboxCoordinate(scwxCoordinates.front()); diff --git a/scwx-qt/source/scwx/qt/map/color_table_layer.cpp b/scwx-qt/source/scwx/qt/map/color_table_layer.cpp index eb5d5d13..20d9c9dc 100644 --- a/scwx-qt/source/scwx/qt/map/color_table_layer.cpp +++ b/scwx-qt/source/scwx/qt/map/color_table_layer.cpp @@ -116,7 +116,7 @@ void ColorTableLayer::Initialize() } void ColorTableLayer::Render( - const QMapLibreGL::CustomLayerRenderParameters& params) + const QMapLibre::CustomLayerRenderParameters& params) { gl::OpenGLFunctions& gl = context()->gl(); auto radarProductView = context()->radar_product_view(); diff --git a/scwx-qt/source/scwx/qt/map/color_table_layer.hpp b/scwx-qt/source/scwx/qt/map/color_table_layer.hpp index 3fd8c07f..c23dc2b8 100644 --- a/scwx-qt/source/scwx/qt/map/color_table_layer.hpp +++ b/scwx-qt/source/scwx/qt/map/color_table_layer.hpp @@ -18,7 +18,7 @@ public: ~ColorTableLayer(); void Initialize() override final; - void Render(const QMapLibreGL::CustomLayerRenderParameters&) override final; + void Render(const QMapLibre::CustomLayerRenderParameters&) override final; void Deinitialize() override final; private: diff --git a/scwx-qt/source/scwx/qt/map/draw_layer.cpp b/scwx-qt/source/scwx/qt/map/draw_layer.cpp index 5b0dd7ca..92254307 100644 --- a/scwx-qt/source/scwx/qt/map/draw_layer.cpp +++ b/scwx-qt/source/scwx/qt/map/draw_layer.cpp @@ -44,7 +44,7 @@ void DrawLayer::Initialize() } } -void DrawLayer::Render(const QMapLibreGL::CustomLayerRenderParameters& params) +void DrawLayer::Render(const QMapLibre::CustomLayerRenderParameters& params) { gl::OpenGLFunctions& gl = p->context_->gl(); p->textureAtlas_ = p->context_->GetTextureAtlas(); @@ -77,12 +77,12 @@ void DrawLayer::Deinitialize() } bool DrawLayer::RunMousePicking( - const QMapLibreGL::CustomLayerRenderParameters& params, - const QPointF& mouseLocalPos, - const QPointF& mouseGlobalPos, - const glm::vec2& mouseCoords, - const common::Coordinate& mouseGeoCoords, - std::shared_ptr& eventHandler) + const QMapLibre::CustomLayerRenderParameters& params, + const QPointF& mouseLocalPos, + const QPointF& mouseGlobalPos, + const glm::vec2& mouseCoords, + const common::Coordinate& mouseGeoCoords, + std::shared_ptr& eventHandler) { bool itemPicked = false; diff --git a/scwx-qt/source/scwx/qt/map/draw_layer.hpp b/scwx-qt/source/scwx/qt/map/draw_layer.hpp index adf71457..22dfa76c 100644 --- a/scwx-qt/source/scwx/qt/map/draw_layer.hpp +++ b/scwx-qt/source/scwx/qt/map/draw_layer.hpp @@ -19,16 +19,15 @@ public: virtual ~DrawLayer(); virtual void Initialize() override; - virtual void - Render(const QMapLibreGL::CustomLayerRenderParameters&) override; + virtual void Render(const QMapLibre::CustomLayerRenderParameters&) override; virtual void Deinitialize() override; virtual bool - RunMousePicking(const QMapLibreGL::CustomLayerRenderParameters& params, - const QPointF& mouseLocalPos, - const QPointF& mouseGlobalPos, - const glm::vec2& mouseCoords, - const common::Coordinate& mouseGeoCoords, + RunMousePicking(const QMapLibre::CustomLayerRenderParameters& params, + const QPointF& mouseLocalPos, + const QPointF& mouseGlobalPos, + const glm::vec2& mouseCoords, + const common::Coordinate& mouseGeoCoords, std::shared_ptr& eventHandler) override; protected: diff --git a/scwx-qt/source/scwx/qt/map/generic_layer.cpp b/scwx-qt/source/scwx/qt/map/generic_layer.cpp index d93345ae..97f22097 100644 --- a/scwx-qt/source/scwx/qt/map/generic_layer.cpp +++ b/scwx-qt/source/scwx/qt/map/generic_layer.cpp @@ -27,7 +27,7 @@ GenericLayer::GenericLayer(std::shared_ptr context) : GenericLayer::~GenericLayer() = default; bool GenericLayer::RunMousePicking( - const QMapLibreGL::CustomLayerRenderParameters& /* params */, + const QMapLibre::CustomLayerRenderParameters& /* params */, const QPointF& /* mouseLocalPos */, const QPointF& /* mouseGlobalPos */, const glm::vec2& /* mousePos */, diff --git a/scwx-qt/source/scwx/qt/map/generic_layer.hpp b/scwx-qt/source/scwx/qt/map/generic_layer.hpp index 0ebc4869..0fee92ab 100644 --- a/scwx-qt/source/scwx/qt/map/generic_layer.hpp +++ b/scwx-qt/source/scwx/qt/map/generic_layer.hpp @@ -7,8 +7,8 @@ #include #include -#include #include +#include namespace scwx { @@ -27,9 +27,9 @@ public: explicit GenericLayer(std::shared_ptr context); virtual ~GenericLayer(); - virtual void Initialize() = 0; - virtual void Render(const QMapLibreGL::CustomLayerRenderParameters&) = 0; - virtual void Deinitialize() = 0; + virtual void Initialize() = 0; + virtual void Render(const QMapLibre::CustomLayerRenderParameters&) = 0; + virtual void Deinitialize() = 0; /** * @brief Run mouse picking on the layer. @@ -44,12 +44,12 @@ public: * @return true if a draw item was picked, otherwise false */ virtual bool - RunMousePicking(const QMapLibreGL::CustomLayerRenderParameters& params, - const QPointF& mouseLocalPos, - const QPointF& mouseGlobalPos, - const glm::vec2& mouseCoords, - const common::Coordinate& mouseGeoCoords, - std::shared_ptr& eventHandler); + RunMousePicking(const QMapLibre::CustomLayerRenderParameters& params, + const QPointF& mouseLocalPos, + const QPointF& mouseGlobalPos, + const glm::vec2& mouseCoords, + const common::Coordinate& mouseGeoCoords, + std::shared_ptr& eventHandler); signals: void NeedsRendering(); diff --git a/scwx-qt/source/scwx/qt/map/layer_wrapper.cpp b/scwx-qt/source/scwx/qt/map/layer_wrapper.cpp index a7d47808..2e66f8d7 100644 --- a/scwx-qt/source/scwx/qt/map/layer_wrapper.cpp +++ b/scwx-qt/source/scwx/qt/map/layer_wrapper.cpp @@ -34,8 +34,7 @@ void LayerWrapper::initialize() p->layer_->Initialize(); } -void LayerWrapper::render( - const QMapLibreGL::CustomLayerRenderParameters& params) +void LayerWrapper::render(const QMapLibre::CustomLayerRenderParameters& params) { p->layer_->Render(params); } diff --git a/scwx-qt/source/scwx/qt/map/layer_wrapper.hpp b/scwx-qt/source/scwx/qt/map/layer_wrapper.hpp index 9e23c53e..6e0e44ee 100644 --- a/scwx-qt/source/scwx/qt/map/layer_wrapper.hpp +++ b/scwx-qt/source/scwx/qt/map/layer_wrapper.hpp @@ -11,7 +11,7 @@ namespace map class LayerWrapperImpl; -class LayerWrapper : public QMapLibreGL::CustomLayerHostInterface +class LayerWrapper : public QMapLibre::CustomLayerHostInterface { public: explicit LayerWrapper(std::shared_ptr layer); @@ -24,7 +24,7 @@ public: LayerWrapper& operator=(LayerWrapper&&) noexcept; void initialize() override final; - void render(const QMapLibreGL::CustomLayerRenderParameters&) override final; + void render(const QMapLibre::CustomLayerRenderParameters&) override final; void deinitialize() override final; private: diff --git a/scwx-qt/source/scwx/qt/map/map_context.cpp b/scwx-qt/source/scwx/qt/map/map_context.cpp index 7590d9d7..4dc87bb1 100644 --- a/scwx-qt/source/scwx/qt/map/map_context.cpp +++ b/scwx-qt/source/scwx/qt/map/map_context.cpp @@ -20,14 +20,14 @@ public: ~Impl() {} - std::weak_ptr map_ {}; - MapSettings settings_ {}; - float pixelRatio_ {1.0f}; - common::RadarProductGroup radarProductGroup_ { + std::weak_ptr map_ {}; + MapSettings settings_ {}; + float pixelRatio_ {1.0f}; + common::RadarProductGroup radarProductGroup_ { common::RadarProductGroup::Unknown}; - std::string radarProduct_ {"???"}; - int16_t radarProductCode_ {0}; - QMapLibreGL::CustomLayerRenderParameters renderParameters_ {}; + std::string radarProduct_ {"???"}; + int16_t radarProductCode_ {0}; + QMapLibre::CustomLayerRenderParameters renderParameters_ {}; std::shared_ptr overlayProductView_ {nullptr}; std::shared_ptr radarProductView_; @@ -43,7 +43,7 @@ MapContext::~MapContext() = default; MapContext::MapContext(MapContext&&) noexcept = default; MapContext& MapContext::operator=(MapContext&&) noexcept = default; -std::weak_ptr MapContext::map() const +std::weak_ptr MapContext::map() const { return p->map_; } @@ -84,12 +84,12 @@ int16_t MapContext::radar_product_code() const return p->radarProductCode_; } -QMapLibreGL::CustomLayerRenderParameters MapContext::render_parameters() const +QMapLibre::CustomLayerRenderParameters MapContext::render_parameters() const { return p->renderParameters_; } -void MapContext::set_map(const std::shared_ptr& map) +void MapContext::set_map(const std::shared_ptr& map) { p->map_ = map; } @@ -128,7 +128,7 @@ void MapContext::set_radar_product_code(int16_t radarProductCode) } void MapContext::set_render_parameters( - const QMapLibreGL::CustomLayerRenderParameters& params) + const QMapLibre::CustomLayerRenderParameters& params) { p->renderParameters_ = params; } diff --git a/scwx-qt/source/scwx/qt/map/map_context.hpp b/scwx-qt/source/scwx/qt/map/map_context.hpp index 30498ab3..d6613ae0 100644 --- a/scwx-qt/source/scwx/qt/map/map_context.hpp +++ b/scwx-qt/source/scwx/qt/map/map_context.hpp @@ -3,7 +3,7 @@ #include #include -#include +#include namespace scwx { @@ -35,7 +35,7 @@ public: MapContext(MapContext&&) noexcept; MapContext& operator=(MapContext&&) noexcept; - std::weak_ptr map() const; + std::weak_ptr map() const; MapSettings& settings(); float pixel_ratio() const; std::shared_ptr overlay_product_view() const; @@ -43,9 +43,9 @@ public: common::RadarProductGroup radar_product_group() const; std::string radar_product() const; int16_t radar_product_code() const; - QMapLibreGL::CustomLayerRenderParameters render_parameters() const; + QMapLibre::CustomLayerRenderParameters render_parameters() const; - void set_map(const std::shared_ptr& map); + void set_map(const std::shared_ptr& map); void set_overlay_product_view( const std::shared_ptr& overlayProductView); void set_pixel_ratio(float pixelRatio); @@ -54,8 +54,8 @@ public: void set_radar_product_group(common::RadarProductGroup radarProductGroup); void set_radar_product(const std::string& radarProduct); void set_radar_product_code(int16_t radarProductCode); - void set_render_parameters( - const QMapLibreGL::CustomLayerRenderParameters& params); + void + set_render_parameters(const QMapLibre::CustomLayerRenderParameters& params); private: class Impl; diff --git a/scwx-qt/source/scwx/qt/map/map_provider.cpp b/scwx-qt/source/scwx/qt/map/map_provider.cpp index df4bba08..b27870d7 100644 --- a/scwx-qt/source/scwx/qt/map/map_provider.cpp +++ b/scwx-qt/source/scwx/qt/map/map_provider.cpp @@ -27,7 +27,7 @@ static const std::unordered_map mapProviderInfo_ { .mapProvider_ {MapProvider::Mapbox}, .cacheDbName_ {"mbgl-cache.db"}, .settingsTemplate_ { - QMapLibreGL::Settings::SettingsTemplate::MapboxSettings}, + QMapLibre::Settings::SettingsTemplate::MapboxSettings}, .mapStyles_ {{.name_ {"Streets"}, .url_ {"mapbox://styles/mapbox/streets-v11"}, .drawBelow_ {mapboxDrawBelow_}}, @@ -51,7 +51,7 @@ static const std::unordered_map mapProviderInfo_ { .mapProvider_ {MapProvider::MapTiler}, .cacheDbName_ {"maptiler-cache.db"}, .settingsTemplate_ { - QMapLibreGL::Settings::SettingsTemplate::MapTilerSettings}, + QMapLibre::Settings::SettingsTemplate::MapTilerSettings}, .mapStyles_ { {.name_ {"Satellite"}, .url_ {"maptiler://maps/hybrid"}, diff --git a/scwx-qt/source/scwx/qt/map/map_provider.hpp b/scwx-qt/source/scwx/qt/map/map_provider.hpp index 7e6bb491..9b89f4d4 100644 --- a/scwx-qt/source/scwx/qt/map/map_provider.hpp +++ b/scwx-qt/source/scwx/qt/map/map_provider.hpp @@ -4,7 +4,7 @@ #include -#include +#include namespace scwx { @@ -32,10 +32,10 @@ struct MapStyle struct MapProviderInfo { - MapProvider mapProvider_ {MapProvider::Unknown}; - std::string cacheDbName_ {}; - QMapLibreGL::Settings::SettingsTemplate settingsTemplate_ {}; - std::vector mapStyles_ {}; + MapProvider mapProvider_ {MapProvider::Unknown}; + std::string cacheDbName_ {}; + QMapLibre::Settings::SettingsTemplate settingsTemplate_ {}; + std::vector mapStyles_ {}; }; MapProvider GetMapProvider(const std::string& name); diff --git a/scwx-qt/source/scwx/qt/map/map_widget.cpp b/scwx-qt/source/scwx/qt/map/map_widget.cpp index 9d841215..11367bbe 100644 --- a/scwx-qt/source/scwx/qt/map/map_widget.cpp +++ b/scwx-qt/source/scwx/qt/map/map_widget.cpp @@ -60,9 +60,9 @@ class MapWidgetImpl : public QObject Q_OBJECT public: - explicit MapWidgetImpl(MapWidget* widget, - std::size_t id, - const QMapLibreGL::Settings& settings) : + explicit MapWidgetImpl(MapWidget* widget, + std::size_t id, + const QMapLibre::Settings& settings) : id_ {id}, uuid_ {boost::uuids::random_generator()()}, context_ {std::make_shared()}, @@ -169,11 +169,11 @@ public: std::shared_ptr context_; - MapWidget* widget_; - MapProvider mapProvider_; - QMapLibreGL::Settings settings_; - std::shared_ptr map_; - std::list layerList_; + MapWidget* widget_; + MapProvider mapProvider_; + QMapLibre::Settings settings_; + std::shared_ptr map_; + std::list layerList_; std::vector> genericLayers_ {}; @@ -229,7 +229,7 @@ public slots: void Update(); }; -MapWidget::MapWidget(std::size_t id, const QMapLibreGL::Settings& settings) : +MapWidget::MapWidget(std::size_t id, const QMapLibre::Settings& settings) : p(std::make_unique(this, id, settings)) { if (settings::GeneralSettings::Instance().anti_aliasing_enabled().GetValue()) @@ -246,7 +246,7 @@ MapWidget::MapWidget(std::size_t id, const QMapLibreGL::Settings& settings) : MapWidget::~MapWidget() { - // Make sure we have a valid context so we can delete the QMapLibreGL. + // Make sure we have a valid context so we can delete the QMapLibre. makeCurrent(); } @@ -987,8 +987,8 @@ void MapWidgetImpl::AddLayer(const std::string& id, std::shared_ptr layer, const std::string& before) { - // QMapLibreGL::addCustomLayer will take ownership of the std::unique_ptr - std::unique_ptr pHost = + // QMapLibre::addCustomLayer will take ownership of the std::unique_ptr + std::unique_ptr pHost = std::make_unique(layer); try @@ -1131,10 +1131,10 @@ void MapWidget::initializeGL() p->imGuiRendererInitialized_ = true; p->map_.reset( - new QMapLibreGL::Map(nullptr, p->settings_, size(), pixelRatio())); + new QMapLibre::Map(nullptr, p->settings_, size(), pixelRatio())); p->context_->set_map(p->map_); connect(p->map_.get(), - &QMapLibreGL::Map::needsRendering, + &QMapLibre::Map::needsRendering, p.get(), &MapWidgetImpl::Update); @@ -1160,10 +1160,8 @@ void MapWidget::initializeGL() SetMapStyle(p->initialStyleName_); } - connect(p->map_.get(), - &QMapLibreGL::Map::mapChanged, - this, - &MapWidget::mapChanged); + connect( + p->map_.get(), &QMapLibre::Map::mapChanged, this, &MapWidget::mapChanged); } void MapWidget::paintGL() @@ -1192,7 +1190,7 @@ void MapWidget::paintGL() // Update pixel ratio p->context_->set_pixel_ratio(pixelRatio()); - // Render QMapLibreGL Map + // Render QMapLibre Map p->map_->resize(size()); p->map_->setFramebufferObject(defaultFramebufferObject(), size() * pixelRatio()); @@ -1243,7 +1241,7 @@ void MapWidgetImpl::ImGuiCheckFonts() void MapWidgetImpl::RunMousePicking() { - const QMapLibreGL::CustomLayerRenderParameters params = + const QMapLibre::CustomLayerRenderParameters params = context_->render_parameters(); auto coordinate = map_->coordinateForPixel(lastPos_); @@ -1318,11 +1316,11 @@ void MapWidgetImpl::RunMousePicking() lastItemPicked_ = itemPicked; } -void MapWidget::mapChanged(QMapLibreGL::Map::MapChange mapChange) +void MapWidget::mapChanged(QMapLibre::Map::MapChange mapChange) { switch (mapChange) { - case QMapLibreGL::Map::MapChangeDidFinishLoadingStyle: + case QMapLibre::Map::MapChangeDidFinishLoadingStyle: p->UpdateLoadedStyle(); p->AddLayers(); break; diff --git a/scwx-qt/source/scwx/qt/map/map_widget.hpp b/scwx-qt/source/scwx/qt/map/map_widget.hpp index 007fd2f4..7776e1c9 100644 --- a/scwx-qt/source/scwx/qt/map/map_widget.hpp +++ b/scwx-qt/source/scwx/qt/map/map_widget.hpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include @@ -33,7 +33,7 @@ class MapWidget : public QOpenGLWidget Q_OBJECT public: - explicit MapWidget(std::size_t id, const QMapLibreGL::Settings&); + explicit MapWidget(std::size_t id, const QMapLibre::Settings&); ~MapWidget(); void DumpLayerList() const; @@ -139,7 +139,7 @@ private: friend class MapWidgetImpl; private slots: - void mapChanged(QMapLibreGL::Map::MapChange); + void mapChanged(QMapLibre::Map::MapChange); signals: void Level3ProductsChanged(); diff --git a/scwx-qt/source/scwx/qt/map/overlay_layer.cpp b/scwx-qt/source/scwx/qt/map/overlay_layer.cpp index 6f23d8dd..afd88b7f 100644 --- a/scwx-qt/source/scwx/qt/map/overlay_layer.cpp +++ b/scwx-qt/source/scwx/qt/map/overlay_layer.cpp @@ -204,8 +204,7 @@ void OverlayLayer::Initialize() }); } -void OverlayLayer::Render( - const QMapLibreGL::CustomLayerRenderParameters& params) +void OverlayLayer::Render(const QMapLibre::CustomLayerRenderParameters& params) { gl::OpenGLFunctions& gl = context()->gl(); auto radarProductView = context()->radar_product_view(); @@ -393,12 +392,12 @@ void OverlayLayer::Deinitialize() } bool OverlayLayer::RunMousePicking( - const QMapLibreGL::CustomLayerRenderParameters& params, - const QPointF& mouseLocalPos, - const QPointF& mouseGlobalPos, - const glm::vec2& mouseCoords, - const common::Coordinate& mouseGeoCoords, - std::shared_ptr& eventHandler) + const QMapLibre::CustomLayerRenderParameters& params, + const QPointF& mouseLocalPos, + const QPointF& mouseGlobalPos, + const glm::vec2& mouseCoords, + const common::Coordinate& mouseGeoCoords, + std::shared_ptr& eventHandler) { // If sweep time was picked, don't process additional items if (p->sweepTimePicked_) diff --git a/scwx-qt/source/scwx/qt/map/overlay_layer.hpp b/scwx-qt/source/scwx/qt/map/overlay_layer.hpp index a1ddae6f..411694b1 100644 --- a/scwx-qt/source/scwx/qt/map/overlay_layer.hpp +++ b/scwx-qt/source/scwx/qt/map/overlay_layer.hpp @@ -18,15 +18,15 @@ public: ~OverlayLayer(); void Initialize() override final; - void Render(const QMapLibreGL::CustomLayerRenderParameters&) override final; + void Render(const QMapLibre::CustomLayerRenderParameters&) override final; void Deinitialize() override final; bool RunMousePicking( - const QMapLibreGL::CustomLayerRenderParameters& params, - const QPointF& mouseLocalPos, - const QPointF& mouseGlobalPos, - const glm::vec2& mouseCoords, - const common::Coordinate& mouseGeoCoords, + const QMapLibre::CustomLayerRenderParameters& params, + const QPointF& mouseLocalPos, + const QPointF& mouseGlobalPos, + const glm::vec2& mouseCoords, + const common::Coordinate& mouseGeoCoords, std::shared_ptr& eventHandler) override final; public slots: diff --git a/scwx-qt/source/scwx/qt/map/overlay_product_layer.cpp b/scwx-qt/source/scwx/qt/map/overlay_product_layer.cpp index 3e5d09b6..c8312c7d 100644 --- a/scwx-qt/source/scwx/qt/map/overlay_product_layer.cpp +++ b/scwx-qt/source/scwx/qt/map/overlay_product_layer.cpp @@ -139,7 +139,7 @@ void OverlayProductLayer::Initialize() } void OverlayProductLayer::Render( - const QMapLibreGL::CustomLayerRenderParameters& params) + const QMapLibre::CustomLayerRenderParameters& params) { gl::OpenGLFunctions& gl = context()->gl(); @@ -436,12 +436,12 @@ std::string OverlayProductLayer::Impl::BuildHoverText( } bool OverlayProductLayer::RunMousePicking( - const QMapLibreGL::CustomLayerRenderParameters& params, - const QPointF& mouseLocalPos, - const QPointF& mouseGlobalPos, - const glm::vec2& mouseCoords, - const common::Coordinate& mouseGeoCoords, - std::shared_ptr& eventHandler) + const QMapLibre::CustomLayerRenderParameters& params, + const QPointF& mouseLocalPos, + const QPointF& mouseGlobalPos, + const glm::vec2& mouseCoords, + const common::Coordinate& mouseGeoCoords, + std::shared_ptr& eventHandler) { return DrawLayer::RunMousePicking(params, mouseLocalPos, diff --git a/scwx-qt/source/scwx/qt/map/overlay_product_layer.hpp b/scwx-qt/source/scwx/qt/map/overlay_product_layer.hpp index 0b550697..8f65c2d6 100644 --- a/scwx-qt/source/scwx/qt/map/overlay_product_layer.hpp +++ b/scwx-qt/source/scwx/qt/map/overlay_product_layer.hpp @@ -16,15 +16,15 @@ public: ~OverlayProductLayer(); void Initialize() override final; - void Render(const QMapLibreGL::CustomLayerRenderParameters&) override final; + void Render(const QMapLibre::CustomLayerRenderParameters&) override final; void Deinitialize() override final; bool RunMousePicking( - const QMapLibreGL::CustomLayerRenderParameters& params, - const QPointF& mouseLocalPos, - const QPointF& mouseGlobalPos, - const glm::vec2& mouseCoords, - const common::Coordinate& mouseGeoCoords, + const QMapLibre::CustomLayerRenderParameters& params, + const QPointF& mouseLocalPos, + const QPointF& mouseGlobalPos, + const glm::vec2& mouseCoords, + const common::Coordinate& mouseGeoCoords, std::shared_ptr& eventHandler) override final; private: diff --git a/scwx-qt/source/scwx/qt/map/placefile_layer.cpp b/scwx-qt/source/scwx/qt/map/placefile_layer.cpp index 3f6e5961..63eebff8 100644 --- a/scwx-qt/source/scwx/qt/map/placefile_layer.cpp +++ b/scwx-qt/source/scwx/qt/map/placefile_layer.cpp @@ -124,7 +124,7 @@ void PlacefileLayer::Initialize() } void PlacefileLayer::Render( - const QMapLibreGL::CustomLayerRenderParameters& params) + const QMapLibre::CustomLayerRenderParameters& params) { gl::OpenGLFunctions& gl = context()->gl(); diff --git a/scwx-qt/source/scwx/qt/map/placefile_layer.hpp b/scwx-qt/source/scwx/qt/map/placefile_layer.hpp index ec351510..981c3c12 100644 --- a/scwx-qt/source/scwx/qt/map/placefile_layer.hpp +++ b/scwx-qt/source/scwx/qt/map/placefile_layer.hpp @@ -25,7 +25,7 @@ public: void set_placefile_name(const std::string& placefileName); void Initialize() override final; - void Render(const QMapLibreGL::CustomLayerRenderParameters&) override final; + void Render(const QMapLibre::CustomLayerRenderParameters&) override final; void Deinitialize() override final; void ReloadData(); 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 c4b9e45d..07881e75 100644 --- a/scwx-qt/source/scwx/qt/map/radar_product_layer.cpp +++ b/scwx-qt/source/scwx/qt/map/radar_product_layer.cpp @@ -261,7 +261,7 @@ void RadarProductLayer::UpdateSweep() } void RadarProductLayer::Render( - const QMapLibreGL::CustomLayerRenderParameters& params) + const QMapLibre::CustomLayerRenderParameters& params) { gl::OpenGLFunctions& gl = context()->gl(); @@ -329,7 +329,7 @@ void RadarProductLayer::Deinitialize() } bool RadarProductLayer::RunMousePicking( - const QMapLibreGL::CustomLayerRenderParameters& /* params */, + const QMapLibre::CustomLayerRenderParameters& /* params */, const QPointF& /* mouseLocalPos */, const QPointF& mouseGlobalPos, const glm::vec2& /* mouseCoords */, 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 a081d842..1e53eba8 100644 --- a/scwx-qt/source/scwx/qt/map/radar_product_layer.hpp +++ b/scwx-qt/source/scwx/qt/map/radar_product_layer.hpp @@ -18,15 +18,15 @@ public: ~RadarProductLayer(); void Initialize() override final; - void Render(const QMapLibreGL::CustomLayerRenderParameters&) override final; + void Render(const QMapLibre::CustomLayerRenderParameters&) override final; void Deinitialize() override final; virtual bool - RunMousePicking(const QMapLibreGL::CustomLayerRenderParameters& params, - const QPointF& mouseLocalPos, - const QPointF& mouseGlobalPos, - const glm::vec2& mouseCoords, - const common::Coordinate& mouseGeoCoords, + RunMousePicking(const QMapLibre::CustomLayerRenderParameters& params, + const QPointF& mouseLocalPos, + const QPointF& mouseGlobalPos, + const glm::vec2& mouseCoords, + const common::Coordinate& mouseGeoCoords, std::shared_ptr& eventHandler) override; private: diff --git a/scwx-qt/source/scwx/qt/map/radar_range_layer.cpp b/scwx-qt/source/scwx/qt/map/radar_range_layer.cpp index a4738404..66ce5df7 100644 --- a/scwx-qt/source/scwx/qt/map/radar_range_layer.cpp +++ b/scwx-qt/source/scwx/qt/map/radar_range_layer.cpp @@ -15,13 +15,13 @@ namespace map static const std::string logPrefix_ = "scwx::qt::map::radar_range_layer"; static const auto logger_ = scwx::util::Logger::Create(logPrefix_); -static std::shared_ptr -GetRangeCircle(float range, QMapLibreGL::Coordinate center); +static std::shared_ptr +GetRangeCircle(float range, QMapLibre::Coordinate center); -void RadarRangeLayer::Add(std::shared_ptr map, - float range, - QMapLibreGL::Coordinate center, - const QString& before) +void RadarRangeLayer::Add(std::shared_ptr map, + float range, + QMapLibre::Coordinate center, + const QString& before) { static const QString layerId = QString::fromStdString(types::GetLayerName( types::LayerType::Data, types::DataLayer::RadarRange)); @@ -37,7 +37,7 @@ void RadarRangeLayer::Add(std::shared_ptr map, map->removeSource("rangeCircleSource"); } - std::shared_ptr rangeCircle = + std::shared_ptr rangeCircle = GetRangeCircle(range, center); map->addSource( @@ -49,19 +49,19 @@ void RadarRangeLayer::Add(std::shared_ptr map, map->setPaintProperty(layerId, "line-color", "rgba(128, 128, 128, 128)"); } -void RadarRangeLayer::Update(std::shared_ptr map, - float range, - QMapLibreGL::Coordinate center) +void RadarRangeLayer::Update(std::shared_ptr map, + float range, + QMapLibre::Coordinate center) { - std::shared_ptr rangeCircle = + std::shared_ptr rangeCircle = GetRangeCircle(range, center); map->updateSource("rangeCircleSource", {{"data", QVariant::fromValue(*rangeCircle)}}); } -static std::shared_ptr -GetRangeCircle(float range, QMapLibreGL::Coordinate center) +static std::shared_ptr +GetRangeCircle(float range, QMapLibre::Coordinate center) { const GeographicLib::Geodesic& geodesic( util::GeographicLib::DefaultGeodesic()); @@ -71,7 +71,7 @@ GetRangeCircle(float range, QMapLibreGL::Coordinate center) float angle = -angleDeltaH; - QMapLibreGL::Coordinates geometry; + QMapLibre::Coordinates geometry; for (uint16_t azimuth = 0; azimuth <= 720; ++azimuth) { @@ -90,11 +90,11 @@ GetRangeCircle(float range, QMapLibreGL::Coordinate center) angle += angleDelta; } - std::shared_ptr rangeCircle = - std::make_shared( - QMapLibreGL::Feature::LineStringType, - std::initializer_list { - std::initializer_list {geometry}}); + std::shared_ptr rangeCircle = + std::make_shared( + QMapLibre::Feature::LineStringType, + std::initializer_list { + std::initializer_list {geometry}}); return rangeCircle; } diff --git a/scwx-qt/source/scwx/qt/map/radar_range_layer.hpp b/scwx-qt/source/scwx/qt/map/radar_range_layer.hpp index b900a9d2..d900f01e 100644 --- a/scwx-qt/source/scwx/qt/map/radar_range_layer.hpp +++ b/scwx-qt/source/scwx/qt/map/radar_range_layer.hpp @@ -1,6 +1,6 @@ #pragma once -#include +#include namespace scwx { @@ -11,13 +11,13 @@ namespace map namespace RadarRangeLayer { -void Add(std::shared_ptr map, - float range, - QMapLibreGL::Coordinate center, - const QString& before = QString()); -void Update(std::shared_ptr map, - float range, - QMapLibreGL::Coordinate center); +void Add(std::shared_ptr map, + float range, + QMapLibre::Coordinate center, + const QString& before = QString()); +void Update(std::shared_ptr map, + float range, + QMapLibre::Coordinate center); } // namespace RadarRangeLayer } // namespace map diff --git a/scwx-qt/source/scwx/qt/map/radar_site_layer.cpp b/scwx-qt/source/scwx/qt/map/radar_site_layer.cpp index c7348615..33486185 100644 --- a/scwx-qt/source/scwx/qt/map/radar_site_layer.cpp +++ b/scwx-qt/source/scwx/qt/map/radar_site_layer.cpp @@ -6,7 +6,6 @@ #include #include -// #include #include #include @@ -26,7 +25,7 @@ public: explicit Impl(RadarSiteLayer* self) : self_ {self} {} ~Impl() = default; - void RenderRadarSite(const QMapLibreGL::CustomLayerRenderParameters& params, + void RenderRadarSite(const QMapLibre::CustomLayerRenderParameters& params, std::shared_ptr& radarSite); RadarSiteLayer* self_; @@ -58,7 +57,7 @@ void RadarSiteLayer::Initialize() } void RadarSiteLayer::Render( - const QMapLibreGL::CustomLayerRenderParameters& params) + const QMapLibre::CustomLayerRenderParameters& params) { gl::OpenGLFunctions& gl = context()->gl(); @@ -90,8 +89,8 @@ void RadarSiteLayer::Render( } void RadarSiteLayer::Impl::RenderRadarSite( - const QMapLibreGL::CustomLayerRenderParameters& params, - std::shared_ptr& radarSite) + const QMapLibre::CustomLayerRenderParameters& params, + std::shared_ptr& radarSite) { const std::string windowName = fmt::format("radar-site-{}", radarSite->id()); @@ -158,7 +157,7 @@ void RadarSiteLayer::Deinitialize() } bool RadarSiteLayer::RunMousePicking( - const QMapLibreGL::CustomLayerRenderParameters& /* params */, + const QMapLibre::CustomLayerRenderParameters& /* params */, const QPointF& /* mouseLocalPos */, const QPointF& mouseGlobalPos, const glm::vec2& /* mouseCoords */, diff --git a/scwx-qt/source/scwx/qt/map/radar_site_layer.hpp b/scwx-qt/source/scwx/qt/map/radar_site_layer.hpp index 6cd75f42..f88786f4 100644 --- a/scwx-qt/source/scwx/qt/map/radar_site_layer.hpp +++ b/scwx-qt/source/scwx/qt/map/radar_site_layer.hpp @@ -19,15 +19,15 @@ public: ~RadarSiteLayer(); void Initialize() override final; - void Render(const QMapLibreGL::CustomLayerRenderParameters&) override final; + void Render(const QMapLibre::CustomLayerRenderParameters&) override final; void Deinitialize() override final; bool RunMousePicking( - const QMapLibreGL::CustomLayerRenderParameters& params, - const QPointF& mouseLocalPos, - const QPointF& mouseGlobalPos, - const glm::vec2& mouseCoords, - const common::Coordinate& mouseGeoCoords, + const QMapLibre::CustomLayerRenderParameters& params, + const QPointF& mouseLocalPos, + const QPointF& mouseGlobalPos, + const glm::vec2& mouseCoords, + const common::Coordinate& mouseGeoCoords, std::shared_ptr& eventHandler) override final; signals: diff --git a/scwx-qt/source/scwx/qt/util/maplibre.cpp b/scwx-qt/source/scwx/qt/util/maplibre.cpp index 9cc092bb..7a7b9c00 100644 --- a/scwx-qt/source/scwx/qt/util/maplibre.cpp +++ b/scwx-qt/source/scwx/qt/util/maplibre.cpp @@ -1,6 +1,6 @@ #include -#include +#include #include namespace scwx @@ -13,14 +13,14 @@ namespace maplibre { units::length::meters -GetMapDistance(const QMapLibreGL::CustomLayerRenderParameters& params) +GetMapDistance(const QMapLibre::CustomLayerRenderParameters& params) { return units::length::meters( - QMapLibreGL::metersPerPixelAtLatitude(params.latitude, params.zoom) * + QMapLibre::metersPerPixelAtLatitude(params.latitude, params.zoom) * (params.width + params.height) / 2.0); } -glm::mat4 GetMapMatrix(const QMapLibreGL::CustomLayerRenderParameters& params) +glm::mat4 GetMapMatrix(const QMapLibre::CustomLayerRenderParameters& params) { glm::vec2 scale = GetMapScale(params); @@ -33,7 +33,7 @@ glm::mat4 GetMapMatrix(const QMapLibreGL::CustomLayerRenderParameters& params) return mapMatrix; } -glm::vec2 GetMapScale(const QMapLibreGL::CustomLayerRenderParameters& params) +glm::vec2 GetMapScale(const QMapLibre::CustomLayerRenderParameters& params) { const float scale = std::pow(2.0, params.zoom) * 2.0f * mbgl::util::tileSize_D / mbgl::util::DEGREES_MAX; @@ -73,7 +73,7 @@ bool IsPointInPolygon(const std::vector& vertices, return inPolygon; } -glm::vec2 LatLongToScreenCoordinate(const QMapLibreGL::Coordinate& coordinate) +glm::vec2 LatLongToScreenCoordinate(const QMapLibre::Coordinate& coordinate) { static constexpr double RAD2DEG_D = 180.0 / M_PI; diff --git a/scwx-qt/source/scwx/qt/util/maplibre.hpp b/scwx-qt/source/scwx/qt/util/maplibre.hpp index 35989cbf..62fb9cb2 100644 --- a/scwx-qt/source/scwx/qt/util/maplibre.hpp +++ b/scwx-qt/source/scwx/qt/util/maplibre.hpp @@ -1,6 +1,6 @@ #pragma once -#include +#include #include #include @@ -14,9 +14,9 @@ namespace maplibre { units::length::meters -GetMapDistance(const QMapLibreGL::CustomLayerRenderParameters& params); -glm::mat4 GetMapMatrix(const QMapLibreGL::CustomLayerRenderParameters& params); -glm::vec2 GetMapScale(const QMapLibreGL::CustomLayerRenderParameters& params); + GetMapDistance(const QMapLibre::CustomLayerRenderParameters& params); +glm::mat4 GetMapMatrix(const QMapLibre::CustomLayerRenderParameters& params); +glm::vec2 GetMapScale(const QMapLibre::CustomLayerRenderParameters& params); /** * @brief Determine whether a point lies within a polygon @@ -29,7 +29,7 @@ glm::vec2 GetMapScale(const QMapLibreGL::CustomLayerRenderParameters& params); bool IsPointInPolygon(const std::vector& vertices, const glm::vec2& point); -glm::vec2 LatLongToScreenCoordinate(const QMapLibreGL::Coordinate& coordinate); +glm::vec2 LatLongToScreenCoordinate(const QMapLibre::Coordinate& coordinate); } // namespace maplibre } // namespace util