常规三角剖分中插入带

常规三角剖分中插入带

本文介绍了在CGAL常规三角剖分中插入带信息的加权点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正面临一个我希望其他人以前遇到过的问题,因为我找不到出路!

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

我在CGAL中有一个常规的三角剖分我想一一插入一些加权信息info std :: pair< myweightpoint,myinfo> 并获得顶点的句柄( Vertex_handle )一旦插入!问题是没有这样的功能。它存在几个要插入的函数:

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 :


  • Vertex_handle (const Weighted_point& p);

  • Vertex_handleRegular_triangulation::insert( const Weighted_point & p ) ;

返回 Vertex_handle 很酷,但是不会对INFO进行加权,这对我以及这些顶点的处理非常重要。

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.


  • std :: ptrdiff_t (首先是WeightedPointWithInfoInputIterator,最后是WeightedPointWithInfoInputIterator);

  • std::ptrdiff_tRegular_triangulation::insert( WeightedPointWithInfoInputIterator first, WeightedPointWithInfoInputIterator last ) ;

我可以在其中插入一些带有信息的加权点(这很好),但是没有给我一个插入顶点的句柄。而且,由于我一次插入一个点,所以现在我正在做这样的事情:

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.

非常感谢。

推荐答案

您可以做的是:

Vertex_handle v = rt.insert(wp);
v->info()=the_info;

这篇关于在CGAL常规三角剖分中插入带信息的加权点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-01 23:49