Advertisement
marbledeveloper

SphericalProjection_cpp.diff

May 23rd, 2012
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. --- SphericalProjection_original.cpp 2011-12-20 20:19:12.000000000 +0100
  2. +++ SphericalProjection.cpp 2012-05-23 19:51:57.539813700 +0200
  3. @@ -19,6 +19,8 @@
  4. #include "GeoDataPoint.h"
  5. #include "global.h"
  6.  
  7. +#include <QDebug>
  8. +
  9. #define SAFE_DISTANCE
  10.  
  11. namespace Marble
  12. @@ -81,10 +83,15 @@
  13. const ViewportParams *viewport,
  14. qreal &x, qreal &y, bool &globeHidesPoint ) const
  15. {
  16. + qDebug() << "SphericalProjection::screenCoordinates() lat: " << coordinates.latitude() << " lon: " << coordinates.longitude() << " type: " << coordinates.getType();
  17. qreal absoluteAltitude = coordinates.altitude() + EARTH_RADIUS;
  18. Quaternion qpos = coordinates.quaternion();
  19.  
  20. - qpos.rotateAroundAxis( *( viewport->planetAxisMatrix() ) );
  21. + if (coordinates.getType()){
  22. + viewport->setTime(coordinates.getTime());
  23. + viewport->setOld(coordinates.isOld());
  24. + }
  25. + qpos.rotateAroundAxis( *( viewport->planetAxisMatrix( coordinates.getType() ) ));
  26.  
  27. qreal pixelAltitude = ( ( viewport->radius() )
  28. / EARTH_RADIUS * absoluteAltitude );
  29. @@ -92,6 +99,7 @@
  30. // Skip placemarks at the other side of the earth.
  31. if ( qpos.v[Q_Z] < 0 ) {
  32. globeHidesPoint = true;
  33. + coordinates.setOld(true);
  34. return false;
  35. }
  36. }
  37. @@ -106,6 +114,7 @@
  38. + earthCenteredY * earthCenteredY )
  39. < radius * radius ) ) {
  40. globeHidesPoint = true;
  41. + coordinates.setOld(true);
  42. return false;
  43. }
  44. }
  45. @@ -117,10 +126,12 @@
  46. // Skip placemarks that are outside the screen area
  47. if ( x < 0 || x >= viewport->width() || y < 0 || y >= viewport->height() ) {
  48. globeHidesPoint = false;
  49. + coordinates.setOld(true);
  50. return false;
  51. }
  52.  
  53. globeHidesPoint = false;
  54. + coordinates.setOld(true);
  55. return true;
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement