diff --git a/SMDS_3/examples/SMDS_3/tetrahedron_soup_to_c3t3_example.cpp b/SMDS_3/examples/SMDS_3/tetrahedron_soup_to_c3t3_example.cpp index a4ede84a1ee..aa62bd89398 100644 --- a/SMDS_3/examples/SMDS_3/tetrahedron_soup_to_c3t3_example.cpp +++ b/SMDS_3/examples/SMDS_3/tetrahedron_soup_to_c3t3_example.cpp @@ -69,8 +69,7 @@ int main(int , char* []) //build a C3T3 C3T3 c3t3; - c3t3.triangulation() = tr; - c3t3.rescan_after_load_of_triangulation(); + c3t3.set_triangulation(tr); std::cout << "Number of corners: " << c3t3.number_of_corners() << std::endl; std::cout << "Number of edges: " << c3t3.number_of_edges() << std::endl; diff --git a/SMDS_3/include/CGAL/Mesh_complex_3_in_triangulation_3.h b/SMDS_3/include/CGAL/Mesh_complex_3_in_triangulation_3.h index 6255bb26104..fffdb9686a9 100644 --- a/SMDS_3/include/CGAL/Mesh_complex_3_in_triangulation_3.h +++ b/SMDS_3/include/CGAL/Mesh_complex_3_in_triangulation_3.h @@ -351,6 +351,14 @@ public: far_vertices_.clear(); } + /** sets the internal triangulation to \p tr + */ + void set_triangulation(const Triangulation& tr) + { + tr_ = tr; + rescan_after_load_of_triangulation(); + } + /** adds cell \p cell to the 3D complex, with subdomain index \p index */ void add_to_complex(const Cell_handle& cell, const Subdomain_index& index)