Subject: CGAL users discussion list
List archive
- From: "Sebastien Loriot (GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] Triangulation_2 with info
- Date: Mon, 02 Apr 2012 08:50:55 +0200
If you look at that page:
http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Triangulation_2_ref/Class_Triangulation_2.htm
you'll see that the insert function taking an iterator range
can only have a point as value_type (which is not the case for Delaunay).
Sebastien.
On 04/02/2012 05:23 AM, edward wrote:
Hi, everyone,
I had a problem on using Triangulation_2 with
Triangulation_vertex_base_with_info_2.
Here are main codes:
typedef CGAL::Exact_predicates_inexact_constructions_kernel CEPIC_K;
typedef CGAL::Triangulation_vertex_base_with_info_2<unsigned int, CEPIC_K>
Vb2Uint;
typedef CGAL::Triangulation_data_structure_2<Vb2Uint>
TdsVb2Uint;
typedef CGAL::Delaunay_triangulation_2<CEPIC_K, TdsVb2Uint>
DelaunayInfoUint_2;
typedef CGAL::Triangulation_2<CEPIC_K, TdsVb2Uint>
TriangulationInfoUint_2;
void function(vector<Point_3> &pts)
{
vector< pair<Point_2, unsigned int> >pointsUint(pts.size());
for(unsigned int i=0;i<pts.size();++i)
{
pointsUint[i]= pair<Point_2, unsigned int>(Point_2(pts[i].x(),
pts[i].y()), i);
}
TriangulationInfoUint_2 dtInfoUint;
dtInfoUint.insert( pointsUint.begin(), pointsUint.end());
if(dtInfoUint.number_of_vertices()==0)
{
cout<<"Error! Number of vertices is 0!"<<endl;
return;
}
}
If I use DelaunayInfoUint_2, then this funciton works well. But if I use
TriangulationInfoUint_2 instead of DelaunayInfoUint_2, the compiler reports
error like this:
error C2664: 'CGAL::Point_2<R_>::Point_2(const CGAL::Origin&)' : cannot
convert parameter 1 from 'std::pair<_Ty1,_Ty2>' to 'const CGAL::Origin&'
1>
with
1> [
1> R_=CGAL::Epick
1> ]
1> and
1> [
1> _Ty1=Point_2,
1> _Ty2=unsigned int
1> ]
1> Reason: cannot convert from 'std::pair<_Ty1,_Ty2>' to 'const
CGAL::Origin'
1> with
1> [
1> _Ty1=Point_2,
1> _Ty2=unsigned int
1> ]
1> No user-defined-conversion operator available that can perform
this conversion, or the operator cannot be called
In my opinion, it seems that for Triangulation_2, structure
Triangulation_vertex_base_with_info_2 does not work.
Am I rigth? Or does my codes have some falts?
Hope you could help
Best regards
Edward
--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Triangulation-2-with-info-tp4525119p4525119.html
Sent from the cgal-discuss mailing list archive at Nabble.com.
- [cgal-discuss] Triangulation_2 with info, edward, 04/02/2012
- Re: [cgal-discuss] Triangulation_2 with info, Sebastien Loriot (GeometryFactory), 04/02/2012
- [cgal-discuss] Re: Triangulation_2 with info, edward, 04/02/2012
- [cgal-discuss] 3D mesh with surface preserved, Martin Vymazal, 04/03/2012
- Re: [cgal-discuss] 3D mesh with surface preserved, Sebastien Loriot (GeometryFactory), 04/03/2012
- [cgal-discuss] 3D mesh with surface preserved, Martin Vymazal, 04/03/2012
- [cgal-discuss] Re: Triangulation_2 with info, edward, 04/02/2012
- Re: [cgal-discuss] Triangulation_2 with info, Sebastien Loriot (GeometryFactory), 04/02/2012
Archive powered by MHonArc 2.6.16.