mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 02:40:05 +00:00 
			
		
		
		
	Refactor placefile text into its own draw item
This commit is contained in:
		
							parent
							
								
									d6f8a339fc
								
							
						
					
					
						commit
						a4027ba120
					
				
					 4 changed files with 321 additions and 132 deletions
				
			
		
							
								
								
									
										57
									
								
								scwx-qt/source/scwx/qt/gl/draw/placefile_text.hpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										57
									
								
								scwx-qt/source/scwx/qt/gl/draw/placefile_text.hpp
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,57 @@ | |||
| #pragma once | ||||
| 
 | ||||
| #include <scwx/qt/gl/gl_context.hpp> | ||||
| #include <scwx/qt/gl/draw/draw_item.hpp> | ||||
| #include <scwx/gr/placefile.hpp> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
| namespace qt | ||||
| { | ||||
| namespace gl | ||||
| { | ||||
| namespace draw | ||||
| { | ||||
| 
 | ||||
| class PlacefileText : public DrawItem | ||||
| { | ||||
| public: | ||||
|    explicit PlacefileText(std::shared_ptr<GlContext> context, | ||||
|                           const std::string&         placefileName); | ||||
|    ~PlacefileText(); | ||||
| 
 | ||||
|    PlacefileText(const PlacefileText&)            = delete; | ||||
|    PlacefileText& operator=(const PlacefileText&) = delete; | ||||
| 
 | ||||
|    PlacefileText(PlacefileText&&) noexcept; | ||||
|    PlacefileText& operator=(PlacefileText&&) noexcept; | ||||
| 
 | ||||
|    void set_placefile_name(const std::string& placefileName); | ||||
|    void set_thresholded(bool thresholded); | ||||
| 
 | ||||
|    void Initialize() override; | ||||
|    void Render(const QMapLibreGL::CustomLayerRenderParameters& params) override; | ||||
|    void Deinitialize() override; | ||||
| 
 | ||||
|    /**
 | ||||
|     * Adds placefile text to the internal draw list. | ||||
|     * | ||||
|     * @param [in] di Placefile icon | ||||
|     */ | ||||
|    void AddText(const std::shared_ptr<gr::Placefile::TextDrawItem>& di); | ||||
| 
 | ||||
|    /**
 | ||||
|     * Resets the list of text in preparation for rendering a new frame. | ||||
|     */ | ||||
|    void Reset(); | ||||
| 
 | ||||
| private: | ||||
|    class Impl; | ||||
| 
 | ||||
|    std::unique_ptr<Impl> p; | ||||
| }; | ||||
| 
 | ||||
| } // namespace draw
 | ||||
| } // namespace gl
 | ||||
| } // namespace qt
 | ||||
| } // namespace scwx
 | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat