Rename: FGArray -> TGArray
This commit is contained in:
parent
595ed50097
commit
0a1108e494
7 changed files with 28 additions and 37 deletions
|
@ -180,7 +180,7 @@ static point_list calc_elevations( const string& root,
|
|||
bool done = false;
|
||||
point_list result = geod_nodes;
|
||||
int i, j;
|
||||
FGArray array;
|
||||
TGArray array;
|
||||
|
||||
// just bail if no work to do
|
||||
if ( ! result.size() ) {
|
||||
|
|
|
@ -411,7 +411,7 @@ static int load_polys( FGConstruct& c ) {
|
|||
|
||||
// Load elevation data from a DEM file, a regular grid of elevation
|
||||
// data--dem based) and return list of fitted nodes.
|
||||
static int load_dem( FGConstruct& c, FGArray& array) {
|
||||
static int load_dem( FGConstruct& c, TGArray& array) {
|
||||
point_list result;
|
||||
string base = c.get_bucket().gen_base_path();
|
||||
int i;
|
||||
|
@ -437,13 +437,13 @@ static int load_dem( FGConstruct& c, FGArray& array) {
|
|||
|
||||
|
||||
// fit dem nodes, return number of fitted nodes
|
||||
static int fit_dem(FGArray& array, int error) {
|
||||
static int fit_dem(TGArray& array, int error) {
|
||||
return array.fit( error );
|
||||
}
|
||||
|
||||
|
||||
// triangulate the data for each polygon ( first time before splitting )
|
||||
static void first_triangulate( FGConstruct& c, const FGArray& array,
|
||||
static void first_triangulate( FGConstruct& c, const TGArray& array,
|
||||
FGTriangle& t ) {
|
||||
// first we need to consolidate the points of the DEM fit list and
|
||||
// all the polygons into a more "Triangle" friendly format
|
||||
|
@ -490,7 +490,7 @@ static double distance2D( const Point3D p1, const Point3D p2 ) {
|
|||
|
||||
|
||||
// fix the elevations of the geodetic nodes
|
||||
static void fix_point_heights( FGConstruct& c, const FGArray& array ) {
|
||||
static void fix_point_heights( FGConstruct& c, const TGArray& array ) {
|
||||
int i;
|
||||
double z;
|
||||
|
||||
|
@ -594,7 +594,7 @@ static void fix_point_heights( FGConstruct& c, const FGArray& array ) {
|
|||
|
||||
|
||||
// build the wgs-84 point list
|
||||
static void build_wgs_84_point_list( FGConstruct& c, const FGArray& array ) {
|
||||
static void build_wgs_84_point_list( FGConstruct& c, const TGArray& array ) {
|
||||
point_list geod_nodes;
|
||||
point_list wgs84_nodes;
|
||||
int i;
|
||||
|
@ -879,7 +879,7 @@ static void construct_tile( FGConstruct& c ) {
|
|||
}
|
||||
|
||||
// load grid of elevation data (dem)
|
||||
FGArray array;
|
||||
TGArray array;
|
||||
load_dem( c, array );
|
||||
|
||||
FGTriangle t;
|
||||
|
|
|
@ -62,25 +62,25 @@ SG_USING_STD(cout);
|
|||
SG_USING_STD(endl);
|
||||
|
||||
|
||||
FGArray::FGArray( void ) {
|
||||
// cout << "class FGArray CONstructor called." << endl;
|
||||
TGArray::TGArray( void ) {
|
||||
// cout << "class TGArray CONstructor called." << endl;
|
||||
in_data = new float[ARRAY_SIZE_1][ARRAY_SIZE_1];
|
||||
// out_data = new float[ARRAY_SIZE_1][ARRAY_SIZE_1];
|
||||
}
|
||||
|
||||
|
||||
FGArray::FGArray( const string &file ) {
|
||||
// cout << "class FGArray CONstructor called." << endl;
|
||||
TGArray::TGArray( const string &file ) {
|
||||
// cout << "class TGArray CONstructor called." << endl;
|
||||
in_data = new float[ARRAY_SIZE_1][ARRAY_SIZE_1];
|
||||
// out_data = new float[ARRAY_SIZE_1][ARRAY_SIZE_1];
|
||||
|
||||
FGArray::open(file);
|
||||
TGArray::open(file);
|
||||
}
|
||||
|
||||
|
||||
// open an Array file
|
||||
int
|
||||
FGArray::open( const string& file ) {
|
||||
TGArray::open( const string& file ) {
|
||||
// open input file (or read from stdin)
|
||||
if ( file == "-" ) {
|
||||
cout << " Opening array data pipe from stdin" << endl;
|
||||
|
@ -103,7 +103,7 @@ FGArray::open( const string& file ) {
|
|||
|
||||
// close an Array file
|
||||
int
|
||||
FGArray::close() {
|
||||
TGArray::close() {
|
||||
// the sg_gzifstream doesn't seem to have a close()
|
||||
|
||||
delete in;
|
||||
|
@ -115,7 +115,7 @@ FGArray::close() {
|
|||
// parse Array file, pass in the bucket so we can make up values when
|
||||
// the file wasn't found.
|
||||
int
|
||||
FGArray::parse( SGBucket& b ) {
|
||||
TGArray::parse( SGBucket& b ) {
|
||||
if ( in->is_open() ) {
|
||||
// file open, parse
|
||||
*in >> originx >> originy;
|
||||
|
@ -167,7 +167,7 @@ FGArray::parse( SGBucket& b ) {
|
|||
|
||||
|
||||
// add a node to the output corner node list
|
||||
void FGArray::add_corner_node( int i, int j, double val ) {
|
||||
void TGArray::add_corner_node( int i, int j, double val ) {
|
||||
|
||||
double x = (originx + i * col_step) / 3600.0;
|
||||
double y = (originy + j * row_step) / 3600.0;
|
||||
|
@ -178,7 +178,7 @@ void FGArray::add_corner_node( int i, int j, double val ) {
|
|||
|
||||
|
||||
// add a node to the output fitted node list
|
||||
void FGArray::add_fit_node( int i, int j, double val ) {
|
||||
void TGArray::add_fit_node( int i, int j, double val ) {
|
||||
double x = (originx + i * col_step) / 3600.0;
|
||||
double y = (originy + j * row_step) / 3600.0;
|
||||
// cout << Point3D(x, y, val) << endl;
|
||||
|
@ -188,7 +188,7 @@ void FGArray::add_fit_node( int i, int j, double val ) {
|
|||
|
||||
// Use least squares to fit a simpler data set to dem data. Return
|
||||
// the number of fitted nodes
|
||||
int FGArray::fit( double error ) {
|
||||
int TGArray::fit( double error ) {
|
||||
double x[ARRAY_SIZE_1], y[ARRAY_SIZE_1];
|
||||
double m, b, max_error, error_sq;
|
||||
double x1, y1;
|
||||
|
@ -345,7 +345,7 @@ int FGArray::fit( double error ) {
|
|||
|
||||
// return the current altitude based on grid data. We should rewrite
|
||||
// this to interpolate exact values, but for now this is good enough
|
||||
double FGArray::interpolate_altitude( double lon, double lat ) const {
|
||||
double TGArray::interpolate_altitude( double lon, double lat ) const {
|
||||
// we expect incoming (lon,lat) to be in arcsec for now
|
||||
|
||||
double xlocal, ylocal, dx, dy, zA, zB, elev;
|
||||
|
@ -464,7 +464,7 @@ double FGArray::interpolate_altitude( double lon, double lat ) const {
|
|||
// Check for an optional "index.node.ex" file in case there is a .poly
|
||||
// file to go along with this node file. Include these nodes first
|
||||
// since they are referenced by position from the .poly file.
|
||||
void FGArray::outputmesh_output_nodes( const string& fg_root, SGBucket& p )
|
||||
void TGArray::outputmesh_output_nodes( const string& fg_root, SGBucket& p )
|
||||
{
|
||||
double exnodes[MAX_EX_NODES][3];
|
||||
struct stat stat_buf;
|
||||
|
@ -578,8 +578,8 @@ void FGArray::outputmesh_output_nodes( const string& fg_root, SGBucket& p )
|
|||
#endif
|
||||
|
||||
|
||||
FGArray::~FGArray( void ) {
|
||||
// printf("class FGArray DEstructor called.\n");
|
||||
TGArray::~TGArray( void ) {
|
||||
// printf("class TGArray DEstructor called.\n");
|
||||
delete [] in_data;
|
||||
// delete [] out_data;
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ SG_USING_STD(vector);
|
|||
#define ARRAY_SIZE_1 1201
|
||||
|
||||
|
||||
class FGArray {
|
||||
class TGArray {
|
||||
|
||||
private:
|
||||
|
||||
|
@ -78,11 +78,11 @@ private:
|
|||
public:
|
||||
|
||||
// Constructor
|
||||
FGArray( void );
|
||||
FGArray( const string& file );
|
||||
TGArray( void );
|
||||
TGArray( const string& file );
|
||||
|
||||
// Destructor
|
||||
~FGArray( void );
|
||||
~TGArray( void );
|
||||
|
||||
// open an Array file (use "-" if input is coming from stdin)
|
||||
int open ( const string& file );
|
||||
|
|
|
@ -25,7 +25,7 @@ int main( int argc, char **argv ) {
|
|||
string arrayfile = path + "/" + b.gen_index_str() + ".dem";
|
||||
cout << "arrayfile = " << arrayfile << endl;
|
||||
|
||||
FGArray a(arrayfile);
|
||||
TGArray a(arrayfile);
|
||||
a.parse( b );
|
||||
|
||||
lon *= 3600;
|
||||
|
|
|
@ -42,15 +42,6 @@ SG_USING_STD(string);
|
|||
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
/*
|
||||
fgDEM dem;
|
||||
SGBucket p;
|
||||
string fg_root;
|
||||
string filename;
|
||||
double error;
|
||||
int i, j;
|
||||
*/
|
||||
|
||||
sglog().setLogLevels( SG_ALL, SG_WARN );
|
||||
|
||||
if ( argc != 3 ) {
|
||||
|
|
|
@ -53,7 +53,7 @@ point_list calc_elevations( const string& root, const point_list& geod_nodes ) {
|
|||
bool done = false;
|
||||
point_list result = geod_nodes;
|
||||
int i, j;
|
||||
FGArray array;
|
||||
TGArray array;
|
||||
|
||||
// set all elevations to -9999
|
||||
for ( i = 0; i < (int)result.size(); ++i ) {
|
||||
|
|
Loading…
Add table
Reference in a new issue