CGAL: Поддерживается ли разбиение 2D-полигонов ядром epeck?

Я хотел бы использовать выпуклое разбиение CGAL в приложении, основанном на ядре epeck, но при попытке его скомпилировать возникает следующая ошибка:

ошибка:

 no matching constructor for initialization of 'CGAL::Partition_vertex<CGAL::Partition_traits_2<CGAL::Epeck> >'

Простой тестовый пример для этого - взять, например, greene_approx_convex_partition_2.cpp пример из дистрибутива и попытаться изменить параметризацию ядра на epeck.

Поддерживаются ли / могут ли 2D convex partitioning подпрограммы в epeck ядре? Любые указатели или советы очень ценятся!

большое спасибо,


person FritzM    schedule 11.01.2014    source источник


Ответы (2)


Вот обходной путь:


--- a/include/CGAL/Partition_2/Indirect_edge_compare.h
+++ b/include/CGAL/Partition_2/Indirect_edge_compare.h
@@ -69,7 +69,7 @@ class Indirect_edge_compare
         else 
         { 
            // construct supporting line for edge
-           Line_2  line = _construct_line_2(*edge_vtx_1, *edge_vtx_2);
+           Line_2  line = _construct_line_2((Point_2)*edge_vtx_1, (Point_2)*edge_vtx_2);
            return _compare_x_at_y_2(*vertex, line) == SMALLER;
         }
      }               
@@ -98,10 +98,10 @@ class Indirect_edge_compare

         // else neither endpoint is shared
         // construct supporting line
-        Line_2  l_p = _construct_line_2(*p, *after_p);
+        Line_2  l_p = _construct_line_2((Point_2)*p, (Point_2)*after_p);
         if (_is_horizontal_2(l_p)) 
         {
-            Line_2  l_q = _construct_line_2(*q, *after_q);
+            Line_2  l_q = _construct_line_2((Point_2)*q, (Point_2)*after_q);

             if (_is_horizontal_2(l_q))  
             {                         
@@ -130,7 +130,7 @@ class Indirect_edge_compare
             return q_larger_x;
         // else one smaller and one larger
         // construct the other line
-        Line_2 l_q = _construct_line_2(*q, *after_q); 
+        Line_2 l_q = _construct_line_2((Point_2)*q, (Point_2)*after_q); 
         if (_is_horizontal_2(l_q))     // p is not horizontal
         {
             return _compare_x_at_y_2((*q), l_p) == LARGER;
person sloriot    schedule 13.01.2014

Я также заметил, что, хотя greene_approx_convex_partition_2 с epeck приводит к упомянутой выше ошибке компилятора, альтернатива approx_convex_partition_2 прекрасно компилируется с epeck прямо из коробки.

person FritzM    schedule 14.01.2014
comment
Обратите внимание, что CGAL 4.4 будет содержать исправление проблемы. - person sloriot; 15.01.2014