mirror of https://github.com/CGAL/cgal
Refactor
This commit is contained in:
parent
d5c4d3fd64
commit
9f98df3d16
|
|
@ -306,11 +306,23 @@ std::vector<QVector3D> 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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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<Node>;
|
||||
|
||||
|
|
|
|||
|
|
@ -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<QVector3D> 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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue