Subject: CGAL users discussion list
List archive
- From: "Christian Friedrich" <>
- To:
- Subject: Re: [cgal-discuss] Re: Triangulation_vertex_base_with_info_3<int, K> problem
- Date: Tue, 19 Feb 2008 11:24:45 +0100
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:references; b=xoXB+yl8S7mXMlskXF24KTxiYe8Y01atlglJUGATmz3IWHERU+018Na8/syzIQSp7NXAv9vkaxLMSlc1bzI1mPmPmH5kee3IU0YUFqT/kiDhkxD5GzfeRCa8ys2S6+45/h7gDusWIGLRTB2yFoAHs8jjahq9Ljh51Fg5Rv8cOBo=
Manuel,
thanks a lot, this solved my problem!
Daniel,
thank you for your suggestion as well, that part of the code was fine though - it stores the integers in the array correctly
Cheers,
Christian
On Feb 19, 2008 11:16 AM, Manuel Caroli <> wrote:
Dear Christian,
I'm not sure whether I understood your problem right. Especially it is
not clear to me what makes you think that the info is wrong...
So that's the answer to the question as I understood it:
I think the problem is that you assume the finite vertices iterator
iterating over all vertices in exactly the same order in which you
inserted it. However, this is not necessarily true.
The simplest solution would be to construct the triangulation point by
point, i.e. something likeDh::Vertex_handle vh = T->insert(
for (int i =0; i<vcount; i++) {
input_mesh->GetVertexPosition(i,&vPos);Dh::Point((double)vPos.x,(double)vPos.y, (double)vPos.z));vh->info() = i;
}
hope this helps
best
Manuel
wrote:
> I still don't have a solution to my problem. Maybe the vertex info does work well, but there's something wrong in the way i set it.
>
> I want to save with each Vertex next to its coordinate its index in the point set it originates from, so i can retrieve the indices of the vertices for each cell.
>
> This worked well with the older version of CGAL. Could there be anything wrong now in the way i assign the vertex info?
> ===============================================================
> Dh m_T;
> Dh *T = &m_T;
> T->clear();
>
> VxVector vPos;
> std::list<Dh::Point> L;
>
> int vcount=input_mesh->GetVertexCount();
> for (int i =0; i<vcount; i++) {
> input_mesh->GetVertexPosition(i,&vPos);
> L.push_back(Dh::Point((double)vPos.x,(double)vPos.y, (double)vPos.z));
> }
> T->insert(L.begin(), L.end());
> L.clear();
>
> Dh::Finite_vertices_iterator vit;
> int index=0;
> for (vit = T->finite_vertices_begin(); vit != T->finite_vertices_end();
> ++vit){
> vit->info() = index;
> ++index;
> }
> ==============================================================
>
> And, is there another way to retrieve the index (position within the list of all vertices) of a vertex from the vertex handle?
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss
--
Best Regards,
Christian Friedrich MSc ing
Phd candidate
Technische Universiteit Delft
Hyperbody
www.hyperbody.bk.tudelft.nl
Berlageweg 1
2628 CR Delft
kab. 1.37
T: +31 (0)15 27 85954
M: +31 (0)6 16 43 1661
E:
- Triangulation_vertex_base_with_info_3<int, K> problem, h . c . friedrich, 02/15/2008
- <Possible follow-up(s)>
- Re: Triangulation_vertex_base_with_info_3<int, K> problem, h . c . friedrich, 02/19/2008
- Re: [cgal-discuss] Re: Triangulation_vertex_base_with_info_3<int, K> problem, Daniel Duque Campayo, 02/19/2008
- Re: [cgal-discuss] Re: Triangulation_vertex_base_with_info_3<int, K> problem, Manuel Caroli, 02/19/2008
- Re: [cgal-discuss] Re: Triangulation_vertex_base_with_info_3<int, K> problem, Christian Friedrich, 02/19/2008
- Re: [cgal-discuss] Re: Triangulation_vertex_base_with_info_3<int,K> problem, Daniel Duque Campayo, 02/19/2008
- Re: [cgal-discuss] Re: Triangulation_vertex_base_with_info_3<int,K> problem, Daniel Duque Campayo, 02/20/2008
Archive powered by MHonArc 2.6.16.