그래서 나는 CGAL의 find_conflicts 함수에 대해 매우 혼란스러워합니다. 나는 std :: pair를 알았고 find_conflicts()에서 무슨 일이 벌어지고 있는지 알았지 만, 내 인생에서 어떻게 결과에 접근 할 지 확신하지 못했습니다. 필자는 find_conflicts에 전달 된 반복자가 값에 직접 액세스하는 것으로 충분하다고 생각했습니다. (즉, 나는 ", 벡터면"나는에 넣어 그면에서 싶어)와 내가 뭘 것처럼 나타납니다 그 때문에 내가 할 수있는 성공적으로 요약CGAL : find_conflicts() 결과 액세스
typedef std::pair<std::vector<Facet>, std::vector<Cell> > FacetAndCell;
* * *
Cell_handle cell = T.locate(curr_point);
std::vector<Facet> facets;
T.find_conflicts(curr_point, cell, std::back_inserter(facets), CGAL::Emptyset_iterator());
CGAL::First_of_pair_property_map<FacetAndCell> my_p_map();
Delaunay::Finite_facets_iterator ff_iter;
std::vector<Facet>::iterator facet_iter;
// Here, what I'm trying to achieve is figuring out which of the facets
// in conflict are finite. I had wanted to use some kind of test like
// "is_infinite()" on the facet at hand, but this isn't available for
// a facet out of context of the triangulation it's part of.
for(facet_iter = facets.begin(); facet_iter != facets.end(); facet_iter++){
for(ff_iter = T.finite_facets_begin(); ff_iter != T.finite_facets_end(); ff_iter++){
// Since I get an error that facet_iter is actually of type pair, I thought this would work, but it doesn't.
// ERROR!
cout << facet_iter->first << endl;
// This works, which is what led me to believe I was comparing one facet to another facet.
/*
if(*facet_iter == *ff_iter){
cout << "Finite facet!" << endl;
break;
}*/
}
}
:
1) 전반적으로, 나는 find_conflicts()의 결과에서 어떤 패싯이 유한한지 알고 싶습니다. 이 작업을 수행하는 더 쉬운 방법이 있다면 알려 주시기 바랍니다.
2) 그렇지 않으면 더 구체적인 문제는 find_conflicts()에서 결과를 얻은 패싯 벡터를 얻고 각 패싯의 꼭지점에 도달해야한다는 것입니다. 나는 셀과 패싯의 리턴 된 "쌍"으로 작업해야하는데, 그렇지 않으면 벡터에 직접 액세스 할 수 있습니까?
도움말, 감사합니다.
아, 네. 너는 나의 진짜 오해를 알아내는 것이 좋다. 그것은 후자였습니다. 그래서 패싯은 패싯이 반대하는 셀 버텍스를 지시하는 셀 및 셀의 버텍스 인덱스에 의해 설명됩니다 ... 패싯은 3D Delaunay 삼각 측량에서 필연적으로 삼각형입니다, 맞습니까? – kdottiemo