mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 05:20:06 +00:00 
			
		
		
		
	Fix usage of vertexRadials in ComputeSweep
This commit is contained in:
		
							parent
							
								
									fe4a324a04
								
							
						
					
					
						commit
						41c1125388
					
				
					 1 changed files with 19 additions and 12 deletions
				
			
		|  | @ -539,8 +539,8 @@ void Level2ProductView::ComputeSweep() | ||||||
|       return; |       return; | ||||||
|    } |    } | ||||||
| 
 | 
 | ||||||
|    const std::size_t radials       = radarData->crbegin()->first + 1; |    std::size_t radials       = radarData->crbegin()->first + 1; | ||||||
|    std::size_t       vertexRadials = radials; |    std::size_t vertexRadials = radials; | ||||||
| 
 | 
 | ||||||
|    // When there is missing data, insert another empty vertex radial at the end
 |    // When there is missing data, insert another empty vertex radial at the end
 | ||||||
|    // to avoid stretching
 |    // to avoid stretching
 | ||||||
|  | @ -551,6 +551,11 @@ void Level2ProductView::ComputeSweep() | ||||||
|       ++vertexRadials; |       ++vertexRadials; | ||||||
|    } |    } | ||||||
| 
 | 
 | ||||||
|  |    // Limit radials
 | ||||||
|  |    radials = std::min<std::size_t>(radials, common::MAX_0_5_DEGREE_RADIALS); | ||||||
|  |    vertexRadials = | ||||||
|  |       std::min<std::size_t>(vertexRadials, common::MAX_0_5_DEGREE_RADIALS); | ||||||
|  | 
 | ||||||
|    p->ComputeCoordinates(radarData); |    p->ComputeCoordinates(radarData); | ||||||
| 
 | 
 | ||||||
|    const std::vector<float>& coordinates = p->coordinates_; |    const std::vector<float>& coordinates = p->coordinates_; | ||||||
|  | @ -735,15 +740,16 @@ void Level2ProductView::ComputeSweep() | ||||||
|          { |          { | ||||||
|             const std::uint16_t baseCoord = gate - 1; |             const std::uint16_t baseCoord = gate - 1; | ||||||
| 
 | 
 | ||||||
|             std::size_t offset1 = ((startRadial + radial) % radials * |             std::size_t offset1 = ((startRadial + radial) % vertexRadials * | ||||||
|                                       common::MAX_DATA_MOMENT_GATES + |                                       common::MAX_DATA_MOMENT_GATES + | ||||||
|                                    baseCoord) * |                                    baseCoord) * | ||||||
|                                   2; |                                   2; | ||||||
|             std::size_t offset2 = offset1 + gateSize * 2; |             std::size_t offset2 = offset1 + gateSize * 2; | ||||||
|             std::size_t offset3 = (((startRadial + radial + 1) % radials) * |             std::size_t offset3 = | ||||||
|                                       common::MAX_DATA_MOMENT_GATES + |                (((startRadial + radial + 1) % vertexRadials) * | ||||||
|                                    baseCoord) * |                    common::MAX_DATA_MOMENT_GATES + | ||||||
|                                   2; |                 baseCoord) * | ||||||
|  |                2; | ||||||
|             std::size_t offset4 = offset3 + gateSize * 2; |             std::size_t offset4 = offset3 + gateSize * 2; | ||||||
| 
 | 
 | ||||||
|             vertices[vIndex++] = coordinates[offset1]; |             vertices[vIndex++] = coordinates[offset1]; | ||||||
|  | @ -770,14 +776,15 @@ void Level2ProductView::ComputeSweep() | ||||||
|          { |          { | ||||||
|             const std::uint16_t baseCoord = gate; |             const std::uint16_t baseCoord = gate; | ||||||
| 
 | 
 | ||||||
|             std::size_t offset1 = ((startRadial + radial) % radials * |             std::size_t offset1 = ((startRadial + radial) % vertexRadials * | ||||||
|                                       common::MAX_DATA_MOMENT_GATES + |  | ||||||
|                                    baseCoord) * |  | ||||||
|                                   2; |  | ||||||
|             std::size_t offset2 = (((startRadial + radial + 1) % radials) * |  | ||||||
|                                       common::MAX_DATA_MOMENT_GATES + |                                       common::MAX_DATA_MOMENT_GATES + | ||||||
|                                    baseCoord) * |                                    baseCoord) * | ||||||
|                                   2; |                                   2; | ||||||
|  |             std::size_t offset2 = | ||||||
|  |                (((startRadial + radial + 1) % vertexRadials) * | ||||||
|  |                    common::MAX_DATA_MOMENT_GATES + | ||||||
|  |                 baseCoord) * | ||||||
|  |                2; | ||||||
| 
 | 
 | ||||||
|             vertices[vIndex++] = p->latitude_; |             vertices[vIndex++] = p->latitude_; | ||||||
|             vertices[vIndex++] = p->longitude_; |             vertices[vIndex++] = p->longitude_; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat