#include <Include/fg_constants.h>
#include <Include/fg_types.h>
-#include <Math/fg_geodesy.h>
-#include <Math/mat3.h>
-#include <Math/polar.h>
-#include <Scenery/bucketutils.h>
+// #include <Math/fg_geodesy.h>
+// #include <Math/mat3.h>
+// #include <Math/polar.h>
+#include <Bucket/bucketutils.h>
int nodecount = 0;
static double nodes[MAX_NODES][3];
-struct fgBUCKET my_index;
-struct fgBUCKET ne_index, nw_index, sw_index, se_index;
-struct fgBUCKET north_index, south_index, east_index, west_index;
+fgBUCKET my_index;
+fgBUCKET ne_index, nw_index, sw_index, se_index;
+fgBUCKET north_index, south_index, east_index, west_index;
/* return the file base name ( foo/bar/file.ext = file.ext ) */
}
-/* given a file pointer, read all the gdn (geodetic nodes from it) */
-void read_nodes(FILE *fp) {
+/* given a file pointer, read all the gdn (geodetic nodes from it.)
+ The specified offset values (in arcsec) are used to overlap the
+ edges of the tile slightly to cover gaps induced by floating point
+ precision problems. 1 arcsec == about 100 feet so 0.01 arcsec ==
+ about 1 foot */
+void read_nodes(FILE *fp, double offset_lon, double offset_lat) {
char line[256];
while ( fgets(line, 250, fp) != NULL ) {
if ( strncmp(line, "gdn ", 4) == 0 ) {
sscanf(line, "gdn %lf %lf %lf\n", &nodes[nodecount][0],
&nodes[nodecount][1], &nodes[nodecount][2]);
+
+ nodes[nodecount][0] += offset_lon;
+ nodes[nodecount][1] += offset_lat;
+
/*
printf("read_nodes(%d) %.2f %.2f %.2f %s", nodecount,
nodes[nodecount][0], nodes[nodecount][1],
FILE *ne, *nw, *se, *sw, *north, *south, *east, *west, *body;
ne = my_open(basename, basepath, ".ne");
- read_nodes(ne);
+ read_nodes(ne, 0.1, 0.1);
fclose(ne);
nw = my_open(basename, basepath, ".nw");
- read_nodes(nw);
+ read_nodes(nw, -0.1, 0.1);
fclose(nw);
se = my_open(basename, basepath, ".se");
- read_nodes(se);
+ read_nodes(se, 0.1, -0.1);
fclose(se);
sw = my_open(basename, basepath, ".sw");
- read_nodes(sw);
+ read_nodes(sw, -0.1, -0.1);
fclose(sw);
north = my_open(basename, basepath, ".north");
- read_nodes(north);
+ read_nodes(north, 0.0, 0.1);
fclose(north);
south = my_open(basename, basepath, ".south");
- read_nodes(south);
+ read_nodes(south, 0.0, -0.1);
fclose(south);
east = my_open(basename, basepath, ".east");
- read_nodes(east);
+ read_nodes(east, 0.1, 0.0);
fclose(east);
west = my_open(basename, basepath, ".west");
- read_nodes(west);
+ read_nodes(west, -0.1, 0.0);
fclose(west);
body = my_open(basename, basepath, ".body");
- read_nodes(body);
+ read_nodes(body, 0.0, 0.0);
fclose(body);
}
/* $Log$
-/* Revision 1.5 1998/03/03 16:00:52 curt
-/* More c++ compile tweaks.
+/* Revision 1.9 1998/07/04 00:55:39 curt
+/* typedef'd struct fgBUCKET.
/*
+ * Revision 1.8 1998/06/01 17:58:19 curt
+ * Added a slight border overlap to try to minimize pixel wide gaps between
+ * tiles due to round off error. This is not a perfect solution, but helps.
+ *
+ * Revision 1.7 1998/04/14 02:26:00 curt
+ * Code reorganizations. Added a Lib/ directory for more general libraries.
+ *
+ * Revision 1.6 1998/04/08 22:54:58 curt
+ * Adopted Gnu automake/autoconf system.
+ *
+ * Revision 1.5 1998/03/03 16:00:52 curt
+ * More c++ compile tweaks.
+ *
* Revision 1.4 1998/01/31 00:41:23 curt
* Made a few changes converting floats to doubles.
*