diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.cpp index e15b5185976..ef6b193a5fa 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.cpp @@ -347,6 +347,7 @@ void Scene_edit_polyhedron_item_priv::compute_normals_and_vertices(Mesh* mesh) typedef typename boost::property_map::type VertexPointMap; VertexPointMap pmap = get(boost::vertex_point, *mesh); + int s_index = 0; for(mesh_vd vd : fs.get_deform_mesh(mesh)->roi_vertices()) { if(!fs.get_deform_mesh(mesh)->is_control_vertex(vd)) @@ -360,7 +361,7 @@ void Scene_edit_polyhedron_item_priv::compute_normals_and_vertices(Mesh* mesh) { CGAL::Color c(0,255,0); EPICK::Point_3 point(p.x()+offset.x, p.y()+offset.y, p.z()+offset.z); - spheres->add_sphere(EPICK::Sphere_3(point, length_of_axis/15.0*length_of_axis/15.0), c); + spheres->add_sphere(EPICK::Sphere_3(point, length_of_axis/15.0*length_of_axis/15.0), s_index++, c); } } @@ -400,7 +401,7 @@ void Scene_edit_polyhedron_item_priv::compute_normals_and_vertices(Mesh* mesh) EPICK::Point_3 center(p.x()+offset.x, p.y()+offset.y, p.z()+offset.z); - spheres_ctrl->add_sphere(EPICK::Sphere_3(center, length_of_axis/15.0*length_of_axis/15.0), c); + spheres_ctrl->add_sphere(EPICK::Sphere_3(center, length_of_axis/15.0*length_of_axis/15.0), s_index++, c); } } } @@ -1271,7 +1272,7 @@ void Scene_edit_polyhedron_item::ShowAsSphere(bool b) { if(!d->spheres) { - d->spheres = new Scene_spheres_item(this, false); + d->spheres = new Scene_spheres_item(this, 0, false); d->spheres->setName("ROI spheres"); d->spheres->setRenderingMode(Gouraud); connect(d->spheres, SIGNAL(destroyed()), this, SLOT(reset_spheres())); diff --git a/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp b/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp index 9ad4cfa9dc2..a74f77e3818 100644 --- a/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp @@ -1390,7 +1390,7 @@ void Scene_c3t3_item_priv::computeSpheres() if(!spheres) return; - + int s_id = 0; for(Tr::Finite_vertices_iterator vit = c3t3.triangulation().finite_vertices_begin(), end = c3t3.triangulation().finite_vertices_end(); @@ -1436,7 +1436,7 @@ void Scene_c3t3_item_priv::computeSpheres() wp2p(vit->point()).z() + offset.z); float radius = vit->point().weight() ; typedef unsigned char UC; - spheres->add_sphere(Geom_traits::Sphere_3(center, radius), + spheres->add_sphere(Geom_traits::Sphere_3(center, radius),s_id++, CGAL::Color(UC(c.red()), UC(c.green()), UC(c.blue()))); } spheres->invalidateOpenGLBuffers(); @@ -1602,7 +1602,7 @@ void Scene_c3t3_item::show_spheres(bool b) contextMenu()->findChild("actionShowSpheres")->setChecked(b); if(b && !d->spheres) { - d->spheres = new Scene_spheres_item(this, true); + d->spheres = new Scene_spheres_item(this, d->c3t3.number_of_vertices_in_complex(), true); d->spheres->setName("Protecting spheres"); d->spheres->setRenderingMode(Gouraud); connect(d->spheres, SIGNAL(destroyed()), this, SLOT(reset_spheres())); diff --git a/Polyhedron/demo/Polyhedron/Scene_polylines_item.cpp b/Polyhedron/demo/Polyhedron/Scene_polylines_item.cpp index cb9b43c6162..8802aeec8e1 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polylines_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_polylines_item.cpp @@ -218,6 +218,7 @@ Scene_polylines_item_private::computeSpheres() // At this point, 'corner_polyline_nb' gives the multiplicity of all // corners. //Finds the centers of the spheres and their color + int s_id = 0; for(iterator p_it = corner_polyline_nb.begin(), end = corner_polyline_nb.end(); @@ -253,7 +254,7 @@ Scene_polylines_item_private::computeSpheres() } CGAL::Color c(colors[0], colors[1], colors[2]); - spheres->add_sphere(K::Sphere_3(center+offset, spheres_drawn_square_radius), c); + spheres->add_sphere(K::Sphere_3(center+offset, spheres_drawn_square_radius),s_id++, c); } spheres->setToolTip( QString("

Legend of endpoints colors: