#pragma once #include #include #include #include #include #include #include #include #include class QKeyEvent; class QMouseEvent; class QWheelEvent; namespace scwx { namespace qt { namespace map { class MapWidgetImpl; class MapWidget : public QOpenGLWidget { Q_OBJECT public: explicit MapWidget(const QMapboxGLSettings&); ~MapWidget(); common::Level3ProductCategoryMap GetAvailableLevel3Categories(); float GetElevation() const; std::vector GetElevationCuts() const; std::vector GetLevel3Products(); common::RadarProductGroup GetRadarProductGroup() const; std::string GetRadarProductName() const; std::shared_ptr GetRadarSite() const; uint16_t GetVcp() const; void SelectElevation(float elevation); void SelectRadarProduct(common::RadarProductGroup group, const std::string& product, int16_t productCode); void SelectRadarProduct(std::shared_ptr record); void SetActive(bool isActive); void SetAutoRefresh(bool enabled); void SetMapParameters(double latitude, double longitude, double zoom, double bearing, double pitch); private: void changeStyle(); qreal pixelRatio(); // QWidget implementation. void keyPressEvent(QKeyEvent* ev) override final; void mousePressEvent(QMouseEvent* ev) override final; void mouseMoveEvent(QMouseEvent* ev) override final; void wheelEvent(QWheelEvent* ev) override final; // QOpenGLWidget implementation. void initializeGL() override final; void paintGL() override final; void AddLayers(); std::unique_ptr p; friend class MapWidgetImpl; private slots: void mapChanged(QMapboxGL::MapChange); signals: void Level3ProductsChanged(); void MapParametersChanged(double latitude, double longitude, double zoom, double bearing, double pitch); void RadarSweepUpdated(); }; } // namespace map } // namespace qt } // namespace scwx