将 Vertex_handles 获取到 delaunay 三角剖分的点

发布于 2024-10-02 23:17:18 字数 534 浏览 0 评论 0原文

我想迭代 CGAL::Delaunay_triangulation_2 的所有顶点,但无法找到有关获取所有顶点句柄的文档。

我为此找到的文档解释了如何迭代三角测量。

typedef CGAL::Delaunay_triangulation_2<K> T;
typedef T::Vertex_handle Vh;
typedef T::Vertex_iterator Vi;
for (Vi vi = g.vertices_begin(); vi != g.vertices_end(); vi++) {
    // Vh v = how can I get this?
}

但是,我找不到有关如何从迭代器获取 Vertex_handle 的文档

I want to iterate through all vertices of a CGAL::Delaunay_triangulation_2, but am unable to find documentation about getting all the vertex handles.

The documentation I found for this explained how to iterate through the triangulation.

typedef CGAL::Delaunay_triangulation_2<K> T;
typedef T::Vertex_handle Vh;
typedef T::Vertex_iterator Vi;
for (Vi vi = g.vertices_begin(); vi != g.vertices_end(); vi++) {
    // Vh v = how can I get this?
}

However, I cannot find documentation about how to get to the Vertex_handle from the iterator

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

听风念你 2024-10-09 23:17:18

好吧,我只是愚蠢。尝试了一些更随机的事情,发现迭代器实际上是句柄。当然,我在这里写完整篇文章后发现了这一点:-)

typedef CGAL::Delaunay_triangulation_2<K> T; 
typedef T::Vertex_handle Vh; 
typedef T::Vertex_iterator Vi; 
for (Vi vi = g.vertices_begin(); vi != g.vertices_end(); vi++) { 
    Vh v = vi;
} 

Okay I was just stupid. Tried some more random things and got that the iterator actually is the handle. Of course I find this out after writing the whole post here :-)

typedef CGAL::Delaunay_triangulation_2<K> T; 
typedef T::Vertex_handle Vh; 
typedef T::Vertex_iterator Vi; 
for (Vi vi = g.vertices_begin(); vi != g.vertices_end(); vi++) { 
    Vh v = vi;
} 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文