1
0
Fork 0

Bump minimum SG version. Make TG compile again. Own multithread logging is disabled for now.

This commit is contained in:
Christian Schmitt 2013-02-07 20:03:27 +01:00
parent d469bc04a9
commit 5c44d450d4
17 changed files with 292 additions and 295 deletions

View file

@ -92,7 +92,7 @@ endif (MSVC AND MSVC_3RDPARTY_ROOT)
find_package(Boost COMPONENTS system thread REQUIRED) find_package(Boost COMPONENTS system thread REQUIRED)
find_package(ZLIB REQUIRED) find_package(ZLIB REQUIRED)
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
find_package(SimGear 2.10.0 REQUIRED) find_package(SimGear 2.11.0 REQUIRED)
find_package(GDAL 1.6.0 REQUIRED) find_package(GDAL 1.6.0 REQUIRED)
find_package(TIFF REQUIRED) # needed for SRTM find_package(TIFF REQUIRED) # needed for SRTM

View file

@ -20,7 +20,6 @@
#include "airport.hxx" #include "airport.hxx"
#include "beznode.hxx" #include "beznode.hxx"
#include "debug.hxx"
#include "elevations.hxx" #include "elevations.hxx"
#include "global.hxx" #include "global.hxx"
#include "helipad.hxx" #include "helipad.hxx"
@ -77,7 +76,7 @@ Airport::Airport( int c, char* def)
altitude *= SG_FEET_TO_METER; altitude *= SG_FEET_TO_METER;
GENAPT_LOG( SG_GENERAL, SG_DEBUG, "Read airport with icao " << icao << ", control tower " << ct << ", and description " << description ); SG_LOG( SG_GENERAL, SG_DEBUG, "Read airport with icao " << icao << ", control tower " << ct << ", and description " << description );
} }
Airport::~Airport() Airport::~Airport()
@ -318,7 +317,7 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
apt_lat = apt_lat / (double)num_samples; apt_lat = apt_lat / (double)num_samples;
SGBucket b( apt_lon, apt_lat ); SGBucket b( apt_lon, apt_lat );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, b.gen_base_path() << "/" << b.gen_index_str()); SG_LOG(SG_GENERAL, SG_DEBUG, b.gen_base_path() << "/" << b.gen_index_str());
// If we are cutting in the linear features, add them first // If we are cutting in the linear features, add them first
if (pavements.size()) if (pavements.size())
@ -329,7 +328,7 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
} }
} }
GENAPT_LOG(SG_GENERAL, SG_INFO, "Parse Complete - Runways: " << runways.size() << " Pavements: " << pavements.size() << " Features: " << features.size() << " Taxiways: " << taxiways.size() ); SG_LOG(SG_GENERAL, SG_INFO, "Parse Complete - Runways: " << runways.size() << " Pavements: " << pavements.size() << " Features: " << features.size() << " Taxiways: " << taxiways.size() );
// Starting to clip the polys (for now - only UNIX builds) // Starting to clip the polys (for now - only UNIX builds)
build_start.stamp(); build_start.stamp();
@ -339,10 +338,10 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
{ {
tgAccumulator lf_accum; tgAccumulator lf_accum;
GENAPT_LOG(SG_GENERAL, SG_INFO, "Build " << features.size() << " Linear Feature Polys"); SG_LOG(SG_GENERAL, SG_INFO, "Build " << features.size() << " Linear Feature Polys");
for ( unsigned int i=0; i<features.size(); i++ ) for ( unsigned int i=0; i<features.size(); i++ )
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Build Feature Poly " << i + 1 << " of " << features.size() << " : " << features[i]->GetDescription() ); SG_LOG(SG_GENERAL, SG_DEBUG, "Build Feature Poly " << i + 1 << " of " << features.size() << " : " << features[i]->GetDescription() );
features[i]->BuildBtg( line_polys, rwy_lights, lf_accum, make_shapefiles ); features[i]->BuildBtg( line_polys, rwy_lights, lf_accum, make_shapefiles );
} }
@ -350,7 +349,7 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
// lf_accum.ToShapefiles( "./lf_accum", "test", false ); // lf_accum.ToShapefiles( "./lf_accum", "test", false );
log_time = time(0); log_time = time(0);
GENAPT_LOG( SG_GENERAL, SG_ALERT, "Finished building Linear Features for " << icao << " at " << DebugTimeToString(log_time) ); SG_LOG( SG_GENERAL, SG_ALERT, "Finished building Linear Features for " << icao << " at " << DebugTimeToString(log_time) );
} }
/* Initialize a new accumulator for the other objects */ /* Initialize a new accumulator for the other objects */
@ -359,10 +358,10 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
// Build runways next // Build runways next
if (runways.size()) if (runways.size())
{ {
GENAPT_LOG(SG_GENERAL, SG_INFO, "Build " << runways.size() << " Runway Polys"); SG_LOG(SG_GENERAL, SG_INFO, "Build " << runways.size() << " Runway Polys");
for ( unsigned int i=0; i<runways.size(); i++ ) for ( unsigned int i=0; i<runways.size(); i++ )
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Build Runway " << i + 1 << " of " << runways.size()); SG_LOG(SG_GENERAL, SG_DEBUG, "Build Runway " << i + 1 << " of " << runways.size());
slivers.clear(); slivers.clear();
if ( isDebugRunway(i) ) { if ( isDebugRunway(i) ) {
@ -386,15 +385,15 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
} }
log_time = time(0); log_time = time(0);
GENAPT_LOG( SG_GENERAL, SG_ALERT, "Finished building runways for " << icao << " at " << DebugTimeToString(log_time) ); SG_LOG( SG_GENERAL, SG_ALERT, "Finished building runways for " << icao << " at " << DebugTimeToString(log_time) );
} }
if (lightobjects.size()) if (lightobjects.size())
{ {
GENAPT_LOG(SG_GENERAL, SG_INFO, "Build " << lightobjects.size() << " Light Objects "); SG_LOG(SG_GENERAL, SG_INFO, "Build " << lightobjects.size() << " Light Objects ");
for ( unsigned int i=0; i<lightobjects.size(); i++ ) for ( unsigned int i=0; i<lightobjects.size(); i++ )
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Build runway light " << i + 1 << " of " << lightobjects.size()); SG_LOG(SG_GENERAL, SG_DEBUG, "Build runway light " << i + 1 << " of " << lightobjects.size());
lightobjects[i]->BuildBtg( rwy_lights ); lightobjects[i]->BuildBtg( rwy_lights );
} }
} }
@ -402,10 +401,10 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
// Build helipads (use runway poly- and texture list for this) // Build helipads (use runway poly- and texture list for this)
if (helipads.size()) if (helipads.size())
{ {
GENAPT_LOG(SG_GENERAL, SG_INFO, "Build " << helipads.size() << " Helipad Polys "); SG_LOG(SG_GENERAL, SG_INFO, "Build " << helipads.size() << " Helipad Polys ");
for ( unsigned int i=0; i<helipads.size(); i++ ) for ( unsigned int i=0; i<helipads.size(); i++ )
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Build helipad " << i + 1 << " of " << helipads.size()); SG_LOG(SG_GENERAL, SG_DEBUG, "Build helipad " << i + 1 << " of " << helipads.size());
slivers.clear(); slivers.clear();
if (boundary.size()) if (boundary.size())
@ -425,10 +424,10 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
// Build the pavements // Build the pavements
if (pavements.size()) if (pavements.size())
{ {
GENAPT_LOG(SG_GENERAL, SG_INFO, "Build " << pavements.size() << " Pavement Polys "); SG_LOG(SG_GENERAL, SG_INFO, "Build " << pavements.size() << " Pavement Polys ");
for ( unsigned int i=0; i<pavements.size(); i++ ) for ( unsigned int i=0; i<pavements.size(); i++ )
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Build Pavement " << i + 1 << " of " << pavements.size() << " : " << pavements[i]->GetDescription()); SG_LOG(SG_GENERAL, SG_DEBUG, "Build Pavement " << i + 1 << " of " << pavements.size() << " : " << pavements[i]->GetDescription());
slivers.clear(); slivers.clear();
if ( isDebugPavement(i) ) { if ( isDebugPavement(i) ) {
@ -453,16 +452,16 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
} }
log_time = time(0); log_time = time(0);
GENAPT_LOG( SG_GENERAL, SG_ALERT, "Finished building Pavements for " << icao << " at " << DebugTimeToString(log_time) ); SG_LOG( SG_GENERAL, SG_ALERT, "Finished building Pavements for " << icao << " at " << DebugTimeToString(log_time) );
} }
// Build the legacy taxiways // Build the legacy taxiways
if (taxiways.size()) if (taxiways.size())
{ {
GENAPT_LOG(SG_GENERAL, SG_INFO, "Build " << taxiways.size() << " Taxiway Polys "); SG_LOG(SG_GENERAL, SG_INFO, "Build " << taxiways.size() << " Taxiway Polys ");
for ( unsigned int i=0; i<taxiways.size(); i++ ) for ( unsigned int i=0; i<taxiways.size(); i++ )
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Build Taxiway " << i + 1 << " of " << taxiways.size()); SG_LOG(SG_GENERAL, SG_DEBUG, "Build Taxiway " << i + 1 << " of " << taxiways.size());
slivers.clear(); slivers.clear();
if ( isDebugTaxiway(i) ) { if ( isDebugTaxiway(i) ) {
@ -490,10 +489,10 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
// Build runway shoulders here // Build runway shoulders here
if ( runways.size() ) if ( runways.size() )
{ {
GENAPT_LOG(SG_GENERAL, SG_INFO, "Build " << runways.size() << " Runway Shoulder Polys "); SG_LOG(SG_GENERAL, SG_INFO, "Build " << runways.size() << " Runway Shoulder Polys ");
for ( unsigned int i=0; i<runways.size(); i++ ) for ( unsigned int i=0; i<runways.size(); i++ )
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Build Runway shoulder " << i + 1 << " of " << runways.size()); SG_LOG(SG_GENERAL, SG_DEBUG, "Build Runway shoulder " << i + 1 << " of " << runways.size());
if ( runways[i]->GetsShoulder() ) if ( runways[i]->GetsShoulder() )
{ {
@ -510,10 +509,10 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
// Build helipad shoulders here // Build helipad shoulders here
if ( helipads.size() ) if ( helipads.size() )
{ {
GENAPT_LOG(SG_GENERAL, SG_INFO, "Build " << runways.size() << " Helipad Shoulder Polys "); SG_LOG(SG_GENERAL, SG_INFO, "Build " << runways.size() << " Helipad Shoulder Polys ");
for ( unsigned int i=0; i<helipads.size(); i++ ) for ( unsigned int i=0; i<helipads.size(); i++ )
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Build Helipad shoulder " << i + 1 << " of " << helipads.size()); SG_LOG(SG_GENERAL, SG_DEBUG, "Build Helipad shoulder " << i + 1 << " of " << helipads.size());
if ( helipads[i]->GetsShoulder() ) if ( helipads[i]->GetsShoulder() )
{ {
@ -531,12 +530,12 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
tgPolygon apt_base, apt_clearing; tgPolygon apt_base, apt_clearing;
if (boundary.size()) if (boundary.size())
{ {
GENAPT_LOG(SG_GENERAL, SG_INFO, "Build " << boundary.size() << " Boundary Polys "); SG_LOG(SG_GENERAL, SG_INFO, "Build " << boundary.size() << " Boundary Polys ");
shapefile = ""; shapefile = "";
for ( unsigned int i=0; i<boundary.size(); i++ ) for ( unsigned int i=0; i<boundary.size(); i++ )
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Build Userdefined boundary " << i + 1 << " of " << boundary.size()); SG_LOG(SG_GENERAL, SG_DEBUG, "Build Userdefined boundary " << i + 1 << " of " << boundary.size());
boundary[i]->BuildBtg( apt_base, apt_clearing, shapefile ); boundary[i]->BuildBtg( apt_base, apt_clearing, shapefile );
} }
} else { } else {
@ -546,7 +545,7 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
if ( apt_base.TotalNodes() == 0 ) if ( apt_base.TotalNodes() == 0 )
{ {
GENAPT_LOG(SG_GENERAL, SG_ALERT, "no airport points generated"); SG_LOG(SG_GENERAL, SG_ALERT, "no airport points generated");
return; return;
} }
@ -565,7 +564,7 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
UniqueSGGeodSet tmp_feat_nodes; UniqueSGGeodSet tmp_feat_nodes;
// build temporary node list from runways... // build temporary node list from runways...
GENAPT_LOG(SG_GENERAL, SG_INFO, "Build Node List " ); SG_LOG(SG_GENERAL, SG_INFO, "Build Node List " );
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]; tgPolygon poly = rwy_polys[k];
@ -624,14 +623,14 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
} }
log_time = time(0); log_time = time(0);
GENAPT_LOG( SG_GENERAL, SG_ALERT, "Finished collecting nodes for " << icao << " at " << DebugTimeToString(log_time) ); SG_LOG( SG_GENERAL, SG_ALERT, "Finished collecting nodes for " << icao << " at " << DebugTimeToString(log_time) );
// second pass : runways // second pass : runways
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]; tgPolygon poly = rwy_polys[k];
poly = tgPolygon::AddColinearNodes( poly, tmp_pvmt_nodes ); poly = tgPolygon::AddColinearNodes( poly, tmp_pvmt_nodes );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "total size after add nodes = " << poly.TotalNodes()); SG_LOG(SG_GENERAL, SG_DEBUG, "total size after add nodes = " << poly.TotalNodes());
rwy_polys[k] = poly; rwy_polys[k] = poly;
} }
@ -640,7 +639,7 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
{ {
tgPolygon poly = pvmt_polys[k]; tgPolygon poly = pvmt_polys[k];
poly = tgPolygon::AddColinearNodes( poly, tmp_pvmt_nodes ); poly = tgPolygon::AddColinearNodes( poly, tmp_pvmt_nodes );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "total size after add nodes = " << poly.TotalNodes()); SG_LOG(SG_GENERAL, SG_DEBUG, "total size after add nodes = " << poly.TotalNodes());
pvmt_polys[k] = poly; pvmt_polys[k] = poly;
} }
@ -649,12 +648,12 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
{ {
tgPolygon poly = line_polys[k]; tgPolygon poly = line_polys[k];
poly = tgPolygon::AddColinearNodes( poly, tmp_feat_nodes ); poly = tgPolygon::AddColinearNodes( poly, tmp_feat_nodes );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "total size after add nodes = " << poly.TotalNodes()); SG_LOG(SG_GENERAL, SG_DEBUG, "total size after add nodes = " << poly.TotalNodes());
line_polys[k] = poly; line_polys[k] = poly;
} }
log_time = time(0); log_time = time(0);
GENAPT_LOG( SG_GENERAL, SG_ALERT, "Finished adding intermediate nodes for " << icao << " at " << DebugTimeToString(log_time) ); SG_LOG( SG_GENERAL, SG_ALERT, "Finished adding intermediate nodes for " << icao << " at " << DebugTimeToString(log_time) );
for ( unsigned int k = 0; k < line_polys.size(); ++k ) for ( unsigned int k = 0; k < line_polys.size(); ++k )
{ {
@ -677,7 +676,7 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
} }
log_time = time(0); log_time = time(0);
GENAPT_LOG( SG_GENERAL, SG_ALERT, "Finished cleaning polys for " << icao << " at " << DebugTimeToString(log_time) ); SG_LOG( SG_GENERAL, SG_ALERT, "Finished cleaning polys for " << icao << " at " << DebugTimeToString(log_time) );
base_poly = tgPolygon::AddColinearNodes( base_poly, tmp_pvmt_nodes ); base_poly = tgPolygon::AddColinearNodes( base_poly, tmp_pvmt_nodes );
base_poly = tgPolygon::Snap( base_poly, gSnap ); base_poly = tgPolygon::Snap( base_poly, gSnap );
@ -714,14 +713,14 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
// tesselate the polygons and prepair them for final output // tesselate the polygons and prepair them for final output
if ( rwy_polys.size() ) if ( rwy_polys.size() )
{ {
GENAPT_LOG(SG_GENERAL, SG_INFO, "Tesselating " << rwy_polys.size() << " Runway Polys " ); SG_LOG(SG_GENERAL, SG_INFO, "Tesselating " << rwy_polys.size() << " Runway Polys " );
for ( unsigned int i = 0; i < rwy_polys.size(); ++i ) for ( unsigned int i = 0; i < rwy_polys.size(); ++i )
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Tesselating runway poly = " << i + 1 << " of " << rwy_polys.size() ); SG_LOG(SG_GENERAL, SG_DEBUG, "Tesselating runway poly = " << i + 1 << " of " << rwy_polys.size() );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "contours before " << rwy_polys[i].Contours() << " total points before = " << rwy_polys[i].TotalNodes()); SG_LOG(SG_GENERAL, SG_DEBUG, "contours before " << rwy_polys[i].Contours() << " total points before = " << rwy_polys[i].TotalNodes());
rwy_polys[i].Tesselate(); rwy_polys[i].Tesselate();
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "triangles after = " << rwy_polys[i].Triangles()); SG_LOG(SG_GENERAL, SG_DEBUG, "triangles after = " << rwy_polys[i].Triangles());
rwy_polys[i].Texture(); rwy_polys[i].Texture();
} }
} }
@ -729,14 +728,14 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
if ( pvmt_polys.size() ) if ( pvmt_polys.size() )
{ {
// tesselate the polygons and prepair them for final output // tesselate the polygons and prepair them for final output
GENAPT_LOG(SG_GENERAL, SG_INFO, "Tesselating " << pvmt_polys.size() << " Pavement Polys " ); SG_LOG(SG_GENERAL, SG_INFO, "Tesselating " << pvmt_polys.size() << " Pavement Polys " );
for ( unsigned int i = 0; i < pvmt_polys.size(); ++i ) for ( unsigned int i = 0; i < pvmt_polys.size(); ++i )
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Tesselating pavement poly = " << i + 1 << " of " << pvmt_polys.size() ); SG_LOG(SG_GENERAL, SG_DEBUG, "Tesselating pavement poly = " << i + 1 << " of " << pvmt_polys.size() );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "contours before " << pvmt_polys[i].Contours() << " total points before = " << pvmt_polys[i].TotalNodes()); SG_LOG(SG_GENERAL, SG_DEBUG, "contours before " << pvmt_polys[i].Contours() << " total points before = " << pvmt_polys[i].TotalNodes());
pvmt_polys[i].Tesselate(); pvmt_polys[i].Tesselate();
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "triangles after = " << pvmt_polys[i].Triangles()); SG_LOG(SG_GENERAL, SG_DEBUG, "triangles after = " << pvmt_polys[i].Triangles());
pvmt_polys[i].Texture(); pvmt_polys[i].Texture();
} }
} }
@ -744,14 +743,14 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
if ( line_polys.size() ) if ( line_polys.size() )
{ {
// tesselate the polygons and prepair them for final output // tesselate the polygons and prepair them for final output
GENAPT_LOG(SG_GENERAL, SG_INFO, "Tesselating " << line_polys.size() << " Linear Feature Polys " ); SG_LOG(SG_GENERAL, SG_INFO, "Tesselating " << line_polys.size() << " Linear Feature Polys " );
for ( unsigned int i = 0; i < line_polys.size(); ++i ) for ( unsigned int i = 0; i < line_polys.size(); ++i )
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Tesselating line poly = " << i + 1 << " of " << line_polys.size() ); SG_LOG(SG_GENERAL, SG_DEBUG, "Tesselating line poly = " << i + 1 << " of " << line_polys.size() );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "contours before " << line_polys[i].Contours() << " total points before = " << line_polys[i].TotalNodes()); SG_LOG(SG_GENERAL, SG_DEBUG, "contours before " << line_polys[i].Contours() << " total points before = " << line_polys[i].TotalNodes());
line_polys[i].Tesselate(); line_polys[i].Tesselate();
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "triangles after = " << line_polys[i].Triangles()); SG_LOG(SG_GENERAL, SG_DEBUG, "triangles after = " << line_polys[i].Triangles());
line_polys[i].Texture(); line_polys[i].Texture();
} }
} }
@ -760,9 +759,9 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
intersecting contours */ intersecting contours */
base_poly = tgPolygon::Simplify( base_poly ); base_poly = tgPolygon::Simplify( base_poly );
GENAPT_LOG(SG_GENERAL, SG_INFO, "Tesselating base poly : " << base_poly.Contours() << " contours " ); SG_LOG(SG_GENERAL, SG_INFO, "Tesselating base poly : " << base_poly.Contours() << " contours " );
base_poly.Tesselate(); base_poly.Tesselate();
GENAPT_LOG(SG_GENERAL, SG_INFO, "Tesselating base poly - done : Triangles = " << base_poly.Triangles()); SG_LOG(SG_GENERAL, SG_INFO, "Tesselating base poly - done : Triangles = " << base_poly.Triangles());
// should we texture base here? // should we texture base here?
triangulation_end.stamp(); triangulation_end.stamp();
@ -770,7 +769,7 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
// a few airports fail here // a few airports fail here
if ( base_poly.Triangles() == 0 ) if ( base_poly.Triangles() == 0 )
{ {
GENAPT_LOG(SG_GENERAL, SG_ALERT, "no base poly triangles"); SG_LOG(SG_GENERAL, SG_ALERT, "no base poly triangles");
return; return;
} }
@ -815,13 +814,13 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
SGVec3f vnt = SGVec3f::fromGeod( base_poly.GetNode(0, 0) ); SGVec3f vnt = SGVec3f::fromGeod( base_poly.GetNode(0, 0) );
vnt = normalize(vnt); vnt = normalize(vnt);
GENAPT_LOG(SG_GENERAL, SG_INFO, "Adding runway nodes and normals"); SG_LOG(SG_GENERAL, SG_INFO, "Adding runway nodes and normals");
for ( unsigned int k = 0; k < rwy_polys.size(); ++k ) for ( unsigned int k = 0; k < rwy_polys.size(); ++k )
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "tri " << k); SG_LOG(SG_GENERAL, SG_DEBUG, "tri " << k);
std::string material = rwy_polys[k].GetMaterial(); std::string material = rwy_polys[k].GetMaterial();
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "material = " << material); SG_LOG(SG_GENERAL, SG_DEBUG, "material = " << material);
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "triangles = " << rwy_polys[k].Triangles()); SG_LOG(SG_GENERAL, SG_DEBUG, "triangles = " << rwy_polys[k].Triangles());
for ( unsigned int i = 0; i < rwy_polys[k].Triangles(); ++i ) for ( unsigned int i = 0; i < rwy_polys[k].Triangles(); ++i )
{ {
tri_v.clear(); tri_v.clear();
@ -847,13 +846,13 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
} }
} }
GENAPT_LOG(SG_GENERAL, SG_INFO, "Adding pavement nodes and normals"); SG_LOG(SG_GENERAL, SG_INFO, "Adding pavement nodes and normals");
for ( unsigned int k = 0; k < pvmt_polys.size(); ++k ) for ( unsigned int k = 0; k < pvmt_polys.size(); ++k )
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "tri " << k); SG_LOG(SG_GENERAL, SG_DEBUG, "tri " << k);
std::string material = pvmt_polys[k].GetMaterial(); std::string material = pvmt_polys[k].GetMaterial();
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "material = " << material); SG_LOG(SG_GENERAL, SG_DEBUG, "material = " << material);
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "triangles = " << pvmt_polys[k].Triangles()); SG_LOG(SG_GENERAL, SG_DEBUG, "triangles = " << pvmt_polys[k].Triangles());
for ( unsigned int i = 0; i < pvmt_polys[k].Triangles(); ++i ) for ( unsigned int i = 0; i < pvmt_polys[k].Triangles(); ++i )
{ {
tri_v.clear(); tri_v.clear();
@ -878,13 +877,13 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
} }
} }
GENAPT_LOG(SG_GENERAL, SG_INFO, "Adding line nodes and normals"); SG_LOG(SG_GENERAL, SG_INFO, "Adding line nodes and normals");
for ( unsigned int k = 0; k < line_polys.size(); ++k ) for ( unsigned int k = 0; k < line_polys.size(); ++k )
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "tri " << k); SG_LOG(SG_GENERAL, SG_DEBUG, "tri " << k);
std::string material = line_polys[k].GetMaterial(); std::string material = line_polys[k].GetMaterial();
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "material = " << material); SG_LOG(SG_GENERAL, SG_DEBUG, "material = " << material);
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "triangles = " << line_polys[k].Triangles()); SG_LOG(SG_GENERAL, SG_DEBUG, "triangles = " << line_polys[k].Triangles());
for ( unsigned int i = 0; i < line_polys[k].Triangles(); ++i ) for ( unsigned int i = 0; i < line_polys[k].Triangles(); ++i )
{ {
tri_v.clear(); tri_v.clear();
@ -913,7 +912,7 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
std::vector< SGVec2f > base_txs; std::vector< SGVec2f > base_txs;
int_list base_tc; int_list base_tc;
GENAPT_LOG(SG_GENERAL, SG_INFO, "Adding base nodes and normals"); SG_LOG(SG_GENERAL, SG_INFO, "Adding base nodes and normals");
for ( unsigned int i = 0; i < base_poly.Triangles(); ++i ) for ( unsigned int i = 0; i < base_poly.Triangles(); ++i )
{ {
tri_v.clear(); tri_v.clear();
@ -953,7 +952,7 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
for ( unsigned int j = 0; j < divided_base.ContourSize( i ); ++j ) for ( unsigned int j = 0; j < divided_base.ContourSize( i ); ++j )
{ {
index = nodes.add( divided_base.GetNode(i, j) ); index = nodes.add( divided_base.GetNode(i, j) );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "added base point " << divided_base.GetNode(i, j) << " at " << index ); SG_LOG(SG_GENERAL, SG_DEBUG, "added base point " << divided_base.GetNode(i, j) << " at " << index );
} }
} }
@ -964,15 +963,15 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
// it avoids biases introduced from the surrounding area if the // it avoids biases introduced from the surrounding area if the
// airport is located in a bowl or on a hill. // airport is located in a bowl or on a hill.
GENAPT_LOG(SG_GENERAL, SG_DEBUG, " calc average elevation"); SG_LOG(SG_GENERAL, SG_DEBUG, " calc average elevation");
{ {
std::vector < SGGeod > dbg = nodes.get_list(); std::vector < SGGeod > dbg = nodes.get_list();
// dump the node list // dump the node list
GENAPT_LOG(SG_GENERAL, SG_DEBUG, " node list size is " << dbg.size() ); SG_LOG(SG_GENERAL, SG_DEBUG, " node list size is " << dbg.size() );
for (unsigned int w = 0; w<dbg.size(); w++) for (unsigned int w = 0; w<dbg.size(); w++)
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, " node " << w << " is " << dbg[w] ); SG_LOG(SG_GENERAL, SG_DEBUG, " node " << w << " is " << dbg[w] );
} }
} }
@ -981,7 +980,7 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
// Now build the fitted airport surface ... // Now build the fitted airport surface ...
// calculation min/max coordinates of airport area // calculation min/max coordinates of airport area
GENAPT_LOG(SG_GENERAL, SG_DEBUG, " calculation min/max coordinates of airport area"); SG_LOG(SG_GENERAL, SG_DEBUG, " calculation min/max coordinates of airport area");
SGGeod min_deg = SGGeod::fromDeg(9999.0, 9999.0); SGGeod min_deg = SGGeod::fromDeg(9999.0, 9999.0);
SGGeod max_deg = SGGeod::fromDeg(-9999.0, -9999.0); SGGeod max_deg = SGGeod::fromDeg(-9999.0, -9999.0);
@ -990,35 +989,35 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
SGGeod p = nodes.get_list()[j]; SGGeod p = nodes.get_list()[j];
if ( p.getLongitudeDeg() < min_deg.getLongitudeDeg() ) if ( p.getLongitudeDeg() < min_deg.getLongitudeDeg() )
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "new min lon from node " << j << " is " << p.getLongitudeDeg() ); SG_LOG(SG_GENERAL, SG_DEBUG, "new min lon from node " << j << " is " << p.getLongitudeDeg() );
min_deg.setLongitudeDeg( p.getLongitudeDeg() ); min_deg.setLongitudeDeg( p.getLongitudeDeg() );
} }
if ( p.getLongitudeDeg() > max_deg.getLongitudeDeg() ) if ( p.getLongitudeDeg() > max_deg.getLongitudeDeg() )
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "new max lon from node " << j << " is " << p.getLongitudeDeg() ); SG_LOG(SG_GENERAL, SG_DEBUG, "new max lon from node " << j << " is " << p.getLongitudeDeg() );
max_deg.setLongitudeDeg( p.getLongitudeDeg() ); max_deg.setLongitudeDeg( p.getLongitudeDeg() );
} }
if ( p.getLatitudeDeg() < min_deg.getLatitudeDeg() ) if ( p.getLatitudeDeg() < min_deg.getLatitudeDeg() )
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "new min lat from node " << j << " is " << p.getLatitudeDeg() ); SG_LOG(SG_GENERAL, SG_DEBUG, "new min lat from node " << j << " is " << p.getLatitudeDeg() );
min_deg.setLatitudeDeg( p.getLatitudeDeg() ); min_deg.setLatitudeDeg( p.getLatitudeDeg() );
} }
if ( p.getLatitudeDeg() > max_deg.getLatitudeDeg() ) if ( p.getLatitudeDeg() > max_deg.getLatitudeDeg() )
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "new max lat from node " << j << " is " << p.getLatitudeDeg() ); SG_LOG(SG_GENERAL, SG_DEBUG, "new max lat from node " << j << " is " << p.getLatitudeDeg() );
max_deg.setLatitudeDeg( p.getLatitudeDeg() ); max_deg.setLatitudeDeg( p.getLatitudeDeg() );
} }
} }
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Before extending for lights: min = " << min_deg << " max = " << max_deg ); SG_LOG(SG_GENERAL, SG_DEBUG, "Before extending for lights: min = " << min_deg << " max = " << max_deg );
// extend the min/max coordinates of airport area to cover all // extend the min/max coordinates of airport area to cover all
// lights as well // lights as well
GENAPT_LOG(SG_GENERAL, SG_DEBUG, " extend the min/max coordinates of airport area to cover all lights as well : num rwy lights is " << rwy_lights.size() ); SG_LOG(SG_GENERAL, SG_DEBUG, " extend the min/max coordinates of airport area to cover all lights as well : num rwy lights is " << rwy_lights.size() );
for ( unsigned int i = 0; i < rwy_lights.size(); ++i ) for ( unsigned int i = 0; i < rwy_lights.size(); ++i )
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, " extend the min/max coordinates of airport area to cover all lights as well : rwy light " << i << "has " << rwy_lights[i].ContourSize() << " lights " ); SG_LOG(SG_GENERAL, SG_DEBUG, " extend the min/max coordinates of airport area to cover all lights as well : rwy light " << i << "has " << rwy_lights[i].ContourSize() << " lights " );
for ( unsigned int j = 0; j < rwy_lights[i].ContourSize(); ++j ) for ( unsigned int j = 0; j < rwy_lights[i].ContourSize(); ++j )
{ {
@ -1049,19 +1048,19 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
max_deg.setLongitudeDeg( max_deg.getLongitudeDeg() + 0.01 * dlon ); max_deg.setLongitudeDeg( max_deg.getLongitudeDeg() + 0.01 * dlon );
min_deg.setLatitudeDeg( min_deg.getLatitudeDeg() - 0.01 * dlat ); min_deg.setLatitudeDeg( min_deg.getLatitudeDeg() - 0.01 * dlat );
max_deg.setLatitudeDeg( max_deg.getLatitudeDeg() + 0.01 * dlat ); max_deg.setLatitudeDeg( max_deg.getLatitudeDeg() + 0.01 * dlat );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "min = " << min_deg << " max = " << max_deg ); SG_LOG(SG_GENERAL, SG_DEBUG, "min = " << min_deg << " max = " << max_deg );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Create Apt surface:" ); SG_LOG(SG_GENERAL, SG_DEBUG, "Create Apt surface:" );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, " root: " << root ); SG_LOG(SG_GENERAL, SG_DEBUG, " root: " << root );
//GENAPT_LOG(SG_GENERAL, SG_DEBUG, " elev: " << elev_src ); //SG_LOG(SG_GENERAL, SG_DEBUG, " elev: " << elev_src );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, " min: " << min_deg ); SG_LOG(SG_GENERAL, SG_DEBUG, " min: " << min_deg );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, " max: " << max_deg ); SG_LOG(SG_GENERAL, SG_DEBUG, " max: " << max_deg );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, " average: " << average ); SG_LOG(SG_GENERAL, SG_DEBUG, " average: " << average );
// TODO elevation queries should be performed as member functions of surface // TODO elevation queries should be performed as member functions of surface
tgRectangle aptBounds(min_deg, max_deg); tgRectangle aptBounds(min_deg, max_deg);
tgSurface apt_surf( root, elev_src, aptBounds, average, slope_max, slope_eps ); tgSurface apt_surf( root, elev_src, aptBounds, average, slope_max, slope_eps );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Airport surface created"); SG_LOG(SG_GENERAL, SG_DEBUG, "Airport surface created");
// add light points // add light points
// pass one, calculate raw elevations from Array // pass one, calculate raw elevations from Array
@ -1072,7 +1071,7 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
} }
} }
GENAPT_LOG(SG_GENERAL, SG_INFO, "Done with lighting calc_elevations() num light polys is " << rwy_lights.size() ); SG_LOG(SG_GENERAL, SG_INFO, "Done with lighting calc_elevations() num light polys is " << rwy_lights.size() );
// pass two, for each light group check if we need to lift (based // pass two, for each light group check if we need to lift (based
// on flag) and do so, then output next structures. // on flag) and do so, then output next structures.
@ -1095,7 +1094,7 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
} }
// calculate node elevations // calculate node elevations
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Computing airport node elevations"); SG_LOG(SG_GENERAL, SG_DEBUG, "Computing airport node elevations");
std::vector<SGGeod> geod_nodes = calc_elevations( apt_surf, nodes.get_list(), 0.0 ); std::vector<SGGeod> geod_nodes = calc_elevations( apt_surf, nodes.get_list(), 0.0 );
divided_base = calc_elevations( apt_surf, divided_base, 0.0 ); divided_base = calc_elevations( apt_surf, divided_base, 0.0 );
@ -1115,9 +1114,9 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
SGVec3d gbs_center = d.getCenter(); SGVec3d gbs_center = d.getCenter();
double gbs_radius = d.getRadius(); double gbs_radius = d.getRadius();
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "gbs center = " << gbs_center); SG_LOG(SG_GENERAL, SG_DEBUG, "gbs center = " << gbs_center);
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Done with wgs84 node mapping"); SG_LOG(SG_GENERAL, SG_DEBUG, "Done with wgs84 node mapping");
GENAPT_LOG(SG_GENERAL, SG_DEBUG, " center = " << gbs_center << " radius = " << gbs_radius ); SG_LOG(SG_GENERAL, SG_DEBUG, " center = " << gbs_center << " radius = " << gbs_radius );
// null structures // null structures
group_list fans_v; fans_v.clear(); group_list fans_v; fans_v.clear();
@ -1172,7 +1171,7 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
SGGeod ref_geod; SGGeod ref_geod;
// calc elevations and write out windsock references // calc elevations and write out windsock references
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Computing windsock node elevations"); SG_LOG(SG_GENERAL, SG_DEBUG, "Computing windsock node elevations");
for ( unsigned int i = 0; i < windsocks.size(); ++i ) for ( unsigned int i = 0; i < windsocks.size(); ++i )
{ {

View file

@ -8,8 +8,6 @@
#include <simgear/debug/logstream.hxx> #include <simgear/debug/logstream.hxx>
#include <simgear/math/SGMath.hxx> #include <simgear/math/SGMath.hxx>
#include "debug.hxx"
inline double LinearDistance( const SGGeod& p0, const SGGeod& p1 ) inline double LinearDistance( const SGGeod& p0, const SGGeod& p1 )
{ {
return SGGeodesy::distanceM( p0, p1 ); return SGGeodesy::distanceM( p0, p1 );
@ -261,7 +259,7 @@ public:
void Print() void Print()
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, SG_LOG(SG_GENERAL, SG_DEBUG,
"\tLoc: " << loc << "\n" << "\tLoc: " << loc << "\n" <<
"\tprev_cp: " << prev_cp << "\n" << "\tprev_cp: " << prev_cp << "\n" <<
"\tnext_cp: " << next_cp << "\n" ); "\tnext_cp: " << next_cp << "\n" );

View file

@ -63,7 +63,7 @@ ClosedPoly::ClosedPoly( int st, float s, float th, char* desc )
ClosedPoly::~ClosedPoly() ClosedPoly::~ClosedPoly()
{ {
GENAPT_LOG( SG_GENERAL, SG_DEBUG, "Deleting ClosedPoly " << description ); SG_LOG( SG_GENERAL, SG_DEBUG, "Deleting ClosedPoly " << description );
} }
void ClosedPoly::AddNode( BezNode* node ) void ClosedPoly::AddNode( BezNode* node )
@ -75,7 +75,7 @@ void ClosedPoly::AddNode( BezNode* node )
} }
cur_contour->push_back( node ); cur_contour->push_back( node );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "CLOSEDPOLY::ADDNODE : " << node->GetLoc() ); SG_LOG(SG_GENERAL, SG_DEBUG, "CLOSEDPOLY::ADDNODE : " << node->GetLoc() );
// For pavement polys, add a linear feature for each contour // For pavement polys, add a linear feature for each contour
if (is_pavement) if (is_pavement)
@ -92,7 +92,7 @@ void ClosedPoly::AddNode( BezNode* node )
feature_desc += "boundary"; feature_desc += "boundary";
} }
GENAPT_LOG(SG_GENERAL, SG_DEBUG, " Adding node " << node->GetLoc() << " to current linear feature " << cur_feature); SG_LOG(SG_GENERAL, SG_DEBUG, " Adding node " << node->GetLoc() << " to current linear feature " << cur_feature);
cur_feature = new LinearFeature(feature_desc, 1.0f ); cur_feature = new LinearFeature(feature_desc, 1.0f );
} }
cur_feature->AddNode( node ); cur_feature->AddNode( node );
@ -101,13 +101,13 @@ void ClosedPoly::AddNode( BezNode* node )
void ClosedPoly::CloseCurContour() void ClosedPoly::CloseCurContour()
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Close Contour"); SG_LOG(SG_GENERAL, SG_DEBUG, "Close Contour");
// if we are recording a pavement marking - it must be closed - // if we are recording a pavement marking - it must be closed -
// add the first node of the poly // add the first node of the poly
if (cur_feature) if (cur_feature)
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "We still have an active linear feature - add the first node to close it"); SG_LOG(SG_GENERAL, SG_DEBUG, "We still have an active linear feature - add the first node to close it");
cur_feature->Finish(true, features.size() ); cur_feature->Finish(true, features.size() );
features.push_back(cur_feature); features.push_back(cur_feature);
@ -146,7 +146,7 @@ void ClosedPoly::ConvertContour( BezContour* src, tgContour& dst )
double total_dist; double total_dist;
int num_segs = BEZIER_DETAIL; int num_segs = BEZIER_DETAIL;
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Creating a contour with " << src->size() << " nodes"); SG_LOG(SG_GENERAL, SG_DEBUG, "Creating a contour with " << src->size() << " nodes");
// clear anything in this point list // clear anything in this point list
dst.Erase(); dst.Erase();
@ -154,7 +154,7 @@ void ClosedPoly::ConvertContour( BezContour* src, tgContour& dst )
// iterate through each bezier node in the contour // iterate through each bezier node in the contour
for (unsigned int i = 0; i <= src->size()-1; i++) for (unsigned int i = 0; i <= src->size()-1; i++)
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "\nHandling Node " << i << "\n\n"); SG_LOG(SG_GENERAL, SG_DEBUG, "\nHandling Node " << i << "\n\n");
curNode = src->at(i); curNode = src->at(i);
if (i < src->size() - 1) if (i < src->size() - 1)
@ -211,8 +211,8 @@ void ClosedPoly::ConvertContour( BezContour* src, tgContour& dst )
{ {
// If total distance is < 4 meters, then we need to modify num Segments so that each segment >= 2 meters // If total distance is < 4 meters, then we need to modify num Segments so that each segment >= 2 meters
num_segs = ((int)total_dist + 1); num_segs = ((int)total_dist + 1);
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Segment from " << curNode->GetLoc() << " to " << nextNode->GetLoc() ); SG_LOG(SG_GENERAL, SG_DEBUG, "Segment from " << curNode->GetLoc() << " to " << nextNode->GetLoc() );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, " Distance is " << total_dist << " ( < 16.0) so num_segs is " << num_segs ); SG_LOG(SG_GENERAL, SG_DEBUG, " Distance is " << total_dist << " ( < 16.0) so num_segs is " << num_segs );
} }
else else
{ {
@ -223,16 +223,16 @@ void ClosedPoly::ConvertContour( BezContour* src, tgContour& dst )
{ {
// If total distance is > 800 meters, then we need to modify num Segments so that each segment <= 100 meters // If total distance is > 800 meters, then we need to modify num Segments so that each segment <= 100 meters
num_segs = total_dist / 100.0f + 1; num_segs = total_dist / 100.0f + 1;
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Segment from " << curNode->GetLoc() << " to " << nextNode->GetLoc() ); SG_LOG(SG_GENERAL, SG_DEBUG, "Segment from " << curNode->GetLoc() << " to " << nextNode->GetLoc() );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, " Distance is " << total_dist << " ( > 100.0) so num_segs is " << num_segs ); SG_LOG(SG_GENERAL, SG_DEBUG, " Distance is " << total_dist << " ( > 100.0) so num_segs is " << num_segs );
} }
else else
{ {
if (curve_type != CURVE_LINEAR) if (curve_type != CURVE_LINEAR)
{ {
num_segs = 8; num_segs = 8;
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Segment from " << curNode->GetLoc() << " to " << nextNode->GetLoc() ); SG_LOG(SG_GENERAL, SG_DEBUG, "Segment from " << curNode->GetLoc() << " to " << nextNode->GetLoc() );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, " Distance is " << total_dist << " (OK) so num_segs is " << num_segs ); SG_LOG(SG_GENERAL, SG_DEBUG, " Distance is " << total_dist << " (OK) so num_segs is " << num_segs );
} }
else else
{ {
@ -274,11 +274,11 @@ void ClosedPoly::ConvertContour( BezContour* src, tgContour& dst )
if (p==0) if (p==0)
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "adding Curve Anchor node (type " << curve_type << ") at " << curLoc ); SG_LOG(SG_GENERAL, SG_DEBUG, "adding Curve Anchor node (type " << curve_type << ") at " << curLoc );
} }
else else
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, " add bezier node (type " << curve_type << ") at " << curLoc ); SG_LOG(SG_GENERAL, SG_DEBUG, " add bezier node (type " << curve_type << ") at " << curLoc );
} }
// now set set cur location for the next iteration // now set set cur location for the next iteration
@ -299,11 +299,11 @@ void ClosedPoly::ConvertContour( BezContour* src, tgContour& dst )
if (p==0) if (p==0)
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "adding Linear anchor node at " << curLoc ); SG_LOG(SG_GENERAL, SG_DEBUG, "adding Linear anchor node at " << curLoc );
} }
else else
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, " add linear node at " << curLoc ); SG_LOG(SG_GENERAL, SG_DEBUG, " add linear node at " << curLoc );
} }
// now set set prev and cur locations for the next iteration // now set set prev and cur locations for the next iteration
@ -317,7 +317,7 @@ void ClosedPoly::ConvertContour( BezContour* src, tgContour& dst )
// just add the one vertex - dist is small // just add the one vertex - dist is small
dst.AddNode( curLoc ); dst.AddNode( curLoc );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "adding Linear Anchor node at " << curLoc ); SG_LOG(SG_GENERAL, SG_DEBUG, "adding Linear Anchor node at " << curLoc );
curLoc = nextLoc; curLoc = nextLoc;
} }
@ -333,10 +333,10 @@ void ClosedPoly::Finish()
// error handling // error handling
if (boundary == NULL) if (boundary == NULL)
{ {
GENAPT_LOG(SG_GENERAL, SG_ALERT, "no boundary"); SG_LOG(SG_GENERAL, SG_ALERT, "no boundary");
} }
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Converting a poly with " << holes.size() << " holes"); SG_LOG(SG_GENERAL, SG_DEBUG, "Converting a poly with " << holes.size() << " holes");
if (boundary != NULL) if (boundary != NULL)
{ {
@ -422,7 +422,7 @@ std::string ClosedPoly::GetMaterial( int surface )
break; break;
default: default:
GENAPT_LOG(SG_GENERAL, SG_ALERT, "ClosedPoly::BuildBtg: unknown surface type " << surface_type ); SG_LOG(SG_GENERAL, SG_ALERT, "ClosedPoly::BuildBtg: unknown surface type " << surface_type );
exit(1); exit(1);
} }

