mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 09:40:04 +00:00 
			
		
		
		
	Include OverlayProductView in MapContext
This commit is contained in:
		
							parent
							
								
									b800efd45a
								
							
						
					
					
						commit
						fb06ce7505
					
				
					 2 changed files with 40 additions and 26 deletions
				
			
		|  | @ -1,5 +1,6 @@ | ||||||
| #include <scwx/qt/map/map_context.hpp> | #include <scwx/qt/map/map_context.hpp> | ||||||
| #include <scwx/qt/map/map_settings.hpp> | #include <scwx/qt/map/map_settings.hpp> | ||||||
|  | #include <scwx/qt/view/overlay_product_view.hpp> | ||||||
| #include <scwx/qt/view/radar_product_view.hpp> | #include <scwx/qt/view/radar_product_view.hpp> | ||||||
| 
 | 
 | ||||||
| namespace scwx | namespace scwx | ||||||
|  | @ -13,26 +14,23 @@ class MapContext::Impl | ||||||
| { | { | ||||||
| public: | public: | ||||||
|    explicit Impl(std::shared_ptr<view::RadarProductView> radarProductView) : |    explicit Impl(std::shared_ptr<view::RadarProductView> radarProductView) : | ||||||
|        map_ {}, |        radarProductView_ {radarProductView} | ||||||
|        settings_ {}, |  | ||||||
|        pixelRatio_ {1.0f}, |  | ||||||
|        radarProductView_ {radarProductView}, |  | ||||||
|        radarProductGroup_ {common::RadarProductGroup::Unknown}, |  | ||||||
|        radarProduct_ {"???"}, |  | ||||||
|        radarProductCode_ {0} |  | ||||||
|    { |    { | ||||||
|    } |    } | ||||||
| 
 | 
 | ||||||
|    ~Impl() {} |    ~Impl() {} | ||||||
| 
 | 
 | ||||||
|    std::weak_ptr<QMapLibreGL::Map>          map_; |    std::weak_ptr<QMapLibreGL::Map> map_ {}; | ||||||
|    MapSettings                              settings_; |    MapSettings                     settings_ {}; | ||||||
|    float                                    pixelRatio_; |    float                           pixelRatio_ {1.0f}; | ||||||
|    std::shared_ptr<view::RadarProductView>  radarProductView_; |    common::RadarProductGroup       radarProductGroup_ { | ||||||
|    common::RadarProductGroup                radarProductGroup_; |       common::RadarProductGroup::Unknown}; | ||||||
|    std::string                              radarProduct_; |    std::string                              radarProduct_ {"???"}; | ||||||
|    int16_t                                  radarProductCode_; |    int16_t                                  radarProductCode_ {0}; | ||||||
|    QMapLibreGL::CustomLayerRenderParameters renderParameters_ {}; |    QMapLibreGL::CustomLayerRenderParameters renderParameters_ {}; | ||||||
|  | 
 | ||||||
|  |    std::shared_ptr<view::OverlayProductView> overlayProductView_ {nullptr}; | ||||||
|  |    std::shared_ptr<view::RadarProductView>   radarProductView_; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| MapContext::MapContext( | MapContext::MapContext( | ||||||
|  | @ -60,6 +58,12 @@ float MapContext::pixel_ratio() const | ||||||
|    return p->pixelRatio_; |    return p->pixelRatio_; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | std::shared_ptr<view::OverlayProductView> | ||||||
|  | MapContext::overlay_product_view() const | ||||||
|  | { | ||||||
|  |    return p->overlayProductView_; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| std::shared_ptr<view::RadarProductView> MapContext::radar_product_view() const | std::shared_ptr<view::RadarProductView> MapContext::radar_product_view() const | ||||||
| { | { | ||||||
|    return p->radarProductView_; |    return p->radarProductView_; | ||||||
|  | @ -85,18 +89,24 @@ QMapLibreGL::CustomLayerRenderParameters MapContext::render_parameters() const | ||||||
|    return p->renderParameters_; |    return p->renderParameters_; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void MapContext::set_map(std::shared_ptr<QMapLibreGL::Map> map) | void MapContext::set_map(const std::shared_ptr<QMapLibreGL::Map>& map) | ||||||
| { | { | ||||||
|    p->map_ = map; |    p->map_ = map; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | void MapContext::set_overlay_product_view( | ||||||
|  |    const std::shared_ptr<view::OverlayProductView>& overlayProductView) | ||||||
|  | { | ||||||
|  |    p->overlayProductView_ = overlayProductView; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| void MapContext::set_pixel_ratio(float pixelRatio) | void MapContext::set_pixel_ratio(float pixelRatio) | ||||||
| { | { | ||||||
|    p->pixelRatio_ = pixelRatio; |    p->pixelRatio_ = pixelRatio; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void MapContext::set_radar_product_view( | void MapContext::set_radar_product_view( | ||||||
|    std::shared_ptr<view::RadarProductView> radarProductView) |    const std::shared_ptr<view::RadarProductView>& radarProductView) | ||||||
| { | { | ||||||
|    p->radarProductView_ = radarProductView; |    p->radarProductView_ = radarProductView; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -12,6 +12,7 @@ namespace qt | ||||||
| namespace view | namespace view | ||||||
| { | { | ||||||
| 
 | 
 | ||||||
|  | class OverlayProductView; | ||||||
| class RadarProductView; | class RadarProductView; | ||||||
| 
 | 
 | ||||||
| } // namespace view
 | } // namespace view
 | ||||||
|  | @ -34,19 +35,22 @@ public: | ||||||
|    MapContext(MapContext&&) noexcept; |    MapContext(MapContext&&) noexcept; | ||||||
|    MapContext& operator=(MapContext&&) noexcept; |    MapContext& operator=(MapContext&&) noexcept; | ||||||
| 
 | 
 | ||||||
|    std::weak_ptr<QMapLibreGL::Map>          map() const; |    std::weak_ptr<QMapLibreGL::Map>           map() const; | ||||||
|    MapSettings&                             settings(); |    MapSettings&                              settings(); | ||||||
|    float                                    pixel_ratio() const; |    float                                     pixel_ratio() const; | ||||||
|    std::shared_ptr<view::RadarProductView>  radar_product_view() const; |    std::shared_ptr<view::OverlayProductView> overlay_product_view() const; | ||||||
|    common::RadarProductGroup                radar_product_group() const; |    std::shared_ptr<view::RadarProductView>   radar_product_view() const; | ||||||
|    std::string                              radar_product() const; |    common::RadarProductGroup                 radar_product_group() const; | ||||||
|    int16_t                                  radar_product_code() const; |    std::string                               radar_product() const; | ||||||
|    QMapLibreGL::CustomLayerRenderParameters render_parameters() const; |    int16_t                                   radar_product_code() const; | ||||||
|  |    QMapLibreGL::CustomLayerRenderParameters  render_parameters() const; | ||||||
| 
 | 
 | ||||||
|    void set_map(std::shared_ptr<QMapLibreGL::Map> map); |    void set_map(const std::shared_ptr<QMapLibreGL::Map>& map); | ||||||
|  |    void set_overlay_product_view( | ||||||
|  |       const std::shared_ptr<view::OverlayProductView>& overlayProductView); | ||||||
|    void set_pixel_ratio(float pixelRatio); |    void set_pixel_ratio(float pixelRatio); | ||||||
|    void set_radar_product_view( |    void set_radar_product_view( | ||||||
|       std::shared_ptr<view::RadarProductView> radarProductView); |       const std::shared_ptr<view::RadarProductView>& radarProductView); | ||||||
|    void set_radar_product_group(common::RadarProductGroup radarProductGroup); |    void set_radar_product_group(common::RadarProductGroup radarProductGroup); | ||||||
|    void set_radar_product(const std::string& radarProduct); |    void set_radar_product(const std::string& radarProduct); | ||||||
|    void set_radar_product_code(int16_t radarProductCode); |    void set_radar_product_code(int16_t radarProductCode); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat