diff --git a/Arrangement_on_surface_2/demo/earth/Aos.cpp b/Arrangement_on_surface_2/demo/earth/Aos.cpp index 3e572107014..d7552f10ced 100644 --- a/Arrangement_on_surface_2/demo/earth/Aos.cpp +++ b/Arrangement_on_surface_2/demo/earth/Aos.cpp @@ -306,11 +306,23 @@ std::vector Aos::ext_check(const Kml::Placemarks& placemarks) auto& d = vit->data(); if (vit->data().v == false) { + if (2 == vit->degree()) + ;//continue; + + if (1 == vit->degree()) + { + std::cout << "1-deg vertex: " << std::boolalpha << vit->incident_halfedges()->target()->data().v << std::endl; + } + + num_created_vertices++; auto p = vit->point(); auto ap = approx(p); QVector3D new_vertex(ap.dx(), ap.dy(), ap.dz()); + new_vertex.normalize(); std::cout << new_vertex << std::endl; + std::cout << "degree = " << vit->degree() << std::endl; + created_vertices.push_back(new_vertex); // find the arcs that are adjacent to this vertex diff --git a/Arrangement_on_surface_2/demo/earth/Kml_reader.cpp b/Arrangement_on_surface_2/demo/earth/Kml_reader.cpp index 98fc4949ce7..0c2dbc32041 100644 --- a/Arrangement_on_surface_2/demo/earth/Kml_reader.cpp +++ b/Arrangement_on_surface_2/demo/earth/Kml_reader.cpp @@ -29,6 +29,11 @@ QVector3D Kml::Node::get_coords_3f(const double r) const const auto v = get_coords_3d(r); return QVector3D(v.x, v.y, v.z); } +std::ostream& operator << (std::ostream& os, const Kml::Node& n) +{ + os << n.lon << ", " << n.lat; + return os; +} Kml::Placemarks Kml::read(const std::string& file_name) diff --git a/Arrangement_on_surface_2/demo/earth/Kml_reader.h b/Arrangement_on_surface_2/demo/earth/Kml_reader.h index eda3c77a4c2..d51cca15ea8 100644 --- a/Arrangement_on_surface_2/demo/earth/Kml_reader.h +++ b/Arrangement_on_surface_2/demo/earth/Kml_reader.h @@ -25,11 +25,7 @@ public: bool operator == (const Node& r) const; Vec3d get_coords_3d(const double r = 1.0) const; QVector3D get_coords_3f(const double r=1.0) const; - friend std::ostream& operator << (std::ostream& os, const Node& n) - { - os << n.lon << ", " << n.lat; - return os; - } + friend std::ostream& operator << (std::ostream& os, const Node& n); }; using Nodes = std::vector; diff --git a/Arrangement_on_surface_2/demo/earth/Main_widget.cpp b/Arrangement_on_surface_2/demo/earth/Main_widget.cpp index f9349348b04..78cf160b599 100644 --- a/Arrangement_on_surface_2/demo/earth/Main_widget.cpp +++ b/Arrangement_on_surface_2/demo/earth/Main_widget.cpp @@ -206,7 +206,7 @@ void readShapefile(const std::string& filename) { void Main_widget::initializeGL() { - readShapefile("C:/work/gsoc2023/data/ne_110m_admin_0_countries/ne_110m_admin_0_countries.shp"); + //readShapefile("C:/work/gsoc2023/data/ne_110m_admin_0_countries/ne_110m_admin_0_countries.shp"); //const auto file_name = "C:/work/gsoc2023/data/world_countries.kml"; const auto file_name = "C:/work/gsoc2023/data/ne_110m_admin_0_countries.kml"; @@ -214,7 +214,7 @@ void Main_widget::initializeGL() auto dup_nodes = Kml::get_duplicates(m_countries); // initialize rendering of DUPLICATE VERTICES - if(1) + if(0) { std::vector vertices; for (const auto& node : dup_nodes) @@ -493,7 +493,7 @@ void Main_widget::paintGL() const QVector4D vertex_color(1, 0, 0, 1); sp.set_uniform("u_color", vertex_color); glPointSize(5); - //m_vertices->draw(); + m_vertices->draw(); sp.unuse(); }