Tweaks to go along with scenery tools overhaul.
Added a new constructor that accepts the file name.
This commit is contained in:
parent
d2d25cbc93
commit
3defec9ea5
2 changed files with 21 additions and 46 deletions
54
DEM/dem.cxx
54
DEM/dem.cxx
|
@ -77,59 +77,21 @@ FG_USING_NAMESPACE(std);
|
|||
|
||||
|
||||
fgDEM::fgDEM( void ) {
|
||||
// printf("class fgDEM CONstructor called.\n");
|
||||
// cout << "class fgDEM CONstructor called." << endl;
|
||||
dem_data = new float[DEM_SIZE_1][DEM_SIZE_1];
|
||||
output_data = new float[DEM_SIZE_1][DEM_SIZE_1];
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
#ifdef WIN32
|
||||
fgDEM::fgDEM( const string &file ) {
|
||||
// cout << "class fgDEM CONstructor called." << endl;
|
||||
dem_data = new float[DEM_SIZE_1][DEM_SIZE_1];
|
||||
output_data = new float[DEM_SIZE_1][DEM_SIZE_1];
|
||||
|
||||
// return the file path name ( foo/bar/file.ext = foo/bar )
|
||||
static void extract_path ( const char *in, char *base) {
|
||||
int len, i;
|
||||
|
||||
len = strlen (in);
|
||||
strcpy (base, in);
|
||||
|
||||
i = len - 1;
|
||||
while ( (i >= 0) && (in[i] != '/') ) {
|
||||
i--;
|
||||
}
|
||||
|
||||
base[i] = '\0';
|
||||
fgDEM::open(file);
|
||||
}
|
||||
|
||||
|
||||
// Make a subdirectory
|
||||
static int my_mkdir (const char *dir) {
|
||||
struct stat stat_buf;
|
||||
int result;
|
||||
|
||||
printf ("mk_dir() ");
|
||||
|
||||
result = stat (dir, &stat_buf);
|
||||
|
||||
if (result != 0) {
|
||||
MKDIR (dir);
|
||||
result = stat (dir, &stat_buf);
|
||||
if (result != 0) {
|
||||
printf ("problem creating %s\n", dir);
|
||||
} else {
|
||||
printf ("%s created\n", dir);
|
||||
}
|
||||
} else {
|
||||
printf ("%s already exists\n", dir);
|
||||
}
|
||||
|
||||
return (result);
|
||||
}
|
||||
|
||||
#endif // WIN32
|
||||
#endif //0
|
||||
|
||||
|
||||
// open a DEM file
|
||||
int fgDEM::open ( const string& file ) {
|
||||
// open input file (or read from stdin)
|
||||
|
@ -868,6 +830,10 @@ fgDEM::~fgDEM( void ) {
|
|||
|
||||
|
||||
// $Log$
|
||||
// Revision 1.23 1999/03/10 01:09:12 curt
|
||||
// Tweaks to go along with scenery tools overhaul.
|
||||
// Added a new constructor that accepts the file name.
|
||||
//
|
||||
// Revision 1.22 1999/01/19 20:56:56 curt
|
||||
// MacOS portability changes contributed by "Robert Puyol" <puyol@abvent.fr>
|
||||
//
|
||||
|
|
13
DEM/dem.hxx
13
DEM/dem.hxx
|
@ -96,6 +96,7 @@ public:
|
|||
|
||||
// Constructor
|
||||
fgDEM( void );
|
||||
fgDEM( const string& file );
|
||||
|
||||
// open a DEM file (use "-" if input is coming from stdin)
|
||||
int open ( const string& file );
|
||||
|
@ -113,8 +114,12 @@ public:
|
|||
void read_b_record();
|
||||
|
||||
// Informational methods
|
||||
double info_originx( void ) { return(originx); }
|
||||
double info_originy( void ) { return(originy); }
|
||||
double get_originx( void ) { return originx; }
|
||||
double get_originy( void ) { return originy; }
|
||||
int get_cols( void ) { return cols; }
|
||||
int get_rows( void ) { return rows; }
|
||||
double get_col_step( void ) { return col_step; }
|
||||
double get_row_step( void ) { return row_step; }
|
||||
|
||||
// return the current altitude based on mesh data. We should
|
||||
// rewrite this to interpolate exact values, but for now this is
|
||||
|
@ -145,6 +150,10 @@ public:
|
|||
|
||||
|
||||
// $Log$
|
||||
// Revision 1.10 1999/03/10 01:09:13 curt
|
||||
// Tweaks to go along with scenery tools overhaul.
|
||||
// Added a new constructor that accepts the file name.
|
||||
//
|
||||
// Revision 1.9 1998/10/16 19:08:14 curt
|
||||
// Portability updates from Bernie Bright.
|
||||
//
|
||||
|
|
Loading…
Add table
Reference in a new issue