Insertion of weighted point with info in CGAL regu

2019-04-15 08:09发布

I'm facing a problem that I hope some others have faced before because I can't find a way out !

I have a regular triangulation in CGAL in which I wish to insert some weighted points with info std::pair<myweightpoint, myinfo> one by one and to get the handle to the vertex (Vertex_handle) once it is inserted ! The thing is that there is no such function. It exists several functions to insert :

That returns a Vertex_handle which is cool but does not take weighted points WITH INFO which is very important for me and what I do with those vertices.

Which allows me to insert some weighted points with info (which is good) but doesn't gives me a handle to the inserted vertex. Moreover, since I am inserting points one at a time, for now I'm doing things like this :

v_wpoints.resize(1) ;
v_wpoints[0] = std::make_pair(myweightpoint, myinfo) ;
rt.insert(v_wpoints.begin(), v_wpoints.end()) ;

which seems really dirty. So, my questions are : why isn't there a function like that :

Vertex_handle Regular_triangulation::insert( const Weighted_point_with_info & p ) ;

and how can I do to insert a weighted point with info in the regular triangulation and get the handle to the vertex inserted.

Thanks a lot.

1条回答
混吃等死
2楼-- · 2019-04-15 08:27

What you can do is:

Vertex_handle v = rt.insert(wp);
v->info()=the_info;
查看更多
登录 后发表回答