2014-06-23 2 views
0

그래서 나는 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()에서 결과를 얻은 패싯 벡터를 얻고 각 패싯의 꼭지점에 도달해야한다는 것입니다. 나는 셀과 패싯의 리턴 된 "쌍"으로 작업해야하는데, 그렇지 않으면 벡터에 직접 액세스 할 수 있습니까?

도움말, 감사합니다.

답변

0

고급 테스트를 위해 is_infinite()을 사용하십시오. http://doc.cgal.org/latest/Triangulation_3/classCGAL_1_1Triangulation__3.html#af024721d3ae4b9327ffe442fb828935c

그렇지 않으면 패싯 유형이 한 쌍의 typedef이기 때문에 혼란 스러울 수도 있습니다 (불행히도).

추 신 : 다른 방법으로 Marc Glisse의 제안을 사용할 수도 있습니다 (locate (midpoint (p, sphere center))). 더 쉬울 수도 있습니다. CGAL Using Locate() to Find Cell on Triangulation Surface

+0

아, 네. 너는 나의 진짜 오해를 알아내는 것이 좋다. 그것은 후자였습니다. 그래서 패싯은 패싯이 반대하는 셀 버텍스를 지시하는 셀 및 셀의 버텍스 인덱스에 의해 설명됩니다 ... 패싯은 3D Delaunay 삼각 측량에서 필연적으로 삼각형입니다, 맞습니까? – kdottiemo