Subject: CGAL users discussion list
List archive
- From: "Sebastien Loriot (GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] indices of faces, halfedges, vertices
- Date: Wed, 28 Apr 2010 09:56:54 +0200
Mohamed Yousef wrote:
space isn't a problemMaybe I was not clear.
but the problem is that , with deletion of faces/edges/vertices , the two vectors will be immediately invalidated
and you will have to reconstruct them again from beginning
what is more problematic is that , even if you decided to monitor all deletion/addition and try to make partial reconstruction of
vectors , you will have to mimic and analyze all inner/low level half edge operations to update your vectors accordingly (may be by a custom half-edge that does this extra work for every operation )
Regards,
Mohamed Yousef
You can use the list based HDS to have support for removal
and in parallel maintain your vector of handles.
Then I might not get your problem but from what I understand, I see no "inner/low level half-edge operations" except maintaining the vector of handles.
If I am wrong, can you please state what you expect to be done using the
polyhedron class (your requirements).
S.
On 27 April 2010 15:25, Sebastien Loriot (GeometryFactory) <sloriot.ml <http://sloriot.ml>@gmail.com <http://gmail.com>> wrote:
Mohamed Yousef wrote:
The real problem with solutions like this , is that it's built
by hand
and every time you update P , you will have to go through the
very lengthy process of updating id's
the only real solution is to use Vector based Polyhedron's
instead of List ones , but those are limited and more importantly
doesn't support deleting nodes
this problem is a real weak point of cgal , facing applications
that require regular , random update of Polyhedron and need
random access / indices
If space is not a problem, maybe you can use an additional vector of
handles together with the polyhedron so that you can have random access
as well as direct access. Maintaining in parallel the vector should not
be too expensive (depending on your application).
S.
Regards,
Mohamed Yousef
On 27 April 2010 14:45,
<
<mailto:>
<mailto:
<mailto:>>>
wrote:
Thank you.
Le 27/04 - 14:02, Sebastien Loriot (GeometryFactory) a écrit :
>
<mailto:>
<mailto:
<mailto:>>
wrote:
> >It's what I want.
> >But it seems that by default the vertex class has no
member id.
> >Is there an option ?
>
> Have a look at this item class
> CGAL/Polyhedron_items_with_id_3.h
>
> Facets, halfedges and vertices will have an id.
>
> S.
>
> >
> >Le 27/04 - 11:49, Sebastien Loriot (GeometryFactory) a
écrit :
>
>>
<mailto:>
<mailto:
<mailto:>>
wrote:
> >>>I have a polyhedron P.
> >>>And I want to associate to each face an index : the
distance from
> >>>P->facets_begin() to the iterator pointing to the face (for
example).
> >>>
> >>>Now, given a halfedge h, I would like to know the number of
h.facets().
> >>>I tried std::distance(P.facets_begin(), h.facets()) but it
doesn't work
> >>>since one is an iterator and the other a handle.
> >>>
> >>>Is there a simple way to do that ?
> >>>
> >>Is something like this a correct solution for your problem?
> >>
> >>unsigned i=0
> >>for (Polyhedron::Facet_iterator
> >>it=P.facets_begin();it!=P.facets_end();++it){
> >> it->id()=i++;
> >>}
> >>
> >>S.
> >
>
>
> --
> You are currently subscribed to cgal-discuss.
> To unsubscribe or access the archives, go to
> https://lists-sop.inria.fr/wws/info/cgal-discuss
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss
-- You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss
- [cgal-discuss] indices of faces, halfedges, vertices, cc . ld, 04/27/2010
- Re: [cgal-discuss] indices of faces, halfedges, vertices, Sebastien Loriot (GeometryFactory), 04/27/2010
- Re: [cgal-discuss] indices of faces, halfedges, vertices, cc . ld, 04/27/2010
- Re: [cgal-discuss] indices of faces, halfedges, vertices, Sebastien Loriot (GeometryFactory), 04/27/2010
- Re: [cgal-discuss] indices of faces, halfedges, vertices, cc . ld, 04/27/2010
- Re: [cgal-discuss] indices of faces, halfedges, vertices, Mohamed Yousef, 04/27/2010
- Re: [cgal-discuss] indices of faces, halfedges, vertices, Sebastien Loriot (GeometryFactory), 04/27/2010
- Re: [cgal-discuss] indices of faces, halfedges, vertices, Mohamed Yousef, 04/27/2010
- Re: [cgal-discuss] indices of faces, halfedges, vertices, Sebastien Loriot (GeometryFactory), 04/28/2010
- Re: [cgal-discuss] indices of faces, halfedges, vertices, Mohamed Yousef, 04/29/2010
- Re: [cgal-discuss] indices of faces, halfedges, vertices, Sebastien Loriot (GeometryFactory), 04/27/2010
- Re: [cgal-discuss] indices of faces, halfedges, vertices, Mohamed Yousef, 04/27/2010
- Re: [cgal-discuss] indices of faces, halfedges, vertices, cc . ld, 04/27/2010
- Re: [cgal-discuss] indices of faces, halfedges, vertices, Sebastien Loriot (GeometryFactory), 04/27/2010
- Re: [cgal-discuss] indices of faces, halfedges, vertices, cc . ld, 04/27/2010
- Re: [cgal-discuss] indices of faces, halfedges, vertices, Sebastien Loriot (GeometryFactory), 04/27/2010
Archive powered by MHonArc 2.6.16.