View file

@ -63,7 +63,7 @@ double tgAverageElevation( const std::string &root, const string_list elev_src,
for ( i = 0; i < points.size(); ++i ) { for ( i = 0; i < points.size(); ++i ) {
if ( points[i].getElevationM() < -9000.0 && !found_one ) { if ( points[i].getElevationM() < -9000.0 && !found_one ) {
first = points[i]; first = points[i];
GENAPT_LOG( SG_GENERAL, SG_DEBUG, "found first = " << first ); SG_LOG( SG_GENERAL, SG_DEBUG, "found first = " << first );
found_one = true; found_one = true;
} }
@ -81,7 +81,7 @@ double tgAverageElevation( const std::string &root, const string_list elev_src,
if ( array.open(array_path) ) { if ( array.open(array_path) ) {
found_file = true; found_file = true;
GENAPT_LOG( SG_GENERAL, SG_DEBUG, "Using array_path = " << array_path ); SG_LOG( SG_GENERAL, SG_DEBUG, "Using array_path = " << array_path );
} }
i++; i++;
} }
@ -123,7 +123,7 @@ double tgAverageElevation( const std::string &root, const string_list elev_src,
count++; count++;
} }
double average = total / (double) count; double average = total / (double) count;
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Average surface height of point list = " << average); SG_LOG(SG_GENERAL, SG_DEBUG, "Average surface height of point list = " << average);
return average; return average;
} }

