mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-30 23:30:04 +00:00 
			
		
		
		
	Render placefile triangles
This commit is contained in:
		
							parent
							
								
									0421435e97
								
							
						
					
					
						commit
						26a326b450
					
				
					 4 changed files with 388 additions and 5 deletions
				
			
		|  | @ -2,6 +2,7 @@ | |||
| #include <scwx/qt/gl/draw/placefile_icons.hpp> | ||||
| #include <scwx/qt/gl/draw/placefile_lines.hpp> | ||||
| #include <scwx/qt/gl/draw/placefile_polygons.hpp> | ||||
| #include <scwx/qt/gl/draw/placefile_triangles.hpp> | ||||
| #include <scwx/qt/gl/draw/placefile_text.hpp> | ||||
| #include <scwx/qt/manager/placefile_manager.hpp> | ||||
| #include <scwx/util/logger.hpp> | ||||
|  | @ -31,6 +32,8 @@ public: | |||
|        placefileLines_ {std::make_shared<gl::draw::PlacefileLines>(context)}, | ||||
|        placefilePolygons_ { | ||||
|           std::make_shared<gl::draw::PlacefilePolygons>(context)}, | ||||
|        placefileTriangles_ { | ||||
|           std::make_shared<gl::draw::PlacefileTriangles>(context)}, | ||||
|        placefileText_ { | ||||
|           std::make_shared<gl::draw::PlacefileText>(context, placefileName)} | ||||
|    { | ||||
|  | @ -47,10 +50,11 @@ public: | |||
|    std::string placefileName_; | ||||
|    std::mutex  dataMutex_ {}; | ||||
| 
 | ||||
|    std::shared_ptr<gl::draw::PlacefileIcons>    placefileIcons_; | ||||
|    std::shared_ptr<gl::draw::PlacefileLines>    placefileLines_; | ||||
|    std::shared_ptr<gl::draw::PlacefilePolygons> placefilePolygons_; | ||||
|    std::shared_ptr<gl::draw::PlacefileText>     placefileText_; | ||||
|    std::shared_ptr<gl::draw::PlacefileIcons>     placefileIcons_; | ||||
|    std::shared_ptr<gl::draw::PlacefileLines>     placefileLines_; | ||||
|    std::shared_ptr<gl::draw::PlacefilePolygons>  placefilePolygons_; | ||||
|    std::shared_ptr<gl::draw::PlacefileTriangles> placefileTriangles_; | ||||
|    std::shared_ptr<gl::draw::PlacefileText>      placefileText_; | ||||
| }; | ||||
| 
 | ||||
| PlacefileLayer::PlacefileLayer(const std::shared_ptr<MapContext>& context, | ||||
|  | @ -59,8 +63,9 @@ PlacefileLayer::PlacefileLayer(const std::shared_ptr<MapContext>& context, | |||
|     p(std::make_unique<PlacefileLayer::Impl>(this, context, placefileName)) | ||||
| { | ||||
|    AddDrawItem(p->placefileIcons_); | ||||
|    AddDrawItem(p->placefileLines_); | ||||
|    AddDrawItem(p->placefilePolygons_); | ||||
|    AddDrawItem(p->placefileTriangles_); | ||||
|    AddDrawItem(p->placefileLines_); | ||||
|    AddDrawItem(p->placefileText_); | ||||
| 
 | ||||
|    ReloadData(); | ||||
|  | @ -125,6 +130,7 @@ void PlacefileLayer::Render( | |||
|       p->placefileIcons_->set_thresholded(thresholded); | ||||
|       p->placefileLines_->set_thresholded(thresholded); | ||||
|       p->placefilePolygons_->set_thresholded(thresholded); | ||||
|       p->placefileTriangles_->set_thresholded(thresholded); | ||||
|       p->placefileText_->set_thresholded(thresholded); | ||||
|    } | ||||
| 
 | ||||
|  | @ -163,6 +169,7 @@ void PlacefileLayer::ReloadData() | |||
|          p->placefileIcons_->StartIcons(); | ||||
|          p->placefileLines_->StartLines(); | ||||
|          p->placefilePolygons_->StartPolygons(); | ||||
|          p->placefileTriangles_->StartTriangles(); | ||||
|          p->placefileText_->StartText(); | ||||
| 
 | ||||
|          p->placefileIcons_->SetIconFiles(placefile->icon_files(), | ||||
|  | @ -196,6 +203,12 @@ void PlacefileLayer::ReloadData() | |||
|                      drawItem)); | ||||
|                break; | ||||
| 
 | ||||
|             case gr::Placefile::ItemType::Triangles: | ||||
|                p->placefileTriangles_->AddTriangles( | ||||
|                   std::static_pointer_cast<gr::Placefile::TrianglesDrawItem>( | ||||
|                      drawItem)); | ||||
|                break; | ||||
| 
 | ||||
|             default: | ||||
|                break; | ||||
|             } | ||||
|  | @ -205,6 +218,7 @@ void PlacefileLayer::ReloadData() | |||
|          p->placefileIcons_->FinishIcons(); | ||||
|          p->placefileLines_->FinishLines(); | ||||
|          p->placefilePolygons_->FinishPolygons(); | ||||
|          p->placefileTriangles_->FinishTriangles(); | ||||
|          p->placefileText_->FinishText(); | ||||
| 
 | ||||
|          Q_EMIT DataReloaded(); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat