]> git.mxchange.org Git - flightgear.git/commitdiff
Support for changes to libDEM.a
authorcurt <curt>
Sat, 19 Sep 1998 18:01:21 +0000 (18:01 +0000)
committercurt <curt>
Sat, 19 Sep 1998 18:01:21 +0000 (18:01 +0000)
DemInfo/Makefile.am
DemInfo/deminfo.cxx
FixNode/Makefile.am
FixNode/main.cxx

index 0ec8323d091a626b6c8fe48404980c79aa389e4e..aa73af87304d5162595df1f7e636b8b255e8d7cd 100644 (file)
@@ -32,6 +32,7 @@ deminfo_SOURCES = \
 deminfo_LDADD = \
        $(top_builddir)/Lib/DEM/libDEM.a \
        $(top_builddir)/Lib/Bucket/libBucket.a \
+       $(top_builddir)/Lib/Misc/libMisc.a \
        $(top_builddir)/Lib/zlib/libz.a
 
 INCLUDES += -I$(top_builddir) -I$(top_builddir)/Lib
@@ -44,6 +45,9 @@ CXXFLAGS = -g
 
 #---------------------------------------------------------------------------
 # $Log$
+# Revision 1.3  1998/09/19 18:01:21  curt
+# Support for changes to libDEM.a
+#
 # Revision 1.2  1998/07/30 23:49:24  curt
 # Removed libtool support.
 #
index 9af81a9dd2c1a7fb26d179879b2e4f63a054298d..27f1f43575643cd24c3bedb8337f49abec9013e1 100644 (file)
@@ -26,6 +26,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <string>
 
 #include <DEM/dem.hxx>
 
@@ -37,8 +38,7 @@
 int main(int argc, char **argv) {
     // DEM data
     fgDEM dem;
-    char fg_root[256];
-    char filename[256];
+    string filename;
     double error;
     int i, j;
 
@@ -48,17 +48,16 @@ int main(int argc, char **argv) {
     }
 
     // set input dem file name
-    strcpy(filename, argv[1]);
+    filename = argv[1];
 
     dem.open(filename);
 
     if ( dem.read_a_record() ) {
-       printf("Results = %s  %.1f %.1f\n", 
-              filename, 
-              dem.info_originx() / 3600.0,
-              dem.info_originy() / 3600.0 ) ;
+       cout << "Results = " << filename << "  "
+            << dem.info_originx() / 3600.0 << " "
+            << dem.info_originy() / 3600.0 << "\n";
     } else {
-       printf("Error parsing DEM file.\n");
+       cout << "Error parsing DEM file.\n";
     }
 
     dem.close();
@@ -68,6 +67,9 @@ int main(int argc, char **argv) {
 
 
 // $Log$
+// Revision 1.2  1998/09/19 18:01:22  curt
+// Support for changes to libDEM.a
+//
 // Revision 1.1  1998/06/04 19:18:05  curt
 // Initial revision.
 //
index b44b9b6d7fb34d5a4e67d1fc31157cd0348c32c6..f9224f1a3386998382452be0ccf984f140a490b3 100644 (file)
@@ -34,6 +34,7 @@ fixnode_SOURCES = \
 fixnode_LDADD = \
        $(top_builddir)/Lib/DEM/libDEM.a \
         $(top_builddir)/Lib/Bucket/libBucket.a \
+        $(top_builddir)/Lib/Misc/libMisc.a \
         $(top_builddir)/Lib/zlib/libz.a
 
 INCLUDES += -I$(top_builddir) -I$(top_builddir)/Lib
@@ -46,6 +47,9 @@ CXXFLAGS = -g
 
 #---------------------------------------------------------------------------
 # $Log$
+# Revision 1.5  1998/09/19 18:01:26  curt
+# Support for changes to libDEM.a
+#
 # Revision 1.4  1998/07/30 23:49:24  curt
 # Removed libtool support.
 #
index 92441ec8eba698fa8f0ef27584f51ca4fdc06e64..4adaa97d078e2ead3e401f5a96793ed5b5dde501 100644 (file)
@@ -1,5 +1,5 @@
-// main.c -- read in a .node file and fix the z values of the interpolated 
-//           points
+// main.cxx -- read in a .node file and fix the z values of the interpolated 
+//             points
 //
 // Written by Curtis Olson, started November 1997.
 //
@@ -28,6 +28,7 @@
 #include <dirent.h>
 #include <stdio.h>
 #include <string.h>
+#include <string>
 
 #ifdef HAVE_STDLIB_H
 #  include <stdlib.h>
@@ -47,15 +48,15 @@ static double nodes[MAX_NODES][3];
 
 
 // find all the matching files in the specified directory and fix them
-void process_files(char *root_path) {
+void process_files(const string& root_path) {
     DIR *d;
     struct dirent *de;
-    char file_path[256];
+    string file_path;
     char *ptr;
     int len;
 
-    if ( (d = opendir(root_path)) == NULL ) {
-        printf("cannot open directory '%s'.", root_path);
+    if ( (d = opendir( root_path.c_str() )) == NULL ) {
+        cout << "cannot open directory " + root_path + "\n";
        exit(-1);
     }
 
@@ -67,15 +68,13 @@ void process_files(char *root_path) {
            // printf("--> %s \n", ptr);
 
            if ( strcmp(ptr, ".1.node") == 0 ) {
-               strcpy(file_path, root_path);
-               strcat(file_path, "/");
-               strcat(file_path, de->d_name);
-               printf("File = %s\n", file_path);
+               file_path =  root_path + "/" + de->d_name;
+               cout << "File = " + file_path + "\n";
 
                // load the input data files
-               triload(file_path, nodes);
+               triload(file_path.c_str(), nodes);
 
-               fixnodes(file_path, &dem, nodes);
+               fixnodes(file_path.c_str(), &dem, nodes);
            }
        }
     }
@@ -84,17 +83,17 @@ void process_files(char *root_path) {
 
 // main
 int main(int argc, char **argv) {
-    char demfile[256], root_path[256];
+    string demfile, root_path;
 
     if ( argc != 3 ) {
        printf("Usage %s demfile root_path\n", argv[0]);
        exit(-1);
     }
 
-    printf("Starting fixnode\n");
+    cout << "Starting fixnode\n";
 
-    strcpy(demfile, argv[1]);
-    strcpy(root_path, argv[2]);
+    demfile = argv[1];
+    root_path = argv[2];
 
     // load the corresponding dem file so we can interpolate elev values
     dem.open(demfile);
@@ -109,6 +108,9 @@ int main(int argc, char **argv) {
 
 
 // $Log$
+// Revision 1.6  1998/09/19 18:01:27  curt
+// Support for changes to libDEM.a
+//
 // Revision 1.5  1998/07/22 21:46:41  curt
 // Fixed a bug that was triggering a seg fault.
 //