View file

@ -36,7 +36,7 @@ Helipad::Helipad(char* definition)
heli.designator, &heli.lat, &heli.lon, &heli.heading, &heli.length, &heli.width, &heli.surface, heli.designator, &heli.lat, &heli.lon, &heli.heading, &heli.length, &heli.width, &heli.surface,
&heli.marking, &heli.shoulder, &heli.smoothness, &heli.edge_lights); &heli.marking, &heli.shoulder, &heli.smoothness, &heli.edge_lights);
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Read helipad: (" << heli.lon << "," << heli.lat << ") heading: " << heli.heading << " length: " << heli.length << " width: " << heli.width ); SG_LOG(SG_GENERAL, SG_DEBUG, "Read helipad: (" << heli.lon << "," << heli.lat << ") heading: " << heli.heading << " length: " << heli.length << " width: " << heli.width );
} }
tglightcontour_list Helipad::gen_helipad_lights(double maxsize) { tglightcontour_list Helipad::gen_helipad_lights(double maxsize) {

View file

@ -22,7 +22,7 @@ void LinearFeature::ConvertContour( BezContour* src, bool closed )
Marking* cur_mark = NULL; Marking* cur_mark = NULL;
Lighting* cur_light = NULL; Lighting* cur_light = NULL;
GENAPT_LOG(SG_GENERAL, SG_DEBUG, " LinearFeature::ConvertContour - Creating a contour with " << src->size() << " nodes"); SG_LOG(SG_GENERAL, SG_DEBUG, " LinearFeature::ConvertContour - Creating a contour with " << src->size() << " nodes");
// clear anything in the point list // clear anything in the point list
points.Erase(); points.Erase();
@ -50,7 +50,7 @@ void LinearFeature::ConvertContour( BezContour* src, bool closed )
{ {
if (curNode->GetMarking() != cur_mark->type) if (curNode->GetMarking() != cur_mark->type)
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "LinearFeature::ConvertContour Marking has changed from " << cur_mark->type << " to " << curNode->GetMarking() << " save mark from " << cur_mark->start_idx << " to " << points.GetSize() ); SG_LOG(SG_GENERAL, SG_DEBUG, "LinearFeature::ConvertContour Marking has changed from " << cur_mark->type << " to " << curNode->GetMarking() << " save mark from " << cur_mark->start_idx << " to " << points.GetSize() );
// marking has ended, or changed // marking has ended, or changed
cur_mark->end_idx = points.GetSize(); cur_mark->end_idx = points.GetSize();
@ -59,7 +59,7 @@ void LinearFeature::ConvertContour( BezContour* src, bool closed )
} }
else else
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "LinearFeature::ConvertContour Continue Marking from " << cur_mark->start_idx << " with type " << cur_mark->type ); SG_LOG(SG_GENERAL, SG_DEBUG, "LinearFeature::ConvertContour Continue Marking from " << cur_mark->start_idx << " with type " << cur_mark->type );
} }
} }
@ -68,7 +68,7 @@ void LinearFeature::ConvertContour( BezContour* src, bool closed )
{ {
if (curNode->GetMarking()) if (curNode->GetMarking())
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "LinearFeature::ConvertContour Start Marking from " << points.GetSize() << " with type " << curNode->GetMarking() ); SG_LOG(SG_GENERAL, SG_DEBUG, "LinearFeature::ConvertContour Start Marking from " << points.GetSize() << " with type " << curNode->GetMarking() );
// we aren't watching a mark, and this node has one // we aren't watching a mark, and this node has one
cur_mark = new Marking; cur_mark = new Marking;
@ -87,7 +87,7 @@ void LinearFeature::ConvertContour( BezContour* src, bool closed )
{ {
if (curNode->GetLighting() != cur_light->type) if (curNode->GetLighting() != cur_light->type)
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "LinearFeature::ConvertContour Lighting has changed from " << cur_light->type << " to " << curNode->GetLighting() << " save light from " << cur_light->start_idx << " to " << points.GetSize() ); SG_LOG(SG_GENERAL, SG_DEBUG, "LinearFeature::ConvertContour Lighting has changed from " << cur_light->type << " to " << curNode->GetLighting() << " save light from " << cur_light->start_idx << " to " << points.GetSize() );
// lighting has ended, or changed : add final light // lighting has ended, or changed : add final light
cur_light->end_idx = points.GetSize(); cur_light->end_idx = points.GetSize();
@ -96,7 +96,7 @@ void LinearFeature::ConvertContour( BezContour* src, bool closed )
} }
else else
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "LinearFeature::ConvertContour Continue Lighting from " << cur_light->start_idx << " with type " << cur_light->type ); SG_LOG(SG_GENERAL, SG_DEBUG, "LinearFeature::ConvertContour Continue Lighting from " << cur_light->start_idx << " with type " << cur_light->type );
} }
} }
@ -105,7 +105,7 @@ void LinearFeature::ConvertContour( BezContour* src, bool closed )
{ {
if (curNode->GetLighting()) if (curNode->GetLighting())
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "LinearFeature::ConvertContour Start Lighting from " << points.GetSize() << " with type " << curNode->GetLighting() ); SG_LOG(SG_GENERAL, SG_DEBUG, "LinearFeature::ConvertContour Start Lighting from " << points.GetSize() << " with type " << curNode->GetLighting() );
// we aren't watching a mark, and this node has one // we aren't watching a mark, and this node has one
cur_light = new Lighting; cur_light = new Lighting;
@ -166,12 +166,12 @@ void LinearFeature::ConvertContour( BezContour* src, bool closed )
{ {
if ( (abs(theta1 - 180.0) < 5.0 ) || (abs(theta1) < 5.0 ) || (isnan(theta1)) ) if ( (abs(theta1 - 180.0) < 5.0 ) || (abs(theta1) < 5.0 ) || (isnan(theta1)) )
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "\nLinearFeature: Quadtratic curve with cp in line : convert to linear: " << description << ": theta is " << theta1 ); SG_LOG(SG_GENERAL, SG_DEBUG, "\nLinearFeature: Quadtratic curve with cp in line : convert to linear: " << description << ": theta is " << theta1 );
curve_type = CURVE_LINEAR; curve_type = CURVE_LINEAR;
} }
else else
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "\nLinearFeature: Quadtratic curve withOUT cp in line : keep quadtratic: " << description << ": theta is " << theta1 ); SG_LOG(SG_GENERAL, SG_DEBUG, "\nLinearFeature: Quadtratic curve withOUT cp in line : keep quadtratic: " << description << ": theta is " << theta1 );
} }
} }
@ -179,30 +179,30 @@ void LinearFeature::ConvertContour( BezContour* src, bool closed )
{ {
if ( (abs(theta1 - 180.0) < 5.0 ) || (abs(theta1) < 5.0 ) || (isnan(theta1)) ) if ( (abs(theta1 - 180.0) < 5.0 ) || (abs(theta1) < 5.0 ) || (isnan(theta1)) )
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "\nLinearFeature: Cubic curve with cp1 in line : " << description << ": theta is " << theta1 ); SG_LOG(SG_GENERAL, SG_DEBUG, "\nLinearFeature: Cubic curve with cp1 in line : " << description << ": theta is " << theta1 );
if ( (abs(theta2 - 180.0) < 5.0 ) || (abs(theta2) < 5.0 ) || (isnan(theta2)) ) if ( (abs(theta2 - 180.0) < 5.0 ) || (abs(theta2) < 5.0 ) || (isnan(theta2)) )
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "\n and cp2 in line : " << description << ": theta is " << theta2 << " CONVERTING TO LINEAR" ); SG_LOG(SG_GENERAL, SG_DEBUG, "\n and cp2 in line : " << description << ": theta is " << theta2 << " CONVERTING TO LINEAR" );
curve_type = CURVE_LINEAR; curve_type = CURVE_LINEAR;
} }
else else
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "\n BUT cp2 NOT in line : " << description << ": theta is " << theta2 ); SG_LOG(SG_GENERAL, SG_DEBUG, "\n BUT cp2 NOT in line : " << description << ": theta is " << theta2 );
} }
} }
else else
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "\nLinearFeature: Cubic curve withOUT cp1 in line : keep quadtratic: " << description << ": theta is " << theta1 ); SG_LOG(SG_GENERAL, SG_DEBUG, "\nLinearFeature: Cubic curve withOUT cp1 in line : keep quadtratic: " << description << ": theta is " << theta1 );
if ( (abs(theta2 - 180.0) < 5.0 ) || (abs(theta2) < 5.0 ) || (isnan(theta2)) ) if ( (abs(theta2 - 180.0) < 5.0 ) || (abs(theta2) < 5.0 ) || (isnan(theta2)) )
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "\n BUT cp2 IS in line : " << description << ": theta is " << theta2 ); SG_LOG(SG_GENERAL, SG_DEBUG, "\n BUT cp2 IS in line : " << description << ": theta is " << theta2 );
} }
else else
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "\n AND cp2 NOT in line : " << description << ": theta is " << theta2 ); SG_LOG(SG_GENERAL, SG_DEBUG, "\n AND cp2 NOT in line : " << description << ": theta is " << theta2 );
} }
} }
} }
@ -213,8 +213,8 @@ void LinearFeature::ConvertContour( BezContour* src, bool closed )
{ {
// If total distance is < 4 meters, then we need to modify num Segments so that each segment >= 1/2 meter // If total distance is < 4 meters, then we need to modify num Segments so that each segment >= 1/2 meter
num_segs = ((int)total_dist + 1) * 2; num_segs = ((int)total_dist + 1) * 2;
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Segment from " << curNode->GetLoc() << " to " << nextNode->GetLoc() ); SG_LOG(SG_GENERAL, SG_DEBUG, "Segment from " << curNode->GetLoc() << " to " << nextNode->GetLoc() );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, " Distance is " << total_dist << " ( < 4.0) so num_segs is " << num_segs ); SG_LOG(SG_GENERAL, SG_DEBUG, " Distance is " << total_dist << " ( < 4.0) so num_segs is " << num_segs );
} }
else else
{ {
@ -225,16 +225,16 @@ void LinearFeature::ConvertContour( BezContour* src, bool closed )
{ {
// If total distance is > 800 meters, then we need to modify num Segments so that each segment <= 100 meters // If total distance is > 800 meters, then we need to modify num Segments so that each segment <= 100 meters
num_segs = total_dist / 100.0f + 1; num_segs = total_dist / 100.0f + 1;
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Segment from " << curNode->GetLoc() << " to " << nextNode->GetLoc() ); SG_LOG(SG_GENERAL, SG_DEBUG, "Segment from " << curNode->GetLoc() << " to " << nextNode->GetLoc() );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, " Distance is " << total_dist << " ( > 100.0) so num_segs is " << num_segs ); SG_LOG(SG_GENERAL, SG_DEBUG, " Distance is " << total_dist << " ( > 100.0) so num_segs is " << num_segs );
} }
else else
{ {
if (curve_type != CURVE_LINEAR) if (curve_type != CURVE_LINEAR)
{ {
num_segs = 8; num_segs = 8;
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Segment from " << curNode->GetLoc() << " to " << nextNode->GetLoc() ); SG_LOG(SG_GENERAL, SG_DEBUG, "Segment from " << curNode->GetLoc() << " to " << nextNode->GetLoc() );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, " Distance is " << total_dist << " (OK) so num_segs is " << num_segs ); SG_LOG(SG_GENERAL, SG_DEBUG, " Distance is " << total_dist << " (OK) so num_segs is " << num_segs );
} }
else else
{ {
@ -269,11 +269,11 @@ void LinearFeature::ConvertContour( BezContour* src, bool closed )
if (p==0) if (p==0)
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "adding Curve Anchor node (type " << curve_type << ") at " << curLoc ); SG_LOG(SG_GENERAL, SG_DEBUG, "adding Curve Anchor node (type " << curve_type << ") at " << curLoc );
} }
else else
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, " add bezier node (type " << curve_type << ") at " << curLoc ); SG_LOG(SG_GENERAL, SG_DEBUG, " add bezier node (type " << curve_type << ") at " << curLoc );
} }
// now set set prev and cur locations for the next iteration // now set set prev and cur locations for the next iteration
@ -295,11 +295,11 @@ void LinearFeature::ConvertContour( BezContour* src, bool closed )
if (p==0) if (p==0)
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "adding Linear anchor node at " << curLoc ); SG_LOG(SG_GENERAL, SG_DEBUG, "adding Linear anchor node at " << curLoc );
} }
else else
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, " add linear node at " << curLoc ); SG_LOG(SG_GENERAL, SG_DEBUG, " add linear node at " << curLoc );
} }
// now set set prev and cur locations for the next iteration // now set set prev and cur locations for the next iteration
@ -313,7 +313,7 @@ void LinearFeature::ConvertContour( BezContour* src, bool closed )
// just add the one vertex - dist is small // just add the one vertex - dist is small
points.AddNode(curLoc); points.AddNode(curLoc);
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "adding Linear Anchor node at " << curLoc ); SG_LOG(SG_GENERAL, SG_DEBUG, "adding Linear Anchor node at " << curLoc );
curLoc = nextLoc; curLoc = nextLoc;
} }
@ -322,7 +322,7 @@ void LinearFeature::ConvertContour( BezContour* src, bool closed )
if (closed) if (closed)
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Closed COntour : adding last node at " << curLoc ); SG_LOG(SG_GENERAL, SG_DEBUG, "Closed COntour : adding last node at " << curLoc );
// need to add the markings for last segment // need to add the markings for last segment
points.AddNode(curLoc); points.AddNode(curLoc);
@ -331,7 +331,7 @@ void LinearFeature::ConvertContour( BezContour* src, bool closed )
// check for marking that goes all the way to the end... // check for marking that goes all the way to the end...
if (cur_mark) if (cur_mark)
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "LinearFeature::ConvertContour Marking from " << cur_mark->start_idx << " with type " << cur_mark->type << " ends at the end of the contour: " << points.GetSize() ); SG_LOG(SG_GENERAL, SG_DEBUG, "LinearFeature::ConvertContour Marking from " << cur_mark->start_idx << " with type " << cur_mark->type << " ends at the end of the contour: " << points.GetSize() );
cur_mark->end_idx = points.GetSize()-1; cur_mark->end_idx = points.GetSize()-1;
marks.push_back(cur_mark); marks.push_back(cur_mark);
@ -341,7 +341,7 @@ void LinearFeature::ConvertContour( BezContour* src, bool closed )
// check for lighting that goes all the way to the end... // check for lighting that goes all the way to the end...
if (cur_light) if (cur_light)
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "LinearFeature::ConvertContour Lighting from " << cur_light->start_idx << " with type " << cur_light->type << " ends at the end of the contour: " << points.GetSize() ); SG_LOG(SG_GENERAL, SG_DEBUG, "LinearFeature::ConvertContour Lighting from " << cur_light->start_idx << " with type " << cur_light->type << " ends at the end of the contour: " << points.GetSize() );
cur_light->end_idx = points.GetSize()-1; cur_light->end_idx = points.GetSize()-1;
lights.push_back(cur_light); lights.push_back(cur_light);
@ -500,13 +500,13 @@ int LinearFeature::Finish( bool closed, unsigned int idx )
break; break;
default: default:
GENAPT_LOG(SG_GENERAL, SG_ALERT, "LinearFeature::Finish: unknown marking " << marks[i]->type ); SG_LOG(SG_GENERAL, SG_ALERT, "LinearFeature::Finish: unknown marking " << marks[i]->type );
exit(1); exit(1);
} }
for (unsigned int j = marks[i]->start_idx; j <= marks[i]->end_idx; j++) for (unsigned int j = marks[i]->start_idx; j <= marks[i]->end_idx; j++)
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "LinearFeature::Finish: calculating offsets for mark " << i << " whose start idx is " << marks[i]->start_idx << " and end idx is " << marks[i]->end_idx << " cur idx is " << j ); SG_LOG(SG_GENERAL, SG_DEBUG, "LinearFeature::Finish: calculating offsets for mark " << i << " whose start idx is " << marks[i]->start_idx << " and end idx is " << marks[i]->end_idx << " cur idx is " << j );
// for each point on the PointsList, generate a quad from // for each point on the PointsList, generate a quad from
// start to next, offset by 2 distnaces from the edge // start to next, offset by 2 distnaces from the edge
@ -607,7 +607,7 @@ int LinearFeature::Finish( bool closed, unsigned int idx )
for (unsigned int j = lights[i]->start_idx; j <= lights[i]->end_idx; j++) for (unsigned int j = lights[i]->start_idx; j <= lights[i]->end_idx; j++)
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "LinearFeature::Finish: calculating offsets for light " << i << " whose start idx is " << lights[i]->start_idx << " and end idx is " << lights[i]->end_idx << " cur idx is " << j ); SG_LOG(SG_GENERAL, SG_DEBUG, "LinearFeature::Finish: calculating offsets for light " << i << " whose start idx is " << lights[i]->start_idx << " and end idx is " << lights[i]->end_idx << " cur idx is " << j );
// for each point on the PointsList, offset by 2 distnaces from the edge, and add a point to the superpoly contour // for each point on the PointsList, offset by 2 distnaces from the edge, and add a point to the superpoly contour
if (j == lights[i]->start_idx) if (j == lights[i]->start_idx)
{ {
@ -691,7 +691,7 @@ int LinearFeature::Finish( bool closed, unsigned int idx )
// if there were lights generated - create the superpoly // if there were lights generated - create the superpoly
if (cur_light_contour.ContourSize()) if (cur_light_contour.ContourSize())
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "\nLinearFeature::Finish: Adding light contour with " << cur_light_contour.ContourSize() << " lights" ); SG_LOG(SG_GENERAL, SG_DEBUG, "\nLinearFeature::Finish: Adding light contour with " << cur_light_contour.ContourSize() << " lights" );
cur_light_contour.SetFlag(""); cur_light_contour.SetFlag("");
lighting_polys.push_back(cur_light_contour); lighting_polys.push_back(cur_light_contour);
} }
@ -699,13 +699,13 @@ int LinearFeature::Finish( bool closed, unsigned int idx )
// create the superpoly for the alternating light color // create the superpoly for the alternating light color
if (alt_light_contour.ContourSize()) if (alt_light_contour.ContourSize())
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "\nLinearFeature::Finish: Adding light contour with " << cur_light_contour.ContourSize() << " lights" ); SG_LOG(SG_GENERAL, SG_DEBUG, "\nLinearFeature::Finish: Adding light contour with " << cur_light_contour.ContourSize() << " lights" );
alt_light_contour.SetFlag(""); alt_light_contour.SetFlag("");
lighting_polys.push_back(cur_light_contour); lighting_polys.push_back(cur_light_contour);
} }
else else
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "\nLinearFeature::Finish: No points for linear feature " << description << " light index " << i ); SG_LOG(SG_GENERAL, SG_DEBUG, "\nLinearFeature::Finish: No points for linear feature " << description << " light index " << i );
} }
} }
@ -717,7 +717,7 @@ int LinearFeature::BuildBtg(tgpolygon_list& line_polys, tglightcontour_list& lig
tgPolygon poly; tgPolygon poly;
SGGeod min, max, minp, maxp; SGGeod min, max, minp, maxp;
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "\nLinearFeature::BuildBtg: " << description); SG_LOG(SG_GENERAL, SG_DEBUG, "\nLinearFeature::BuildBtg: " << description);
for ( unsigned int i = 0; i < marking_polys.size(); i++) for ( unsigned int i = 0; i < marking_polys.size(); i++)
{ {
// Clipping and triangulation need to copy texparams, and material info... // Clipping and triangulation need to copy texparams, and material info...
@ -727,7 +727,7 @@ int LinearFeature::BuildBtg(tgpolygon_list& line_polys, tglightcontour_list& lig
accum.Add( marking_polys[i] ); accum.Add( marking_polys[i] );
} }
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "LinearFeature::BuildBtg: add " << lighting_polys.size() << " light defs"); SG_LOG(SG_GENERAL, SG_DEBUG, "LinearFeature::BuildBtg: add " << lighting_polys.size() << " light defs");
for ( unsigned i = 0; i < lighting_polys.size(); i++) for ( unsigned i = 0; i < lighting_polys.size(); i++)
{ {
lights.push_back( lighting_polys[i] ); lights.push_back( lighting_polys[i] );

View file

@ -6,14 +6,14 @@ Windsock::Windsock( char* definition )
{ {
sscanf(definition, "%lf %lf %d", &lat, &lon, &lit); sscanf(definition, "%lf %lf %d", &lat, &lon, &lit);
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Read Windsock: (" << lon << "," << lat << ") lit: " << lit ); SG_LOG(SG_GENERAL, SG_DEBUG, "Read Windsock: (" << lon << "," << lat << ") lit: " << lit );
} }
Beacon::Beacon( char* definition ) Beacon::Beacon( char* definition )
{ {
sscanf(definition, "%lf %lf %d", &lat, &lon, &code); sscanf(definition, "%lf %lf %d", &lat, &lon, &code);
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Read Beacon: (" << lon << "," << lat << ") code: " << code ); SG_LOG(SG_GENERAL, SG_DEBUG, "Read Beacon: (" << lon << "," << lat << ") code: " << code );
} }
Sign::Sign( char* definition ) Sign::Sign( char* definition )
@ -27,7 +27,7 @@ Sign::Sign( char* definition )
// Flightgear wants the heading to be the heading in which the sign is read // Flightgear wants the heading to be the heading in which the sign is read
heading = -def_heading + 360.0; heading = -def_heading + 360.0;
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Read Sign: (" << lon << "," << lat << ") heading " << def_heading << " size " << size << " definition: " << sgdef << " calc view heading: " << heading ); SG_LOG(SG_GENERAL, SG_DEBUG, "Read Sign: (" << lon << "," << lat << ") heading " << def_heading << " size " << size << " definition: " << sgdef << " calc view heading: " << heading );
sgn_def = sgdef; sgn_def = sgdef;
} }

