From 53769e98a775ad41bf75bbfbdadfdfeb0422bbce Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 13 Feb 2018 11:31:21 +0100 Subject: [PATCH] * Add draw examples in the 5 concerned packages (Polyhedron, Surface_mesh, T2, T3, LCC) * Update FindQGLViewel to add a target. --- .../Combinatorial_map_internal_functors.h | 2 +- .../cmake/modules/FindQGLViewer.cmake | 81 ------------------- .../demo/Linear_cell_complex/CMakeLists.txt | 1 - .../Linear_cell_complex/CMakeLists.txt | 42 +++++----- Polyhedron/examples/Polyhedron/CMakeLists.txt | 24 +++--- .../examples/Polyhedron/draw_polyhedron.cpp | 18 +++++ .../polyhedron_self_intersection.cpp | 8 -- Polyhedron/include/CGAL/draw_polyhedron.h | 2 +- .../examples/Surface_mesh/CMakeLists.txt | 23 +++--- .../Surface_mesh/draw_surface_mesh.cpp | 19 +++++ .../examples/Surface_mesh/sm_join.cpp | 9 --- .../examples/Triangulation_2/CMakeLists.txt | 13 ++- .../Triangulation_2/draw_triangulation_2.cpp | 21 +++++ .../examples/Triangulation_2/regular.cpp | 8 -- .../include/CGAL/draw_triangulation_2.h | 2 +- .../examples/Triangulation_3/CMakeLists.txt | 22 ++--- .../Triangulation_3/draw_triangulation_3.cpp | 21 +++++ .../examples/Triangulation_3/regular_3.cpp | 8 -- .../include/CGAL/draw_triangulation_3.h | 2 +- 19 files changed, 144 insertions(+), 182 deletions(-) delete mode 100644 Installation/cmake/modules/FindQGLViewer.cmake create mode 100644 Polyhedron/examples/Polyhedron/draw_polyhedron.cpp create mode 100644 Surface_mesh/examples/Surface_mesh/draw_surface_mesh.cpp create mode 100644 Triangulation_2/examples/Triangulation_2/draw_triangulation_2.cpp create mode 100644 Triangulation_3/examples/Triangulation_3/draw_triangulation_3.cpp diff --git a/Combinatorial_map/include/CGAL/internal/Combinatorial_map_internal_functors.h b/Combinatorial_map/include/CGAL/internal/Combinatorial_map_internal_functors.h index 6baae231673..26286c5f5c7 100644 --- a/Combinatorial_map/include/CGAL/internal/Combinatorial_map_internal_functors.h +++ b/Combinatorial_map/include/CGAL/internal/Combinatorial_map_internal_functors.h @@ -329,7 +329,7 @@ struct Correct_invalid_attributes_functor unsigned int nb=0; bool found_dart = false; - for ( CGAL::CMap_dart_iterator_basic_of_cell + for ( typename CMap::template Dart_of_cell_basic_range::iterator it(amap, adart, amark); it.cont(); ++it, ++nb ) { if ( a!=amap.template attribute(it) ) diff --git a/Installation/cmake/modules/FindQGLViewer.cmake b/Installation/cmake/modules/FindQGLViewer.cmake deleted file mode 100644 index aadfa505689..00000000000 --- a/Installation/cmake/modules/FindQGLViewer.cmake +++ /dev/null @@ -1,81 +0,0 @@ -# - Try to find QGLViewer -# Once done this will define -# -# QGLVIEWER_FOUND - system has QGLViewer -# QGLVIEWER_INCLUDE_DIR - the QGLViewer include directory -# QGLVIEWER_LIBRARIES - Link these to use QGLViewer -# QGLVIEWER_DEFINITIONS - Compiler switches required for using QGLViewer -# -if(POLICY CMP0072) - # About the use of OpenGL - cmake_policy(SET CMP0072 NEW) -endif() -find_package(OpenGL QUIET) -find_package(Qt5 QUIET COMPONENTS OpenGL Xml) - -# first look in user defined locations -find_path(QGLVIEWER_INCLUDE_DIR - NAMES QGLViewer/qglviewer.h - NO_DEFAULT_PATH - PATHS ENV QGLVIEWERROOT - /usr/local/include - ) - -find_library(QGLVIEWER_LIBRARY_RELEASE - NAMES qglviewer-qt5 qglviewer QGLViewer-qt5 QGLViewer QGLViewer2-qt5 QGLViewer2 - NO_DEFAULT_PATH - PATHS ENV QGLVIEWERROOT - ENV LD_LIBRARY_PATH - ENV LIBRARY_PATH - /usr/local/lib - PATH_SUFFIXES QGLViewer QGLViewer/release - ) - -find_library(QGLVIEWER_LIBRARY_DEBUG - NAMES dqglviewer dQGLViewer-qt5 dQGLViewer dQGLViewer2-qt5 dQGLViewer2 QGLViewerd2-qt5 QGLViewerd2 - NO_DEFAULT_PATH - PATHS /usr/local/lib - ENV QGLVIEWERROOT - ENV LD_LIBRARY_PATH - ENV LIBRARY_PATH - PATH_SUFFIXES QGLViewer QGLViewer/debug - ) - -#now try the standard paths -if (NOT QGLVIEWER_INCLUDE_DIR OR NOT QGLVIEWER_LIBRARY_RELEASE OR NOT QGLVIEWER_LIBRARY_DEBUG) -find_path(QGLVIEWER_INCLUDE_DIR - NAMES QGLViewer/qglviewer.h) - -find_library(QGLVIEWER_LIBRARY_RELEASE - NAMES qglviewer-qt5 qglviewer QGLViewer-qt5 QGLViewer QGLViewer2-qt5 QGLViewer2) - -find_library(QGLVIEWER_LIBRARY_DEBUG - NAMES dqglviewer dQGLViewer-qt5 dQGLViewer dQGLViewer2-qt5 dQGLViewer2 QGLViewerd2-qt5 QGLViewerd2) - -endif() - -if(QGLVIEWER_LIBRARY_RELEASE) - if(QGLVIEWER_LIBRARY_DEBUG) - set(QGLVIEWER_LIBRARIES_ Qt5::Xml Qt5::OpenGL ${OPENGL_LIBRARIES} optimized ${QGLVIEWER_LIBRARY_RELEASE} debug ${QGLVIEWER_LIBRARY_DEBUG}) - else() - set(QGLVIEWER_LIBRARIES_ Qt5::Xml Qt5::OpenGL ${OPENGL_LIBRARIES} ${QGLVIEWER_LIBRARY_RELEASE}) - endif() - - set(QGLVIEWER_LIBRARIES ${QGLVIEWER_LIBRARIES_} CACHE FILEPATH "The QGLViewer library") - -endif() - -IF(QGLVIEWER_INCLUDE_DIR AND QGLVIEWER_LIBRARIES) - SET(QGLVIEWER_FOUND TRUE) -ENDIF(QGLVIEWER_INCLUDE_DIR AND QGLVIEWER_LIBRARIES) - -IF(QGLVIEWER_FOUND) - IF(NOT QGLViewer_FIND_QUIETLY) - MESSAGE(STATUS "Found QGLViewer: ${QGLVIEWER_LIBRARIES}") - ENDIF(NOT QGLViewer_FIND_QUIETLY) -ELSE(QGLVIEWER_FOUND) - IF(QGLViewer_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Could not find QGLViewer") - ENDIF(QGLViewer_FIND_REQUIRED) -ENDIF(QGLVIEWER_FOUND) - diff --git a/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt b/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt index cf875857d47..d774c81cc65 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt +++ b/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt @@ -58,7 +58,6 @@ qt5_wrap_ui(uis MainWindow.ui CreateMesh.ui CreateMenger.ui # qrc files (resources files, that contain icons, at least) qt5_add_resources (CGAL_Qt5_RESOURCE_FILES ./Linear_cell_complex_3.qrc) - add_executable(Linear_cell_complex_3_demo Linear_cell_complex_3_demo.cpp MainWindow.cpp Viewer.cpp Linear_cell_complex_3_subdivision.cpp diff --git a/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt b/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt index cb65e291900..1a74373d02c 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt +++ b/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt @@ -11,6 +11,13 @@ endif() find_package(CGAL COMPONENTS Qt5) +if(CGAL_Qt5_FOUND) + find_package(QGLViewer) + if (TARGET QGLViewer::QGLViewer) + add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS) + endif() +endif() + # For Gprof. # ADD_DEFINITIONS("-pg") # set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg") @@ -18,44 +25,31 @@ find_package(CGAL COMPONENTS Qt5) # To use valgrind, we must disable rounding math ckeck. # add_definition(-DCGAL_DISABLE_ROUNDING_MATH_CHECK) -if ( CGAL_FOUND ) - include(${CGAL_USE_FILE}) +if (CGAL_FOUND) + include( ${CGAL_USE_FILE} ) - include( CGAL_CreateSingleSourceCGALProgram ) + include(CGAL_CreateSingleSourceCGALProgram) include_directories(BEFORE ../../include) + create_single_source_cgal_program("gmap_linear_cell_complex_3.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_attributes_management.cpp") + create_single_source_cgal_program("linear_cell_complex_3_operations.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_4.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") - create_single_source_cgal_program("draw_linear_cell_complex.cpp") - if(TARGET CGAL::CGAL_Qt5) - find_package(Qt5 REQUIRED COMPONENTS OpenGL Xml) - find_package(QGLViewer REQUIRED) - find_package(OpenGL REQUIRED) - add_definitions(${QT_DEFINITIONS}) - add_definitions(-DQT_NO_KEYWORDS) - include_directories( ${QGLVIEWER_INCLUDE_DIR} ) - add_definitions(${QGLVIEWER_DEFINITIONS}) - - target_link_libraries(draw_linear_cell_complex CGAL::CGAL_Qt5 Qt5::Xml - ${QT_LIBRARIES} - ${QGLVIEWER_LIBRARIES} - ${OPENGL_gl_LIBRARY}) - target_compile_definitions(draw_linear_cell_complex PRIVATE CGAL_USE_BASIC_VIEWER) + create_single_source_cgal_program("draw_linear_cell_complex.cpp") + if(CGAL_Qt5_FOUND AND TARGET QGLViewer::QGLViewer) + target_link_libraries(draw_linear_cell_complex CGAL::CGAL_Qt5 QGLViewer::QGLViewer) endif() else() - message(STATUS "This program requires the CGAL library, " - "and will not be compiled.") + message(STATUS "This program requires the CGAL library, and will not be compiled.") endif() diff --git a/Polyhedron/examples/Polyhedron/CMakeLists.txt b/Polyhedron/examples/Polyhedron/CMakeLists.txt index 2ebfc161e16..c3d550772a6 100644 --- a/Polyhedron/examples/Polyhedron/CMakeLists.txt +++ b/Polyhedron/examples/Polyhedron/CMakeLists.txt @@ -6,17 +6,18 @@ project( Polyhedron_Examples ) cmake_minimum_required(VERSION 2.8.10) -# If you want to visualize a polyhedron, 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) +if(CGAL_Qt5_FOUND) + find_package(QGLViewer) + if (TARGET QGLViewer::QGLViewer) + add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS) + endif() +endif() if ( CGAL_FOUND ) include( ${CGAL_USE_FILE} ) - # find_package(CGALBasicViewer) include( CGAL_CreateSingleSourceCGALProgram ) @@ -27,15 +28,12 @@ if ( CGAL_FOUND ) file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) foreach(cppfile ${cppfiles}) create_single_source_cgal_program( "${cppfile}" ) - - if (USE_BASIC_VIEWER) - get_filename_component(exe_name "${cppfile}" NAME_WE) - target_link_libraries("${exe_name}" ${BASIC_VIEWER_LIBRARIES}) - qt5_use_modules("${exe_name}" ${BASIC_VIEWER_MODULES}) - endif(USE_BASIC_VIEWER) - endforeach() + if(CGAL_Qt5_FOUND AND TARGET QGLViewer::QGLViewer) + target_link_libraries(draw_polyhedron CGAL::CGAL_Qt5 QGLViewer::QGLViewer) + endif() + else() message(STATUS "This program requires the CGAL library, and will not be compiled.") diff --git a/Polyhedron/examples/Polyhedron/draw_polyhedron.cpp b/Polyhedron/examples/Polyhedron/draw_polyhedron.cpp new file mode 100644 index 00000000000..76c17c2d3e9 --- /dev/null +++ b/Polyhedron/examples/Polyhedron/draw_polyhedron.cpp @@ -0,0 +1,18 @@ +#include +#include +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; +typedef CGAL::Polyhedron_3 Polyhedron; + +int main() +{ + std::cerr<<"Loading OFF file ... "<>P; + + CGAL::draw(P); + + return EXIT_SUCCESS; +} diff --git a/Polyhedron/examples/Polyhedron/polyhedron_self_intersection.cpp b/Polyhedron/examples/Polyhedron/polyhedron_self_intersection.cpp index 8bca5f9b9f1..acaad9db7ed 100644 --- a/Polyhedron/examples/Polyhedron/polyhedron_self_intersection.cpp +++ b/Polyhedron/examples/Polyhedron/polyhedron_self_intersection.cpp @@ -8,10 +8,6 @@ #include #include -#ifdef CGAL_USE_BASIC_VIEWER -#include -#endif - using std::cerr; using std::endl; using std::cout; @@ -160,9 +156,5 @@ int main() { cerr << "Intersection : " << user_time.time() << " seconds." << endl; write_off(); -#ifdef CGAL_USE_BASIC_VIEWER - display(P); -#endif // CGAL_USE_BASIC_VIEWER - return 0; } diff --git a/Polyhedron/include/CGAL/draw_polyhedron.h b/Polyhedron/include/CGAL/draw_polyhedron.h index c4fe5c78bf0..23a71e06023 100644 --- a/Polyhedron/include/CGAL/draw_polyhedron.h +++ b/Polyhedron/include/CGAL/draw_polyhedron.h @@ -213,7 +213,7 @@ void draw(const Polyhedron& apoly, const char* title="Polyhedron Viewer", bool nofill=false) { - return display + return draw (apoly, title, nofill); } diff --git a/Surface_mesh/examples/Surface_mesh/CMakeLists.txt b/Surface_mesh/examples/Surface_mesh/CMakeLists.txt index 7b3090358d6..591106c503d 100644 --- a/Surface_mesh/examples/Surface_mesh/CMakeLists.txt +++ b/Surface_mesh/examples/Surface_mesh/CMakeLists.txt @@ -6,17 +6,18 @@ project( Surface_mesh_Examples ) cmake_minimum_required(VERSION 2.8.11) -# If you want to visualize a surface mesh, 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) +if(CGAL_Qt5_FOUND) + find_package(QGLViewer) + if (TARGET QGLViewer::QGLViewer) + add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS) + endif() +endif() if ( CGAL_FOUND ) include( ${CGAL_USE_FILE} ) - # find_package(CGALBasicViewer) include( CGAL_CreateSingleSourceCGALProgram ) @@ -24,11 +25,6 @@ if ( CGAL_FOUND ) create_single_source_cgal_program( "sm_derivation.cpp" ) create_single_source_cgal_program( "sm_join.cpp" ) - if (USE_BASIC_VIEWER) - target_link_libraries("sm_join" ${BASIC_VIEWER_LIBRARIES}) - qt5_use_modules("sm_join" ${BASIC_VIEWER_MODULES}) - endif(USE_BASIC_VIEWER) - create_single_source_cgal_program( "sm_aabbtree.cpp" ) create_single_source_cgal_program( "sm_bgl.cpp" ) create_single_source_cgal_program( "sm_circulators.cpp" ) @@ -38,6 +34,11 @@ if ( CGAL_FOUND ) create_single_source_cgal_program( "sm_memory.cpp" ) create_single_source_cgal_program( "sm_properties.cpp" ) + create_single_source_cgal_program("draw_surface_mesh.cpp") + if(CGAL_Qt5_FOUND AND TARGET QGLViewer::QGLViewer) + target_link_libraries(draw_surface_mesh CGAL::CGAL_Qt5 QGLViewer::QGLViewer) + endif() + else() message(STATUS "This program requires the CGAL library, and will not be compiled.") diff --git a/Surface_mesh/examples/Surface_mesh/draw_surface_mesh.cpp b/Surface_mesh/examples/Surface_mesh/draw_surface_mesh.cpp new file mode 100644 index 00000000000..4735193c89f --- /dev/null +++ b/Surface_mesh/examples/Surface_mesh/draw_surface_mesh.cpp @@ -0,0 +1,19 @@ +#include +#include +#include +#include + +typedef CGAL::Simple_cartesian Kernel; +typedef Kernel::Point_3 Point; +typedef CGAL::Surface_mesh Mesh; + +int main(int argc, char* argv[]) +{ + Mesh sm1; + std::ifstream in1((argc>1)?argv[1]:"data/triangle.off"); + in1 >> sm1; + + CGAL::draw(sm1); + + return EXIT_SUCCESS; +} diff --git a/Surface_mesh/examples/Surface_mesh/sm_join.cpp b/Surface_mesh/examples/Surface_mesh/sm_join.cpp index 9b46da3897e..e787eb66c70 100644 --- a/Surface_mesh/examples/Surface_mesh/sm_join.cpp +++ b/Surface_mesh/examples/Surface_mesh/sm_join.cpp @@ -5,10 +5,6 @@ #include -#ifdef CGAL_USE_BASIC_VIEWER -#include -#endif - typedef CGAL::Simple_cartesian Kernel; typedef Kernel::Point_3 Point; typedef CGAL::Surface_mesh Mesh; @@ -40,9 +36,4 @@ int main(int argc, char* argv[]) std::cout << sm1 << std::endl; - -#ifdef CGAL_USE_BASIC_VIEWER - display(sm1); -#endif // CGAL_USE_BASIC_VIEWER - } diff --git a/Triangulation_2/examples/Triangulation_2/CMakeLists.txt b/Triangulation_2/examples/Triangulation_2/CMakeLists.txt index 5eb6e369b69..f968d4b7ef0 100644 --- a/Triangulation_2/examples/Triangulation_2/CMakeLists.txt +++ b/Triangulation_2/examples/Triangulation_2/CMakeLists.txt @@ -6,7 +6,14 @@ project( Triangulation_2_Examples ) cmake_minimum_required(VERSION 2.8.10) -find_package(CGAL QUIET) +find_package(CGAL COMPONENTS Qt5) + +if(CGAL_Qt5_FOUND) + find_package(QGLViewer) + if (TARGET QGLViewer::QGLViewer) + add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS) + endif() +endif() if ( CGAL_FOUND ) @@ -22,6 +29,10 @@ if ( CGAL_FOUND ) create_single_source_cgal_program( "${cppfile}" ) endforeach() + if(CGAL_Qt5_FOUND AND TARGET QGLViewer::QGLViewer) + target_link_libraries(draw_triangulation_2 CGAL::CGAL_Qt5 QGLViewer::QGLViewer) + endif() + else() message(STATUS "This program requires the CGAL library, and will not be compiled.") diff --git a/Triangulation_2/examples/Triangulation_2/draw_triangulation_2.cpp b/Triangulation_2/examples/Triangulation_2/draw_triangulation_2.cpp new file mode 100644 index 00000000000..ec8f03b0e3b --- /dev/null +++ b/Triangulation_2/examples/Triangulation_2/draw_triangulation_2.cpp @@ -0,0 +1,21 @@ +#include +#include +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef CGAL::Triangulation_2 Triangulation; +typedef Triangulation::Point Point; + +int main() { + std::ifstream in("data/triangulation_prog1.cin"); + std::istream_iterator begin(in); + std::istream_iterator end; + + Triangulation t; + t.insert(begin, end); + + CGAL::draw(t); + + return EXIT_SUCCESS; +} diff --git a/Triangulation_2/examples/Triangulation_2/regular.cpp b/Triangulation_2/examples/Triangulation_2/regular.cpp index 10bd101a4f9..4cc0a1857ad 100644 --- a/Triangulation_2/examples/Triangulation_2/regular.cpp +++ b/Triangulation_2/examples/Triangulation_2/regular.cpp @@ -3,10 +3,6 @@ #include -#ifdef CGAL_USE_BASIC_VIEWER -#include -#endif - typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef CGAL::Regular_triangulation_2 Regular_triangulation; @@ -29,9 +25,5 @@ int main() std::cout << "number of hidden vertices : " ; std::cout << rt.number_of_hidden_vertices() << std::endl; -#ifdef CGAL_USE_BASIC_VIEWER - CGAL::display(rt); -#endif // CGAL_USE_BASIC_VIEWER - return 0; } diff --git a/Triangulation_2/include/CGAL/draw_triangulation_2.h b/Triangulation_2/include/CGAL/draw_triangulation_2.h index 63d82ced015..938501bdddc 100644 --- a/Triangulation_2/include/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/include/CGAL/draw_triangulation_2.h @@ -153,7 +153,7 @@ template void draw(const T2& at2, const char* title="T2 Viewer", bool nofill=false) -{ return display(at2, title, nofill); } +{ draw(at2, title, nofill); } } // End namespace CGAL diff --git a/Triangulation_3/examples/Triangulation_3/CMakeLists.txt b/Triangulation_3/examples/Triangulation_3/CMakeLists.txt index c9673ba28b7..7cc0fceafd9 100644 --- a/Triangulation_3/examples/Triangulation_3/CMakeLists.txt +++ b/Triangulation_3/examples/Triangulation_3/CMakeLists.txt @@ -3,7 +3,11 @@ project( Triangulation_3_Examples ) cmake_minimum_required(VERSION 2.8.12) -find_package(CGAL QUIET) +find_package(CGAL COMPONENTS Qt5) + +if(CGAL_Qt5_FOUND) + add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS) +endif() if ( CGAL_FOUND ) create_single_source_cgal_program( "adding_handles_3.cpp" ) @@ -20,19 +24,9 @@ if ( CGAL_FOUND ) create_single_source_cgal_program( "simple_triangulation_3.cpp" ) create_single_source_cgal_program( "simplex.cpp" ) - find_package( TBB QUIET ) - - if( TBB_FOUND ) - include( CGAL_target_use_TBB ) - - create_single_source_cgal_program( "parallel_insertion_and_removal_in_regular_3.cpp" ) - create_single_source_cgal_program( "parallel_insertion_in_delaunay_3.cpp" ) - create_single_source_cgal_program( "sequential_parallel.cpp" ) - CGAL_target_use_TBB( parallel_insertion_and_removal_in_regular_3 ) - CGAL_target_use_TBB( parallel_insertion_in_delaunay_3 ) - CGAL_target_use_TBB( sequential_parallel ) - else() - message(STATUS "NOTICE: a few examples require TBB and will not be compiled.") + create_single_source_cgal_program("draw_triangulation_3.cpp") + if(CGAL_Qt5_FOUND) + target_link_libraries(draw_triangulation_3 CGAL::CGAL_Qt5) endif() else() diff --git a/Triangulation_3/examples/Triangulation_3/draw_triangulation_3.cpp b/Triangulation_3/examples/Triangulation_3/draw_triangulation_3.cpp new file mode 100644 index 00000000000..3806854f938 --- /dev/null +++ b/Triangulation_3/examples/Triangulation_3/draw_triangulation_3.cpp @@ -0,0 +1,21 @@ +#include +#include +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef CGAL::Delaunay_triangulation_3 DT3; +typedef CGAL::Creator_uniform_3 Creator; + +int main() +{ + std::vector points; + CGAL::Random_points_in_sphere_3 g(1.0); + CGAL::cpp11::copy_n(g, 50, std::back_inserter(points)); + + DT3 dt3(points.begin(), points.end()); + + CGAL::draw(dt3); + + return EXIT_SUCCESS; +} diff --git a/Triangulation_3/examples/Triangulation_3/regular_3.cpp b/Triangulation_3/examples/Triangulation_3/regular_3.cpp index 2a75e3f53b0..3c29cb1e0e3 100644 --- a/Triangulation_3/examples/Triangulation_3/regular_3.cpp +++ b/Triangulation_3/examples/Triangulation_3/regular_3.cpp @@ -3,10 +3,6 @@ #include #include -#ifdef CGAL_USE_BASIC_VIEWER -#include -#endif - typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef K::FT Weight; @@ -44,10 +40,6 @@ int main() std::cout << "Number of vertices : " << T.number_of_vertices() << std::endl; -#ifdef CGAL_USE_BASIC_VIEWER - display(T); -#endif // CGAL_USE_BASIC_VIEWER - // removal of all vertices int count = 0; while (T.number_of_vertices() > 0) { diff --git a/Triangulation_3/include/CGAL/draw_triangulation_3.h b/Triangulation_3/include/CGAL/draw_triangulation_3.h index 3affe83d4bc..a2d96d360ad 100644 --- a/Triangulation_3/include/CGAL/draw_triangulation_3.h +++ b/Triangulation_3/include/CGAL/draw_triangulation_3.h @@ -157,7 +157,7 @@ template void draw(const T3& at3, const char* title="t3_viewer", bool nofill=false) -{ return display(at3, title, nofill); } +{ draw(at3, title, nofill); } } // End namespace CGAL