- Timestamp:
- Dec 1, 2010, 2:09:21 PM (15 years ago)
- Location:
- trunk/BNC
- Files:
-
- 2 edited
-
bnc.qrc (modified) (1 diff)
-
bncmap.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bnc.qrc
r2657 r2754 5 5 <file>bnchelp.html</file> 6 6 <file>bncabout.html</file> 7 <file>worldmap.dat</file> 7 8 </qresource> 8 9 <qresource prefix="/bnchelp"> -
trunk/BNC/bncmap.cpp
r2753 r2754 50 50 void bncMap::slotReadMap() 51 51 { 52 QString mapFile = "worldmap.dat"; 53 QFile world(mapFile); 52 QFile world(":worldmap.dat"); 54 53 float fi, la; 55 54 56 if(world.open(QIODevice::ReadOnly) ){55 world.open(QIODevice::ReadOnly | QIODevice::Text); 57 56 58 QTextStream in(&world);59 in.setRealNumberNotation(QTextStream::FixedNotation);57 QTextStream in(&world); 58 in.setRealNumberNotation(QTextStream::FixedNotation); 60 59 61 while( ! in.atEnd() ){60 while( ! in.atEnd() ){ 62 61 63 in >> la >> fi; 64 _worldMap << QPointF( la, -fi ); 65 66 } 67 }else{ 68 std::cerr << QString("World map cannot be found : %1\n").arg(mapFile).toAscii().data(); 62 in >> la >> fi; 63 _worldMap << QPointF( la, -fi ); 64 69 65 } 66 70 67 world.close(); 71 68 } … … 82 79 if( _worldMap.at(i).x() == 0.0 and _worldMap.at(i).y() == 0.0 ){ 83 80 if( i > 0 ){ 84 endIdx = i-1;81 endIdx = i-1; 85 82 while( begIdx < endIdx ){ 86 83 87 int l1 = 0;88 int l2 = 0;84 int l1 = 0; 85 int l2 = 0; 89 86 90 87 float la1 = _worldMap.at(begIdx+0).x() + _LaOff; … … 93 90 float fi2 = _worldMap.at(begIdx+1).y(); 94 91 begIdx++; 95 96 while( la1 < 0 ){ la1 += 360; l1++; }97 while( la1 >= 360 ){ la1 -= 360; l1--; }98 while( la2 < 0 ){ la2 += 360; l2++; }99 while( la2 >= 360 ){ la2 -= 360; l2--; }92 93 while( la1 < 0 ){ la1 += 360; l1++; } 94 while( la1 >= 360 ){ la1 -= 360; l1--; } 95 while( la2 < 0 ){ la2 += 360; l2++; } 96 while( la2 >= 360 ){ la2 -= 360; l2--; } 100 97 101 if( l1 != 0 and l2 == 0 ){ continue; } // break this line102 if( l2 != 0 and l1 == 0 ){ continue; } // break this line98 if( l1 != 0 and l2 == 0 ){ continue; } // break this line 99 if( l2 != 0 and l1 == 0 ){ continue; } // break this line 103 100 104 101 _mapScen->addLine(la1*_scale, fi1*_scale, la2*_scale, fi2*_scale, QPen(QBrush(Qt::black),1));
Note:
See TracChangeset
for help on using the changeset viewer.
