Add CGAL pre-4.11 support back to e/a/alphashapes3d-periodic default tip
authorDmitriy Morozov <dmitriy@mrzv.org>
Mon Nov 27 10:26:59 2017 -0800 (12 months ago)
changeset 293bc7bd0ac9af6
parent 292 b90319e7126f
Add CGAL pre-4.11 support back to e/a/alphashapes3d-periodic
examples/alphashapes/alphashapes3d-periodic.hpp
     1.1 --- a/examples/alphashapes/alphashapes3d-periodic.hpp	Sun Nov 26 18:42:36 2017 -0800
     1.2 +++ b/examples/alphashapes/alphashapes3d-periodic.hpp	Mon Nov 27 10:26:59 2017 -0800
     1.3 @@ -218,59 +218,38 @@
     1.4      return out;
     1.5  }
     1.6  
     1.7 -// FOR CGAL 4.10 use the following code
     1.8 -//
     1.9 -// void fill_simplex_set(const Delaunay3D& Dt, AlphaSimplex3D::SimplexSet& simplices)
    1.10 -// {
    1.11 -//     // Compute all simplices with their alpha values and attachment information
    1.12 -//     for(Cell_iterator cur = Dt.cells_begin(); cur != Dt.cells_end(); ++cur){
    1.13 -//         Delaunay3D::Periodic_tetrahedron ptet = Dt.periodic_tetrahedron(cur);
    1.14 -//         Delaunay3D::Tetrahedron tet = Dt.tetrahedron(ptet);
    1.15 -//         RealValue sqrad = CGAL::squared_radius(tet[0], tet[1], tet[2], tet[3]);
    1.16 -//         simplices.insert(AlphaSimplex3D(*cur, sqrad));
    1.17 -//     }
    1.18 -//     rInfo("Cells inserted");
    1.19 -//     for(Facet_iterator cur = Dt.facets_begin(); cur != Dt.facets_end(); ++cur){
    1.20 -//         Delaunay3D::Periodic_triangle ptri = Dt.periodic_triangle(*cur);
    1.21 -//         Delaunay3D::Triangle tri = Dt.triangle(ptri);
    1.22 -//         RealValue sqrad = CGAL::squared_radius(tri[0], tri[1], tri[2]);
    1.23 -//         simplices.insert(AlphaSimplex3D(*cur, simplices, Dt, sqrad));
    1.24 -//     }
    1.25 -//     rInfo("Facets inserted");
    1.26 -//     for(Edge_iterator cur = Dt.edges_begin(); cur != Dt.edges_end(); ++cur){
    1.27 -//         Delaunay3D::Periodic_segment pseg = Dt.periodic_segment(*cur);
    1.28 -//         Delaunay3D::Segment seg = Dt.segment(pseg);
    1.29 -//         RealValue sqrad = CGAL::squared_radius(seg[0],seg[1]);
    1.30 -//         simplices.insert(AlphaSimplex3D(*cur, simplices, Dt, Dt.incident_facets(*cur), sqrad));
    1.31 -//     }
    1.32 -//     rInfo("Edges inserted");
    1.33 -//     for(Vertex_iterator cur = Dt.vertices_begin(); cur != Dt.vertices_end(); ++cur)
    1.34 -//         simplices.insert(AlphaSimplex3D(*cur));
    1.35 -//     rInfo("Vertices inserted");
    1.36 -// }
    1.37 -
    1.38 -// FOR CGAL 4.11 you must change to the following code
    1.39 -//
    1.40  void fill_simplex_set(const Delaunay3D& Dt, AlphaSimplex3D::SimplexSet& simplices)
    1.41  {
    1.42     // Compute all simplices with their alpha values and attachment information
    1.43     for(Cell_iterator cur = Dt.cells_begin(); cur != Dt.cells_end(); ++cur){
    1.44         Delaunay3D::Periodic_tetrahedron ptet = Dt.periodic_tetrahedron(cur);
    1.45 +#if CGAL_VERSION_NR >= CGAL_VERSION_NUMBER(4,11,0)
    1.46         Delaunay3D::Tetrahedron tet = Dt.construct_tetrahedron(ptet);
    1.47 +#else
    1.48 +       Delaunay3D::Tetrahedron tet = Dt.tetrahedron(ptet);
    1.49 +#endif
    1.50         RealValue sqrad = CGAL::squared_radius(tet[0], tet[1], tet[2], tet[3]);
    1.51         simplices.insert(AlphaSimplex3D(*cur, sqrad));
    1.52     }
    1.53     rInfo("Cells inserted");
    1.54     for(Facet_iterator cur = Dt.facets_begin(); cur != Dt.facets_end(); ++cur){
    1.55         Delaunay3D::Periodic_triangle ptri = Dt.periodic_triangle(*cur);
    1.56 +#if CGAL_VERSION_NR >= CGAL_VERSION_NUMBER(4,11,0)
    1.57         Delaunay3D::Triangle tri = Dt.construct_triangle(ptri);
    1.58 +#else
    1.59 +       Delaunay3D::Triangle tri = Dt.triangle(ptri);
    1.60 +#endif
    1.61         RealValue sqrad = CGAL::squared_radius(tri[0], tri[1], tri[2]);
    1.62         simplices.insert(AlphaSimplex3D(*cur, simplices, Dt, sqrad));
    1.63     }
    1.64     rInfo("Facets inserted");
    1.65     for(Edge_iterator cur = Dt.edges_begin(); cur != Dt.edges_end(); ++cur){
    1.66         Delaunay3D::Periodic_segment pseg = Dt.periodic_segment(*cur);
    1.67 +#if CGAL_VERSION_NR >= CGAL_VERSION_NUMBER(4,11,0)
    1.68         Delaunay3D::Segment seg = Dt.construct_segment(pseg);
    1.69 +#else
    1.70 +       Delaunay3D::Segment seg = Dt.segment(pseg);
    1.71 +#endif
    1.72         RealValue sqrad = CGAL::squared_radius(seg[0],seg[1]);
    1.73         simplices.insert(AlphaSimplex3D(*cur, simplices, Dt, Dt.incident_facets(*cur), sqrad));
    1.74     }