From 09e42c760e662007625c75fa1ad571c07e8b3a09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 19 Dec 2012 10:52:56 +0100 Subject: [PATCH] fix source vertex and face types --- .../include/CGAL/Triangulation_data_structure_2.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Triangulation_2/include/CGAL/Triangulation_data_structure_2.h b/Triangulation_2/include/CGAL/Triangulation_data_structure_2.h index 9c7f609ce9c..46be609f233 100644 --- a/Triangulation_2/include/CGAL/Triangulation_data_structure_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_data_structure_2.h @@ -1776,8 +1776,7 @@ copy_tds(const TDS_src& tds_src, const ConvertVertex& convert_vertex, const ConvertFace& convert_face) { - if (this == &tds_src) return Vertex_handle(); - if (vert != Vertex_handle()) + if (vert != typename TDS_src::Vertex_handle()) CGAL_triangulation_precondition( tds_src.is_vertex(vert)); clear(); @@ -1790,11 +1789,11 @@ copy_tds(const TDS_src& tds_src, if(n == 0) {return Vertex_handle();} //initializes maps - Unique_hash_map vmap; - Unique_hash_map fmap; + Unique_hash_map vmap; + Unique_hash_map fmap; // create vertices - Vertex_iterator vit1 = tds_src.vertices_begin(); + typename TDS_src::Vertex_iterator vit1 = tds_src.vertices_begin(); for( ; vit1 != tds_src.vertices_end(); ++vit1) { Vertex_handle vh = create_vertex( convert_vertex(*vit1) ); vmap[vit1] = vh; @@ -1802,7 +1801,7 @@ copy_tds(const TDS_src& tds_src, } //create faces - Face_iterator fit1 = tds_src.faces().begin(); + typename TDS_src::Face_iterator fit1 = tds_src.faces().begin(); for( ; fit1 != tds_src.faces_end(); ++fit1) { Face_handle fh = create_face( convert_face(*fit1) ); fmap[fit1] = fh; @@ -1827,7 +1826,7 @@ copy_tds(const TDS_src& tds_src, // remove the post condition because it is false when copying the // TDS of a regular triangulation because of hidden vertices // CGAL_triangulation_postcondition( is_valid() ); - return (vert == Vertex_handle()) ? Vertex_handle() : vmap[vert]; + return (vert == typename TDS_src::Vertex_handle()) ? Vertex_handle() : vmap[vert]; } //utilities for copy_tds @@ -1865,6 +1864,7 @@ Triangulation_data_structure_2:: copy_tds(const Tds &src, Vertex_handle vh) // return the vertex corresponding to vh in the new tds { + if (this == &src) return Vertex_handle(); internal::TDS_2::Default_vertex_converter setv; internal::TDS_2::Default_face_converter setf; return copy_tds(src,vh,setv,setf);