diff --git a/src/Airports/GenAirports850/build.cxx b/src/Airports/GenAirports850/build.cxx index 01433c14..800863fb 100644 --- a/src/Airports/GenAirports850/build.cxx +++ b/src/Airports/GenAirports850/build.cxx @@ -275,7 +275,7 @@ static void build_runway( const TGRunway& rwy_info, } - SG_LOG(SG_GENERAL, SG_DEBUG, "marking code = " << rwy_info.marking_code); + SG_LOG(SG_GENERAL, SG_DEBUG, "marking code = " << rwy_info.marking_code1 << " / " << rwy_info.marking_code2); if ( rwy_info.really_taxiway ) { gen_taxiway( rwy_info, alt_m, material, @@ -286,22 +286,13 @@ static void build_runway( const TGRunway& rwy_info, { gen_simple_rwy( rwy_info, alt_m, material, rwy_polys, texparams, accum ); - } else if ( rwy_info.marking_code == 3 /* Precision */ ) { - // precision runway markings + } else if ( rwy_info.marking_code1 == 3 || + rwy_info.marking_code1 == 2 || + rwy_info.marking_code1 == 1 || + rwy_info.marking_code1 == 0 ) { + gen_rwy( rwy_info, alt_m, material, rwy_polys, texparams, accum ); - } else if ( rwy_info.marking_code == 2 /* Non-precision */ ) { - // non-precision runway markings - gen_rwy( rwy_info, alt_m, material, - rwy_polys, texparams, accum ); - } else if ( rwy_info.marking_code == 1 /* Visual */ ) { - // visual runway markings - gen_rwy( rwy_info, alt_m, material, - rwy_polys, texparams, accum ); - } else if ( rwy_info.marking_code == 0 /* No known markings, lets assume Visual */ ) { - // visual runway markings - gen_rwy( rwy_info, alt_m, material, - rwy_polys, texparams, accum ); } else if ( surface_code == 13 /* Water buoys */ ) { // do nothing for now. } else { @@ -309,7 +300,7 @@ static void build_runway( const TGRunway& rwy_info, // right here so the programmer has to fix his code if a // new code ever gets introduced. :-) SG_LOG( SG_GENERAL, SG_ALERT, "Unknown runway code = " << - rwy_info.marking_code ); + rwy_info.marking_code1 ); throw sg_exception("Unknown runway code in build.cxx:build_airport()"); } @@ -380,6 +371,10 @@ void build_airport( string airport_id, float alt_m, rwy.really_taxiway = (rwy.rwy_no1 == "xxx"); rwy.generated = false; + rwy.surface_code = atoi( token[2].c_str() ); + rwy.shoulder_code = token[3]; + rwy.smoothness = atof( token[4].c_str() ); + //first runway end coordinates double lat_1 = atof( token[9].c_str() ); double lon_1 = atof( token[10].c_str() ); @@ -422,11 +417,11 @@ void build_airport( string airport_id, float alt_m, rwy.stopway1 = atoi( token[12].c_str() ) * SG_METER_TO_FEET; rwy.stopway2 = atoi( token[21].c_str() ) * SG_METER_TO_FEET; + rwy.marking_code1 = atoi( token[13].c_str() ); + rwy.marking_code2 = atoi( token[22].c_str() ); + rwy.lighting_flags = token[9]; - rwy.surface_code = atoi( token[2].c_str() ); - rwy.shoulder_code = token[3]; - rwy.marking_code = atoi( token[13].c_str() ); - rwy.smoothness = atof( token[4].c_str() ); + rwy.dist_remaining = (atoi( token[14].c_str() ) == 1 ); if (token.size()>15) { @@ -446,7 +441,7 @@ void build_airport( string airport_id, float alt_m, SG_LOG( SG_GENERAL, SG_DEBUG, " width = " << rwy.width); SG_LOG( SG_GENERAL, SG_DEBUG, " lighting = " << rwy.lighting_flags); SG_LOG( SG_GENERAL, SG_DEBUG, " sfc = " << rwy.surface_code); - SG_LOG( SG_GENERAL, SG_DEBUG, " mrkgs = " << rwy.marking_code); + SG_LOG( SG_GENERAL, SG_DEBUG, " mrkgs1/2 = " << rwy.marking_code1 << " / " << rwy.marking_code2); SG_LOG( SG_GENERAL, SG_DEBUG, " dspth1= " << rwy.disp_thresh1); SG_LOG( SG_GENERAL, SG_DEBUG, " stop1 = " << rwy.stopway1); SG_LOG( SG_GENERAL, SG_DEBUG, " dspth2= " << rwy.disp_thresh2); @@ -528,13 +523,11 @@ void build_airport( string airport_id, float alt_m, } } - TGSuperPoly sp; - TGTexParams tp; // First pass: generate the precision runways since these have // precidence for ( i = 0; i < (int)runways.size(); ++i ) { - if ( runways[i].marking_code == 3 /* Precision */ ) { + if ( runways[i].marking_code1 == 3 /* Precision */ ) { build_runway( runways[i], alt_m, &rwy_polys, &texparams, &accum, &apt_base, &apt_clearing ); @@ -543,8 +536,8 @@ void build_airport( string airport_id, float alt_m, // 2nd pass: generate the non-precision and visual runways for ( i = 0; i < (int)runways.size(); ++i ) { - if ( runways[i].marking_code == 2 /* Non-precision */ - || runways[i].marking_code == 1 /* Visual */ ) + if ( runways[i].marking_code1 == 2 /* Non-precision */ + || runways[i].marking_code1 == 1 /* Visual */ ) { if ( runways[i].surface_code != 13 /* Water */ ) { // only build non-water runways @@ -557,9 +550,9 @@ void build_airport( string airport_id, float alt_m, // 3rd pass: generate all remaining runways not covered in the first pass for ( i = 0; i < (int)runways.size(); ++i ) { - if ( runways[i].marking_code != 3 /* Precision */ - && runways[i].marking_code != 2 /* Non-precision */ - && runways[i].marking_code != 1 /* Visual */ ) + if ( runways[i].marking_code1 != 3 /* Precision */ + && runways[i].marking_code1 != 2 /* Non-precision */ + && runways[i].marking_code1 != 1 /* Visual */ ) { if ( runways[i].surface_code != 6 /* Asphalt Helipad */ && runways[i].surface_code != 7 /* Concrete Helipad */ && @@ -577,37 +570,6 @@ void build_airport( string airport_id, float alt_m, // 4th pass: generate all taxiways -#if 0 - // 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; - } - } -#else /* Ralf Gerlich: Generate Taxiways in specified order from bottom to top */ for ( i=0; i #include @@ -31,7 +29,87 @@ using std::string; +struct marking +{ + const char* tex; + int size; +}; +void gen_prec_marking( const TGRunway& rwy_info, + const TGPolygon& runway, + double &start1_pct, double &end1_pct, + double heading, + const string& material, + superpoly_list *rwy_polys, + texparams_list *texparams, + TGPolygon *accum) { + + // Precision runway sections from after the designation number + // onwards to the middle (one half). + // Set order of sections and their corresponding size + static const struct marking prec_rw[] = { + { "tz_three", 380 }, + { "rest", 200 }, + { "aim", 400 }, + { "tz_two_a", 400 }, + { "rest", 200 }, + { "tz_two_b", 200 }, + { "rest", 200 }, + { "tz_one_a", 400 }, + { "rest", 200 }, + { "tz_one_b", 200 } + }; + + double length = rwy_info.length / 2.0 + 2.0; + + for ( int i=0; i < sizeof prec_rw / sizeof prec_rw[0]; ++i) { + SG_LOG(SG_GENERAL, SG_INFO, "PREC_RW = " << prec_rw[i].tex << " lenght: " << prec_rw[i].size); + start1_pct = end1_pct; + end1_pct = start1_pct + ( prec_rw[i].size / length ); + gen_runway_section( rwy_info, runway, + start1_pct, end1_pct, + 0.0, 1.0, + 0.0, 1.0, 0.0, 1.0, + heading, + material, prec_rw[i].tex, + rwy_polys, texparams, accum ); + } + +} + +void gen_non_prec_marking( const TGRunway& rwy_info, + const TGPolygon& runway, + double &start1_pct, double &end1_pct, + double heading, + const string& material, + superpoly_list *rwy_polys, + texparams_list *texparams, + TGPolygon *accum) { + + // Non-precision runway sections from after the designation number + // onwards to the middle (one half). + // Set order of sections and their corresponding size + static const struct marking non_prec_rw[] = { + { "centerline", 200 }, + { "aim", 400 } + }; + + double length = rwy_info.length / 2.0 + 2.0; + + for ( int i=0; i < sizeof non_prec_rw / sizeof non_prec_rw[0]; ++i) { + SG_LOG(SG_GENERAL, SG_INFO, "NON_PREC_RW = " << non_prec_rw[i].tex << " lenght: " << non_prec_rw[i].size); + start1_pct = end1_pct; + end1_pct = start1_pct + ( non_prec_rw[i].size / length ); + gen_runway_section( rwy_info, runway, + start1_pct, end1_pct, + 0.0, 1.0, + 0.0, 1.0, 0.0, 1.0, + heading, + material, non_prec_rw[i].tex, + rwy_polys, texparams, accum ); + } + +} // generate a runway. The routine modifies // rwy_polys, texparams, and accum. For specific details and // dimensions of precision runway markings, please refer to FAA @@ -56,42 +134,37 @@ void gen_rwy( const TGRunway& rwy_info, 2 * SG_FEET_TO_METER, 2 * SG_FEET_TO_METER ); - // runway half "a" (actually the reverse half) - TGPolygon runway_a; - runway_a.erase(); - runway_a.add_node( 0, runway.get_pt(0, 0) ); - runway_a.add_node( 0, runway.get_pt(0, 1) ); - runway_a.add_node( 0, runway.get_pt(0, 2) ); - runway_a.add_node( 0, runway.get_pt(0, 5) ); + TGPolygon runway_half; +for ( int rwhalf=1; rwhalf<3; ++rwhalf ){ - // runway half "b" (actually the forward half) - TGPolygon runway_b; - runway_b.erase(); - runway_b.add_node( 0, runway.get_pt(0, 3) ); - runway_b.add_node( 0, runway.get_pt(0, 4) ); - runway_b.add_node( 0, runway.get_pt(0, 5) ); - runway_b.add_node( 0, runway.get_pt(0, 2) ); + if (rwhalf == 1) { + + //Create first half of the runway (first entry in apt.dat) + // runway half "b" (actually the first half) + runway_half.erase(); + runway_half.add_node( 0, runway.get_pt(0, 3) ); + runway_half.add_node( 0, runway.get_pt(0, 4) ); + runway_half.add_node( 0, runway.get_pt(0, 5) ); + runway_half.add_node( 0, runway.get_pt(0, 2) ); + } + + else if (rwhalf == 2) { + + // runway half "a" (actually the second half in apt.dat) + runway_half.erase(); + runway_half.add_node( 0, runway.get_pt(0, 0) ); + runway_half.add_node( 0, runway.get_pt(0, 1) ); + runway_half.add_node( 0, runway.get_pt(0, 2) ); + runway_half.add_node( 0, runway.get_pt(0, 5) ); + } Point3D p; - SG_LOG(SG_GENERAL, SG_DEBUG, "raw runway pts (a half)"); - for ( i = 0; i < runway_a.contour_size( 0 ); ++i ) { - p = runway_a.get_pt(0, i); + SG_LOG(SG_GENERAL, SG_DEBUG, "raw runway half pts (run " << rwhalf << ")"); + for ( i = 0; i < runway_half.contour_size( 0 ); ++i ) { + p = runway_half.get_pt(0, i); SG_LOG(SG_GENERAL, SG_DEBUG, " point = " << p); } - SG_LOG(SG_GENERAL, SG_DEBUG, "raw runway pts (b half)"); - for ( i = 0; i < runway_b.contour_size( 0 ); ++i ) { - p = runway_b.get_pt(0, i); - SG_LOG(SG_GENERAL, SG_DEBUG, " point = " << p); - } - - // - // Setup some variables and values to help us chop up the runway - // into its various sections - // - - TGSuperPoly sp; - TGTexParams tp; // we add 2' to the length for texture overlap. This puts the // lines on the texture back to the edge of the runway where they @@ -104,70 +177,36 @@ void gen_rwy( const TGRunway& rwy_info, } double start1_pct = 0.0; - double start2_pct = 0.0; double end1_pct = 0.0; - double end2_pct = 0.0; + double disp_thresh = 0.0; + double heading = 0.0; + double stopway = 0.0; + string rwname; + // // Displaced threshold if it exists // - if ( rwy_info.disp_thresh1 > 0.0 ) { - SG_LOG( SG_GENERAL, SG_INFO, "Forward displaced threshold = " - << rwy_info.disp_thresh1 ); - - // reserve 90' for final arrows - double thresh = rwy_info.disp_thresh1 - 90.0; - - // number of full center arrows - int count = (int)(thresh / 200.0); - - // length of starting partial arrow - double part_len = thresh - ( count * 200.0 ); - double tex_pct = (200.0 - part_len) / 200.0; - - // starting (possibly partial chunk) - start2_pct = end2_pct; - end2_pct = start2_pct + ( part_len / length ); - gen_runway_section( rwy_info, runway_b, - start2_pct, end2_pct, - 0.0, 1.0, - 0.0, 1.0, tex_pct, 1.0, - rwy_info.heading + 180.0, - material, "dspl_thresh", - rwy_polys, texparams, accum ); - - // main chunks - for ( i = 0; i < count; ++i ) { - start2_pct = end2_pct; - end2_pct = start2_pct + ( 200.0 / length ); - gen_runway_section( rwy_info, runway_b, - start2_pct, end2_pct, - 0.0, 1.0, - 0.0, 1.0, 0.0, 1.0, - rwy_info.heading + 180.0, - material, "dspl_thresh", - rwy_polys, texparams, accum ); - } - - // final arrows - start2_pct = end2_pct; - end2_pct = start2_pct + ( 90.0 / length ); - gen_runway_section( rwy_info, runway_b, - start2_pct, end2_pct, - 0.0, 1.0, - 0.0, 1.0, 0.0, 1.0, - rwy_info.heading + 180.0, - material, "dspl_arrows", - rwy_polys, texparams, accum ); + if (rwhalf == 1) { + disp_thresh = rwy_info.disp_thresh1; + heading = rwy_info.heading + 180.0; + rwname = rwy_info.rwy_no1; + stopway = rwy_info.stopway1; } - - if ( rwy_info.disp_thresh2 > 0.0 ) { - SG_LOG( SG_GENERAL, SG_INFO, "Reverse displaced threshold = " - << rwy_info.disp_thresh2 ); + else if (rwhalf == 2) { + disp_thresh = rwy_info.disp_thresh2; + heading = rwy_info.heading; + rwname = rwy_info.rwy_no2; + stopway = rwy_info.stopway2; + } + + if ( disp_thresh > 0.0 ) { + SG_LOG( SG_GENERAL, SG_INFO, "Displaced threshold for RW side " << rwhalf << " is " + << disp_thresh ); // reserve 90' for final arrows - double thresh = rwy_info.disp_thresh2 - 90.0; + double thresh = disp_thresh - 90.0; // number of full center arrows int count = (int)(thresh / 200.0); @@ -179,11 +218,11 @@ void gen_rwy( const TGRunway& rwy_info, // starting (possibly partial chunk) start1_pct = end1_pct; end1_pct = start1_pct + ( part_len / length ); - gen_runway_section( rwy_info, runway_a, + gen_runway_section( rwy_info, runway_half, start1_pct, end1_pct, 0.0, 1.0, 0.0, 1.0, tex_pct, 1.0, - rwy_info.heading, + heading, material, "dspl_thresh", rwy_polys, texparams, accum ); @@ -191,11 +230,11 @@ void gen_rwy( const TGRunway& rwy_info, for ( i = 0; i < count; ++i ) { start1_pct = end1_pct; end1_pct = start1_pct + ( 200.0 / length ); - gen_runway_section( rwy_info, runway_a, + gen_runway_section( rwy_info, runway_half, start1_pct, end1_pct, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, - rwy_info.heading, + heading, material, "dspl_thresh", rwy_polys, texparams, accum ); } @@ -203,94 +242,63 @@ void gen_rwy( const TGRunway& rwy_info, // final arrows start1_pct = end1_pct; end1_pct = start1_pct + ( 90.0 / length ); - gen_runway_section( rwy_info, runway_a, + gen_runway_section( rwy_info, runway_half, start1_pct, end1_pct, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, - rwy_info.heading, + heading, material, "dspl_arrows", rwy_polys, texparams, accum ); } + + if ((rwhalf == 1 && !rwy_info.marking_code1 == 0) || (rwhalf == 2 && !rwy_info.marking_code2 == 0)){ + // // Threshold // start1_pct = end1_pct; end1_pct = start1_pct + ( 202.0 / length ); - gen_runway_section( rwy_info, runway_a, + gen_runway_section( rwy_info, runway_half, start1_pct, end1_pct, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, - rwy_info.heading, + heading, material, "threshold", rwy_polys, texparams, accum ); - start2_pct = end2_pct; - end2_pct = start2_pct + ( 202.0 / length ); - gen_runway_section( rwy_info, runway_b, - start2_pct, end2_pct, - 0.0, 1.0, - 0.0, 1.0, 0.0, 1.0, - rwy_info.heading + 180.0, - material, "threshold", - rwy_polys, texparams, accum ); // // Runway designation letter // - int len = rwy_info.rwy_no1.length(); - string letter1 = ""; - string letter2 = ""; + int len = rwname.length(); + string letter = ""; for ( i = 0; i < len; ++i ) { - string tmp = rwy_info.rwy_no1.substr(i, 1); + string tmp = rwname.substr(i, 1); if ( tmp == "L" ) { - letter1 = "L"; + letter = "L"; } else if ( tmp == "R" ) { - letter1 = "R"; + letter = "R"; } else if ( tmp == "C" ) { - letter1 = "C"; + letter = "C"; } } - len = rwy_info.rwy_no2.length(); - for ( i = 0; i < len; ++i ) { - string tmp = rwy_info.rwy_no2.substr(i, 1); - if ( tmp == "L" ) { - letter2 = "L"; - } else if ( tmp == "R" ) { - letter2 = "R"; - } else if ( tmp == "C" ) { - letter2 = "C"; - } - } - SG_LOG(SG_GENERAL, SG_DEBUG, "Runway designation1 = " << rwy_info.rwy_no1); - SG_LOG(SG_GENERAL, SG_DEBUG, "Runway designation letter1 = " << letter1); - SG_LOG(SG_GENERAL, SG_DEBUG, "Runway designation2 = " << rwy_info.rwy_no2); - SG_LOG(SG_GENERAL, SG_DEBUG, "Runway designation letter2 = " << letter2); + SG_LOG(SG_GENERAL, SG_DEBUG, "Runway designation1 = " << rwname); + SG_LOG(SG_GENERAL, SG_DEBUG, "Runway designation letter1 = " << letter); - //TODO: add empty airport end generation - if ( !letter1.empty() && !letter2.empty() ) { + if ( !letter.empty() ) { start1_pct = end1_pct; end1_pct = start1_pct + ( 90.0 / length ); - gen_runway_section( rwy_info, runway_a, + gen_runway_section( rwy_info, runway_half, start1_pct, end1_pct, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, - rwy_info.heading, - material, letter2, - rwy_polys, texparams, accum ); - - start2_pct = end2_pct; - end2_pct = start2_pct + ( 90.0 / length ); - gen_runway_section( rwy_info, runway_b, - start2_pct, end2_pct, - 0.0, 1.0, - 0.0, 1.0, 0.0, 1.0, - rwy_info.heading + 180.0, - material, letter1, + heading, + material, letter, rwy_polys, texparams, accum ); } @@ -298,301 +306,43 @@ void gen_rwy( const TGRunway& rwy_info, // Runway designation number(s) // - len = rwy_info.rwy_no1.length(); - string snum1 = rwy_info.rwy_no1; + len = rwname.length(); + string snum = rwname; for ( i = 0; i < len; ++i ) { - string tmp = rwy_info.rwy_no1.substr(i, 1); + string tmp = rwname.substr(i, 1); if ( tmp == "L" || tmp == "R" || tmp == "C" || tmp == " " ) { - snum1 = rwy_info.rwy_no1.substr(0, i); + snum = rwname.substr(0, i); } } - len = rwy_info.rwy_no2.length(); - string snum2 = rwy_info.rwy_no2; - for ( i = 0; i < len; ++i ) { - string tmp = rwy_info.rwy_no2.substr(i, 1); - if ( tmp == "L" || tmp == "R" || tmp == "C" || tmp == " " ) { - snum2 = rwy_info.rwy_no2.substr(0, i); - } - } - SG_LOG(SG_GENERAL, SG_INFO, "Runway num1 = '" << snum1 << "'"); - SG_LOG(SG_GENERAL, SG_INFO, "Runway num2 = '" << snum2 << "'"); + SG_LOG(SG_GENERAL, SG_INFO, "Runway num = '" << snum ); - int num1 = atoi( snum1.c_str() ); - int num2 = atoi( snum2.c_str() ); - while ( num1 <= 0 ) { - num1 += 36; - } - - start2_pct = end2_pct; - end2_pct = start2_pct + ( 80.0 / length ); - gen_number_block( rwy_info, material, runway_b, rwy_info.heading + 180.0, - num1, start2_pct, end2_pct, rwy_polys, texparams, accum ); - - while ( num2 <= 0 ) { - num2 += 36; + int num = atoi( snum.c_str() ); + while ( num <= 0 ) { + num += 36; } start1_pct = end1_pct; end1_pct = start1_pct + ( 80.0 / length ); - gen_number_block( rwy_info, material, runway_a, rwy_info.heading, - num2, start1_pct, end1_pct, rwy_polys, texparams, accum ); + gen_number_block( rwy_info, material, runway_half, heading, + num, start1_pct, end1_pct, rwy_polys, texparams, accum ); + } - // - // Touch down zone x3 - // - start1_pct = end1_pct; - end1_pct = start1_pct + ( 380 / length ); - gen_runway_section( rwy_info, runway_a, - start1_pct, end1_pct, - 0.0, 1.0, - 0.0, 1.0, 0.0, 1.0, - rwy_info.heading, - material, "tz_three", - rwy_polys, texparams, accum ); - - start2_pct = end2_pct; - end2_pct = start2_pct + ( 380 / length ); - gen_runway_section( rwy_info, runway_b, - start2_pct, end2_pct, - 0.0, 1.0, - 0.0, 1.0, 0.0, 1.0, - rwy_info.heading + 180.0, - material, "tz_three", - rwy_polys, texparams, accum ); - - // add a section of center stripe - start1_pct = end1_pct; - end1_pct = start1_pct + ( 200 / length ); - gen_runway_section( rwy_info, runway_a, - start1_pct, end1_pct, - 0.0, 1.0, - 0.0, 1.0, 0.0, 1.0, - rwy_info.heading, - material, "rest", - rwy_polys, texparams, accum ); - - start2_pct = end2_pct; - end2_pct = start2_pct + ( 200 / length ); - gen_runway_section( rwy_info, runway_b, - start2_pct, end2_pct, - 0.0, 1.0, - 0.0, 1.0, 0.0, 1.0, - rwy_info.heading + 180.0, - material, "rest", - rwy_polys, texparams, accum ); - - // - // Aiming point - // - - start1_pct = end1_pct; - end1_pct = start1_pct + ( 400 / length ); - gen_runway_section( rwy_info, runway_a, - start1_pct, end1_pct, - 0.0, 1.0, - 0.0, 1.0, 0.0, 1.0, - rwy_info.heading, - material, "aim", - rwy_polys, texparams, accum ); - - start2_pct = end2_pct; - end2_pct = start2_pct + ( 400 / length ); - gen_runway_section( rwy_info, runway_b, - start2_pct, end2_pct, - 0.0, 1.0, - 0.0, 1.0, 0.0, 1.0, - rwy_info.heading + 180.0, - material, "aim", - rwy_polys, texparams, accum ); - - // - // Touch down zone x2 (first) - // - - if ( end1_pct < 1.0 ) { - start1_pct = end1_pct; - end1_pct = start1_pct + ( 400 / length ); - gen_runway_section( rwy_info, runway_a, - start1_pct, end1_pct, - 0.0, 1.0, - 0.0, 1.0, 0.0, 1.0, - rwy_info.heading, - material, "tz_two_a", - rwy_polys, texparams, accum ); + if ((rwhalf == 1 && rwy_info.marking_code1 == 3) || (rwhalf == 2 && rwy_info.marking_code2 == 3)){ + gen_prec_marking( rwy_info, runway_half, + start1_pct, end1_pct, + heading, material, + rwy_polys, texparams, accum ); } - if ( end2_pct < 1.0 ) { - start2_pct = end2_pct; - end2_pct = start2_pct + ( 400 / length ); - gen_runway_section( rwy_info, runway_b, - start2_pct, end2_pct, - 0.0, 1.0, - 0.0, 1.0, 0.0, 1.0, - rwy_info.heading + 180.0, - material, "tz_two_a", - rwy_polys, texparams, accum ); + if ((rwhalf == 1 && rwy_info.marking_code1 == 2) || (rwhalf == 2 && rwy_info.marking_code2 == 2)){ + gen_non_prec_marking( rwy_info, runway_half, + start1_pct, end1_pct, + heading, material, + rwy_polys, texparams, accum ); } - // add a section of center stripe - if ( end1_pct < 1.0 ) { - start1_pct = end1_pct; - end1_pct = start1_pct + ( 200 / length ); - gen_runway_section( rwy_info, runway_a, - start1_pct, end1_pct, - 0.0, 1.0, - 0.0, 1.0, 0.0, 1.0, - rwy_info.heading, - material, "rest", - rwy_polys, texparams, accum ); - } - - if ( end2_pct < 1.0 ) { - start2_pct = end2_pct; - end2_pct = start2_pct + ( 200 / length ); - gen_runway_section( rwy_info, runway_b, - start2_pct, end2_pct, - 0.0, 1.0, - 0.0, 1.0, 0.0, 1.0, - rwy_info.heading + 180.0, - material, "rest", - rwy_polys, texparams, accum ); - } - - // - // Touch down zone x2 (second) - // - - if ( end1_pct < 1.0 ) { - start1_pct = end1_pct; - end1_pct = start1_pct + ( 200 / length ); - gen_runway_section( rwy_info, runway_a, - start1_pct, end1_pct, - 0.0, 1.0, - 0.0, 1.0, 0.0, 1.0, - rwy_info.heading, - material, "tz_two_b", - rwy_polys, texparams, accum ); - } - - if ( end2_pct < 1.0 ) { - start2_pct = end2_pct; - end2_pct = start2_pct + ( 200 / length ); - gen_runway_section( rwy_info, runway_b, - start2_pct, end2_pct, - 0.0, 1.0, - 0.0, 1.0, 0.0, 1.0, - rwy_info.heading + 180.0, - material, "tz_two_b", - rwy_polys, texparams, accum ); - } - - // add a section of center stripe - if ( end1_pct < 1.0 ) { - start1_pct = end1_pct; - end1_pct = start1_pct + ( 200 / length ); - gen_runway_section( rwy_info, runway_a, - start1_pct, end1_pct, - 0.0, 1.0, - 0.0, 1.0, 0.0, 1.0, - rwy_info.heading, - material, "rest", - rwy_polys, texparams, accum ); - } - - if ( end2_pct < 1.0 ) { - start2_pct = end2_pct; - end2_pct = start2_pct + ( 200 / length ); - gen_runway_section( rwy_info, runway_b, - start2_pct, end2_pct, - 0.0, 1.0, - 0.0, 1.0, 0.0, 1.0, - rwy_info.heading + 180.0, - material, "rest", - rwy_polys, texparams, accum ); - } - - // - // Touch down zone x1 (first) - // - - if ( end1_pct < 1.0 ) { - start1_pct = end1_pct; - end1_pct = start1_pct + ( 400 / length ); - gen_runway_section( rwy_info, runway_a, - start1_pct, end1_pct, - 0.0, 1.0, - 0.0, 1.0, 0.0, 1.0, - rwy_info.heading, - material, "tz_one_a", - rwy_polys, texparams, accum ); - } - - if ( end2_pct < 1.0 ) { - start2_pct = end2_pct; - end2_pct = start2_pct + ( 400 / length ); - gen_runway_section( rwy_info, runway_b, - start2_pct, end2_pct, - 0.0, 1.0, - 0.0, 1.0, 0.0, 1.0, - rwy_info.heading + 180.0, - material, "tz_one_a", - rwy_polys, texparams, accum ); - } - - // add a section of center stripe - if ( end1_pct < 1.0 ) { - start1_pct = end1_pct; - end1_pct = start1_pct + ( 200 / length ); - gen_runway_section( rwy_info, runway_a, - start1_pct, end1_pct, - 0.0, 1.0, - 0.0, 1.0, 0.0, 1.0, - rwy_info.heading, - material, "rest", - rwy_polys, texparams, accum ); - } - - if ( end2_pct < 1.0 ) { - start2_pct = end2_pct; - end2_pct = start2_pct + ( 200 / length ); - gen_runway_section( rwy_info, runway_b, - start2_pct, end2_pct, - 0.0, 1.0, - 0.0, 1.0, 0.0, 1.0, - rwy_info.heading + 180.0, - material, "rest", - rwy_polys, texparams, accum ); - } - - // - // Touch down zone x1 (second) - // - - if ( end1_pct < 1.0 ) { - start1_pct = end1_pct; - end1_pct = start1_pct + ( 200 / length ); - gen_runway_section( rwy_info, runway_a, - start1_pct, end1_pct, - 0.0, 1.0, - 0.0, 1.0, 0.0, 1.0, - rwy_info.heading, - material, "tz_one_b", - rwy_polys, texparams, accum ); - } - - if ( end2_pct < 1.0 ) { - start2_pct = end2_pct; - end2_pct = start2_pct + ( 200 / length ); - gen_runway_section( rwy_info, runway_b, - start2_pct, end2_pct, - 0.0, 1.0, - 0.0, 1.0, 0.0, 1.0, - rwy_info.heading + 180.0, - material, "tz_one_b", - rwy_polys, texparams, accum ); - } // // The rest ... @@ -609,33 +359,16 @@ void gen_rwy( const TGRunway& rwy_info, start1_pct = end1_pct; end1_pct = start1_pct + rest1_inc; - gen_runway_section( rwy_info, runway_a, + gen_runway_section( rwy_info, runway_half, start1_pct, end1_pct, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, - rwy_info.heading, + heading, material, "rest", rwy_polys, texparams, accum ); } - ideal_rest_inc = ( 200.0 / length ); - divs = (int)((1.0 - end2_pct) / ideal_rest_inc) + 1; - double rest2_inc = (1.0 - end2_pct) / divs; - - while ( end2_pct < 1.0 ) { - start2_pct = end2_pct; - end2_pct = start2_pct + rest2_inc; - - gen_runway_section( rwy_info, runway_b, - start2_pct, end2_pct, - 0.0, 1.0, - 0.0, 1.0, 0.0, 1.0, - rwy_info.heading + 180.0, - material, "rest", - rwy_polys, texparams, accum ); - } - - gen_runway_stopway( rwy_info, runway_a, runway_b, - material, - rwy_polys, texparams, accum ); +} + + }