diff --git a/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt b/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt index 1e217145464..f27a2cb40be 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt +++ b/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt @@ -37,13 +37,14 @@ if ( CGAL_FOUND ) # If you want to visualize a linear cell complex, there are 2 viewers # based on qt and vtk. Just uncomment the corresponding line - include("CMakeLCCViewerQt.inc") + # include("CMakeLCCViewerQt.inc") # include("CMakeLCCViewerVtk.inc") add_executable(linear_cell_complex_3_triangulation linear_cell_complex_3_triangulation.cpp) target_link_libraries(linear_cell_complex_3_triangulation ${CGAL_LIBRARIES} - ${CGAL_3RD_PARTY_LIBRARIES} ${MAP_VIEWER_LIBRARIES}) + ${CGAL_3RD_PARTY_LIBRARIES} + ${MAP_VIEWER_LIBRARIES}) add_executable(voronoi_2 voronoi_2.cpp) target_link_libraries(voronoi_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} diff --git a/Linear_cell_complex/examples/Linear_cell_complex/data/small_points_3 b/Linear_cell_complex/examples/Linear_cell_complex/data/small_points_3 index 0e196b16d9e..1ad1667b732 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/data/small_points_3 +++ b/Linear_cell_complex/examples/Linear_cell_complex/data/small_points_3 @@ -2,5 +2,14 @@ 1 0 0 0 1 0 0 0 1 +0 0 0 +-1 0 0 +0 -1 0 +0 0 -1 +-2 -2 -2 2 2 2 -1 0 1 +-3 0 5 +3 0 5 +-2.2 2 4.8 +2.2 2 4.8 diff --git a/Linear_cell_complex/examples/Linear_cell_complex/voronoi_2.cpp b/Linear_cell_complex/examples/Linear_cell_complex/voronoi_2.cpp index e461eb25e70..f71bfbb29f5 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/voronoi_2.cpp +++ b/Linear_cell_complex/examples/Linear_cell_complex/voronoi_2.cpp @@ -34,6 +34,12 @@ #endif #endif +/* // If you want to use exact constructions. +#include +typedef CGAL::Linear_cell_complex<2,2, + CGAL::Linear_cell_complex_traits<2, CGAL::Exact_predicates_exact_constructions_kernel> > LCC_2; +*/ + typedef CGAL::Linear_cell_complex<2> LCC_2; typedef LCC_2::Dart_handle Dart_handle; typedef LCC_2::Point Point; @@ -117,8 +123,7 @@ void set_geometry_of_dual(LCC& alcc, TR& tr, alcc.set_vertex_attribute (it->second,alcc.create_vertex_attribute(tr.circumcenter(it->first))); else - alcc.set_vertex_attribute - (it->second,alcc.create_vertex_attribute()); + alcc.set_vertex_attribute(it->second,alcc.create_vertex_attribute()); } } @@ -160,19 +165,14 @@ int main(int narg, char** argv) std::map face_to_dart; - Dart_handle dh= - CGAL::import_from_triangulation_2(lcc, T, - &face_to_dart); + Dart_handle dh=CGAL::import_from_triangulation_2 + (lcc, T, &face_to_dart); CGAL_assertion(lcc.is_without_boundary()); std::cout<<"Delaunay triangulation :"< toremove; int mark_toremove=alcc.get_new_mark(); - // We cannot view the infinite volume since it does not have - // a correct geometry. For that we have to remove the infinite volume. + // adart belongs to the infinite volume. toremove.push(adart); CGAL::mark_cell(alcc, adart, mark_toremove); - // Plus all the volumes sharing a face with it. + // Now we get all the volumes adjacent to the infinite volume. for (LCC_3::Dart_of_cell_range<3>::iterator it=alcc.darts_of_cell<3>(adart).begin(), itend=alcc.darts_of_cell<3>(adart).end(); it!=itend; ++it) @@ -61,7 +68,7 @@ void display_voronoi(LCC_3& alcc, Dart_handle adart) { CGAL::mark_cell(alcc, it->beta(3), mark_toremove); toremove.push(it->beta(3)); - } + } } while( !toremove.empty() ) @@ -70,11 +77,57 @@ void display_voronoi(LCC_3& alcc, Dart_handle adart) toremove.pop(); } + CGAL_assertion(alcc.is_without_boundary(1) && alcc.is_without_boundary(2)); + + std::cout<<"Voronoi subdvision, only finite volumes:"<(lcc, T); + std::map vol_to_dart; + + Dart_handle dh=CGAL::import_from_triangulation_3 + (lcc, T, &vol_to_dart); std::cout<<"Delaunay triangulation :"<