diff --git a/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h index a33ff7a1e3d..982b3fa023f 100644 --- a/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h @@ -42,7 +42,7 @@ namespace CGAL { */ template @@ -51,7 +51,7 @@ class Labeled_image_mesh_domain_3 >::type, BGT, @@ -59,6 +59,7 @@ class Labeled_image_mesh_domain_3 > { public: + typedef Image_word_type_ Image_word_type; typedef typename Default::Get #include #include +#include // for CGAL::Null_subdomain_index namespace CGAL { -template +template void polylines_to_protect(const CGAL::Image_3& cgal_image, - const double, const double, const double, - std::vector >& polylines) + const double vx, const double vy, const double vz, + std::vector >& polylines, + Image_word_type*, + Null_subdomain_index null) { typedef typename Kernel_traits

::Kernel K; typedef P Point_3; @@ -85,7 +90,6 @@ polylines_to_protect(const CGAL::Image_3& cgal_image, // we have gone too far continue; } - typedef unsigned char Image_word_type; typedef tuple Enriched_pixel; array, 2> square = @@ -99,9 +103,9 @@ polylines_to_protect(const CGAL::Image_3& cgal_image, for(int jj = 0; jj < 2; ++jj) { const Pixel& pixel = get<0>(square[ii][jj]); - double x = pixel[0] * cgal_image.vx(); - double y = pixel[1] * cgal_image.vy(); - double z = pixel[2] * cgal_image.vz(); + double x = pixel[0] * vx; + double y = pixel[1] * vy; + double z = pixel[2] * vz; get<1>(square[ii][jj]) = Point_3(x, y, z); get<2>(square[ii][jj]) = static_cast(cgal_image.value(pixel[0], pixel[1], @@ -340,7 +344,22 @@ case_4: } -template +template +void +polylines_to_protect(const CGAL::Image_3& cgal_image, + std::vector >& polylines, + Image_word_type* word_type, + Null_subdomain_index null) +{ + polylines_to_protect

+ (cgal_image, + cgal_image.vx(), cgal_image.vy(),cgal_image.vz(), + polylines, + word_type, + null); +} + +template void polylines_to_protect(const CGAL::Image_3& cgal_image, std::vector >& polylines) @@ -348,7 +367,9 @@ polylines_to_protect(const CGAL::Image_3& cgal_image, polylines_to_protect

(cgal_image, cgal_image.vx(), cgal_image.vy(),cgal_image.vz(), - polylines); + polylines, + (Image_word_type*)0, + CGAL::Null_subdomain_index()); } } // namespace CGAL 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 2978e674c55..626b2b65428 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 @@ -132,7 +132,9 @@ Meshing_thread* cgal_code_mesh_3(const Image* pImage, if(protect_features && polylines.empty()){ std::vector > polylines_on_bbox; - CGAL::polylines_to_protect(*pImage, polylines_on_bbox); + CGAL::polylines_to_protect< + Point_3, + Image_mesh_domain::Image_word_type>(*pImage, polylines_on_bbox); p_domain->add_features(polylines_on_bbox.begin(), polylines_on_bbox.end()); } if(! polylines.empty()){