Why are largest taxiways generated first?

"David Luff" <[email protected]> Fri, 03 Dec 2004 17:22:07 +0000
Newsgroups gmane.games.flightgear.terragear.devel
Message-ID <[email protected]>
With respect to the following code snippet from Airports/build.cxx

    // 4th pass: generate all taxiways

    // we want to generate in order of largest size first so this will
    // look a little weird, but that's all I'm doing, otherwise a
    // simple list traversal would work fine.
    bool done = false;
    while ( !done ) {
        // find the largest taxiway
        int largest_idx = -1;
        double max_size = 0;
        for ( i = 0; i < (int)taxiways.size(); ++i ) {
            SG_LOG( SG_GENERAL, SG_DEBUG, "taxiway i = " << i );
            double size = taxiways[i].length * taxiways[i].width;
            if ( size > max_size && !taxiways[i].generated ) {
                SG_LOG( SG_GENERAL, SG_DEBUG, "taxiway max i = " << i );
                max_size = size;
                largest_idx = i;
            }
        }

        if ( largest_idx >= 0 ) {
            SG_LOG( SG_GENERAL, SG_DEBUG, "generating " << largest_idx );
            build_runway( taxiways[largest_idx], alt_m,
                          &rwy_polys, &texparams, &accum,
                          &apt_base, &apt_clearing );
            taxiways[largest_idx].generated = true;
        } else {
            SG_LOG( SG_GENERAL, SG_DEBUG, "done with taxiways." );
            done = true;
        }
    }

I'm curious as to why largest taxiways necessarily get generated first?
Are there rendering related reasons why, for example, longest taxiways
couldn't get generated first, or other schemes applied?

Cheers - Dave


This message has been scanned but we cannot guarantee that it and any
attachments are free from viruses or other damaging content: you are
advised to perform your own checks.  Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.


_______________________________________________
Terragear-devel mailing list
[email protected]
http://mail.flightgear.org/mailman/listinfo/terragear-devel
2f585eeea02e2c79d7b1d8c4963bae2d