From 7c052d1ed3e237a9c1d1b94bb667c7f57ca275f6 Mon Sep 17 00:00:00 2001 From: scttgs0 Date: Sun, 14 May 2023 11:21:49 -0500 Subject: [PATCH] [lights] Maintenance --- src/Airports/GenAirports/lights.cxx | 702 ++++++++++++++-------------- 1 file changed, 347 insertions(+), 355 deletions(-) diff --git a/src/Airports/GenAirports/lights.cxx b/src/Airports/GenAirports/lights.cxx index d08b9951..d93a33bc 100644 --- a/src/Airports/GenAirports/lights.cxx +++ b/src/Airports/GenAirports/lights.cxx @@ -20,23 +20,23 @@ // #ifdef HAVE_CONFIG_H -# include +#include #endif #include -#include #include +#include #include "runway.hxx" -using std::string; // calculate the runway light direction vector. We take both runway // ends to get the direction of the runway. -SGVec3f Runway::gen_runway_light_vector( float angle, bool recip ) { +SGVec3f Runway::gen_runway_light_vector(float angle, bool recip) +{ SGVec3f cart1, cart2; - if ( !recip ) { + if (!recip) { cart1 = normalize(SGVec3f::fromGeod(GetStart())); cart2 = normalize(SGVec3f::fromGeod(GetEnd())); } else { @@ -54,7 +54,7 @@ SGVec3f Runway::gen_runway_light_vector( float angle, bool recip ) { // generate runway edge lighting // 60 meters spacing or the next number down that divides evenly. -tglightcontour_list Runway::gen_runway_edge_lights( bool recip ) +tglightcontour_list Runway::gen_runway_edge_lights(bool recip) { tgLightContour r_lights; tgLightContour w_lights; @@ -68,9 +68,9 @@ tglightcontour_list Runway::gen_runway_edge_lights( bool recip ) double step = dist / divs; SGGeod pt1, pt2; - SGVec3f normal = gen_runway_light_vector( 3.0, recip ); + SGVec3f normal = gen_runway_light_vector(3.0, recip); - if ( recip ) { + if (recip) { length_hdg = SGMiscd::normalizePeriodic(0, 360, rwy.heading + 180.0); pt1 = SGGeodesy::direct(GetEnd(), length_hdg, rwy.threshold[get_thresh0(recip)]); pt2 = GetStart(); @@ -79,72 +79,68 @@ tglightcontour_list Runway::gen_runway_edge_lights( bool recip ) pt1 = SGGeodesy::direct(GetStart(), length_hdg, rwy.threshold[get_thresh0(recip)]); pt2 = GetEnd(); } - double left_hdg = SGMiscd::normalizePeriodic(0, 360, length_hdg - 90.0 ); + double left_hdg = SGMiscd::normalizePeriodic(0, 360, length_hdg - 90.0); int tstep; double offset = 2 + rwy.width * 0.5; //front threshold - if (rwy.threshold[get_thresh0(recip)] > step ) - { + if (rwy.threshold[get_thresh0(recip)] > step) { SGGeod pt0 = pt1; tstep = (int)(rwy.threshold[get_thresh0(recip)] / step); - for ( i = 0; i < tstep; ++i ) { + for (i = 0; i < tstep; ++i) { pt0 = SGGeodesy::direct(pt0, length_hdg, -step); - r_lights.AddLight( SGGeodesy::direct(pt0, left_hdg, offset), normal ); - r_lights.AddLight( SGGeodesy::direct(pt0, left_hdg, -offset), normal ); + r_lights.AddLight(SGGeodesy::direct(pt0, left_hdg, offset), normal); + r_lights.AddLight(SGGeodesy::direct(pt0, left_hdg, -offset), normal); } } - for ( i = 0; i < divs; ++i ) { + for (i = 0; i < divs; ++i) { pt1 = SGGeodesy::direct(pt1, SGGeodesy::courseDeg(pt1, pt2), step); dist -= step; - if ( dist > 610.0 || dist > rwy.length / 2 ) { - w_lights.AddLight( SGGeodesy::direct(pt1, left_hdg, offset), normal ); - w_lights.AddLight( SGGeodesy::direct(pt1, left_hdg, -offset), normal ); + if (dist > 610.0 || dist > rwy.length / 2) { + w_lights.AddLight(SGGeodesy::direct(pt1, left_hdg, offset), normal); + w_lights.AddLight(SGGeodesy::direct(pt1, left_hdg, -offset), normal); } else if (dist > 5.0) { - y_lights.AddLight( SGGeodesy::direct(pt1, left_hdg, offset), normal ); - y_lights.AddLight( SGGeodesy::direct(pt1, left_hdg, -offset), normal ); + y_lights.AddLight(SGGeodesy::direct(pt1, left_hdg, offset), normal); + y_lights.AddLight(SGGeodesy::direct(pt1, left_hdg, -offset), normal); } } //back threshold - if (rwy.threshold[get_thresh1(recip)] > step ) - { + if (rwy.threshold[get_thresh1(recip)] > step) { tstep = (int)(rwy.threshold[get_thresh1(recip)] / step); - for ( i = 0; i < tstep; ++i ) { - y_lights.AddLight( SGGeodesy::direct(pt1, left_hdg, offset), normal ); - y_lights.AddLight( SGGeodesy::direct(pt1, left_hdg, -offset), normal ); + for (i = 0; i < tstep; ++i) { + y_lights.AddLight(SGGeodesy::direct(pt1, left_hdg, offset), normal); + y_lights.AddLight(SGGeodesy::direct(pt1, left_hdg, -offset), normal); pt1 = SGGeodesy::direct(pt1, length_hdg, step); } } //Different intensities if (rwy.edge_lights == 3) { - w_lights.SetType( "RWY_WHITE_LIGHTS" ); - y_lights.SetType( "RWY_YELLOW_LIGHTS" ); - r_lights.SetType( "RWY_RED_LIGHTS" ); - } - else if (rwy.edge_lights == 2) { - w_lights.SetType( "RWY_WHITE_MEDIUM_LIGHTS" ); - y_lights.SetType( "RWY_YELLOW_MEDIUM_LIGHTS" ); - r_lights.SetType( "RWY_RED_MEDIUM_LIGHTS" ); - } - else if (rwy.edge_lights == 1) { - w_lights.SetType( "RWY_WHITE_LOW_LIGHTS" ); - y_lights.SetType( "RWY_YELLOW_LOW_LIGHTS" ); - r_lights.SetType( "RWY_RED_LOW_LIGHTS" ); + w_lights.SetType("RWY_WHITE_LIGHTS"); + y_lights.SetType("RWY_YELLOW_LIGHTS"); + r_lights.SetType("RWY_RED_LIGHTS"); + } else if (rwy.edge_lights == 2) { + w_lights.SetType("RWY_WHITE_MEDIUM_LIGHTS"); + y_lights.SetType("RWY_YELLOW_MEDIUM_LIGHTS"); + r_lights.SetType("RWY_RED_MEDIUM_LIGHTS"); + } else if (rwy.edge_lights == 1) { + w_lights.SetType("RWY_WHITE_LOW_LIGHTS"); + y_lights.SetType("RWY_YELLOW_LOW_LIGHTS"); + r_lights.SetType("RWY_RED_LOW_LIGHTS"); } - result.push_back( w_lights ); - result.push_back( y_lights ); - result.push_back( r_lights ); + result.push_back(w_lights); + result.push_back(y_lights); + result.push_back(r_lights); return result; } // generate threshold lights for displaced/normal runways and with/without light bars -tglightcontour_list Runway::gen_runway_threshold_lights( const int kind, bool recip ) +tglightcontour_list Runway::gen_runway_threshold_lights(const int kind, bool recip) { tgLightContour r_lights; tgLightContour g_lights; @@ -155,7 +151,7 @@ tglightcontour_list Runway::gen_runway_threshold_lights( const int kind, bool re SGGeod ref1, ref2; double length_hdg; - if ( recip ) { + if (recip) { length_hdg = SGMiscd::normalizePeriodic(0, 360, rwy.heading + 180); ref1 = SGGeodesy::direct(GetEnd(), length_hdg, rwy.threshold[get_thresh0(recip)] - 1); ref2 = GetEnd(); @@ -165,8 +161,8 @@ tglightcontour_list Runway::gen_runway_threshold_lights( const int kind, bool re ref2 = GetStart(); } - SGVec3f normal1 = gen_runway_light_vector( 3.0, recip ); - SGVec3f normal2 = gen_runway_light_vector( 3.0, !recip ); + SGVec3f normal1 = gen_runway_light_vector(3.0, recip); + SGVec3f normal2 = gen_runway_light_vector(3.0, !recip); double left_hdg = SGMiscd::normalizePeriodic(0, 360, length_hdg - 90.0); int divs = (int)(rwy.width + 4) / 3.0; @@ -174,13 +170,13 @@ tglightcontour_list Runway::gen_runway_threshold_lights( const int kind, bool re SGGeod pt1, pt2; double offset = 2 + rwy.width * 0.5; - if ( GetsThreshold(recip) ) { + if (GetsThreshold(recip)) { SGGeod thresh1 = pt1 = SGGeodesy::direct(ref1, left_hdg, offset); SGGeod thresh2 = SGGeodesy::direct(ref1, left_hdg, -offset); // four lights for each side - for ( i = 0; i < 4; ++i ) { - g_lights.AddLight( thresh1, normal1 ); - g_lights.AddLight( thresh2, normal1 ); + for (i = 0; i < 4; ++i) { + g_lights.AddLight(thresh1, normal1); + g_lights.AddLight(thresh2, normal1); // offset 3m towards outside thresh1 = SGGeodesy::direct(thresh1, left_hdg, 3); @@ -190,12 +186,12 @@ tglightcontour_list Runway::gen_runway_threshold_lights( const int kind, bool re pt1 = SGGeodesy::direct(ref2, left_hdg, offset); } - if ( kind ) { + if (kind) { // Add a green and red threshold lights bar SGGeod redbar = SGGeodesy::direct(ref2, left_hdg, offset); - for ( i = 0; i < divs + 1; ++i ) { - g_lights.AddLight( pt1, normal1 ); - r_lights.AddLight( redbar, normal2 ); + for (i = 0; i < divs + 1; ++i) { + g_lights.AddLight(pt1, normal1); + r_lights.AddLight(redbar, normal2); pt1 = SGGeodesy::direct(pt1, left_hdg, -step); redbar = SGGeodesy::direct(redbar, left_hdg, -step); @@ -207,51 +203,50 @@ tglightcontour_list Runway::gen_runway_threshold_lights( const int kind, bool re pt2 = SGGeodesy::direct(ref2, left_hdg, -offset); // Create groups of four lights in front of the displaced threshold - for ( i = 0; i < 4; ++i ) { - - if (GetsThreshold(recip) ) { - r_lights.AddLight( pt1, normal1); - r_lights.AddLight( pt2, normal1); + for (i = 0; i < 4; ++i) { + if (GetsThreshold(recip)) { + r_lights.AddLight(pt1, normal1); + r_lights.AddLight(pt2, normal1); } else if (!kind) { - g_lights.AddLight( pt1, normal1); - g_lights.AddLight( pt2, normal1); + g_lights.AddLight(pt1, normal1); + g_lights.AddLight(pt2, normal1); } if (!kind) { - r_lights.AddLight( pt1, normal2 ); - r_lights.AddLight( pt2, normal2 ); + r_lights.AddLight(pt1, normal2); + r_lights.AddLight(pt2, normal2); } // offset 3m towards center pt1 = SGGeodesy::direct(pt1, left_hdg, -3); - pt2 = SGGeodesy::direct(pt2, left_hdg, 3); + pt2 = SGGeodesy::direct(pt2, left_hdg, 3); } - g_lights.SetType( "RWY_GREEN_LIGHTS" ); - r_lights.SetType( "RWY_RED_LIGHTS" ); + g_lights.SetType("RWY_GREEN_LIGHTS"); + r_lights.SetType("RWY_RED_LIGHTS"); - result.push_back( g_lights ); - result.push_back( r_lights ); + result.push_back(g_lights); + result.push_back(r_lights); return result; } // generate runway center line lighting, 15m spacing. -tglightcontour_list Runway::gen_runway_center_line_lights( bool recip ) +tglightcontour_list Runway::gen_runway_center_line_lights(bool recip) { tgLightContour w_lights; tgLightContour r_lights; tglightcontour_list result; - SGVec3f normal = gen_runway_light_vector( 3.0, recip ); + SGVec3f normal = gen_runway_light_vector(3.0, recip); SGGeod pt1, pt2; double length_hdg; - if ( recip ) { + if (recip) { length_hdg = SGMiscd::normalizePeriodic(0, 360, rwy.heading + 180); - pt1 = SGGeodesy::direct( GetEnd(), length_hdg, rwy.threshold[get_thresh0(recip)]); + pt1 = SGGeodesy::direct(GetEnd(), length_hdg, rwy.threshold[get_thresh0(recip)]); pt2 = GetStart(); } else { length_hdg = rwy.heading; @@ -264,32 +259,32 @@ tglightcontour_list Runway::gen_runway_center_line_lights( bool recip ) double step = dist / divs; bool use_white = true; - while ( dist > 0.0 ) { - if ( dist > 900.0 ) { - w_lights.AddLight( pt1, normal ); - } else if ( dist > 300.0 ) { - if ( use_white ) { - w_lights.AddLight( pt1, normal ); + while (dist > 0.0) { + if (dist > 900.0) { + w_lights.AddLight(pt1, normal); + } else if (dist > 300.0) { + if (use_white) { + w_lights.AddLight(pt1, normal); } else { - r_lights.AddLight( pt1, normal ); + r_lights.AddLight(pt1, normal); } use_white = !use_white; } else { - r_lights.AddLight( pt1, normal ); + r_lights.AddLight(pt1, normal); } length_hdg = SGGeodesy::courseDeg(pt1, pt2); pt1 = SGGeodesy::direct(pt1, length_hdg, step); dist -= step; } - if ( w_lights.ContourSize() ) { - w_lights.SetType( "RWY_WHITE_MEDIUM_LIGHTS" ); - result.push_back( w_lights ); + if (w_lights.ContourSize()) { + w_lights.SetType("RWY_WHITE_MEDIUM_LIGHTS"); + result.push_back(w_lights); } - if ( r_lights.ContourSize() ) { - r_lights.SetType( "RWY_RED_MEDIUM_LIGHTS" ); - result.push_back( r_lights ); + if (r_lights.ContourSize()) { + r_lights.SetType("RWY_RED_MEDIUM_LIGHTS"); + result.push_back(r_lights); } return result; @@ -297,18 +292,18 @@ tglightcontour_list Runway::gen_runway_center_line_lights( bool recip ) // generate touch down zone lights -tgLightContour Runway::gen_touchdown_zone_lights( bool recip ) +tgLightContour Runway::gen_touchdown_zone_lights(bool recip) { tgLightContour lights; - SGVec3f normal = gen_runway_light_vector( 3.0, recip ); + SGVec3f normal = gen_runway_light_vector(3.0, recip); // determine the start point. SGGeod ref; double length_hdg, left_hdg; - if ( recip ) { + if (recip) { length_hdg = SGMiscd::normalizePeriodic(0, 360, rwy.heading + 180); - ref = SGGeodesy::direct( GetEnd(), length_hdg, rwy.threshold[get_thresh0(recip)]); + ref = SGGeodesy::direct(GetEnd(), length_hdg, rwy.threshold[get_thresh0(recip)]); } else { length_hdg = rwy.heading; ref = SGGeodesy::direct(GetStart(), length_hdg, rwy.threshold[get_thresh0(recip)]); @@ -321,45 +316,45 @@ tgLightContour Runway::gen_touchdown_zone_lights( bool recip ) int rows = (int)(rwy.length * 0.5) / 30; if (rows > 30) rows = 30; - for ( int i = 0; i < rows; ++i ) { + for (int i = 0; i < rows; ++i) { // offset 30m upwind - ref = SGGeodesy::direct( ref, length_hdg, 30 ); + ref = SGGeodesy::direct(ref, length_hdg, 30); SGGeod pt1 = ref; // left side bar - pt1 = SGGeodesy::direct( pt1, left_hdg, 11 ); - lights.AddLight( pt1, normal ); + pt1 = SGGeodesy::direct(pt1, left_hdg, 11); + lights.AddLight(pt1, normal); - pt1 = SGGeodesy::direct( pt1, left_hdg, 1.5 ); - lights.AddLight( pt1, normal ); + pt1 = SGGeodesy::direct(pt1, left_hdg, 1.5); + lights.AddLight(pt1, normal); - pt1 = SGGeodesy::direct( pt1, left_hdg, 1.5 ); - lights.AddLight( pt1, normal ); + pt1 = SGGeodesy::direct(pt1, left_hdg, 1.5); + lights.AddLight(pt1, normal); pt1 = ref; // right side bar - pt1 = SGGeodesy::direct( pt1, left_hdg, -11 ); - lights.AddLight( pt1, normal ); + pt1 = SGGeodesy::direct(pt1, left_hdg, -11); + lights.AddLight(pt1, normal); - pt1 = SGGeodesy::direct( pt1, left_hdg, -1.5 ); - lights.AddLight( pt1, normal ); + pt1 = SGGeodesy::direct(pt1, left_hdg, -1.5); + lights.AddLight(pt1, normal); - pt1 = SGGeodesy::direct( pt1, left_hdg, -1.5 ); - lights.AddLight( pt1, normal ); + pt1 = SGGeodesy::direct(pt1, left_hdg, -1.5); + lights.AddLight(pt1, normal); } - lights.SetType( "RWY_WHITE_LIGHTS" ); + lights.SetType("RWY_WHITE_LIGHTS"); - return lights;; + return lights; } // generate REIL lights -tgLightContour Runway::gen_reil( const int kind, bool recip ) +tgLightContour Runway::gen_reil(const int kind, bool recip) { tgLightContour lights; - string flag = rwy.rwnum[get_thresh0(recip)]; + std::string flag = rwy.rwnum[get_thresh0(recip)]; SGVec3f normal; if (kind == 1) { @@ -367,15 +362,15 @@ tgLightContour Runway::gen_reil( const int kind, bool recip ) normal = normalize(SGVec3f::fromGeod(GetStart())); } else { // unidirectional lights - normal = gen_runway_light_vector( 10, recip ); + normal = gen_runway_light_vector(10, recip); } // determine the start point. SGGeod ref; double length_hdg, left_hdg; - if ( recip ) { + if (recip) { length_hdg = SGMiscd::normalizePeriodic(0, 360, rwy.heading + 180); - ref = SGGeodesy::direct( GetEnd(), length_hdg, rwy.threshold[get_thresh0(recip)] - 1); + ref = SGGeodesy::direct(GetEnd(), length_hdg, rwy.threshold[get_thresh0(recip)] - 1); } else { length_hdg = rwy.heading; ref = SGGeodesy::direct(GetStart(), length_hdg, rwy.threshold[get_thresh0(recip)] - 1); @@ -385,37 +380,37 @@ tgLightContour Runway::gen_reil( const int kind, bool recip ) double offset = rwy.width * 0.5 + 12; // left light - lights.AddLight( SGGeodesy::direct( ref, left_hdg, offset ), normal ); + lights.AddLight(SGGeodesy::direct(ref, left_hdg, offset), normal); // right light - lights.AddLight( SGGeodesy::direct( ref, left_hdg, -offset ), normal ); + lights.AddLight(SGGeodesy::direct(ref, left_hdg, -offset), normal); - lights.SetType( "RWY_REIL_LIGHTS" ); - lights.SetFlag( flag ); + lights.SetType("RWY_REIL_LIGHTS"); + lights.SetFlag(flag); return lights; } // generate Calvert-I/II approach lighting schemes -tglightcontour_list Runway::gen_calvert( const string &kind, bool recip ) +tglightcontour_list Runway::gen_calvert(const std::string& kind, bool recip) { tgLightContour w_lights; tgLightContour r_lights; - string flag; + std::string flag; - SGVec3f normal = gen_runway_light_vector( 3.0, recip ); + SGVec3f normal = gen_runway_light_vector(3.0, recip); // Generate long center bar of lights // determine the start point. SGGeod ref_save, pt; double length_hdg, left_hdg; - if ( recip ) { + if (recip) { length_hdg = SGMiscd::normalizePeriodic(0, 360, rwy.heading + 180); - ref_save = SGGeodesy::direct( GetEnd(), length_hdg, rwy.threshold[get_thresh0(recip)] ); + ref_save = SGGeodesy::direct(GetEnd(), length_hdg, rwy.threshold[get_thresh0(recip)]); } else { length_hdg = rwy.heading; - ref_save = SGGeodesy::direct( GetStart(), length_hdg, rwy.threshold[get_thresh0(recip)] ); + ref_save = SGGeodesy::direct(GetStart(), length_hdg, rwy.threshold[get_thresh0(recip)]); } left_hdg = SGMiscd::normalizePeriodic(0, 360, length_hdg - 90.0); @@ -430,95 +425,94 @@ tglightcontour_list Runway::gen_calvert( const string &kind, bool recip ) const double vert_space = 30; const double horiz_space = 10; - const int count=30; + const int count = 30; SGGeod crossbar[5]; SGGeod pair; // first set of single lights pt = ref; - for ( int i = 0; i < count; ++i ) { + for (int i = 0; i < count; ++i) { // centre lights pt = SGGeodesy::direct(pt, length_hdg, -vert_space); - if ( i >= 10 && i < 20 ) { - w_lights.AddLight( SGGeodesy::direct(pt, left_hdg, horiz_space/2), normal ); - w_lights.AddLight( SGGeodesy::direct(pt, left_hdg, -horiz_space/2), normal ); + if (i >= 10 && i < 20) { + w_lights.AddLight(SGGeodesy::direct(pt, left_hdg, horiz_space / 2), normal); + w_lights.AddLight(SGGeodesy::direct(pt, left_hdg, -horiz_space / 2), normal); } else if (i >= 20) { - w_lights.AddLight( pt, normal); - w_lights.AddLight( SGGeodesy::direct(pt, left_hdg, horiz_space), normal ); - w_lights.AddLight( SGGeodesy::direct(pt, left_hdg, -horiz_space), normal ); - } else if (i < 10 && kind == "1" ) { - w_lights.AddLight( pt, normal); + w_lights.AddLight(pt, normal); + w_lights.AddLight(SGGeodesy::direct(pt, left_hdg, horiz_space), normal); + w_lights.AddLight(SGGeodesy::direct(pt, left_hdg, -horiz_space), normal); + } else if (i < 10 && kind == "1") { + w_lights.AddLight(pt, normal); } else { // cal2 has red centre lights - r_lights.AddLight( pt, normal); + r_lights.AddLight(pt, normal); } - switch ( i ) { - case 4: - crossbar[0] = pt; - break; - case 9: - crossbar[1] = pt; - break; - case 14: - crossbar[2] = pt; - break; - case 19: - crossbar[3] = pt; - break; - case 24: - crossbar[4] = pt; - break; + switch (i) { + case 4: + crossbar[0] = pt; + break; + case 9: + crossbar[1] = pt; + break; + case 14: + crossbar[2] = pt; + break; + case 19: + crossbar[3] = pt; + break; + case 24: + crossbar[4] = pt; + break; } - } - if ( kind == "2" ) { + if (kind == "2") { // add some red and white bars in the 300m area // in front of the threshold ref = ref_save; - for ( int i = 0; i < 9; ++i ) { + for (int i = 0; i < 9; ++i) { // offset upwind - ref = SGGeodesy::direct( ref, length_hdg, -vert_space ); + ref = SGGeodesy::direct(ref, length_hdg, -vert_space); pt = ref; // left side bar - pt = SGGeodesy::direct( pt, left_hdg, 1.5 ); - w_lights.AddLight( pt, normal); + pt = SGGeodesy::direct(pt, left_hdg, 1.5); + w_lights.AddLight(pt, normal); - pt = SGGeodesy::direct( pt, left_hdg, 1.5 ); - w_lights.AddLight( pt, normal); + pt = SGGeodesy::direct(pt, left_hdg, 1.5); + w_lights.AddLight(pt, normal); pt = ref; - pt = SGGeodesy::direct( pt, left_hdg, 11 ); - r_lights.AddLight( pt, normal); + pt = SGGeodesy::direct(pt, left_hdg, 11); + r_lights.AddLight(pt, normal); - pt = SGGeodesy::direct( pt, left_hdg, 1.5 ); - r_lights.AddLight( pt, normal); + pt = SGGeodesy::direct(pt, left_hdg, 1.5); + r_lights.AddLight(pt, normal); - pt = SGGeodesy::direct( pt, left_hdg, 1.5 ); - r_lights.AddLight( pt, normal); + pt = SGGeodesy::direct(pt, left_hdg, 1.5); + r_lights.AddLight(pt, normal); pt = ref; // right side bar - pt = SGGeodesy::direct( pt, left_hdg, -1.5 ); - w_lights.AddLight( pt, normal); + pt = SGGeodesy::direct(pt, left_hdg, -1.5); + w_lights.AddLight(pt, normal); - pt = SGGeodesy::direct( pt, left_hdg, -1.5 ); - w_lights.AddLight( pt, normal); + pt = SGGeodesy::direct(pt, left_hdg, -1.5); + w_lights.AddLight(pt, normal); pt = ref; - pt = SGGeodesy::direct( pt, left_hdg, -11 ); - r_lights.AddLight( pt, normal); + pt = SGGeodesy::direct(pt, left_hdg, -11); + r_lights.AddLight(pt, normal); - pt = SGGeodesy::direct( pt, left_hdg, -1.5 ); - r_lights.AddLight( pt, normal); + pt = SGGeodesy::direct(pt, left_hdg, -1.5); + r_lights.AddLight(pt, normal); - pt = SGGeodesy::direct( pt, left_hdg, -1.5 ); - r_lights.AddLight( pt, normal); + pt = SGGeodesy::direct(pt, left_hdg, -1.5); + r_lights.AddLight(pt, normal); } } @@ -526,34 +520,34 @@ tglightcontour_list Runway::gen_calvert( const string &kind, bool recip ) int num_lights = 0; // draw nice crossbars - for ( int i = 0; i < 5; ++i ) { - switch ( i ) { - case 0: - num_lights = 4; - break; - case 1: - num_lights = 5; - break; - case 2: - num_lights = 6; - break; - case 3: - num_lights = 7; - break; - case 4: - num_lights = 8; - break; + for (int i = 0; i < 5; ++i) { + switch (i) { + case 0: + num_lights = 4; + break; + case 1: + num_lights = 5; + break; + case 2: + num_lights = 6; + break; + case 3: + num_lights = 7; + break; + case 4: + num_lights = 8; + break; } pt = crossbar[i]; - for ( int j = 0 ; j < num_lights; ++j ) { + for (int j = 0; j < num_lights; ++j) { // left side lights pt = SGGeodesy::direct(pt, left_hdg, horiz_space); w_lights.AddLight(pt, normal); } pt = crossbar[i]; - for ( int j = 0; j < num_lights; ++j ) { + for (int j = 0; j < num_lights; ++j) { // right side lights pt = SGGeodesy::direct(pt, left_hdg, -horiz_space); w_lights.AddLight(pt, normal); @@ -561,44 +555,44 @@ tglightcontour_list Runway::gen_calvert( const string &kind, bool recip ) } tglightcontour_list result; - r_lights.SetType( "RWY_RED_LIGHTS" ); - w_lights.SetType( "RWY_WHITE_LIGHTS" ); + r_lights.SetType("RWY_RED_LIGHTS"); + w_lights.SetType("RWY_WHITE_LIGHTS"); - result.push_back( r_lights ); - result.push_back( w_lights ); + result.push_back(r_lights); + result.push_back(w_lights); return result; } // generate ALSF-I/II and SALS/SALSF approach lighting schemes -tglightcontour_list Runway::gen_alsf( const string &kind, bool recip ) +tglightcontour_list Runway::gen_alsf(const std::string& kind, bool recip) { tgLightContour g_lights; tgLightContour w_lights; tgLightContour r_lights; tgLightContour s_lights; int i; - string flag; + std::string flag; - SGVec3f normal = gen_runway_light_vector( 3.0, recip ); + SGVec3f normal = gen_runway_light_vector(3.0, recip); // Generate long center bar of lights // determine the start point. SGGeod ref_save, pt; double length_hdg, left_hdg; - if ( recip ) { + if (recip) { length_hdg = SGMiscd::normalizePeriodic(0, 360, rwy.heading + 180); - ref_save = SGGeodesy::direct( GetEnd(), length_hdg, rwy.threshold[get_thresh0(recip)]); + ref_save = SGGeodesy::direct(GetEnd(), length_hdg, rwy.threshold[get_thresh0(recip)]); } else { length_hdg = rwy.heading; - ref_save = SGGeodesy::direct( GetStart(), length_hdg, rwy.threshold[get_thresh0(recip)]); + ref_save = SGGeodesy::direct(GetStart(), length_hdg, rwy.threshold[get_thresh0(recip)]); } left_hdg = SGMiscd::normalizePeriodic(0, 360, length_hdg - 90.0); SGGeod ref = ref_save; int count; - if ( kind == "1" || kind == "2" ) { + if (kind == "1" || kind == "2") { // ALSF-I or ALSF-II ref = SGGeodesy::direct(ref, length_hdg, -30); count = 30; @@ -608,7 +602,7 @@ tglightcontour_list Runway::gen_alsf( const string &kind, bool recip ) count = 13; } - for ( i = 0; i < count; ++i ) { + for (i = 0; i < count; ++i) { pt = ref; w_lights.AddLight(pt, normal); @@ -633,7 +627,7 @@ tglightcontour_list Runway::gen_alsf( const string &kind, bool recip ) ref = ref_save; - if ( kind == "1" || kind == "O" || kind == "P" ) { + if (kind == "1" || kind == "O" || kind == "P") { // Terminating bar // offset 60m downwind @@ -662,10 +656,10 @@ tglightcontour_list Runway::gen_alsf( const string &kind, bool recip ) pt = SGGeodesy::direct(pt, left_hdg, -1.5); r_lights.AddLight(pt, normal); - } else if ( kind == "2" ) { + } else if (kind == "2") { // Generate red side row lights - for ( i = 0; i < 9; ++i ) { + for (i = 0; i < 9; ++i) { // offset 30m downwind ref = SGGeodesy::direct(ref, length_hdg, -30); @@ -695,7 +689,7 @@ tglightcontour_list Runway::gen_alsf( const string &kind, bool recip ) } } - if ( kind == "1" || kind == "O" || kind == "P" ) { + if (kind == "1" || kind == "O" || kind == "P") { // Generate pre-threshold bar ref = ref_save; @@ -705,7 +699,7 @@ tglightcontour_list Runway::gen_alsf( const string &kind, bool recip ) // left 5 side lights pt = SGGeodesy::direct(pt, left_hdg, 22.5); - for ( i = 0; i < 5; ++i ) { + for (i = 0; i < 5; ++i) { r_lights.AddLight(pt, normal); pt = SGGeodesy::direct(pt, left_hdg, 1.0); } @@ -713,11 +707,11 @@ tglightcontour_list Runway::gen_alsf( const string &kind, bool recip ) // right 5 side lights pt = SGGeodesy::direct(pt, left_hdg, -22.5); - for ( i = 0; i < 5; ++i ) { + for (i = 0; i < 5; ++i) { r_lights.AddLight(pt, normal); pt = SGGeodesy::direct(pt, left_hdg, -1.0); } - } else if ( kind == "2" ) { + } else if (kind == "2") { // Generate -150m extra horizontal row of lights ref = ref_save; @@ -728,7 +722,7 @@ tglightcontour_list Runway::gen_alsf( const string &kind, bool recip ) // left 4 side lights pt = SGGeodesy::direct(pt, left_hdg, 4.25); - for ( i = 0; i < 4; ++i ) { + for (i = 0; i < 4; ++i) { w_lights.AddLight(pt, normal); pt = SGGeodesy::direct(pt, left_hdg, 1.5); } @@ -737,7 +731,7 @@ tglightcontour_list Runway::gen_alsf( const string &kind, bool recip ) // right 4 side lights pt = SGGeodesy::direct(pt, left_hdg, -4.25); - for ( i = 0; i < 4; ++i ) { + for (i = 0; i < 4; ++i) { w_lights.AddLight(pt, normal); pt = SGGeodesy::direct(pt, left_hdg, -1.5); } @@ -745,7 +739,7 @@ tglightcontour_list Runway::gen_alsf( const string &kind, bool recip ) ref = ref_save; - if ( kind == "O" || kind == "P" ) { + if (kind == "O" || kind == "P") { // generate SALS secondary threshold ref = SGGeodesy::direct(ref, length_hdg, -60); @@ -778,7 +772,7 @@ tglightcontour_list Runway::gen_alsf( const string &kind, bool recip ) // left 8 side lights pt = SGGeodesy::direct(pt, left_hdg, 4.5); - for ( i = 0; i < 8; ++i ) { + for (i = 0; i < 8; ++i) { w_lights.AddLight(pt, normal); pt = SGGeodesy::direct(pt, left_hdg, 1.5); } @@ -787,30 +781,30 @@ tglightcontour_list Runway::gen_alsf( const string &kind, bool recip ) // right 8 side lights pt = SGGeodesy::direct(pt, left_hdg, -4.5); - for ( i = 0; i < 8; ++i ) { + for (i = 0; i < 8; ++i) { w_lights.AddLight(pt, normal); pt = SGGeodesy::direct(pt, left_hdg, -1.5); } ref = ref_save; - if ( kind == "1" || kind == "2" ) { + if (kind == "1" || kind == "2") { // generate rabbit lights // start 300m downwind ref = SGGeodesy::direct(ref, length_hdg, -300); - for ( i = 0; i < 21; ++i ) { + for (i = 0; i < 21; ++i) { s_lights.AddLight(ref, normal); // offset 30m downwind ref = SGGeodesy::direct(ref, length_hdg, -30); } - } else if ( kind == "P" ) { + } else if (kind == "P") { // generate 3 sequenced lights aligned with last 3 light bars // start 390m downwind ref = SGGeodesy::direct(ref, length_hdg, -390); - for ( i = 0; i < 3; ++i ) { + for (i = 0; i < 3; ++i) { s_lights.AddLight(ref, normal); // offset 30m downwind @@ -820,31 +814,31 @@ tglightcontour_list Runway::gen_alsf( const string &kind, bool recip ) tglightcontour_list result; - g_lights.SetType( "RWY_GREEN_LIGHTS" ); - w_lights.SetType( "RWY_WHITE_LIGHTS" ); - r_lights.SetType( "RWY_RED_LIGHTS" ); + g_lights.SetType("RWY_GREEN_LIGHTS"); + w_lights.SetType("RWY_WHITE_LIGHTS"); + r_lights.SetType("RWY_RED_LIGHTS"); - result.push_back( g_lights ); - result.push_back( w_lights ); - result.push_back( r_lights ); + result.push_back(g_lights); + result.push_back(w_lights); + result.push_back(r_lights); - if ( s_lights.ContourSize() ) { - s_lights.SetType( "RWY_SEQUENCED_LIGHTS"); - result.push_back( s_lights ); + if (s_lights.ContourSize()) { + s_lights.SetType("RWY_SEQUENCED_LIGHTS"); + result.push_back(s_lights); } return result; } -// generate ODALS or RAIL lights. Main differende between the two: +// generate ODALS or RAIL lights. Main difference between the two: // ODALS is omnidirectional, RAIL is unidirectional -tgLightContour Runway::gen_odals( const int kind, bool recip ) +tgLightContour Runway::gen_odals(const int kind, bool recip) { tgLightContour lights; int i; - string material; + std::string material; SGVec3f normal; if (kind == 0) { @@ -854,7 +848,7 @@ tgLightContour Runway::gen_odals( const int kind, bool recip ) material = "RWY_ODALS_LIGHTS"; } else { // RAIL lights are directional - normal = gen_runway_light_vector( 3.0, recip ); + normal = gen_runway_light_vector(3.0, recip); material = "RWY_SEQUENCED_LIGHTS"; } @@ -862,31 +856,31 @@ tgLightContour Runway::gen_odals( const int kind, bool recip ) SGGeod ref; double length_hdg, left_hdg; - if ( recip ) { + if (recip) { length_hdg = SGMiscd::normalizePeriodic(0, 360, rwy.heading + 180); - ref = SGGeodesy::direct( GetEnd(), length_hdg, rwy.threshold[get_thresh0(recip)] ); + ref = SGGeodesy::direct(GetEnd(), length_hdg, rwy.threshold[get_thresh0(recip)]); } else { length_hdg = rwy.heading; - ref = SGGeodesy::direct( GetStart(), length_hdg, rwy.threshold[get_thresh0(recip)] ); + ref = SGGeodesy::direct(GetStart(), length_hdg, rwy.threshold[get_thresh0(recip)]); } left_hdg = SGMiscd::normalizePeriodic(0, 360, length_hdg - 90.0); double offset = rwy.width / 2 + 14; if (kind == 0) { // offset 14m left of runway - lights.AddLight( SGGeodesy::direct(ref, left_hdg, offset), normal); + lights.AddLight(SGGeodesy::direct(ref, left_hdg, offset), normal); // offset 14m right of runway - lights.AddLight( SGGeodesy::direct(ref, left_hdg, -offset), normal); + lights.AddLight(SGGeodesy::direct(ref, left_hdg, -offset), normal); } - for ( i = 0; i < 5; ++i ) { + for (i = 0; i < 5; ++i) { // offset 90m downwind - ref = SGGeodesy::direct( ref, length_hdg, -90 ); + ref = SGGeodesy::direct(ref, length_hdg, -90); lights.AddLight(ref, normal); } - lights.SetType( material ); + lights.SetType(material); return lights; } @@ -894,33 +888,33 @@ tgLightContour Runway::gen_odals( const int kind, bool recip ) // generate SSALS, SSALF, and SSALR approach lighting scheme (kind = // S, F, or R) -tglightcontour_list Runway::gen_ssalx( const string& kind, bool recip ) +tglightcontour_list Runway::gen_ssalx(const std::string& kind, bool recip) { tgLightContour g_lights; tgLightContour w_lights; tgLightContour r_lights; tgLightContour s_lights; int i; - string flag; + std::string flag; - SGVec3f normal = gen_runway_light_vector( 3.0, recip ); + SGVec3f normal = gen_runway_light_vector(3.0, recip); SGGeod ref_save, pt; // Generate long center bar of lights (every 200') // determine the start point. double length_hdg, left_hdg; - if ( recip ) { + if (recip) { length_hdg = SGMiscd::normalizePeriodic(0, 360, rwy.heading + 180); - ref_save = SGGeodesy::direct( GetEnd(), length_hdg, rwy.threshold[get_thresh0(recip)] ); + ref_save = SGGeodesy::direct(GetEnd(), length_hdg, rwy.threshold[get_thresh0(recip)]); } else { length_hdg = rwy.heading; - ref_save = SGGeodesy::direct( GetStart(), length_hdg, rwy.threshold[get_thresh0(recip)] ); + ref_save = SGGeodesy::direct(GetStart(), length_hdg, rwy.threshold[get_thresh0(recip)]); } left_hdg = SGMiscd::normalizePeriodic(0, 360, length_hdg - 90.0); SGGeod ref = ref_save; - for ( i = 0; i < 7; ++i ) { + for (i = 0; i < 7; ++i) { // offset 60m downwind ref = SGGeodesy::direct(ref, length_hdg, -60); @@ -950,7 +944,7 @@ tglightcontour_list Runway::gen_ssalx( const string& kind, bool recip ) // left 5 side lights pt = SGGeodesy::direct(pt, left_hdg, 4.5); - for ( i = 0; i < 5; ++i ) { + for (i = 0; i < 5; ++i) { w_lights.AddLight(pt, normal); pt = SGGeodesy::direct(pt, left_hdg, 1.5); } @@ -958,32 +952,32 @@ tglightcontour_list Runway::gen_ssalx( const string& kind, bool recip ) pt = ref; // right 5 side lights pt = SGGeodesy::direct(pt, left_hdg, -4.5); - for ( i = 0; i < 5; ++i ) { + for (i = 0; i < 5; ++i) { w_lights.AddLight(pt, normal); pt = SGGeodesy::direct(pt, left_hdg, -1.5); } - if ( kind == "R" ) { + if (kind == "R") { // generate 8 rabbit lights ref = ref_save; // start 480m downwind ref = SGGeodesy::direct(ref, length_hdg, -480); - for ( i = 0; i < 8; ++i ) { + for (i = 0; i < 8; ++i) { s_lights.AddLight(ref, normal); // offset 60m downwind ref = SGGeodesy::direct(ref, length_hdg, -60); } - } else if ( kind == "F" ) { + } else if (kind == "F") { // generate 3 sequenced lights aligned with last 3 light bars ref = ref_save; // start 300m downwind ref = SGGeodesy::direct(ref, length_hdg, -300); - for ( i = 0; i < 3; ++i ) { + for (i = 0; i < 3; ++i) { s_lights.AddLight(ref, normal); // offset 60m downwind @@ -992,17 +986,17 @@ tglightcontour_list Runway::gen_ssalx( const string& kind, bool recip ) } tglightcontour_list result; - g_lights.SetType( "RWY_GREEN_LIGHTS" ); - w_lights.SetType( "RWY_WHITE_LIGHTS" ); - r_lights.SetType( "RWY_RED_LIGHTS" ); + g_lights.SetType("RWY_GREEN_LIGHTS"); + w_lights.SetType("RWY_WHITE_LIGHTS"); + r_lights.SetType("RWY_RED_LIGHTS"); - result.push_back( g_lights ); - result.push_back( w_lights ); - result.push_back( r_lights ); + result.push_back(g_lights); + result.push_back(w_lights); + result.push_back(r_lights); - if ( s_lights.ContourSize() ) { - s_lights.SetType( "RWY_SEQUENCED_LIGHTS" ); - result.push_back( s_lights ); + if (s_lights.ContourSize()) { + s_lights.SetType("RWY_SEQUENCED_LIGHTS"); + result.push_back(s_lights); } return result; @@ -1011,32 +1005,32 @@ tglightcontour_list Runway::gen_ssalx( const string& kind, bool recip ) // generate MALS, MALSF, and MALSR approach lighting scheme (kind = // ' ', F, or R) -tglightcontour_list Runway::gen_malsx( const string& kind, bool recip ) +tglightcontour_list Runway::gen_malsx(const std::string& kind, bool recip) { tgLightContour g_lights; tgLightContour w_lights; tgLightContour r_lights; tgLightContour s_lights; int i; - string flag; + std::string flag; - SGVec3f normal = gen_runway_light_vector( 3.0, recip ); + SGVec3f normal = gen_runway_light_vector(3.0, recip); // Generate long center bar of lights (every 60m) // determine the start point. SGGeod ref_save, pt; double length_hdg, left_hdg; - if ( recip ) { + if (recip) { length_hdg = SGMiscd::normalizePeriodic(0, 360, rwy.heading + 180); - ref_save = SGGeodesy::direct( GetEnd(), length_hdg, rwy.threshold[get_thresh0(recip)] ); + ref_save = SGGeodesy::direct(GetEnd(), length_hdg, rwy.threshold[get_thresh0(recip)]); } else { length_hdg = rwy.heading; - ref_save = SGGeodesy::direct( GetStart(), length_hdg, rwy.threshold[get_thresh0(recip)] ); + ref_save = SGGeodesy::direct(GetStart(), length_hdg, rwy.threshold[get_thresh0(recip)]); } left_hdg = SGMiscd::normalizePeriodic(0, 360, length_hdg - 90.0); SGGeod ref = ref_save; - for ( i = 0; i < 7; ++i ) { + for (i = 0; i < 7; ++i) { // offset 60m downwind ref = SGGeodesy::direct(ref, length_hdg, -60); @@ -1066,7 +1060,7 @@ tglightcontour_list Runway::gen_malsx( const string& kind, bool recip ) // left 5 side lights pt = SGGeodesy::direct(pt, left_hdg, 6.5); - for ( i = 0; i < 5; ++i ) { + for (i = 0; i < 5; ++i) { w_lights.AddLight(pt, normal); pt = SGGeodesy::direct(pt, left_hdg, 0.75); } @@ -1074,30 +1068,30 @@ tglightcontour_list Runway::gen_malsx( const string& kind, bool recip ) pt = ref; // right 5 side lights pt = SGGeodesy::direct(pt, left_hdg, -6.5); - for ( i = 0; i < 5; ++i ) { + for (i = 0; i < 5; ++i) { w_lights.AddLight(pt, normal); pt = SGGeodesy::direct(pt, left_hdg, -0.75); } - if ( kind == "R" ) { + if (kind == "R") { // generate 5 rabbit lights ref = ref_save; // start 480m downwind ref = SGGeodesy::direct(ref, length_hdg, -480); - for ( i = 0; i < 5; ++i ) { + for (i = 0; i < 5; ++i) { s_lights.AddLight(ref, normal); // offset 60m downwind ref = SGGeodesy::direct(ref, length_hdg, -60); } - } else if ( kind == "F" ) { + } else if (kind == "F") { // generate 3 sequenced lights aligned with last 3 light bars ref = ref_save; // start 300m downwind ref = SGGeodesy::direct(ref, length_hdg, -300); - for ( i = 0; i < 3; ++i ) { + for (i = 0; i < 3; ++i) { s_lights.AddLight(ref, normal); // offset 60m downwind @@ -1106,17 +1100,17 @@ tglightcontour_list Runway::gen_malsx( const string& kind, bool recip ) } tglightcontour_list result; - g_lights.SetType( "RWY_GREEN_LIGHTS" ); - w_lights.SetType( "RWY_WHITE_LIGHTS" ); - r_lights.SetType( "RWY_RED_LIGHTS" ); + g_lights.SetType("RWY_GREEN_LIGHTS"); + w_lights.SetType("RWY_WHITE_LIGHTS"); + r_lights.SetType("RWY_RED_LIGHTS"); - result.push_back( g_lights ); - result.push_back( w_lights ); - result.push_back( r_lights ); + result.push_back(g_lights); + result.push_back(w_lights); + result.push_back(r_lights); - if ( s_lights.ContourSize() ) { - s_lights.SetType( "RWY_SEQUENCED_LIGHTS" ); - result.push_back( s_lights ); + if (s_lights.ContourSize()) { + s_lights.SetType("RWY_SEQUENCED_LIGHTS"); + result.push_back(s_lights); } return result; @@ -1124,8 +1118,8 @@ tglightcontour_list Runway::gen_malsx( const string& kind, bool recip ) // top level runway light generator -void Runway::gen_runway_lights( tglightcontour_list& lights ) { - +void Runway::gen_runway_lights(tglightcontour_list& lights) +{ unsigned int i, side; bool recip; @@ -1137,115 +1131,115 @@ void Runway::gen_runway_lights( tglightcontour_list& lights ) { } // Make edge lighting - if ( rwy.edge_lights ) { - tglightcontour_list s = gen_runway_edge_lights( recip ); - for ( i = 0; i < s.size(); ++i ) { - lights.push_back( s[i] ); + if (rwy.edge_lights) { + tglightcontour_list s = gen_runway_edge_lights(recip); + for (i = 0; i < s.size(); ++i) { + lights.push_back(s[i]); } } // Centerline lighting - if ( rwy.centerline_lights ) { - tglightcontour_list s = gen_runway_center_line_lights( recip ); - for ( i = 0; i < s.size(); ++i ) { - lights.push_back( s[i] ); + if (rwy.centerline_lights) { + tglightcontour_list s = gen_runway_center_line_lights(recip); + for (i = 0; i < s.size(); ++i) { + lights.push_back(s[i]); } } // Touchdown zone lighting - if ( rwy.tz_lights[side] ) { - tgLightContour s = gen_touchdown_zone_lights( recip ); - lights.push_back( s ); + if (rwy.tz_lights[side]) { + tgLightContour s = gen_touchdown_zone_lights(recip); + lights.push_back(s); } // REIL lighting - if ( rwy.reil[side] ) { - tgLightContour s = gen_reil( rwy.reil[side], recip ); - lights.push_back( s ); + if (rwy.reil[side]) { + tgLightContour s = gen_reil(rwy.reil[side], recip); + lights.push_back(s); } // Approach lighting - if ( rwy.approach_lights[side] == 1 /* ALSF-I */ ) { - tglightcontour_list s = gen_alsf( "1", recip ); - for ( i = 0; i < s.size(); ++i ) { - lights.push_back( s[i] ); + if (rwy.approach_lights[side] == 1 /* ALSF-I */) { + tglightcontour_list s = gen_alsf("1", recip); + for (i = 0; i < s.size(); ++i) { + lights.push_back(s[i]); } } - else if ( rwy.approach_lights[side] == 2 /* ALSF-II */ ) { - tglightcontour_list s = gen_alsf( "2", recip ); - for ( i = 0; i < s.size(); ++i ) { - lights.push_back( s[i] ); + else if (rwy.approach_lights[side] == 2 /* ALSF-II */) { + tglightcontour_list s = gen_alsf("2", recip); + for (i = 0; i < s.size(); ++i) { + lights.push_back(s[i]); } } - else if ( rwy.approach_lights[side] == 3 /* Calvert I */ ) { - tglightcontour_list s = gen_calvert( "1", recip ); - for ( i = 0; i < s.size(); ++i ) { - lights.push_back( s[i] ); + else if (rwy.approach_lights[side] == 3 /* Calvert I */) { + tglightcontour_list s = gen_calvert("1", recip); + for (i = 0; i < s.size(); ++i) { + lights.push_back(s[i]); } } - else if ( rwy.approach_lights[side] == 4 /* Calvert II */ ) { - tglightcontour_list s = gen_calvert( "2", recip ); - for ( i = 0; i < s.size(); ++i ) { - lights.push_back( s[i] ); + else if (rwy.approach_lights[side] == 4 /* Calvert II */) { + tglightcontour_list s = gen_calvert("2", recip); + for (i = 0; i < s.size(); ++i) { + lights.push_back(s[i]); } } - else if ( rwy.approach_lights[side] == 5 /* SSALR */ ) { - tglightcontour_list s = gen_ssalx( "R", recip ); - for ( i = 0; i < s.size(); ++i ) { - lights.push_back( s[i] ); + else if (rwy.approach_lights[side] == 5 /* SSALR */) { + tglightcontour_list s = gen_ssalx("R", recip); + for (i = 0; i < s.size(); ++i) { + lights.push_back(s[i]); } } - else if ( rwy.approach_lights[side] == 6 /* SSALF */ ) { - tglightcontour_list s = gen_ssalx( "F", recip ); - for ( i = 0; i < s.size(); ++i ) { - lights.push_back( s[i] ); + else if (rwy.approach_lights[side] == 6 /* SSALF */) { + tglightcontour_list s = gen_ssalx("F", recip); + for (i = 0; i < s.size(); ++i) { + lights.push_back(s[i]); } } // SALS (Essentially ALSF-1 without the lead in rabbit lights, and // a shorter center bar) - else if ( rwy.approach_lights[side] == 7 /* SALS */ ) { - tglightcontour_list s = gen_alsf( "O", recip ); - for ( i = 0; i < s.size(); ++i ) { - lights.push_back( s[i] ); + else if (rwy.approach_lights[side] == 7 /* SALS */) { + tglightcontour_list s = gen_alsf("O", recip); + for (i = 0; i < s.size(); ++i) { + lights.push_back(s[i]); } } - else if ( rwy.approach_lights[side] == 8 /* MALSR */ ) { - tglightcontour_list s = gen_malsx( "R", recip ); - for ( i = 0; i < s.size(); ++i ) { - lights.push_back( s[i] ); + else if (rwy.approach_lights[side] == 8 /* MALSR */) { + tglightcontour_list s = gen_malsx("R", recip); + for (i = 0; i < s.size(); ++i) { + lights.push_back(s[i]); } } - else if ( rwy.approach_lights[side] == 9 /* MALSF */ ) { - tglightcontour_list s = gen_malsx( "F", recip ); - for ( i = 0; i < s.size(); ++i ) { - lights.push_back( s[i] ); + else if (rwy.approach_lights[side] == 9 /* MALSF */) { + tglightcontour_list s = gen_malsx("F", recip); + for (i = 0; i < s.size(); ++i) { + lights.push_back(s[i]); } } - else if ( rwy.approach_lights[side] == 10 /* MALSX */ ) { - tglightcontour_list s = gen_malsx( "x", recip ); - for ( i = 0; i < s.size(); ++i ) { - lights.push_back( s[i] ); + else if (rwy.approach_lights[side] == 10 /* MALSX */) { + tglightcontour_list s = gen_malsx("x", recip); + for (i = 0; i < s.size(); ++i) { + lights.push_back(s[i]); } } - else if ( rwy.approach_lights[side] == 11 /* ODALS Omni-directional approach light system */ ) { - tgLightContour s = gen_odals( 0, recip ); - lights.push_back( s ); + else if (rwy.approach_lights[side] == 11 /* ODALS Omni-directional approach light system */) { + tgLightContour s = gen_odals(0, recip); + lights.push_back(s); } // RAIL: Sequenced strobes with no other approach lights - else if ( rwy.approach_lights[side] == 12 /* RAIL Runway alignment indicator lights */ ) { - tgLightContour s = gen_odals( 1, recip ); - lights.push_back( s ); + else if (rwy.approach_lights[side] == 12 /* RAIL Runway alignment indicator lights */) { + tgLightContour s = gen_odals(1, recip); + lights.push_back(s); } #if 0 @@ -1266,22 +1260,20 @@ void Runway::gen_runway_lights( tglightcontour_list& lights ) { // Approach light systems that have a threshold light bar // use a central routine for its creation - if ( rwy.approach_lights[side] > 0 && rwy.approach_lights[side] < 11) - { - tglightcontour_list s = gen_runway_threshold_lights( 1, recip ); - for ( i = 0; i < s.size(); ++i ) { - lights.push_back( s[i] ); + if (rwy.approach_lights[side] > 0 && rwy.approach_lights[side] < 11) { + tglightcontour_list s = gen_runway_threshold_lights(1, recip); + for (i = 0; i < s.size(); ++i) { + lights.push_back(s[i]); } } // If the runway has edge lights but no approach lights, // or approach lights without a lights bar, // create a simple threshold lighting - if ( rwy.edge_lights && (rwy.approach_lights[side] == 0 || rwy.approach_lights[side] > 10)) - { - tglightcontour_list s = gen_runway_threshold_lights( 0, recip ); - for ( i = 0; i < s.size(); ++i ) { - lights.push_back( s[i] ); + if (rwy.edge_lights && (rwy.approach_lights[side] == 0 || rwy.approach_lights[side] > 10)) { + tglightcontour_list s = gen_runway_threshold_lights(0, recip); + for (i = 0; i < s.size(); ++i) { + lights.push_back(s[i]); } } }