Skip to content

Commit

Permalink
added: source and target attributes to each edge in json format
Browse files Browse the repository at this point in the history
  • Loading branch information
denizdiktas committed Aug 11, 2023
1 parent 9c6c7ff commit 93811df
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 3 additions & 1 deletion Arrangement_on_surface_2/demo/earth/Aos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,8 @@ void Aos::save_arr(Kml::Placemarks& placemarks, const std::string& file_name)
json js_edge;
js_edge["curve"] = xcvp;
js_edge["direction"] = edge.direction();
js_edge["source"] = vertex_pos_map[edge.source()];
js_edge["target"] = vertex_pos_map[edge.target()];
js_edges.push_back(std::move(js_edge));
num_edges++;

Expand Down Expand Up @@ -1085,7 +1087,7 @@ void Aos::save_arr(Kml::Placemarks& placemarks, const std::string& file_name)
auto get_ccb_json = [&](Ext_aos::Ccb_halfedge_circulator first)
{
json js_edges;
auto& ccb_edge_indices = js_edges["edges"] = json::array();
auto& ccb_edge_indices = js_edges["halfedges"] = json::array();
auto curr = first;
do {
auto& he = *curr;
Expand Down
11 changes: 7 additions & 4 deletions Arrangement_on_surface_2/demo/earth/Main_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ void Main_widget::initializeGL()
//Shapefile::read(shape_file_name);

//const auto file_name = data_path + "world_countries.kml";
const auto file_name = data_path + "ne_110m_admin_0_countries.kml";
//const auto file_name = data_path + "ne_110m_admin_0_countries_africa.kml";
//const auto file_name = data_path + "ne_110m_admin_0_countries.kml";
const auto file_name = data_path + "ne_110m_admin_0_countries_africa_1.kml";
m_countries = Kml::read(file_name);
auto dup_nodes = Kml::get_duplicates(m_countries);
//auto all_nodes = Kml::generate_ids(m_countries);
Expand All @@ -191,8 +191,11 @@ void Main_widget::initializeGL()
}

// SAVING & LOADING ARR
if(1)
{
//Aos::save_arr(m_countries, "C:/work/gsoc2023/ne_110m_admin_0_countries_africa.json");
Aos::save_arr(m_countries, "C:/work/gsoc2023/ne_110m_admin_0_countries_africa_1.json");
qDebug() << "done saving!";
exit(0);
//Aos::save_arr(m_countries, "C:/work/gsoc2023/ne_110m_admin_0_countries.json");
//Aos::load_arr("C:/work/gsoc2023/ne_110m_admin_0_countries.json");
}
Expand Down Expand Up @@ -506,7 +509,7 @@ void Main_widget::paintGL()
if(1)
{
glDisable(GL_DEPTH_TEST);
QVector4D face_color(1, .5, 0, 1);
auto face_color = QVector4D(241, 141, 0, 255) / 255;
sp.set_uniform("u_color", face_color);
sp.set_uniform("u_plane", plane);
//glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
Expand Down

0 comments on commit 93811df

Please sign in to comment.