Use ViewportParams rather than AbstractProjection for projection calculations regarding the visible area
Review Request #5539 - Created Oct. 6, 2010 and updated
Using ViewportParams rather than AbstractProjection simpliefies statements like viewport->currentProjection()->screenCoordinates(...,viewport,...) to viewport->screenCoordinates(...). That way, in the future, ViewportParams could be used for projection calculations that need to take the current viewport (and possibly an elevation model) into account, while AbstractProjections represent the pure mathematical concept (i.e. no elevation model).
Works for me (KDE version of Marble).
Ok, I had a look at this patch yesterday already. The motivation is nice since we also need some similar action for taking camera focus into account. Now the disadvantage of this patch is that almost all the projection methods need to get moved into the Viewport class. This kind of replicates lots of methods and introduces the awareness of the existance of GeoCoordinates into the ViewPorts class. So in a way this floods this class a bit with lots of stuff that had been encapsulated away before. Still this step makes sense to some degree: The only other option would be to "muddy" the projection classes with stuff like focus/elevation calculation. Putting an additional screenpixel conversion class (which would handle focus, elevation etc.) between Viewport and Abstractprojection might be another option but of course that could lead to other disadvantages. Any comments from your side regarding these thoughts?