View file

@ -35,7 +35,7 @@ using namespace std;
// Display usage // Display usage
static void usage( int argc, char **argv ) { static void usage( int argc, char **argv ) {
GENAPT_LOG(SG_GENERAL, SG_ALERT, "Usage: " << argv[0] << "\n--input=<apt_file>" SG_LOG(SG_GENERAL, SG_ALERT, "Usage: " << argv[0] << "\n--input=<apt_file>"
<< "\n--work=<work_dir>\n[ --start-id=abcd ] [ --restart-id=abcd ] [ --nudge=n ] " << "\n--work=<work_dir>\n[ --start-id=abcd ] [ --restart-id=abcd ] [ --nudge=n ] "
<< "[--min-lon=<deg>] [--max-lon=<deg>] [--min-lat=<deg>] [--max-lat=<deg>] " << "[--min-lon=<deg>] [--max-lon=<deg>] [--min-lat=<deg>] [--max-lat=<deg>] "
<< "[ --airport=abcd ] [--max-slope=<decimal>] [--tile=<tile>] [--threads] [--threads=x]" << "[ --airport=abcd ] [--max-slope=<decimal>] [--tile=<tile>] [--threads] [--threads=x]"
@ -236,7 +236,7 @@ int main(int argc, char **argv)
} }
else if (arg.find("--debug-taxiways=") == 0) else if (arg.find("--debug-taxiways=") == 0)
{ {
GENAPT_LOG(SG_GENERAL, SG_INFO, "add debug taxiway " << arg.substr(17) ); SG_LOG(SG_GENERAL, SG_INFO, "add debug taxiway " << arg.substr(17) );
debug_taxiway_defs.push_back( arg.substr(17) ); debug_taxiway_defs.push_back( arg.substr(17) );
} }
else if (arg.find("--debug-features=") == 0) else if (arg.find("--debug-features=") == 0)
@ -258,26 +258,26 @@ int main(int argc, char **argv)
std::string airportareadir=work_dir+"/AirportArea"; std::string airportareadir=work_dir+"/AirportArea";
// this is the main program - // this is the main program -
GENAPT_LOG(SG_GENERAL, SG_INFO, "Genapts850 version " << getTGVersion() << " running with " << num_threads << " threads" ); SG_LOG(SG_GENERAL, SG_INFO, "Genapts850 version " << getTGVersion() << " running with " << num_threads << " threads" );
GENAPT_LOG(SG_GENERAL, SG_INFO, "Launch command was " << argv[0] ); SG_LOG(SG_GENERAL, SG_INFO, "Launch command was " << argv[0] );
GENAPT_LOG(SG_GENERAL, SG_INFO, "Input file = " << input_file); SG_LOG(SG_GENERAL, SG_INFO, "Input file = " << input_file);
GENAPT_LOG(SG_GENERAL, SG_INFO, "Work directory = " << work_dir); SG_LOG(SG_GENERAL, SG_INFO, "Work directory = " << work_dir);
GENAPT_LOG(SG_GENERAL, SG_INFO, "Longitude = " << min.getLongitudeDeg() << ':' << max.getLongitudeDeg()); SG_LOG(SG_GENERAL, SG_INFO, "Longitude = " << min.getLongitudeDeg() << ':' << max.getLongitudeDeg());
GENAPT_LOG(SG_GENERAL, SG_INFO, "Latitude = " << min.getLatitudeDeg() << ':' << max.getLatitudeDeg()); SG_LOG(SG_GENERAL, SG_INFO, "Latitude = " << min.getLatitudeDeg() << ':' << max.getLatitudeDeg());
GENAPT_LOG(SG_GENERAL, SG_INFO, "Terrain sources = "); SG_LOG(SG_GENERAL, SG_INFO, "Terrain sources = ");
for ( unsigned int i = 0; i < elev_src.size(); ++i ) { for ( unsigned int i = 0; i < elev_src.size(); ++i ) {
GENAPT_LOG(SG_GENERAL, SG_INFO, " " << work_dir << "/" << elev_src[i] ); SG_LOG(SG_GENERAL, SG_INFO, " " << work_dir << "/" << elev_src[i] );
} }
GENAPT_LOG(SG_GENERAL, SG_INFO, "Nudge = " << nudge); SG_LOG(SG_GENERAL, SG_INFO, "Nudge = " << nudge);
if (!max.isValid() || !min.isValid()) if (!max.isValid() || !min.isValid())
{ {
GENAPT_LOG(SG_GENERAL, SG_ALERT, "Bad longitude or latitude"); SG_LOG(SG_GENERAL, SG_ALERT, "Bad longitude or latitude");
exit(1); exit(1);
} }
// make work directory // make work directory
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Creating AirportArea directory"); SG_LOG(SG_GENERAL, SG_DEBUG, "Creating AirportArea directory");
SGPath sgp( airportareadir ); SGPath sgp( airportareadir );
sgp.append( "dummy" ); sgp.append( "dummy" );
@ -290,21 +290,21 @@ int main(int argc, char **argv)
if ( work_dir == "" ) if ( work_dir == "" )
{ {
GENAPT_LOG( SG_GENERAL, SG_ALERT, "Error: no work directory specified." ); SG_LOG( SG_GENERAL, SG_ALERT, "Error: no work directory specified." );
usage( argc, argv ); usage( argc, argv );
exit(-1); exit(-1);
} }
if ( input_file == "" ) if ( input_file == "" )
{ {
GENAPT_LOG( SG_GENERAL, SG_ALERT, "Error: no input file." ); SG_LOG( SG_GENERAL, SG_ALERT, "Error: no input file." );
exit(-1); exit(-1);
} }
sg_gzifstream in( input_file ); sg_gzifstream in( input_file );
if ( !in.is_open() ) if ( !in.is_open() )
{ {
GENAPT_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << input_file ); SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << input_file );
exit(-1); exit(-1);
} }
@ -320,7 +320,7 @@ int main(int argc, char **argv)
// just find and add the one airport // just find and add the one airport
scheduler->AddAirport( airport_id ); scheduler->AddAirport( airport_id );
GENAPT_LOG(SG_GENERAL, SG_INFO, "Finished Adding airport - now parse"); SG_LOG(SG_GENERAL, SG_INFO, "Finished Adding airport - now parse");
// and schedule parsers // and schedule parsers
scheduler->Schedule( num_threads, summary_file ); scheduler->Schedule( num_threads, summary_file );
@ -328,7 +328,7 @@ int main(int argc, char **argv)
else if ( start_id != "" ) else if ( start_id != "" )
{ {
GENAPT_LOG(SG_GENERAL, SG_INFO, "move forward to " << start_id ); SG_LOG(SG_GENERAL, SG_INFO, "move forward to " << start_id );
// scroll forward in datafile // scroll forward in datafile
position = scheduler->FindAirport( start_id ); position = scheduler->FindAirport( start_id );
@ -350,7 +350,7 @@ int main(int argc, char **argv)
} }
} }
GENAPT_LOG(SG_GENERAL, SG_INFO, "Done"); SG_LOG(SG_GENERAL, SG_INFO, "Done");
exit(0); exit(0);
return 0; return 0;

