Bump minimum SG version. Make TG compile again. Own multithread logging is disabled for now.
This commit is contained in:
parent
d469bc04a9
commit
5c44d450d4
17 changed files with 292 additions and 295 deletions
|
@ -92,7 +92,7 @@ endif (MSVC AND MSVC_3RDPARTY_ROOT)
|
|||
find_package(Boost COMPONENTS system thread REQUIRED)
|
||||
find_package(ZLIB 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(TIFF REQUIRED) # needed for SRTM
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
|
||||
#include "airport.hxx"
|
||||
#include "beznode.hxx"
|
||||
#include "debug.hxx"
|
||||
#include "elevations.hxx"
|
||||
#include "global.hxx"
|
||||
#include "helipad.hxx"
|
||||
|
@ -77,7 +76,7 @@ Airport::Airport( int c, char* def)
|
|||
|
||||
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()
|
||||
|
@ -299,7 +298,7 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
|
|||
|
||||
char shapefile_name[64];
|
||||
std::string shapefile;
|
||||
|
||||
|
||||
// Find the average of all the runway and heliport long / lats
|
||||
int num_samples = 0;
|
||||
for (unsigned int i=0; i<runways.size(); i++)
|
||||
|
@ -318,7 +317,7 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
|
|||
apt_lat = apt_lat / (double)num_samples;
|
||||
|
||||
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 (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)
|
||||
build_start.stamp();
|
||||
|
@ -339,10 +338,10 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
|
|||
{
|
||||
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++ )
|
||||
{
|
||||
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 );
|
||||
}
|
||||
|
@ -350,7 +349,7 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
|
|||
// lf_accum.ToShapefiles( "./lf_accum", "test", false );
|
||||
|
||||
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 */
|
||||
|
@ -359,10 +358,10 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
|
|||
// Build runways next
|
||||
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++ )
|
||||
{
|
||||
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();
|
||||
|
||||
if ( isDebugRunway(i) ) {
|
||||
|
@ -386,15 +385,15 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
|
|||
}
|
||||
|
||||
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())
|
||||
{
|
||||
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++ )
|
||||
{
|
||||
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 );
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
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++ )
|
||||
{
|
||||
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();
|
||||
|
||||
if (boundary.size())
|
||||
|
@ -425,10 +424,10 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
|
|||
// Build the pavements
|
||||
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++ )
|
||||
{
|
||||
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();
|
||||
|
||||
if ( isDebugPavement(i) ) {
|
||||
|
@ -453,16 +452,16 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
|
|||
}
|
||||
|
||||
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
|
||||
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++ )
|
||||
{
|
||||
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();
|
||||
|
||||
if ( isDebugTaxiway(i) ) {
|
||||
|
@ -490,10 +489,10 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
|
|||
// Build runway shoulders here
|
||||
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++ )
|
||||
{
|
||||
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() )
|
||||
{
|
||||
|
@ -510,10 +509,10 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
|
|||
// Build helipad shoulders here
|
||||
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++ )
|
||||
{
|
||||
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() )
|
||||
{
|
||||
|
@ -531,12 +530,12 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
|
|||
tgPolygon apt_base, apt_clearing;
|
||||
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 = "";
|
||||
|
||||
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 );
|
||||
}
|
||||
} else {
|
||||
|
@ -546,7 +545,7 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -565,8 +564,8 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
|
|||
UniqueSGGeodSet tmp_feat_nodes;
|
||||
|
||||
// build temporary node list from runways...
|
||||
GENAPT_LOG(SG_GENERAL, SG_INFO, "Build Node List " );
|
||||
for ( unsigned int k = 0; k < rwy_polys.size(); ++k )
|
||||
SG_LOG(SG_GENERAL, SG_INFO, "Build Node List " );
|
||||
for ( unsigned int k = 0; k < rwy_polys.size(); ++k )
|
||||
{
|
||||
tgPolygon poly = rwy_polys[k];
|
||||
for ( unsigned int i = 0; i < poly.Contours(); ++i )
|
||||
|
@ -579,7 +578,7 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
|
|||
}
|
||||
|
||||
// and pavements
|
||||
for ( unsigned int k = 0; k < pvmt_polys.size(); ++k )
|
||||
for ( unsigned int k = 0; k < pvmt_polys.size(); ++k )
|
||||
{
|
||||
tgPolygon poly = pvmt_polys[k];
|
||||
for ( unsigned int i = 0; i < poly.Contours(); ++i )
|
||||
|
@ -592,7 +591,7 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
|
|||
}
|
||||
|
||||
// and linear features ( keep Linear feature nodes seperate)
|
||||
for ( unsigned int k = 0; k < line_polys.size(); ++k )
|
||||
for ( unsigned int k = 0; k < line_polys.size(); ++k )
|
||||
{
|
||||
tgPolygon poly = line_polys[k];
|
||||
for ( unsigned int i = 0; i < poly.Contours(); ++i )
|
||||
|
@ -624,37 +623,37 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
|
|||
}
|
||||
|
||||
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
|
||||
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];
|
||||
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;
|
||||
}
|
||||
|
||||
// second pass : and pavements
|
||||
for ( unsigned int k = 0; k < pvmt_polys.size(); ++k )
|
||||
for ( unsigned int k = 0; k < pvmt_polys.size(); ++k )
|
||||
{
|
||||
tgPolygon poly = pvmt_polys[k];
|
||||
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;
|
||||
}
|
||||
|
||||
// second pass : and lines
|
||||
for ( unsigned int k = 0; k < line_polys.size(); ++k )
|
||||
for ( unsigned int k = 0; k < line_polys.size(); ++k )
|
||||
{
|
||||
tgPolygon poly = line_polys[k];
|
||||
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;
|
||||
}
|
||||
|
||||
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 )
|
||||
{
|
||||
|
@ -677,7 +676,7 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
|
|||
}
|
||||
|
||||
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::Snap( base_poly, gSnap );
|
||||
|
@ -689,7 +688,7 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
|
|||
tgPolygon::MergeSlivers( pvmt_polys, slivers );
|
||||
|
||||
// Then snap rwy and pavement to grid (was done right after adding intermediate nodes...)
|
||||
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];
|
||||
poly = tgPolygon::Snap(poly, gSnap);
|
||||
|
@ -697,7 +696,7 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
|
|||
poly = tgPolygon::RemoveBadContours( poly );
|
||||
rwy_polys[k] = poly;
|
||||
}
|
||||
for ( unsigned int k = 0; k < pvmt_polys.size(); ++k )
|
||||
for ( unsigned int k = 0; k < pvmt_polys.size(); ++k )
|
||||
{
|
||||
tgPolygon poly = pvmt_polys[k];
|
||||
poly = tgPolygon::Snap(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
|
||||
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 )
|
||||
{
|
||||
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();
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
@ -729,14 +728,14 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
|
|||
if ( pvmt_polys.size() )
|
||||
{
|
||||
// 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 )
|
||||
{
|
||||
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();
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
@ -744,14 +743,14 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
|
|||
if ( line_polys.size() )
|
||||
{
|
||||
// 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 )
|
||||
{
|
||||
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();
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
@ -760,9 +759,9 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
|
|||
intersecting contours */
|
||||
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();
|
||||
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?
|
||||
|
||||
triangulation_end.stamp();
|
||||
|
@ -770,7 +769,7 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
|
|||
// a few airports fail here
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -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) );
|
||||
vnt = normalize(vnt);
|
||||
|
||||
GENAPT_LOG(SG_GENERAL, SG_INFO, "Adding runway nodes and normals");
|
||||
for ( unsigned int k = 0; k < rwy_polys.size(); ++k )
|
||||
SG_LOG(SG_GENERAL, SG_INFO, "Adding runway nodes and normals");
|
||||
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();
|
||||
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "material = " << material);
|
||||
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "triangles = " << rwy_polys[k].Triangles());
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, "material = " << material);
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, "triangles = " << rwy_polys[k].Triangles());
|
||||
for ( unsigned int i = 0; i < rwy_polys[k].Triangles(); ++i )
|
||||
{
|
||||
tri_v.clear();
|
||||
|
@ -847,14 +846,14 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
|
|||
}
|
||||
}
|
||||
|
||||
GENAPT_LOG(SG_GENERAL, SG_INFO, "Adding pavement nodes and normals");
|
||||
for ( unsigned int k = 0; k < pvmt_polys.size(); ++k )
|
||||
SG_LOG(SG_GENERAL, SG_INFO, "Adding pavement nodes and normals");
|
||||
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();
|
||||
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "material = " << material);
|
||||
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "triangles = " << pvmt_polys[k].Triangles());
|
||||
for ( unsigned int i = 0; i < pvmt_polys[k].Triangles(); ++i )
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, "material = " << material);
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, "triangles = " << pvmt_polys[k].Triangles());
|
||||
for ( unsigned int i = 0; i < pvmt_polys[k].Triangles(); ++i )
|
||||
{
|
||||
tri_v.clear();
|
||||
tri_n.clear();
|
||||
|
@ -878,14 +877,14 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
|
|||
}
|
||||
}
|
||||
|
||||
GENAPT_LOG(SG_GENERAL, SG_INFO, "Adding line nodes and normals");
|
||||
for ( unsigned int k = 0; k < line_polys.size(); ++k )
|
||||
SG_LOG(SG_GENERAL, SG_INFO, "Adding line nodes and normals");
|
||||
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();
|
||||
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "material = " << material);
|
||||
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "triangles = " << line_polys[k].Triangles());
|
||||
for ( unsigned int i = 0; i < line_polys[k].Triangles(); ++i )
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, "material = " << material);
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, "triangles = " << line_polys[k].Triangles());
|
||||
for ( unsigned int i = 0; i < line_polys[k].Triangles(); ++i )
|
||||
{
|
||||
tri_v.clear();
|
||||
tri_n.clear();
|
||||
|
@ -910,10 +909,10 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
|
|||
}
|
||||
|
||||
// add base points
|
||||
std::vector< SGVec2f > base_txs;
|
||||
std::vector< SGVec2f > base_txs;
|
||||
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 )
|
||||
{
|
||||
tri_v.clear();
|
||||
|
@ -937,7 +936,7 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
|
|||
base_txs = sgCalcTexCoords( b, geodNodes, tri_v );
|
||||
|
||||
base_tc.clear();
|
||||
for ( unsigned int j = 0; j < base_txs.size(); ++j )
|
||||
for ( unsigned int j = 0; j < base_txs.size(); ++j )
|
||||
{
|
||||
index = texcoords.add( base_txs[j] );
|
||||
base_tc.push_back( index );
|
||||
|
@ -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 )
|
||||
{
|
||||
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
|
||||
// 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();
|
||||
|
||||
// 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++)
|
||||
{
|
||||
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 ...
|
||||
|
||||
// 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 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];
|
||||
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() );
|
||||
}
|
||||
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() );
|
||||
}
|
||||
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() );
|
||||
}
|
||||
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() );
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
// 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() );
|
||||
for ( unsigned int i = 0; i < rwy_lights.size(); ++i )
|
||||
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 )
|
||||
{
|
||||
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 )
|
||||
{
|
||||
|
@ -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 );
|
||||
min_deg.setLatitudeDeg( min_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:" );
|
||||
GENAPT_LOG(SG_GENERAL, SG_DEBUG, " root: " << root );
|
||||
//GENAPT_LOG(SG_GENERAL, SG_DEBUG, " elev: " << elev_src );
|
||||
GENAPT_LOG(SG_GENERAL, SG_DEBUG, " min: " << min_deg );
|
||||
GENAPT_LOG(SG_GENERAL, SG_DEBUG, " max: " << max_deg );
|
||||
GENAPT_LOG(SG_GENERAL, SG_DEBUG, " average: " << average );
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, "Create Apt surface:" );
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, " root: " << root );
|
||||
//SG_LOG(SG_GENERAL, SG_DEBUG, " elev: " << elev_src );
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, " min: " << min_deg );
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, " max: " << max_deg );
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, " average: " << average );
|
||||
|
||||
// TODO elevation queries should be performed as member functions of surface
|
||||
tgRectangle aptBounds(min_deg, max_deg);
|
||||
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
|
||||
// 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
|
||||
// on flag) and do so, then output next structures.
|
||||
|
@ -1095,29 +1094,29 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
|
|||
}
|
||||
|
||||
// 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 );
|
||||
divided_base = calc_elevations( apt_surf, divided_base, 0.0 );
|
||||
|
||||
// calculate wgs84 mapping of nodes
|
||||
std::vector<SGVec3d> wgs84_nodes;
|
||||
for ( unsigned int i = 0; i < geod_nodes.size(); ++i )
|
||||
for ( unsigned int i = 0; i < geod_nodes.size(); ++i )
|
||||
{
|
||||
wgs84_nodes.push_back( SGVec3d::fromGeod(geod_nodes[i]) );
|
||||
}
|
||||
|
||||
SGSphered d;
|
||||
for ( unsigned int i = 0; i < wgs84_nodes.size(); ++i )
|
||||
for ( unsigned int i = 0; i < wgs84_nodes.size(); ++i )
|
||||
{
|
||||
d.expandBy(wgs84_nodes[ i ]);
|
||||
}
|
||||
|
||||
SGVec3d gbs_center = d.getCenter();
|
||||
double gbs_radius = d.getRadius();
|
||||
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "gbs center = " << gbs_center);
|
||||
GENAPT_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, "gbs center = " << gbs_center);
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, "Done with wgs84 node mapping");
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, " center = " << gbs_center << " radius = " << gbs_radius );
|
||||
|
||||
// null structures
|
||||
group_list fans_v; fans_v.clear();
|
||||
|
@ -1139,11 +1138,11 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
|
|||
obj.set_pt_materials( pt_materials );
|
||||
obj.set_tris_v( tris_v );
|
||||
obj.set_tris_n( tris_n );
|
||||
obj.set_tris_tc( tris_tc );
|
||||
obj.set_tris_tc( tris_tc );
|
||||
obj.set_tri_materials( tri_materials );
|
||||
obj.set_strips_v( strips_v );
|
||||
obj.set_strips_n( strips_n );
|
||||
obj.set_strips_tc( strips_tc );
|
||||
obj.set_strips_tc( strips_tc );
|
||||
obj.set_strip_materials( strip_materials );
|
||||
obj.set_fans_v( fans_v );
|
||||
obj.set_fans_n( fans_n );
|
||||
|
@ -1152,7 +1151,7 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
|
|||
|
||||
bool result;
|
||||
result = obj.write_bin( objpath, name, b );
|
||||
if ( !result )
|
||||
if ( !result )
|
||||
{
|
||||
throw sg_exception("error writing file. :-(");
|
||||
}
|
||||
|
@ -1162,7 +1161,7 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
|
|||
|
||||
#if 0 // TODO : along with taxiway signs
|
||||
// write out tower references
|
||||
for ( i = 0; i < (int)tower_nodes.size(); ++i )
|
||||
for ( i = 0; i < (int)tower_nodes.size(); ++i )
|
||||
{
|
||||
write_index_shared( objpath, b, tower_nodes[i],
|
||||
"Models/Airport/tower.xml",
|
||||
|
@ -1172,7 +1171,7 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
|
|||
|
||||
SGGeod ref_geod;
|
||||
// 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 )
|
||||
{
|
||||
|
@ -1238,4 +1237,4 @@ void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
|
|||
chopper.Add( divided_base, "Hole" );
|
||||
chopper.Add( apt_clearing, "Airport" );
|
||||
chopper.Save();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
#include <simgear/debug/logstream.hxx>
|
||||
#include <simgear/math/SGMath.hxx>
|
||||
|
||||
#include "debug.hxx"
|
||||
|
||||
inline double LinearDistance( const SGGeod& p0, const SGGeod& p1 )
|
||||
{
|
||||
return SGGeodesy::distanceM( p0, p1 );
|
||||
|
@ -261,7 +259,7 @@ public:
|
|||
|
||||
void Print()
|
||||
{
|
||||
GENAPT_LOG(SG_GENERAL, SG_DEBUG,
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG,
|
||||
"\tLoc: " << loc << "\n" <<
|
||||
"\tprev_cp: " << prev_cp << "\n" <<
|
||||
"\tnext_cp: " << next_cp << "\n" );
|
||||
|
|
|
@ -63,7 +63,7 @@ ClosedPoly::ClosedPoly( int st, float s, float th, char* desc )
|
|||
|
||||
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 )
|
||||
|
@ -75,7 +75,7 @@ void ClosedPoly::AddNode( BezNode* 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
|
||||
if (is_pavement)
|
||||
|
@ -92,7 +92,7 @@ void ClosedPoly::AddNode( BezNode* node )
|
|||
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->AddNode( node );
|
||||
|
@ -101,13 +101,13 @@ void ClosedPoly::AddNode( BezNode* node )
|
|||
|
||||
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 -
|
||||
// add the first node of the poly
|
||||
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() );
|
||||
|
||||
features.push_back(cur_feature);
|
||||
|
@ -146,7 +146,7 @@ void ClosedPoly::ConvertContour( BezContour* src, tgContour& dst )
|
|||
double total_dist;
|
||||
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
|
||||
dst.Erase();
|
||||
|
@ -154,7 +154,7 @@ void ClosedPoly::ConvertContour( BezContour* src, tgContour& dst )
|
|||
// iterate through each bezier node in the contour
|
||||
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);
|
||||
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
|
||||
num_segs = ((int)total_dist + 1);
|
||||
GENAPT_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, "Segment from " << curNode->GetLoc() << " to " << nextNode->GetLoc() );
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, " Distance is " << total_dist << " ( < 16.0) so num_segs is " << num_segs );
|
||||
}
|
||||
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
|
||||
num_segs = total_dist / 100.0f + 1;
|
||||
GENAPT_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, "Segment from " << curNode->GetLoc() << " to " << nextNode->GetLoc() );
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, " Distance is " << total_dist << " ( > 100.0) so num_segs is " << num_segs );
|
||||
}
|
||||
else
|
||||
{
|
||||
if (curve_type != CURVE_LINEAR)
|
||||
{
|
||||
num_segs = 8;
|
||||
GENAPT_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, "Segment from " << curNode->GetLoc() << " to " << nextNode->GetLoc() );
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, " Distance is " << total_dist << " (OK) so num_segs is " << num_segs );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -274,11 +274,11 @@ void ClosedPoly::ConvertContour( BezContour* src, tgContour& dst )
|
|||
|
||||
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
|
||||
{
|
||||
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
|
||||
|
@ -299,11 +299,11 @@ void ClosedPoly::ConvertContour( BezContour* src, tgContour& dst )
|
|||
|
||||
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
|
||||
{
|
||||
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
|
||||
|
@ -317,7 +317,7 @@ void ClosedPoly::ConvertContour( BezContour* src, tgContour& dst )
|
|||
// just add the one vertex - dist is small
|
||||
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;
|
||||
}
|
||||
|
@ -333,10 +333,10 @@ void ClosedPoly::Finish()
|
|||
// error handling
|
||||
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)
|
||||
{
|
||||
|
@ -422,7 +422,7 @@ std::string ClosedPoly::GetMaterial( int surface )
|
|||
break;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ double tgAverageElevation( const std::string &root, const string_list elev_src,
|
|||
for ( i = 0; i < points.size(); ++i ) {
|
||||
if ( points[i].getElevationM() < -9000.0 && !found_one ) {
|
||||
first = points[i];
|
||||
GENAPT_LOG( SG_GENERAL, SG_DEBUG, "found first = " << first );
|
||||
SG_LOG( SG_GENERAL, SG_DEBUG, "found first = " << first );
|
||||
|
||||
found_one = true;
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ double tgAverageElevation( const std::string &root, const string_list elev_src,
|
|||
|
||||
if ( array.open(array_path) ) {
|
||||
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++;
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ double tgAverageElevation( const std::string &root, const string_list elev_src,
|
|||
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;
|
||||
}
|
|
@ -36,7 +36,7 @@ Helipad::Helipad(char* definition)
|
|||
heli.designator, &heli.lat, &heli.lon, &heli.heading, &heli.length, &heli.width, &heli.surface,
|
||||
&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) {
|
||||
|
|
|
@ -22,7 +22,7 @@ void LinearFeature::ConvertContour( BezContour* src, bool closed )
|
|||
Marking* cur_mark = 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
|
||||
points.Erase();
|
||||
|
@ -50,7 +50,7 @@ void LinearFeature::ConvertContour( BezContour* src, bool closed )
|
|||
{
|
||||
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
|
||||
cur_mark->end_idx = points.GetSize();
|
||||
|
@ -59,7 +59,7 @@ void LinearFeature::ConvertContour( BezContour* src, bool closed )
|
|||
}
|
||||
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())
|
||||
{
|
||||
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
|
||||
cur_mark = new Marking;
|
||||
|
@ -87,7 +87,7 @@ void LinearFeature::ConvertContour( BezContour* src, bool closed )
|
|||
{
|
||||
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
|
||||
cur_light->end_idx = points.GetSize();
|
||||
|
@ -96,7 +96,7 @@ void LinearFeature::ConvertContour( BezContour* src, bool closed )
|
|||
}
|
||||
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())
|
||||
{
|
||||
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
|
||||
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)) )
|
||||
{
|
||||
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;
|
||||
}
|
||||
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)) )
|
||||
{
|
||||
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)) )
|
||||
{
|
||||
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;
|
||||
}
|
||||
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
|
||||
{
|
||||
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)) )
|
||||
{
|
||||
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
|
||||
{
|
||||
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
|
||||
num_segs = ((int)total_dist + 1) * 2;
|
||||
GENAPT_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, "Segment from " << curNode->GetLoc() << " to " << nextNode->GetLoc() );
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, " Distance is " << total_dist << " ( < 4.0) so num_segs is " << num_segs );
|
||||
}
|
||||
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
|
||||
num_segs = total_dist / 100.0f + 1;
|
||||
GENAPT_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, "Segment from " << curNode->GetLoc() << " to " << nextNode->GetLoc() );
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, " Distance is " << total_dist << " ( > 100.0) so num_segs is " << num_segs );
|
||||
}
|
||||
else
|
||||
{
|
||||
if (curve_type != CURVE_LINEAR)
|
||||
{
|
||||
num_segs = 8;
|
||||
GENAPT_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, "Segment from " << curNode->GetLoc() << " to " << nextNode->GetLoc() );
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, " Distance is " << total_dist << " (OK) so num_segs is " << num_segs );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -269,11 +269,11 @@ void LinearFeature::ConvertContour( BezContour* src, bool closed )
|
|||
|
||||
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
|
||||
{
|
||||
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
|
||||
|
@ -295,11 +295,11 @@ void LinearFeature::ConvertContour( BezContour* src, bool closed )
|
|||
|
||||
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
|
||||
{
|
||||
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
|
||||
|
@ -313,7 +313,7 @@ void LinearFeature::ConvertContour( BezContour* src, bool closed )
|
|||
// just add the one vertex - dist is small
|
||||
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;
|
||||
}
|
||||
|
@ -322,7 +322,7 @@ void LinearFeature::ConvertContour( BezContour* src, bool 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
|
||||
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...
|
||||
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;
|
||||
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...
|
||||
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;
|
||||
lights.push_back(cur_light);
|
||||
|
@ -500,13 +500,13 @@ int LinearFeature::Finish( bool closed, unsigned int idx )
|
|||
break;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
// 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++)
|
||||
{
|
||||
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
|
||||
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 (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("");
|
||||
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
|
||||
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("");
|
||||
lighting_polys.push_back(cur_light_contour);
|
||||
}
|
||||
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;
|
||||
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++)
|
||||
{
|
||||
// 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] );
|
||||
}
|
||||
|
||||
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++)
|
||||
{
|
||||
lights.push_back( lighting_polys[i] );
|
||||
|
|
|
@ -6,14 +6,14 @@ Windsock::Windsock( char* definition )
|
|||
{
|
||||
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 )
|
||||
{
|
||||
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 )
|
||||
|
@ -27,7 +27,7 @@ Sign::Sign( char* definition )
|
|||
// Flightgear wants the heading to be the heading in which the sign is read
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ using namespace std;
|
|||
|
||||
// Display usage
|
||||
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 ] "
|
||||
<< "[--min-lon=<deg>] [--max-lon=<deg>] [--min-lat=<deg>] [--max-lat=<deg>] "
|
||||
<< "[ --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)
|
||||
{
|
||||
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) );
|
||||
}
|
||||
else if (arg.find("--debug-features=") == 0)
|
||||
|
@ -258,26 +258,26 @@ int main(int argc, char **argv)
|
|||
std::string airportareadir=work_dir+"/AirportArea";
|
||||
|
||||
// this is the main program -
|
||||
GENAPT_LOG(SG_GENERAL, SG_INFO, "Genapts850 version " << getTGVersion() << " running with " << num_threads << " threads" );
|
||||
GENAPT_LOG(SG_GENERAL, SG_INFO, "Launch command was " << argv[0] );
|
||||
GENAPT_LOG(SG_GENERAL, SG_INFO, "Input file = " << input_file);
|
||||
GENAPT_LOG(SG_GENERAL, SG_INFO, "Work directory = " << work_dir);
|
||||
GENAPT_LOG(SG_GENERAL, SG_INFO, "Longitude = " << min.getLongitudeDeg() << ':' << max.getLongitudeDeg());
|
||||
GENAPT_LOG(SG_GENERAL, SG_INFO, "Latitude = " << min.getLatitudeDeg() << ':' << max.getLatitudeDeg());
|
||||
GENAPT_LOG(SG_GENERAL, SG_INFO, "Terrain sources = ");
|
||||
SG_LOG(SG_GENERAL, SG_INFO, "Genapts850 version " << getTGVersion() << " running with " << num_threads << " threads" );
|
||||
SG_LOG(SG_GENERAL, SG_INFO, "Launch command was " << argv[0] );
|
||||
SG_LOG(SG_GENERAL, SG_INFO, "Input file = " << input_file);
|
||||
SG_LOG(SG_GENERAL, SG_INFO, "Work directory = " << work_dir);
|
||||
SG_LOG(SG_GENERAL, SG_INFO, "Longitude = " << min.getLongitudeDeg() << ':' << max.getLongitudeDeg());
|
||||
SG_LOG(SG_GENERAL, SG_INFO, "Latitude = " << min.getLatitudeDeg() << ':' << max.getLatitudeDeg());
|
||||
SG_LOG(SG_GENERAL, SG_INFO, "Terrain sources = ");
|
||||
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())
|
||||
{
|
||||
GENAPT_LOG(SG_GENERAL, SG_ALERT, "Bad longitude or latitude");
|
||||
SG_LOG(SG_GENERAL, SG_ALERT, "Bad longitude or latitude");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// make work directory
|
||||
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Creating AirportArea directory");
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, "Creating AirportArea directory");
|
||||
|
||||
SGPath sgp( airportareadir );
|
||||
sgp.append( "dummy" );
|
||||
|
@ -290,21 +290,21 @@ int main(int argc, char **argv)
|
|||
|
||||
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 );
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
sg_gzifstream in( input_file );
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -320,7 +320,7 @@ int main(int argc, char **argv)
|
|||
// just find and add the one airport
|
||||
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
|
||||
scheduler->Schedule( num_threads, summary_file );
|
||||
|
@ -328,7 +328,7 @@ int main(int argc, char **argv)
|
|||
|
||||
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
|
||||
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);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -7,7 +7,7 @@ LightingObj::LightingObj( char* definition )
|
|||
{
|
||||
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 )
|
||||
|
@ -30,7 +30,7 @@ void LightingObj::BuildBtg( tglightcontour_list& lights )
|
|||
|
||||
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.
|
||||
// Space between the bars is 200m
|
||||
|
@ -65,7 +65,7 @@ void LightingObj::BuildBtg( tglightcontour_list& lights )
|
|||
}
|
||||
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
|
||||
pt1 = SGGeodesy::direct( ref, left_hdg, -12 );
|
||||
|
@ -80,7 +80,7 @@ void LightingObj::BuildBtg( tglightcontour_list& lights )
|
|||
}
|
||||
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
|
||||
pt1 = SGGeodesy::direct( ref, left_hdg, 12 );
|
||||
|
@ -95,19 +95,19 @@ void LightingObj::BuildBtg( tglightcontour_list& lights )
|
|||
}
|
||||
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;
|
||||
}
|
||||
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
|
||||
light_contour.AddLight( ref, normal );
|
||||
}
|
||||
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" );
|
||||
|
||||
|
@ -119,7 +119,7 @@ void LightingObj::BuildBtg( tglightcontour_list& lights )
|
|||
}
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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> 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;
|
||||
|
||||
|
@ -67,7 +67,7 @@ void Parser::set_debug( std::string path, std::vector<std::string> runway_defs,
|
|||
|
||||
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);
|
||||
|
||||
|
@ -96,7 +96,7 @@ void Parser::set_debug( std::string path, std::vector<std::string> runway_defs,
|
|||
|
||||
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);
|
||||
|
||||
|
@ -125,7 +125,7 @@ void Parser::set_debug( std::string path, std::vector<std::string> runway_defs,
|
|||
|
||||
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);
|
||||
|
||||
|
@ -154,7 +154,7 @@ void Parser::set_debug( std::string path, std::vector<std::string> runway_defs,
|
|||
|
||||
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);
|
||||
|
||||
|
@ -183,7 +183,7 @@ void Parser::run()
|
|||
std::ifstream in( filename.c_str() );
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -204,7 +204,7 @@ void Parser::run()
|
|||
|
||||
// Verify this is and airport definition and get the 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
|
||||
SetState(STATE_NONE);
|
||||
|
@ -212,8 +212,8 @@ void Parser::run()
|
|||
|
||||
parse_start.stamp();
|
||||
log_time = time(0);
|
||||
GENAPT_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, "\n*******************************************************************" );
|
||||
SG_LOG( SG_GENERAL, SG_ALERT, "Start airport " << icao << " at " << pos << ": start time " << ctime(&log_time) );
|
||||
|
||||
in.seekg(pos, std::ios::beg);
|
||||
while ( !in.eof() && (cur_state != STATE_DONE ) ) {
|
||||
|
@ -240,11 +240,11 @@ void Parser::run()
|
|||
}
|
||||
|
||||
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 <<
|
||||
" : clean " << clean_time << " : tesselate " << triangulation_time );
|
||||
} 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);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
@ -421,11 +421,11 @@ ClosedPoly* Parser::ParsePavement( char* line )
|
|||
if (numParams == 4)
|
||||
{
|
||||
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
|
||||
{
|
||||
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);
|
||||
|
@ -451,7 +451,7 @@ ClosedPoly* Parser::ParseBoundary( char* line )
|
|||
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);
|
||||
|
||||
return poly;
|
||||
|
@ -463,7 +463,7 @@ int Parser::SetState( int state )
|
|||
// is when we get a non-node line to parse
|
||||
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_airport->AddPavement( cur_pavement );
|
||||
cur_pavement = NULL;
|
||||
|
@ -471,7 +471,7 @@ int Parser::SetState( int state )
|
|||
|
||||
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_airport->AddBoundary( cur_boundary );
|
||||
cur_boundary = NULL;
|
||||
|
@ -507,7 +507,7 @@ int Parser::ParseLine(char* line)
|
|||
if (cur_state == STATE_NONE)
|
||||
{
|
||||
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 );
|
||||
}
|
||||
else
|
||||
|
@ -519,7 +519,7 @@ int Parser::ParseLine(char* line)
|
|||
if (cur_state == STATE_NONE)
|
||||
{
|
||||
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 );
|
||||
}
|
||||
else
|
||||
|
@ -530,7 +530,7 @@ int Parser::ParseLine(char* line)
|
|||
|
||||
case LAND_RUNWAY_CODE:
|
||||
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);
|
||||
if (cur_airport)
|
||||
{
|
||||
|
@ -540,7 +540,7 @@ int Parser::ParseLine(char* line)
|
|||
|
||||
case WATER_RUNWAY_CODE:
|
||||
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);
|
||||
if (cur_airport)
|
||||
{
|
||||
|
@ -549,7 +549,7 @@ int Parser::ParseLine(char* line)
|
|||
break;
|
||||
case HELIPAD_CODE:
|
||||
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);
|
||||
if (cur_airport)
|
||||
{
|
||||
|
@ -559,7 +559,7 @@ int Parser::ParseLine(char* line)
|
|||
|
||||
case TAXIWAY_CODE:
|
||||
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);
|
||||
if (cur_airport)
|
||||
{
|
||||
|
@ -569,25 +569,25 @@ int Parser::ParseLine(char* line)
|
|||
|
||||
case PAVEMENT_CODE:
|
||||
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 );
|
||||
break;
|
||||
|
||||
case LINEAR_FEATURE_CODE:
|
||||
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 );
|
||||
break;
|
||||
|
||||
case BOUNDRY_CODE:
|
||||
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 );
|
||||
break;
|
||||
|
||||
case 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 );
|
||||
|
||||
if ( prev_node && (cur_node != prev_node) )
|
||||
|
@ -612,7 +612,7 @@ int Parser::ParseLine(char* line)
|
|||
|
||||
case CLOSE_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 );
|
||||
|
||||
if ( cur_state == STATE_PARSE_PAVEMENT )
|
||||
|
@ -666,7 +666,7 @@ int Parser::ParseLine(char* line)
|
|||
|
||||
case TERM_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 )
|
||||
{
|
||||
|
@ -694,7 +694,7 @@ int Parser::ParseLine(char* line)
|
|||
}
|
||||
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...
|
||||
delete cur_feat;
|
||||
|
@ -708,66 +708,66 @@ int Parser::ParseLine(char* line)
|
|||
|
||||
case AIRPORT_VIEWPOINT_CODE:
|
||||
SetState( STATE_PARSE_SIMPLE );
|
||||
GENAPT_LOG(SG_GENERAL, SG_DEBUG, "Parsing viewpoint: " << line);
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, "Parsing viewpoint: " << line);
|
||||
break;
|
||||
case AIRPLANE_STARTUP_LOCATION_CODE:
|
||||
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;
|
||||
case LIGHT_BEACON_CODE:
|
||||
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_airport->AddBeacon( cur_beacon );
|
||||
break;
|
||||
case WINDSOCK_CODE:
|
||||
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_airport->AddWindsock( cur_windsock );
|
||||
break;
|
||||
case TAXIWAY_SIGN:
|
||||
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_airport->AddSign( cur_sign );
|
||||
break;
|
||||
case LIGHTING_OBJECT:
|
||||
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_airport->AddObj( cur_object );
|
||||
break;
|
||||
case COMM_FREQ1_CODE:
|
||||
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;
|
||||
case COMM_FREQ2_CODE:
|
||||
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;
|
||||
case COMM_FREQ3_CODE:
|
||||
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;
|
||||
case COMM_FREQ4_CODE:
|
||||
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;
|
||||
case COMM_FREQ5_CODE:
|
||||
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;
|
||||
case COMM_FREQ6_CODE:
|
||||
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;
|
||||
case COMM_FREQ7_CODE:
|
||||
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;
|
||||
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 );
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ Runway::Runway(char* definition)
|
|||
// calculate runway heading and length (used a lot)
|
||||
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]);
|
||||
|
||||
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()
|
||||
|
@ -122,7 +122,7 @@ int Runway::BuildBtg( tgpolygon_list& rwy_polys, tglightcontour_list& rwy_lights
|
|||
}
|
||||
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!");
|
||||
}
|
||||
|
||||
|
@ -131,7 +131,7 @@ int Runway::BuildBtg( tgpolygon_list& rwy_polys, tglightcontour_list& rwy_lights
|
|||
{
|
||||
case 1: // asphalt:
|
||||
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_runway_lights( rwy_lights );
|
||||
break;
|
||||
|
@ -140,25 +140,25 @@ int Runway::BuildBtg( tgpolygon_list& rwy_polys, tglightcontour_list& rwy_lights
|
|||
case 4: // Dirt
|
||||
case 5: // Gravel
|
||||
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_runway_lights( rwy_lights );
|
||||
break;
|
||||
|
||||
case 13: // water
|
||||
GENAPT_LOG( SG_GENERAL, SG_DEBUG, "Build Runway: Water");
|
||||
SG_LOG( SG_GENERAL, SG_DEBUG, "Build Runway: Water");
|
||||
break;
|
||||
|
||||
case 14: // snow
|
||||
GENAPT_LOG( SG_GENERAL, SG_DEBUG, "Build Runway: Snow");
|
||||
SG_LOG( SG_GENERAL, SG_DEBUG, "Build Runway: Snow");
|
||||
break;
|
||||
|
||||
case 15: // transparent
|
||||
GENAPT_LOG( SG_GENERAL, SG_DEBUG, "Build Runway: transparent");
|
||||
SG_LOG( SG_GENERAL, SG_DEBUG, "Build Runway: transparent");
|
||||
break;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
@ -241,7 +241,7 @@ void Runway::gen_runway_section( const tgPolygon& runway,
|
|||
SGVec2d t3 = SGVec2d( a2.x() + dlx * 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;
|
||||
|
||||
|
@ -299,8 +299,8 @@ void Runway::gen_runway_section( const tgPolygon& runway,
|
|||
section = tgPolygon::Snap( section, gSnap );
|
||||
|
||||
// print runway points
|
||||
GENAPT_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, "pre clipped runway pts " << material_prefix << material);
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, section );
|
||||
|
||||
if( shapefile_name.size() ) {
|
||||
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;
|
||||
|
||||
|
@ -407,7 +407,7 @@ void Runway::gen_runway_section( const tgPolygon& runway,
|
|||
SGVec2d t3 = SGVec2d( a2.x() + dlx * 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;
|
||||
|
||||
|
@ -445,8 +445,8 @@ void Runway::gen_runway_section( const tgPolygon& runway,
|
|||
section = tgPolygon::Snap( section, gSnap );
|
||||
|
||||
// print runway points
|
||||
GENAPT_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, "pre clipped runway pts " << material_prefix << material);
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, section );
|
||||
|
||||
// Clip the new polygon against what ever has already been created.
|
||||
tgPolygon clipped = accum.Diff( section );
|
||||
|
@ -497,7 +497,7 @@ void Runway::gen_rw_designation( tgPolygon poly, double heading, string rwname,
|
|||
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
|
||||
if ( !letter.empty() ) {
|
||||
|
@ -522,7 +522,7 @@ void Runway::gen_rw_designation( tgPolygon poly, double heading, string rwname,
|
|||
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 tex2[32]; tex2[0] = '\0';
|
||||
|
@ -584,7 +584,7 @@ void Runway::gen_rwy( tgpolygon_list& rwy_polys,
|
|||
tgAccumulator& accum,
|
||||
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 = "";
|
||||
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
|
||||
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 ("
|
||||
<< rwy.length << "m) for non-precision markings! Setting runway markings to visual!");
|
||||
rwy.marking[rwhalf]=1;
|
||||
}
|
||||
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 ("
|
||||
<< rwy.length << "m) for precision markings! Setting runway markings to visual!");
|
||||
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
|
||||
//
|
||||
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];
|
||||
|
||||
|
@ -780,7 +780,7 @@ void Runway::gen_rwy( tgpolygon_list& rwy_polys,
|
|||
|
||||
// Now create the marking sections of the runway type
|
||||
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 ) {
|
||||
start1_pct = end1_pct;
|
||||
|
|
|
@ -65,11 +65,11 @@ void Runway::gen_simple_rwy( tgpolygon_list& rwy_polys,
|
|||
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
|
||||
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;
|
||||
end_pct = start_pct + ( rwy.threshold[rwhalf] / length );
|
||||
|
|
|
@ -16,7 +16,7 @@ extern double gSnap;
|
|||
|
||||
SGLockedQueue<AirportInfo> global_workQueue;
|
||||
|
||||
ostream& operator<< (ostream &out, const AirportInfo &ai)
|
||||
std::ostream& operator<< (std::ostream &out, const AirportInfo &ai)
|
||||
{
|
||||
char snap_string[32];
|
||||
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> 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;
|
||||
|
||||
|
@ -76,7 +76,7 @@ void Scheduler::set_debug( std::string path, std::vector<std::string> runway_def
|
|||
|
||||
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);
|
||||
|
||||
|
@ -105,7 +105,7 @@ void Scheduler::set_debug( std::string path, std::vector<std::string> runway_def
|
|||
|
||||
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);
|
||||
|
||||
|
@ -134,7 +134,7 @@ void Scheduler::set_debug( std::string path, std::vector<std::string> runway_def
|
|||
|
||||
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);
|
||||
|
||||
|
@ -163,7 +163,7 @@ void Scheduler::set_debug( std::string path, std::vector<std::string> runway_def
|
|||
|
||||
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);
|
||||
|
||||
|
@ -245,11 +245,11 @@ void Scheduler::AddAirport( std::string icao )
|
|||
std::ifstream in( filename.c_str() );
|
||||
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);
|
||||
}
|
||||
|
||||
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 )
|
||||
{
|
||||
// remember the position of this line
|
||||
|
@ -261,7 +261,7 @@ void Scheduler::AddAirport( std::string icao )
|
|||
// this is and airport definition - remember it
|
||||
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 );
|
||||
global_workQueue.push( ai );
|
||||
|
@ -280,11 +280,11 @@ long Scheduler::FindAirport( std::string icao )
|
|||
std::ifstream in( filename.c_str() );
|
||||
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);
|
||||
}
|
||||
|
||||
GENAPT_LOG( SG_GENERAL, SG_DEBUG, "Finding airport " << icao );
|
||||
SG_LOG( SG_GENERAL, SG_DEBUG, "Finding airport " << icao );
|
||||
while ( !in.eof() && !found )
|
||||
{
|
||||
// remember the position of this line
|
||||
|
@ -296,7 +296,7 @@ long Scheduler::FindAirport( std::string icao )
|
|||
// this is and airport definition - remember it
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -337,7 +337,7 @@ bool Scheduler::AddAirports( long start_pos, tgRectangle* boundingBox )
|
|||
std::ifstream in( filename.c_str() );
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -482,7 +482,7 @@ Scheduler::Scheduler(std::string& datafile, const std::string& root, const strin
|
|||
std::ifstream in( filename.c_str() );
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ public:
|
|||
|
||||
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:
|
||||
std::string icao;
|
||||
|
|
|
@ -42,7 +42,7 @@ Taxiway::Taxiway(char* definition)
|
|||
&lat, &lon, designation, &heading, &length, &threshold, &overrun,
|
||||
&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
|
||||
length *= SG_FEET_TO_METER;
|
||||
|
@ -129,7 +129,7 @@ int Taxiway::BuildBtg( tgpolygon_list& rwy_polys, tglightcontour_list& rwy_light
|
|||
}
|
||||
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!");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue