Subject: CGAL users discussion list
List archive
- From: "Jens K. Becker" <>
- To:
- Subject: Re: [cgal-discuss] Range or segment trees for point data
- Date: Wed, 10 Sep 2008 11:54:22 +0200
Ah-haha, how embarrassing....
yes, a multimap would certainly be the thing to use. Why didn't I think of it?
Much simpler and does exactly what I need.
Thanks, very much appreciated!
Jens
--
Dr. J.K. Becker
University of Tuebingen - Institute for Geoscience
Sigwartst. 10 - 72076 Tuebingen (Germany)
Tel.: ++49 7071 29 73139 Fax: +49 7071 5059
web: http://www.jkbecker.de
Quoting Andreas Fabri
<>:
Hi Jens,
A std::multimap<Point_3, Polyhedron::Vertex_handle> should do it.
You traverse all vertices of all polyhedra and insert the point and
vertex in the map.
When you want to change the coordinates of one point, the multimap
will give you all vertices that have a copy.
A completely differnent approach miht be not to store points in
the polyhedron, but pointers to one point, So when you change the
coordinated of this point, you have changed it for all vertices.
But that needs programming some point proxy.
andreas
Jens K. Becker wrote:
Hi all,
I am a bit at a loss with the concepts of range and segment trees and how to use
them. Therefore, I guess it is easiest to try and explain what I want to do...
I have a number of polyhedra that do not overlap and there are no gaps between
them. I triangulate them so that the different triangles making up the
polyhedra are shared between 2 (or more) neighbouring polyhedra. This means
that each point (vertex) is in the list at least twice, but can be there more
often (in case 3 or more polyhedra share a point). What I want to do is to be
able to quickly change the coordinates of a point (vertex). The brute-force
method would be to go through the list of all points of all polyhedra, check
the coordinates and change them if necessary. This would take a long time. It
would be better to have a tree structure so that with a single query I would
find all points at once. The problem is that after changing the coordinates of
these points, they have to be reinserted into the tree and the old ones
deleted. And I cant figure out if CGAl can do that.
I have written my own template to do this and it works, but bugs a lot due to
memory leaks (might be related to GMPZ though, not sure and really hard to
debug). So I am thinking about using an already made tree structure or so from
CGAL. Is that possible? Can I find, delete and reinsert elements (leafs) into
an already existing tree in CGAL?
Thanks for your help,
Jens Becker
--
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] quadric error simplification is extremely slow., Shi Yan, 09/10/2008
- [cgal-discuss] Range or segment trees for point data, Jens K. Becker, 09/10/2008
- Re: [cgal-discuss] Range or segment trees for point data, Andreas Fabri, 09/10/2008
- Re: [cgal-discuss] Range or segment trees for point data, Jens K. Becker, 09/10/2008
- Re: [cgal-discuss] Range or segment trees for point data, Andreas Fabri, 09/10/2008
- [cgal-discuss] Range or segment trees for point data, Jens K. Becker, 09/10/2008
Archive powered by MHonArc 2.6.16.