mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 15:50:05 +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_settings.hpp> | ||||
| #include <scwx/qt/view/overlay_product_view.hpp> | ||||
| #include <scwx/qt/view/radar_product_view.hpp> | ||||
| 
 | ||||
| namespace scwx | ||||
|  | @ -13,26 +14,23 @@ class MapContext::Impl | |||
| { | ||||
| public: | ||||
|    explicit Impl(std::shared_ptr<view::RadarProductView> radarProductView) : | ||||
|        map_ {}, | ||||
|        settings_ {}, | ||||
|        pixelRatio_ {1.0f}, | ||||
|        radarProductView_ {radarProductView}, | ||||
|        radarProductGroup_ {common::RadarProductGroup::Unknown}, | ||||
|        radarProduct_ {"???"}, | ||||
|        radarProductCode_ {0} | ||||
|        radarProductView_ {radarProductView} | ||||
|    { | ||||
|    } | ||||
| 
 | ||||
|    ~Impl() {} | ||||
| 
 | ||||
|    std::weak_ptr<QMapLibreGL::Map>          map_; | ||||
|    MapSettings                              settings_; | ||||
|    float                                    pixelRatio_; | ||||
|    std::shared_ptr<view::RadarProductView>  radarProductView_; | ||||
|    common::RadarProductGroup                radarProductGroup_; | ||||
|    std::string                              radarProduct_; | ||||
|    int16_t                                  radarProductCode_; | ||||
|    std::weak_ptr<QMapLibreGL::Map> map_ {}; | ||||
|    MapSettings                     settings_ {}; | ||||
|    float                           pixelRatio_ {1.0f}; | ||||
|    common::RadarProductGroup       radarProductGroup_ { | ||||
|       common::RadarProductGroup::Unknown}; | ||||
|    std::string                              radarProduct_ {"???"}; | ||||
|    int16_t                                  radarProductCode_ {0}; | ||||
|    QMapLibreGL::CustomLayerRenderParameters renderParameters_ {}; | ||||
| 
 | ||||
|    std::shared_ptr<view::OverlayProductView> overlayProductView_ {nullptr}; | ||||
|    std::shared_ptr<view::RadarProductView>   radarProductView_; | ||||
| }; | ||||
| 
 | ||||
| MapContext::MapContext( | ||||
|  | @ -60,6 +58,12 @@ float MapContext::pixel_ratio() const | |||
|    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 | ||||
| { | ||||
|    return p->radarProductView_; | ||||
|  | @ -85,18 +89,24 @@ QMapLibreGL::CustomLayerRenderParameters MapContext::render_parameters() const | |||
|    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; | ||||
| } | ||||
| 
 | ||||
| void MapContext::set_overlay_product_view( | ||||
|    const std::shared_ptr<view::OverlayProductView>& overlayProductView) | ||||
| { | ||||
|    p->overlayProductView_ = overlayProductView; | ||||
| } | ||||
| 
 | ||||
| void MapContext::set_pixel_ratio(float pixelRatio) | ||||
| { | ||||
|    p->pixelRatio_ = pixelRatio; | ||||
| } | ||||
| 
 | ||||
| void MapContext::set_radar_product_view( | ||||
|    std::shared_ptr<view::RadarProductView> radarProductView) | ||||
|    const std::shared_ptr<view::RadarProductView>& radarProductView) | ||||
| { | ||||
|    p->radarProductView_ = radarProductView; | ||||
| } | ||||
|  |  | |||
|  | @ -12,6 +12,7 @@ namespace qt | |||
| namespace view | ||||
| { | ||||
| 
 | ||||
| class OverlayProductView; | ||||
| class RadarProductView; | ||||
| 
 | ||||
| } // namespace view
 | ||||
|  | @ -34,19 +35,22 @@ public: | |||
|    MapContext(MapContext&&) noexcept; | ||||
|    MapContext& operator=(MapContext&&) noexcept; | ||||
| 
 | ||||
|    std::weak_ptr<QMapLibreGL::Map>          map() const; | ||||
|    MapSettings&                             settings(); | ||||
|    float                                    pixel_ratio() const; | ||||
|    std::shared_ptr<view::RadarProductView>  radar_product_view() const; | ||||
|    common::RadarProductGroup                radar_product_group() const; | ||||
|    std::string                              radar_product() const; | ||||
|    int16_t                                  radar_product_code() const; | ||||
|    QMapLibreGL::CustomLayerRenderParameters render_parameters() const; | ||||
|    std::weak_ptr<QMapLibreGL::Map>           map() const; | ||||
|    MapSettings&                              settings(); | ||||
|    float                                     pixel_ratio() const; | ||||
|    std::shared_ptr<view::OverlayProductView> overlay_product_view() const; | ||||
|    std::shared_ptr<view::RadarProductView>   radar_product_view() const; | ||||
|    common::RadarProductGroup                 radar_product_group() const; | ||||
|    std::string                               radar_product() 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_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(const std::string& radarProduct); | ||||
|    void set_radar_product_code(int16_t radarProductCode); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat