8
我在獲取Delaunay三角剖分中每個邊的每個端點的vertex_handle時遇到了一些困難。自從我敲我的頭這幾個小時,我想,也許你一個人可以幫助我這個表面上很重要的問題:從edge_iterator獲取vertex_handle
#include <iostream>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Delaunay_triangulation_2.h>
using namespace std;
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Delaunay_triangulation_2<K> Triangulation;
typedef Triangulation::Point Point;
typedef Triangulation::Edge_iterator Edge_iterator;
typedef Triangulation::Vertex_handle Vertex;
int main(){
Point p;
Triangulation t;
while(cin >> p)
t.insert(p);
// Iterate over edges
for(Edge_iterator ei=t.finite_edges_begin();ei!=t.finite_edges_end(); ei++){
// Get a vertex from the edge
Vertex vs = ei->source();
}
}
根據文檔訪問一個Edge_iterator我應該得到一個Edge_handle和Edge_handle應該有成員source()和target()只是獲取端點,但它不會編譯並且似乎是錯誤的。像上面那樣去除反彈會給我一對<>,它沒有那些成員函數。
任何想法我做錯了什麼?
編譯失敗的地方在哪裏? – payne 2011-01-29 13:48:00
這就是(ei *)是類型對,顯然沒有源()。 – cdecker 2011-01-29 13:52:10