在將點添加到三角函數對象之前,可以將信息(如整數)附加到點。我這樣做是因爲我一方面需要一個int標誌,我稍後用它來定義我的紋理座標,另一方面我使用了一個索引,以便我可以創建索引的VBO。 http://doc.cgal.org/latest/Triangulation_2/Triangulation_2_2info_insert_with_pair_iterator_2_8cpp-example.htmlCGAL:2D約束Delaunay三角剖分 - 向約束添加信息
但不是點我只想插入約束邊。如果我插入兩個CGAL返回奇怪的結果,因爲點已經被輸入兩次(一次爲點,一次爲約束邊的點)。 http://doc.cgal.org/latest/Triangulation_2/Triangulation_2_2constrained_8cpp-example.html
是否可以像點信息一樣連接到「約束條件」,以便我只能在迭代所得到的面之前使用此函數cdt.insert_constraint(Point(j,0), Point(j,6));
?
lateron當我循環三角形時,我需要一些方法來訪問我之前定義的int標誌。像acutal點,但受約束定義段的「目的」這個而不是邊緣:
for(CDT::Finite_faces_iterator fit = m_cdt.finite_faces_begin(); fit != m_cdt.finite_faces_end(); ++fit, ++k) {
int j = k*3;
for(int i=0; i < 3; i++) {
indices[j+i] = fit->vertex(i)->info().first;
}
}
這個問題的另外一個問題我張貼在這裏的一部分:Constrained (Delaunay) Triangulation。 由於這是它自己的問題,我獨立發佈了第二次。
貌似我終於解決了!遵循以下說明: http://doc.cgal.org/latest/Kernel_23/index.html#sectionextensiblekernel – HesselKRaymond
您可以發表一個自己的答案,並說明您的解決方案嗎?我不確定你的評論中是否有描述。 – lrineau