[Marble-commits] KDE/kdeedu/marble
Bastian Holst
bastianholst at gmx.de
Tue Aug 11 12:08:35 CEST 2009
SVN commit 1009961 by bholst:
Marble:
* Some normalization fixes in GeoPainter (Degree instead of Radian).
* Test for GeoDataCoordinates::normalizeLat() and GeoDataCoordinates::normalizeLon()
M +2 -2 src/lib/GeoPainter.cpp
M +4 -4 src/lib/geodata/data/GeoDataCoordinates.cpp
M +1 -0 tests/CMakeLists.txt
AM tests/TestGeoData.cpp [License: LGPL]
M +1 -1 tests/TestGeoPainter.cpp
--- trunk/KDE/kdeedu/marble/src/lib/GeoPainter.cpp #1009960:1009961
@@ -145,8 +145,8 @@
qreal altitude = centerCoordinates.altitude();
centerCoordinates.geoCoordinates( lon, lat, GeoDataCoordinates::Degree );
- lon = GeoDataCoordinates::normalizeLon( lon );
- lat = GeoDataCoordinates::normalizeLat( lat );
+ lon = GeoDataCoordinates::normalizeLon( lon, GeoDataCoordinates::Degree );
+ lat = GeoDataCoordinates::normalizeLat( lat, GeoDataCoordinates::Degree );
qreal west = GeoDataCoordinates::normalizeLon( lon - width * 0.5, GeoDataCoordinates::Degree );
qreal east = GeoDataCoordinates::normalizeLon( lon + width * 0.5, GeoDataCoordinates::Degree );
--- trunk/KDE/kdeedu/marble/src/lib/geodata/data/GeoDataCoordinates.cpp #1009960:1009961
@@ -207,14 +207,14 @@
qreal GeoDataCoordinates::normalizeLon( qreal lon, GeoDataCoordinates::Unit unit )
{
qreal halfCircle;
- if ( unit = GeoDataCoordinates::Radian ) {
+ if ( unit == GeoDataCoordinates::Radian ) {
halfCircle = M_PI;
}
else {
halfCircle = 180;
}
- if ( lon > +halfCircle ) {
+ if ( lon > halfCircle ) {
int cycles = (int)( ( lon + halfCircle ) / ( 2 * halfCircle ) );
return lon - ( cycles * 2 * halfCircle );
}
@@ -230,7 +230,7 @@
qreal GeoDataCoordinates::normalizeLat( qreal lat, GeoDataCoordinates::Unit unit )
{
qreal halfCircle;
- if ( unit = GeoDataCoordinates::Radian ) {
+ if ( unit == GeoDataCoordinates::Radian ) {
halfCircle = M_PI;
}
else {
@@ -276,7 +276,7 @@
void GeoDataCoordinates::normalizeLonLat( qreal &lon, qreal &lat, GeoDataCoordinates::Unit unit )
{
qreal halfCircle;
- if ( unit = GeoDataCoordinates::Radian ) {
+ if ( unit == GeoDataCoordinates::Radian ) {
halfCircle = M_PI;
}
else {
--- trunk/KDE/kdeedu/marble/tests/CMakeLists.txt #1009960:1009961
@@ -91,6 +91,7 @@
marble_add_test( PluginManagerTest )
marble_add_test( MarbleWidgetTest )
marble_add_test( TestGeoPainter )
+marble_add_test( TestGeoData )
add_definitions( -DCITIES_PATH="\\\"${CMAKE_CURRENT_SOURCE_DIR}/../../../data/placemarks/cityplacemarks.kml\\\"" )
marble_add_test( KMLTest )
** trunk/KDE/kdeedu/marble/tests/TestGeoData.cpp #property svn:eol-style
+ native
--- trunk/KDE/kdeedu/marble/tests/TestGeoPainter.cpp #1009960:1009961
@@ -41,7 +41,7 @@
// (*it).width( GeoDataCoordinates::Degree ),
// (*it).height( GeoDataCoordinates::Degree ) );
//
-// QCOMPARE( ring.latLonAltBox(), (*it) );
+// QCOMPARE( ring.latLonAltBox().toString(), (*it).toString() );
// }
}
More information about the Marble-commits
mailing list