//
// 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
#include <Misc/fgstream.hxx>
#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 ) {
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);
}
// 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]);
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;
}
// $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
//
#endif
#include <DEM/dem.hxx>
-#include <Include/fg_types.h>
+#include <Math/point3d.hxx>
-typedef vector < fgPoint3d > container;
+typedef vector < Point3D > container;
typedef container::iterator iterator;
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 );
// $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.