Subject: CGAL users discussion list
List archive
- From: Shuchu Han <>
- To:
- Subject: Re: [cgal-discuss] Edge with info
- Date: Tue, 3 Nov 2009 21:15:40 +0800
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=QWs3XbrQiAEmRUV3/R+b+fW+W4Gy8EwYrS/iBFTbA2tLNBrcfswiE7nhp5m9Cs/YUZ bdlFNfY/XiaJTEMkHmVFYRvuRoYmUN2lzVKM7wACRLJjXpaYkt6GdA+r+09OQ2KsZ6wK ug3i8r3ANXfVZbL1LrlcjG2Mv/OV8yoTjoJAg=
Hi, Daniel
I faced this problem before and maybe my idea can give you some hints. ( although it is not a good one );
Mainly, I explicit construct an Edges data using Hash_map;
/*---------------------------------------------------------------------------*/
typedef CGAL::Triangulation_3<Kernel> T3;
typedef std::pair<T3::Vertex_handle, T3::Vertex_handle> MyEdge;
struct my_hash_function{
typedef std::size_t result_type;
std::size_t operator() (const MyEdge& h) const {
std::size_t seed(0);
boost::hash_combine(seed, (h.first)->id());
boost::hash_combine(seed, (h.second)->id());
return seed;
}
};
CGAL::Unique_hash_map<MyEdge,double, my_hash_function> edge_tag;
/*---------------------------------------------------------------------------*/
I use Finite_edges_iterator to build the data; parser the information of CGAL::Triangulation_3::Edge
when look up an edge in the hash map; I double check the exist of the edge:
// as an Edge is constructed by two Vertex_handle:
MyEdge edge_0(Vertex_handle_0, Vertex_handle_1);
MyEdge edge_1(Vertex_handle_1, Vertex_handle_0);
edge_tag.is_define(edge_0);
edge_tag.is_define(edge_1);
---end
Wish it is helpful!
best regards
shuchu
On Tue, Nov 3, 2009 at 6:41 PM, Daniel Duque <> wrote:
Hello,
I am thinking about efficiently adding info to the edges of a triangulation.
E.g., imagine you frequently need their lengths, and do not want to compute
them each time you need them, just once when the triangulation is built.
Since edges are not explicitly represented, I had the idea of using
Cell_circulator tds.incident_cells ( Edge e) Starts at an arbitrary cell
incident to e
to get one cell incident to an edge. The cell could be provided with info
relevant to the edge. E.g., a simple way would be to keep a 4x4 matrix, with
element i,j giving the info for the vertex with indices i,j.
My question is if this approach is (basically) sensible.
Also, I am assuming the "arbitrary" cell will always be the same one for a
given edge. I would be surprised if this was not the case.
BTW, there was a previous email from "400555 < >" about this
last July, but it did not get any answers.
Best regards,
Daniel
--
Nueva dirección de e-mail!
--
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] Edge with info, Daniel Duque, 11/03/2009
- Re: [cgal-discuss] Edge with info, Manuel Caroli, 11/03/2009
- Re: [cgal-discuss] Edge with info, Daniel Duque, 11/03/2009
- Re: [cgal-discuss] Edge with info, Vitaliy, 11/03/2009
- Re: [cgal-discuss] Edge with info, Manuel Caroli, 11/03/2009
- Re: [cgal-discuss] Edge with info, Daniel Duque, 11/03/2009
- Re: [cgal-discuss] Edge with info, Daniel Duque, 11/03/2009
- Re: [cgal-discuss] Edge with info, Vitaliy, 11/03/2009
- Re: [cgal-discuss] Edge with info, Sylvain Pion, 11/03/2009
- Re: [cgal-discuss] Edge with info, Shuchu Han, 11/03/2009
- Re: [cgal-discuss] Edge with info, Manuel Caroli, 11/03/2009
Archive powered by MHonArc 2.6.16.