From 048130a991cf2daacf79329cb69d21ee22e96f13 Mon Sep 17 00:00:00 2001 From: curt Date: Tue, 20 Oct 1998 15:49:22 +0000 Subject: [PATCH] Converted to Point3D class. --- FixNode/fixnode.cxx | 24 ++++++++++++++++-------- FixNode/fixnode.hxx | 17 ++++++++++++++--- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/FixNode/fixnode.cxx b/FixNode/fixnode.cxx index f8819e30c..183833d4d 100644 --- a/FixNode/fixnode.cxx +++ b/FixNode/fixnode.cxx @@ -3,7 +3,7 @@ // // Written by Curtis Olson, started November 1997. // -// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com +// Copyright (C) 1997 Curtis L. Olson - curt@me.umn.edu // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -36,16 +36,20 @@ #include #include "fixnode.hxx" -// #include "triload.hxx" + + +// load extra nodes +void load_extra(const string& filename, container& extra_list) { +} // load the node information void load_nodes(const string& filename, container& node_list) { - fgPoint3d node; + Point3D node; int dim, junk1, junk2; int i, nodecount; - cout << "Loading node file: " + filename + " ...\n"; + cout << "Loading node file: " << filename << " ...\n"; fg_gzifstream in( filename ); if ( !in ) { @@ -64,7 +68,7 @@ void load_nodes(const string& filename, container& node_list) { in.eat_comments(); while ( ! in.eof() ) { - in.stream() >> junk1 >> node.x >> node.y >> node.z >> junk2; + in.stream() >> junk1 >> node >> junk2; in.eat_comments(); node_list.push_back(node); } @@ -86,8 +90,9 @@ void fix_nodes( const string& filename, fgDEM& dem, container& node_list ) // printf("Current: %d %.2f %.2f %.2f\n", i, nodes[i][0], // nodes[i][1], nodes[i][2]); - (*current).z = - dem.interpolate_altitude( (*current).x, (*current).y ); + (*current).setz( + dem.interpolate_altitude( (*current).x(), + (*current).y() ) ); // printf("Fixed: %d %.2f %.2f %.2f\n", i, nodes[i][0], // nodes[i][1], nodes[i][2]); @@ -107,7 +112,7 @@ void fix_nodes( const string& filename, fgDEM& dem, container& node_list ) i = 1; for ( current = node_list.begin() ; current != last ; ++current ) { fprintf( fd, "%d %.2f %.2f %.2f 0\n", i, - (*current).x, (*current).y, (*current).z ); + (*current).x(), (*current).y(), (*current).z() ); ++i; } @@ -116,6 +121,9 @@ void fix_nodes( const string& filename, fgDEM& dem, container& node_list ) // $Log$ +// Revision 1.6 1998/10/20 15:49:22 curt +// Converted to Point3D class. +// // Revision 1.5 1998/09/22 23:49:10 curt // eliminated a left over #include // diff --git a/FixNode/fixnode.hxx b/FixNode/fixnode.hxx index 0bcc9b2c3..80b6eb2b6 100644 --- a/FixNode/fixnode.hxx +++ b/FixNode/fixnode.hxx @@ -40,10 +40,10 @@ using namespace std; #endif #include -#include +#include -typedef vector < fgPoint3d > container; +typedef vector < Point3D > container; typedef container::iterator iterator; typedef container::const_iterator const_iterator; @@ -52,7 +52,15 @@ typedef container::const_iterator const_iterator; void load_nodes(const string& basename, container& node_list); -// load the node information +// load the extra nodes. These are always the first n nodes of the +// .node file. (??? These will be tagged with a code indicating what +// needs to be done with this node's elevation such as adjust to local +// DEM elevation, or massage the local DEM points to match this +// elevation point. ???) +void load_extra_nodes(const string& filename, container& node_list); + + +// fix the node elevations void fix_nodes( const string& basename, fgDEM& dem, container& node_list ); @@ -60,6 +68,9 @@ void fix_nodes( const string& basename, fgDEM& dem, container& node_list ); // $Log$ +// Revision 1.4 1998/10/20 15:49:23 curt +// Converted to Point3D class. +// // Revision 1.3 1998/09/19 20:43:53 curt // C++-ified and STL-ified the code. Combined triload.* and fixnode.* into // a single file. -- 2.39.2