Support for changes to libDEM.a
This commit is contained in:
parent
4b0aa0e3a6
commit
192edc5eaf
4 changed files with 36 additions and 24 deletions
|
@ -32,6 +32,7 @@ deminfo_SOURCES = \
|
||||||
deminfo_LDADD = \
|
deminfo_LDADD = \
|
||||||
$(top_builddir)/Lib/DEM/libDEM.a \
|
$(top_builddir)/Lib/DEM/libDEM.a \
|
||||||
$(top_builddir)/Lib/Bucket/libBucket.a \
|
$(top_builddir)/Lib/Bucket/libBucket.a \
|
||||||
|
$(top_builddir)/Lib/Misc/libMisc.a \
|
||||||
$(top_builddir)/Lib/zlib/libz.a
|
$(top_builddir)/Lib/zlib/libz.a
|
||||||
|
|
||||||
INCLUDES += -I$(top_builddir) -I$(top_builddir)/Lib
|
INCLUDES += -I$(top_builddir) -I$(top_builddir)/Lib
|
||||||
|
@ -44,6 +45,9 @@ CXXFLAGS = -g
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# $Log$
|
# $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
|
# Revision 1.2 1998/07/30 23:49:24 curt
|
||||||
# Removed libtool support.
|
# Removed libtool support.
|
||||||
#
|
#
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include <DEM/dem.hxx>
|
#include <DEM/dem.hxx>
|
||||||
|
|
||||||
|
@ -37,8 +38,7 @@
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
// DEM data
|
// DEM data
|
||||||
fgDEM dem;
|
fgDEM dem;
|
||||||
char fg_root[256];
|
string filename;
|
||||||
char filename[256];
|
|
||||||
double error;
|
double error;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
|
@ -48,17 +48,16 @@ int main(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// set input dem file name
|
// set input dem file name
|
||||||
strcpy(filename, argv[1]);
|
filename = argv[1];
|
||||||
|
|
||||||
dem.open(filename);
|
dem.open(filename);
|
||||||
|
|
||||||
if ( dem.read_a_record() ) {
|
if ( dem.read_a_record() ) {
|
||||||
printf("Results = %s %.1f %.1f\n",
|
cout << "Results = " << filename << " "
|
||||||
filename,
|
<< dem.info_originx() / 3600.0 << " "
|
||||||
dem.info_originx() / 3600.0,
|
<< dem.info_originy() / 3600.0 << "\n";
|
||||||
dem.info_originy() / 3600.0 ) ;
|
|
||||||
} else {
|
} else {
|
||||||
printf("Error parsing DEM file.\n");
|
cout << "Error parsing DEM file.\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
dem.close();
|
dem.close();
|
||||||
|
@ -68,6 +67,9 @@ int main(int argc, char **argv) {
|
||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $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
|
// Revision 1.1 1998/06/04 19:18:05 curt
|
||||||
// Initial revision.
|
// Initial revision.
|
||||||
//
|
//
|
||||||
|
|
|
@ -34,6 +34,7 @@ fixnode_SOURCES = \
|
||||||
fixnode_LDADD = \
|
fixnode_LDADD = \
|
||||||
$(top_builddir)/Lib/DEM/libDEM.a \
|
$(top_builddir)/Lib/DEM/libDEM.a \
|
||||||
$(top_builddir)/Lib/Bucket/libBucket.a \
|
$(top_builddir)/Lib/Bucket/libBucket.a \
|
||||||
|
$(top_builddir)/Lib/Misc/libMisc.a \
|
||||||
$(top_builddir)/Lib/zlib/libz.a
|
$(top_builddir)/Lib/zlib/libz.a
|
||||||
|
|
||||||
INCLUDES += -I$(top_builddir) -I$(top_builddir)/Lib
|
INCLUDES += -I$(top_builddir) -I$(top_builddir)/Lib
|
||||||
|
@ -46,6 +47,9 @@ CXXFLAGS = -g
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# $Log$
|
# $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
|
# Revision 1.4 1998/07/30 23:49:24 curt
|
||||||
# Removed libtool support.
|
# Removed libtool support.
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// main.c -- read in a .node file and fix the z values of the interpolated
|
// main.cxx -- read in a .node file and fix the z values of the interpolated
|
||||||
// points
|
// points
|
||||||
//
|
//
|
||||||
// Written by Curtis Olson, started November 1997.
|
// Written by Curtis Olson, started November 1997.
|
||||||
//
|
//
|
||||||
|
@ -28,6 +28,7 @@
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#ifdef HAVE_STDLIB_H
|
#ifdef HAVE_STDLIB_H
|
||||||
# include <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
|
// 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;
|
DIR *d;
|
||||||
struct dirent *de;
|
struct dirent *de;
|
||||||
char file_path[256];
|
string file_path;
|
||||||
char *ptr;
|
char *ptr;
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
if ( (d = opendir(root_path)) == NULL ) {
|
if ( (d = opendir( root_path.c_str() )) == NULL ) {
|
||||||
printf("cannot open directory '%s'.", root_path);
|
cout << "cannot open directory " + root_path + "\n";
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,15 +68,13 @@ void process_files(char *root_path) {
|
||||||
// printf("--> %s \n", ptr);
|
// printf("--> %s \n", ptr);
|
||||||
|
|
||||||
if ( strcmp(ptr, ".1.node") == 0 ) {
|
if ( strcmp(ptr, ".1.node") == 0 ) {
|
||||||
strcpy(file_path, root_path);
|
file_path = root_path + "/" + de->d_name;
|
||||||
strcat(file_path, "/");
|
cout << "File = " + file_path + "\n";
|
||||||
strcat(file_path, de->d_name);
|
|
||||||
printf("File = %s\n", file_path);
|
|
||||||
|
|
||||||
// load the input data files
|
// 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
|
// main
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
char demfile[256], root_path[256];
|
string demfile, root_path;
|
||||||
|
|
||||||
if ( argc != 3 ) {
|
if ( argc != 3 ) {
|
||||||
printf("Usage %s demfile root_path\n", argv[0]);
|
printf("Usage %s demfile root_path\n", argv[0]);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Starting fixnode\n");
|
cout << "Starting fixnode\n";
|
||||||
|
|
||||||
strcpy(demfile, argv[1]);
|
demfile = argv[1];
|
||||||
strcpy(root_path, argv[2]);
|
root_path = argv[2];
|
||||||
|
|
||||||
// load the corresponding dem file so we can interpolate elev values
|
// load the corresponding dem file so we can interpolate elev values
|
||||||
dem.open(demfile);
|
dem.open(demfile);
|
||||||
|
@ -109,6 +108,9 @@ int main(int argc, char **argv) {
|
||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $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
|
// Revision 1.5 1998/07/22 21:46:41 curt
|
||||||
// Fixed a bug that was triggering a seg fault.
|
// Fixed a bug that was triggering a seg fault.
|
||||||
//
|
//
|
||||||
|
|
Loading…
Add table
Reference in a new issue