mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 15:40:06 +00:00 
			
		
		
		
	Use information available during DoMousePicking instead of params from
last render in MapWidget
This commit is contained in:
		
							parent
							
								
									4038fb2c43
								
							
						
					
					
						commit
						36e8690ad1
					
				
					 6 changed files with 9 additions and 22 deletions
				
			
		|  | @ -48,7 +48,6 @@ void DrawLayer::Render(const QMapLibre::CustomLayerRenderParameters& params) | ||||||
| { | { | ||||||
|    gl::OpenGLFunctions& gl = p->context_->gl(); |    gl::OpenGLFunctions& gl = p->context_->gl(); | ||||||
|    p->textureAtlas_        = p->context_->GetTextureAtlas(); |    p->textureAtlas_        = p->context_->GetTextureAtlas(); | ||||||
|    p->context_->set_render_parameters(params); |  | ||||||
| 
 | 
 | ||||||
|    // Determine if the texture atlas changed since last render
 |    // Determine if the texture atlas changed since last render
 | ||||||
|    std::uint64_t newTextureAtlasBuildCount = |    std::uint64_t newTextureAtlasBuildCount = | ||||||
|  |  | ||||||
|  | @ -27,7 +27,6 @@ public: | ||||||
|       common::RadarProductGroup::Unknown}; |       common::RadarProductGroup::Unknown}; | ||||||
|    std::string                            radarProduct_ {"???"}; |    std::string                            radarProduct_ {"???"}; | ||||||
|    int16_t                                radarProductCode_ {0}; |    int16_t                                radarProductCode_ {0}; | ||||||
|    QMapLibre::CustomLayerRenderParameters renderParameters_ {}; |  | ||||||
| 
 | 
 | ||||||
|    MapProvider mapProvider_ {MapProvider::Unknown}; |    MapProvider mapProvider_ {MapProvider::Unknown}; | ||||||
|    std::string mapCopyrights_ {}; |    std::string mapCopyrights_ {}; | ||||||
|  | @ -110,11 +109,6 @@ int16_t MapContext::radar_product_code() const | ||||||
|    return p->radarProductCode_; |    return p->radarProductCode_; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| QMapLibre::CustomLayerRenderParameters MapContext::render_parameters() const |  | ||||||
| { |  | ||||||
|    return p->renderParameters_; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| void MapContext::set_map(const std::shared_ptr<QMapLibre::Map>& map) | void MapContext::set_map(const std::shared_ptr<QMapLibre::Map>& map) | ||||||
| { | { | ||||||
|    p->map_ = map; |    p->map_ = map; | ||||||
|  | @ -173,12 +167,6 @@ void MapContext::set_radar_product_code(int16_t radarProductCode) | ||||||
|    p->radarProductCode_ = radarProductCode; |    p->radarProductCode_ = radarProductCode; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void MapContext::set_render_parameters( |  | ||||||
|    const QMapLibre::CustomLayerRenderParameters& params) |  | ||||||
| { |  | ||||||
|    p->renderParameters_ = params; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| } // namespace map
 | } // namespace map
 | ||||||
| } // namespace qt
 | } // namespace qt
 | ||||||
| } // namespace scwx
 | } // namespace scwx
 | ||||||
|  |  | ||||||
|  | @ -50,7 +50,6 @@ public: | ||||||
|    common::RadarProductGroup                 radar_product_group() const; |    common::RadarProductGroup                 radar_product_group() const; | ||||||
|    std::string                               radar_product() const; |    std::string                               radar_product() const; | ||||||
|    int16_t                                   radar_product_code() const; |    int16_t                                   radar_product_code() const; | ||||||
|    QMapLibre::CustomLayerRenderParameters    render_parameters() const; |  | ||||||
| 
 | 
 | ||||||
|    void set_map(const std::shared_ptr<QMapLibre::Map>& map); |    void set_map(const std::shared_ptr<QMapLibre::Map>& map); | ||||||
|    void set_map_copyrights(const std::string& copyrights); |    void set_map_copyrights(const std::string& copyrights); | ||||||
|  | @ -65,8 +64,6 @@ public: | ||||||
|    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); | ||||||
|    void |  | ||||||
|    set_render_parameters(const QMapLibre::CustomLayerRenderParameters& params); |  | ||||||
| 
 | 
 | ||||||
| private: | private: | ||||||
|    class Impl; |    class Impl; | ||||||
|  |  | ||||||
|  | @ -1649,8 +1649,15 @@ void MapWidgetImpl::ImGuiCheckFonts() | ||||||
| 
 | 
 | ||||||
| void MapWidgetImpl::RunMousePicking() | void MapWidgetImpl::RunMousePicking() | ||||||
| { | { | ||||||
|    const QMapLibre::CustomLayerRenderParameters params = |    const QMapLibre::CustomLayerRenderParameters params = { | ||||||
|       context_->render_parameters(); |       .width       = static_cast<double>(widget_->size().width()), | ||||||
|  |       .height      = static_cast<double>(widget_->size().height()), | ||||||
|  |       .latitude    = map_->coordinate().first, | ||||||
|  |       .longitude   = map_->coordinate().second, | ||||||
|  |       .zoom        = map_->zoom(), | ||||||
|  |       .bearing     = map_->bearing(), | ||||||
|  |       .pitch       = map_->pitch(), | ||||||
|  |       .fieldOfView = 0}; | ||||||
| 
 | 
 | ||||||
|    auto coordinate = map_->coordinateForPixel(lastPos_); |    auto coordinate = map_->coordinateForPixel(lastPos_); | ||||||
|    auto mouseScreenCoordinate = |    auto mouseScreenCoordinate = | ||||||
|  |  | ||||||
|  | @ -292,8 +292,6 @@ void OverlayLayer::Render(const QMapLibre::CustomLayerRenderParameters& params) | ||||||
|    auto&                settings         = context()->settings(); |    auto&                settings         = context()->settings(); | ||||||
|    const float          pixelRatio       = context()->pixel_ratio(); |    const float          pixelRatio       = context()->pixel_ratio(); | ||||||
| 
 | 
 | ||||||
|    context()->set_render_parameters(params); |  | ||||||
| 
 |  | ||||||
|    p->sweepTimePicked_ = false; |    p->sweepTimePicked_ = false; | ||||||
| 
 | 
 | ||||||
|    if (radarProductView != nullptr) |    if (radarProductView != nullptr) | ||||||
|  |  | ||||||
|  | @ -74,8 +74,6 @@ void RadarSiteLayer::Render( | ||||||
| 
 | 
 | ||||||
|    gl::OpenGLFunctions& gl = context()->gl(); |    gl::OpenGLFunctions& gl = context()->gl(); | ||||||
| 
 | 
 | ||||||
|    context()->set_render_parameters(params); |  | ||||||
| 
 |  | ||||||
|    // Update map screen coordinate and scale information
 |    // Update map screen coordinate and scale information
 | ||||||
|    p->mapScreenCoordLocation_ = util::maplibre::LatLongToScreenCoordinate( |    p->mapScreenCoordLocation_ = util::maplibre::LatLongToScreenCoordinate( | ||||||
|       {params.latitude, params.longitude}); |       {params.latitude, params.longitude}); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 AdenKoperczak
						AdenKoperczak