Vanessa's fix for e/a/alphashapes3d-periodic for CGAL 4.11
authorDmitriy Morozov <dmitriy@mrzv.org>
Sun, 26 Nov 2017 18:42:36 -0800
changeset 292 b90319e7126f
parent 291 5d387c35465b
child 293 bc7bd0ac9af6
Vanessa's fix for e/a/alphashapes3d-periodic for CGAL 4.11
examples/alphashapes/alphashapes3d-periodic.hpp
--- a/examples/alphashapes/alphashapes3d-periodic.hpp	Sun Nov 26 12:07:49 2017 -0800
+++ b/examples/alphashapes/alphashapes3d-periodic.hpp	Sun Nov 26 18:42:36 2017 -0800
@@ -218,35 +218,70 @@
     return out;
 }
 
+// FOR CGAL 4.10 use the following code
+//
+// void fill_simplex_set(const Delaunay3D& Dt, AlphaSimplex3D::SimplexSet& simplices)
+// {
+//     // Compute all simplices with their alpha values and attachment information
+//     for(Cell_iterator cur = Dt.cells_begin(); cur != Dt.cells_end(); ++cur){
+//         Delaunay3D::Periodic_tetrahedron ptet = Dt.periodic_tetrahedron(cur);
+//         Delaunay3D::Tetrahedron tet = Dt.tetrahedron(ptet);
+//         RealValue sqrad = CGAL::squared_radius(tet[0], tet[1], tet[2], tet[3]);
+//         simplices.insert(AlphaSimplex3D(*cur, sqrad));
+//     }
+//     rInfo("Cells inserted");
+//     for(Facet_iterator cur = Dt.facets_begin(); cur != Dt.facets_end(); ++cur){
+//         Delaunay3D::Periodic_triangle ptri = Dt.periodic_triangle(*cur);
+//         Delaunay3D::Triangle tri = Dt.triangle(ptri);
+//         RealValue sqrad = CGAL::squared_radius(tri[0], tri[1], tri[2]);
+//         simplices.insert(AlphaSimplex3D(*cur, simplices, Dt, sqrad));
+//     }
+//     rInfo("Facets inserted");
+//     for(Edge_iterator cur = Dt.edges_begin(); cur != Dt.edges_end(); ++cur){
+//         Delaunay3D::Periodic_segment pseg = Dt.periodic_segment(*cur);
+//         Delaunay3D::Segment seg = Dt.segment(pseg);
+//         RealValue sqrad = CGAL::squared_radius(seg[0],seg[1]);
+//         simplices.insert(AlphaSimplex3D(*cur, simplices, Dt, Dt.incident_facets(*cur), sqrad));
+//     }
+//     rInfo("Edges inserted");
+//     for(Vertex_iterator cur = Dt.vertices_begin(); cur != Dt.vertices_end(); ++cur)
+//         simplices.insert(AlphaSimplex3D(*cur));
+//     rInfo("Vertices inserted");
+// }
+
+// FOR CGAL 4.11 you must change to the following code
+//
 void fill_simplex_set(const Delaunay3D& Dt, AlphaSimplex3D::SimplexSet& simplices)
 {
-    // Compute all simplices with their alpha values and attachment information
-    for(Cell_iterator cur = Dt.cells_begin(); cur != Dt.cells_end(); ++cur){
-        Delaunay3D::Periodic_tetrahedron ptet = Dt.periodic_tetrahedron(cur);
-        Delaunay3D::Tetrahedron tet = Dt.tetrahedron(ptet);
-        RealValue sqrad = CGAL::squared_radius(tet[0], tet[1], tet[2], tet[3]);
-        simplices.insert(AlphaSimplex3D(*cur, sqrad));
-    }
-    rInfo("Cells inserted");
-    for(Facet_iterator cur = Dt.facets_begin(); cur != Dt.facets_end(); ++cur){
-        Delaunay3D::Periodic_triangle ptri = Dt.periodic_triangle(*cur);
-        Delaunay3D::Triangle tri = Dt.triangle(ptri);
-        RealValue sqrad = CGAL::squared_radius(tri[0], tri[1], tri[2]);
-        simplices.insert(AlphaSimplex3D(*cur, simplices, Dt, sqrad));
-    }
-    rInfo("Facets inserted");
-    for(Edge_iterator cur = Dt.edges_begin(); cur != Dt.edges_end(); ++cur){
-        Delaunay3D::Periodic_segment pseg = Dt.periodic_segment(*cur);
-        Delaunay3D::Segment seg = Dt.segment(pseg);
-        RealValue sqrad = CGAL::squared_radius(seg[0],seg[1]);
-        simplices.insert(AlphaSimplex3D(*cur, simplices, Dt, Dt.incident_facets(*cur), sqrad));
-    }
-    rInfo("Edges inserted");
-    for(Vertex_iterator cur = Dt.vertices_begin(); cur != Dt.vertices_end(); ++cur)
-        simplices.insert(AlphaSimplex3D(*cur));
-    rInfo("Vertices inserted");
+   // Compute all simplices with their alpha values and attachment information
+   for(Cell_iterator cur = Dt.cells_begin(); cur != Dt.cells_end(); ++cur){
+       Delaunay3D::Periodic_tetrahedron ptet = Dt.periodic_tetrahedron(cur);
+       Delaunay3D::Tetrahedron tet = Dt.construct_tetrahedron(ptet);
+       RealValue sqrad = CGAL::squared_radius(tet[0], tet[1], tet[2], tet[3]);
+       simplices.insert(AlphaSimplex3D(*cur, sqrad));
+   }
+   rInfo("Cells inserted");
+   for(Facet_iterator cur = Dt.facets_begin(); cur != Dt.facets_end(); ++cur){
+       Delaunay3D::Periodic_triangle ptri = Dt.periodic_triangle(*cur);
+       Delaunay3D::Triangle tri = Dt.construct_triangle(ptri);
+       RealValue sqrad = CGAL::squared_radius(tri[0], tri[1], tri[2]);
+       simplices.insert(AlphaSimplex3D(*cur, simplices, Dt, sqrad));
+   }
+   rInfo("Facets inserted");
+   for(Edge_iterator cur = Dt.edges_begin(); cur != Dt.edges_end(); ++cur){
+       Delaunay3D::Periodic_segment pseg = Dt.periodic_segment(*cur);
+       Delaunay3D::Segment seg = Dt.construct_segment(pseg);
+       RealValue sqrad = CGAL::squared_radius(seg[0],seg[1]);
+       simplices.insert(AlphaSimplex3D(*cur, simplices, Dt, Dt.incident_facets(*cur), sqrad));
+   }
+   rInfo("Edges inserted");
+   for(Vertex_iterator cur = Dt.vertices_begin(); cur != Dt.vertices_end(); ++cur)
+       simplices.insert(AlphaSimplex3D(*cur));
+   rInfo("Vertices inserted");
 }
 
+
+
 template<class Filtration>
 void fill_complex(const Delaunay3D& Dt, Filtration& filtration)
 {