# include <config.h>
#endif
+#include <Misc/fgstream.hxx>
#include "match.hxx"
}
+static bool check_corner( FGMatch::neighbor_type n, FGBucket b ) {
+ double clon = b.get_center_lon();
+ double clat = b.get_center_lat();
+
+ if ( n == FGMatch::SW_Corner ) {
+ fgBucketOffset(clon, clat, -1, 0)
+ }
+}
+
+
+// load any previously existing shared data from all neighbors
+void FGMatch::load_neighbor_shared( FGConstruct& c ) {
+ sw_flag = se_flag = ne_flag = nw_flag = false;
+ north_flag = south_flag = east_flag = west_flag = false;
+
+ string base = c.get_work_base();
+ FGBucket b = c.get_bucket();
+
+ string dir = base + ".shared/Scenery/" + b.gen_base_path();
+ string command = "mkdir -p " + dir;
+ string file = dir + "/" + b.gen_index_str();
+ cout << "shared data will be written to " << file << endl;
+
+ system(command.c_str());
+ fg_gzifstream in( file );
+ if ( !in ) {
+ cout << "Cannot open file: " << file << endl;
+ }
+
+ while ( in ) { }
+
+ check_corner( SW_Corner, b );
+}
+
+
// extract the shared edge points, normals, and segments. This must
// be done after calling load_neighbor_data() and will ignore any
// shared data from the current tile that already exists from a
west_normals[i].z() );
}
+#if 0 // not needed
point_list nodes = c.get_geod_nodes();
Point3D p1, p2;
fprintf( fp, "w_seg %.6f %.6f %.6f %.6f\n",
p1.x(), p1.y(), p2.x(), p2.y() );
}
+#endif
fclose( fp );
+
+ command = "gzip --force --best " + file;
+ system(command.c_str());
}
point_list north_normals, south_normals, east_normals, west_normals;
point_list body_normals;
+ // flags
+ bool sw_flag, se_flag, ne_flag, nw_flag;
+ bool north_flag, south_flag, east_flag, west_flag;
+
// segment breakdown
triseg_list north_segs, south_segs, east_segs, west_segs;
triseg_list body_segs;
public:
+ enum neighbor_type {
+ SW_Corner = 1,
+ SE_Corner = 2,
+ NE_Corner = 3,
+ NW_Corner = 4,
+ NORTH = 5,
+ SOUTH = 6,
+ EAST = 7,
+ WEST = 8
+ };
+
// Constructor
FGMatch( void );
~FGMatch( void );
// load any previously existing shared data from all neighbors
- void load_neighbor_data();
+ void load_neighbor_shared( FGConstruct& c );
// extract the shared edge points, normals, and segments. This
// must be done after calling load_neighbor_data() and will ignore