View file

@ -7,7 +7,7 @@ LightingObj::LightingObj( char* definition )
{ {
sscanf(definition, "%lf %lf %d %lf %lf %s", &lat, &lon, &type, &heading, &glideslope, &assoc_rw); sscanf(definition, "%lf %lf %d %lf %lf %s", &lat, &lon, &type, &heading, &glideslope, &assoc_rw);
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Read lighting object: (" << lon << "," << lat << ") heading: " << heading << " type: " << type ); SG_LOG(SG_GENERAL, SG_DEBUG, "Read lighting object: (" << lon << "," << lat << ") heading: " << heading << " type: " << type );
} }
void LightingObj::BuildBtg( tglightcontour_list& lights ) void LightingObj::BuildBtg( tglightcontour_list& lights )
@ -30,7 +30,7 @@ void LightingObj::BuildBtg( tglightcontour_list& lights )
if (type == 1) if (type == 1)
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Generating VASI = " << assoc_rw); SG_LOG(SG_GENERAL, SG_DEBUG, "Generating VASI = " << assoc_rw);
// VASI coordinates describe the center between the two bars. // VASI coordinates describe the center between the two bars.
// Space between the bars is 200m // Space between the bars is 200m
@ -65,7 +65,7 @@ void LightingObj::BuildBtg( tglightcontour_list& lights )
} }
else if (type == 2) else if (type == 2)
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Generating PAPI 4L = " << assoc_rw); SG_LOG(SG_GENERAL, SG_DEBUG, "Generating PAPI 4L = " << assoc_rw);
// unit1 // unit1
pt1 = SGGeodesy::direct( ref, left_hdg, -12 ); pt1 = SGGeodesy::direct( ref, left_hdg, -12 );
@ -80,7 +80,7 @@ void LightingObj::BuildBtg( tglightcontour_list& lights )
} }
else if (type == 3) else if (type == 3)
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Generating PAPI 4R = " << assoc_rw); SG_LOG(SG_GENERAL, SG_DEBUG, "Generating PAPI 4R = " << assoc_rw);
// unit1 // unit1
pt1 = SGGeodesy::direct( ref, left_hdg, 12 ); pt1 = SGGeodesy::direct( ref, left_hdg, 12 );
@ -95,19 +95,19 @@ void LightingObj::BuildBtg( tglightcontour_list& lights )
} }
else if (type == 4) else if (type == 4)
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Space Shuttle PAPI is deprecated. Use the normal PAPI and set the glideslope accordingly"); SG_LOG(SG_GENERAL, SG_DEBUG, "Space Shuttle PAPI is deprecated. Use the normal PAPI and set the glideslope accordingly");
return; return;
} }
else if (type == 5) else if (type == 5)
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Generating tri-colour VASI = " << assoc_rw); SG_LOG(SG_GENERAL, SG_DEBUG, "Generating tri-colour VASI = " << assoc_rw);
// only one light here // only one light here
light_contour.AddLight( ref, normal ); light_contour.AddLight( ref, normal );
} }
else if (type == 6) else if (type == 6)
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Generating runway guard light = " << assoc_rw); SG_LOG(SG_GENERAL, SG_DEBUG, "Generating runway guard light = " << assoc_rw);
light_contour.SetType( "RWY_GUARD_LIGHTS" ); light_contour.SetType( "RWY_GUARD_LIGHTS" );
@ -119,7 +119,7 @@ void LightingObj::BuildBtg( tglightcontour_list& lights )
} }
else else
{ {
GENAPT_LOG(SG_GENERAL, SG_ALERT, "Unknown lighting object (PAPI/VASI...) code: " << type); SG_LOG(SG_GENERAL, SG_ALERT, "Unknown lighting object (PAPI/VASI...) code: " << type);
return; return;
} }

