diff --git a/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt b/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt index 9c2193256ad..70c0eccfa66 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt +++ b/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt @@ -11,10 +11,10 @@ endif() # If you want to visualize a linear cell complex, you can use the following viewer # based on qt. Just uncomment the following line, plus the line find_package(CGALBasicViewer) below -# find_package(CGAL COMPONENTS Qt5) +find_package(CGAL COMPONENTS Qt5) # If you don't want to visualize, use the following line (otherwise comment it) -find_package(CGAL QUIET) +# find_package(CGAL QUIET) # For Gprof. # ADD_DEFINITIONS("-pg") @@ -24,38 +24,28 @@ find_package(CGAL QUIET) # add_definition(-DCGAL_DISABLE_ROUNDING_MATH_CHECK) if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - # find_package(CGALBasicViewer) + include(${CGAL_USE_FILE}) + find_package(CGALBasicViewer) include( CGAL_CreateSingleSourceCGALProgram ) include_directories(BEFORE ../../include) - create_single_source_cgal_program( "linear_cell_complex_3.cpp" ) - create_single_source_cgal_program( "linear_cell_complex_4.cpp" ) - create_single_source_cgal_program( - "linear_cell_complex_3_with_colored_vertices.cpp" ) - create_single_source_cgal_program( - "linear_cell_complex_3_with_mypoint.cpp" ) - + create_single_source_cgal_program("linear_cell_complex_3.cpp") + create_single_source_cgal_program("linear_cell_complex_4.cpp") + create_single_source_cgal_program("linear_cell_complex_3_with_colored_vertices.cpp") + create_single_source_cgal_program("linear_cell_complex_3_with_mypoint.cpp") create_single_source_cgal_program("plane_graph_to_lcc_2.cpp") create_single_source_cgal_program("linear_cell_complex_3_attributes_management.cpp") + create_single_source_cgal_program("voronoi_2.cpp") + create_single_source_cgal_program("voronoi_3.cpp") + create_single_source_cgal_program("gmap_linear_cell_complex_3.cpp") + create_single_source_cgal_program("linear_cell_complex_3_operations.cpp") - add_executable(voronoi_2 voronoi_2.cpp) - target_link_libraries(voronoi_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} - ${BASIC_VIEWER_LIBRARIES}) - add_executable(voronoi_3 voronoi_3.cpp) - target_link_libraries(voronoi_3 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} - ${BASIC_VIEWER_LIBRARIES}) - - if (USE_BASIC_VIEWER) - qt5_use_modules(voronoi_3 ${BASIC_VIEWER_MODULES}) - endif(USE_BASIC_VIEWER) - - create_single_source_cgal_program( "gmap_linear_cell_complex_3.cpp" ) - - add_executable(linear_cell_complex_3_operations linear_cell_complex_3_operations.cpp) - target_link_libraries(linear_cell_complex_3_operations ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} - ${BASIC_VIEWER_LIBRARIES}) + create_single_source_cgal_program("display_linear_cell_complex.cpp") +if (USE_BASIC_VIEWER) + target_link_libraries(display_linear_cell_complex ${BASIC_VIEWER_LIBRARIES}) + qt5_use_modules(display_linear_cell_complex ${BASIC_VIEWER_MODULES}) +endif(USE_BASIC_VIEWER) else() message(STATUS "This program requires the CGAL library, " diff --git a/Linear_cell_complex/examples/Linear_cell_complex/display_linear_cell_complex.cpp b/Linear_cell_complex/examples/Linear_cell_complex/display_linear_cell_complex.cpp new file mode 100644 index 00000000000..32ec76c99dd --- /dev/null +++ b/Linear_cell_complex/examples/Linear_cell_complex/display_linear_cell_complex.cpp @@ -0,0 +1,26 @@ +#include + +#ifdef CGAL_USE_BASIC_VIEWER +#include +#endif + +typedef CGAL::Linear_cell_complex_for_combinatorial_map<3> LCC; +typedef LCC::Point Point; + +int main() +{ + LCC lcc; + lcc.make_hexahedron(Point(0,0,0), Point(5,0,0), + Point(5,5,0), Point(0,5,0), + Point(0,5,4), Point(0,0,4), + Point(5,0,4), Point(5,5,4)); + + lcc.display_characteristics(std::cout)<<", valid=" + < #include - -#ifdef CGAL_USE_BASIC_VIEWER -#include -#endif - typedef CGAL::Linear_cell_complex_for_combinatorial_map<3> LCC_3_cmap; typedef CGAL::Linear_cell_complex_for_generalized_map<3> LCC_3_gmap; @@ -54,10 +49,6 @@ void run_test() lcc.template sew<3>(lcc.template opposite<2>(lcc.next(dh1)), lcc.other_orientation(lcc.template opposite<2>(lcc.previous(dh3)))); -#ifdef CGAL_USE_BASIC_VIEWER - display(lcc); -#endif // CGAL_USE_BASIC_VIEWER - lcc.insert_cell_1_in_cell_2(lcc.next(dh1), Alpha1::run(lcc, lcc.previous(dh1))); dh2=lcc.template opposite<2>(lcc.next(lcc.next @@ -73,14 +64,9 @@ void run_test() lcc.insert_cell_2_in_cell_3(path.begin(),path.end()); lcc.display_characteristics(std::cout) << ", valid=" - << lcc.is_valid() << std::endl; - -#ifdef CGAL_USE_BASIC_VIEWER - display(lcc); -#endif // CGAL_USE_BASIC_VIEWER + << lcc.is_valid() << std::endl; } - int main() { run_test(); 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 7833696d633..64fe08e3b42 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/voronoi_2.cpp +++ b/Linear_cell_complex/examples/Linear_cell_complex/voronoi_2.cpp @@ -7,10 +7,6 @@ #include -#ifdef CGAL_USE_BASIC_VIEWER -#include -#endif - // This example works both with cmap and gmap as combinatorial data structure. //typedef CGAL::Linear_cell_complex_for_combinatorial_map<2> LCC_2; typedef CGAL::Linear_cell_complex_for_generalized_map<2> LCC_2; @@ -56,10 +52,6 @@ void display_voronoi(LCC_2& alcc, Dart_handle adart) alcc.display_characteristics(std::cout) << ", valid=" << alcc.is_valid() << std::endl; - -#ifdef CGAL_USE_BASIC_VIEWER - display(alcc); -#endif // CGAL_USE_BASIC_VIEWER } template diff --git a/Linear_cell_complex/examples/Linear_cell_complex/voronoi_3.cpp b/Linear_cell_complex/examples/Linear_cell_complex/voronoi_3.cpp index 318028bda3a..30f94107b00 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/voronoi_3.cpp +++ b/Linear_cell_complex/examples/Linear_cell_complex/voronoi_3.cpp @@ -5,10 +5,6 @@ #include #include -#ifdef CGAL_USE_BASIC_VIEWER -#include -#endif - /* // If you want to use exact constructions. #include typedef CGAL::Linear_cell_complex<3,3, @@ -58,10 +54,6 @@ void display_voronoi(LCC_3& alcc, Dart_handle adart) alcc.display_characteristics(std::cout) << ", valid=" << alcc.is_valid() << std::endl; - -#ifdef CGAL_USE_BASIC_VIEWER - display(alcc); -#endif // CGAL_USE_BASIC_VIEWER } template