【问题标题】:Insertion of weighted point with info in CGAL regular triangulation在 CGAL 正则三角剖分中插入带有信息的加权点
【发布时间】:2015-06-27 05:14:19
【问题描述】:

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

我在 CGAL 中有一个常规的三角测量,我希望在其中插入一些带有信息 std::pair<myweightpoint, myinfo> 的加权点,并在插入后获取顶点的句柄(Vertex_handle)!问题是没有这样的功能。它存在几个要插入的函数:

这会返回一个Vertex_handle,这很酷,但不采用 WITH INFO 加权点,这对我以及我对这些顶点的处理非常重要。

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

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

这看起来真的很脏。所以,我的问题是:为什么没有这样的功能:

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

以及如何在常规三角剖分中插入带有信息的加权点并获取插入顶点​​的句柄。

非常感谢。

【问题讨论】:

    标签: c++ insert triangulation cgal weighted


    【解决方案1】:

    你可以做的是:

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

    【讨论】:

    • 完美!刚刚好 !
    猜你喜欢
    • 1970-01-01
    • 2019-12-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-08-05
    • 2020-05-06
    • 2016-02-25
    • 2013-11-19
    相关资源
    最近更新 更多