View file

@ -44,7 +44,7 @@ void Parser::set_debug( std::string path, std::vector<std::string> runway_defs,
std::vector<std::string> taxiway_defs, std::vector<std::string> taxiway_defs,
std::vector<std::string> feature_defs ) std::vector<std::string> feature_defs )
{ {
GENAPT_LOG(SG_GENERAL, SG_ALERT, "Set debug Path " << path); SG_LOG(SG_GENERAL, SG_ALERT, "Set debug Path " << path);
debug_path = path; debug_path = path;
@ -67,7 +67,7 @@ void Parser::set_debug( std::string path, std::vector<std::string> runway_defs,
while (ss >> i) while (ss >> i)
{ {
GENAPT_LOG(SG_GENERAL, SG_ALERT, "Adding debug runway " << i); SG_LOG(SG_GENERAL, SG_ALERT, "Adding debug runway " << i);
shapes.push_back(i); shapes.push_back(i);
@ -96,7 +96,7 @@ void Parser::set_debug( std::string path, std::vector<std::string> runway_defs,
while (ss >> i) while (ss >> i)
{ {
GENAPT_LOG(SG_GENERAL, SG_ALERT, "Adding debug pavement " << i); SG_LOG(SG_GENERAL, SG_ALERT, "Adding debug pavement " << i);
shapes.push_back(i); shapes.push_back(i);
@ -125,7 +125,7 @@ void Parser::set_debug( std::string path, std::vector<std::string> runway_defs,
while (ss >> i) while (ss >> i)
{ {
GENAPT_LOG(SG_GENERAL, SG_ALERT, "Adding debug taxiway " << i); SG_LOG(SG_GENERAL, SG_ALERT, "Adding debug taxiway " << i);
shapes.push_back(i); shapes.push_back(i);
@ -154,7 +154,7 @@ void Parser::set_debug( std::string path, std::vector<std::string> runway_defs,
while (ss >> i) while (ss >> i)
{ {
GENAPT_LOG(SG_GENERAL, SG_ALERT, "Adding debug feature " << i); SG_LOG(SG_GENERAL, SG_ALERT, "Adding debug feature " << i);
shapes.push_back(i); shapes.push_back(i);
@ -183,7 +183,7 @@ void Parser::run()
std::ifstream in( filename.c_str() ); std::ifstream in( filename.c_str() );
if ( !in.is_open() ) if ( !in.is_open() )
{ {
GENAPT_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << filename ); SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << filename );
exit(-1); exit(-1);
} }
@ -204,7 +204,7 @@ void Parser::run()
// Verify this is and airport definition and get the icao // Verify this is and airport definition and get the icao
if( GetAirportDefinition( line, icao ) ) { if( GetAirportDefinition( line, icao ) ) {
GENAPT_LOG( SG_GENERAL, SG_INFO, "Found airport " << icao << " at " << pos ); SG_LOG( SG_GENERAL, SG_INFO, "Found airport " << icao << " at " << pos );
// Start parse at pos // Start parse at pos
SetState(STATE_NONE); SetState(STATE_NONE);
@ -212,8 +212,8 @@ void Parser::run()
parse_start.stamp(); parse_start.stamp();
log_time = time(0); log_time = time(0);
GENAPT_LOG( SG_GENERAL, SG_ALERT, "\n*******************************************************************" ); SG_LOG( SG_GENERAL, SG_ALERT, "\n*******************************************************************" );
GENAPT_LOG( SG_GENERAL, SG_ALERT, "Start airport " << icao << " at " << pos << ": start time " << ctime(&log_time) ); SG_LOG( SG_GENERAL, SG_ALERT, "Start airport " << icao << " at " << pos << ": start time " << ctime(&log_time) );
in.seekg(pos, std::ios::beg); in.seekg(pos, std::ios::beg);
while ( !in.eof() && (cur_state != STATE_DONE ) ) { while ( !in.eof() && (cur_state != STATE_DONE ) ) {
@ -240,11 +240,11 @@ void Parser::run()
} }
log_time = time(0); log_time = time(0);
GENAPT_LOG( SG_GENERAL, SG_ALERT, "Finished airport " << icao << SG_LOG( SG_GENERAL, SG_ALERT, "Finished airport " << icao <<
" : parse " << parse_time << " : build " << build_time << " : parse " << parse_time << " : build " << build_time <<
" : clean " << clean_time << " : tesselate " << triangulation_time ); " : clean " << clean_time << " : tesselate " << triangulation_time );
} else { } else {
GENAPT_LOG( SG_GENERAL, SG_INFO, "Not an airport at pos " << pos << " line is: " << line ); SG_LOG( SG_GENERAL, SG_INFO, "Not an airport at pos " << pos << " line is: " << line );
} }
} }
} }
@ -401,7 +401,7 @@ LinearFeature* Parser::ParseFeature( char* line )
feature = new LinearFeature(NULL, 0.0f); feature = new LinearFeature(NULL, 0.0f);
} }
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Creating Linear Feature with desription \"" << line << "\""); SG_LOG(SG_GENERAL, SG_DEBUG, "Creating Linear Feature with desription \"" << line << "\"");
return feature; return feature;
} }
@ -421,11 +421,11 @@ ClosedPoly* Parser::ParsePavement( char* line )
if (numParams == 4) if (numParams == 4)
{ {
d = strstr(line,desc); d = strstr(line,desc);
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Creating Closed Poly with st " << st << " smoothness " << s << " thexture heading " << th << " and description " << d); SG_LOG(SG_GENERAL, SG_DEBUG, "Creating Closed Poly with st " << st << " smoothness " << s << " thexture heading " << th << " and description " << d);
} }
else else
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Creating Closed Poly with st " << st << " smoothness " << s << " thexture heading " << th ); SG_LOG(SG_GENERAL, SG_DEBUG, "Creating Closed Poly with st " << st << " smoothness " << s << " thexture heading " << th );
} }
poly = new ClosedPoly(st, s, th, d); poly = new ClosedPoly(st, s, th, d);
@ -451,7 +451,7 @@ ClosedPoly* Parser::ParseBoundary( char* line )
d = (char *)"none"; d = (char *)"none";
} }
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Creating Closed Poly for airport boundary : " << d); SG_LOG(SG_GENERAL, SG_DEBUG, "Creating Closed Poly for airport boundary : " << d);
poly = new ClosedPoly(d); poly = new ClosedPoly(d);
return poly; return poly;
@ -463,7 +463,7 @@ int Parser::SetState( int state )
// is when we get a non-node line to parse // is when we get a non-node line to parse
if ( cur_airport && cur_state == STATE_PARSE_PAVEMENT ) if ( cur_airport && cur_state == STATE_PARSE_PAVEMENT )
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Closing and Adding pavement"); SG_LOG(SG_GENERAL, SG_DEBUG, "Closing and Adding pavement");
cur_pavement->Finish(); cur_pavement->Finish();
cur_airport->AddPavement( cur_pavement ); cur_airport->AddPavement( cur_pavement );
cur_pavement = NULL; cur_pavement = NULL;
@ -471,7 +471,7 @@ int Parser::SetState( int state )
if ( cur_airport && cur_state == STATE_PARSE_BOUNDARY ) if ( cur_airport && cur_state == STATE_PARSE_BOUNDARY )
{ {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Closing and Adding boundary"); SG_LOG(SG_GENERAL, SG_DEBUG, "Closing and Adding boundary");
cur_boundary->Finish(); cur_boundary->Finish();
cur_airport->AddBoundary( cur_boundary ); cur_airport->AddBoundary( cur_boundary );
cur_boundary = NULL; cur_boundary = NULL;
@ -507,7 +507,7 @@ int Parser::ParseLine(char* line)
if (cur_state == STATE_NONE) if (cur_state == STATE_NONE)
{ {
SetState( STATE_PARSE_SIMPLE ); SetState( STATE_PARSE_SIMPLE );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Parsing land airport: " << line); SG_LOG(SG_GENERAL, SG_DEBUG, "Parsing land airport: " << line);
cur_airport = new Airport( code, line ); cur_airport = new Airport( code, line );
} }
else else
@ -519,7 +519,7 @@ int Parser::ParseLine(char* line)
if (cur_state == STATE_NONE) if (cur_state == STATE_NONE)
{ {
SetState( STATE_PARSE_SIMPLE ); SetState( STATE_PARSE_SIMPLE );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Parsing heliport: " << line); SG_LOG(SG_GENERAL, SG_DEBUG, "Parsing heliport: " << line);
cur_airport = new Airport( code, line ); cur_airport = new Airport( code, line );
} }
else else
@ -530,7 +530,7 @@ int Parser::ParseLine(char* line)
case LAND_RUNWAY_CODE: case LAND_RUNWAY_CODE:
SetState( STATE_PARSE_SIMPLE ); SetState( STATE_PARSE_SIMPLE );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Parsing runway: " << line); SG_LOG(SG_GENERAL, SG_DEBUG, "Parsing runway: " << line);
cur_runway = new Runway(line); cur_runway = new Runway(line);
if (cur_airport) if (cur_airport)
{ {
@ -540,7 +540,7 @@ int Parser::ParseLine(char* line)
case WATER_RUNWAY_CODE: case WATER_RUNWAY_CODE:
SetState( STATE_PARSE_SIMPLE ); SetState( STATE_PARSE_SIMPLE );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Parsing water runway: " << line); SG_LOG(SG_GENERAL, SG_DEBUG, "Parsing water runway: " << line);
cur_waterrunway = new WaterRunway(line); cur_waterrunway = new WaterRunway(line);
if (cur_airport) if (cur_airport)
{ {
@ -549,7 +549,7 @@ int Parser::ParseLine(char* line)
break; break;
case HELIPAD_CODE: case HELIPAD_CODE:
SetState( STATE_PARSE_SIMPLE ); SetState( STATE_PARSE_SIMPLE );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Parsing helipad: " << line); SG_LOG(SG_GENERAL, SG_DEBUG, "Parsing helipad: " << line);
cur_helipad = new Helipad(line); cur_helipad = new Helipad(line);
if (cur_airport) if (cur_airport)
{ {
@ -559,7 +559,7 @@ int Parser::ParseLine(char* line)
case TAXIWAY_CODE: case TAXIWAY_CODE:
SetState( STATE_PARSE_SIMPLE ); SetState( STATE_PARSE_SIMPLE );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Parsing taxiway: " << line); SG_LOG(SG_GENERAL, SG_DEBUG, "Parsing taxiway: " << line);
cur_taxiway = new Taxiway(line); cur_taxiway = new Taxiway(line);
if (cur_airport) if (cur_airport)
{ {
@ -569,25 +569,25 @@ int Parser::ParseLine(char* line)
case PAVEMENT_CODE: case PAVEMENT_CODE:
SetState( STATE_PARSE_PAVEMENT ); SetState( STATE_PARSE_PAVEMENT );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Parsing pavement: " << line); SG_LOG(SG_GENERAL, SG_DEBUG, "Parsing pavement: " << line);
cur_pavement = ParsePavement( line ); cur_pavement = ParsePavement( line );
break; break;
case LINEAR_FEATURE_CODE: case LINEAR_FEATURE_CODE:
SetState( STATE_PARSE_FEATURE ); SetState( STATE_PARSE_FEATURE );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Linear Feature: " << line); SG_LOG(SG_GENERAL, SG_DEBUG, "Linear Feature: " << line);
cur_feat = ParseFeature( line ); cur_feat = ParseFeature( line );
break; break;
case BOUNDRY_CODE: case BOUNDRY_CODE:
SetState( STATE_PARSE_BOUNDARY ); SetState( STATE_PARSE_BOUNDARY );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Parsing Boundary: " << line); SG_LOG(SG_GENERAL, SG_DEBUG, "Parsing Boundary: " << line);
cur_boundary = ParseBoundary( line ); cur_boundary = ParseBoundary( line );
break; break;
case NODE_CODE: case NODE_CODE:
case BEZIER_NODE_CODE: case BEZIER_NODE_CODE:
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Parsing node: " << line); SG_LOG(SG_GENERAL, SG_DEBUG, "Parsing node: " << line);
cur_node = ParseNode( code, line, prev_node ); cur_node = ParseNode( code, line, prev_node );
if ( prev_node && (cur_node != prev_node) ) if ( prev_node && (cur_node != prev_node) )
@ -612,7 +612,7 @@ int Parser::ParseLine(char* line)
case CLOSE_NODE_CODE: case CLOSE_NODE_CODE:
case CLOSE_BEZIER_NODE_CODE: case CLOSE_BEZIER_NODE_CODE:
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Parsing close loop node: " << line); SG_LOG(SG_GENERAL, SG_DEBUG, "Parsing close loop node: " << line);
cur_node = ParseNode( code, line, prev_node ); cur_node = ParseNode( code, line, prev_node );
if ( cur_state == STATE_PARSE_PAVEMENT ) if ( cur_state == STATE_PARSE_PAVEMENT )
@ -666,7 +666,7 @@ int Parser::ParseLine(char* line)
case TERM_NODE_CODE: case TERM_NODE_CODE:
case TERM_BEZIER_NODE_CODE: case TERM_BEZIER_NODE_CODE:
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Parsing termination node: " << line); SG_LOG(SG_GENERAL, SG_DEBUG, "Parsing termination node: " << line);
if ( cur_state == STATE_PARSE_FEATURE ) if ( cur_state == STATE_PARSE_FEATURE )
{ {
@ -694,7 +694,7 @@ int Parser::ParseLine(char* line)
} }
else else
{ {
GENAPT_LOG(SG_GENERAL, SG_ALERT, "Parsing termination node with no previous nodes!!!" ); SG_LOG(SG_GENERAL, SG_ALERT, "Parsing termination node with no previous nodes!!!" );
// this feature is bogus... // this feature is bogus...
delete cur_feat; delete cur_feat;
@ -708,66 +708,66 @@ int Parser::ParseLine(char* line)
case AIRPORT_VIEWPOINT_CODE: case AIRPORT_VIEWPOINT_CODE:
SetState( STATE_PARSE_SIMPLE ); SetState( STATE_PARSE_SIMPLE );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Parsing viewpoint: " << line); SG_LOG(SG_GENERAL, SG_DEBUG, "Parsing viewpoint: " << line);
break; break;
case AIRPLANE_STARTUP_LOCATION_CODE: case AIRPLANE_STARTUP_LOCATION_CODE:
SetState( STATE_PARSE_SIMPLE ); SetState( STATE_PARSE_SIMPLE );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Parsing airplane startup location: " << line); SG_LOG(SG_GENERAL, SG_DEBUG, "Parsing airplane startup location: " << line);
break; break;
case LIGHT_BEACON_CODE: case LIGHT_BEACON_CODE:
SetState( STATE_PARSE_SIMPLE ); SetState( STATE_PARSE_SIMPLE );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Parsing light beacon: " << line); SG_LOG(SG_GENERAL, SG_DEBUG, "Parsing light beacon: " << line);
cur_beacon = new Beacon(line); cur_beacon = new Beacon(line);
cur_airport->AddBeacon( cur_beacon ); cur_airport->AddBeacon( cur_beacon );
break; break;
case WINDSOCK_CODE: case WINDSOCK_CODE:
SetState( STATE_PARSE_SIMPLE ); SetState( STATE_PARSE_SIMPLE );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Parsing windsock: " << line); SG_LOG(SG_GENERAL, SG_DEBUG, "Parsing windsock: " << line);
cur_windsock = new Windsock(line); cur_windsock = new Windsock(line);
cur_airport->AddWindsock( cur_windsock ); cur_airport->AddWindsock( cur_windsock );
break; break;
case TAXIWAY_SIGN: case TAXIWAY_SIGN:
SetState( STATE_PARSE_SIMPLE ); SetState( STATE_PARSE_SIMPLE );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Parsing taxiway sign: " << line); SG_LOG(SG_GENERAL, SG_DEBUG, "Parsing taxiway sign: " << line);
cur_sign = new Sign(line); cur_sign = new Sign(line);
cur_airport->AddSign( cur_sign ); cur_airport->AddSign( cur_sign );
break; break;
case LIGHTING_OBJECT: case LIGHTING_OBJECT:
SetState( STATE_PARSE_SIMPLE ); SetState( STATE_PARSE_SIMPLE );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Parsing lighting object: " << line); SG_LOG(SG_GENERAL, SG_DEBUG, "Parsing lighting object: " << line);
cur_object = new LightingObj(line); cur_object = new LightingObj(line);
cur_airport->AddObj( cur_object ); cur_airport->AddObj( cur_object );
break; break;
case COMM_FREQ1_CODE: case COMM_FREQ1_CODE:
SetState( STATE_PARSE_SIMPLE ); SetState( STATE_PARSE_SIMPLE );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Parsing commfreq 1: " << line); SG_LOG(SG_GENERAL, SG_DEBUG, "Parsing commfreq 1: " << line);
break; break;
case COMM_FREQ2_CODE: case COMM_FREQ2_CODE:
SetState( STATE_PARSE_SIMPLE ); SetState( STATE_PARSE_SIMPLE );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Parsing commfreq 2: " << line); SG_LOG(SG_GENERAL, SG_DEBUG, "Parsing commfreq 2: " << line);
break; break;
case COMM_FREQ3_CODE: case COMM_FREQ3_CODE:
SetState( STATE_PARSE_SIMPLE ); SetState( STATE_PARSE_SIMPLE );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Parsing commfreq 3: " << line); SG_LOG(SG_GENERAL, SG_DEBUG, "Parsing commfreq 3: " << line);
break; break;
case COMM_FREQ4_CODE: case COMM_FREQ4_CODE:
SetState( STATE_PARSE_SIMPLE ); SetState( STATE_PARSE_SIMPLE );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Parsing commfreq 4: " << line); SG_LOG(SG_GENERAL, SG_DEBUG, "Parsing commfreq 4: " << line);
break; break;
case COMM_FREQ5_CODE: case COMM_FREQ5_CODE:
SetState( STATE_PARSE_SIMPLE ); SetState( STATE_PARSE_SIMPLE );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Parsing commfreq 5: " << line); SG_LOG(SG_GENERAL, SG_DEBUG, "Parsing commfreq 5: " << line);
break; break;
case COMM_FREQ6_CODE: case COMM_FREQ6_CODE:
SetState( STATE_PARSE_SIMPLE ); SetState( STATE_PARSE_SIMPLE );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Parsing commfreq 6: " << line); SG_LOG(SG_GENERAL, SG_DEBUG, "Parsing commfreq 6: " << line);
break; break;
case COMM_FREQ7_CODE: case COMM_FREQ7_CODE:
SetState( STATE_PARSE_SIMPLE ); SetState( STATE_PARSE_SIMPLE );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Parsing commfreq 7: " << line); SG_LOG(SG_GENERAL, SG_DEBUG, "Parsing commfreq 7: " << line);
break; break;
case END_OF_FILE : case END_OF_FILE :
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Reached end of file"); SG_LOG(SG_GENERAL, SG_DEBUG, "Reached end of file");
SetState( STATE_DONE ); SetState( STATE_DONE );
break; break;
} }

View file

@ -47,7 +47,7 @@ Runway::Runway(char* definition)
// calculate runway heading and length (used a lot) // calculate runway heading and length (used a lot)
SGGeodesy::inverse( GetStart(), GetEnd(), rwy.heading, az2, rwy.length ); SGGeodesy::inverse( GetStart(), GetEnd(), rwy.heading, az2, rwy.length );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Read runway: (" << rwy.lon[0] << "," << rwy.lat[0] << ") to (" << rwy.lon[1] << "," << rwy.lat[1] << ") heading: " << rwy.heading << " length: " << rwy.length << " width: " << rwy.width ); SG_LOG(SG_GENERAL, SG_DEBUG, "Read runway: (" << rwy.lon[0] << "," << rwy.lat[0] << ") to (" << rwy.lon[1] << "," << rwy.lat[1] << ") heading: " << rwy.heading << " length: " << rwy.length << " width: " << rwy.width );
} }
@ -56,7 +56,7 @@ WaterRunway::WaterRunway(char* definition)
{ {
sscanf(definition, "%lf %d %s %lf %lf %s %lf %lf", &width, &buoys, rwnum[0], &lat[0], &lon[0], rwnum[1], &lat[1], &lon[1]); sscanf(definition, "%lf %d %s %lf %lf %s %lf %lf", &width, &buoys, rwnum[0], &lat[0], &lon[0], rwnum[1], &lat[1], &lon[1]);
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Read water runway: (" << lon[0] << "," << lat[0] << ") to (" << lon[1] << "," << lat[1] << ") width: " << width << " buoys = " << buoys ); SG_LOG(SG_GENERAL, SG_DEBUG, "Read water runway: (" << lon[0] << "," << lat[0] << ") to (" << lon[1] << "," << lat[1] << ") width: " << width << " buoys = " << buoys );
} }
tgContour WaterRunway::GetBuoys() tgContour WaterRunway::GetBuoys()
@ -122,7 +122,7 @@ int Runway::BuildBtg( tgpolygon_list& rwy_polys, tglightcontour_list& rwy_lights
} }
else else
{ {
GENAPT_LOG(SG_GENERAL, SG_WARN, "surface_code = " << rwy.surface); SG_LOG(SG_GENERAL, SG_WARN, "surface_code = " << rwy.surface);
throw sg_exception("unknown runway type!"); throw sg_exception("unknown runway type!");
} }
@ -131,7 +131,7 @@ int Runway::BuildBtg( tgpolygon_list& rwy_polys, tglightcontour_list& rwy_lights
{ {
case 1: // asphalt: case 1: // asphalt:
case 2: // concrete case 2: // concrete
GENAPT_LOG( SG_GENERAL, SG_DEBUG, "Build Runway: asphalt or concrete " << rwy.surface); SG_LOG( SG_GENERAL, SG_DEBUG, "Build Runway: asphalt or concrete " << rwy.surface);
gen_rwy( rwy_polys, slivers, accum, shapefile_name ); gen_rwy( rwy_polys, slivers, accum, shapefile_name );
gen_runway_lights( rwy_lights ); gen_runway_lights( rwy_lights );
break; break;
@ -140,25 +140,25 @@ int Runway::BuildBtg( tgpolygon_list& rwy_polys, tglightcontour_list& rwy_lights
case 4: // Dirt case 4: // Dirt
case 5: // Gravel case 5: // Gravel
case 12: // dry lakebed case 12: // dry lakebed
GENAPT_LOG( SG_GENERAL, SG_DEBUG, "Build Runway: Grass, Dirt, Gravel or Dry Lakebed " << rwy.surface ); SG_LOG( SG_GENERAL, SG_DEBUG, "Build Runway: Grass, Dirt, Gravel or Dry Lakebed " << rwy.surface );
gen_simple_rwy( rwy_polys, slivers, accum ); gen_simple_rwy( rwy_polys, slivers, accum );
gen_runway_lights( rwy_lights ); gen_runway_lights( rwy_lights );
break; break;
case 13: // water case 13: // water
GENAPT_LOG( SG_GENERAL, SG_DEBUG, "Build Runway: Water"); SG_LOG( SG_GENERAL, SG_DEBUG, "Build Runway: Water");
break; break;
case 14: // snow case 14: // snow
GENAPT_LOG( SG_GENERAL, SG_DEBUG, "Build Runway: Snow"); SG_LOG( SG_GENERAL, SG_DEBUG, "Build Runway: Snow");
break; break;
case 15: // transparent case 15: // transparent
GENAPT_LOG( SG_GENERAL, SG_DEBUG, "Build Runway: transparent"); SG_LOG( SG_GENERAL, SG_DEBUG, "Build Runway: transparent");
break; break;
default: // unknown default: // unknown
GENAPT_LOG( SG_GENERAL, SG_DEBUG, "Build Runway: unknown: " << rwy.surface); SG_LOG( SG_GENERAL, SG_DEBUG, "Build Runway: unknown: " << rwy.surface);
break; break;
} }

View file

@ -220,7 +220,7 @@ void Runway::gen_runway_section( const tgPolygon& runway,
} }
} }
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "start len % = " << startl_pct << " end len % = " << endl_pct); SG_LOG(SG_GENERAL, SG_DEBUG, "start len % = " << startl_pct << " end len % = " << endl_pct);
double dlx, dly; double dlx, dly;
@ -241,7 +241,7 @@ void Runway::gen_runway_section( const tgPolygon& runway,
SGVec2d t3 = SGVec2d( a2.x() + dlx * endl_pct, SGVec2d t3 = SGVec2d( a2.x() + dlx * endl_pct,
a2.y() + dly * endl_pct ); a2.y() + dly * endl_pct );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "start wid % = " << startw_pct << " end wid % = " << endw_pct); SG_LOG(SG_GENERAL, SG_DEBUG, "start wid % = " << startw_pct << " end wid % = " << endw_pct);
double dwx, dwy; double dwx, dwy;
@ -299,8 +299,8 @@ void Runway::gen_runway_section( const tgPolygon& runway,
section = tgPolygon::Snap( section, gSnap ); section = tgPolygon::Snap( section, gSnap );
// print runway points // print runway points
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "pre clipped runway pts " << material_prefix << material); SG_LOG(SG_GENERAL, SG_DEBUG, "pre clipped runway pts " << material_prefix << material);
GENAPT_LOG(SG_GENERAL, SG_DEBUG, section ); SG_LOG(SG_GENERAL, SG_DEBUG, section );
if( shapefile_name.size() ) { if( shapefile_name.size() ) {
tgShapefile::FromPolygon( section, "./airport_dbg", std::string("preclip"), shapefile_name ); tgShapefile::FromPolygon( section, "./airport_dbg", std::string("preclip"), shapefile_name );
@ -386,7 +386,7 @@ void Runway::gen_runway_section( const tgPolygon& runway,
} }
} }
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "start len % = " << startl_pct << " end len % = " << endl_pct); SG_LOG(SG_GENERAL, SG_DEBUG, "start len % = " << startl_pct << " end len % = " << endl_pct);
double dlx, dly; double dlx, dly;
@ -407,7 +407,7 @@ void Runway::gen_runway_section( const tgPolygon& runway,
SGVec2d t3 = SGVec2d( a2.x() + dlx * endl_pct, SGVec2d t3 = SGVec2d( a2.x() + dlx * endl_pct,
a2.y() + dly * endl_pct ); a2.y() + dly * endl_pct );
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "start wid % = " << startw_pct << " end wid % = " << endw_pct); SG_LOG(SG_GENERAL, SG_DEBUG, "start wid % = " << startw_pct << " end wid % = " << endw_pct);
double dwx, dwy; double dwx, dwy;
@ -445,8 +445,8 @@ void Runway::gen_runway_section( const tgPolygon& runway,
section = tgPolygon::Snap( section, gSnap ); section = tgPolygon::Snap( section, gSnap );
// print runway points // print runway points
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "pre clipped runway pts " << material_prefix << material); SG_LOG(SG_GENERAL, SG_DEBUG, "pre clipped runway pts " << material_prefix << material);
GENAPT_LOG(SG_GENERAL, SG_DEBUG, section ); SG_LOG(SG_GENERAL, SG_DEBUG, section );
// Clip the new polygon against what ever has already been created. // Clip the new polygon against what ever has already been created.
tgPolygon clipped = accum.Diff( section ); tgPolygon clipped = accum.Diff( section );
@ -497,7 +497,7 @@ void Runway::gen_rw_designation( tgPolygon poly, double heading, string rwname,
letter = tmp; letter = tmp;
} }
} }
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Runway designation letter = " << letter); SG_LOG(SG_GENERAL, SG_DEBUG, "Runway designation letter = " << letter);
// create runway designation letter // create runway designation letter
if ( !letter.empty() ) { if ( !letter.empty() ) {
@ -522,7 +522,7 @@ void Runway::gen_rw_designation( tgPolygon poly, double heading, string rwname,
rwname = "36"; rwname = "36";
} }
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Runway designation = " << rwname); SG_LOG(SG_GENERAL, SG_DEBUG, "Runway designation = " << rwname);
char tex1[32]; tex1[0] = '\0'; char tex1[32]; tex1[0] = '\0';
char tex2[32]; tex2[0] = '\0'; char tex2[32]; tex2[0] = '\0';
@ -584,7 +584,7 @@ void Runway::gen_rwy( tgpolygon_list& rwy_polys,
tgAccumulator& accum, tgAccumulator& accum,
std::string& shapefile_name ) std::string& shapefile_name )
{ {
GENAPT_LOG( SG_GENERAL, SG_DEBUG, "Building runway = " << rwy.rwnum[0] << " / " << rwy.rwnum[1]); SG_LOG( SG_GENERAL, SG_DEBUG, "Building runway = " << rwy.rwnum[0] << " / " << rwy.rwnum[1]);
std::string section_name = ""; std::string section_name = "";
bool debug = shapefile_name.size() != 0; bool debug = shapefile_name.size() != 0;
@ -625,25 +625,25 @@ void Runway::gen_rwy( tgpolygon_list& rwy_polys,
// Make sure our runway is long enough for the desired marking variant // Make sure our runway is long enough for the desired marking variant
if ( (rwy.marking[rwhalf]==2 || rwy.marking[rwhalf]==4) && length < 1150 * SG_FEET_TO_METER ) { if ( (rwy.marking[rwhalf]==2 || rwy.marking[rwhalf]==4) && length < 1150 * SG_FEET_TO_METER ) {
GENAPT_LOG( SG_GENERAL, SG_ALERT, SG_LOG( SG_GENERAL, SG_ALERT,
"Runway " << rwy.rwnum[rwhalf] << " is not long enough (" "Runway " << rwy.rwnum[rwhalf] << " is not long enough ("
<< rwy.length << "m) for non-precision markings! Setting runway markings to visual!"); << rwy.length << "m) for non-precision markings! Setting runway markings to visual!");
rwy.marking[rwhalf]=1; rwy.marking[rwhalf]=1;
} }
if ( (rwy.marking[rwhalf]==3 || rwy.marking[rwhalf]==5) && length < 3075 * SG_FEET_TO_METER ) { if ( (rwy.marking[rwhalf]==3 || rwy.marking[rwhalf]==5) && length < 3075 * SG_FEET_TO_METER ) {
GENAPT_LOG( SG_GENERAL, SG_ALERT, SG_LOG( SG_GENERAL, SG_ALERT,
"Runway " << rwy.rwnum[rwhalf] << " is not long enough (" "Runway " << rwy.rwnum[rwhalf] << " is not long enough ("
<< rwy.length << "m) for precision markings! Setting runway markings to visual!"); << rwy.length << "m) for precision markings! Setting runway markings to visual!");
rwy.marking[rwhalf]=1; rwy.marking[rwhalf]=1;
} }
GENAPT_LOG( SG_GENERAL, SG_DEBUG, "runway marking = " << rwy.marking[rwhalf] ); SG_LOG( SG_GENERAL, SG_DEBUG, "runway marking = " << rwy.marking[rwhalf] );
// //
// Displaced threshold if it exists // Displaced threshold if it exists
// //
if ( rwy.threshold[rwhalf] > 0.0 ) { if ( rwy.threshold[rwhalf] > 0.0 ) {
GENAPT_LOG( SG_GENERAL, SG_DEBUG, "Displaced threshold for RW side " << rwhalf << " is " << rwy.threshold[rwhalf] ); SG_LOG( SG_GENERAL, SG_DEBUG, "Displaced threshold for RW side " << rwhalf << " is " << rwy.threshold[rwhalf] );
double final_arrow = rwy.threshold[rwhalf]; double final_arrow = rwy.threshold[rwhalf];
@ -780,7 +780,7 @@ void Runway::gen_rwy( tgpolygon_list& rwy_polys,
// Now create the marking sections of the runway type // Now create the marking sections of the runway type
for ( unsigned int i=0; i < rw_marking_list.size(); ++i) { for ( unsigned int i=0; i < rw_marking_list.size(); ++i) {
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Runway section texture = " << rw_marking_list[i].tex << " start_pct: " << start1_pct << " end_pct: " << end1_pct << " length: " << rw_marking_list[i].size); SG_LOG(SG_GENERAL, SG_DEBUG, "Runway section texture = " << rw_marking_list[i].tex << " start_pct: " << start1_pct << " end_pct: " << end1_pct << " length: " << rw_marking_list[i].size);
if ( end1_pct < 1.0 ) { if ( end1_pct < 1.0 ) {
start1_pct = end1_pct; start1_pct = end1_pct;

View file

@ -65,11 +65,11 @@ void Runway::gen_simple_rwy( tgpolygon_list& rwy_polys,
runway_half.AddNode( 0, runway.GetNode(5) ); runway_half.AddNode( 0, runway.GetNode(5) );
} }
GENAPT_LOG( SG_GENERAL, SG_DEBUG, "runway marking = " << rwy.marking[rwhalf] ); SG_LOG( SG_GENERAL, SG_DEBUG, "runway marking = " << rwy.marking[rwhalf] );
// Displaced threshold if it exists // Displaced threshold if it exists
if ( rwy.threshold[rwhalf] > 0.0 ) { if ( rwy.threshold[rwhalf] > 0.0 ) {
GENAPT_LOG( SG_GENERAL, SG_DEBUG, "Displaced threshold for RW side " << rwhalf << " is " << rwy.threshold[rwhalf] ); SG_LOG( SG_GENERAL, SG_DEBUG, "Displaced threshold for RW side " << rwhalf << " is " << rwy.threshold[rwhalf] );
start_pct = end_pct; start_pct = end_pct;
end_pct = start_pct + ( rwy.threshold[rwhalf] / length ); end_pct = start_pct + ( rwy.threshold[rwhalf] / length );

View file

@ -16,7 +16,7 @@ extern double gSnap;
SGLockedQueue<AirportInfo> global_workQueue; SGLockedQueue<AirportInfo> global_workQueue;
ostream& operator<< (ostream &out, const AirportInfo &ai) std::ostream& operator<< (std::ostream &out, const AirportInfo &ai)
{ {
char snap_string[32]; char snap_string[32];
sprintf( snap_string, "%1.8lf", ai.snap ); sprintf( snap_string, "%1.8lf", ai.snap );
@ -53,7 +53,7 @@ void Scheduler::set_debug( std::string path, std::vector<std::string> runway_def
std::vector<std::string> taxiway_defs, std::vector<std::string> taxiway_defs,
std::vector<std::string> feature_defs ) std::vector<std::string> feature_defs )
{ {
GENAPT_LOG(SG_GENERAL, SG_ALERT, "Set debug Path " << path); SG_LOG(SG_GENERAL, SG_ALERT, "Set debug Path " << path);
debug_path = path; debug_path = path;
@ -76,7 +76,7 @@ void Scheduler::set_debug( std::string path, std::vector<std::string> runway_def
while (ss >> i) while (ss >> i)
{ {
GENAPT_LOG(SG_GENERAL, SG_ALERT, "Adding debug runway " << i << " for " << icao ); SG_LOG(SG_GENERAL, SG_ALERT, "Adding debug runway " << i << " for " << icao );
shapes.push_back(i); shapes.push_back(i);
@ -105,7 +105,7 @@ void Scheduler::set_debug( std::string path, std::vector<std::string> runway_def
while (ss >> i) while (ss >> i)
{ {
GENAPT_LOG(SG_GENERAL, SG_ALERT, "Adding debug pavement " << i << " for " << icao ); SG_LOG(SG_GENERAL, SG_ALERT, "Adding debug pavement " << i << " for " << icao );
shapes.push_back(i); shapes.push_back(i);
@ -134,7 +134,7 @@ void Scheduler::set_debug( std::string path, std::vector<std::string> runway_def
while (ss >> i) while (ss >> i)
{ {
GENAPT_LOG(SG_GENERAL, SG_ALERT, "Adding debug taxiway " << i << " for " << icao ); SG_LOG(SG_GENERAL, SG_ALERT, "Adding debug taxiway " << i << " for " << icao );
shapes.push_back(i); shapes.push_back(i);
@ -163,7 +163,7 @@ void Scheduler::set_debug( std::string path, std::vector<std::string> runway_def
while (ss >> i) while (ss >> i)
{ {
GENAPT_LOG(SG_GENERAL, SG_ALERT, "Adding debug feature " << i << " for " << icao ); SG_LOG(SG_GENERAL, SG_ALERT, "Adding debug feature " << i << " for " << icao );
shapes.push_back(i); shapes.push_back(i);
@ -245,11 +245,11 @@ void Scheduler::AddAirport( std::string icao )
std::ifstream in( filename.c_str() ); std::ifstream in( filename.c_str() );
if ( !in.is_open() ) if ( !in.is_open() )
{ {
GENAPT_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << filename ); SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << filename );
exit(-1); exit(-1);
} }
GENAPT_LOG( SG_GENERAL, SG_INFO, "Adding airport " << icao << " to parse list"); SG_LOG( SG_GENERAL, SG_INFO, "Adding airport " << icao << " to parse list");
while ( !in.eof() && !found ) while ( !in.eof() && !found )
{ {
// remember the position of this line // remember the position of this line
@ -261,7 +261,7 @@ void Scheduler::AddAirport( std::string icao )
// this is and airport definition - remember it // this is and airport definition - remember it
if ( IsAirportDefinition( line, icao ) ) if ( IsAirportDefinition( line, icao ) )
{ {
GENAPT_LOG( SG_GENERAL, SG_DEBUG, "Found airport " << icao << " at " << cur_pos ); SG_LOG( SG_GENERAL, SG_DEBUG, "Found airport " << icao << " at " << cur_pos );
ai = AirportInfo( icao, cur_pos, gSnap ); ai = AirportInfo( icao, cur_pos, gSnap );
global_workQueue.push( ai ); global_workQueue.push( ai );
@ -280,11 +280,11 @@ long Scheduler::FindAirport( std::string icao )
std::ifstream in( filename.c_str() ); std::ifstream in( filename.c_str() );
if ( !in.is_open() ) if ( !in.is_open() )
{ {
GENAPT_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << filename ); SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << filename );
exit(-1); exit(-1);
} }
GENAPT_LOG( SG_GENERAL, SG_DEBUG, "Finding airport " << icao ); SG_LOG( SG_GENERAL, SG_DEBUG, "Finding airport " << icao );
while ( !in.eof() && !found ) while ( !in.eof() && !found )
{ {
// remember the position of this line // remember the position of this line
@ -296,7 +296,7 @@ long Scheduler::FindAirport( std::string icao )
// this is and airport definition - remember it // this is and airport definition - remember it
if ( IsAirportDefinition( line, icao ) ) if ( IsAirportDefinition( line, icao ) )
{ {
GENAPT_LOG( SG_GENERAL, SG_DEBUG, "Found airport " << line << " at " << cur_pos ); SG_LOG( SG_GENERAL, SG_DEBUG, "Found airport " << line << " at " << cur_pos );
found = true; found = true;
} }
} }
@ -337,7 +337,7 @@ bool Scheduler::AddAirports( long start_pos, tgRectangle* boundingBox )
std::ifstream in( filename.c_str() ); std::ifstream in( filename.c_str() );
if ( !in.is_open() ) if ( !in.is_open() )
{ {
GENAPT_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << filename ); SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << filename );
exit(-1); exit(-1);
} }
@ -482,7 +482,7 @@ Scheduler::Scheduler(std::string& datafile, const std::string& root, const strin
std::ifstream in( filename.c_str() ); std::ifstream in( filename.c_str() );
if ( !in.is_open() ) if ( !in.is_open() )
{ {
GENAPT_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << filename ); SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << filename );
exit(-1); exit(-1);
} }
} }

View file

@ -72,7 +72,7 @@ public:
void IncreaseSnap( void ) { snap *= 2.0f; } void IncreaseSnap( void ) { snap *= 2.0f; }
friend ostream& operator<<(ostream& output, const AirportInfo& ai); friend std::ostream& operator<<(std::ostream& output, const AirportInfo& ai);
private: private:
std::string icao; std::string icao;

View file

@ -42,7 +42,7 @@ Taxiway::Taxiway(char* definition)
&lat, &lon, designation, &heading, &length, &threshold, &overrun, &lat, &lon, designation, &heading, &length, &threshold, &overrun,
&width, lighting, &surface, &shoulder, &markings, &smoothness, &signs); &width, lighting, &surface, &shoulder, &markings, &smoothness, &signs);
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Read taxiway: (" << lon << "," << lat << ") heading: " << heading << " length: " << length << " width: " << width ); SG_LOG(SG_GENERAL, SG_DEBUG, "Read taxiway: (" << lon << "," << lat << ") heading: " << heading << " length: " << length << " width: " << width );
// adjust length and width from feet to meters // adjust length and width from feet to meters
length *= SG_FEET_TO_METER; length *= SG_FEET_TO_METER;
@ -129,7 +129,7 @@ int Taxiway::BuildBtg( tgpolygon_list& rwy_polys, tglightcontour_list& rwy_light
} }
else else
{ {
GENAPT_LOG(SG_GENERAL, SG_WARN, "surface_code = " << surface); SG_LOG(SG_GENERAL, SG_WARN, "surface_code = " << surface);
throw sg_exception("unknown runway type!"); throw sg_exception("unknown runway type!");
} }