Airport lighting arrangement now factors in displaced thresholds.
This commit is contained in:
parent
4d3cbc5f55
commit
c75fa83c15
8 changed files with 271 additions and 235 deletions
|
@ -221,10 +221,15 @@ TGAptSurface::TGAptSurface( const string& path,
|
|||
double accum = 0.0;
|
||||
for ( int ii = 0; ii < mult; ++ii ) {
|
||||
for ( int jj = 0; jj < mult; ++jj ) {
|
||||
double value = dPts(mult*(i+1) - (mult/2) + ii,
|
||||
mult*(j+1) - (mult/2) + jj).z();
|
||||
SG_LOG( SG_GENERAL, SG_DEBUG, "value = " << value );
|
||||
accum += dPts(mult*(i+1) - (mult/2) + ii,
|
||||
mult*(j+1) - (mult/2) + jj).z();
|
||||
}
|
||||
}
|
||||
SG_LOG( SG_GENERAL, SG_DEBUG,
|
||||
" average = " << accum / (mult*mult) );
|
||||
Pts(i,j) = Point3Df( min_deg.lon() + i * dlon,
|
||||
min_deg.lat() + j * dlat,
|
||||
accum / (mult*mult) );
|
||||
|
|
|
@ -316,13 +316,15 @@ static void build_runway( const TGRunway& rwy_info,
|
|||
|
||||
TGPolygon base, safe_base;
|
||||
if ( rwy_info.really_taxiway ) {
|
||||
base = gen_runway_area_w_extend( rwy_info, 0.0, 10.0, 10.0 );
|
||||
base = gen_runway_area_w_extend( rwy_info, 0.0, 10.0, 0.0, 0.0, 10.0 );
|
||||
// also clear a safe area around the taxiway
|
||||
safe_base = gen_runway_area_w_extend( rwy_info, 0.0, 40.0, 40.0 );
|
||||
safe_base
|
||||
= gen_runway_area_w_extend( rwy_info, 0.0, 40.0, 0.0, 0.0, 40.0 );
|
||||
} else {
|
||||
base = gen_runway_area_w_extend( rwy_info, 0.0, 20.0, 20.0 );
|
||||
base = gen_runway_area_w_extend( rwy_info, 0.0, 20.0, 0.0, 0.0, 20.0 );
|
||||
// also clear a safe area around the runway
|
||||
safe_base = gen_runway_area_w_extend( rwy_info, 0.0, 180.0, 50.0 );
|
||||
safe_base
|
||||
= gen_runway_area_w_extend( rwy_info, 0.0, 180.0, 0.0, 0.0, 50.0 );
|
||||
}
|
||||
*apt_clearing = polygon_union(safe_base, *apt_clearing);
|
||||
|
||||
|
@ -436,10 +438,10 @@ void build_airport( string airport_id, float alt_m,
|
|||
}
|
||||
|
||||
SGBucket b( apt_lon / (double)rwy_count, apt_lat / (double)rwy_count );
|
||||
Point3D center_geod( b.get_center_lon() * SGD_DEGREES_TO_RADIANS,
|
||||
b.get_center_lat() * SGD_DEGREES_TO_RADIANS, 0 );
|
||||
Point3D gbs_center = sgGeodToCart( center_geod );
|
||||
SG_LOG(SG_GENERAL, SG_INFO, b.gen_base_path() << "/" << b.gen_index_str());
|
||||
Point3D center_geod( b.get_center_lon() * SGD_DEGREES_TO_RADIANS,
|
||||
b.get_center_lat() * SGD_DEGREES_TO_RADIANS, 0 );
|
||||
Point3D gbs_center = sgGeodToCart( center_geod );
|
||||
|
||||
// parse taxiways and generate the vertex list
|
||||
runway_list taxiways;
|
||||
|
@ -1140,10 +1142,17 @@ void build_airport( string airport_id, float alt_m,
|
|||
p.setx( geod_nodes[i].x() * SGD_DEGREES_TO_RADIANS );
|
||||
p.sety( geod_nodes[i].y() * SGD_DEGREES_TO_RADIANS );
|
||||
p.setz( geod_nodes[i].z() );
|
||||
wgs84_nodes.push_back( sgGeodToCart( p ) );
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, "geod pt = " << geod_nodes[i] );
|
||||
Point3D cart = sgGeodToCart( p );
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, " cart pt = " << cart );
|
||||
Point3D geod = sgCartToGeod( cart );
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, " remapped goed pt = " << geod );
|
||||
wgs84_nodes.push_back( cart );
|
||||
}
|
||||
float gbs_radius = sgCalcBoundingRadius( gbs_center, wgs84_nodes );
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, "Done with wgs84 node mapping");
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, " center = " << gbs_center
|
||||
<< " radius = " << gbs_radius );
|
||||
|
||||
// null structures
|
||||
group_list fans_v; fans_v.clear();
|
||||
|
|
|
@ -44,7 +44,8 @@ static Point3D gen_runway_light_vector( const TGRunway& rwy_info,
|
|||
double length;
|
||||
|
||||
// Generate the 4 corners of the runway
|
||||
TGPolygon poly_corners = gen_runway_area_w_extend( rwy_info, 0.0, 0.0, 0.0 );
|
||||
TGPolygon poly_corners
|
||||
= gen_runway_area_w_extend( rwy_info, 0.0, 0.0, 0.0, 0.0, 0.0 );
|
||||
point_list corner;
|
||||
for ( int i = 0; i < poly_corners.contour_size( 0 ); ++i ) {
|
||||
corner.push_back( poly_corners.get_pt( 0, i ) );
|
||||
|
@ -99,7 +100,11 @@ static superpoly_list gen_runway_edge_lights( const TGRunway& rwy_info,
|
|||
|
||||
// using TGPolygon is a bit innefficient, but that's what the
|
||||
// routine returns.
|
||||
TGPolygon poly_corners = gen_runway_area_w_extend( rwy_info, 0.0, 2.0, 2.0 );
|
||||
TGPolygon poly_corners
|
||||
= gen_runway_area_w_extend( rwy_info, 0.0, 2.0,
|
||||
rwy_info.disp_thresh1 * SG_FEET_TO_METER,
|
||||
rwy_info.disp_thresh2 * SG_FEET_TO_METER,
|
||||
2.0 );
|
||||
|
||||
point_list corner;
|
||||
for ( i = 0; i < poly_corners.contour_size( 0 ); ++i ) {
|
||||
|
@ -209,7 +214,8 @@ static superpoly_list gen_taxiway_edge_lights( const TGRunway& rwy_info,
|
|||
|
||||
// using TGPolygon is a bit innefficient, but that's what the
|
||||
// routine returns.
|
||||
TGPolygon poly_corners = gen_runway_area_w_extend( rwy_info, 0.0, 2.0, 2.0 );
|
||||
TGPolygon poly_corners
|
||||
= gen_runway_area_w_extend( rwy_info, 0.0, 2.0, 0.0, 0.0, 2.0 );
|
||||
|
||||
point_list corner;
|
||||
for ( i = 0; i < poly_corners.contour_size( 0 ); ++i ) {
|
||||
|
@ -286,7 +292,11 @@ static superpoly_list gen_runway_threshold_lights( const TGRunway& rwy_info,
|
|||
|
||||
// using TGPolygon is a bit innefficient, but that's what the
|
||||
// routine returns.
|
||||
TGPolygon poly_corners = gen_runway_area_w_extend( rwy_info, 0.0, 0.0, 0.0 );
|
||||
TGPolygon poly_corners
|
||||
= gen_runway_area_w_extend( rwy_info, 0.0, 0.0,
|
||||
rwy_info.disp_thresh1 * SG_FEET_TO_METER,
|
||||
rwy_info.disp_thresh2 * SG_FEET_TO_METER,
|
||||
0.0 );
|
||||
|
||||
point_list corner;
|
||||
for ( i = 0; i < poly_corners.contour_size( 0 ); ++i ) {
|
||||
|
@ -418,7 +428,11 @@ static superpoly_list gen_runway_center_line_lights( const TGRunway& rwy_info,
|
|||
|
||||
// using TGPolygon is a bit innefficient, but that's what the
|
||||
// routine returns.
|
||||
TGPolygon poly_corners = gen_runway_area_w_extend( rwy_info, 0.0, 2.0, 2.0 );
|
||||
TGPolygon poly_corners
|
||||
= gen_runway_area_w_extend( rwy_info, 0.0, 2.0,
|
||||
rwy_info.disp_thresh1 * SG_FEET_TO_METER,
|
||||
rwy_info.disp_thresh2 * SG_FEET_TO_METER,
|
||||
2.0 );
|
||||
|
||||
point_list corner;
|
||||
for ( i = 0; i < poly_corners.contour_size( 0 ); ++i ) {
|
||||
|
@ -516,7 +530,8 @@ static superpoly_list gen_taxiway_center_line_lights( const TGRunway& rwy_info,
|
|||
|
||||
// using TGPolygon is a bit innefficient, but that's what the
|
||||
// routine returns.
|
||||
TGPolygon poly_corners = gen_runway_area_w_extend( rwy_info, 0.0, 2.0, 2.0 );
|
||||
TGPolygon poly_corners
|
||||
= gen_runway_area_w_extend( rwy_info, 0.0, 2.0, 0.0, 0.0, 2.0 );
|
||||
|
||||
point_list corner;
|
||||
for ( i = 0; i < poly_corners.contour_size( 0 ); ++i ) {
|
||||
|
@ -584,7 +599,11 @@ static TGSuperPoly gen_touchdown_zone_lights( const TGRunway& rwy_info,
|
|||
|
||||
// using TGPolygon is a bit innefficient, but that's what the
|
||||
// routine returns.
|
||||
TGPolygon poly_corners = gen_runway_area_w_extend( rwy_info, 0.0, 0.0, 0.0 );
|
||||
TGPolygon poly_corners
|
||||
= gen_runway_area_w_extend( rwy_info, 0.0, 0.0,
|
||||
rwy_info.disp_thresh1 * SG_FEET_TO_METER,
|
||||
rwy_info.disp_thresh2 * SG_FEET_TO_METER,
|
||||
0.0 );
|
||||
|
||||
point_list corner;
|
||||
for ( i = 0; i < poly_corners.contour_size( 0 ); ++i ) {
|
||||
|
@ -688,7 +707,11 @@ static TGSuperPoly gen_vasi( const TGRunway& rwy_info, float alt_m,
|
|||
|
||||
// using TGPolygon is a bit innefficient, but that's what the
|
||||
// routine returns.
|
||||
TGPolygon poly_corners = gen_runway_area_w_extend( rwy_info, 0.0, 0.0, 0.0 );
|
||||
TGPolygon poly_corners
|
||||
= gen_runway_area_w_extend( rwy_info, 0.0, 0.0,
|
||||
rwy_info.disp_thresh1 * SG_FEET_TO_METER,
|
||||
rwy_info.disp_thresh2 * SG_FEET_TO_METER,
|
||||
0.0 );
|
||||
|
||||
point_list corner;
|
||||
for ( i = 0; i < poly_corners.contour_size( 0 ); ++i ) {
|
||||
|
@ -829,7 +852,11 @@ static TGSuperPoly gen_papi( const TGRunway& rwy_info, float alt_m,
|
|||
|
||||
// using TGPolygon is a bit innefficient, but that's what the
|
||||
// routine returns.
|
||||
TGPolygon poly_corners = gen_runway_area_w_extend( rwy_info, 0.0, 0.0, 0.0 );
|
||||
TGPolygon poly_corners
|
||||
= gen_runway_area_w_extend( rwy_info, 0.0, 0.0,
|
||||
rwy_info.disp_thresh1 * SG_FEET_TO_METER,
|
||||
rwy_info.disp_thresh2 * SG_FEET_TO_METER,
|
||||
0.0 );
|
||||
|
||||
point_list corner;
|
||||
for ( i = 0; i < poly_corners.contour_size( 0 ); ++i ) {
|
||||
|
@ -925,7 +952,11 @@ static TGSuperPoly gen_reil( const TGRunway& rwy_info, float alt_m,
|
|||
|
||||
// using TGPolygon is a bit innefficient, but that's what the
|
||||
// routine returns.
|
||||
TGPolygon poly_corners = gen_runway_area_w_extend( rwy_info, 0.0, 0.0, 0.0 );
|
||||
TGPolygon poly_corners
|
||||
= gen_runway_area_w_extend( rwy_info, 0.0, 0.0,
|
||||
rwy_info.disp_thresh1 * SG_FEET_TO_METER,
|
||||
rwy_info.disp_thresh2 * SG_FEET_TO_METER,
|
||||
0.0 );
|
||||
|
||||
point_list corner;
|
||||
for ( i = 0; i < poly_corners.contour_size( 0 ); ++i ) {
|
||||
|
@ -997,7 +1028,7 @@ static TGSuperPoly gen_reil( const TGRunway& rwy_info, float alt_m,
|
|||
|
||||
// generate Calvert-I/II approach lighting schemes
|
||||
static superpoly_list gen_calvert( const TGRunway& rwy_info,
|
||||
float alt_m, const string &kind, bool recip )
|
||||
float alt_m, const string &kind, bool recip )
|
||||
{
|
||||
point_list g_lights; g_lights.clear();
|
||||
point_list w_lights; w_lights.clear();
|
||||
|
@ -1009,19 +1040,14 @@ static superpoly_list gen_calvert( const TGRunway& rwy_info,
|
|||
point_list s_normals; s_normals.clear();
|
||||
int i, j;
|
||||
string flag;
|
||||
if (kind == "1")
|
||||
{
|
||||
cout << "gen Calvert lights " << rwy_info.rwy_no << endl;
|
||||
} else if (kind == "2")
|
||||
{
|
||||
if ( kind == "1" ) {
|
||||
cout << "gen Calvert lights " << rwy_info.rwy_no << endl;
|
||||
} else if ( kind == "2" ) {
|
||||
cout << "gen Calvert/II lights " << rwy_info.rwy_no << endl;
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
cout << "gen unknown Calvert lights " << rwy_info.rwy_no << endl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Point3D normal1 = gen_runway_light_vector( rwy_info, 3.0, recip );
|
||||
Point3D normal2 = gen_runway_light_vector( rwy_info, 3.0, !recip );
|
||||
|
||||
|
@ -1032,7 +1058,11 @@ static superpoly_list gen_calvert( const TGRunway& rwy_info,
|
|||
|
||||
// using TGPolygon is a bit innefficient, but that's what the
|
||||
// routine returns.
|
||||
TGPolygon poly_corners = gen_runway_area_w_extend( rwy_info, 0.0, 2.0, 2.0 );
|
||||
TGPolygon poly_corners
|
||||
= gen_runway_area_w_extend( rwy_info, 0.0, 2.0,
|
||||
rwy_info.disp_thresh1 * SG_FEET_TO_METER,
|
||||
rwy_info.disp_thresh2 * SG_FEET_TO_METER,
|
||||
2.0 );
|
||||
|
||||
point_list corner;
|
||||
for ( i = 0; i < poly_corners.contour_size( 0 ); ++i ) {
|
||||
|
@ -1122,152 +1152,129 @@ static superpoly_list gen_calvert( const TGRunway& rwy_info,
|
|||
-1 * CALVERT_HORIZ_SPACING, &lat, &lon, &r );
|
||||
pt = Point3D( lon, lat, 0.0 );
|
||||
|
||||
if (kind == "1" )
|
||||
{
|
||||
if (i >= 10 && i < 20)
|
||||
{
|
||||
|
||||
|
||||
geo_direct_wgs_84 ( alt_m, pt.lat(), pt.lon(), left_hdg,
|
||||
CALVERT_VERT_SPACING/2, &lat, &lon, &r );
|
||||
pair = Point3D( lon, lat, 0.0 );
|
||||
w_lights.push_back( pair );
|
||||
w_normals.push_back( normal1 );
|
||||
if (kind == "1" ) {
|
||||
if ( i >= 10 && i < 20 ) {
|
||||
geo_direct_wgs_84 ( alt_m, pt.lat(), pt.lon(), left_hdg,
|
||||
CALVERT_VERT_SPACING/2, &lat, &lon, &r );
|
||||
pair = Point3D( lon, lat, 0.0 );
|
||||
w_lights.push_back( pair );
|
||||
w_normals.push_back( normal1 );
|
||||
|
||||
geo_direct_wgs_84 ( alt_m, pt.lat(), pt.lon(), left_hdg,
|
||||
-1 * CALVERT_VERT_SPACING/2, &lat, &lon, &r );
|
||||
pair = Point3D( lon, lat, 0.0 );
|
||||
w_lights.push_back( pair );
|
||||
w_normals.push_back( normal1 );
|
||||
geo_direct_wgs_84 ( alt_m, pt.lat(), pt.lon(), left_hdg,
|
||||
-1 * CALVERT_VERT_SPACING/2, &lat, &lon,
|
||||
&r );
|
||||
pair = Point3D( lon, lat, 0.0 );
|
||||
w_lights.push_back( pair );
|
||||
w_normals.push_back( normal1 );
|
||||
} else if (i >= 20) {
|
||||
w_lights.push_back( pt );
|
||||
w_normals.push_back( normal1 );
|
||||
|
||||
geo_direct_wgs_84 ( alt_m, pt.lat(), pt.lon(), left_hdg,
|
||||
CALVERT_VERT_SPACING, &lat, &lon, &r );
|
||||
pair = Point3D( lon, lat, 0.0 );
|
||||
w_lights.push_back( pair );
|
||||
w_normals.push_back( normal1 );
|
||||
|
||||
} else if (i >= 20)
|
||||
{
|
||||
w_lights.push_back( pt );
|
||||
w_normals.push_back( normal1 );
|
||||
|
||||
geo_direct_wgs_84 ( alt_m, pt.lat(), pt.lon(), left_hdg,
|
||||
CALVERT_VERT_SPACING, &lat, &lon, &r );
|
||||
pair = Point3D( lon, lat, 0.0 );
|
||||
w_lights.push_back( pair );
|
||||
w_normals.push_back( normal1 );
|
||||
|
||||
geo_direct_wgs_84 ( alt_m, pt.lat(), pt.lon(), left_hdg,
|
||||
-1 * CALVERT_VERT_SPACING, &lat, &lon, &r );
|
||||
pair = Point3D( lon, lat, 0.0 );
|
||||
w_lights.push_back( pair );
|
||||
w_normals.push_back( normal1 );
|
||||
|
||||
|
||||
|
||||
} else
|
||||
{
|
||||
w_lights.push_back( pt );
|
||||
w_normals.push_back( normal1 );
|
||||
}
|
||||
} else
|
||||
{
|
||||
if (i < 10)
|
||||
{
|
||||
geo_direct_wgs_84 ( alt_m, pt.lat(), pt.lon(), left_hdg,
|
||||
-1 * CALVERT_VERT_SPACING, &lat, &lon, &r );
|
||||
pair = Point3D( lon, lat, 0.0 );
|
||||
w_lights.push_back( pair );
|
||||
w_normals.push_back( normal1 );
|
||||
} else {
|
||||
w_lights.push_back( pt );
|
||||
w_normals.push_back( normal1 );
|
||||
}
|
||||
} else {
|
||||
if ( i < 10 ) {
|
||||
// cal2 has red centre lights
|
||||
r_lights.push_back( pt );
|
||||
r_normals.push_back( normal1 );
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
// cal2 has red centre lights
|
||||
w_lights.push_back( pt );
|
||||
w_normals.push_back( normal1 );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
switch(i)
|
||||
{
|
||||
switch ( i ) {
|
||||
case 4:
|
||||
crossbar[0] = pt;
|
||||
break;
|
||||
crossbar[0] = pt;
|
||||
break;
|
||||
case 9:
|
||||
crossbar[1] = pt;
|
||||
break;
|
||||
crossbar[1] = pt;
|
||||
break;
|
||||
case 14:
|
||||
crossbar[2] = pt;
|
||||
break;
|
||||
crossbar[2] = pt;
|
||||
break;
|
||||
case 19:
|
||||
crossbar[3] = pt;
|
||||
break;
|
||||
crossbar[3] = pt;
|
||||
break;
|
||||
case 24:
|
||||
crossbar[4] = pt;
|
||||
break;
|
||||
crossbar[4] = pt;
|
||||
break;
|
||||
}
|
||||
|
||||
// add 2 more rows if CAL/II (white)
|
||||
//
|
||||
|
||||
|
||||
|
||||
if (kind == "2" )
|
||||
{
|
||||
saved = pt;
|
||||
geo_direct_wgs_84 ( alt_m, pt.lat(), pt.lon(), left_hdg,
|
||||
CALVERT2_VERT_SPACING, &lat, &lon, &r );
|
||||
pt = Point3D( lon, lat, 0.0 );
|
||||
w_lights.push_back( pt );
|
||||
w_normals.push_back( normal1 );
|
||||
if ( kind == "2" ) {
|
||||
saved = pt;
|
||||
geo_direct_wgs_84 ( alt_m, pt.lat(), pt.lon(), left_hdg,
|
||||
CALVERT2_VERT_SPACING, &lat, &lon, &r );
|
||||
pt = Point3D( lon, lat, 0.0 );
|
||||
w_lights.push_back( pt );
|
||||
w_normals.push_back( normal1 );
|
||||
|
||||
// five rows < 300m
|
||||
if (i < 10)
|
||||
{
|
||||
geo_direct_wgs_84 ( alt_m, pt.lat(), pt.lon(), left_hdg,
|
||||
CALVERT2_VERT_SPACING, &lat, &lon, &r );
|
||||
pt = Point3D( lon, lat, 0.0 );
|
||||
w_lights.push_back( pt );
|
||||
w_normals.push_back( normal1 );
|
||||
// five rows < 300m
|
||||
if ( i < 10 ) {
|
||||
geo_direct_wgs_84 ( alt_m, pt.lat(), pt.lon(), left_hdg,
|
||||
CALVERT2_VERT_SPACING, &lat, &lon, &r );
|
||||
pt = Point3D( lon, lat, 0.0 );
|
||||
w_lights.push_back( pt );
|
||||
w_normals.push_back( normal1 );
|
||||
|
||||
// outer strip of lights
|
||||
for (j=0;j<9;j++)
|
||||
{
|
||||
geo_direct_wgs_84 ( alt_m, pt.lat(), pt.lon(), left_hdg,
|
||||
CALVERT2_VERT_SPACING, &lat, &lon, &r );
|
||||
pt = Point3D( lon, lat, 0.0 );
|
||||
if (i == 0 || j > 3)
|
||||
{
|
||||
w_lights.push_back( pt );
|
||||
w_normals.push_back( normal1 );
|
||||
}
|
||||
}
|
||||
}
|
||||
// outer strip of lights
|
||||
for (j=0;j<9;j++) {
|
||||
geo_direct_wgs_84 ( alt_m, pt.lat(), pt.lon(), left_hdg,
|
||||
CALVERT2_VERT_SPACING, &lat, &lon, &r );
|
||||
pt = Point3D( lon, lat, 0.0 );
|
||||
if ( i == 0 || j > 3 ) {
|
||||
w_lights.push_back( pt );
|
||||
w_normals.push_back( normal1 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pt = saved;
|
||||
geo_direct_wgs_84 ( alt_m, pt.lat(), pt.lon(), left_hdg,
|
||||
-1 * CALVERT2_VERT_SPACING, &lat, &lon, &r );
|
||||
pt = Point3D( lon, lat, 0.0 );
|
||||
w_lights.push_back( pt );
|
||||
w_normals.push_back( normal1 );
|
||||
pt = saved;
|
||||
geo_direct_wgs_84 ( alt_m, pt.lat(), pt.lon(), left_hdg,
|
||||
-1 * CALVERT2_VERT_SPACING, &lat, &lon, &r );
|
||||
pt = Point3D( lon, lat, 0.0 );
|
||||
w_lights.push_back( pt );
|
||||
w_normals.push_back( normal1 );
|
||||
|
||||
// five rows < 300m
|
||||
if (i < 10)
|
||||
{
|
||||
geo_direct_wgs_84 ( alt_m, pt.lat(), pt.lon(), left_hdg,
|
||||
-1 * CALVERT2_VERT_SPACING, &lat, &lon, &r );
|
||||
pt = Point3D( lon, lat, 0.0 );
|
||||
w_lights.push_back( pt );
|
||||
w_normals.push_back( normal1 );
|
||||
// outer strip of lights
|
||||
for (j=0;j<9;j++)
|
||||
{
|
||||
geo_direct_wgs_84 ( alt_m, pt.lat(), pt.lon(), left_hdg,
|
||||
-1 * CALVERT2_VERT_SPACING, &lat, &lon, &r );
|
||||
pt = Point3D( lon, lat, 0.0 );
|
||||
if (i == 0 || j > 3)
|
||||
{
|
||||
w_lights.push_back( pt );
|
||||
w_normals.push_back( normal1 );
|
||||
}
|
||||
}
|
||||
}
|
||||
// five rows < 300m
|
||||
if ( i < 10 ) {
|
||||
geo_direct_wgs_84 ( alt_m, pt.lat(), pt.lon(), left_hdg,
|
||||
-1 * CALVERT2_VERT_SPACING, &lat, &lon,
|
||||
&r );
|
||||
pt = Point3D( lon, lat, 0.0 );
|
||||
w_lights.push_back( pt );
|
||||
w_normals.push_back( normal1 );
|
||||
// outer strip of lights
|
||||
for ( j = 0; j < 9; j++ ) {
|
||||
geo_direct_wgs_84 ( alt_m, pt.lat(), pt.lon(), left_hdg,
|
||||
-1 * CALVERT2_VERT_SPACING, &lat, &lon,
|
||||
&r );
|
||||
pt = Point3D( lon, lat, 0.0 );
|
||||
if ( i == 0 || j > 3 ) {
|
||||
w_lights.push_back( pt );
|
||||
w_normals.push_back( normal1 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
pt = saved;
|
||||
pt = saved;
|
||||
|
||||
}
|
||||
ref = pt;
|
||||
|
@ -1277,95 +1284,82 @@ static superpoly_list gen_calvert( const TGRunway& rwy_info,
|
|||
ref = ref_save;
|
||||
|
||||
int spacing;
|
||||
int num_lights;
|
||||
int num_lights = 0;
|
||||
|
||||
// draw nice crossbars
|
||||
for(i=0;i<5;i++)
|
||||
{
|
||||
|
||||
if (kind == "1")
|
||||
{
|
||||
spacing = CALVERT_VERT_SPACING;
|
||||
} else
|
||||
{
|
||||
spacing = CALVERT2_VERT_SPACING;
|
||||
for ( i = 0; i < 5; i++ ) {
|
||||
if (kind == "1") {
|
||||
spacing = CALVERT_VERT_SPACING;
|
||||
} else {
|
||||
spacing = CALVERT2_VERT_SPACING;
|
||||
}
|
||||
switch(i)
|
||||
{
|
||||
switch ( i ) {
|
||||
case 0:
|
||||
num_lights = 4;
|
||||
break;
|
||||
num_lights = 4;
|
||||
break;
|
||||
case 1:
|
||||
num_lights = 5;
|
||||
break;
|
||||
num_lights = 5;
|
||||
break;
|
||||
case 2:
|
||||
num_lights = 6;
|
||||
break;
|
||||
num_lights = 6;
|
||||
break;
|
||||
case 3:
|
||||
num_lights = 7;
|
||||
break;
|
||||
num_lights = 7;
|
||||
break;
|
||||
case 4:
|
||||
num_lights = 8;
|
||||
break;
|
||||
num_lights = 8;
|
||||
break;
|
||||
}
|
||||
|
||||
pt = crossbar[i];
|
||||
for (j=0;j<num_lights;j++)
|
||||
{
|
||||
// left side lights
|
||||
for ( j = 0 ; j < num_lights; j++ ) {
|
||||
// left side lights
|
||||
|
||||
// space out from centre lights
|
||||
if (j==0)
|
||||
{
|
||||
geo_direct_wgs_84 ( alt_m, pt.lat(), pt.lon(), left_hdg,
|
||||
CALVERT_VERT_SPACING * j, &lat, &lon, &r );
|
||||
pt = Point3D( lon, lat, 0.0 );
|
||||
}
|
||||
// space out from centre lights
|
||||
if ( j == 0 ) {
|
||||
geo_direct_wgs_84 ( alt_m, pt.lat(), pt.lon(), left_hdg,
|
||||
CALVERT_VERT_SPACING * j, &lat, &lon, &r );
|
||||
pt = Point3D( lon, lat, 0.0 );
|
||||
}
|
||||
|
||||
geo_direct_wgs_84 ( alt_m, pt.lat(), pt.lon(), left_hdg,
|
||||
spacing, &lat, &lon, &r );
|
||||
pt = Point3D( lon, lat, 0.0 );
|
||||
geo_direct_wgs_84 ( alt_m, pt.lat(), pt.lon(), left_hdg,
|
||||
spacing, &lat, &lon, &r );
|
||||
pt = Point3D( lon, lat, 0.0 );
|
||||
|
||||
if (kind == "1" || i >= 2)
|
||||
{
|
||||
w_lights.push_back( pt );
|
||||
w_normals.push_back( normal1 );
|
||||
} else
|
||||
{
|
||||
r_lights.push_back( pt );
|
||||
r_normals.push_back( normal1 );
|
||||
}
|
||||
if ( kind == "1" || i >= 2 ) {
|
||||
w_lights.push_back( pt );
|
||||
w_normals.push_back( normal1 );
|
||||
} else {
|
||||
r_lights.push_back( pt );
|
||||
r_normals.push_back( normal1 );
|
||||
}
|
||||
}
|
||||
|
||||
pt = crossbar[i];
|
||||
for (j=0;j<num_lights;j++)
|
||||
{
|
||||
// right side lights
|
||||
// space out from centre lights
|
||||
if (j==0)
|
||||
{
|
||||
geo_direct_wgs_84 ( alt_m, pt.lat(), pt.lon(), left_hdg,
|
||||
-1 * CALVERT_VERT_SPACING * j, &lat, &lon, &r );
|
||||
pt = Point3D( lon, lat, 0.0 );
|
||||
}
|
||||
for ( j = 0; j < num_lights; j++ ) {
|
||||
// right side lights
|
||||
// space out from centre lights
|
||||
if ( j == 0 ) {
|
||||
geo_direct_wgs_84 ( alt_m, pt.lat(), pt.lon(), left_hdg,
|
||||
-1 * CALVERT_VERT_SPACING * j, &lat, &lon,
|
||||
&r );
|
||||
pt = Point3D( lon, lat, 0.0 );
|
||||
}
|
||||
|
||||
geo_direct_wgs_84 ( alt_m, pt.lat(), pt.lon(), left_hdg,
|
||||
-1 * spacing, &lat, &lon, &r );
|
||||
pt = Point3D( lon, lat, 0.0 );
|
||||
geo_direct_wgs_84 ( alt_m, pt.lat(), pt.lon(), left_hdg,
|
||||
-1 * spacing, &lat, &lon, &r );
|
||||
pt = Point3D( lon, lat, 0.0 );
|
||||
|
||||
if (kind == "1" || i >= 2)
|
||||
{
|
||||
w_lights.push_back( pt );
|
||||
w_normals.push_back( normal1 );
|
||||
} else
|
||||
{
|
||||
r_lights.push_back( pt );
|
||||
r_normals.push_back( normal1 );
|
||||
}
|
||||
if ( kind == "1" || i >= 2 ) {
|
||||
w_lights.push_back( pt );
|
||||
w_normals.push_back( normal1 );
|
||||
} else {
|
||||
r_lights.push_back( pt );
|
||||
r_normals.push_back( normal1 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
TGPolygon lights_poly; lights_poly.erase();
|
||||
TGPolygon normals_poly; normals_poly.erase();
|
||||
lights_poly.add_contour( g_lights, false );
|
||||
|
@ -1450,7 +1444,11 @@ static superpoly_list gen_alsf( const TGRunway& rwy_info,
|
|||
|
||||
// using TGPolygon is a bit innefficient, but that's what the
|
||||
// routine returns.
|
||||
TGPolygon poly_corners = gen_runway_area_w_extend( rwy_info, 0.0, 2.0, 2.0 );
|
||||
TGPolygon poly_corners
|
||||
= gen_runway_area_w_extend( rwy_info, 0.0, 2.0,
|
||||
rwy_info.disp_thresh1 * SG_FEET_TO_METER,
|
||||
rwy_info.disp_thresh2 * SG_FEET_TO_METER,
|
||||
2.0 );
|
||||
|
||||
point_list corner;
|
||||
for ( i = 0; i < poly_corners.contour_size( 0 ); ++i ) {
|
||||
|
@ -1953,7 +1951,11 @@ static TGSuperPoly gen_odals( const TGRunway& rwy_info, float alt_m,
|
|||
|
||||
// using TGPolygon is a bit innefficient, but that's what the
|
||||
// routine returns.
|
||||
TGPolygon poly_corners = gen_runway_area_w_extend( rwy_info, 0.0, 0.0, 0.0 );
|
||||
TGPolygon poly_corners
|
||||
= gen_runway_area_w_extend( rwy_info, 0.0, 0.0,
|
||||
rwy_info.disp_thresh1 * SG_FEET_TO_METER,
|
||||
rwy_info.disp_thresh2 * SG_FEET_TO_METER,
|
||||
0.0 );
|
||||
|
||||
point_list corner;
|
||||
for ( i = 0; i < poly_corners.contour_size( 0 ); ++i ) {
|
||||
|
@ -2060,7 +2062,11 @@ static superpoly_list gen_ssalx( const TGRunway& rwy_info,
|
|||
|
||||
// using TGPolygon is a bit innefficient, but that's what the
|
||||
// routine returns.
|
||||
TGPolygon poly_corners = gen_runway_area_w_extend( rwy_info, 0.0, 2.0, 2.0 );
|
||||
TGPolygon poly_corners
|
||||
= gen_runway_area_w_extend( rwy_info, 0.0, 2.0,
|
||||
rwy_info.disp_thresh1 * SG_FEET_TO_METER,
|
||||
rwy_info.disp_thresh2 * SG_FEET_TO_METER,
|
||||
2.0 );
|
||||
|
||||
point_list corner;
|
||||
for ( i = 0; i < poly_corners.contour_size( 0 ); ++i ) {
|
||||
|
@ -2326,7 +2332,11 @@ static superpoly_list gen_malsx( const TGRunway& rwy_info,
|
|||
|
||||
// using TGPolygon is a bit innefficient, but that's what the
|
||||
// routine returns.
|
||||
TGPolygon poly_corners = gen_runway_area_w_extend( rwy_info, 0.0, 2.0, 2.0 );
|
||||
TGPolygon poly_corners
|
||||
= gen_runway_area_w_extend( rwy_info, 0.0, 2.0,
|
||||
rwy_info.disp_thresh1 * SG_FEET_TO_METER,
|
||||
rwy_info.disp_thresh2 * SG_FEET_TO_METER,
|
||||
2.0 );
|
||||
|
||||
point_list corner;
|
||||
for ( i = 0; i < poly_corners.contour_size( 0 ); ++i ) {
|
||||
|
|
|
@ -98,6 +98,7 @@ static void help( int argc, char **argv ) {
|
|||
cout << "SRTM-North_America-3\n";
|
||||
cout << "SRTM-South_America-3\n";
|
||||
cout << "SRTM-Eurasia-3\n";
|
||||
cout << "SRTM-Africa-3\n";
|
||||
cout << "DEM-USGS-3\n";
|
||||
cout << "SRTM-30";
|
||||
cout << "\n\n";
|
||||
|
@ -117,7 +118,7 @@ int main( int argc, char **argv ) {
|
|||
string_list elev_src;
|
||||
elev_src.clear();
|
||||
|
||||
sglog().setLogLevels( SG_GENERAL, SG_INFO );
|
||||
sglog().setLogLevels( SG_GENERAL, SG_DEBUG );
|
||||
|
||||
// parse arguments
|
||||
string work_dir = "";
|
||||
|
@ -177,6 +178,7 @@ int main( int argc, char **argv ) {
|
|||
elev_src.push_back( "SRTM-North_America-3" );
|
||||
elev_src.push_back( "SRTM-South_America-3" );
|
||||
elev_src.push_back( "SRTM-Eurasia-3" );
|
||||
elev_src.push_back( "SRTM-Africa-3" );
|
||||
elev_src.push_back( "DEM-USGS-3" );
|
||||
elev_src.push_back( "SRTM-30" );
|
||||
|
||||
|
|
|
@ -37,8 +37,13 @@
|
|||
// given a runway center point, length, width, and heading, and
|
||||
// altitude (meters) generate the lon and lat 4 corners using wgs84
|
||||
// math.
|
||||
TGPolygon gen_wgs84_area( Point3D origin, double length_m, double width_m,
|
||||
double heading_deg, double alt_m, bool add_mid )
|
||||
static TGPolygon gen_wgs84_area( Point3D origin,
|
||||
double length_m,
|
||||
double displ1, double displ2,
|
||||
double width_m,
|
||||
double heading_deg,
|
||||
double alt_m,
|
||||
bool add_mid )
|
||||
{
|
||||
TGPolygon result_list;
|
||||
double length_hdg = heading_deg;
|
||||
|
@ -49,7 +54,7 @@ TGPolygon gen_wgs84_area( Point3D origin, double length_m, double width_m,
|
|||
Point3D ref = origin;
|
||||
double lon, lat, r;
|
||||
geo_direct_wgs_84 ( alt_m, ref.lat(), ref.lon(), length_hdg,
|
||||
length_m / 2.0, &lat, &lon, &r );
|
||||
length_m / 2.0 - displ2, &lat, &lon, &r );
|
||||
ref = Point3D( lon, lat, 0.0 );
|
||||
|
||||
// move to the l,-w corner (then we add points in a clockwise direction)
|
||||
|
@ -77,7 +82,7 @@ TGPolygon gen_wgs84_area( Point3D origin, double length_m, double width_m,
|
|||
// move to the -l end/center of the runway
|
||||
ref = origin;
|
||||
geo_direct_wgs_84 ( alt_m, ref.lat(), ref.lon(), length_hdg,
|
||||
-length_m / 2.0, &lat, &lon, &r );
|
||||
displ1 - length_m/2.0, &lat, &lon, &r );
|
||||
ref = Point3D( lon, lat, 0.0 );
|
||||
|
||||
// move to the -l,w corner (then we add points in a clockwise direction)
|
||||
|
@ -117,8 +122,9 @@ TGPolygon gen_runway_area_w_scale( const TGRunway& runway,
|
|||
Point3D origin(runway.lon, runway.lat, 0);
|
||||
|
||||
result_list = gen_wgs84_area( origin,
|
||||
runway.length * length_scale * SG_FEET_TO_METER,
|
||||
runway.width * width_scale * SG_FEET_TO_METER,
|
||||
runway.length*length_scale * SG_FEET_TO_METER,
|
||||
0.0, 0.0,
|
||||
runway.width*width_scale * SG_FEET_TO_METER,
|
||||
runway.heading, alt_m, false );
|
||||
|
||||
// display points
|
||||
|
@ -136,6 +142,7 @@ TGPolygon gen_runway_area_w_scale( const TGRunway& runway,
|
|||
TGPolygon gen_runway_area_w_extend( const TGRunway& runway,
|
||||
double alt_m,
|
||||
double length_extend,
|
||||
double displ1, double displ2,
|
||||
double width_extend ) {
|
||||
|
||||
TGPolygon result_list;
|
||||
|
@ -143,8 +150,9 @@ TGPolygon gen_runway_area_w_extend( const TGRunway& runway,
|
|||
|
||||
result_list
|
||||
= gen_wgs84_area( origin,
|
||||
runway.length * SG_FEET_TO_METER + 2.0 * length_extend,
|
||||
runway.width * SG_FEET_TO_METER + 2.0 * width_extend,
|
||||
runway.length*SG_FEET_TO_METER + 2.0*length_extend,
|
||||
displ1, displ2,
|
||||
runway.width*SG_FEET_TO_METER + 2.0*width_extend,
|
||||
runway.heading, alt_m, false );
|
||||
|
||||
// display points
|
||||
|
@ -167,7 +175,8 @@ TGPolygon gen_runway_w_mid( const TGRunway& runway,
|
|||
|
||||
result_list = gen_wgs84_area( origin,
|
||||
runway.length * SG_FEET_TO_METER
|
||||
+ 2.0 * length_extend_m,
|
||||
+ 2.0*length_extend_m,
|
||||
0.0, 0.0,
|
||||
runway.width * SG_FEET_TO_METER
|
||||
+ 2.0 * width_extend_m,
|
||||
runway.heading, alt_m, true );
|
||||
|
|
|
@ -78,15 +78,16 @@ TGPolygon gen_runway_area_w_scale( const TGRunway& runway,
|
|||
// (return result points in degrees)
|
||||
TGPolygon gen_runway_area_w_extend( const TGRunway& runway,
|
||||
double alt_m,
|
||||
double length_extend = 0.0,
|
||||
double width_extend = 0.0 );
|
||||
double length_extend,
|
||||
double displ1, double displ2,
|
||||
double width_extend );
|
||||
|
||||
|
||||
// generate an area for half a runway
|
||||
TGPolygon gen_runway_w_mid( const TGRunway& runway,
|
||||
double alt_m,
|
||||
double length_extend_m = 0.0,
|
||||
double width_extend_m = 0.0 );
|
||||
double length_extend_m,
|
||||
double width_extend_m );
|
||||
|
||||
|
||||
#endif // _RUNWAY_HXX
|
||||
|
|
|
@ -43,7 +43,7 @@ void gen_simple_rwy( const TGRunway& rwy_info,
|
|||
{
|
||||
int j, k;
|
||||
|
||||
TGPolygon runway = gen_runway_w_mid( rwy_info, alt_m );
|
||||
TGPolygon runway = gen_runway_w_mid( rwy_info, alt_m, 0.0, 0.0 );
|
||||
|
||||
// runway half "a"
|
||||
TGPolygon runway_a;
|
||||
|
|
|
@ -43,7 +43,7 @@ void gen_taxiway( const TGRunway& rwy_info,
|
|||
{
|
||||
int j, k;
|
||||
|
||||
TGPolygon runway = gen_runway_w_mid( rwy_info, alt_m );
|
||||
TGPolygon runway = gen_runway_w_mid( rwy_info, alt_m, 0.0, 0.0 );
|
||||
|
||||
// runway half "a"
|
||||
TGPolygon runway_a;
|
||||
|
|
Loading…
Add table
Reference in a new issue