diff --git a/Heat_method_3/include/CGAL/Heat_method_3/Intrinsic_Delaunay_Triangulation_3.h b/Heat_method_3/include/CGAL/Heat_method_3/Intrinsic_Delaunay_Triangulation_3.h index 13f48964392..965a932fcbb 100644 --- a/Heat_method_3/include/CGAL/Heat_method_3/Intrinsic_Delaunay_Triangulation_3.h +++ b/Heat_method_3/include/CGAL/Heat_method_3/Intrinsic_Delaunay_Triangulation_3.h @@ -159,6 +159,7 @@ namespace Intrinsic_Delaunay_Triangulation_3 { } }; + struct Vertex_iterator_functor { typedef vertex_descriptor argument_type; @@ -792,7 +793,6 @@ target(typename boost::graph_traits::vertex_descriptor tm_vd = target(vd.hd, idtpm.idt.triangle_mesh()); - put(idtpm.pm, idtpm.idt.v2v.at(tm_vd), v); } }; diff --git a/Heat_method_3/test/Heat_method_3/heat_method_intrinsic_surface_mesh_test.cpp b/Heat_method_3/test/Heat_method_3/heat_method_intrinsic_surface_mesh_test.cpp index dfb7a08618e..36cd464abb2 100644 --- a/Heat_method_3/test/Heat_method_3/heat_method_intrinsic_surface_mesh_test.cpp +++ b/Heat_method_3/test/Heat_method_3/heat_method_intrinsic_surface_mesh_test.cpp @@ -1,3 +1,6 @@ + + + #include #include #include @@ -24,29 +27,40 @@ typedef boost::property_map::type Vertex_dis typedef CGAL::Intrinsic_Delaunay_Triangulation_3::Intrinsic_Delaunay_Triangulation_3 Idt; +typedef boost::graph_traits::vertex_descriptor sm_vertex_descriptor; typedef boost::graph_traits::vertex_descriptor vertex_descriptor; typedef CGAL::Heat_method_3::Heat_method_3 Heat_method; typedef CGAL::Heat_method_3::Heat_method_Eigen_traits_3::SparseMatrix SparseMatrix; +template +T +NEXT(T t, int n) +{ + for(int i = 0; i < n; i++){ + ++t; + } + return t; +} -#if 0 +#if 1 void source_set_tests(Heat_method hm, const Idt& sm) { - vertex_descriptor source = *(vertices(sm).first); + sm_vertex_descriptor source = *(vertices(sm).first); hm.add_source(source); - const std::set& source_copy = hm.get_sources(); - assert(*(source_copy.begin()) == source);; - assert(*(hm.sources_begin()) == source); + // const std::set& source_copy = hm.get_sources(); + //assert(*(source_copy.begin()) == source);; + // assert(*(hm.sources_begin()) == source); + assert(source == *(hm.sources_begin())); assert(hm.remove_source(source)); assert((hm.get_sources()).empty()); assert(hm.add_source(*(vertices(sm).first))); - assert(*(hm.sources_begin()) == source); - assert(hm.add_source(*(std::next(vertices(sm).first,3)))); - assert(source != *(std::next(vertices(sm).first,3))); - assert(*(hm.sources_begin()) == source); + assert(source == *(hm.sources_begin())); + assert(hm.add_source(*(NEXT(vertices(sm).first,3)))); + assert(source != *(NEXT(vertices(sm).first,3))); + assert(source == *(hm.sources_begin())); assert(!(hm.add_source(source))); - assert(hm.remove_source(*(std::next(vertices(sm).first,3)))); + assert(hm.remove_source(*(NEXT(vertices(sm).first,3)))); } @@ -114,6 +128,7 @@ void check_no_update(const Idt& sm, const Vertex_distance_map& original, const V #endif + int main(int argc, char*argv[]) { Surface_mesh sm; @@ -127,23 +142,19 @@ int main(int argc, char*argv[]) Vertex_distance_map vdm = get(Vertex_distance_tag(),sm); Idt idt(sm, vdm); - //source set tests Heat_method hm(idt, idt.vertex_distance_map()); hm.add_source(* vertices(sm).first); - boost::graph_traits::vertex_descriptor vd = *(hm.sources_begin()); - assert(vd == * vertices(sm).first); - hm.update(); - + BOOST_FOREACH(boost::graph_traits::vertex_descriptor vd, vertices(sm)){ std::cout << get(vdm,vd) << std::endl; } - // source_set_tests(hm,idt); + source_set_tests(hm,idt); #if 1 @@ -176,6 +187,7 @@ int main(int argc, char*argv[]) Eigen::VectorXd solved_dist = hm.solve_phi(c, XD,4); #endif - + return 0; } +