[Marble-devel] Introducing Projections to Marble

Carlos Licea carlos_licea at hotmail.com
Thu Aug 9 19:12:56 CEST 2007


> Hi Carlos,
>
> I just saw that you committed some code to integrate the flat projection code 
> you did with Marble.
>
> Could you outline your plans concerning the introduction of projections on our 
> new mailing list marble-devel? 
>
> Thanks in advance :-)
>
> Torsten
>   

Sure, my idea is basically to reimplement the needed calls so that they 
are "generic" and that we route those calls to the needed methods like this:
-We have the generic PaintFoo, it used to paint the foo element only for 
the globe projection,
-Since Foo it's painted different in each projection we introduce 
globePaintFoo and rectangularPaintFoo,
-Finally paintFoo will be just a router like:
switch ( viewParams->m_projection ) {
    case ( ViewParams::Spherical ):
         sphericalPaintFoo();
          break;
    case ....
    }
}
So, what do you guys think?, I'm concerned for performance in which case 
everything should be compacted in the same function as:
foo:paintFoo ( ... ) {
    switch ( viewParams->m_projection ) {
          case(ViewParams::Spherical)
                LOTS OF CODE
                break;
          case....
       }
}

Which I think will be much more hard to read and very verbose. Please 
let me know asap which route should i take.

Carlos




More information about the Marble-devel mailing list