From 60fa986e1f918419cff9414ffba18be636ea2bb8 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 3 Mar 2017 18:05:18 +0100 Subject: [PATCH] make the Polyhedron demo mesh_3_plugin work --- .../AABB_triangulation_3_triangle_primitive.h | 8 +++--- .../CGAL/Mesh_3/polylines_to_protect.h | 3 ++- .../Mesh_3/Mesh_3_plugin_cgal_code.cpp | 4 +-- .../demo/Polyhedron/Scene_c3t3_item.cpp | 26 +++++++++---------- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/AABB_tree/include/CGAL/AABB_triangulation_3_triangle_primitive.h b/AABB_tree/include/CGAL/AABB_triangulation_3_triangle_primitive.h index 23aed23744e..f23705fab87 100644 --- a/AABB_tree/include/CGAL/AABB_triangulation_3_triangle_primitive.h +++ b/AABB_tree/include/CGAL/AABB_triangulation_3_triangle_primitive.h @@ -87,9 +87,9 @@ namespace CGAL { Datum datum() const { int i = m_facet.second; - const Point& a = m_facet.first->vertex((i+1) &3)->point(); - const Point& b = m_facet.first->vertex((i+2) &3)->point(); - const Point& c = m_facet.first->vertex((i+3) &3)->point(); + const Point& a = m_facet.first->vertex((i+1) &3)->point().point(); + const Point& b = m_facet.first->vertex((i+2) &3)->point().point(); + const Point& c = m_facet.first->vertex((i+3) &3)->point().point(); return Datum(a,b,c); } @@ -97,7 +97,7 @@ namespace CGAL { // Returns a point on the primitive Point reference_point() const { - return m_facet.first->vertex((m_facet.second +1) &3)->point(); + return m_facet.first->vertex((m_facet.second +1) &3)->point().point(); } // Returns the identifier diff --git a/Mesh_3/include/CGAL/Mesh_3/polylines_to_protect.h b/Mesh_3/include/CGAL/Mesh_3/polylines_to_protect.h index a5ab79faad7..f7b76857999 100644 --- a/Mesh_3/include/CGAL/Mesh_3/polylines_to_protect.h +++ b/Mesh_3/include/CGAL/Mesh_3/polylines_to_protect.h @@ -317,7 +317,8 @@ case_4: vertex_descriptor right = g_manip.split(p10, p11, out10, out11); vertex_descriptor top = g_manip.split(p01, p11, out01, out11); vertex_descriptor bottom = g_manip.split(p00, p10, out00, out10); - vertex_descriptor vmid = g_manip.get_vertex(midpoint(p00, p11)); + + vertex_descriptor vmid = g_manip.get_vertex(midpoint(p00, p11)); g_manip.try_add_edge(left , vmid); g_manip.try_add_edge(right , vmid); g_manip.try_add_edge(top , vmid); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.cpp index ce06a9809c0..c6b4405faf6 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.cpp @@ -308,9 +308,9 @@ Meshing_thread* cgal_code_mesh_3(const Image* pImage, Image_mesh_domain* p_domain = new Image_mesh_domain(*pImage, 1e-6); if(protect_features && polylines.empty()){ - std::vector > polylines_on_bbox; + std::vector > polylines_on_bbox; CGAL::polylines_to_protect< - Tr_Point_3, + Bare_point_3, Image_mesh_domain::Image_word_type>(*pImage, polylines_on_bbox); p_domain->add_features(polylines_on_bbox.begin(), polylines_on_bbox.end()); } diff --git a/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp b/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp index 3cea5bcbb86..eb622d40188 100644 --- a/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp @@ -638,7 +638,7 @@ template std::vector create_histogram(const C3t3& c3t3, double& min_value, double& max_value) { - typedef typename C3t3::Triangulation::Point Point_3; + typedef typename C3t3::Triangulation::Bare_point Point_3; typename Kernel::Compute_approximate_dihedral_angle_3 approx_dihedral_angle = Kernel().compute_approximate_dihedral_angle_3_object(); @@ -662,10 +662,10 @@ create_histogram(const C3t3& c3t3, double& min_value, double& max_value) continue; #endif //CGAL_MESH_3_DEMO_DONT_COUNT_TETS_ADJACENT_TO_SHARP_FEATURES_FOR_HISTOGRAM - const Point_3& p0 = cit->vertex(0)->point(); - const Point_3& p1 = cit->vertex(1)->point(); - const Point_3& p2 = cit->vertex(2)->point(); - const Point_3& p3 = cit->vertex(3)->point(); + const Point_3& p0 = cit->vertex(0)->point().point(); + const Point_3& p1 = cit->vertex(1)->point().point(); + const Point_3& p2 = cit->vertex(2)->point().point(); + const Point_3& p3 = cit->vertex(3)->point().point(); double a = CGAL::to_double(CGAL::abs(approx_dihedral_angle(p0, p1, p2, p3))); histo[static_cast(std::floor(a))] += 1; @@ -1181,7 +1181,7 @@ void Scene_c3t3_item::export_facets_in_complex() std::size_t index = 0; BOOST_FOREACH(C3t3::Vertex_handle v, vertex_set) { - points[index] = v->point(); + points[index] = v->point().point(); indices.insert(std::make_pair(v, index)); index++; } @@ -1569,9 +1569,9 @@ void Scene_c3t3_item_priv::computeElements() { const Tr::Cell_handle& cell = fit->first; const int& index = fit->second; - const Kernel::Point_3& pa = cell->vertex((index + 1) & 3)->point(); - const Kernel::Point_3& pb = cell->vertex((index + 2) & 3)->point(); - const Kernel::Point_3& pc = cell->vertex((index + 3) & 3)->point(); + const Kernel::Point_3& pa = cell->vertex((index + 1) & 3)->point().point(); + const Kernel::Point_3& pb = cell->vertex((index + 2) & 3)->point().point(); + const Kernel::Point_3& pc = cell->vertex((index + 3) & 3)->point().point(); QColor color = colors[cell->surface_patch_index(index)]; f_colors.push_back(color.redF());f_colors.push_back(color.greenF());f_colors.push_back(color.blueF()); @@ -1600,10 +1600,10 @@ void Scene_c3t3_item_priv::computeElements() } if(!has_far_point) { - const Kernel::Point_3& p1 = cit->vertex(0)->point(); - const Kernel::Point_3& p2 = cit->vertex(1)->point(); - const Kernel::Point_3& p3 = cit->vertex(2)->point(); - const Kernel::Point_3& p4 = cit->vertex(3)->point(); + const Kernel::Point_3& p1 = cit->vertex(0)->point().point(); + const Kernel::Point_3& p2 = cit->vertex(1)->point().point(); + const Kernel::Point_3& p3 = cit->vertex(2)->point().point(); + const Kernel::Point_3& p4 = cit->vertex(3)->point().point(); draw_triangle_edges_cnc(p1, p2, p4); draw_triangle_edges_cnc(p1, p3, p4); draw_triangle_edges_cnc(p2, p3, p4);