#include <math.h>
#include <algorithm>
+#include <iostream>
#include <simgear/compiler.h>
#include "awynet.hxx"
-SG_USING_STD(sort);
+using std::sort;
+
+using std::cerr;
+using std::endl;
/**************************************************************************
* FGNode
maxDistance = 0;
}
+FGAirwayNetwork::~FGAirwayNetwork()
+{
+ for (unsigned int it = 0; it < nodes.size(); it++) {
+ delete nodes[ it];
+ }
+}
void FGAirwayNetwork::addAirway(const FGAirway &seg)
{
segments.push_back(seg);
in >> skipeol;
// read in each remaining line of the file
-
-#ifdef __MWERKS__
- char c = 0;
- while ( in.get(c) && c != '\0' ) {
- in.putback(c);
-#else
while ( ! in.eof() ) {
-#endif
string token;
in >> token;
// Read each line from the database
identStart = token;
in >> latStart >> lonStart >> identEnd >> latEnd >> lonEnd >> type >> base >> top >> name;
+ in >> skipeol;
/*out << identStart << " "
<< latStart << " "
<< lonStart << " "
char buffer[32];
string startNode, endNode;
// Start
- snprintf(buffer, 32, "%s%d%d", identStart.c_str(), (int) latStart, (int) lonStart);
+ buffer[sizeof(buffer)-1] = 0;
+ snprintf(buffer, sizeof(buffer)-1, "%s%d%d", identStart.c_str(), (int) latStart, (int) lonStart);
startNode = buffer;
node_map_iterator itr = nodesMap.find(string(buffer));