onvert cout to SG_LOG in lights.cxx.
remove unused dead code in airport.cxx
This commit is contained in:
parent
474c126a0c
commit
effbefde41
2 changed files with 49 additions and 87 deletions
|
@ -773,40 +773,12 @@ void Airport::BuildBtg(const string& root, const string_list& elev_src )
|
||||||
for ( unsigned int k = 0; k < rwy_polys.size(); ++k )
|
for ( unsigned int k = 0; k < rwy_polys.size(); ++k )
|
||||||
{
|
{
|
||||||
TGPolygon poly = rwy_polys[k].get_poly();
|
TGPolygon poly = rwy_polys[k].get_poly();
|
||||||
|
|
||||||
SG_LOG(SG_GENERAL, SG_DEBUG, "total size of section " << k << " before =" << poly.total_size());
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
poly = remove_cycles( poly );
|
|
||||||
poly = remove_dups( poly );
|
|
||||||
poly = remove_bad_contours( poly );
|
|
||||||
poly = remove_tiny_contours( poly );
|
|
||||||
poly = remove_spikes( poly );
|
|
||||||
poly = remove_dups( poly );
|
|
||||||
poly = remove_bad_contours( poly );
|
|
||||||
poly = remove_small_contours( poly );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
rwy_polys[k].set_poly( poly );
|
rwy_polys[k].set_poly( poly );
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( unsigned int k = 0; k < pvmt_polys.size(); ++k )
|
for ( unsigned int k = 0; k < pvmt_polys.size(); ++k )
|
||||||
{
|
{
|
||||||
TGPolygon poly = pvmt_polys[k].get_poly();
|
TGPolygon poly = pvmt_polys[k].get_poly();
|
||||||
|
|
||||||
SG_LOG(SG_GENERAL, SG_DEBUG, "total size of section " << k << " before =" << poly.total_size());
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
poly = remove_cycles( poly );
|
|
||||||
poly = remove_dups( poly );
|
|
||||||
poly = remove_bad_contours( poly );
|
|
||||||
poly = remove_tiny_contours( poly );
|
|
||||||
poly = remove_spikes( poly );
|
|
||||||
poly = remove_dups( poly );
|
|
||||||
poly = remove_bad_contours( poly );
|
|
||||||
poly = remove_small_contours( poly );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
pvmt_polys[k].set_poly( poly );
|
pvmt_polys[k].set_poly( poly );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -814,8 +786,6 @@ void Airport::BuildBtg(const string& root, const string_list& elev_src )
|
||||||
{
|
{
|
||||||
TGPolygon poly = line_polys[k].get_poly();
|
TGPolygon poly = line_polys[k].get_poly();
|
||||||
|
|
||||||
SG_LOG(SG_GENERAL, SG_DEBUG, "total size of section " << k << " before =" << poly.total_size());
|
|
||||||
|
|
||||||
poly = remove_cycles( poly );
|
poly = remove_cycles( poly );
|
||||||
poly = remove_dups( poly );
|
poly = remove_dups( poly );
|
||||||
poly = remove_bad_contours( poly );
|
poly = remove_bad_contours( poly );
|
||||||
|
@ -840,23 +810,8 @@ void Airport::BuildBtg(const string& root, const string_list& elev_src )
|
||||||
base_poly = add_nodes_to_poly( base_poly, tmp_pvmt_nodes );
|
base_poly = add_nodes_to_poly( base_poly, tmp_pvmt_nodes );
|
||||||
SG_LOG(SG_GENERAL, SG_DEBUG, " after adding tmp_nodes: " << base_poly);
|
SG_LOG(SG_GENERAL, SG_DEBUG, " after adding tmp_nodes: " << base_poly);
|
||||||
|
|
||||||
#if 0
|
|
||||||
base_poly = remove_cycles( base_poly );
|
|
||||||
base_poly = remove_dups( base_poly );
|
|
||||||
base_poly = remove_bad_contours( base_poly );
|
|
||||||
base_poly = tgPolygonSimplify( base_poly );
|
|
||||||
base_poly = remove_tiny_contours( base_poly );
|
|
||||||
base_poly = remove_spikes( base_poly );
|
|
||||||
base_poly = remove_dups( base_poly );
|
|
||||||
base_poly = remove_bad_contours( base_poly );
|
|
||||||
base_poly = remove_small_contours( base_poly );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Finally find slivers in base
|
// Finally find slivers in base
|
||||||
SG_LOG(SG_GENERAL, SG_INFO, "before find slivers in base - contours is : " << base_poly.contours() );
|
|
||||||
tgPolygonFindSlivers( base_poly, slivers );
|
tgPolygonFindSlivers( base_poly, slivers );
|
||||||
SG_LOG(SG_GENERAL, SG_INFO, "after find slivers in base - contours is : " << base_poly.contours() );
|
|
||||||
|
|
||||||
merge_slivers( rwy_polys, slivers );
|
merge_slivers( rwy_polys, slivers );
|
||||||
merge_slivers( pvmt_polys, slivers );
|
merge_slivers( pvmt_polys, slivers );
|
||||||
|
|
||||||
|
|
|
@ -32,8 +32,6 @@
|
||||||
|
|
||||||
#include "runway.hxx"
|
#include "runway.hxx"
|
||||||
|
|
||||||
using std::cout;
|
|
||||||
using std::endl;
|
|
||||||
using std::string;
|
using std::string;
|
||||||
|
|
||||||
|
|
||||||
|
@ -281,7 +279,7 @@ superpoly_list Runway::gen_runway_threshold_lights( const int kind, bool recip )
|
||||||
point_list r_normals; r_normals.clear();
|
point_list r_normals; r_normals.clear();
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
cout << "gen threshold " << rwy.rwnum[0] << endl;
|
SG_LOG(SG_GENERAL, SG_DEBUG, "gen threshold " << rwy.rwnum[0] );
|
||||||
|
|
||||||
// using TGPolygon is a bit innefficient, but that's what the
|
// using TGPolygon is a bit innefficient, but that's what the
|
||||||
// routine returns.
|
// routine returns.
|
||||||
|
@ -315,8 +313,7 @@ superpoly_list Runway::gen_runway_threshold_lights( const int kind, bool recip )
|
||||||
}
|
}
|
||||||
left_hdg = length_hdg - 90.0;
|
left_hdg = length_hdg - 90.0;
|
||||||
if ( left_hdg < 0 ) { left_hdg += 360.0; }
|
if ( left_hdg < 0 ) { left_hdg += 360.0; }
|
||||||
cout << "length hdg = " << length_hdg
|
SG_LOG(SG_GENERAL, SG_DEBUG, "length hdg = " << length_hdg << " left heading = " << left_hdg );
|
||||||
<< " left heading = " << left_hdg << endl;
|
|
||||||
|
|
||||||
Point3D normal1 = gen_runway_light_vector( 3.0, recip );
|
Point3D normal1 = gen_runway_light_vector( 3.0, recip );
|
||||||
Point3D normal2 = gen_runway_light_vector( 3.0, !recip );
|
Point3D normal2 = gen_runway_light_vector( 3.0, !recip );
|
||||||
|
@ -569,7 +566,7 @@ TGSuperPoly Runway::gen_touchdown_zone_lights( bool recip )
|
||||||
point_list normals; normals.clear();
|
point_list normals; normals.clear();
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
cout << "gen touchdown zone lights " << rwy.rwnum[0] << endl;
|
SG_LOG(SG_GENERAL, SG_DEBUG, "gen touchdown zone lights " << rwy.rwnum[0] );
|
||||||
|
|
||||||
Point3D normal;
|
Point3D normal;
|
||||||
|
|
||||||
|
@ -588,19 +585,23 @@ TGSuperPoly Runway::gen_touchdown_zone_lights( bool recip )
|
||||||
// determine the start point.
|
// determine the start point.
|
||||||
Point3D ref;
|
Point3D ref;
|
||||||
double length_hdg, left_hdg;
|
double length_hdg, left_hdg;
|
||||||
double lon, lat, r;
|
double lon = 0.0f, lat = 0.0f, r;
|
||||||
if ( recip ) {
|
if ( recip ) {
|
||||||
ref = (corner[0] + corner[1]) / 2;
|
ref = (corner[0] + corner[1]) / 2;
|
||||||
length_hdg = rwy.heading + 180.0;
|
length_hdg = rwy.heading + 180.0;
|
||||||
if ( length_hdg > 360.0 ) { length_hdg -= 360.0; }
|
if ( length_hdg > 360.0 ) {
|
||||||
|
length_hdg -= 360.0;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
ref = (corner[2] + corner[3]) / 2;
|
ref = (corner[2] + corner[3]) / 2;
|
||||||
length_hdg = rwy.heading;
|
length_hdg = rwy.heading;
|
||||||
}
|
}
|
||||||
left_hdg = length_hdg - 90.0;
|
left_hdg = length_hdg - 90.0;
|
||||||
if ( left_hdg < 0 ) { left_hdg += 360.0; }
|
if ( left_hdg < 0 ) {
|
||||||
cout << "length hdg = " << length_hdg
|
left_hdg += 360.0;
|
||||||
<< " left heading = " << left_hdg << endl;
|
}
|
||||||
|
|
||||||
|
SG_LOG(SG_GENERAL, SG_DEBUG, "length hdg = " << length_hdg << " left heading = " << left_hdg );
|
||||||
|
|
||||||
normal = gen_runway_light_vector( 3.0, recip );
|
normal = gen_runway_light_vector( 3.0, recip );
|
||||||
|
|
||||||
|
@ -677,7 +678,7 @@ static TGSuperPoly gen_vasi( const TGLightobj& rwy_light,
|
||||||
string flag;
|
string flag;
|
||||||
double gs_angle = 3.0;
|
double gs_angle = 3.0;
|
||||||
|
|
||||||
cout << "gen vasi " << rwy.rwnum[0] << endl;
|
SG_LOG(SG_GENERAL, SG_DEBUG, "gen vasi " << rwy.rwnum[0] );
|
||||||
|
|
||||||
Point3D normal;
|
Point3D normal;
|
||||||
|
|
||||||
|
@ -839,7 +840,7 @@ static TGSuperPoly gen_vasi( const TGLightobj& rwy_light,
|
||||||
point_list lightobj; lightobj.clear();
|
point_list lightobj; lightobj.clear();
|
||||||
point_list normals; normals.clear();
|
point_list normals; normals.clear();
|
||||||
|
|
||||||
cout << "gen papi " << rwy_light.rwy_name << endl;
|
SG_LOG(SG_GENERAL, SG_DEBUG, "gen papi " << rwy_light.rwy_name
|
||||||
|
|
||||||
Point3D ref;
|
Point3D ref;
|
||||||
double lon, lat, r;
|
double lon, lat, r;
|
||||||
|
@ -945,7 +946,7 @@ TGSuperPoly Runway::gen_reil( bool recip )
|
||||||
int i;
|
int i;
|
||||||
string flag;
|
string flag;
|
||||||
|
|
||||||
cout << "gen reil " << rwy.rwnum[0] << endl;
|
SG_LOG(SG_GENERAL, SG_DEBUG, "gen reil " << rwy.rwnum[0] );
|
||||||
|
|
||||||
Point3D normal;
|
Point3D normal;
|
||||||
|
|
||||||
|
@ -978,9 +979,10 @@ TGSuperPoly Runway::gen_reil( bool recip )
|
||||||
flag = rwy.rwnum[0];
|
flag = rwy.rwnum[0];
|
||||||
}
|
}
|
||||||
left_hdg = length_hdg - 90.0;
|
left_hdg = length_hdg - 90.0;
|
||||||
if ( left_hdg < 0 ) { left_hdg += 360.0; }
|
if ( left_hdg < 0 ) {
|
||||||
cout << "length hdg = " << length_hdg
|
left_hdg += 360.0;
|
||||||
<< " left heading = " << left_hdg << endl;
|
}
|
||||||
|
SG_LOG(SG_GENERAL, SG_DEBUG, "length hdg = " << length_hdg << " left heading = " << left_hdg );
|
||||||
|
|
||||||
// offset 40' downwind
|
// offset 40' downwind
|
||||||
geo_direct_wgs_84 ( ref1.lat(), ref1.lon(), length_hdg,
|
geo_direct_wgs_84 ( ref1.lat(), ref1.lon(), length_hdg,
|
||||||
|
@ -1038,11 +1040,11 @@ superpoly_list Runway::gen_calvert( const string &kind, bool recip )
|
||||||
int i, j;
|
int i, j;
|
||||||
string flag;
|
string flag;
|
||||||
if ( kind == "1" ) {
|
if ( kind == "1" ) {
|
||||||
cout << "gen Calvert lights " << rwy.rwnum[0] << endl;
|
SG_LOG(SG_GENERAL, SG_DEBUG, "gen Calvert lights " << rwy.rwnum[0] );
|
||||||
} else if ( kind == "2" ) {
|
} else if ( kind == "2" ) {
|
||||||
cout << "gen Calvert/II lights " << rwy.rwnum[0] << endl;
|
SG_LOG(SG_GENERAL, SG_DEBUG, "gen Calvert/II lights " << rwy.rwnum[0] );
|
||||||
} else {
|
} else {
|
||||||
cout << "gen unknown Calvert lights " << rwy.rwnum[0] << endl;
|
SG_LOG(SG_GENERAL, SG_DEBUG, "gen unknown Calvert lights " << rwy.rwnum[0] );
|
||||||
}
|
}
|
||||||
|
|
||||||
Point3D normal1 = gen_runway_light_vector( 3.0, recip );
|
Point3D normal1 = gen_runway_light_vector( 3.0, recip );
|
||||||
|
@ -1111,9 +1113,10 @@ superpoly_list Runway::gen_calvert( const string &kind, bool recip )
|
||||||
length_hdg = rwy.heading;
|
length_hdg = rwy.heading;
|
||||||
}
|
}
|
||||||
left_hdg = length_hdg - 90.0;
|
left_hdg = length_hdg - 90.0;
|
||||||
if ( left_hdg < 0 ) { left_hdg += 360.0; }
|
if ( left_hdg < 0 ) {
|
||||||
cout << "length hdg = " << length_hdg
|
left_hdg += 360.0;
|
||||||
<< " left heading = " << left_hdg << endl;
|
}
|
||||||
|
SG_LOG(SG_GENERAL, SG_DEBUG, "length hdg = " << length_hdg << " left heading = " << left_hdg );
|
||||||
|
|
||||||
Point3D ref = ref_save;
|
Point3D ref = ref_save;
|
||||||
//
|
//
|
||||||
|
@ -1427,7 +1430,7 @@ superpoly_list Runway::gen_alsf( const string &kind, bool recip )
|
||||||
int i, j;
|
int i, j;
|
||||||
string flag;
|
string flag;
|
||||||
|
|
||||||
cout << "gen ALSF/SALS lights " << rwy.rwnum[0] << endl;
|
SG_LOG(SG_GENERAL, SG_DEBUG, "gen ALSF/SALS lights " << rwy.rwnum[0] );
|
||||||
|
|
||||||
Point3D normal1 = gen_runway_light_vector( 3.0, recip );
|
Point3D normal1 = gen_runway_light_vector( 3.0, recip );
|
||||||
Point3D normal2 = gen_runway_light_vector( 3.0, !recip );
|
Point3D normal2 = gen_runway_light_vector( 3.0, !recip );
|
||||||
|
@ -1495,9 +1498,10 @@ superpoly_list Runway::gen_alsf( const string &kind, bool recip )
|
||||||
length_hdg = rwy.heading;
|
length_hdg = rwy.heading;
|
||||||
}
|
}
|
||||||
left_hdg = length_hdg - 90.0;
|
left_hdg = length_hdg - 90.0;
|
||||||
if ( left_hdg < 0 ) { left_hdg += 360.0; }
|
if ( left_hdg < 0 ) {
|
||||||
cout << "length hdg = " << length_hdg
|
left_hdg += 360.0;
|
||||||
<< " left heading = " << left_hdg << endl;
|
}
|
||||||
|
SG_LOG(SG_GENERAL, SG_DEBUG, "length hdg = " << length_hdg << " left heading = " << left_hdg );
|
||||||
|
|
||||||
Point3D ref = ref_save;
|
Point3D ref = ref_save;
|
||||||
|
|
||||||
|
@ -1936,7 +1940,7 @@ TGSuperPoly Runway::gen_odals( bool recip )
|
||||||
int i;
|
int i;
|
||||||
string flag;
|
string flag;
|
||||||
|
|
||||||
cout << "gen odals " << rwy.rwnum[0] << endl;
|
SG_LOG(SG_GENERAL, SG_DEBUG, "gen odals " << rwy.rwnum[0] );
|
||||||
|
|
||||||
// ODALS lighting is omni-directional, but we generate a normal as
|
// ODALS lighting is omni-directional, but we generate a normal as
|
||||||
// a placeholder to keep everything happy.
|
// a placeholder to keep everything happy.
|
||||||
|
@ -1971,9 +1975,10 @@ TGSuperPoly Runway::gen_odals( bool recip )
|
||||||
flag = rwy.rwnum[0];
|
flag = rwy.rwnum[0];
|
||||||
}
|
}
|
||||||
left_hdg = length_hdg - 90.0;
|
left_hdg = length_hdg - 90.0;
|
||||||
if ( left_hdg < 0 ) { left_hdg += 360.0; }
|
if ( left_hdg < 0 ) {
|
||||||
cout << "length hdg = " << length_hdg
|
left_hdg += 360.0;
|
||||||
<< " left heading = " << left_hdg << endl;
|
}
|
||||||
|
SG_LOG(SG_GENERAL, SG_DEBUG, "length hdg = " << length_hdg << " left heading = " << left_hdg );
|
||||||
|
|
||||||
Point3D ref = ( ref1 + ref2 ) / 2.0;
|
Point3D ref = ( ref1 + ref2 ) / 2.0;
|
||||||
|
|
||||||
|
@ -2041,7 +2046,7 @@ superpoly_list Runway::gen_ssalx( const string& kind, bool recip )
|
||||||
int i, j;
|
int i, j;
|
||||||
string flag;
|
string flag;
|
||||||
|
|
||||||
cout << "gen SSALx lights " << rwy.rwnum[0] << endl;
|
SG_LOG(SG_GENERAL, SG_DEBUG, "gen SSALx lights " << rwy.rwnum[0] );
|
||||||
|
|
||||||
Point3D normal1 = gen_runway_light_vector( 3.0, recip );
|
Point3D normal1 = gen_runway_light_vector( 3.0, recip );
|
||||||
Point3D normal2 = gen_runway_light_vector( 3.0, !recip );
|
Point3D normal2 = gen_runway_light_vector( 3.0, !recip );
|
||||||
|
@ -2109,9 +2114,10 @@ superpoly_list Runway::gen_ssalx( const string& kind, bool recip )
|
||||||
length_hdg = rwy.heading;
|
length_hdg = rwy.heading;
|
||||||
}
|
}
|
||||||
left_hdg = length_hdg - 90.0;
|
left_hdg = length_hdg - 90.0;
|
||||||
if ( left_hdg < 0 ) { left_hdg += 360.0; }
|
if ( left_hdg < 0 ) {
|
||||||
cout << "length hdg = " << length_hdg
|
left_hdg += 360.0;
|
||||||
<< " left heading = " << left_hdg << endl;
|
}
|
||||||
|
SG_LOG(SG_GENERAL, SG_DEBUG, "length hdg = " << length_hdg << " left heading = " << left_hdg );
|
||||||
|
|
||||||
Point3D ref = ref_save;
|
Point3D ref = ref_save;
|
||||||
|
|
||||||
|
@ -2309,7 +2315,7 @@ superpoly_list Runway::gen_malsx( const string& kind, bool recip )
|
||||||
int i, j;
|
int i, j;
|
||||||
string flag;
|
string flag;
|
||||||
|
|
||||||
cout << "gen SSALx lights " << rwy.rwnum[0] << endl;
|
SG_LOG(SG_GENERAL, SG_DEBUG, "gen SSALx lights " << rwy.rwnum[0] );
|
||||||
|
|
||||||
Point3D normal1 = gen_runway_light_vector( 3.0, recip );
|
Point3D normal1 = gen_runway_light_vector( 3.0, recip );
|
||||||
Point3D normal2 = gen_runway_light_vector( 3.0, !recip );
|
Point3D normal2 = gen_runway_light_vector( 3.0, !recip );
|
||||||
|
@ -2377,9 +2383,10 @@ superpoly_list Runway::gen_malsx( const string& kind, bool recip )
|
||||||
length_hdg = rwy.heading;
|
length_hdg = rwy.heading;
|
||||||
}
|
}
|
||||||
left_hdg = length_hdg - 90.0;
|
left_hdg = length_hdg - 90.0;
|
||||||
if ( left_hdg < 0 ) { left_hdg += 360.0; }
|
if ( left_hdg < 0 ) {
|
||||||
cout << "length hdg = " << length_hdg
|
left_hdg += 360.0;
|
||||||
<< " left heading = " << left_hdg << endl;
|
}
|
||||||
|
SG_LOG(SG_GENERAL, SG_DEBUG, "length hdg = " << length_hdg << " left heading = " << left_hdg );
|
||||||
|
|
||||||
Point3D ref = ref_save;
|
Point3D ref = ref_save;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue