1- // Build a graph structure out of all highway data in active and
2- // preview systems
31cout << et.et() << " Setting up for graphs of highway data." << endl;
42HighwayGraph graph_data (all_waypoints, et);
53
@@ -10,19 +8,8 @@ for (string& line : graph_data.waypoint_naming_log)
108wslogfile.close();
119graph_data.waypoint_naming_log.clear();
1210
13- // create list of graph information for the DB
14- list<array<string,3 >> graph_types;
15-
1611// start generating graphs and making entries for graph DB table
17- if (Args::skipgraphs || Args::errorcheck)
18- cout << et.et() << " SKIPPING generation of subgraphs." << endl;
19- else { list<Region*> *regions;
20- list<HighwaySystem*> *systems;
21- GraphListEntry::entries.emplace_back (' s' , graph_data.vertices .size (), graph_data.se , 0 );
22- GraphListEntry::entries.emplace_back (' c' , graph_data.cv , graph_data.ce , 0 );
23- GraphListEntry::entries.emplace_back (' t' , graph_data.tv , graph_data.te , TravelerList::allusers.size );
24- graph_types.push_back ({" master" , " All Travel Mapping Data" ,
25- " These graphs contain all routes currently plotted in the Travel Mapping project." });
12+ { // Let's keep these braces here, for easily commenting out subgraph generation when developing waypoint simplification routines
2613 GraphListEntry::num = 3 ;
2714
2815 cout << et.et () << " Writing master TM graph files." << endl;
@@ -31,30 +18,21 @@ else { list<Region*> *regions;
3118 std::cout << " Collapsed graph has " << graph_data.cv << " vertices, " << graph_data.ce << " edges." << std::endl;
3219 std::cout << " Traveled graph has " << graph_data.tv << " vertices, " << graph_data.te << " edges." << std::endl;
3320
34- #ifndef threading_enabled
35- graph_data.write_master_graphs_tmg ();
36- #else
37- cout << et.et () << " Setting up subgraphs." << endl;
38- #endif
39- HighwaySystem *h, *const sys_end = HighwaySystem::syslist.end ();
40- #include " subgraphs/continent.cpp"
41- #include " subgraphs/multisystem.cpp"
42- #include " subgraphs/system.cpp"
43- #include " subgraphs/country.cpp"
44- #include " subgraphs/multiregion.cpp"
45- #include " subgraphs/fullcustom.cpp"
46- #include " subgraphs/region.cpp"
47- #include " subgraphs/area.cpp"
48- #ifdef threading_enabled
4921 // write graph vector entries to disk
22+ #ifdef threading_enabled
5023 thr[0 ] = thread (MasterTmgThread, &graph_data, &list_mtx, &term_mtx, &all_waypoints, &et);
5124 // start at t=1, because MasterTmgThread will spawn another SubgraphThread when finished
5225 for (unsigned int t = 1 ; t < thr.size (); t++)
5326 thr[t] = thread (SubgraphThread, t, &list_mtx, &term_mtx, &graph_data, &all_waypoints, &et);
5427 THREADLOOP thr[t].join ();
55- cout << ' !' << endl;
28+ #else
29+ for ( graph_data.write_master_graphs_tmg ();
30+ GraphListEntry::num < GraphListEntry::entries.size ();
31+ GraphListEntry::num += 3
32+ ) graph_data.write_subgraphs_tmg (GraphListEntry::num, 0 , &all_waypoints, &et, &term_mtx);
5633 #endif
57- }
34+ cout << ' !' << endl;
35+ } // */
5836
5937cout << et.et() << " Clearing HighwayGraph contents from memory." << endl;
6038graph_data.clear();
0 commit comments