Add a routine to place a "shared" object into the Work tree so the tile
builder can pick it up later in the final assembly process.
This commit is contained in:
parent
35f324ddaa
commit
9c43f4785e
2 changed files with 41 additions and 4 deletions
|
@ -67,8 +67,9 @@ void write_polygon( const TGPolygon& poly, const string& base ) {
|
|||
}
|
||||
|
||||
|
||||
// update index
|
||||
void write_index(const string& base, const SGBucket& b, const string& name) {
|
||||
// update index file (list of objects to be included in final scenery build)
|
||||
void write_index( const string& base, const SGBucket& b, const string& name )
|
||||
{
|
||||
string dir = base + "/" + b.gen_base_path();
|
||||
#ifdef _MSC_VER
|
||||
fg_mkdir( dir.c_str() );
|
||||
|
@ -92,6 +93,36 @@ void write_index(const string& base, const SGBucket& b, const string& name) {
|
|||
}
|
||||
|
||||
|
||||
// update index file (list of shared objects to be included in final
|
||||
// scenery build)
|
||||
void write_index_shared( const string &base, const SGBucket &b,
|
||||
const Point3D &p, const string& name,
|
||||
const double &heading )
|
||||
{
|
||||
string dir = base + "/" + b.gen_base_path();
|
||||
#ifdef _MSC_VER
|
||||
fg_mkdir( dir.c_str() );
|
||||
#else
|
||||
string command = "mkdir -p " + dir;
|
||||
system(command.c_str());
|
||||
#endif
|
||||
|
||||
string file = dir + "/" + b.gen_index_str() + ".ind";
|
||||
// string file = dir + "/" + name;
|
||||
cout << "Output file = " << file << endl;
|
||||
|
||||
FILE *fp;
|
||||
if ( (fp = fopen( file.c_str(), "a" )) == NULL ) {
|
||||
cout << "ERROR: opening " << file << " for writing!" << endl;
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
fprintf( fp, "OBJECT_SHARED %s %.6f %.6f %.1f %.2f\n", name.c_str(),
|
||||
p.lon(), p.lat(), p.elev(), heading );
|
||||
fclose( fp );
|
||||
}
|
||||
|
||||
|
||||
void write_boundary( const string& base, const SGBucket& b,
|
||||
const TGPolygon& bounds, long int p_index )
|
||||
{
|
||||
|
|
|
@ -46,8 +46,14 @@
|
|||
|
||||
void write_polygon( const TGPolygon& poly, const string& base );
|
||||
|
||||
// update index
|
||||
void write_index(const string& base, const SGBucket& b, const string& name);
|
||||
// update index file (list of objects to be included in final scenery build)
|
||||
void write_index( const string& base, const SGBucket& b, const string& name );
|
||||
|
||||
// update index file (list of shared objects to be included in final
|
||||
// scenery build)
|
||||
void write_index_shared( const string &base, const SGBucket &b,
|
||||
const Point3D &p, const string& name,
|
||||
const double &heading );
|
||||
|
||||
void write_boundary( const string& base, const SGBucket& b,
|
||||
const TGPolygon& bounds, long int p_index );
|
||||
|
|
Loading…
Reference in a new issue