diff --git a/AABB_tree/demo/AABB_tree/CMakeLists.txt b/AABB_tree/demo/AABB_tree/CMakeLists.txt index e6e619906be..4c5aca422de 100644 --- a/AABB_tree/demo/AABB_tree/CMakeLists.txt +++ b/AABB_tree/demo/AABB_tree/CMakeLists.txt @@ -13,19 +13,21 @@ endif() # Include this package's headers first include_directories( BEFORE ./ ./include ../../include ) + # Find CGAL and CGAL Qt5 -find_package(CGAL COMPONENTS Qt5 ) -include( ${CGAL_USE_FILE} ) +find_package(CGAL COMPONENTS Qt5) # Find Qt5 itself find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Gui Svg) +include( ${CGAL_USE_FILE} ) + # Find OpenGL find_package(OpenGL) # Find QGLViewer if(Qt5_FOUND) - find_package(QGLViewer ) + find_package(QGLViewer) endif(Qt5_FOUND) if(CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND) @@ -45,13 +47,13 @@ if(CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_FO qt5_generate_moc( "Scene.h" "${CMAKE_CURRENT_BINARY_DIR}/Scene_moc.cpp" ) add_file_dependencies( Scene_moc.cpp "${CMAKE_CURRENT_SOURCE_DIR}/Scene.h" ) - qt5_add_resources ( RESOURCE_FILES AABB_demo.qrc ) + qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES AABB_demo.qrc ) add_file_dependencies( AABB_demo.cpp "${CMAKE_CURRENT_BINARY_DIR}/MainWindow_moc.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Viewer_moc.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Scene_moc.cpp" ) - add_executable ( AABB_demo AABB_demo.cpp ${UI_FILES} ${RESOURCE_FILES} ) + add_executable ( AABB_demo AABB_demo.cpp ${UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) qt5_use_modules(AABB_demo Gui OpenGL Xml Script Svg ) # Link with Qt libraries target_link_libraries( AABB_demo ${QT_LIBRARIES} ) @@ -65,7 +67,7 @@ if(CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_FO add_to_cached_list( CGAL_EXECUTABLE_TARGETS AABB_demo ) -else (CGAL_FOUND AND CGAL_CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND) +else (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND) set(AABB_MISSING_DEPS "") @@ -74,7 +76,7 @@ else (CGAL_FOUND AND CGAL_CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLV endif() if(NOT CGAL_Qt5_FOUND) - set(AABB_MISSING_DEPS "the CGAL Qt5 library, ${AABB_MISSING_DEPS}") + set(AABB_MISSING_DEPS "CGAL_Qt5, ${AABB_MISSING_DEPS}") endif() if(NOT Qt5_FOUND) @@ -87,7 +89,7 @@ else (CGAL_FOUND AND CGAL_CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLV if(NOT QGLVIEWER_FOUND) set(AABB_MISSING_DEPS "QGLViewer, ${AABB_MISSING_DEPS}") - endif() + endif() message(STATUS "NOTICE: This demo requires ${AABB_MISSING_DEPS}and will not be compiled.") diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_E08_tree.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_E08_tree.h index 5367ebd10e8..0a6db49ff2c 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_E08_tree.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_E08_tree.h @@ -988,7 +988,7 @@ Bitstream_descartes_E08_tree // next try heuristic alpha with small denom (failures don't count) log_alpha_den = 4; alpha_den_4 = 1L << (log_alpha_den - 2); - alpha_num = CGAL::default_random.get_int( // TODO .get_long + alpha_num = CGAL::get_default_random().get_int( // TODO .get_long alpha_den_4, 3*alpha_den_4 + 1 ); ++(this->ptr()->subdiv_tries_); @@ -999,7 +999,7 @@ Bitstream_descartes_E08_tree log_alpha_den = 4 + this->ptr()->ceil_log_degree_; alpha_den_4 = 1L << (log_alpha_den - 2); do { - alpha_num = CGAL::default_random.get_int( // TODO .get_long + alpha_num = CGAL::get_default_random().get_int( // TODO .get_long alpha_den_4, 3*alpha_den_4 + 1 ); ++(this->ptr()->subdiv_tries_); diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_rndl_tree.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_rndl_tree.h index 3e26f0d5098..5181c5c5384 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_rndl_tree.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_rndl_tree.h @@ -1327,7 +1327,7 @@ Bitstream_descartes_rndl_tree // next try heuristic alpha with small denom (failures don't count) log_alpha_den = 4; alpha_den_4 = 1L << (log_alpha_den - 2); - alpha_num = CGAL::default_random.get_int( // TODO .get_long + alpha_num = CGAL::get_default_random().get_int( // TODO .get_long alpha_den_4, 3*alpha_den_4 + 1 ); ++(n->subdiv_tries_); @@ -1338,7 +1338,7 @@ Bitstream_descartes_rndl_tree log_alpha_den = 5 + this->ptr()->ceil_log_degree_; alpha_den_4 = 1L << (log_alpha_den - 2); do { - alpha_num = CGAL::default_random.get_int( // TODO .get_long + alpha_num = CGAL::get_default_random().get_int( // TODO .get_long alpha_den_4, 3*alpha_den_4 + 1 ); ++(n->subdiv_tries_); diff --git a/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt b/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt index d91c658f42e..d66ed7474f1 100644 --- a/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt +++ b/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt @@ -32,9 +32,9 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_ qt5_wrap_ui( uis MainWindow.ui ) # qrc files (resources files, that contain icons, at least) - qt5_add_resources ( RESOURCE_FILES ./Alpha_shape_3.qrc ) + qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./Alpha_shape_3.qrc ) - add_executable ( Alpha_shape_3 Alpha_shape_3.cpp MainWindow.cpp Viewer.cpp ${uis} ${RESOURCE_FILES} ) + add_executable ( Alpha_shape_3 Alpha_shape_3.cpp MainWindow.cpp Viewer.cpp ${uis} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) qt5_use_modules(Alpha_shape_3 Xml Script OpenGL Svg) add_to_cached_list( CGAL_EXECUTABLE_TARGETS Alpha_shape_3 ) diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CMakeLists.txt b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CMakeLists.txt index 9f7094158c7..ee6a26bfa05 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CMakeLists.txt +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CMakeLists.txt @@ -23,7 +23,7 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND CGAL_Core_FOUND) OverlayDialog.ui ArrangementDemoPropertiesDialog.ui ) - qt5_wrap_cpp( arrangement_2_mocs + qt5_wrap_cpp( CGAL_Qt5_MOC_FILES ArrangementDemoWindow.h ArrangementDemoTab.h Callback.h @@ -35,7 +35,7 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND CGAL_Core_FOUND) PropertyValueDelegate.h #PropertyValueDelegate.cpp ) - qt5_add_resources( arrangement_2_resources + qt5_add_resources( CGAL_Qt5_RESOURCE_FILES ArrangementDemoWindow.qrc ) add_executable( arrangement_2 @@ -61,9 +61,9 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND CGAL_Core_FOUND) DeleteCurveModeItemEditor.cpp PointsGraphicsItem.cpp VerticalRayGraphicsItem.cpp - ${arrangement_2_mocs} + ${CGAL_Qt5_MOC_FILES} ${arrangement_2_uis} - ${arrangement_2_resources} + ${CGAL_Qt5_RESOURCE_FILES} ) qt5_use_modules(arrangement_2 Widgets Script) target_link_libraries( arrangement_2 diff --git a/Boolean_set_operations_2/demo/Boolean_set_operations_2_GraphicsView/CMakeLists.txt b/Boolean_set_operations_2/demo/Boolean_set_operations_2_GraphicsView/CMakeLists.txt index 1f285d32568..7edec3d5852 100644 --- a/Boolean_set_operations_2/demo/Boolean_set_operations_2_GraphicsView/CMakeLists.txt +++ b/Boolean_set_operations_2/demo/Boolean_set_operations_2_GraphicsView/CMakeLists.txt @@ -26,13 +26,13 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND CGAL_Core_FOUND ) qt5_wrap_ui( CDT_UI_FILES boolean_operations_2.ui ) # qrc files (resources files, that contain icons, at least) - qt5_add_resources ( CDT_RESOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/boolean_operations_2.qrc ) + qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/boolean_operations_2.qrc ) # use the Qt MOC preprocessor on classes that derives from QObject qt5_generate_moc( "boolean_operations_2.cpp" "${CMAKE_CURRENT_BINARY_DIR}/boolean_operations_2.moc" ) # The executable itself. - add_executable ( boolean_operations_2 ${CMAKE_CURRENT_SOURCE_DIR}/boolean_operations_2.cpp boolean_operations_2.moc ${CDT_UI_FILES} ${CDT_RESOURCE_FILES} ) + add_executable ( boolean_operations_2 ${CMAKE_CURRENT_SOURCE_DIR}/boolean_operations_2.cpp boolean_operations_2.moc ${CGAL_Qt5_MOC_FILES} ${CDT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ) qt5_use_modules(boolean_operations_2 Widgets Script Svg) # Link with Qt libraries target_link_libraries( boolean_operations_2 ${QT_LIBRARIES} ) diff --git a/Boolean_set_operations_2/include/CGAL/General_polygon_2.h b/Boolean_set_operations_2/include/CGAL/General_polygon_2.h index 4616075685a..5654bb36896 100644 --- a/Boolean_set_operations_2/include/CGAL/General_polygon_2.h +++ b/Boolean_set_operations_2/include/CGAL/General_polygon_2.h @@ -191,7 +191,7 @@ std::ostream { typename General_polygon_2::Curve_const_iterator i; - switch(os.iword(IO::mode)) { + switch(get_mode(os)) { case IO::ASCII : os << p.size() << ' '; for (i = p.curves_begin(); i != p.curves_end(); ++i) { diff --git a/Boolean_set_operations_2/include/CGAL/General_polygon_with_holes_2.h b/Boolean_set_operations_2/include/CGAL/General_polygon_with_holes_2.h index e9891870d89..82d9cf4cf71 100644 --- a/Boolean_set_operations_2/include/CGAL/General_polygon_with_holes_2.h +++ b/Boolean_set_operations_2/include/CGAL/General_polygon_with_holes_2.h @@ -143,7 +143,7 @@ std::ostream { typename General_polygon_with_holes_2::Hole_const_iterator hit; - switch(os.iword(IO::mode)) { + switch(get_mode(os)) { case IO::ASCII : os << p.outer_boundary() << ' ' << p.number_of_holes()<< ' '; for (hit = p.holes_begin(); hit != p.holes_end(); ++hit) { diff --git a/Boolean_set_operations_2/include/CGAL/Polygon_with_holes_2.h b/Boolean_set_operations_2/include/CGAL/Polygon_with_holes_2.h index 0963fe78ff5..64a9f2b69d9 100644 --- a/Boolean_set_operations_2/include/CGAL/Polygon_with_holes_2.h +++ b/Boolean_set_operations_2/include/CGAL/Polygon_with_holes_2.h @@ -77,7 +77,7 @@ std::ostream& operator<<(std::ostream &os, { typename Polygon_with_holes_2::Hole_const_iterator i; - switch(os.iword(IO::mode)) { + switch(get_mode(os)) { case IO::ASCII : os << p.outer_boundary() << ' ' << p.number_of_holes()<<' '; for (i = p.holes_begin(); i != p.holes_end(); ++i) { diff --git a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_circle_2.h b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_circle_2.h index a8726337fa4..7dd80899f13 100644 --- a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_circle_2.h +++ b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_circle_2.h @@ -130,7 +130,7 @@ template < class InputIterator > Min_circle_2( InputIterator first, InputIterator last, bool randomize, -Random& random = CGAL::default_random, +Random& random = CGAL::get_default_random(), const Traits& traits = Traits() ); /*! diff --git a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_ellipse_2.h b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_ellipse_2.h index a8a329c7840..c5b172a7d8f 100644 --- a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_ellipse_2.h +++ b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_ellipse_2.h @@ -119,7 +119,7 @@ template < class InputIterator > Min_Ellipse_2( InputIterator first, InputIterator last, bool randomize, -Random& random = default_random, +Random& random = get_default_random(), const Traits& traits = Traits() ); /*! diff --git a/Box_intersection_d/test/Box_intersection_d/util.h b/Box_intersection_d/test/Box_intersection_d/util.h index e9059d7a81d..7daacea3951 100644 --- a/Box_intersection_d/test/Box_intersection_d/util.h +++ b/Box_intersection_d/test/Box_intersection_d/util.h @@ -42,9 +42,9 @@ struct Util { NT lo[DIM], max[DIM]; for( int d = 0; d < DIM; ++d ) { lo[d] = - (NT)(CGAL::default_random.get_double() * (n - maxEdgeLength)); + (NT)(CGAL::get_default_random().get_double() * (n - maxEdgeLength)); max[d] = - (NT)(lo[d] + 1 + (CGAL::default_random.get_double() * maxEdgeLength)); + (NT)(lo[d] + 1 + (CGAL::get_default_random().get_double() * maxEdgeLength)); } boxes.push_back( Box( &lo[0], &max[0]) ); } diff --git a/CGAL_Core/include/CGAL/CORE/CoreAux.h b/CGAL_Core/include/CGAL/CORE/CoreAux.h index 37eb1e3eb1f..2d2be9bea14 100644 --- a/CGAL_Core/include/CGAL/CORE/CoreAux.h +++ b/CGAL_Core/include/CGAL/CORE/CoreAux.h @@ -62,7 +62,7 @@ namespace CORE { const double relEps = (1.0 + std::ldexp(1.0, -52)); /// CORE_DIAGFILE is used for all warning and error messages -extern const char* CORE_DIAGFILE; +const char* const CORE_DIAGFILE = "Core_Diagnostics"; // global file name /// template function returns the maximum value of two template diff --git a/CGAL_Core/include/CGAL/CORE/CoreAux_impl.h b/CGAL_Core/include/CGAL/CORE/CoreAux_impl.h index cfb72ece3c6..901ec82635c 100644 --- a/CGAL_Core/include/CGAL/CORE/CoreAux_impl.h +++ b/CGAL_Core/include/CGAL/CORE/CoreAux_impl.h @@ -194,9 +194,6 @@ int IntExponent(double d) { return e-53; } -/// CORE_DIAGFILE is file name for core_error(..) output. -const char* CORE_DIAGFILE = "Core_Diagnostics"; // global file name - /// core_error is the method to write Core Library warning or error messages /** Both warnings and errors are written to a file called CORE_DIAGFILE. * But errors are also written on std:cerr (similar to std::perror()). diff --git a/CGAL_Core/include/CGAL/CORE/Impl.h b/CGAL_Core/include/CGAL/CORE/Impl.h index 57d47a3f6e3..73bc8b1e7ae 100644 --- a/CGAL_Core/include/CGAL/CORE/Impl.h +++ b/CGAL_Core/include/CGAL/CORE/Impl.h @@ -40,6 +40,12 @@ #define CORE_INLINE #endif +#ifdef CGAL_HEADER_ONLY +#define CGAL_INLINE_FUNCTION inline +#else +#define CGAL_INLINE_FUNCTION +#endif + // Macros for memory pool #ifdef CORE_DISABLE_MEMORY_POOL #define CORE_NEW(T) @@ -51,9 +57,9 @@ #define CORE_DELETE(T) void operator delete( void *p, size_t ); #define CORE_MEMORY_IMPL(T) \ - void *T::operator new( size_t size) \ + CGAL_INLINE_FUNCTION void *T::operator new( size_t size) \ { return MemoryPool::global_allocator().allocate(size); } \ - void T::operator delete( void *p, size_t ) \ + CGAL_INLINE_FUNCTION void T::operator delete( void *p, size_t ) \ { MemoryPool::global_allocator().free(p); } #endif diff --git a/CGAL_Core/src/CGAL_Core/CMakeLists.txt b/CGAL_Core/src/CGAL_Core/CMakeLists.txt index 08b450fb314..56348a8866d 100644 --- a/CGAL_Core/src/CGAL_Core/CMakeLists.txt +++ b/CGAL_Core/src/CGAL_Core/CMakeLists.txt @@ -1,5 +1,5 @@ message("Configuring libCGAL_Core") - + use_essential_libs() include_directories (SYSTEM ${CGAL_3RD_PARTY_INCLUDE_DIRS}) @@ -9,12 +9,14 @@ add_definitions(${CGAL_3RD_PARTY_DEFINITIONS}) link_directories ( ${CGAL_LIBRARIES_DIR} ${CGAL_3RD_PARTY_LIBRARIES_DIRS} ) collect_cgal_library(CGAL_Core "") - -# CGAL_Core does not depend on CGAL in either DEBUG or RELEASE, but we -# still link it. -target_link_libraries( CGAL_Core CGAL ${CGAL_3RD_PARTY_LIBRARIES} ) -add_dependencies( CGAL_Core CGAL ) +if(NOT CGAL_HEADER_ONLY) + # CGAL_Core does not depend on CGAL in either DEBUG or RELEASE, but we + # still link it. + target_link_libraries( CGAL_Core CGAL ${CGAL_3RD_PARTY_LIBRARIES} ) + + add_dependencies( CGAL_Core CGAL ) +endif() message("libCGAL_Core is configured") diff --git a/CGAL_ImageIO/src/CGAL_ImageIO/CMakeLists.txt b/CGAL_ImageIO/src/CGAL_ImageIO/CMakeLists.txt index 7b0a1fa3e37..8a32acca916 100644 --- a/CGAL_ImageIO/src/CGAL_ImageIO/CMakeLists.txt +++ b/CGAL_ImageIO/src/CGAL_ImageIO/CMakeLists.txt @@ -1,54 +1,77 @@ message("Configuring libCGAL_ImageIO") -find_package( OpenGL ) -find_package( ZLIB ) +if(NOT CGAL_HEADER_ONLY) + find_package( OpenGL ) + find_package( ZLIB ) + if(OPENGL_FOUND) + message( STATUS "OpenGL include: ${OPENGL_INCLUDE_DIR}" ) + message( STATUS "OpenGL libraries: ${OPENGL_LIBRARIES}" ) -if(OPENGL_FOUND) - message( STATUS "OpenGL include: ${OPENGL_INCLUDE_DIR}" ) - message( STATUS "OpenGL libraries: ${OPENGL_LIBRARIES}" ) - - cache_set(CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR} ) - cache_set(CGAL_ImageIO_3RD_PARTY_LIBRARIES ${OPENGL_LIBRARIES} ) + cache_set(CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS "${CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS}" ${OPENGL_INCLUDE_DIR}) + cache_set(CGAL_ImageIO_3RD_PARTY_LIBRARIES ${OPENGL_LIBRARIES} ) - if(ZLIB_FOUND) - get_dependency_version(ZLIB) - cache_set(CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS ${CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR} ) - cache_set(CGAL_ImageIO_3RD_PARTY_LIBRARIES ${CGAL_ImageIO_3RD_PARTY_LIBRARIES} ${ZLIB_LIBRARY} ) - cache_set(CGAL_ImageIO_3RD_PARTY_DEFINITIONS "-DCGAL_USE_ZLIB") - cache_set(CGAL_ImageIO_USE_ZLIB "ON") - endif(ZLIB_FOUND) + if(ZLIB_FOUND) + get_dependency_version(ZLIB) + cache_set(CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS ${CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR} ) + cache_set(CGAL_ImageIO_3RD_PARTY_LIBRARIES ${CGAL_ImageIO_3RD_PARTY_LIBRARIES} ${ZLIB_LIBRARY} ) + cache_set(CGAL_ImageIO_3RD_PARTY_DEFINITIONS "-DCGAL_USE_ZLIB") + cache_set(CGAL_ImageIO_USE_ZLIB "ON") + endif(ZLIB_FOUND) - set( CGAL_ImageIO_BASENAME CGAL_ImageIO) - - if(COMMAND add_config_flag) - set( CGAL_HAS_IMAGEIO TRUE ) - add_config_flag( CGAL_HAS_IMAGEIO ) - endif() + set( CGAL_ImageIO_BASENAME CGAL_ImageIO) - use_essential_libs() + if(WITH_VTK) + if( VTK_FOUND ) - include_directories( SYSTEM ${CGAL_3RD_PARTY_INCLUDE_DIRS} ${CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS} .) - - link_directories ( ${CGAL_LIBRARIES_DIR} ${CGAL_3RD_PARTY_LIBRARIES_DIRS} ) + message(STATUS "VTK-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION} found. Build VTK support in ${CGAL_ImageIO_BASENAME}.") + include( ${VTK_USE_FILE} ) + cache_set(CGAL_ImageIO_3RD_PARTY_DEFINITIONS ${CGAL_ImageIO_3RD_PARTY_DEFINITIONS} -DCGAL_USE_VTK) + cache_set(CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS ${CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS} ${VTK_INCLUDE_DIRS} ) + cache_set(CGAL_ImageIO_3RD_PARTY_LIBRARIES_DIRS ${CGAL_ImageIO_3RD_PARTY_LIBRARIES_DIRS} ${vtkImagingCore_RUNTIME_LIBRARY_DIRS} ${vtkImagingCore_LIBRARY_DIRS} ${vtkIOImage_RUNTIME_LIBRARY_DIRS} ${vtkIOImage_LIBRARY_DIRS} ${vtkFiltersImaging_RUNTIME_LIBRARY_DIRS} ${vtkFiltersImaging_LIBRARY_DIRS}) + cache_set(CGAL_ImageIO_3RD_PARTY_LIBRARIES ${CGAL_ImageIO_3RD_PARTY_LIBRARIES} ${VTK_LIBRARIES} ) + else() + message(STATUS "VTK not found.") + endif() + endif() + if(COMMAND add_config_flag) + set( CGAL_HAS_IMAGEIO TRUE ) + add_config_flag( CGAL_HAS_IMAGEIO ) + endif() + + use_essential_libs() + + include_directories( SYSTEM ${CGAL_3RD_PARTY_INCLUDE_DIRS} ${CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS} .) + + link_directories ( ${CGAL_LIBRARIES_DIR} ${CGAL_3RD_PARTY_LIBRARIES_DIRS} ) + endif(OPENGL_FOUND) + +else (NOT CGAL_HEADER_ONLY) + cache_set(CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}) +endif() + +if(CGAL_HEADER_ONLY OR OPENGL_FOUND) collect_cgal_library( CGAL_ImageIO "") - - add_dependencies( CGAL_ImageIO CGAL ) - +endif() + +if(NOT CGAL_HEADER_ONLY AND OPENGL_FOUND) add_definitions( ${CGAL_3RD_PARTY_DEFINITIONS} ${CGAL_ImageIO_3RD_PARTY_DEFINITIONS} ) - + + add_dependencies( CGAL_ImageIO CGAL ) + # CGAL_ImageIO only depends on CGAL in DEBUG, but we still link it # in both build types. target_link_libraries( CGAL_ImageIO CGAL ${CGAL_3RD_PARTY_LIBRARIES} ${CGAL_ImageIO_3RD_PARTY_LIBRARIES} ) +endif() + +if(NOT CGAL_HEADER_ONLY AND NOT OPENGL_FOUND) + message( STATUS "libCGAL_ImageIO needs OpenGL, cannot be configured.") +endif() message("libCGAL_ImageIO is configured") - -else(OPENGL_FOUND) - message( STATUS "libCGAL_ImageIO needs OpenGL, cannot be configured.") -endif(OPENGL_FOUND) - -if(NOT ZLIB_FOUND) - message( STATUS "NOTICE: libCGAL_ImageIO needs ZLib to read compressed files. That feature will not be activated.") -endif(NOT ZLIB_FOUND) + +if(NOT CGAL_HEADER_ONLY AND NOT ZLIB_FOUND) + message( STATUS "NOTICE: libCGAL_ImageIO needs ZLib to read compressed files. That feature will not be activated.") +endif() diff --git a/CGAL_ImageIO/src/CGAL_ImageIO/iris.h b/CGAL_ImageIO/src/CGAL_ImageIO/iris.h index 81eb52e0b31..7331dd36118 100644 --- a/CGAL_ImageIO/src/CGAL_ImageIO/iris.h +++ b/CGAL_ImageIO/src/CGAL_ImageIO/iris.h @@ -31,7 +31,7 @@ int readIrisImage( const char *name, _image *im ); int testIrisHeader(char *magic,const char *name); #ifdef CGAL_HEADER_ONLY -#include +#include "iris_impl.h" #endif // CGAL_HEADER_ONLY #endif diff --git a/Circular_kernel_3/demo/Circular_kernel_3/CMakeLists.txt b/Circular_kernel_3/demo/Circular_kernel_3/CMakeLists.txt index 3a590f6c9fc..37c9470ce74 100644 --- a/Circular_kernel_3/demo/Circular_kernel_3/CMakeLists.txt +++ b/Circular_kernel_3/demo/Circular_kernel_3/CMakeLists.txt @@ -19,7 +19,7 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_ include_directories (${QGLVIEWER_INCLUDE_DIR}) include_directories (BEFORE ../../include ./ ) - add_executable ( Circular_kernel_3 Circular_kernel_3.cpp Viewer.cpp ) + add_executable (Circular_kernel_3 Circular_kernel_3.cpp Viewer.cpp ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) qt5_use_modules( Circular_kernel_3 Xml Script OpenGL) diff --git a/Documentation/doc/Documentation/Installation.txt b/Documentation/doc/Documentation/Installation.txt index 85c01e89aca..6e835dd33cc 100644 --- a/Documentation/doc/Documentation/Installation.txt +++ b/Documentation/doc/Documentation/Installation.txt @@ -324,6 +324,21 @@ variable `BUILD_SHARED_LIBS` to `FALSE`. If you use These setting affect the variants of third-party libraries (see next section) selected whenever the choice is available. +\subsection subsection_headeronly Header-only option + +Since \cgal 4.X, \cgal can be used in headers only mode, i.e. without compiling the \cgal libraries and linking with these libraries when compiling examples, tests and demo. This possibility can be enabled by setting the value of the CMake variable `CGAL_HEADERS_ONLY` to `ON`. + +One advantage of using \cgal in header-only mode is that you do not need to compile and install \cgal libraries before compiling a given example or demo. Note that even in header-only mode we still need to run cmake on \cgal in order to generate different configuration files. So, setting up \cgal becomes now: + +
+cd CGAL-\cgalReleaseNumber # go to \cgal directory
+cmake . # configure \cgal
+
+ +and we do not need to run make anymore. + +There is one possible problem when using \cgal in header-only mode on a Windows operating system when compiling a program using several modules (executable programs or dynamic-link libraries DLL). If two different modules use the same static variable, this variable is defined independently in each of these modules. If one module modifies the value of this variable, it will not be modified in the other module, which could induce an unexpected behavior. In \cgal, this concerns only a few specific variables: the default random, the failure behavior, IO mode. One example is the following: if you change the default random in one DLL, then if you use the default random in another DLL, you will not obtain the modified default random but the original one. + \section secessential3rdpartysoftware Essential Third Party Libraries The focus of \cgal is on geometry, and we rely on other diff --git a/Envelope_3/include/CGAL/Envelope_3/set_dividors.h b/Envelope_3/include/CGAL/Envelope_3/set_dividors.h index 0bd114305b0..2b491ad016e 100644 --- a/Envelope_3/include/CGAL/Envelope_3/set_dividors.h +++ b/Envelope_3/include/CGAL/Envelope_3/set_dividors.h @@ -104,7 +104,7 @@ public: while (begin != end) { - if (CGAL::default_random.get_bool()) + if (CGAL::get_default_random().get_bool()) *set1++ = *begin++; else *set2++ = *begin++; diff --git a/Filtered_kernel/test/Filtered_kernel/Filtered_kernel.cpp b/Filtered_kernel/test/Filtered_kernel/Filtered_kernel.cpp index 0efe05e0c9c..6adf28f86a7 100644 --- a/Filtered_kernel/test/Filtered_kernel/Filtered_kernel.cpp +++ b/Filtered_kernel/test/Filtered_kernel/Filtered_kernel.cpp @@ -43,7 +43,7 @@ int my_rand() { int res; do { - res = int(CGAL::default_random.get_double()*(1<<31)); + res = int(CGAL::get_default_random().get_double()*(1<<31)); } while(res == 0); return res; diff --git a/Filtered_kernel/test/Filtered_kernel/Static_filters.cpp b/Filtered_kernel/test/Filtered_kernel/Static_filters.cpp index 929718ae6c4..ed4f57f3415 100644 --- a/Filtered_kernel/test/Filtered_kernel/Static_filters.cpp +++ b/Filtered_kernel/test/Filtered_kernel/Static_filters.cpp @@ -289,7 +289,7 @@ void compute_epsilons() int main(int argc, char **argv) { int loops = (argc < 2) ? 2000 : std::atoi(argv[1]); - int seed = (argc < 3) ? CGAL::default_random.get_int(0, 1<<30) + int seed = (argc < 3) ? CGAL::get_default_random().get_int(0, 1<<30) : std::atoi(argv[2]); std::cout << "Initializing random generator with seed = " << seed diff --git a/Generator/doc/Generator/CGAL/Random.h b/Generator/doc/Generator/CGAL/Random.h index b8cf7722f9a..29763c3e19e 100644 --- a/Generator/doc/Generator/CGAL/Random.h +++ b/Generator/doc/Generator/CGAL/Random.h @@ -23,7 +23,7 @@ seed, or by using the state functions as described below. We use the boost random library function `boost::rand48` to generate the random numbers. -\sa `CGAL::default_random` +\sa `CGAL::get_default_random` */ @@ -178,8 +178,16 @@ bool operator == ( Random const& random2) const; /*! \ingroup PkgGenerators - The variable `default_random` is the default random numbers generator used for - the generator functions and classes. + The global function `get_default_random()` returns the default random + numbers generator used for the generator functions and classes. +*/ +Random &get_default_random(); + +/*! + \ingroup PkgGenerators + \deprecated The variable `default_random` is the default random + numbers generator used for the generator functions and + classes. Deprecated. Use `get_default_random()` instead. */ extern CGAL::Random default_random; diff --git a/Generator/doc/Generator/CGAL/point_generators_2.h b/Generator/doc/Generator/CGAL/point_generators_2.h index 59767ffb0b6..ef301deffca 100644 --- a/Generator/doc/Generator/CGAL/point_generators_2.h +++ b/Generator/doc/Generator/CGAL/point_generators_2.h @@ -36,7 +36,7 @@ are needed from `rnd` for each point. */ template void perturb_points_2( ForwardIterator first, ForwardIterator last, -double xeps, double yeps = xeps, Random& rnd = default_random, +double xeps, double yeps = xeps, Random& rnd = get_default_random(), Creator creator = Creator_uniform_2::Kernel::RT,P>); @@ -132,7 +132,7 @@ Returns the value of `first2` after inserting the \f$ n\f$ points. template OutputIterator random_collinear_points_2( RandomAccessIterator first, RandomAccessIterator last, -std::size_t n, OutputIterator first2, Random& rnd = default_random, +std::size_t n, OutputIterator first2, Random& rnd = get_default_random(), Creator creator = Creator_uniform_2::Kernel::RT,P>); /// @} @@ -199,7 +199,7 @@ i.e.\ \f$ |*g| < r\f$. Two random numbers are needed from */ Random_points_in_disc_2( double r, Random& rnd = -default_random); +get_default_random()); /// @} @@ -268,7 +268,7 @@ Two random numbers are needed from `rnd` for each point. */ Random_points_in_square_2( double a, Random& rnd = -default_random); +get_default_random()); /// @} @@ -337,7 +337,7 @@ Two random numbers are needed from `rnd` for each point. */ Random_points_in_triangle_2(Point_2& p, Point_2& q, Point_2& r, Random& rnd = -default_random); +get_default_random()); /*! Creates an input iterator `g` generating points of type `Point_2` uniformly @@ -347,7 +347,7 @@ Two random numbers are needed from `rnd` for each point. */ Random_points_in_triangle_2(Triangle_2& t, Random& rnd = -default_random); +get_default_random()); /// @} @@ -418,7 +418,7 @@ i.e.\ \f$ |*g| == r\f$. A single random number is needed from */ Random_points_on_circle_2( double r, Random& rnd = -default_random); +get_default_random()); /// @} @@ -488,7 +488,7 @@ A single random number is needed from `rnd` for each point. The expressions `to_double(p.x())` and `to_double(p.y())` must result in the respective `double` representation of the coordinates of \f$ p\f$, and similarly for \f$ q\f$. */ Random_points_on_segment_2( const Point_2& p, const Point_2& q, -Random& rnd = default_random); +Random& rnd = get_default_random()); /// @} @@ -560,7 +560,7 @@ A single random number is needed from `rnd` for each point. */ Random_points_on_square_2( double a, Random& rnd = -default_random); +get_default_random()); /// @} diff --git a/Generator/doc/Generator/CGAL/point_generators_3.h b/Generator/doc/Generator/CGAL/point_generators_3.h index 2d13cc07db0..2cebf089f82 100644 --- a/Generator/doc/Generator/CGAL/point_generators_3.h +++ b/Generator/doc/Generator/CGAL/point_generators_3.h @@ -95,7 +95,7 @@ Three random numbers are needed from `rnd` for each point. */ Random_points_in_cube_3( double a, Random& rnd = -default_random); +get_default_random()); /// @} @@ -164,7 +164,7 @@ i.e.\ \f$ |*g| < r\f$ . Three random numbers are needed from */ Random_points_in_sphere_3( double r, Random& rnd = -default_random); +get_default_random()); /// @} @@ -233,7 +233,7 @@ Two random numbers are needed from `rnd` for each point. */ Random_points_in_triangle_3(Point_3& p, Point_3& q, Point_3& r, Random& rnd = -default_random); +get_default_random()); /*! Creates an input iterator `g` generating points of type `Point_3` uniformly @@ -243,7 +243,7 @@ Two random numbers are needed from `rnd` for each point. */ Random_points_in_triangle_3(Triangle_3& t, Random& rnd = -default_random); +get_default_random()); /// @} @@ -313,7 +313,7 @@ Three random numbers are needed from `rnd` for each point. */ Random_points_in_tetrahedron_3(Point_3& p, Point_3& q, Point_3& r, Point_3& s, Random& rnd = -default_random); +get_default_random()); /*! Creates an input iterator `g` generating points of type `Point_3` uniformly @@ -323,7 +323,7 @@ Three random numbers are needed from `rnd` for each point. */ Random_points_in_tetrahedron_3(Tetrahedron_3& t, Random& rnd = -default_random); +get_default_random()); /// @} @@ -394,7 +394,7 @@ i.e.\ \f$ |*g| == r\f$ . Two random numbers are needed from */ Random_points_on_sphere_3( double r, Random& rnd = -default_random); +get_default_random()); /// @} diff --git a/Generator/doc/Generator/CGAL/point_generators_d.h b/Generator/doc/Generator/CGAL/point_generators_d.h index 71e32088960..aa103faaa8b 100644 --- a/Generator/doc/Generator/CGAL/point_generators_d.h +++ b/Generator/doc/Generator/CGAL/point_generators_d.h @@ -166,7 +166,7 @@ For every point \f$ p = *g\f$ and for all \f$ i OutputIterator random_selection( RandomAccessIterator first, RandomAccessIterator last, -Size n, OutputIterator result, Random& rnd = default_random); +Size n, OutputIterator result, Random& rnd = get_default_random()); } /* namespace CGAL */ diff --git a/Generator/doc/Generator/PackageDescription.txt b/Generator/doc/Generator/PackageDescription.txt index e4f616d0bb4..d18c6f9c103 100644 --- a/Generator/doc/Generator/PackageDescription.txt +++ b/Generator/doc/Generator/PackageDescription.txt @@ -50,10 +50,7 @@ achieve random permutations for otherwise regular generators ( - `CGAL::random_polygon_2()` - `CGAL::random_selection()` - `CGAL::random_convex_hull_in_disc_2()` - -## Variables ## - -- `CGAL::default_random` +- `CGAL::get_default_random()` ## Classes ## diff --git a/Generator/include/CGAL/point_generators_2.h b/Generator/include/CGAL/point_generators_2.h index 48101f05bbd..8bb24a19b85 100644 --- a/Generator/include/CGAL/point_generators_2.h +++ b/Generator/include/CGAL/point_generators_2.h @@ -504,15 +504,15 @@ public: typedef Random_points_in_triangle_2

This; typedef typename Kernel_traits

::Kernel::Triangle_2 Triangle_2; Random_points_in_triangle_2() {} - Random_points_in_triangle_2( const This& x,Random& rnd = default_random) + Random_points_in_triangle_2( const This& x,Random& rnd = get_default_random()) : Random_generator_base

( 1, rnd ),_p(x._p),_q(x._q),_r(x._r) { generate_point(); } - Random_points_in_triangle_2( const P& p, const P& q, const P& r, Random& rnd = default_random) + Random_points_in_triangle_2( const P& p, const P& q, const P& r, Random& rnd = get_default_random()) : Random_generator_base

( 1, rnd ),_p(p),_q(q),_r(r) { generate_point(); } - Random_points_in_triangle_2( const Triangle_2& triangle,Random& rnd = default_random) + Random_points_in_triangle_2( const Triangle_2& triangle,Random& rnd = get_default_random()) : Random_generator_base

( 1, rnd),_p(triangle[0]),_q(triangle[1]),_r(triangle[2]) { generate_point(); diff --git a/Generator/include/CGAL/point_generators_3.h b/Generator/include/CGAL/point_generators_3.h index 5b9670c63a0..cb5830c6ee7 100644 --- a/Generator/include/CGAL/point_generators_3.h +++ b/Generator/include/CGAL/point_generators_3.h @@ -205,15 +205,15 @@ public: typedef Random_points_in_triangle_3

This; typedef typename Kernel_traits

::Kernel::Triangle_3 Triangle_3; Random_points_in_triangle_3() {} - Random_points_in_triangle_3( const This& x,Random& rnd = default_random) + Random_points_in_triangle_3( const This& x,Random& rnd = get_default_random()) : Random_generator_base

( 1, rnd ),_p(x._p),_q(x._q),_r(x._r) { generate_point(); } - Random_points_in_triangle_3( const P& p, const P& q, const P& r, Random& rnd = default_random) + Random_points_in_triangle_3( const P& p, const P& q, const P& r, Random& rnd = get_default_random()) : Random_generator_base

( 1, rnd ),_p(p),_q(q),_r(r) { generate_point(); } - Random_points_in_triangle_3( const Triangle_3& triangle,Random& rnd = default_random) + Random_points_in_triangle_3( const Triangle_3& triangle,Random& rnd = get_default_random()) : Random_generator_base

( 1, rnd),_p(triangle[0]),_q(triangle[1]),_r(triangle[2]) { generate_point(); @@ -257,15 +257,15 @@ public: typedef Random_points_in_tetrahedron_3

This; typedef typename Kernel_traits

::Kernel::Tetrahedron_3 Tetrahedron_3; Random_points_in_tetrahedron_3() {} - Random_points_in_tetrahedron_3( const This& x,Random& rnd = default_random) + Random_points_in_tetrahedron_3( const This& x,Random& rnd = get_default_random()) : Random_generator_base

( 1, rnd ),_p(x._p),_q(x._q),_r(x._r),_s(x._s) { generate_point(); } - Random_points_in_tetrahedron_3( const P& p, const P& q, const P& r, const P& s,Random& rnd = default_random) + Random_points_in_tetrahedron_3( const P& p, const P& q, const P& r, const P& s,Random& rnd = get_default_random()) : Random_generator_base

( 1, rnd ),_p(p),_q(q),_r(r),_s(s) { generate_point(); } - Random_points_in_tetrahedron_3( const Tetrahedron_3& tetrahedron,Random& rnd = default_random) + Random_points_in_tetrahedron_3( const Tetrahedron_3& tetrahedron,Random& rnd = get_default_random()) : Random_generator_base

( 1, rnd),_p(tetrahedron[0]),_q(tetrahedron[1]),_r(tetrahedron[2]),_s(tetrahedron[3]) { generate_point(); } diff --git a/GraphicsView/demo/Alpha_shapes_2/CMakeLists.txt b/GraphicsView/demo/Alpha_shapes_2/CMakeLists.txt index 66675dd5063..2f6837995c6 100644 --- a/GraphicsView/demo/Alpha_shapes_2/CMakeLists.txt +++ b/GraphicsView/demo/Alpha_shapes_2/CMakeLists.txt @@ -26,13 +26,13 @@ add_definitions(-DQT_NO_KEYWORDS) qt5_wrap_ui( DT_UI_FILES Alpha_shapes_2.ui ) # qrc files (resources files, that contain icons, at least) -qt5_add_resources ( DT_RESOURCE_FILES ./Alpha_shapes_2.qrc ) +qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./Alpha_shapes_2.qrc ) # use the Qt MOC preprocessor on classes that derives from QObject qt5_generate_moc( Alpha_shapes_2.cpp Alpha_shapes_2.moc ) # The executable itself. -add_executable ( Alpha_shapes_2 Alpha_shapes_2.cpp Alpha_shapes_2.moc ${DT_UI_FILES} ${DT_RESOURCE_FILES} ) +add_executable ( Alpha_shapes_2 Alpha_shapes_2.cpp Alpha_shapes_2.moc ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) qt5_use_modules(Alpha_shapes_2 Xml Script OpenGL Svg) diff --git a/GraphicsView/demo/Apollonius_graph_2/CMakeLists.txt b/GraphicsView/demo/Apollonius_graph_2/CMakeLists.txt index 4b6589baba5..94254e29ed8 100644 --- a/GraphicsView/demo/Apollonius_graph_2/CMakeLists.txt +++ b/GraphicsView/demo/Apollonius_graph_2/CMakeLists.txt @@ -24,13 +24,13 @@ add_definitions(-DQT_NO_KEYWORDS) qt5_wrap_ui( DT_UI_FILES Apollonius_graph_2.ui ) # qrc files (resources files, that contain icons, at least) -qt5_add_resources ( DT_RESOURCE_FILES ./Apollonius_graph_2.qrc ) +qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./Apollonius_graph_2.qrc ) # use the Qt MOC preprocessor on classes that derives from QObject qt5_generate_moc( Apollonius_graph_2.cpp Apollonius_graph_2.moc ) # The executable itself. -add_executable ( Apollonius_graph_2 Apollonius_graph_2.cpp Apollonius_graph_2.moc ${DT_UI_FILES} ${DT_RESOURCE_FILES} ) +add_executable ( Apollonius_graph_2 Apollonius_graph_2.cpp Apollonius_graph_2.moc ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) qt5_use_modules(Apollonius_graph_2 Xml Script OpenGL Svg) diff --git a/GraphicsView/demo/Bounding_volumes/CMakeLists.txt b/GraphicsView/demo/Bounding_volumes/CMakeLists.txt index 94b21534a5e..ee7fa785d9b 100644 --- a/GraphicsView/demo/Bounding_volumes/CMakeLists.txt +++ b/GraphicsView/demo/Bounding_volumes/CMakeLists.txt @@ -29,13 +29,13 @@ add_definitions(-DQT_NO_KEYWORDS) qt5_wrap_ui( DT_UI_FILES Bounding_volumes.ui ) # qrc files (resources files, that contain icons, at least) -qt5_add_resources ( DT_RESOURCE_FILES ./Bounding_volumes.qrc ) +qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./Bounding_volumes.qrc ) # use the Qt MOC preprocessor on classes that derives from QObject qt5_generate_moc( "Bounding_volumes.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Bounding_volumes.moc" ) # The executable itself. -add_executable ( Bounding_volumes Bounding_volumes.cpp Bounding_volumes.moc ${DT_UI_FILES} ${DT_RESOURCE_FILES} ) +add_executable ( Bounding_volumes Bounding_volumes.cpp Bounding_volumes.moc ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) qt5_use_modules(Bounding_volumes Xml Script OpenGL Svg) diff --git a/GraphicsView/demo/Circular_kernel_2/CMakeLists.txt b/GraphicsView/demo/Circular_kernel_2/CMakeLists.txt index 14de363998b..2f905476e1d 100644 --- a/GraphicsView/demo/Circular_kernel_2/CMakeLists.txt +++ b/GraphicsView/demo/Circular_kernel_2/CMakeLists.txt @@ -29,13 +29,13 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) qt5_wrap_ui( DT_UI_FILES Circular_kernel_2.ui ) # qrc files (resources files, that contain icons, at least) - qt5_add_resources ( DT_RESOURCE_FILES ./Circular_kernel_2.qrc ) + qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./Circular_kernel_2.qrc ) # use the Qt MOC preprocessor on classes that derives from QObject qt5_generate_moc( "Circular_kernel_2.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Circular_kernel_2.moc" ) # The executable itself. - add_executable ( Circular_kernel_2 Circular_kernel_2.cpp Circular_kernel_2.moc ${DT_UI_FILES} ${DT_RESOURCE_FILES} ) + add_executable ( Circular_kernel_2 Circular_kernel_2.cpp Circular_kernel_2.moc ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) qt5_use_modules(Circular_kernel_2 Xml Script OpenGL Svg) diff --git a/GraphicsView/demo/Generator/CMakeLists.txt b/GraphicsView/demo/Generator/CMakeLists.txt index 03ecc8f3945..cb5451ff279 100644 --- a/GraphicsView/demo/Generator/CMakeLists.txt +++ b/GraphicsView/demo/Generator/CMakeLists.txt @@ -26,13 +26,13 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) qt5_wrap_ui( DT_UI_FILES Generator_2.ui ) # qrc files (resources files, that contain icons, at least) - qt5_add_resources ( DT_RESOURCE_FILES ./Generator_2.qrc ) + qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./Generator_2.qrc ) # use the Qt MOC preprocessor on classes that derives from QObject qt5_generate_moc( "Generator_2.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Generator_2.moc" ) # The executable itself. - add_executable ( Generator_2 Generator_2.cpp Generator_2.moc ${DT_UI_FILES} ${DT_RESOURCE_FILES} ) + add_executable ( Generator_2 Generator_2.cpp Generator_2.moc ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} ) qt5_use_modules(Generator_2 Xml Script OpenGL Svg) diff --git a/GraphicsView/demo/GraphicsView/CMakeLists.txt b/GraphicsView/demo/GraphicsView/CMakeLists.txt index 2012948280f..fdc85764484 100644 --- a/GraphicsView/demo/GraphicsView/CMakeLists.txt +++ b/GraphicsView/demo/GraphicsView/CMakeLists.txt @@ -17,7 +17,7 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) add_definitions(-DQT_NO_KEYWORDS) - add_executable ( min min.cpp ) + add_executable ( min min.cpp ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) qt5_use_modules(min Xml Script OpenGL Svg) diff --git a/GraphicsView/demo/L1_Voronoi_diagram_2/CMakeLists.txt b/GraphicsView/demo/L1_Voronoi_diagram_2/CMakeLists.txt index 1a41c660c21..ef902b01043 100644 --- a/GraphicsView/demo/L1_Voronoi_diagram_2/CMakeLists.txt +++ b/GraphicsView/demo/L1_Voronoi_diagram_2/CMakeLists.txt @@ -28,13 +28,13 @@ add_definitions(-DQT_NO_KEYWORDS) qt5_wrap_ui( DT_UI_FILES L1_voronoi_diagram_2.ui ) # qrc files (resources files, that contain icons, at least) -qt5_add_resources ( DT_RESOURCE_FILES ./L1_voronoi_diagram_2.qrc ) +qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./L1_voronoi_diagram_2.qrc ) # use the Qt MOC preprocessor on classes that derives from QObject qt5_generate_moc( L1_voronoi_diagram_2.cpp L1_voronoi_diagram_2.moc ) # The executable itself. -add_executable ( L1_voronoi_diagram_2 L1_voronoi_diagram_2.cpp L1_voronoi_diagram_2.moc ${DT_UI_FILES} ${DT_RESOURCE_FILES} ) +add_executable ( L1_voronoi_diagram_2 L1_voronoi_diagram_2.cpp L1_voronoi_diagram_2.moc ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} ) qt5_use_modules(L1_voronoi_diagram_2 Xml Script OpenGL Svg) diff --git a/GraphicsView/demo/Largest_empty_rect_2/CMakeLists.txt b/GraphicsView/demo/Largest_empty_rect_2/CMakeLists.txt index 51ee7e854de..b3ee42b7389 100644 --- a/GraphicsView/demo/Largest_empty_rect_2/CMakeLists.txt +++ b/GraphicsView/demo/Largest_empty_rect_2/CMakeLists.txt @@ -27,13 +27,13 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) qt5_wrap_ui( DT_UI_FILES Largest_empty_rectangle_2.ui ) # qrc files (resources files, that contain icons, at least) - qt5_add_resources ( DT_RESOURCE_FILES ./Largest_empty_rectangle_2.qrc ) + qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./Largest_empty_rectangle_2.qrc ) # use the Qt MOC preprocessor on classes that derives from QObject qt5_generate_moc( Largest_empty_rectangle_2.cpp Largest_empty_rectangle_2.moc ) # The executable itself. - add_executable ( Largest_empty_rectangle_2 Largest_empty_rectangle_2.cpp Largest_empty_rectangle_2.moc ${DT_UI_FILES} ${DT_RESOURCE_FILES} ) + add_executable ( Largest_empty_rectangle_2 Largest_empty_rectangle_2.cpp Largest_empty_rectangle_2.moc ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} ) qt5_use_modules(Largest_empty_rectangle_2 Xml Script OpenGL Svg) diff --git a/GraphicsView/demo/Periodic_2_triangulation_2/CMakeLists.txt b/GraphicsView/demo/Periodic_2_triangulation_2/CMakeLists.txt index cb1a4a8df9c..b07b5e2a797 100644 --- a/GraphicsView/demo/Periodic_2_triangulation_2/CMakeLists.txt +++ b/GraphicsView/demo/Periodic_2_triangulation_2/CMakeLists.txt @@ -27,7 +27,7 @@ add_definitions(-DQT_NO_KEYWORDS) qt5_wrap_ui( DT_UI_FILES Periodic_2_triangulation_2.ui ) # qrc files (resources files, that contain icons, at least) -qt5_add_resources ( DT_RESOURCE_FILES ./Periodic_2_triangulation_2.qrc ) +qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./Periodic_2_triangulation_2.qrc ) # use the Qt MOC preprocessor on classes that derives from QObject qt5_generate_moc( Periodic_2_Delaunay_triangulation_2.cpp Periodic_2_triangulation_2.moc ) @@ -43,7 +43,7 @@ SOURCE_GROUP("QT" FILES ${QT_headers}) add_executable ( Periodic_2_Delaunay_triangulation_2 Periodic_2_Delaunay_triangulation_2.cpp Periodic_2_triangulation_2.moc - ${DT_UI_FILES} ${DT_RESOURCE_FILES} + ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} ${headers} ${QT_headers} ${P2T2_headers}) qt5_use_modules( Periodic_2_Delaunay_triangulation_2 Xml Script OpenGL Svg) diff --git a/GraphicsView/demo/Polygon/CMakeLists.txt b/GraphicsView/demo/Polygon/CMakeLists.txt index bfe8288eb64..cf9d013b716 100644 --- a/GraphicsView/demo/Polygon/CMakeLists.txt +++ b/GraphicsView/demo/Polygon/CMakeLists.txt @@ -31,7 +31,7 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) qt5_wrap_ui( DT_UI_FILES Polygon_2.ui ) # qrc files (resources files, that contain icons, at least) - qt5_add_resources ( DT_RESOURCE_FILES ./Polygon_2.qrc ) + qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./Polygon_2.qrc ) # use the Qt MOC preprocessor on classes that derives from QObject qt5_generate_moc( Polygon_2.cpp "${CMAKE_CURRENT_BINARY_DIR}/Polygon_2.moc" ) @@ -40,7 +40,7 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) # SET_PROPERTY(TARGET CGAL PROPERTY IMPORTED_LOCATION ${CGAL_LIBRARY} ) # The executable itself. - add_executable ( Polygon_2 Polygon_2.cpp Polygon_2.moc ${DT_UI_FILES} ${DT_RESOURCE_FILES} ) + add_executable ( Polygon_2 Polygon_2.cpp Polygon_2.moc ${DT_UI_FILES} ${DT_RESOURCE_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} ) qt5_use_modules(Polygon_2 Xml Script OpenGL Svg) diff --git a/GraphicsView/demo/Segment_Delaunay_graph_2/CMakeLists.txt b/GraphicsView/demo/Segment_Delaunay_graph_2/CMakeLists.txt index 0377456c903..fbabb7a45c8 100644 --- a/GraphicsView/demo/Segment_Delaunay_graph_2/CMakeLists.txt +++ b/GraphicsView/demo/Segment_Delaunay_graph_2/CMakeLists.txt @@ -34,13 +34,13 @@ add_definitions(-DQT_NO_KEYWORDS) qt5_wrap_ui( CDT_UI_FILES Segment_voronoi_2.ui ) # qrc files (resources files, that contain icons, at least) -qt5_add_resources ( CDT_RESOURCE_FILES ./Segment_voronoi_2.qrc ) +qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./Segment_voronoi_2.qrc ) # use the Qt MOC preprocessor on classes that derives from QObject qt5_generate_moc( "Segment_voronoi_2.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Segment_voronoi_2.moc" ) # The executable itself. -add_executable ( Segment_voronoi_2 Segment_voronoi_2.cpp Segment_voronoi_2.moc ${CDT_UI_FILES} ${CDT_RESOURCE_FILES} ) +add_executable ( Segment_voronoi_2 Segment_voronoi_2.cpp Segment_voronoi_2.moc ${CDT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) qt5_use_modules(Segment_voronoi_2 Xml Script OpenGL Svg) diff --git a/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/CMakeLists.txt b/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/CMakeLists.txt index dd00fe2349a..d1a4e2dc7fc 100644 --- a/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/CMakeLists.txt +++ b/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/CMakeLists.txt @@ -34,13 +34,13 @@ add_definitions(-DQT_NO_KEYWORDS) qt5_wrap_ui( CDT_UI_FILES Segment_voronoi_2.ui ) # qrc files (resources files, that contain icons, at least) -qt5_add_resources ( CDT_RESOURCE_FILES ./Segment_voronoi_2.qrc ) +qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./Segment_voronoi_2.qrc ) # use the Qt MOC preprocessor on classes that derives from QObject qt5_generate_moc( "Segment_voronoi_linf_2.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Segment_voronoi_linf_2.moc" ) # The executable itself. -add_executable ( Segment_voronoi_linf_2 Segment_voronoi_linf_2.cpp Segment_voronoi_linf_2.moc ${CDT_UI_FILES} ${CDT_RESOURCE_FILES} ) +add_executable ( Segment_voronoi_linf_2 Segment_voronoi_linf_2.cpp Segment_voronoi_linf_2.moc ${CDT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) qt5_use_modules(Segment_voronoi_linf_2 Xml Script OpenGL Svg) diff --git a/GraphicsView/demo/Snap_rounding_2/CMakeLists.txt b/GraphicsView/demo/Snap_rounding_2/CMakeLists.txt index da969e599d7..6d02100ec06 100644 --- a/GraphicsView/demo/Snap_rounding_2/CMakeLists.txt +++ b/GraphicsView/demo/Snap_rounding_2/CMakeLists.txt @@ -26,13 +26,13 @@ add_definitions(-DQT_NO_KEYWORDS) qt5_wrap_ui( DT_UI_FILES Snap_rounding_2.ui ) # qrc files (resources files, that contain icons, at least) -qt5_add_resources ( DT_RESOURCE_FILES ./Snap_rounding_2.qrc ) +qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./Snap_rounding_2.qrc ) # use the Qt MOC preprocessor on classes that derives from QObject qt5_generate_moc( Snap_rounding_2.cpp Snap_rounding_2.moc ) # The executable itself. -add_executable ( Snap_rounding_2 Snap_rounding_2.cpp Snap_rounding_2.moc ${DT_UI_FILES} ${DT_RESOURCE_FILES} ) +add_executable ( Snap_rounding_2 Snap_rounding_2.cpp Snap_rounding_2.moc ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} ) qt5_use_modules(Snap_rounding_2 Xml Script OpenGL Svg) diff --git a/GraphicsView/demo/Spatial_searching_2/CMakeLists.txt b/GraphicsView/demo/Spatial_searching_2/CMakeLists.txt index f23272aebbd..e8b7e6679b0 100644 --- a/GraphicsView/demo/Spatial_searching_2/CMakeLists.txt +++ b/GraphicsView/demo/Spatial_searching_2/CMakeLists.txt @@ -28,13 +28,13 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) qt5_wrap_ui( DT_UI_FILES Spatial_searching_2.ui ) # qrc files (resources files, that contain icons, at least) - qt5_add_resources ( DT_RESOURCE_FILES ./Spatial_searching_2.qrc ) + qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./Spatial_searching_2.qrc ) # use the Qt MOC preprocessor on classes that derives from QObject qt5_generate_moc( Spatial_searching_2.cpp Spatial_searching_2.moc ) # The executable itself. - add_executable ( Spatial_searching_2 Spatial_searching_2.cpp Spatial_searching_2.moc ${DT_UI_FILES} ${DT_RESOURCE_FILES} ) + add_executable ( Spatial_searching_2 Spatial_searching_2.cpp Spatial_searching_2.moc ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} ) qt5_use_modules(Spatial_searching_2 Xml Script OpenGL Svg) diff --git a/GraphicsView/demo/Stream_lines_2/CMakeLists.txt b/GraphicsView/demo/Stream_lines_2/CMakeLists.txt index 7c3524889f6..5c0970ec30d 100644 --- a/GraphicsView/demo/Stream_lines_2/CMakeLists.txt +++ b/GraphicsView/demo/Stream_lines_2/CMakeLists.txt @@ -27,13 +27,13 @@ add_definitions(-DQT_NO_KEYWORDS) qt5_wrap_ui( DT_UI_FILES Stream_lines_2.ui ) # qrc files (resources files, that contain icons, at least) -qt5_add_resources ( DT_RESOURCE_FILES ./Stream_lines_2.qrc ) +qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./Stream_lines_2.qrc ) # use the Qt MOC preprocessor on classes that derives from QObject qt5_generate_moc( Stream_lines_2.cpp Stream_lines_2.moc ) # The executable itself. -add_executable ( Stream_lines_2 Stream_lines_2.cpp Stream_lines_2.moc ${DT_UI_FILES} ${DT_RESOURCE_FILES} ) +add_executable ( Stream_lines_2 Stream_lines_2.cpp Stream_lines_2.moc ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} ) qt5_use_modules(Stream_lines_2 Xml Script OpenGL Svg) diff --git a/GraphicsView/demo/Triangulation_2/CMakeLists.txt b/GraphicsView/demo/Triangulation_2/CMakeLists.txt index ee7be01bc3b..fa356897687 100644 --- a/GraphicsView/demo/Triangulation_2/CMakeLists.txt +++ b/GraphicsView/demo/Triangulation_2/CMakeLists.txt @@ -40,7 +40,7 @@ qt5_add_resources ( CDT_RESOURCE_FILES ./Constrained_Delaunay_triangulation_2.qr qt5_generate_moc( "Constrained_Delaunay_triangulation_2.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Constrained_Delaunay_triangulation_2.moc" ) # The executable itself. -add_executable ( Constrained_Delaunay_triangulation_2 Constrained_Delaunay_triangulation_2.cpp Constrained_Delaunay_triangulation_2.moc ${CDT_UI_FILES} ${CDT_RESOURCE_FILES} ) +add_executable ( Constrained_Delaunay_triangulation_2 Constrained_Delaunay_triangulation_2.cpp Constrained_Delaunay_triangulation_2.moc ${CDT_UI_FILES} ${CDT_RESOURCE_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) qt5_use_modules(Constrained_Delaunay_triangulation_2 Xml Script OpenGL Svg) @@ -64,7 +64,7 @@ qt5_add_resources ( DT_RESOURCE_FILES ./Delaunay_triangulation_2.qrc ) qt5_generate_moc( "Delaunay_triangulation_2.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Delaunay_triangulation_2.moc" ) # The executable itself. -add_executable ( Delaunay_triangulation_2 Delaunay_triangulation_2.cpp Delaunay_triangulation_2.moc ${DT_UI_FILES} ${DT_RESOURCE_FILES} ) +add_executable ( Delaunay_triangulation_2 Delaunay_triangulation_2.cpp Delaunay_triangulation_2.moc ${DT_UI_FILES} ${DT_RESOURCE_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) qt5_use_modules(Delaunay_triangulation_2 Xml Script OpenGL Svg) @@ -88,7 +88,7 @@ qt5_add_resources ( DT_RESOURCE_FILES ./Regular_triangulation_2.qrc ) qt5_generate_moc( "Regular_triangulation_2.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Regular_triangulation_2.moc" ) # The executable itself. -add_executable ( Regular_triangulation_2 Regular_triangulation_2.cpp Regular_triangulation_2.moc ${DT_UI_FILES} ${DT_RESOURCE_FILES} ) +add_executable ( Regular_triangulation_2 Regular_triangulation_2.cpp Regular_triangulation_2.moc ${DT_UI_FILES} ${DT_RESOURCE_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) qt5_use_modules(Regular_triangulation_2 Xml Script OpenGL Svg) diff --git a/GraphicsView/include/CGAL/Qt/DemosMainWindow_impl.h b/GraphicsView/include/CGAL/Qt/DemosMainWindow_impl.h index 32fa8676be3..3c035eca68c 100644 --- a/GraphicsView/include/CGAL/Qt/DemosMainWindow_impl.h +++ b/GraphicsView/include/CGAL/Qt/DemosMainWindow_impl.h @@ -368,7 +368,7 @@ DemosMainWindow::openRecentFile_aux() { QAction *action = qobject_cast(sender()); if (action) - emit openRecentFile(action->data().toString()); + Q_EMIT openRecentFile(action->data().toString()); } CGAL_INLINE_FUNCTION diff --git a/GraphicsView/include/CGAL/Qt/GraphicsViewNavigation_impl.h b/GraphicsView/include/CGAL/Qt/GraphicsViewNavigation_impl.h index 0570920869f..09d8149c448 100644 --- a/GraphicsView/include/CGAL/Qt/GraphicsViewNavigation_impl.h +++ b/GraphicsView/include/CGAL/Qt/GraphicsViewNavigation_impl.h @@ -183,7 +183,7 @@ namespace Qt { QMouseEvent* mouseEvent = static_cast(event); QPointF pos = v->mapToScene(mouseEvent->pos()); QString xy = QString(" ") + QString::number(pos.x(),'g', 6) + " , " + QString::number(pos.y(),'g', 6) + " "; - emit mouseCoordinates(xy); + Q_EMIT mouseCoordinates(xy); if(rectItem->isVisible()) { QPointF size = v->mapToScene(mouseEvent->pos()); size = size - rect_first_point; diff --git a/GraphicsView/src/CGAL_Qt5/CMakeLists.txt b/GraphicsView/src/CGAL_Qt5/CMakeLists.txt index 937b6b2277a..db5a66028bd 100644 --- a/GraphicsView/src/CGAL_Qt5/CMakeLists.txt +++ b/GraphicsView/src/CGAL_Qt5/CMakeLists.txt @@ -4,87 +4,96 @@ if(POLICY CMP0043) cmake_policy(SET CMP0043 OLD) endif() -find_package(Qt5 QUIET COMPONENTS OpenGL Svg QUIET) -find_package(OpenGL QUIET) +if(CGAL_HEADER_ONLY) + cache_set(CGAL_Qt5_3RD_PARTY_LIBRARIES Qt5::OpenGL Qt5::Svg ) +else(CGAL_HEADER_ONLY) + find_package(Qt5 QUIET COMPONENTS OpenGL Svg QUIET) + find_package(OpenGL QUIET) -set(CGAL_Qt5_MISSING_DEPS "") -if(NOT Qt5OpenGL_FOUND) - set(CGAL_Qt5_MISSING_DEPS "Qt5OpenGL") -endif() -if(NOT Qt5Svg_FOUND) - set(CGAL_Qt5_MISSING_DEPS "${CGAL_Qt5_MISSING_DEPS} Qt5Svg") -endif() -if(NOT Qt5_FOUND) - set(CGAL_Qt5_MISSING_DEPS "${CGAL_Qt5_MISSING_DEPS} Qt5") -endif() -if(NOT OPENGL_FOUND) - set(CGAL_Qt5_MISSING_DEPS "${CGAL_Qt5_MISSING_DEPS} OpenGL") -endif() + set(CGAL_Qt5_MISSING_DEPS "") + if(NOT Qt5OpenGL_FOUND) + set(CGAL_Qt5_MISSING_DEPS "Qt5OpenGL") + endif() + if(NOT Qt5Svg_FOUND) + set(CGAL_Qt5_MISSING_DEPS "${CGAL_Qt5_MISSING_DEPS} Qt5Svg") + endif() + if(NOT Qt5_FOUND) + set(CGAL_Qt5_MISSING_DEPS "${CGAL_Qt5_MISSING_DEPS} Qt5") + endif() + if(NOT OPENGL_FOUND) + set(CGAL_Qt5_MISSING_DEPS "${CGAL_Qt5_MISSING_DEPS} OpenGL") + endif() -if(CGAL_Qt5_MISSING_DEPS) - message(STATUS "libCGAL_Qt5 is missing the dependencies: ${CGAL_Qt5_MISSING_DEPS} cannot be configured.") - return() -endif() + if(CGAL_Qt5_MISSING_DEPS) + message(STATUS "libCGAL_Qt5 is missing the dependencies: ${CGAL_Qt5_MISSING_DEPS} cannot be configured.") + return() + endif() -include_directories (BEFORE ../../include) + include_directories (BEFORE ../../include) -message( STATUS "USING Qt5_VERSION = '${Qt5Core_VERSION_STRING}'" ) -if(COMMAND add_config_flag) - set( CGAL_HAS_QT5 TRUE ) - add_config_flag( CGAL_HAS_QT5 ) -endif() + message( STATUS "USING Qt5_VERSION = '${Qt5Core_VERSION_STRING}'" ) + if(COMMAND add_config_flag) + set( CGAL_HAS_QT5 TRUE ) + add_config_flag( CGAL_HAS_QT5 ) + endif() -get_property(QT_UIC_EXECUTABLE TARGET Qt5::uic PROPERTY LOCATION) -message( STATUS "OpenGL include: ${OPENGL_INCLUDE_DIR}" ) -message( STATUS "OpenGL libraries: ${OPENGL_LIBRARIES}" ) -message( STATUS "OpenGL definitions: ${OPENGL_DEFINITIONS}" ) -message( STATUS "Qt5Core include: ${Qt5Core_INCLUDE_DIRS}" ) -message( STATUS "Qt5 libraries: ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Svg_LIBRARIES} ${Qt5OpenGL_LIBRARIES}" ) -message( STATUS "Qt5Core definitions: ${Qt5Core_DEFINITIONS}" ) -message( STATUS "moc executable: ${QT_MOC_EXECUTABLE}" ) -message( STATUS "uic executable: ${QT_UIC_EXECUTABLE}" ) + get_property(QT_UIC_EXECUTABLE TARGET Qt5::uic PROPERTY LOCATION) + message( STATUS "OpenGL include: ${OPENGL_INCLUDE_DIR}" ) + message( STATUS "OpenGL libraries: ${OPENGL_LIBRARIES}" ) + message( STATUS "OpenGL definitions: ${OPENGL_DEFINITIONS}" ) + message( STATUS "Qt5Core include: ${Qt5Core_INCLUDE_DIRS}" ) + message( STATUS "Qt5 libraries: ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Svg_LIBRARIES} ${Qt5OpenGL_LIBRARIES}" ) + message( STATUS "Qt5Core definitions: ${Qt5Core_DEFINITIONS}" ) + message( STATUS "moc executable: ${QT_MOC_EXECUTABLE}" ) + message( STATUS "uic executable: ${QT_UIC_EXECUTABLE}" ) -cache_set(CGAL_Qt5_3RD_PARTY_INCLUDE_DIRS ${QT_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR} ) -cache_set(CGAL_Qt5_3RD_PARTY_LIBRARIES ${QT_LIBRARIES} ${OPENGL_LIBRARIES} ) -cache_set(CGAL_Qt5_3RD_PARTY_DEFINITIONS ${QT_DEFINITIONS} ${OPENGL_DEFINITIONS} ) + cache_set(CGAL_Qt5_3RD_PARTY_INCLUDE_DIRS ${QT_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR} ) + cache_set(CGAL_Qt5_3RD_PARTY_LIBRARIES ${QT_LIBRARIES} ${OPENGL_LIBRARIES} ) + cache_set(CGAL_Qt5_3RD_PARTY_DEFINITIONS ${QT_DEFINITIONS} ${OPENGL_DEFINITIONS} ) -set(mocfiles "") -set(RESOURCE_FILES "") + set(mocfiles "") + set(RESOURCE_FILES "") -foreach (package ${CGAL_CONFIGURED_PACKAGES} ) - file(GLOB PACKAGE_QTMOC_FILES "${package}/src/CGAL_Qt5/*.qtmoc.cmake") - list(SORT PACKAGE_QTMOC_FILES) - foreach(package_qtmoc_file ${PACKAGE_QTMOC_FILES}) - # includes 'moccing' for sources/headers in package + collects lists of moc-files for dependency (to properly build the lib) - include(${package_qtmoc_file}) - # message(STATUS QTMOC------------FILE: ${package_qtmoc_file}) + foreach (package ${CGAL_CONFIGURED_PACKAGES} ) + file(GLOB PACKAGE_QTMOC_FILES "${package}/src/CGAL_Qt5/*.qtmoc.cmake") + list(SORT PACKAGE_QTMOC_FILES) + foreach(package_qtmoc_file ${PACKAGE_QTMOC_FILES}) + # includes 'moccing' for sources/headers in package + collects lists of moc-files for dependency (to properly build the lib) + include(${package_qtmoc_file}) + # message(STATUS QTMOC------------FILE: ${package_qtmoc_file}) + + endforeach() endforeach() -endforeach() -foreach(mocfile ${mocfiles}) - list(APPEND additional_files ${mocfile}) -endforeach() -foreach(resfile ${RESOURCE_FILES}) - list(APPEND additional_files ${resfile}) -endforeach() + foreach(mocfile ${mocfiles}) + list(APPEND additional_files ${mocfile}) + endforeach() + foreach(resfile ${RESOURCE_FILES}) + list(APPEND additional_files ${resfile}) + endforeach() # message(STATUS "Additional input files: ${additional_files}") -use_essential_libs() + use_essential_libs() -include_directories( SYSTEM ${CGAL_3RD_PARTY_INCLUDE_DIRS} ${CGAL_Qt5_3RD_PARTY_INCLUDE_DIRS} ) + include_directories( SYSTEM ${CGAL_3RD_PARTY_INCLUDE_DIRS} ${CGAL_Qt5_3RD_PARTY_INCLUDE_DIRS} ) -link_directories ( ${CGAL_LIBRARIES_DIR} ${CGAL_3RD_PARTY_LIBRARIES_DIRS} ) + link_directories ( ${CGAL_LIBRARIES_DIR} ${CGAL_3RD_PARTY_LIBRARIES_DIRS} ) +endif(CGAL_HEADER_ONLY) collect_cgal_library( CGAL_Qt5 "${additional_files}") -qt5_use_modules(CGAL_Qt5 OpenGL Svg) +if(CGAL_HEADER_ONLY) + set(CGAL_QT5_QTMOCCMAKE_FILES ${QTMOCCMAKE_FILES} CACHE INTERNAL "CGAL qt5 qtmoc cmake files") +else() + qt5_use_modules(CGAL_Qt5 OpenGL Svg) -add_dependencies( CGAL_Qt5 CGAL ) + add_dependencies( CGAL_Qt5 CGAL ) -# CGAL_Qt5 only depends on CGAL in DEBUG, but we still link it in -# both build types. -target_link_libraries( CGAL_Qt5 CGAL ${CGAL_3RD_PARTY_LIBRARIES} ${CGAL_Qt5_3RD_PARTY_LIBRARIES} ) + # CGAL_Qt5 only depends on CGAL in DEBUG, but we still link it in + # both build types. + target_link_libraries( CGAL_Qt5 CGAL ${CGAL_3RD_PARTY_LIBRARIES} ${CGAL_Qt5_3RD_PARTY_LIBRARIES} ) +endif() add_definitions ( ${CGAL_3RD_PARTY_DEFINITIONS} ${CGAL_Qt5_3RD_PARTY_DEFINITIONS} ) diff --git a/GraphicsView/src/CGAL_Qt5/GraphicsView.qtmoc.cmake b/GraphicsView/src/CGAL_Qt5/GraphicsView.qtmoc.cmake index 86b463eb977..95ba7c31f5a 100644 --- a/GraphicsView/src/CGAL_Qt5/GraphicsView.qtmoc.cmake +++ b/GraphicsView/src/CGAL_Qt5/GraphicsView.qtmoc.cmake @@ -6,4 +6,3 @@ qt5_wrap_cpp(mocfiles ../../include/CGAL/Qt/GraphicsViewNavigation.h # qrc files (resources files, that contain icons, at least) qt5_add_resources ( RESOURCE_FILES ../../demo/resources/CGAL.qrc ../../demo/icons/Input.qrc ../../demo/icons/File.qrc ../../demo/icons/Triangulation_2.qrc) - diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 8491d1702d9..79638720430 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -30,6 +30,18 @@ endif() # Use GNUInstallDirst to get canonical paths include(GNUInstallDirs) +#-------------------------------------------------------------------------------------------------- +# +# -= HEADER ONLY =- +# +#-------------------------------------------------------------------------------------------------- +option(CGAL_HEADER_ONLY "Enable the header only version of CGAL" OFF ) + +if (CGAL_HEADER_ONLY) + set(CGAL_HEADER_ONLY TRUE CACHE BOOL "Enable cgal header only" FORCE) + add_definitions(-DCGAL_HEADER_ONLY) +endif (CGAL_HEADER_ONLY) + #-------------------------------------------------------------------------------------------------- # # -= PACKAGE SETUP =- @@ -77,6 +89,7 @@ if ( CGAL_BRANCH_BUILD ) set(CGAL_INSTALLATION_PACKAGE_DIR "${CMAKE_SOURCE_DIR}/Installation" CACHE INTERNAL "Directory containing the Installation package") set(CGAL_MAINTENANCE_PACKAGE_DIR "${CMAKE_SOURCE_DIR}/Maintenance" CACHE INTERNAL "Directory containing the Maintenance package") set(CGAL_CORE_PACKAGE_DIR "${CMAKE_SOURCE_DIR}/Core" CACHE INTERNAL "Directory containing the Core package") + set(CGAL_GRAPHICSVIEW_PACKAGE_DIR "${CMAKE_SOURCE_DIR}/GraphicsView" CACHE INTERNAL "Directory containing the GraphicsView package") message(STATUS "Installation package directory: ${CGAL_INSTALLATION_PACKAGE_DIR}") message(STATUS "Maintenance package directory: ${CGAL_MAINTENANCE_PACKAGE_DIR}") @@ -99,6 +112,7 @@ else ( CGAL_BRANCH_BUILD ) set(CGAL_INSTALLATION_PACKAGE_DIR "${CMAKE_SOURCE_DIR}" CACHE INTERNAL "Directory containing the Installation package") set(CGAL_MAINTENANCE_PACKAGE_DIR "${CMAKE_SOURCE_DIR}" CACHE INTERNAL "Directory containing the Maintenance package") set(CGAL_CORE_PACKAGE_DIR "${CMAKE_SOURCE_DIR}" CACHE INTERNAL "Directory containing the Core package") + set(CGAL_GRAPHICSVIEW_PACKAGE_DIR "${CMAKE_SOURCE_DIR}" CACHE INTERNAL "Directory containing the GraphicsView package") endif (CGAL_BRANCH_BUILD ) diff --git a/Installation/cmake/modules/CGALConfig_binary.cmake.in b/Installation/cmake/modules/CGALConfig_binary.cmake.in index 3b5d7b5faec..0ed28cee771 100644 --- a/Installation/cmake/modules/CGALConfig_binary.cmake.in +++ b/Installation/cmake/modules/CGALConfig_binary.cmake.in @@ -4,12 +4,14 @@ # This file is loaded by cmake via the command "find_package(CGAL)" # # This file correspond to a possibly out-of-sources CGAL configuration, thus the actual location -# must be given by the cmake variable or enviroment variable CGAL_DIR. +# must be given by the cmake variable or enviroment variable CGAL_DIR. set(CGAL_CONFIG_LOADED TRUE) get_filename_component(CGAL_CONFIG_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) +set(CGAL_HEADER_ONLY "@CGAL_HEADER_ONLY@" ) + # The code for including exported targets is different from # CGAL_Config_install.cmake. We do not have separate export files in # an installed version and we need to make sure that we are not @@ -68,6 +70,7 @@ endforeach() set(CGAL_INSTALLATION_PACKAGE_DIR "@CGAL_INSTALLATION_PACKAGE_DIR@") set(CGAL_CORE_PACKAGE_DIR "@CGAL_CORE_PACKAGE_DIR@") +set(CGAL_GRAPHICSVIEW_PACKAGE_DIR "@CGAL_GRAPHICSVIEW_PACKAGE_DIR@") set(CGAL_MAJOR_VERSION "@CGAL_MAJOR_VERSION@" ) set(CGAL_MINOR_VERSION "@CGAL_MINOR_VERSION@" ) @@ -109,7 +112,7 @@ else() set( CHECK_CGAL_COMPONENT_MSG_ON_ERROR TRUE ) set( CHECK_CGAL_COMPONENT_ERROR_TYPE STATUS ) set( CHECK_CGAL_COMPONENT_ERROR_TITLE "NOTICE:" ) - else() + else() set( CHECK_CGAL_COMPONENT_MSG_ON_ERROR FALSE ) endif() endif() @@ -124,10 +127,38 @@ macro(check_cgal_component COMPONENT) if ( "${CGAL_LIB}" STREQUAL "CGAL" ) set( CGAL_FOUND TRUE ) set( CHECK_CGAL_ERROR_TAIL "" ) - else() + else() if ( WITH_${CGAL_LIB} ) - if(TARGET CGAL::${CGAL_LIB}) - set( ${CGAL_LIB}_FOUND TRUE ) + + if(CGAL_HEADER_ONLY OR TARGET CGAL::${CGAL_LIB}) + if ("${CGAL_LIB}" STREQUAL "CGAL_Qt5") + find_package( OpenGL ) + find_package(Qt5 COMPONENTS OpenGL Svg) + + if(Qt5_FOUND AND OPENGL_FOUND) + set( ${CGAL_LIB}_FOUND TRUE ) + if (CGAL_HEADER_ONLY) + include("${CGAL_MODULES_DIR}/Use_CGAL_Qt5_headers.cmake") + endif() + else(Qt5_FOUND AND OPENGL_FOUND) + set( ${CGAL_LIB}_FOUND FALSE ) + message(STATUS "Notice: CGAL_Qt5 disabled because it requires Qt5 and OpenGL.") + endif(Qt5_FOUND AND OPENGL_FOUND) + else() + if ("${CGAL_LIB}" STREQUAL "CGAL_ImageIO") + find_package( OpenGL ) + + if(OPENGL_FOUND) + set( ${CGAL_LIB}_FOUND TRUE ) + else(OPENGL_FOUND) + set( ${CGAL_LIB}_FOUND FALSE ) + message(STATUS "Notice: ImageIO disabled because it requires OpenGL.") + endif(OPENGL_FOUND) + else() + # Librairies that have no dependencies + set( ${CGAL_LIB}_FOUND TRUE ) + endif() + endif() else() set( ${CGAL_LIB}_FOUND FALSE ) set( CHECK_${CGAL_LIB}_ERROR_TAIL " CGAL was configured with WITH_${CGAL_LIB}=ON, but one of the dependencies of ${CGAL_LIB} was not configured properly." ) @@ -136,12 +167,12 @@ macro(check_cgal_component COMPONENT) set( ${CGAL_LIB}_FOUND FALSE ) set( CHECK_${CGAL_LIB}_ERROR_TAIL " Please configure CGAL using WITH_${CGAL_LIB}=ON." ) endif() - endif() + endif() if ( NOT ${CGAL_LIB}_FOUND AND CHECK_CGAL_COMPONENT_MSG_ON_ERROR ) message( ${CHECK_CGAL_COMPONENT_ERROR_TYPE} "${CHECK_CGAL_COMPONENT_ERROR_TITLE} The ${CGAL_LIB} library was not configured.${CHECK_${CGAL_LIB}_ERROR_TAIL}" ) endif() - + endmacro() check_cgal_component("CGAL") diff --git a/Installation/cmake/modules/CGALConfig_install.cmake.in b/Installation/cmake/modules/CGALConfig_install.cmake.in index ad6fe9c3ef1..53fa4cb05ab 100644 --- a/Installation/cmake/modules/CGALConfig_install.cmake.in +++ b/Installation/cmake/modules/CGALConfig_install.cmake.in @@ -10,6 +10,8 @@ set(CGAL_CONFIG_LOADED TRUE) get_filename_component(CGAL_CONFIG_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) +set(CGAL_HEADER_ONLY "@CGAL_HEADER_ONLY@" ) + # CGAL_DIR is the directory where this CGALConfig.cmake is installed set(CGAL_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@") @@ -79,8 +81,9 @@ macro(check_cgal_component COMPONENT) # include config file (defining WITH_${CGAL_LIB}) include(${CGAL_CONFIG_DIR}/${CGAL_LIB}LibConfig.cmake) endif() + if ( WITH_${CGAL_LIB} ) - if(TARGET CGAL::${CGAL_LIB}) + if(TARGET CGAL::${CGAL_LIB} OR CGAL_HEADER_ONLY ) set( ${CGAL_LIB}_FOUND TRUE ) else() set( ${CGAL_LIB}_FOUND FALSE ) diff --git a/Installation/cmake/modules/CGALLibConfig.cmake.in b/Installation/cmake/modules/CGALLibConfig.cmake.in index cfbbf2b4963..700446f8641 100644 --- a/Installation/cmake/modules/CGALLibConfig.cmake.in +++ b/Installation/cmake/modules/CGALLibConfig.cmake.in @@ -5,7 +5,7 @@ set(WITH_@LIBRARY_NAME@ "ON") # CMake<=2.8.11 (detected by the absence of CMP0024), the else() # condition is never used. if(NOT POLICY CMP0024 OR NOT CGAL_BUILDING_LIBS) - if(NOT MSVC) + if(NOT MSVC AND NOT CGAL_HEADER_ONLY) get_property(@LIBRARY_NAME@_LIBRARY TARGET CGAL::@LIBRARY_NAME@ PROPERTY LOCATION) else() set(@LIBRARY_NAME@_LIBRARY "") @@ -16,7 +16,7 @@ else() # access the LOCATION property here to set lib_LIBRARY, since those # targets are not imported and this is disallowed by CMP0026. Just # set it to the target name. - if(TARGET @LIBRARY_NAME@ AND NOT TARGET CGAL::@LIBRARY_NAME@) + if(TARGET @LIBRARY_NAME@ AND NOT TARGET CGAL::@LIBRARY_NAME@ AND NOT CGAL_HEADER_ONLY) add_library(CGAL::@LIBRARY_NAME@ ALIAS @LIBRARY_NAME@) set(@LIBRARY_NAME@_LIBRARY CGAL::@LIBRARY_NAME@) else() diff --git a/Installation/cmake/modules/CGAL_Macros.cmake b/Installation/cmake/modules/CGAL_Macros.cmake index eddf75d686f..0dcbbf79c74 100644 --- a/Installation/cmake/modules/CGAL_Macros.cmake +++ b/Installation/cmake/modules/CGAL_Macros.cmake @@ -286,11 +286,6 @@ if( NOT CGAL_MACROS_FILE_INCLUDED ) find_package( ZLIB QUIET ) endif() - if (${component} STREQUAL "Qt5") - find_package( OpenGL QUIET ) - find_package( Qt5 QUIET COMPONENTS OpenGL Svg ) - endif() - else(WITH_CGAL_${component}) # now we are talking about 3rd party libs @@ -450,7 +445,6 @@ if( NOT CGAL_MACROS_FILE_INCLUDED ) endif() endmacro() - ## All the following macros are probably unused. -- Laurent Rineau, 2011/07/21 # Composes a tagged list of libraries: a list with interpersed keywords or tags diff --git a/Installation/cmake/modules/UseCGAL.cmake b/Installation/cmake/modules/UseCGAL.cmake index a3e5236a3e3..549a0dd2b1a 100644 --- a/Installation/cmake/modules/UseCGAL.cmake +++ b/Installation/cmake/modules/UseCGAL.cmake @@ -56,5 +56,8 @@ if(NOT USE_CGAL_FILE_INCLUDED) link_directories ( ${CGAL_LIBRARIES_DIR} ${CGAL_3RD_PARTY_LIBRARIES_DIRS} ) link_libraries ( ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ) + if (CGAL_HEADER_ONLY) + add_definitions(-DCGAL_HEADER_ONLY) + endif() endif() diff --git a/Installation/cmake/modules/Use_CGAL_Qt5_headers.cmake b/Installation/cmake/modules/Use_CGAL_Qt5_headers.cmake new file mode 100644 index 00000000000..4132d77bfab --- /dev/null +++ b/Installation/cmake/modules/Use_CGAL_Qt5_headers.cmake @@ -0,0 +1,13 @@ +qt5_wrap_cpp(CGAL_Qt5_MOC_FILES + ${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/include/CGAL/Qt/GraphicsViewNavigation.h + ${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/include/CGAL/Qt/DemosMainWindow.h + ${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/include/CGAL/Qt/GraphicsItem.h + ${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/include/CGAL/Qt/GraphicsViewInput.h) + +# qrc files (resources files, that contain icons, at least) +qt5_add_resources (CGAL_Qt5_RESOURCE_FILES + ${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/demo/resources/CGAL.qrc + ${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/demo/icons/Input.qrc + ${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/demo/icons/File.qrc + ${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/demo/icons/Triangulation_2.qrc) + diff --git a/Installation/include/CGAL/config.h b/Installation/include/CGAL/config.h index 9586fa1d937..a25f25e4973 100644 --- a/Installation/include/CGAL/config.h +++ b/Installation/include/CGAL/config.h @@ -28,6 +28,10 @@ #ifndef CGAL_CONFIG_H #define CGAL_CONFIG_H +#ifdef CGAL_HEADER_ONLY +# define CGAL_NO_AUTOLINK 1 +#endif + // Workaround for a bug in Boost, that checks WIN64 instead of _WIN64 // https://svn.boost.org/trac/boost/ticket/5519 #if defined(_WIN64) && ! defined(WIN64) diff --git a/Installation/src/CGAL/CMakeLists.txt b/Installation/src/CGAL/CMakeLists.txt index 2d6af2a018e..26f952ce902 100644 --- a/Installation/src/CGAL/CMakeLists.txt +++ b/Installation/src/CGAL/CMakeLists.txt @@ -8,8 +8,10 @@ add_definitions(${CGAL_3RD_PARTY_DEFINITIONS}) link_directories(${CGAL_3RD_PARTY_LIBRARIES_DIRS}) -collect_cgal_library(CGAL "") +collect_cgal_library(CGAL "") -target_link_libraries(CGAL ${CGAL_3RD_PARTY_LIBRARIES}) +if(NOT CGAL_HEADER_ONLY) + target_link_libraries(CGAL ${CGAL_3RD_PARTY_LIBRARIES}) +endif() message("libCGAL is configured") diff --git a/Installation/src/CMakeLists.txt b/Installation/src/CMakeLists.txt index 214e42e2b41..0808a914de1 100644 --- a/Installation/src/CMakeLists.txt +++ b/Installation/src/CMakeLists.txt @@ -31,8 +31,8 @@ function (collect_cgal_library LIBRARY_NAME ADDITIONAL_FILES) set(CGAL_LIB_PREFIX "lib") endif() - set(RELEASE_MANGLED_NAME "${CGAL_LIB_PREFIX}${LIBRARY_NAME}-${CGAL_TOOLSET}-mt-${CGAL_FULL_VERSION}" ) - set(DEBUG_MANGLED_NAME "${CGAL_LIB_PREFIX}${LIBRARY_NAME}-${CGAL_TOOLSET}-mt-gd-${CGAL_FULL_VERSION}" ) + set(RELEASE_MANGLED_NAME "${CGAL_LIB_PREFIX}${LIBRARY_NAME}-${CGAL_TOOLSET}-mt-${CGAL_FULL_VERSION}" ) + set(DEBUG_MANGLED_NAME "${CGAL_LIB_PREFIX}${LIBRARY_NAME}-${CGAL_TOOLSET}-mt-gd-${CGAL_FULL_VERSION}" ) if(CGAL_BUILD_SHARED_LIBS AND WIN32) configure_file(${CGAL_INSTALLATION_PACKAGE_DIR}/src/CGAL_libs_verinfo.rc.in ${LIBRARY_NAME}_verinfo.rc @ONLY) @@ -41,38 +41,46 @@ function (collect_cgal_library LIBRARY_NAME ADDITIONAL_FILES) set(rc_file ) endif() - add_library (${LIBRARY_NAME} - ${CMAKE_CURRENT_BINARY_DIR}/all_files.cpp - ${rc_file} - ${ADDITIONAL_FILES}) - if(CGAL_SOVERSION AND CGAL_SONAME_VERSION) - set_target_properties(${LIBRARY_NAME} PROPERTIES - VERSION "${CGAL_SOVERSION}" - SOVERSION "${CGAL_SONAME_VERSION}") - endif() + if (NOT CGAL_HEADER_ONLY) + add_library (${LIBRARY_NAME} + ${CMAKE_CURRENT_BINARY_DIR}/all_files.cpp + ${rc_file} + ${ADDITIONAL_FILES}) + # add_library (${LIBRARY_NAME} ${CGAL_LIBRARY_SOURCE_FILES} ${rc_file} ${ADDITIONAL_FILES}) # builing not creating temporary all_files.cpp + if(CGAL_SOVERSION AND CGAL_SONAME_VERSION) + set_target_properties(${LIBRARY_NAME} PROPERTIES + VERSION "${CGAL_SOVERSION}" + SOVERSION "${CGAL_SONAME_VERSION}") + endif() + + endif() if(CGAL_AUTO_LINK_ENABLED) - set_target_properties( ${LIBRARY_NAME} PROPERTIES - OUTPUT_NAME_DEBUG "${DEBUG_MANGLED_NAME}" - OUTPUT_NAME_RELEASE "${RELEASE_MANGLED_NAME}" - OUTPUT_NAME_MINSIZEREL "${RELEASE_MANGLED_NAME}" - OUTPUT_NAME_RELWITHDEBINFO "${RELEASE_MANGLED_NAME}" - ) - - if ( HAS_CFG_INTDIR ) - add_custom_command(TARGET ${LIBRARY_NAME} POST_BUILD COMMAND if exist \"$(TargetDir)$(TargetName).dll\" copy /Y \"$(TargetDir)$(TargetName).dll\" \"$(TargetDir)..\" ) - add_custom_command(TARGET ${LIBRARY_NAME} POST_BUILD COMMAND if exist \"$(TargetDir)$(TargetName).pdb\" copy /Y \"$(TargetDir)$(TargetName).pdb\" \"$(TargetDir)..\" ) - add_custom_command(TARGET ${LIBRARY_NAME} POST_BUILD COMMAND if exist \"$(SolutionDir)lib\\$(ConfigurationName)\\$(TargetName).lib\" copy /Y \"$(SolutionDir)lib\\$(ConfigurationName)\\$(TargetName).lib\" \"$(SolutionDir)lib\" ) + if (NOT CGAL_HEADER_ONLY) + set_target_properties( ${LIBRARY_NAME} PROPERTIES + OUTPUT_NAME_DEBUG "${DEBUG_MANGLED_NAME}" + OUTPUT_NAME_RELEASE "${RELEASE_MANGLED_NAME}" + OUTPUT_NAME_MINSIZEREL "${RELEASE_MANGLED_NAME}" + OUTPUT_NAME_RELWITHDEBINFO "${RELEASE_MANGLED_NAME}" + ) + + if ( HAS_CFG_INTDIR ) + add_custom_command(TARGET ${LIBRARY_NAME} POST_BUILD COMMAND if exist \"$(TargetDir)$(TargetName).dll\" copy /Y \"$(TargetDir)$(TargetName).dll\" \"$(TargetDir)..\" ) + add_custom_command(TARGET ${LIBRARY_NAME} POST_BUILD COMMAND if exist \"$(TargetDir)$(TargetName).pdb\" copy /Y \"$(TargetDir)$(TargetName).pdb\" \"$(TargetDir)..\" ) + add_custom_command(TARGET ${LIBRARY_NAME} POST_BUILD COMMAND if exist \"$(SolutionDir)lib\\$(ConfigurationName)\\$(TargetName).lib\" copy /Y \"$(SolutionDir)lib\\$(ConfigurationName)\\$(TargetName).lib\" \"$(SolutionDir)lib\" ) + endif() endif() endif() - install(TARGETS ${LIBRARY_NAME} EXPORT ${LIBRARY_NAME}Exports - RUNTIME DESTINATION "${CGAL_INSTALL_BIN_DIR}" - LIBRARY DESTINATION "${CGAL_INSTALL_LIB_DIR}" - ARCHIVE DESTINATION "${CGAL_INSTALL_LIB_DIR}") - install(EXPORT ${LIBRARY_NAME}Exports - DESTINATION "${CGAL_INSTALL_CMAKE_DIR}" - NAMESPACE CGAL::) + if (NOT CGAL_HEADER_ONLY) + install(TARGETS ${LIBRARY_NAME} EXPORT ${LIBRARY_NAME}Exports + RUNTIME DESTINATION "${CGAL_INSTALL_BIN_DIR}" + LIBRARY DESTINATION "${CGAL_INSTALL_LIB_DIR}" + ARCHIVE DESTINATION "${CGAL_INSTALL_LIB_DIR}") + install(EXPORT ${LIBRARY_NAME}Exports + DESTINATION "${CGAL_INSTALL_CMAKE_DIR}" + NAMESPACE CGAL::) + endif() # We have to call configure_file twice to force double expansion of variables. configure_file("${CGAL_MODULES_DIR}/CGALLibConfig.cmake.in" @@ -80,6 +88,7 @@ function (collect_cgal_library LIBRARY_NAME ADDITIONAL_FILES) configure_file("${CMAKE_BINARY_DIR}/${LIBRARY_NAME}LibConfig.cmake" "${CMAKE_BINARY_DIR}/${LIBRARY_NAME}LibConfig.cmake" @ONLY) install(FILES "${CMAKE_BINARY_DIR}/${LIBRARY_NAME}LibConfig.cmake" DESTINATION ${CGAL_INSTALL_CMAKE_DIR}) + endfunction() function( configure_component DIR COMPONENT ) @@ -121,8 +130,8 @@ add_subdirectory(CGAL) # search libs set(CGAL_CONFIGURED_LIBRARIES "") - -foreach(package ${CGAL_CONFIGURED_PACKAGES}) + +foreach(package ${CGAL_CONFIGURED_PACKAGES}) file(GLOB CONFIGURED_LIBS_IN_PACKAGE ${package}/src/CGAL_*/CMakeLists.txt) list(SORT CONFIGURED_LIBS_IN_PACKAGE) foreach (libconfigfile ${CONFIGURED_LIBS_IN_PACKAGE}) @@ -139,8 +148,8 @@ foreach(package ${CGAL_CONFIGURED_PACKAGES}) cache_set(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_DEFINITIONS "" ) cache_set(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_INCLUDE_DIRS "" ) cache_set(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_LIBRARIES "" ) - cache_set(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_LIBRARIES_DIRS "" ) - if (${CGAL_CONFIGURED_LIBRARY_NAME} STREQUAL "CGAL_Core") + cache_set(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_LIBRARIES_DIRS "" ) + if (${CGAL_CONFIGURED_LIBRARY_NAME} STREQUAL "CGAL_Core") if (NOT CGAL_NO_CORE) configure_component( ${package}/src/${CGAL_CONFIGURED_LIBRARY_NAME} ${CGAL_CONFIGURED_LIBRARY_NAME}) else(NOT CGAL_NO_CORE) @@ -155,17 +164,17 @@ foreach(package ${CGAL_CONFIGURED_PACKAGES}) cache_get(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_DEFINITIONS ) cache_get(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_INCLUDE_DIRS ) cache_get(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_LIBRARIES ) - cache_get(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_LIBRARIES_DIRS) + cache_get(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_LIBRARIES_DIRS) + + else() - else() - list(APPEND CGAL_CONFIGURED_LIBRARIES CGAL) endif() endforeach() endforeach() -if (NOT CGAL_CONFIGURED_LIBRARIES) +if (NOT CGAL_CONFIGURED_LIBRARIES) message(FATAL_ERROR "No component library in configured packages found. Please fix package-file.") endif() @@ -191,7 +200,9 @@ CGAL_add_if_target(CGAL_Core) CGAL_add_if_target(CGAL_ImageIO) CGAL_add_if_target(CGAL_Qt5) -export(TARGETS ${CGAL_ACTUAL_CONFIGURED_LIBRARIES} NAMESPACE CGAL:: FILE "${CMAKE_BINARY_DIR}/CGALExports.cmake") +#if (NOT CGAL_HEADER_ONLY) # TODO Check on windows these exports + export(TARGETS ${CGAL_ACTUAL_CONFIGURED_LIBRARIES} NAMESPACE CGAL:: FILE "${CMAKE_BINARY_DIR}/CGALExports.cmake") +#endif() message(STATUS "Sources for CGAL component libraries '${CGAL_CONFIGURED_LIBRARIES}' detected") diff --git a/Installation/test/Installation/CMakeLists.txt b/Installation/test/Installation/CMakeLists.txt index 5ebf10e8763..0512386bfbd 100644 --- a/Installation/test/Installation/CMakeLists.txt +++ b/Installation/test/Installation/CMakeLists.txt @@ -18,7 +18,7 @@ macro(create_link_to_program COMPONENT ) link_directories( ${${COMPONENT}_3RD_PARTY_LIBRARIES_DIRS}) # Link the executable to CGAL and third-party libraries - if ( CGAL_AUTO_LINK_ENABLED ) + if ( CGAL_AUTO_LINK_ENABLED OR CGAL_HEADER_ONLY) target_link_libraries(link_to_${COMPONENT} ${CGAL_3RD_PARTY_LIBRARIES} ${${COMPONENT}_3RD_PARTY_LIBRARIES} ) else() target_link_libraries(link_to_${COMPONENT} CGAL::${COMPONENT} ${CGAL_3RD_PARTY_LIBRARIES} ${${COMPONENT}_3RD_PARTY_LIBRARIES} ) @@ -69,7 +69,9 @@ if ( CGAL_FOUND ) find_package(Qt5 QUIET) if( Qt5_FOUND ) create_link_to_program(CGAL_Qt5) - qt5_use_modules(link_to_CGAL_Qt5) + if (CGAL_HEADER_ONLY) + qt5_use_modules(link_to_CGAL_Qt5) + endif() endif() endif() diff --git a/Kernel_23/examples/Kernel_23/MyPointC2_iostream.h b/Kernel_23/examples/Kernel_23/MyPointC2_iostream.h index 462ea205ef5..b9ca97eaee8 100644 --- a/Kernel_23/examples/Kernel_23/MyPointC2_iostream.h +++ b/Kernel_23/examples/Kernel_23/MyPointC2_iostream.h @@ -4,7 +4,7 @@ std::ostream & operator<<(std::ostream &os, const MyPointC2 &p) { - switch(os.iword(CGAL::IO::mode)) { + switch(CGAL::get_mode(os)) { case CGAL::IO::ASCII : return os << p.x() << ' ' << p.y() << ' ' << p.color(); case CGAL::IO::BINARY : @@ -24,7 +24,7 @@ operator>>(std::istream &is, MyPointC2 &p) { double x, y; int c; - switch(is.iword(CGAL::IO::mode)) { + switch(CGAL::get_mode(is)) { case CGAL::IO::ASCII : is >> x >> y >> c; break; diff --git a/Kernel_23/examples/Kernel_23/MySegmentC2.h b/Kernel_23/examples/Kernel_23/MySegmentC2.h index e83009c3e6a..34af4fed48b 100644 --- a/Kernel_23/examples/Kernel_23/MySegmentC2.h +++ b/Kernel_23/examples/Kernel_23/MySegmentC2.h @@ -224,7 +224,7 @@ template < class R > std::ostream & operator<<(std::ostream &os, const MySegmentC2 &s) { - switch(os.iword(CGAL::IO::mode)) { + switch(CGAL::get_mode(os)) { case CGAL::IO::ASCII : return os << s.source() << ' ' << s.target(); case CGAL::IO::BINARY : diff --git a/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt b/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt index 763c25d968e..da6c523eaa5 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt +++ b/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt @@ -57,14 +57,14 @@ qt5_wrap_ui(uis MainWindow.ui CreateMesh.ui CreateMenger.ui CreateSierpinskiCarpet.ui CreateSierpinskiTriangle.ui) # qrc files (resources files, that contain icons, at least) -qt5_add_resources (RESOURCE_FILES ./Linear_cell_complex_3.qrc) +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 Linear_cell_complex_pqq_subdivision.cpp - ${uis} ${RESOURCE_FILES} ) + ${uis} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) qt5_use_modules(Linear_cell_complex_3_demo Xml Script OpenGL Svg) add_to_cached_list(CGAL_EXECUTABLE_TARGETS Linear_cell_complex_3_demo) @@ -73,6 +73,7 @@ target_link_libraries(Linear_cell_complex_3_demo ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}) target_link_libraries(Linear_cell_complex_3_demo ${QT_LIBRARIES} ${QGLVIEWER_LIBRARIES} ) -target_link_libraries(Linear_cell_complex_3_demo ${OPENGL_gl_LIBRARY} ) +target_link_libraries(Linear_cell_complex_3_demo ${OPENGL_gl_LIBRARY} + ${OPENGL_glu_LIBRARY} ) endif() diff --git a/Matrix_search/examples/Matrix_search/sorted_matrix_search.cpp b/Matrix_search/examples/Matrix_search/sorted_matrix_search.cpp index ddc1884bfc8..4c1c587f127 100644 --- a/Matrix_search/examples/Matrix_search/sorted_matrix_search.cpp +++ b/Matrix_search/examples/Matrix_search/sorted_matrix_search.cpp @@ -23,7 +23,7 @@ int main() Vector a; const int n = 5; for (int i = 0; i < n; ++i) - a.push_back(CGAL::default_random(100)); + a.push_back(CGAL::get_default_random()(100)); std::sort(a.begin(), a.end()); std::cout << "a = ( "; std::copy(a.begin(), a.end(), std::ostream_iterator(std::cout," ")); diff --git a/Matrix_search/test/Matrix_search/sorted_matrix_search_test.cpp b/Matrix_search/test/Matrix_search/sorted_matrix_search_test.cpp index df77b228661..7808962945b 100644 --- a/Matrix_search/test/Matrix_search/sorted_matrix_search_test.cpp +++ b/Matrix_search/test/Matrix_search/sorted_matrix_search_test.cpp @@ -60,7 +60,7 @@ using std::atoi; using std::exit; using CGAL::Cartesian_matrix; using CGAL::Random; -using CGAL::default_random; +using CGAL::get_default_random; using CGAL::sorted_matrix_search; using CGAL::sorted_matrix_search_traits_adaptor; @@ -108,7 +108,7 @@ main( int argc, char* argv[]) #endif // generate random seed - random_seed = default_random.get_int( 0, (1 << 30)); + random_seed = get_default_random().get_int( 0, (1 << 30)); } else random_seed = atoi(argv[4]); diff --git a/Mesh_3/demo/Mesh_3/CMakeLists.txt b/Mesh_3/demo/Mesh_3/CMakeLists.txt index cd3eebe3c74..864383481c5 100644 --- a/Mesh_3/demo/Mesh_3/CMakeLists.txt +++ b/Mesh_3/demo/Mesh_3/CMakeLists.txt @@ -146,7 +146,7 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND AND Boost_F qt5_wrap_cpp( VOLUME_MOC_OUTFILES ${CMAKE_CURRENT_SOURCE_DIR}/Volume_plane_thread.h ) qt5_wrap_cpp( VOLUME_MOC_OUTFILES ${CMAKE_CURRENT_SOURCE_DIR}/Volume_plane_interface.h ) - qt5_add_resources ( RESOURCE_FILES Mesh_3.qrc ) + qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES Mesh_3.qrc ) # put plugins (which are shared libraries) at the same location as # executable files @@ -220,7 +220,7 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND AND Boost_F Scene_moc.cpp) #ADD_MSVC_PRECOMPILED_HEADER("StdAfx.h" "StdAfx.cpp" MESH_3_SOURCE_FILES) - LIST(APPEND MESH_3_SOURCE_FILES ${UI_FILES} ${RESOURCE_FILES}) + LIST(APPEND MESH_3_SOURCE_FILES ${UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) add_executable( Mesh_3 ${MESH_3_SOURCE_FILES} ) qt5_use_modules(Mesh_3 Xml Script OpenGL Svg) add_to_cached_list( CGAL_EXECUTABLE_TARGETS Mesh_3 ) diff --git a/Mesh_3/demo/Mesh_3/Mesh_function.h b/Mesh_3/demo/Mesh_3/Mesh_function.h index 2c6186f6fe6..821c7b82cc8 100644 --- a/Mesh_3/demo/Mesh_3/Mesh_function.h +++ b/Mesh_3/demo/Mesh_3/Mesh_function.h @@ -158,7 +158,7 @@ Mesh_function:: launch() { #ifdef CGAL_MESH_3_INITIAL_POINTS_NO_RANDOM_SHOOTING - CGAL::default_random = CGAL::Random(0); + CGAL::get_default_random() = CGAL::Random(0); #endif // Create mesh criteria diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 4e08d340c12..480a239162e 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -416,7 +416,7 @@ void make_mesh_3_impl(C3T3& c3t3, mesh_options = parameters::internal::Mesh_3_options()) { #ifdef CGAL_MESH_3_INITIAL_POINTS_NO_RANDOM_SHOOTING - CGAL::default_random = CGAL::Random(0); + CGAL::get_default_random() = CGAL::Random(0); #endif // Initialize c3t3 diff --git a/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image.cpp b/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image.cpp index 679a0512fd7..8fbeea0f86e 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image.cpp @@ -76,14 +76,14 @@ public: } std::cout << "\tSeed is\t" - << CGAL::default_random.get_seed() << std::endl; + << CGAL::get_default_random().get_seed() << std::endl; // Domain Mesh_domain domain(image, 2.9f, //isovalue 0.f, //value_outside 1e-3, //error_bound - &CGAL::default_random);//random generator for determinism + &CGAL::get_default_random());//random generator for determinism const CGAL::Mesh_facet_topology topology = boost::is_same::value ? diff --git a/Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp b/Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp index 9d8338d92ed..ff62347eac9 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp @@ -55,8 +55,8 @@ public: image.read("data/liver.inr.gz"); std::cout << "\tSeed is\t" - << CGAL::default_random.get_seed() << std::endl; - Mesh_domain domain(image, 1e-9, &CGAL::default_random); + << CGAL::get_default_random().get_seed() << std::endl; + Mesh_domain domain(image, 1e-9, &CGAL::get_default_random()); // Set mesh criteria Facet_criteria facet_criteria(25, 20*image.vx(), 5*image.vx()); diff --git a/Mesh_3/test/Mesh_3/test_meshing_implicit_function.cpp b/Mesh_3/test/Mesh_3/test_meshing_implicit_function.cpp index 76415a0a76b..85d7332833a 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_implicit_function.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_implicit_function.cpp @@ -61,11 +61,11 @@ struct Implicit_tester : public Tester // Data generation //------------------------------------------------------- std::cout << "\tSeed is\t" - << CGAL::default_random.get_seed() << std::endl; + << CGAL::get_default_random().get_seed() << std::endl; Mesh_domain domain(Implicit_tester::sphere_function, Sphere_3(CGAL::ORIGIN,2.), 1e-3, - &CGAL::default_random); + &CGAL::get_default_random()); // Set mesh criteria Facet_criteria facet_criteria(0, 0, 0.3); diff --git a/Mesh_3/test/Mesh_3/test_meshing_polyhedron.cpp b/Mesh_3/test/Mesh_3/test_meshing_polyhedron.cpp index ace03d237df..ca8abc31683 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_polyhedron.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_polyhedron.cpp @@ -56,8 +56,8 @@ struct Polyhedron_tester : public Tester input.close(); std::cout << "\tSeed is\t" - << CGAL::default_random.get_seed() << std::endl; - Mesh_domain domain(polyhedron, &CGAL::default_random); + << CGAL::get_default_random().get_seed() << std::endl; + Mesh_domain domain(polyhedron, &CGAL::get_default_random()); // Set mesh criteria Facet_criteria facet_criteria(30, 0.2, 0.02); diff --git a/Mesh_3/test/Mesh_3/test_meshing_polyhedron_with_features.cpp b/Mesh_3/test/Mesh_3/test_meshing_polyhedron_with_features.cpp index 85d51d094f3..b543d20e6fc 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_polyhedron_with_features.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_polyhedron_with_features.cpp @@ -55,8 +55,8 @@ struct Polyhedron_with_features_tester : public Tester // Data generation //------------------------------------------------------- std::cout << "\tSeed is\t" - << CGAL::default_random.get_seed() << std::endl; - Mesh_domain domain("data/cube.off", &CGAL::default_random); + << CGAL::get_default_random().get_seed() << std::endl; + Mesh_domain domain("data/cube.off", &CGAL::get_default_random()); domain.detect_features(); // Set mesh criteria diff --git a/Mesh_3/test/Mesh_3/test_meshing_polylines_only.cpp b/Mesh_3/test/Mesh_3/test_meshing_polylines_only.cpp index d3989fd88b7..7da0c1847cd 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_polylines_only.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_polylines_only.cpp @@ -47,8 +47,8 @@ int main(int argc, char** argv) Point(0, 0, 1)); std::cout << "\tSeed is\t" - << CGAL::default_random.get_seed() << std::endl; - Mesh_domain domain(p, &CGAL::default_random); + << CGAL::get_default_random().get_seed() << std::endl; + Mesh_domain domain(p, &CGAL::get_default_random()); typedef std::vector Polyline; typedef std::vector Polylines; diff --git a/Modular_arithmetic/include/CGAL/primes.h b/Modular_arithmetic/include/CGAL/primes.h index e1cf782d907..fbff306e18e 100644 --- a/Modular_arithmetic/include/CGAL/primes.h +++ b/Modular_arithmetic/include/CGAL/primes.h @@ -27,7 +27,273 @@ namespace CGAL { namespace internal { -CGAL_EXPORT extern const int primes[2000]; + +const int primes[2000] = { + /* + * Generated in SAGE with: + * + * N = 2000 + * p = 2^26 + * L = [] + * while len(L) < N: + * p = previous_prime(p) + * if GF(p)(2).is_primitive_root(): + * L.append(p) + * k = 8 + * for i in range(N/k): + * print ' ' + ', '.join (str(p) for p in L[k*i:k*(i+1)]) + ',' + */ + 67108859, 67108819, 67108763, 67108757, 67108747, 67108739, 67108709, 67108693, + 67108669, 67108667, 67108661, 67108597, 67108579, 67108507, 67108493, 67108453, + 67108387, 67108373, 67108331, 67108219, 67108187, 67108109, 67108037, 67108003, + 67107941, 67107797, 67107787, 67107773, 67107757, 67107749, 67107707, 67107643, + 67107541, 67107539, 67107533, 67107461, 67107427, 67107389, 67107323, 67107317, + 67107301, 67107253, 67107203, 67107149, 67107043, 67106987, 67106821, 67106813, + 67106797, 67106749, 67106717, 67106693, 67106483, 67106477, 67106357, 67106339, + 67106323, 67106243, 67106213, 67106189, 67106107, 67106099, 67106093, 67106059, + 67105963, 67105933, 67105877, 67105867, 67105811, 67105771, 67105763, 67105699, + 67105691, 67105517, 67105459, 67105453, 67105373, 67105349, 67105267, 67105187, + 67105141, 67105133, 67105061, 67104997, 67104931, 67104923, 67104893, 67104883, + 67104859, 67104803, 67104757, 67104707, 67104691, 67104589, 67104581, 67104571, + 67104563, 67104539, 67104517, 67104437, 67104419, 67104379, 67104341, 67104293, + 67104277, 67104251, 67104227, 67104139, 67104061, 67104053, 67103963, 67103909, + 67103867, 67103851, 67103837, 67103821, 67103731, 67103669, 67103653, 67103587, + 67103579, 67103549, 67103507, 67103483, 67103219, 67103173, 67103149, 67103147, + 67103107, 67103083, 67103051, 67103027, 67103021, 67102963, 67102949, 67102901, + 67102843, 67102733, 67102627, 67102613, 67102531, 67102499, 67102459, 67102397, + 67102333, 67102331, 67102283, 67102237, 67102181, 67102163, 67102099, 67102093, + 67102069, 67102067, 67102019, 67101997, 67101989, 67101899, 67101883, 67101877, + 67101779, 67101739, 67101691, 67101637, 67101613, 67101509, 67101493, 67101491, + 67101469, 67101443, 67101413, 67101341, 67101323, 67101299, 67101187, 67101173, + 67101053, 67100987, 67100981, 67100963, 67100947, 67100939, 67100909, 67100899, + 67100861, 67100851, 67100827, 67100773, 67100731, 67100699, 67100669, 67100659, + 67100653, 67100587, 67100459, 67100357, 67100347, 67100179, 67100141, 67100123, + 67100101, 67099987, 67099957, 67099931, 67099861, 67099853, 67099829, 67099819, + 67099699, 67099589, 67099547, 67099541, 67099517, 67099499, 67099397, 67099387, + 67099363, 67099339, 67099267, 67099213, 67099141, 67099133, 67099037, 67098931, + 67098923, 67098917, 67098907, 67098827, 67098821, 67098739, 67098653, 67098589, + 67098419, 67098389, 67098347, 67098341, 67098323, 67098299, 67098277, 67098259, + 67098203, 67098197, 67098179, 67098149, 67098067, 67098029, 67097917, 67097819, + 67097813, 67097803, 67097747, 67097699, 67097669, 67097659, 67097579, 67097413, + 67097363, 67097339, 67097333, 67097291, 67097269, 67097123, 67097053, 67096987, + 67096979, 67096973, 67096907, 67096867, 67096837, 67096693, 67096669, 67096507, + 67096499, 67096483, 67096411, 67096387, 67096373, 67096301, 67096109, 67096067, + 67096021, 67096013, 67095989, 67095971, 67095893, 67095869, 67095797, 67095731, + 67095701, 67095683, 67095667, 67095659, 67095629, 67095499, 67095421, 67095419, + 67095349, 67095317, 67095173, 67095139, 67095131, 67095101, 67095037, 67095011, + 67094987, 67094981, 67094917, 67094899, 67094891, 67094837, 67094827, 67094723, + 67094717, 67094707, 67094701, 67094581, 67094557, 67094507, 67094501, 67094459, + 67094437, 67094411, 67094389, 67094309, 67094299, 67094267, 67094141, 67094123, + 67094099, 67093979, 67093933, 67093931, 67093861, 67093853, 67093757, 67093723, + 67093699, 67093627, 67093619, 67093613, 67093603, 67093597, 67093547, 67093349, + 67093307, 67093181, 67093171, 67093163, 67093157, 67093109, 67093069, 67093043, + 67093003, 67092997, 67092947, 67092869, 67092821, 67092787, 67092757, 67092749, + 67092709, 67092691, 67092643, 67092611, 67092563, 67092539, 67092491, 67092461, + 67092419, 67092331, 67092323, 67092301, 67092227, 67092203, 67092197, 67092107, + 67091987, 67091939, 67091933, 67091923, 67091797, 67091779, 67091771, 67091669, + 67091611, 67091491, 67091477, 67091443, 67091357, 67091341, 67091243, 67091203, + 67091149, 67091107, 67091029, 67090979, 67090973, 67090939, 67090861, 67090763, + 67090627, 67090613, 67090589, 67090579, 67090549, 67090547, 67090523, 67090459, + 67090451, 67090411, 67090403, 67090307, 67090259, 67090229, 67090189, 67090117, + 67090099, 67090091, 67090043, 67090027, 67090013, 67089949, 67089829, 67089739, + 67089733, 67089707, 67089683, 67089587, 67089541, 67089461, 67089299, 67089283, + 67089277, 67089221, 67089059, 67088963, 67088821, 67088797, 67088779, 67088717, + 67088683, 67088653, 67088627, 67088621, 67088603, 67088597, 67088573, 67088509, + 67088501, 67088453, 67088429, 67088381, 67088347, 67088267, 67088117, 67088093, + 67088059, 67087973, 67087957, 67087901, 67087883, 67087859, 67087723, 67087717, + 67087637, 67087571, 67087547, 67087459, 67087451, 67087421, 67087277, 67087259, + 67087243, 67087187, 67087123, 67087019, 67086949, 67086931, 67086917, 67086893, + 67086869, 67086827, 67086757, 67086667, 67086637, 67086629, 67086611, 67086589, + 67086421, 67086347, 67086323, 67086317, 67086307, 67086293, 67086259, 67086109, + 67086067, 67086053, 67086043, 67086013, 67085939, 67085933, 67085899, 67085869, + 67085867, 67085861, 67085819, 67085813, 67085803, 67085771, 67085741, 67085677, + 67085531, 67085443, 67085437, 67085429, 67085357, 67085341, 67085267, 67085189, + 67085173, 67085171, 67085099, 67085093, 67085003, 67084981, 67084973, 67084931, + 67084861, 67084789, 67084757, 67084709, 67084643, 67084637, 67084603, 67084547, + 67084517, 67084483, 67084427, 67084349, 67084333, 67084331, 67084309, 67084189, + 67084187, 67084139, 67084013, 67083883, 67083859, 67083811, 67083803, 67083787, + 67083739, 67083707, 67083629, 67083619, 67083613, 67083539, 67083517, 67083461, + 67083437, 67083371, 67083323, 67083221, 67083197, 67083067, 67082989, 67082987, + 67082963, 67082933, 67082909, 67082891, 67082861, 67082843, 67082779, 67082707, + 67082699, 67082579, 67082549, 67082531, 67082453, 67082363, 67082339, 67082227, + 67082189, 67082131, 67082123, 67082101, 67082003, 67081957, 67081829, 67081811, + 67081787, 67081741, 67081733, 67081709, 67081691, 67081661, 67081579, 67081499, + 67081477, 67081429, 67081283, 67081237, 67081213, 67081211, 67081139, 67081123, + 67081051, 67080971, 67080947, 67080917, 67080859, 67080821, 67080803, 67080763, + 67080701, 67080653, 67080557, 67080491, 67080437, 67080413, 67080323, 67080179, + 67080173, 67080131, 67080107, 67080061, 67079981, 67079963, 67079941, 67079933, + 67079917, 67079693, 67079587, 67079491, 67079459, 67079429, 67079347, 67079333, + 67079323, 67079317, 67079267, 67079237, 67079219, 67079213, 67079203, 67079149, + 67079141, 67079123, 67079083, 67079027, 67078981, 67078931, 67078877, 67078819, + 67078813, 67078789, 67078763, 67078643, 67078573, 67078469, 67078387, 67078331, + 67078309, 67078301, 67078283, 67078213, 67078181, 67078139, 67078133, 67078069, + 67078061, 67078013, 67077947, 67077917, 67077851, 67077827, 67077797, 67077757, + 67077643, 67077611, 67077541, 67077539, 67077419, 67077403, 67077379, 67077349, + 67077341, 67077299, 67077293, 67077259, 67077181, 67077173, 67077133, 67076899, + 67076869, 67076851, 67076843, 67076803, 67076773, 67076741, 67076693, 67076683, + 67076677, 67076651, 67076629, 67076627, 67076573, 67076539, 67076413, 67076411, + 67076357, 67076341, 67076291, 67076189, 67076147, 67076117, 67076077, 67076069, + 67076029, 67075973, 67075949, 67075933, 67075907, 67075867, 67075787, 67075691, + 67075669, 67075573, 67075493, 67075373, 67075363, 67075277, 67075243, 67075147, + 67075109, 67075091, 67075069, 67075067, 67075037, 67074947, 67074901, 67074859, + 67074853, 67074851, 67074829, 67074691, 67074619, 67074613, 67074611, 67074587, + 67074523, 67074467, 67074317, 67074307, 67074277, 67074269, 67074179, 67073947, + 67073917, 67073899, 67073803, 67073731, 67073707, 67073701, 67073683, 67073651, + 67073603, 67073597, 67073579, 67073533, 67073459, 67073387, 67073339, 67073333, + 67073323, 67073309, 67073261, 67073197, 67073189, 67073107, 67073051, 67073003, + 67072997, 67072979, 67072909, 67072877, 67072781, 67072757, 67072739, 67072693, + 67072541, 67072373, 67072363, 67072339, 67072309, 67072283, 67072277, 67072253, + 67072139, 67072037, 67071997, 67071989, 67071947, 67071923, 67071899, 67071883, + 67071877, 67071821, 67071707, 67071637, 67071547, 67071419, 67071413, 67071317, + 67071299, 67071293, 67071157, 67071149, 67071139, 67071061, 67070989, 67070981, + 67070909, 67070869, 67070837, 67070827, 67070813, 67070803, 67070749, 67070699, + 67070621, 67070573, 67070539, 67070459, 67070357, 67070317, 67070291, 67070261, + 67070251, 67070203, 67070053, 67070027, 67069979, 67069819, 67069813, 67069787, + 67069781, 67069763, 67069669, 67069661, 67069549, 67069531, 67069469, 67069427, + 67069397, 67069339, 67069157, 67069133, 67069109, 67069099, 67069043, 67069021, + 67068971, 67068931, 67068787, 67068653, 67068643, 67068629, 67068571, 67068557, + 67068539, 67068509, 67068493, 67068371, 67068301, 67068269, 67068259, 67068227, + 67068203, 67068187, 67068181, 67068173, 67068163, 67068101, 67067971, 67067933, + 67067909, 67067789, 67067779, 67067773, 67067723, 67067629, 67067597, 67067501, + 67067453, 67067437, 67067389, 67067387, 67067339, 67067293, 67067269, 67067213, + 67067173, 67067171, 67067069, 67067059, 67067029, 67066907, 67066861, 67066859, + 67066771, 67066757, 67066723, 67066709, 67066667, 67066619, 67066613, 67066379, + 67066277, 67066243, 67066211, 67066157, 67066093, 67066061, 67066019, 67065979, + 67065931, 67065917, 67065883, 67065827, 67065787, 67065667, 67065659, 67065653, + 67065643, 67065619, 67065563, 67065461, 67065437, 67065389, 67065373, 67065293, + 67065283, 67065227, 67065211, 67065157, 67065091, 67064843, 67064827, 67064819, + 67064773, 67064771, 67064741, 67064717, 67064693, 67064611, 67064597, 67064587, + 67064579, 67064549, 67064467, 67064299, 67064267, 67064237, 67064213, 67064197, + 67064171, 67064147, 67064131, 67064093, 67064059, 67063853, 67063813, 67063723, + 67063643, 67063637, 67063523, 67063517, 67063397, 67063349, 67063307, 67063189, + 67063163, 67063133, 67063123, 67063099, 67063093, 67063069, 67063043, 67063037, + 67063019, 67062923, 67062893, 67062883, 67062859, 67062659, 67062629, 67062613, + 67062539, 67062509, 67062469, 67062461, 67062379, 67062349, 67062299, 67062221, + 67062179, 67062157, 67062067, 67062029, 67062011, 67061987, 67061947, 67061933, + 67061909, 67061867, 67061861, 67061789, 67061747, 67061693, 67061627, 67061597, + 67061563, 67061531, 67061333, 67061299, 67061227, 67061219, 67061179, 67061173, + 67061147, 67061003, 67060997, 67060957, 67060949, 67060933, 67060837, 67060813, + 67060627, 67060549, 67060523, 67060517, 67060507, 67060451, 67060421, 67060373, + 67060333, 67060307, 67060277, 67060261, 67060229, 67060187, 67060171, 67060141, + 67060109, 67060067, 67060043, 67060027, 67060013, 67059989, 67059907, 67059899, + 67059869, 67059779, 67059757, 67059749, 67059731, 67059709, 67059701, 67059637, + 67059613, 67059581, 67059547, 67059533, 67059523, 67059437, 67059427, 67059259, + 67059173, 67059061, 67058963, 67058941, 67058909, 67058899, 67058891, 67058867, + 67058843, 67058723, 67058699, 67058669, 67058627, 67058531, 67058389, 67058347, + 67058339, 67058323, 67058309, 67058269, 67058227, 67058213, 67058141, 67058003, + 67057883, 67057853, 67057819, 67057813, 67057763, 67057733, 67057723, 67057717, + 67057709, 67057643, 67057499, 67057493, 67057387, 67057381, 67057379, 67057363, + 67057307, 67057147, 67057141, 67056989, 67056971, 67056917, 67056877, 67056763, + 67056677, 67056667, 67056659, 67056637, 67056611, 67056581, 67056461, 67056419, + 67056371, 67056259, 67056251, 67056179, 67056107, 67056083, 67056053, 67056043, + 67056013, 67055957, 67055909, 67055843, 67055789, 67055771, 67055629, 67055539, + 67055491, 67055477, 67055467, 67055347, 67055309, 67055299, 67055291, 67055267, + 67055243, 67055203, 67055179, 67055147, 67054997, 67054979, 67054907, 67054877, + 67054859, 67054763, 67054733, 67054717, 67054541, 67054523, 67054483, 67054411, + 67054387, 67054301, 67054213, 67054051, 67054037, 67053997, 67053971, 67053941, + 67053893, 67053787, 67053733, 67053659, 67053653, 67053643, 67053629, 67053619, + 67053563, 67053557, 67053523, 67053517, 67053419, 67053397, 67053373, 67053317, + 67053251, 67053229, 67053197, 67053179, 67053149, 67053037, 67053029, 67052963, + 67052939, 67052933, 67052819, 67052813, 67052779, 67052723, 67052677, 67052509, + 67052477, 67052467, 67052243, 67052021, 67051979, 67051949, 67051909, 67051883, + 67051861, 67051813, 67051811, 67051781, 67051709, 67051651, 67051643, 67051573, + 67051571, 67051547, 67051493, 67051379, 67051373, 67051331, 67051253, 67051189, + 67051181, 67051099, 67051069, 67051021, 67050979, 67050931, 67050917, 67050869, + 67050827, 67050749, 67050707, 67050701, 67050619, 67050611, 67050541, 67050509, + 67050443, 67050421, 67050419, 67050371, 67050301, 67050299, 67050251, 67050187, + 67050101, 67050077, 67049987, 67049981, 67049963, 67049909, 67049891, 67049867, + 67049837, 67049813, 67049747, 67049707, 67049693, 67049629, 67049627, 67049603, + 67049573, 67049539, 67049453, 67049413, 67049267, 67049261, 67049251, 67049179, + 67049149, 67049141, 67049093, 67049027, 67048963, 67048859, 67048819, 67048757, + 67048733, 67048693, 67048627, 67048621, 67048523, 67048469, 67048411, 67048349, + 67048277, 67048259, 67048141, 67048123, 67048109, 67047989, 67047859, 67047787, + 67047763, 67047749, 67047733, 67047731, 67047683, 67047619, 67047613, 67047611, + 67047581, 67047517, 67047509, 67047413, 67047397, 67047283, 67047131, 67047077, + 67047061, 67047059, 67047053, 67047037, 67047011, 67046989, 67046939, 67046899, + 67046797, 67046779, 67046731, 67046549, 67046531, 67046477, 67046467, 67046437, + 67046429, 67046411, 67046387, 67046363, 67046341, 67046333, 67046261, 67046197, + 67046107, 67046069, 67046059, 67046051, 67045973, 67045949, 67045907, 67045877, + 67045723, 67045613, 67045579, 67045571, 67045549, 67045541, 67045507, 67045403, + 67045339, 67045301, 67045267, 67045261, 67045211, 67045189, 67045133, 67045117, + 67045109, 67045061, 67045037, 67045019, 67044973, 67044907, 67044829, 67044797, + 67044779, 67044773, 67044763, 67044739, 67044541, 67044427, 67044371, 67044347, + 67044301, 67044283, 67044203, 67044157, 67044083, 67044077, 67044067, 67044053, + 67043981, 67043939, 67043909, 67043813, 67043797, 67043707, 67043507, 67043477, + 67043443, 67043243, 67043147, 67043107, 67043083, 67043069, 67043059, 67043051, + 67043027, 67042979, 67042973, 67042949, 67042931, 67042709, 67042643, 67042637, + 67042589, 67042571, 67042541, 67042523, 67042501, 67042453, 67042427, 67042363, + 67042307, 67042301, 67042259, 67042211, 67042091, 67042043, 67041907, 67041893, + 67041869, 67041797, 67041749, 67041731, 67041701, 67041613, 67041581, 67041563, + 67041547, 67041539, 67041509, 67041467, 67041461, 67041419, 67041371, 67041307, + 67041283, 67041269, 67041203, 67041187, 67041179, 67041043, 67040917, 67040893, + 67040789, 67040773, 67040723, 67040629, 67040627, 67040621, 67040587, 67040549, + 67040509, 67040443, 67040387, 67040381, 67040317, 67040291, 67040261, 67040243, + 67040219, 67040203, 67040069, 67040021, 67039997, 67039957, 67039883, 67039877, + 67039867, 67039853, 67039811, 67039757, 67039723, 67039699, 67039669, 67039627, + 67039613, 67039571, 67039547, 67039501, 67039499, 67039309, 67039307, 67039253, + 67039187, 67039139, 67039051, 67039003, 67038947, 67038941, 67038877, 67038869, + 67038827, 67038787, 67038739, 67038637, 67038589, 67038557, 67038539, 67038533, + 67038427, 67038371, 67038341, 67038299, 67038277, 67038221, 67038197, 67038173, + 67038149, 67038133, 67038131, 67038067, 67038029, 67038011, 67037843, 67037837, + 67037819, 67037797, 67037771, 67037723, 67037683, 67037627, 67037603, 67037563, + 67037483, 67037459, 67037429, 67037389, 67037261, 67037227, 67037213, 67037107, + 67037101, 67037053, 67036979, 67036909, 67036901, 67036877, 67036867, 67036843, + 67036819, 67036811, 67036747, 67036643, 67036589, 67036547, 67036507, 67036469, + 67036397, 67036379, 67036357, 67036259, 67036243, 67036187, 67036181, 67036157, + 67036093, 67036027, 67036019, 67035989, 67035949, 67035931, 67035901, 67035803, + 67035707, 67035659, 67035653, 67035643, 67035589, 67035499, 67035491, 67035469, + 67035413, 67035349, 67035347, 67035307, 67035277, 67035149, 67035107, 67035077, + 67034987, 67034819, 67034699, 67034683, 67034677, 67034477, 67034419, 67034381, + 67034339, 67034309, 67034293, 67034171, 67034117, 67034069, 67034021, 67033859, + 67033763, 67033741, 67033709, 67033699, 67033667, 67033619, 67033613, 67033597, + 67033541, 67033507, 67033469, 67033429, 67033403, 67033357, 67033331, 67033283, + 67033277, 67033229, 67033157, 67033117, 67033061, 67032997, 67032941, 67032811, + 67032803, 67032701, 67032661, 67032653, 67032613, 67032587, 67032541, 67032523, + 67032517, 67032491, 67032461, 67032451, 67032443, 67032421, 67032389, 67032349, + 67032347, 67032299, 67032221, 67032179, 67032101, 67031941, 67031933, 67031893, + 67031851, 67031819, 67031813, 67031749, 67031693, 67031509, 67031483, 67031443, + 67031429, 67031387, 67031243, 67031219, 67031203, 67031189, 67031149, 67031147, + 67031123, 67031101, 67031059, 67030963, 67030933, 67030907, 67030867, 67030853, + 67030757, 67030741, 67030739, 67030693, 67030669, 67030597, 67030517, 67030451, + 67030427, 67030333, 67030331, 67030181, 67030069, 67030013, 67029947, 67029931, + 67029923, 67029917, 67029901, 67029811, 67029779, 67029763, 67029749, 67029709, + 67029707, 67029581, 67029541, 67029509, 67029491, 67029451, 67029437, 67029427, + 67029421, 67029373, 67029341, 67029323, 67029293, 67029269, 67029253, 67029229, + 67029077, 67029059, 67029043, 67029013, 67028981, 67028917, 67028771, 67028669, + 67028653, 67028651, 67028597, 67028557, 67028539, 67028477, 67028413, 67028387, + 67028243, 67028197, 67028083, 67028069, 67028021, 67027997, 67027963, 67027949, + 67027931, 67027867, 67027861, 67027811, 67027693, 67027627, 67027619, 67027547, + 67027507, 67027453, 67027427, 67027339, 67027283, 67027237, 67027189, 67027187, + 67027069, 67027027, 67027019, 67027013, 67026979, 67026907, 67026829, 67026811, + 67026803, 67026787, 67026643, 67026613, 67026539, 67026469, 67026467, 67026451, + 67026437, 67026403, 67026307, 67026299, 67026227, 67026187, 67026139, 67026131, + 67026109, 67026107, 67026083, 67026067, 67025971, 67025963, 67025957, 67025843, + 67025779, 67025773, 67025723, 67025701, 67025683, 67025669, 67025579, 67025573, + 67025531, 67025501, 67025459, 67025411, 67025363, 67025219, 67025213, 67025173, + 67025107, 67025051, 67025029, 67024987, 67024957, 67024901, 67024891, 67024733, + 67024637, 67024621, 67024613, 67024499, 67024483, 67024429, 67024411, 67024339, + 67024157, 67024141, 67024003, 67023989, 67023899, 67023893, 67023779, 67023763, + 67023667, 67023653, 67023493, 67023443, 67023421, 67023419, 67023371, 67023349, + 67023347, 67023331, 67023293, 67023259, 67023227, 67023211, 67023179, 67023157, + 67023139, 67023133, 67023091, 67023059, 67023053, 67023043, 67023037, 67023029, + 67022869, 67022819, 67022797, 67022723, 67022707, 67022701, 67022699, 67022693, + 67022539, 67022507, 67022477, 67022467, 67022387, 67022261, 67022243, 67022237, + 67022213, 67022147, 67022077, 67022027, 67021979, 67021963, 67021901, 67021861, + 67021741, 67021739, 67021723, 67021637, 67021621, 67021613, 67021499, 67021469, + 67021459, 67021363, 67021301, 67021237, 67021147, 67021139, 67021099, 67021067, + 67021043, 67020979, 67020973, 67020917, 67020893, 67020869, 67020797, 67020763, + 67020683, 67020589, 67020587, 67020557, 67020491, 67020397, 67020323, 67020299, + 67020251, 67020179, 67020077, 67020053, 67020013, 67019963, 67019867, 67019837, + 67019819, 67019747, 67019741, 67019653, 67019587, 67019549, 67019483, 67019437, + 67019371, 67019299, 67019123, 67019077, 67019027, 67019003, 67018997, 67018843, + 67018837, 67018771, 67018733, 67018717, 67018667, 67018613, 67018499, 67018493, + 67018429, 67018397, 67018387, 67018309, 67018181, 67018163, 67018141, 67018139, + 67018069, 67018051, 67017971, 67017931, 67017803, 67017763, 67017733, 67017707, + 67017677, 67017661, 67017659, 67017571, 67017563, 67017547, 67017413, 67017371, + 67017299, 67017277, 67017227, 67017211, 67017163, 67017157, 67017107, 67017059, + 67016869, 67016821, 67016813, 67016723, 67016717, 67016707, 67016693, 67016627, + 67016611, 67016483, 67016437, 67016387, 67016269, 67016197, 67016189, 67016179, +}; static inline int get_next_lower_prime(int current_prime){ @@ -63,8 +329,4 @@ int get_next_lower_prime(int current_prime){ } } -#ifdef CGAL_HEADER_ONLY -#include -#endif // CGAL_HEADER_ONLY - #endif // CGAL_PRIMES_H diff --git a/Modular_arithmetic/include/CGAL/primes_impl.h b/Modular_arithmetic/include/CGAL/primes_impl.h deleted file mode 100644 index 340b50bb1e4..00000000000 --- a/Modular_arithmetic/include/CGAL/primes_impl.h +++ /dev/null @@ -1,293 +0,0 @@ -// Copyright (c) Max-Planck-Institute Saarbruecken (Germany). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// Author(s) : Michael Hemmer, Alexander Kobel - -#include - -namespace CGAL { -namespace internal { - -const int primes [2000] = { - /* - * Generated in SAGE with: - * - * N = 2000 - * p = 2^26 - * L = [] - * while len(L) < N: - * p = previous_prime(p) - * if GF(p)(2).is_primitive_root(): - * L.append(p) - * k = 8 - * for i in range(N/k): - * print ' ' + ', '.join (str(p) for p in L[k*i:k*(i+1)]) + ',' - */ - 67108859, 67108819, 67108763, 67108757, 67108747, 67108739, 67108709, 67108693, - 67108669, 67108667, 67108661, 67108597, 67108579, 67108507, 67108493, 67108453, - 67108387, 67108373, 67108331, 67108219, 67108187, 67108109, 67108037, 67108003, - 67107941, 67107797, 67107787, 67107773, 67107757, 67107749, 67107707, 67107643, - 67107541, 67107539, 67107533, 67107461, 67107427, 67107389, 67107323, 67107317, - 67107301, 67107253, 67107203, 67107149, 67107043, 67106987, 67106821, 67106813, - 67106797, 67106749, 67106717, 67106693, 67106483, 67106477, 67106357, 67106339, - 67106323, 67106243, 67106213, 67106189, 67106107, 67106099, 67106093, 67106059, - 67105963, 67105933, 67105877, 67105867, 67105811, 67105771, 67105763, 67105699, - 67105691, 67105517, 67105459, 67105453, 67105373, 67105349, 67105267, 67105187, - 67105141, 67105133, 67105061, 67104997, 67104931, 67104923, 67104893, 67104883, - 67104859, 67104803, 67104757, 67104707, 67104691, 67104589, 67104581, 67104571, - 67104563, 67104539, 67104517, 67104437, 67104419, 67104379, 67104341, 67104293, - 67104277, 67104251, 67104227, 67104139, 67104061, 67104053, 67103963, 67103909, - 67103867, 67103851, 67103837, 67103821, 67103731, 67103669, 67103653, 67103587, - 67103579, 67103549, 67103507, 67103483, 67103219, 67103173, 67103149, 67103147, - 67103107, 67103083, 67103051, 67103027, 67103021, 67102963, 67102949, 67102901, - 67102843, 67102733, 67102627, 67102613, 67102531, 67102499, 67102459, 67102397, - 67102333, 67102331, 67102283, 67102237, 67102181, 67102163, 67102099, 67102093, - 67102069, 67102067, 67102019, 67101997, 67101989, 67101899, 67101883, 67101877, - 67101779, 67101739, 67101691, 67101637, 67101613, 67101509, 67101493, 67101491, - 67101469, 67101443, 67101413, 67101341, 67101323, 67101299, 67101187, 67101173, - 67101053, 67100987, 67100981, 67100963, 67100947, 67100939, 67100909, 67100899, - 67100861, 67100851, 67100827, 67100773, 67100731, 67100699, 67100669, 67100659, - 67100653, 67100587, 67100459, 67100357, 67100347, 67100179, 67100141, 67100123, - 67100101, 67099987, 67099957, 67099931, 67099861, 67099853, 67099829, 67099819, - 67099699, 67099589, 67099547, 67099541, 67099517, 67099499, 67099397, 67099387, - 67099363, 67099339, 67099267, 67099213, 67099141, 67099133, 67099037, 67098931, - 67098923, 67098917, 67098907, 67098827, 67098821, 67098739, 67098653, 67098589, - 67098419, 67098389, 67098347, 67098341, 67098323, 67098299, 67098277, 67098259, - 67098203, 67098197, 67098179, 67098149, 67098067, 67098029, 67097917, 67097819, - 67097813, 67097803, 67097747, 67097699, 67097669, 67097659, 67097579, 67097413, - 67097363, 67097339, 67097333, 67097291, 67097269, 67097123, 67097053, 67096987, - 67096979, 67096973, 67096907, 67096867, 67096837, 67096693, 67096669, 67096507, - 67096499, 67096483, 67096411, 67096387, 67096373, 67096301, 67096109, 67096067, - 67096021, 67096013, 67095989, 67095971, 67095893, 67095869, 67095797, 67095731, - 67095701, 67095683, 67095667, 67095659, 67095629, 67095499, 67095421, 67095419, - 67095349, 67095317, 67095173, 67095139, 67095131, 67095101, 67095037, 67095011, - 67094987, 67094981, 67094917, 67094899, 67094891, 67094837, 67094827, 67094723, - 67094717, 67094707, 67094701, 67094581, 67094557, 67094507, 67094501, 67094459, - 67094437, 67094411, 67094389, 67094309, 67094299, 67094267, 67094141, 67094123, - 67094099, 67093979, 67093933, 67093931, 67093861, 67093853, 67093757, 67093723, - 67093699, 67093627, 67093619, 67093613, 67093603, 67093597, 67093547, 67093349, - 67093307, 67093181, 67093171, 67093163, 67093157, 67093109, 67093069, 67093043, - 67093003, 67092997, 67092947, 67092869, 67092821, 67092787, 67092757, 67092749, - 67092709, 67092691, 67092643, 67092611, 67092563, 67092539, 67092491, 67092461, - 67092419, 67092331, 67092323, 67092301, 67092227, 67092203, 67092197, 67092107, - 67091987, 67091939, 67091933, 67091923, 67091797, 67091779, 67091771, 67091669, - 67091611, 67091491, 67091477, 67091443, 67091357, 67091341, 67091243, 67091203, - 67091149, 67091107, 67091029, 67090979, 67090973, 67090939, 67090861, 67090763, - 67090627, 67090613, 67090589, 67090579, 67090549, 67090547, 67090523, 67090459, - 67090451, 67090411, 67090403, 67090307, 67090259, 67090229, 67090189, 67090117, - 67090099, 67090091, 67090043, 67090027, 67090013, 67089949, 67089829, 67089739, - 67089733, 67089707, 67089683, 67089587, 67089541, 67089461, 67089299, 67089283, - 67089277, 67089221, 67089059, 67088963, 67088821, 67088797, 67088779, 67088717, - 67088683, 67088653, 67088627, 67088621, 67088603, 67088597, 67088573, 67088509, - 67088501, 67088453, 67088429, 67088381, 67088347, 67088267, 67088117, 67088093, - 67088059, 67087973, 67087957, 67087901, 67087883, 67087859, 67087723, 67087717, - 67087637, 67087571, 67087547, 67087459, 67087451, 67087421, 67087277, 67087259, - 67087243, 67087187, 67087123, 67087019, 67086949, 67086931, 67086917, 67086893, - 67086869, 67086827, 67086757, 67086667, 67086637, 67086629, 67086611, 67086589, - 67086421, 67086347, 67086323, 67086317, 67086307, 67086293, 67086259, 67086109, - 67086067, 67086053, 67086043, 67086013, 67085939, 67085933, 67085899, 67085869, - 67085867, 67085861, 67085819, 67085813, 67085803, 67085771, 67085741, 67085677, - 67085531, 67085443, 67085437, 67085429, 67085357, 67085341, 67085267, 67085189, - 67085173, 67085171, 67085099, 67085093, 67085003, 67084981, 67084973, 67084931, - 67084861, 67084789, 67084757, 67084709, 67084643, 67084637, 67084603, 67084547, - 67084517, 67084483, 67084427, 67084349, 67084333, 67084331, 67084309, 67084189, - 67084187, 67084139, 67084013, 67083883, 67083859, 67083811, 67083803, 67083787, - 67083739, 67083707, 67083629, 67083619, 67083613, 67083539, 67083517, 67083461, - 67083437, 67083371, 67083323, 67083221, 67083197, 67083067, 67082989, 67082987, - 67082963, 67082933, 67082909, 67082891, 67082861, 67082843, 67082779, 67082707, - 67082699, 67082579, 67082549, 67082531, 67082453, 67082363, 67082339, 67082227, - 67082189, 67082131, 67082123, 67082101, 67082003, 67081957, 67081829, 67081811, - 67081787, 67081741, 67081733, 67081709, 67081691, 67081661, 67081579, 67081499, - 67081477, 67081429, 67081283, 67081237, 67081213, 67081211, 67081139, 67081123, - 67081051, 67080971, 67080947, 67080917, 67080859, 67080821, 67080803, 67080763, - 67080701, 67080653, 67080557, 67080491, 67080437, 67080413, 67080323, 67080179, - 67080173, 67080131, 67080107, 67080061, 67079981, 67079963, 67079941, 67079933, - 67079917, 67079693, 67079587, 67079491, 67079459, 67079429, 67079347, 67079333, - 67079323, 67079317, 67079267, 67079237, 67079219, 67079213, 67079203, 67079149, - 67079141, 67079123, 67079083, 67079027, 67078981, 67078931, 67078877, 67078819, - 67078813, 67078789, 67078763, 67078643, 67078573, 67078469, 67078387, 67078331, - 67078309, 67078301, 67078283, 67078213, 67078181, 67078139, 67078133, 67078069, - 67078061, 67078013, 67077947, 67077917, 67077851, 67077827, 67077797, 67077757, - 67077643, 67077611, 67077541, 67077539, 67077419, 67077403, 67077379, 67077349, - 67077341, 67077299, 67077293, 67077259, 67077181, 67077173, 67077133, 67076899, - 67076869, 67076851, 67076843, 67076803, 67076773, 67076741, 67076693, 67076683, - 67076677, 67076651, 67076629, 67076627, 67076573, 67076539, 67076413, 67076411, - 67076357, 67076341, 67076291, 67076189, 67076147, 67076117, 67076077, 67076069, - 67076029, 67075973, 67075949, 67075933, 67075907, 67075867, 67075787, 67075691, - 67075669, 67075573, 67075493, 67075373, 67075363, 67075277, 67075243, 67075147, - 67075109, 67075091, 67075069, 67075067, 67075037, 67074947, 67074901, 67074859, - 67074853, 67074851, 67074829, 67074691, 67074619, 67074613, 67074611, 67074587, - 67074523, 67074467, 67074317, 67074307, 67074277, 67074269, 67074179, 67073947, - 67073917, 67073899, 67073803, 67073731, 67073707, 67073701, 67073683, 67073651, - 67073603, 67073597, 67073579, 67073533, 67073459, 67073387, 67073339, 67073333, - 67073323, 67073309, 67073261, 67073197, 67073189, 67073107, 67073051, 67073003, - 67072997, 67072979, 67072909, 67072877, 67072781, 67072757, 67072739, 67072693, - 67072541, 67072373, 67072363, 67072339, 67072309, 67072283, 67072277, 67072253, - 67072139, 67072037, 67071997, 67071989, 67071947, 67071923, 67071899, 67071883, - 67071877, 67071821, 67071707, 67071637, 67071547, 67071419, 67071413, 67071317, - 67071299, 67071293, 67071157, 67071149, 67071139, 67071061, 67070989, 67070981, - 67070909, 67070869, 67070837, 67070827, 67070813, 67070803, 67070749, 67070699, - 67070621, 67070573, 67070539, 67070459, 67070357, 67070317, 67070291, 67070261, - 67070251, 67070203, 67070053, 67070027, 67069979, 67069819, 67069813, 67069787, - 67069781, 67069763, 67069669, 67069661, 67069549, 67069531, 67069469, 67069427, - 67069397, 67069339, 67069157, 67069133, 67069109, 67069099, 67069043, 67069021, - 67068971, 67068931, 67068787, 67068653, 67068643, 67068629, 67068571, 67068557, - 67068539, 67068509, 67068493, 67068371, 67068301, 67068269, 67068259, 67068227, - 67068203, 67068187, 67068181, 67068173, 67068163, 67068101, 67067971, 67067933, - 67067909, 67067789, 67067779, 67067773, 67067723, 67067629, 67067597, 67067501, - 67067453, 67067437, 67067389, 67067387, 67067339, 67067293, 67067269, 67067213, - 67067173, 67067171, 67067069, 67067059, 67067029, 67066907, 67066861, 67066859, - 67066771, 67066757, 67066723, 67066709, 67066667, 67066619, 67066613, 67066379, - 67066277, 67066243, 67066211, 67066157, 67066093, 67066061, 67066019, 67065979, - 67065931, 67065917, 67065883, 67065827, 67065787, 67065667, 67065659, 67065653, - 67065643, 67065619, 67065563, 67065461, 67065437, 67065389, 67065373, 67065293, - 67065283, 67065227, 67065211, 67065157, 67065091, 67064843, 67064827, 67064819, - 67064773, 67064771, 67064741, 67064717, 67064693, 67064611, 67064597, 67064587, - 67064579, 67064549, 67064467, 67064299, 67064267, 67064237, 67064213, 67064197, - 67064171, 67064147, 67064131, 67064093, 67064059, 67063853, 67063813, 67063723, - 67063643, 67063637, 67063523, 67063517, 67063397, 67063349, 67063307, 67063189, - 67063163, 67063133, 67063123, 67063099, 67063093, 67063069, 67063043, 67063037, - 67063019, 67062923, 67062893, 67062883, 67062859, 67062659, 67062629, 67062613, - 67062539, 67062509, 67062469, 67062461, 67062379, 67062349, 67062299, 67062221, - 67062179, 67062157, 67062067, 67062029, 67062011, 67061987, 67061947, 67061933, - 67061909, 67061867, 67061861, 67061789, 67061747, 67061693, 67061627, 67061597, - 67061563, 67061531, 67061333, 67061299, 67061227, 67061219, 67061179, 67061173, - 67061147, 67061003, 67060997, 67060957, 67060949, 67060933, 67060837, 67060813, - 67060627, 67060549, 67060523, 67060517, 67060507, 67060451, 67060421, 67060373, - 67060333, 67060307, 67060277, 67060261, 67060229, 67060187, 67060171, 67060141, - 67060109, 67060067, 67060043, 67060027, 67060013, 67059989, 67059907, 67059899, - 67059869, 67059779, 67059757, 67059749, 67059731, 67059709, 67059701, 67059637, - 67059613, 67059581, 67059547, 67059533, 67059523, 67059437, 67059427, 67059259, - 67059173, 67059061, 67058963, 67058941, 67058909, 67058899, 67058891, 67058867, - 67058843, 67058723, 67058699, 67058669, 67058627, 67058531, 67058389, 67058347, - 67058339, 67058323, 67058309, 67058269, 67058227, 67058213, 67058141, 67058003, - 67057883, 67057853, 67057819, 67057813, 67057763, 67057733, 67057723, 67057717, - 67057709, 67057643, 67057499, 67057493, 67057387, 67057381, 67057379, 67057363, - 67057307, 67057147, 67057141, 67056989, 67056971, 67056917, 67056877, 67056763, - 67056677, 67056667, 67056659, 67056637, 67056611, 67056581, 67056461, 67056419, - 67056371, 67056259, 67056251, 67056179, 67056107, 67056083, 67056053, 67056043, - 67056013, 67055957, 67055909, 67055843, 67055789, 67055771, 67055629, 67055539, - 67055491, 67055477, 67055467, 67055347, 67055309, 67055299, 67055291, 67055267, - 67055243, 67055203, 67055179, 67055147, 67054997, 67054979, 67054907, 67054877, - 67054859, 67054763, 67054733, 67054717, 67054541, 67054523, 67054483, 67054411, - 67054387, 67054301, 67054213, 67054051, 67054037, 67053997, 67053971, 67053941, - 67053893, 67053787, 67053733, 67053659, 67053653, 67053643, 67053629, 67053619, - 67053563, 67053557, 67053523, 67053517, 67053419, 67053397, 67053373, 67053317, - 67053251, 67053229, 67053197, 67053179, 67053149, 67053037, 67053029, 67052963, - 67052939, 67052933, 67052819, 67052813, 67052779, 67052723, 67052677, 67052509, - 67052477, 67052467, 67052243, 67052021, 67051979, 67051949, 67051909, 67051883, - 67051861, 67051813, 67051811, 67051781, 67051709, 67051651, 67051643, 67051573, - 67051571, 67051547, 67051493, 67051379, 67051373, 67051331, 67051253, 67051189, - 67051181, 67051099, 67051069, 67051021, 67050979, 67050931, 67050917, 67050869, - 67050827, 67050749, 67050707, 67050701, 67050619, 67050611, 67050541, 67050509, - 67050443, 67050421, 67050419, 67050371, 67050301, 67050299, 67050251, 67050187, - 67050101, 67050077, 67049987, 67049981, 67049963, 67049909, 67049891, 67049867, - 67049837, 67049813, 67049747, 67049707, 67049693, 67049629, 67049627, 67049603, - 67049573, 67049539, 67049453, 67049413, 67049267, 67049261, 67049251, 67049179, - 67049149, 67049141, 67049093, 67049027, 67048963, 67048859, 67048819, 67048757, - 67048733, 67048693, 67048627, 67048621, 67048523, 67048469, 67048411, 67048349, - 67048277, 67048259, 67048141, 67048123, 67048109, 67047989, 67047859, 67047787, - 67047763, 67047749, 67047733, 67047731, 67047683, 67047619, 67047613, 67047611, - 67047581, 67047517, 67047509, 67047413, 67047397, 67047283, 67047131, 67047077, - 67047061, 67047059, 67047053, 67047037, 67047011, 67046989, 67046939, 67046899, - 67046797, 67046779, 67046731, 67046549, 67046531, 67046477, 67046467, 67046437, - 67046429, 67046411, 67046387, 67046363, 67046341, 67046333, 67046261, 67046197, - 67046107, 67046069, 67046059, 67046051, 67045973, 67045949, 67045907, 67045877, - 67045723, 67045613, 67045579, 67045571, 67045549, 67045541, 67045507, 67045403, - 67045339, 67045301, 67045267, 67045261, 67045211, 67045189, 67045133, 67045117, - 67045109, 67045061, 67045037, 67045019, 67044973, 67044907, 67044829, 67044797, - 67044779, 67044773, 67044763, 67044739, 67044541, 67044427, 67044371, 67044347, - 67044301, 67044283, 67044203, 67044157, 67044083, 67044077, 67044067, 67044053, - 67043981, 67043939, 67043909, 67043813, 67043797, 67043707, 67043507, 67043477, - 67043443, 67043243, 67043147, 67043107, 67043083, 67043069, 67043059, 67043051, - 67043027, 67042979, 67042973, 67042949, 67042931, 67042709, 67042643, 67042637, - 67042589, 67042571, 67042541, 67042523, 67042501, 67042453, 67042427, 67042363, - 67042307, 67042301, 67042259, 67042211, 67042091, 67042043, 67041907, 67041893, - 67041869, 67041797, 67041749, 67041731, 67041701, 67041613, 67041581, 67041563, - 67041547, 67041539, 67041509, 67041467, 67041461, 67041419, 67041371, 67041307, - 67041283, 67041269, 67041203, 67041187, 67041179, 67041043, 67040917, 67040893, - 67040789, 67040773, 67040723, 67040629, 67040627, 67040621, 67040587, 67040549, - 67040509, 67040443, 67040387, 67040381, 67040317, 67040291, 67040261, 67040243, - 67040219, 67040203, 67040069, 67040021, 67039997, 67039957, 67039883, 67039877, - 67039867, 67039853, 67039811, 67039757, 67039723, 67039699, 67039669, 67039627, - 67039613, 67039571, 67039547, 67039501, 67039499, 67039309, 67039307, 67039253, - 67039187, 67039139, 67039051, 67039003, 67038947, 67038941, 67038877, 67038869, - 67038827, 67038787, 67038739, 67038637, 67038589, 67038557, 67038539, 67038533, - 67038427, 67038371, 67038341, 67038299, 67038277, 67038221, 67038197, 67038173, - 67038149, 67038133, 67038131, 67038067, 67038029, 67038011, 67037843, 67037837, - 67037819, 67037797, 67037771, 67037723, 67037683, 67037627, 67037603, 67037563, - 67037483, 67037459, 67037429, 67037389, 67037261, 67037227, 67037213, 67037107, - 67037101, 67037053, 67036979, 67036909, 67036901, 67036877, 67036867, 67036843, - 67036819, 67036811, 67036747, 67036643, 67036589, 67036547, 67036507, 67036469, - 67036397, 67036379, 67036357, 67036259, 67036243, 67036187, 67036181, 67036157, - 67036093, 67036027, 67036019, 67035989, 67035949, 67035931, 67035901, 67035803, - 67035707, 67035659, 67035653, 67035643, 67035589, 67035499, 67035491, 67035469, - 67035413, 67035349, 67035347, 67035307, 67035277, 67035149, 67035107, 67035077, - 67034987, 67034819, 67034699, 67034683, 67034677, 67034477, 67034419, 67034381, - 67034339, 67034309, 67034293, 67034171, 67034117, 67034069, 67034021, 67033859, - 67033763, 67033741, 67033709, 67033699, 67033667, 67033619, 67033613, 67033597, - 67033541, 67033507, 67033469, 67033429, 67033403, 67033357, 67033331, 67033283, - 67033277, 67033229, 67033157, 67033117, 67033061, 67032997, 67032941, 67032811, - 67032803, 67032701, 67032661, 67032653, 67032613, 67032587, 67032541, 67032523, - 67032517, 67032491, 67032461, 67032451, 67032443, 67032421, 67032389, 67032349, - 67032347, 67032299, 67032221, 67032179, 67032101, 67031941, 67031933, 67031893, - 67031851, 67031819, 67031813, 67031749, 67031693, 67031509, 67031483, 67031443, - 67031429, 67031387, 67031243, 67031219, 67031203, 67031189, 67031149, 67031147, - 67031123, 67031101, 67031059, 67030963, 67030933, 67030907, 67030867, 67030853, - 67030757, 67030741, 67030739, 67030693, 67030669, 67030597, 67030517, 67030451, - 67030427, 67030333, 67030331, 67030181, 67030069, 67030013, 67029947, 67029931, - 67029923, 67029917, 67029901, 67029811, 67029779, 67029763, 67029749, 67029709, - 67029707, 67029581, 67029541, 67029509, 67029491, 67029451, 67029437, 67029427, - 67029421, 67029373, 67029341, 67029323, 67029293, 67029269, 67029253, 67029229, - 67029077, 67029059, 67029043, 67029013, 67028981, 67028917, 67028771, 67028669, - 67028653, 67028651, 67028597, 67028557, 67028539, 67028477, 67028413, 67028387, - 67028243, 67028197, 67028083, 67028069, 67028021, 67027997, 67027963, 67027949, - 67027931, 67027867, 67027861, 67027811, 67027693, 67027627, 67027619, 67027547, - 67027507, 67027453, 67027427, 67027339, 67027283, 67027237, 67027189, 67027187, - 67027069, 67027027, 67027019, 67027013, 67026979, 67026907, 67026829, 67026811, - 67026803, 67026787, 67026643, 67026613, 67026539, 67026469, 67026467, 67026451, - 67026437, 67026403, 67026307, 67026299, 67026227, 67026187, 67026139, 67026131, - 67026109, 67026107, 67026083, 67026067, 67025971, 67025963, 67025957, 67025843, - 67025779, 67025773, 67025723, 67025701, 67025683, 67025669, 67025579, 67025573, - 67025531, 67025501, 67025459, 67025411, 67025363, 67025219, 67025213, 67025173, - 67025107, 67025051, 67025029, 67024987, 67024957, 67024901, 67024891, 67024733, - 67024637, 67024621, 67024613, 67024499, 67024483, 67024429, 67024411, 67024339, - 67024157, 67024141, 67024003, 67023989, 67023899, 67023893, 67023779, 67023763, - 67023667, 67023653, 67023493, 67023443, 67023421, 67023419, 67023371, 67023349, - 67023347, 67023331, 67023293, 67023259, 67023227, 67023211, 67023179, 67023157, - 67023139, 67023133, 67023091, 67023059, 67023053, 67023043, 67023037, 67023029, - 67022869, 67022819, 67022797, 67022723, 67022707, 67022701, 67022699, 67022693, - 67022539, 67022507, 67022477, 67022467, 67022387, 67022261, 67022243, 67022237, - 67022213, 67022147, 67022077, 67022027, 67021979, 67021963, 67021901, 67021861, - 67021741, 67021739, 67021723, 67021637, 67021621, 67021613, 67021499, 67021469, - 67021459, 67021363, 67021301, 67021237, 67021147, 67021139, 67021099, 67021067, - 67021043, 67020979, 67020973, 67020917, 67020893, 67020869, 67020797, 67020763, - 67020683, 67020589, 67020587, 67020557, 67020491, 67020397, 67020323, 67020299, - 67020251, 67020179, 67020077, 67020053, 67020013, 67019963, 67019867, 67019837, - 67019819, 67019747, 67019741, 67019653, 67019587, 67019549, 67019483, 67019437, - 67019371, 67019299, 67019123, 67019077, 67019027, 67019003, 67018997, 67018843, - 67018837, 67018771, 67018733, 67018717, 67018667, 67018613, 67018499, 67018493, - 67018429, 67018397, 67018387, 67018309, 67018181, 67018163, 67018141, 67018139, - 67018069, 67018051, 67017971, 67017931, 67017803, 67017763, 67017733, 67017707, - 67017677, 67017661, 67017659, 67017571, 67017563, 67017547, 67017413, 67017371, - 67017299, 67017277, 67017227, 67017211, 67017163, 67017157, 67017107, 67017059, - 67016869, 67016821, 67016813, 67016723, 67016717, 67016707, 67016693, 67016627, - 67016611, 67016483, 67016437, 67016387, 67016269, 67016197, 67016189, 67016179, -}; - -} // namespace internal -} // namespace CGAL diff --git a/Modular_arithmetic/src/CGAL/primes.cpp b/Modular_arithmetic/src/CGAL/primes.cpp deleted file mode 100644 index 63b8b4d2800..00000000000 --- a/Modular_arithmetic/src/CGAL/primes.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Max-Planck-Institute Saarbruecken (Germany). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// Author(s) : Michael Hemmer - -#ifndef CGAL_HEADER_ONLY - -#include -#include - -#endif diff --git a/Nef_2/include/CGAL/Filtered_extended_homogeneous.h b/Nef_2/include/CGAL/Filtered_extended_homogeneous.h index 40541db7b15..08ea67aaf42 100644 --- a/Nef_2/include/CGAL/Filtered_extended_homogeneous.h +++ b/Nef_2/include/CGAL/Filtered_extended_homogeneous.h @@ -14,7 +14,7 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Michael Seel #ifndef CGAL_FILTERED_EXTENDED_HOMOGENEOUS_H @@ -81,14 +81,14 @@ public: { return SPolynomial(_m-p._m,_n-p._n); } SPolynomial operator-() const { return SPolynomial(-_m,-_n); } - void operator /= (const RT& c) - { _m /= c; _n /= c; } + void operator /= (const RT& c) + { _m /= c; _n /= c; } const RT& operator[](int i) { return (i%2 ? _n : _m); } const RT& operator[](int i) const { return (i%2 ? _n : _m); } bool is_zero() const { return (_m==0 && _n==0); } int sign() const - { if ( _m != 0 ) return CGAL_NTS sign(_m); - return CGAL_NTS sign(_n); + { if ( _m != 0 ) return CGAL_NTS sign(_m); + return CGAL_NTS sign(_n); } @@ -104,8 +104,8 @@ template RT SPolynomial::R_; template int sign(const SPolynomial& p) -{ - return p.sign(); +{ + return p.sign(); } @@ -123,54 +123,54 @@ bool operator<(const SPolynomial& p1, const SPolynomial& p2) template bool operator<(int i, const SPolynomial& p2) -{ +{ SPolynomial p1(i); - return (p1-p2).sign()<0; + return (p1-p2).sign()<0; } template bool operator<(const SPolynomial& p1, int i) -{ +{ SPolynomial p2(i); - return (p1-p2).sign()<0; + return (p1-p2).sign()<0; } -template -inline double to_double(const SPolynomial& p) +template +inline double to_double(const SPolynomial& p) { return (CGAL::to_double(p.eval_at(SPolynomial::R_))); } -template +template std::ostream& operator<<(std::ostream& os, const SPolynomial& p) -{ - switch( os.iword(CGAL::IO::mode) ) { - case CGAL::IO::ASCII : +{ + switch( get_mode(os) ) { + case CGAL::IO::ASCII : os << p.m() << " " << p.n(); break; case CGAL::IO::BINARY : CGAL::write(os,p.m());CGAL::write(os,p.n()); break; default: if ( p.m() == 0 ) os<<"["< +template std::istream& operator>>(std::istream& is, SPolynomial& p) -{ RT m,n; - switch( is.iword(CGAL::IO::mode) ){ - case CGAL::IO::ASCII : +{ RT m,n; + switch( get_mode(is) ){ + case CGAL::IO::ASCII : is >> m >> n; p = SPolynomial(m,n); break; case CGAL::IO::BINARY : CGAL::read(is,m);CGAL::read(is,n);break; default: CGAL_error_msg("\nStream must be in ascii or binary mode\n"); - break; + break; } - return is; + return is; } -template /*CGAL_KERNEL_INLINE*/ -CGAL::io_Operator io_tag(const SPolynomial&) +template /*CGAL_KERNEL_INLINE*/ +CGAL::io_Operator io_tag(const SPolynomial&) { return CGAL::io_Operator(); } @@ -188,8 +188,8 @@ public: const RT& denominator() const { return _n; } }; -template -inline double to_double(const SQuotient& q) +template +inline double to_double(const SQuotient& q) { return (CGAL::to_double(q.numerator().eval_at_R())/ CGAL::to_double(q.denominator())); } @@ -213,8 +213,8 @@ public: mxd=myd=0; } - Extended_point_rep(const SPolynomial& x, - const SPolynomial& y, + Extended_point_rep(const SPolynomial& x, + const SPolynomial& y, const RT& w) : x_(x),y_(y),w_(w) { CGAL_assertion_msg(w!=0,"denominator is zero."); mxd=CGAL::to_interval(x.m()); @@ -226,8 +226,8 @@ public: Extended_point_rep() : x_(),y_(),w_() {} ~Extended_point_rep() {} - void negate() - { x_ = -x_; y_ = -y_; w_ = -w_; + void negate() + { x_ = -x_; y_ = -y_; w_ = -w_; mxd = -mxd; myd = -myd; nxd = -nxd; nyd = -nyd; wd = -wd; } }; @@ -249,9 +249,9 @@ public: Extended_point(const RT& x, const RT& y, const RT& w) : Base( Rep(x,y,w) ) { if (w < 0) this->ptr()->negate(); } - - Extended_point(const SPolynomial& x, - const SPolynomial& y, + + Extended_point(const SPolynomial& x, + const SPolynomial& y, const RT& w) : Base( Rep(x,y,w) ) { if (w < 0) this->ptr()->negate(); } @@ -259,11 +259,11 @@ public: const RT& my, const RT& ny, const RT& w) : Base( Rep(SP(mx,nx), SP(my,ny), w) ) { if (w < 0) this->ptr()->negate(); } - + Extended_point(const Extended_point& p) : Base(p) {} ~Extended_point() {} - Extended_point& operator=(const Extended_point& p) + Extended_point& operator=(const Extended_point& p) { Base::operator=(p); return *this; } const RT& mx() const { return this->ptr()->x_.m(); } @@ -277,16 +277,16 @@ public: const DT& nyD() const { return this->ptr()->nyd; } const DT& hwD() const { return this->ptr()->wd; } - SQuotient x() const + SQuotient x() const { return SQuotient(this->ptr()->x_, this->ptr()->w_); } - SQuotient y() const + SQuotient y() const { return SQuotient(this->ptr()->y_, this->ptr()->w_); } const SPolynomial hx() const { return this->ptr()->x_; } const SPolynomial hy() const { return this->ptr()->y_; } bool is_standard() const { return (mx()==0)&&(my()==0); } - Extended_point opposite() const + Extended_point opposite() const { return Extended_point(-mx(),nx(),-my(),ny(),this->w()); } #ifdef KERNEL_CHECK @@ -306,60 +306,60 @@ CheckPoint checkrep() const }; -template +template std::ostream& operator<<(std::ostream& os, const Extended_point& p) -{ switch( os.iword(CGAL::IO::mode) ) { - case CGAL::IO::ASCII : +{ switch( get_mode(os) ) { + case CGAL::IO::ASCII : os << p.hx() << " " << p.hy() << " " << p.hw(); break; case CGAL::IO::BINARY : - CGAL::write(os,p.hx());CGAL::write(os,p.hy()); + CGAL::write(os,p.hx());CGAL::write(os,p.hy()); CGAL::write(os,p.hw()); break; default: - os << "(" << p.hx() << "," << p.hy() << "," << p.hw() << ")"; + os << "(" << p.hx() << "," << p.hy() << "," << p.hw() << ")"; #if 0 - os << "((" << CGAL::to_double(p.nx())/CGAL::to_double(p.hw()) << "," - << CGAL::to_double(p.ny())/CGAL::to_double(p.hw()) << "))"; + os << "((" << CGAL::to_double(p.nx())/CGAL::to_double(p.hw()) << "," + << CGAL::to_double(p.ny())/CGAL::to_double(p.hw()) << "))"; #endif - } - return os; + } + return os; } -template +template std::istream& operator>>(std::istream& is, Extended_point& p) { SPolynomial x,y; RT w; - switch( is.iword(CGAL::IO::mode) ){ - case CGAL::IO::ASCII : + switch( get_mode(is) ){ + case CGAL::IO::ASCII : is >> x >> y >> w; break; case CGAL::IO::BINARY : CGAL::read(is,x);CGAL::read(is,y);CGAL::read(is,w); break; default: CGAL_error_msg("\nStream must be in ascii or binary mode\n"); - break; + break; } - p = Extended_point(x,y,w); - return is; + p = Extended_point(x,y,w); + return is; } template inline -int orientation_coeff2(const NT& mx1, const NT& /*nx1*/, +int orientation_coeff2(const NT& mx1, const NT& /*nx1*/, const NT& my1, const NT& /*ny1*/, const NT& w1, - const NT& mx2, const NT& /*nx2*/, + const NT& mx2, const NT& /*nx2*/, const NT& my2, const NT& /*ny2*/, const NT& w2, - const NT& mx3, const NT& /*nx3*/, - const NT& my3, const NT& /*ny3*/, const NT& w3) + const NT& mx3, const NT& /*nx3*/, + const NT& my3, const NT& /*ny3*/, const NT& w3) { NT coeff2 = mx1*w3*my2-mx1*w2*my3+mx3*w2*my1- mx2*w3*my1-mx3*w1*my2+mx2*w1*my3; return CGAL_NTS sign(coeff2); } -template inline -int orientation_coeff1(const NT& mx1, const NT& nx1, +template inline +int orientation_coeff1(const NT& mx1, const NT& nx1, const NT& my1, const NT& ny1, const NT& w1, - const NT& mx2, const NT& nx2, + const NT& mx2, const NT& nx2, const NT& my2, const NT& ny2, const NT& w2, - const NT& mx3, const NT& nx3, - const NT& my3, const NT& ny3, const NT& w3) + const NT& mx3, const NT& nx3, + const NT& my3, const NT& ny3, const NT& w3) { NT coeff1 = mx1*w3*ny2-mx1*w2*ny3+nx1*w3*my2-mx2*w3*ny1- nx1*w2*my3+mx2*w1*ny3-nx2*w3*my1+mx3*w2*ny1+ @@ -368,12 +368,12 @@ int orientation_coeff1(const NT& mx1, const NT& nx1, } template inline -int orientation_coeff0(const NT& /*mx1*/, const NT& nx1, +int orientation_coeff0(const NT& /*mx1*/, const NT& nx1, const NT& /*my1*/, const NT& ny1, const NT& w1, - const NT& /*mx2*/, const NT& nx2, + const NT& /*mx2*/, const NT& nx2, const NT& /*my2*/, const NT& ny2, const NT& w2, - const NT& /*mx3*/, const NT& nx3, - const NT& /*my3*/, const NT& ny3, const NT& w3) + const NT& /*mx3*/, const NT& nx3, + const NT& /*my3*/, const NT& ny3, const NT& w3) { NT coeff0 = -nx2*w3*ny1+nx1*w3*ny2+nx2*w1*ny3- nx1*w2*ny3+nx3*w2*ny1-nx3*w1*ny2; @@ -384,9 +384,9 @@ DEFCOUNTER(or0) DEFCOUNTER(or1) DEFCOUNTER(or2) template -int orientation(const Extended_point& p1, - const Extended_point& p2, - const Extended_point& p3) +int orientation(const Extended_point& p1, + const Extended_point& p2, + const Extended_point& p3) { CGAL_NEF_TRACEN("orientation "< Protection; @@ -399,7 +399,7 @@ int orientation(const Extended_point& p1, p2.mx(),p2.nx(),p2.my(),p2.ny(),p2.hw(), p3.mx(),p3.nx(),p3.my(),p3.ny(),p3.hw()); } - if ( res != 0 ) return res; + if ( res != 0 ) return res; try { INCTOTAL(or1); Protect_FPU_rounding Protection; res = orientation_coeff1(p1.mxD(),p1.nxD(),p1.myD(),p1.nyD(),p1.hwD(), @@ -411,7 +411,7 @@ int orientation(const Extended_point& p1, p2.mx(),p2.nx(),p2.my(),p2.ny(),p2.hw(), p3.mx(),p3.nx(),p3.my(),p3.ny(),p3.hw()); } - if ( res != 0 ) return res; + if ( res != 0 ) return res; try { INCTOTAL(or0); Protect_FPU_rounding Protection; res = orientation_coeff0(p1.mxD(),p1.nxD(),p1.myD(),p1.nyD(),p1.hwD(), @@ -426,9 +426,9 @@ int orientation(const Extended_point& p1, return res; } -template +template inline -int compare_expr(const NT& n1, const NT& d1, +int compare_expr(const NT& n1, const NT& d1, const NT& n2, const NT& d2) { return CGAL_NTS sign( n1*d2 - n2*d1 ); } @@ -436,8 +436,8 @@ DEFCOUNTER(cmpx0) DEFCOUNTER(cmpx1) template -int compare_x(const Extended_point& p1, - const Extended_point& p2) +int compare_x(const Extended_point& p1, + const Extended_point& p2) { int res; try { INCTOTAL(cmpx1); Protect_FPU_rounding Protection; @@ -446,7 +446,7 @@ int compare_x(const Extended_point& p1, catch (Uncertain_conversion_exception) { INCEXCEPTION(cmpx1); res = compare_expr(p1.mx(),p1.hw(),p2.mx(),p2.hw()); } - if ( res != 0 ) return res; + if ( res != 0 ) return res; try { INCTOTAL(cmpx0); Protect_FPU_rounding Protection; res = compare_expr(p1.nxD(),p1.hwD(),p2.nxD(),p2.hwD()); @@ -454,15 +454,15 @@ int compare_x(const Extended_point& p1, catch (Uncertain_conversion_exception) { INCEXCEPTION(cmpx0); res = compare_expr(p1.nx(),p1.hw(),p2.nx(),p2.hw()); } - return res; + return res; } DEFCOUNTER(cmpy0) DEFCOUNTER(cmpy1) template -int compare_y(const Extended_point& p1, - const Extended_point& p2) +int compare_y(const Extended_point& p1, + const Extended_point& p2) { int res; try { INCTOTAL(cmpy1); Protect_FPU_rounding Protection; @@ -471,7 +471,7 @@ int compare_y(const Extended_point& p1, catch (Uncertain_conversion_exception) { INCEXCEPTION(cmpy1); res = compare_expr(p1.my(),p1.hw(),p2.my(),p2.hw()); } - if ( res != 0 ) return res; + if ( res != 0 ) return res; try { INCTOTAL(cmpy0); Protect_FPU_rounding Protection; res = compare_expr(p1.nyD(),p1.hwD(),p2.nyD(),p2.hwD()); @@ -479,14 +479,14 @@ int compare_y(const Extended_point& p1, catch (Uncertain_conversion_exception) { INCEXCEPTION(cmpy0); res = compare_expr(p1.ny(),p1.hw(),p2.ny(),p2.hw()); } - return res; + return res; } template inline -int compare_xy(const Extended_point& p1, - const Extended_point& p2) +int compare_xy(const Extended_point& p1, + const Extended_point& p2) { int c1 = compare_x(p1,p2); if ( c1 != 0 ) return c1; else return compare_y(p1,p2); @@ -494,36 +494,36 @@ int compare_xy(const Extended_point& p1, template inline -bool strictly_ordered_along_line(const Extended_point& p1, - const Extended_point& p2, - const Extended_point& p3) +bool strictly_ordered_along_line(const Extended_point& p1, + const Extended_point& p2, + const Extended_point& p3) { return ( orientation(p1,p2,p3) == 0 ) && ( compare_xy(p1,p2) * compare_xy(p2,p3) == 1 ); } template -inline bool operator==(const Extended_point& p1, - const Extended_point& p2) +inline bool operator==(const Extended_point& p1, + const Extended_point& p2) { CHECK(bool(compare_xy(p1,p2) == 0),p1.checkrep()==p2.checkrep()) return (p1.identical(p2) || compare_xy(p1,p2) == 0); } template -inline bool operator!=(const Extended_point& p1, - const Extended_point& p2) +inline bool operator!=(const Extended_point& p1, + const Extended_point& p2) { return !(p1==p2); } -template +template inline -int cmppd_coeff2(const NT& mx1, const NT& /*nx1*/, +int cmppd_coeff2(const NT& mx1, const NT& /*nx1*/, const NT& my1, const NT& /*ny1*/, const NT& w1, - const NT& mx2, const NT& /*nx2*/, + const NT& mx2, const NT& /*nx2*/, const NT& my2, const NT& /*ny2*/, const NT& w2, - const NT& mx3, const NT& /*nx3*/, - const NT& my3, const NT& /*ny3*/, const NT& w3, - const NT& mx4, const NT& /*nx4*/, - const NT& my4, const NT& /*ny4*/, const NT& w4) -{ + const NT& mx3, const NT& /*nx3*/, + const NT& my3, const NT& /*ny3*/, const NT& w3, + const NT& mx4, const NT& /*nx4*/, + const NT& my4, const NT& /*ny4*/, const NT& w4) +{ NT w1Q(w1*w1), w2Q(w2*w2), w3Q(w3*w3), w4Q(w4*w4); NT w1w2Q(w1Q*w2Q), w3w4Q(w3Q*w4Q), two(2); NT coeff2 = w3w4Q * w2Q *mx1*mx1- @@ -538,21 +538,21 @@ int cmppd_coeff2(const NT& mx1, const NT& /*nx1*/, w1w2Q * w4Q *my3*my3+ two* w1w2Q *w4*my3*w3*my4- w1w2Q * w3Q *my4*my4; - return CGAL_NTS sign(coeff2); + return CGAL_NTS sign(coeff2); } -template +template inline -int cmppd_coeff1(const NT& mx1, const NT& nx1, +int cmppd_coeff1(const NT& mx1, const NT& nx1, const NT& my1, const NT& ny1, const NT& w1, - const NT& mx2, const NT& nx2, + const NT& mx2, const NT& nx2, const NT& my2, const NT& ny2, const NT& w2, - const NT& mx3, const NT& nx3, - const NT& my3, const NT& ny3, const NT& w3, - const NT& mx4, const NT& nx4, - const NT& my4, const NT& ny4, const NT& w4) -{ + const NT& mx3, const NT& nx3, + const NT& my3, const NT& ny3, const NT& w3, + const NT& mx4, const NT& nx4, + const NT& my4, const NT& ny4, const NT& w4) +{ NT w1Q(w1*w1), w2Q(w2*w2), w3Q(w3*w3), w4Q(w4*w4); NT w1w2Q(w1Q*w2Q), w3w4Q(w3Q*w4Q), two(2); NT coeff1 = two * (w3w4Q * w1Q * mx2*nx2- @@ -574,24 +574,24 @@ int cmppd_coeff1(const NT& mx1, const NT& nx1, return CGAL_NTS sign(coeff1); } -template +template inline -int cmppd_coeff0(const NT& /*mx1*/, const NT& nx1, +int cmppd_coeff0(const NT& /*mx1*/, const NT& nx1, const NT& /*my1*/, const NT& ny1, const NT& w1, - const NT& /*mx2*/, const NT& nx2, + const NT& /*mx2*/, const NT& nx2, const NT& /*my2*/, const NT& ny2, const NT& w2, - const NT& /*mx3*/, const NT& nx3, - const NT& /*my3*/, const NT& ny3, const NT& w3, - const NT& /*mx4*/, const NT& nx4, - const NT& /*my4*/, const NT& ny4, const NT& w4) -{ + const NT& /*mx3*/, const NT& nx3, + const NT& /*my3*/, const NT& ny3, const NT& w3, + const NT& /*mx4*/, const NT& nx4, + const NT& /*my4*/, const NT& ny4, const NT& w4) +{ NT w1Q(w1*w1), w2Q(w2*w2), w3Q(w3*w3), w4Q(w4*w4); NT w1w2Q(w1Q*w2Q), w3w4Q(w3Q*w4Q), two(2); NT coeff0 = w3w4Q * (w1Q * ( nx2*nx2 + ny2*ny2 ) + w2Q * ( ny1*ny1 + nx1*nx1 )) - w1w2Q * (w4Q * ( nx3*nx3 + ny3*ny3 ) + w3Q * ( nx4*nx4 + ny4*ny4 )) + - two* (- w3w4Q * (w2*nx1*w1*nx2 + w2*ny1*w1*ny2) + two* (- w3w4Q * (w2*nx1*w1*nx2 + w2*ny1*w1*ny2) + w1w2Q * (w4*ny3*w3*ny4 + w4*nx3*w3*nx4)); return CGAL_NTS sign(coeff0); } @@ -603,9 +603,9 @@ DEFCOUNTER(cmppd0) // leghth.mws template int compare_pair_dist( - const Extended_point& p1, const Extended_point& p2, - const Extended_point& p3, const Extended_point& p4) -{ + const Extended_point& p1, const Extended_point& p2, + const Extended_point& p3, const Extended_point& p4) +{ int res; try { INCTOTAL(cmppd2); Protect_FPU_rounding Protection; res = cmppd_coeff2(p1.mxD(),p1.nxD(),p1.myD(),p1.nyD(),p1.hwD(), @@ -619,7 +619,7 @@ int compare_pair_dist( p3.mx(),p3.nx(),p3.my(),p3.ny(),p3.hw(), p4.mx(),p4.nx(),p4.my(),p4.ny(),p4.hw()); } - if ( res != 0 ) return res; + if ( res != 0 ) return res; try { INCTOTAL(cmppd1); Protect_FPU_rounding Protection; res = cmppd_coeff1(p1.mxD(),p1.nxD(),p1.myD(),p1.nyD(),p1.hwD(), @@ -633,7 +633,7 @@ int compare_pair_dist( p3.mx(),p3.nx(),p3.my(),p3.ny(),p3.hw(), p4.mx(),p4.nx(),p4.my(),p4.ny(),p4.hw()); } - if ( res != 0 ) return res; + if ( res != 0 ) return res; try { INCTOTAL(cmppd0); Protect_FPU_rounding Protection; res = cmppd_coeff0(p1.mxD(),p1.nxD(),p1.myD(),p1.nyD(),p1.hwD(), @@ -657,7 +657,7 @@ class Extended_segment { public: Extended_segment() : _p1(),_p2() {} Extended_segment(const Extended_point& p1, - const Extended_point& p2) : + const Extended_point& p2) : _p1(p1), _p2(p2) {} Extended_segment(const Extended_segment& s) : _p1(s._p1), _p2(s._p2) {} @@ -670,10 +670,10 @@ public: void line_equation(RT& a, RT& b, SPolynomial& c) const; }; -template +template std::ostream& operator<<(std::ostream& os, const Extended_segment& s) { os << s.source() << s.target(); return os; } -template +template std::istream& operator>>(std::istream& is, Extended_segment& s) { Extended_point p1,p2; is >> p1 >> p2; s=Extended_segment(p1,p2); return is; } @@ -696,18 +696,18 @@ line_equation(RT& a, RT& b, SPolynomial& c) const if (!sstandard && !tstandard) { bool x_equal = (_p1.hx()*_p2.hw() - _p2.hx()*_p1.hw()).is_zero(); bool y_equal = (_p1.hy()*_p2.hw() - _p2.hy()*_p1.hw()).is_zero(); - if (x_equal && CGAL_NTS abs(_p1.mx())==_p1.hw() && _p1.nx()==0 ) - { int dy = (_p2.hy()-_p1.hy()).sign(); + if (x_equal && CGAL_NTS abs(_p1.mx())==_p1.hw() && _p1.nx()==0 ) + { int dy = (_p2.hy()-_p1.hy()).sign(); a=-dy; b=0; c = SPolynomial(dy*_p1.hx().sign(),0); return; } - if (y_equal && CGAL_NTS abs(_p1.my())==_p1.hw() && _p1.ny()==0 ) - { int dx = (_p2.hx()-_p1.hx()).sign(); + if (y_equal && CGAL_NTS abs(_p1.my())==_p1.hw() && _p1.ny()==0 ) + { int dx = (_p2.hx()-_p1.hx()).sign(); a=0; b=dx; c = SPolynomial(-dx*_p1.hy().sign(),0); return; } p = _p2; // evaluation according to mixed case - } - else if (sstandard && !tstandard) + } + else if (sstandard && !tstandard) { p = _p2; } - else if (!sstandard && tstandard) + else if (!sstandard && tstandard) { p = _p1; correct_orientation=false; } RT w = p.hw(); RT ci; @@ -729,7 +729,7 @@ line_equation(RT& a, RT& b, SPolynomial& c) const template Extended_point intersection( const Extended_segment& s1, const Extended_segment& s2) -{ +{ RT a1,b1,a2,b2; SPolynomial c1,c2; s1.line_equation(a1,b1,c1); @@ -739,9 +739,9 @@ Extended_point intersection( RT w = a1*b2 - a2*b1; CGAL_assertion(w!=0); #ifdef REDUCE_INTERSECTION_POINTS RT xgcd,ygcd; - if ( x.m() == RT(0) ) xgcd = ( x.n() == 0 ? RT(1) : x.n() ); + if ( x.m() == RT(0) ) xgcd = ( x.n() == 0 ? RT(1) : x.n() ); else /* != 0 */ xgcd = ( x.n() == 0 ? x.m() : CGAL_NTS gcd(x.m(),x.n()) ); - if ( y.m() == RT(0) ) ygcd = ( y.n() == 0 ? RT(1) : y.n() ); + if ( y.m() == RT(0) ) ygcd = ( y.n() == 0 ? RT(1) : y.n() ); else /* != 0 */ ygcd = ( y.n() == 0 ? y.m() : CGAL_NTS gcd(y.m(),y.n()) ); RT d = CGAL_NTS gcd(w,CGAL_NTS gcd(xgcd,ygcd)); x /= d; @@ -753,7 +753,7 @@ Extended_point intersection( template inline -int orientation(const Extended_segment& s, const Extended_point& p) +int orientation(const Extended_segment& s, const Extended_point& p) { return orientation(s.source(),s.target(),p); } template @@ -763,8 +763,8 @@ bool is_degenerate(const Extended_segment& s) template inline -bool contains(const Extended_segment& s, - const Extended_point& p) +bool contains(const Extended_segment& s, + const Extended_point& p) { int p_rel_source = compare_xy(p,s.source()); int p_rel_target = compare_xy(p,s.target()); return ( orientation(s,p) == 0 ) && @@ -780,7 +780,7 @@ public: Extended_direction() : _p1(),_p2() {} Extended_direction(const Extended_direction& d) : _p1(d._p1),_p2(d._p2) {} - Extended_direction& operator=(const Extended_direction& d) + Extended_direction& operator=(const Extended_direction& d) { _p1 = d._p1; _p2 = d._p2; return *this; } Extended_direction(const Extended_point& p1, @@ -789,36 +789,36 @@ public: Extended_direction(const RT& x, const RT& y) : _p1(0,0,1),_p2(x,y,1) {} - + const Extended_point& p1() const { return _p1; } const Extended_point& p2() const { return _p2; } - int dx_sign() const + int dx_sign() const { return (_p2.hx()*_p1.hw()-_p1.hx()*_p2.hw()).sign(); } - int dy_sign() const + int dy_sign() const { return (_p2.hy()*_p1.hw()-_p1.hy()*_p2.hw()).sign(); } }; -template +template std::ostream& operator<<(std::ostream& os, const Extended_direction& d) -{ os << d.p1() << "," << d.p2(); +{ os << d.p1() << "," << d.p2(); return os; } -template +template std::istream& operator>>(std::istream& is, Extended_direction& d) { Extended_point x,y; - is >> x >> y; d = Extended_direction(x,y); + is >> x >> y; d = Extended_direction(x,y); return is; } template inline -int coeff2_dor(const NT& mx1, const NT& /*nx1*/, +int coeff2_dor(const NT& mx1, const NT& /*nx1*/, const NT& my1, const NT& /*ny1*/, const NT& w1, - const NT& mx2, const NT& /*nx2*/, + const NT& mx2, const NT& /*nx2*/, const NT& my2, const NT& /*ny2*/, const NT& w2, - const NT& mx3, const NT& /*nx3*/, - const NT& my3, const NT& /*ny3*/, const NT& w3, - const NT& mx4, const NT& /*nx4*/, - const NT& my4, const NT& /*ny4*/, const NT& w4) + const NT& mx3, const NT& /*nx3*/, + const NT& my3, const NT& /*ny3*/, const NT& w3, + const NT& mx4, const NT& /*nx4*/, + const NT& my4, const NT& /*ny4*/, const NT& w4) { NT coeff2 = w1*mx2*w3*my4-w1*mx2*w4*my3-w2*mx1*w3*my4+w2*mx1*w4*my3- w1*my2*w3*mx4+w1*my2*w4*mx3+w2*my1*w3*mx4-w2*my1*w4*mx3; @@ -827,13 +827,13 @@ int coeff2_dor(const NT& mx1, const NT& /*nx1*/, template inline -int coeff1_dor(const NT& mx1, const NT& nx1, +int coeff1_dor(const NT& mx1, const NT& nx1, const NT& my1, const NT& ny1, const NT& w1, - const NT& mx2, const NT& nx2, + const NT& mx2, const NT& nx2, const NT& my2, const NT& ny2, const NT& w2, - const NT& mx3, const NT& nx3, - const NT& my3, const NT& ny3, const NT& w3, - const NT& mx4, const NT& nx4, + const NT& mx3, const NT& nx3, + const NT& my3, const NT& ny3, const NT& w3, + const NT& mx4, const NT& nx4, const NT& my4, const NT& ny4, const NT& w4) { NT coeff1 = -w1*my2*w3*nx4+w1*mx2*w3*ny4+w1*my2*w4*nx3-w1*mx2*w4*ny3+ @@ -845,13 +845,13 @@ int coeff1_dor(const NT& mx1, const NT& nx1, template inline -int coeff0_dor(const NT& /*mx1*/, const NT& nx1, +int coeff0_dor(const NT& /*mx1*/, const NT& nx1, const NT& /*my1*/, const NT& ny1, const NT& w1, - const NT& /*mx2*/, const NT& nx2, + const NT& /*mx2*/, const NT& nx2, const NT& /*my2*/, const NT& ny2, const NT& w2, - const NT& /*mx3*/, const NT& nx3, - const NT& /*my3*/, const NT& ny3, const NT& w3, - const NT& /*mx4*/, const NT& nx4, + const NT& /*mx3*/, const NT& nx3, + const NT& /*my3*/, const NT& ny3, const NT& w3, + const NT& /*mx4*/, const NT& nx4, const NT& /*my4*/, const NT& ny4, const NT& w4) { NT coeff0 = w1*nx2*w3*ny4-w1*nx2*w4*ny3-w2*nx1*w3*ny4+w2*nx1*w4*ny3- @@ -868,7 +868,7 @@ template inline int orientation(const Extended_direction& d1, const Extended_direction& d2) -{ +{ Extended_point p1(d1.p1()), p2(d1.p2()), p3(d2.p1()), p4(d2.p2()); int res; @@ -883,7 +883,7 @@ int orientation(const Extended_direction& d1, p3.mx(),p3.nx(),p3.my(),p3.ny(),p3.hw(), p4.mx(),p4.nx(),p4.my(),p4.ny(),p4.hw()); } - if ( res != 0 ) return res; + if ( res != 0 ) return res; try { INCTOTAL(ord1); Protect_FPU_rounding Protection; res = coeff1_dor(p1.mxD(),p1.nxD(),p1.myD(),p1.nyD(),p1.hwD(), @@ -896,7 +896,7 @@ int orientation(const Extended_direction& d1, p3.mx(),p3.nx(),p3.my(),p3.ny(),p3.hw(), p4.mx(),p4.nx(),p4.my(),p4.ny(),p4.hw()); } - if ( res != 0 ) return res; + if ( res != 0 ) return res; try { INCTOTAL(ord0); Protect_FPU_rounding Protection; res = coeff0_dor(p1.mxD(),p1.nxD(),p1.myD(),p1.nyD(),p1.hwD(), p2.mxD(),p2.nxD(),p2.myD(),p2.nyD(),p2.hwD(), @@ -932,7 +932,7 @@ template bool strictly_ordered_ccw(const Extended_direction& d1, const Extended_direction& d2, const Extended_direction& d3) -{ +{ if (d1 == d3) return (d1 != d2); int or12 = orientation(d1,d2); int or13 = orientation(d1,d3); @@ -980,7 +980,7 @@ typedef typename Standard_kernel::Segment_2 Standard_segment_2; typedef typename Standard_kernel::Line_2 Standard_line_2; typedef typename Standard_kernel::Direction_2 Standard_direction_2; typedef typename Standard_kernel::Ray_2 Standard_ray_2; -typedef typename Standard_kernel::Aff_transformation_2 +typedef typename Standard_kernel::Aff_transformation_2 Standard_aff_transformation_2; typedef SPolynomial RT; @@ -1006,7 +1006,7 @@ CheckDirection convert(const Direction_2& d) const -enum Point_type { SWCORNER=1, LEFTFRAME, NWCORNER, +enum Point_type { SWCORNER=1, LEFTFRAME, NWCORNER, BOTTOMFRAME, STANDARD, TOPFRAME, SECORNER, RIGHTFRAME, NECORNER }; @@ -1025,18 +1025,18 @@ Point_type determine_type(const Standard_line_2& l) const int sdx = CGAL_NTS sign(dx(l)), sdy = CGAL_NTS sign(dy(l)); int cmp_dx_dy = CGAL_NTS compare(adx,ady), s(1); // CGAL_NEF_TRACEN(" "< 0 || ( cmp_dx_dy == 0 && + if (sdx < 0 && ( cmp_dx_dy > 0 || ( cmp_dx_dy == 0 && sdy != (s=CGAL_NTS sign(abscissa_distance(l)))))) { if (0 == s) return ( sdy < 0 ? SWCORNER : NWCORNER ); else return LEFTFRAME; - } else if (sdx > 0 && ( cmp_dx_dy > 0 || ( cmp_dx_dy == 0 && - sdy != (s=CGAL_NTS sign(abscissa_distance(l)))))) { + } else if (sdx > 0 && ( cmp_dx_dy > 0 || ( cmp_dx_dy == 0 && + sdy != (s=CGAL_NTS sign(abscissa_distance(l)))))) { if (0 == s) return ( sdy < 0 ? SECORNER : NECORNER ); else return RIGHTFRAME; - } else if (sdy < 0 && ( cmp_dx_dy < 0 || ( cmp_dx_dy == 0 && + } else if (sdy < 0 && ( cmp_dx_dy < 0 || ( cmp_dx_dy == 0 && abscissa_distance(l) < Standard_FT(0)))) { return BOTTOMFRAME; - } else if (sdy > 0 && ( cmp_dx_dy < 0 || ( cmp_dx_dy == 0 && + } else if (sdy > 0 && ( cmp_dx_dy < 0 || ( cmp_dx_dy == 0 && abscissa_distance(l) > Standard_FT(0)))) { return TOPFRAME; } @@ -1044,8 +1044,8 @@ Point_type determine_type(const Standard_line_2& l) const return (Point_type)-1; // never come here } -Point_2 epoint(const Standard_RT& m1, const Standard_RT& n1, - const Standard_RT& m2, const Standard_RT& n2, +Point_2 epoint(const Standard_RT& m1, const Standard_RT& n1, + const Standard_RT& m2, const Standard_RT& n2, const Standard_RT& n3) const { return Point_2(m1,n1,m2,n2,n3); } @@ -1062,31 +1062,31 @@ Point_2 construct_point(const Standard_line_2& l, Point_type& t) const switch (t) { case SWCORNER: res = epoint(-1, 0, -1, 0, 1); break; case NWCORNER: res = epoint(-1, 0, 1, 0, 1); break; - case SECORNER: res = epoint( 1, 0, -1, 0, 1); break; - case NECORNER: res = epoint( 1, 0, 1, 0, 1); break; - case LEFTFRAME: res = epoint(-l.b(), 0, l.a(), -l.c(), l.b()); - break; - case RIGHTFRAME: res = epoint( l.b(), 0, -l.a(), -l.c(), l.b()); - break; - case BOTTOMFRAME: res = epoint( l.b(), -l.c(), -l.a(), 0, l.a()); - break; - case TOPFRAME: res = epoint(-l.b(), -l.c(), l.a(), 0, l.a()); - break; + case SECORNER: res = epoint( 1, 0, -1, 0, 1); break; + case NECORNER: res = epoint( 1, 0, 1, 0, 1); break; + case LEFTFRAME: res = epoint(-l.b(), 0, l.a(), -l.c(), l.b()); + break; + case RIGHTFRAME: res = epoint( l.b(), 0, -l.a(), -l.c(), l.b()); + break; + case BOTTOMFRAME: res = epoint( l.b(), -l.c(), -l.a(), 0, l.a()); + break; + case TOPFRAME: res = epoint(-l.b(), -l.c(), l.a(), 0, l.a()); + break; default: CGAL_error_msg("EPoint type not correct!"); } return res; } -Point_2 construct_point(const Standard_point_2& p1, - const Standard_point_2& p2, +Point_2 construct_point(const Standard_point_2& p1, + const Standard_point_2& p2, Point_type& t) const { return construct_point(Standard_line_2(p1,p2),t); } Point_2 construct_point(const Standard_line_2& l) const { Point_type dummy; return construct_point(l,dummy); } -Point_2 construct_point(const Standard_point_2& p1, +Point_2 construct_point(const Standard_point_2& p1, const Standard_point_2& p2) const { return construct_point(Standard_line_2(p1,p2)); } -Point_2 construct_point(const Standard_point_2& p, +Point_2 construct_point(const Standard_point_2& p, const Standard_direction_2& d) const { return construct_point(Standard_line_2(p,d)); } Point_2 construct_opposite_point(const Standard_line_2& l) const @@ -1110,7 +1110,7 @@ Point_type type(const Point_2& p) const if (sy > 0) return TOPFRAME; else return BOTTOMFRAME; } - // now (rx == ry) + // now (rx == ry) if (sx==sy) { if (sx < 0) return SWCORNER; else return NECORNER; @@ -1149,18 +1149,18 @@ Point_2 SE() const { return construct_point(Standard_line_2( 1, 1,0)); } Point_2 NW() const { return construct_point(Standard_line_2(-1,-1,0)); } Point_2 SW() const { return construct_point(Standard_line_2( 1,-1,0)); } -int orientation(const Point_2& p1, const Point_2& p2, const Point_2& p3) +int orientation(const Point_2& p1, const Point_2& p2, const Point_2& p3) const { CHECK(K.orientation(p1.checkrep(),p2.checkrep(),p3.checkrep()), CGAL::orientation(p1,p2,p3)) return CGAL::orientation(p1,p2,p3); } -bool left_turn(const Point_2& p1, const Point_2& p2, const Point_2& p3) +bool left_turn(const Point_2& p1, const Point_2& p2, const Point_2& p3) const { return orientation(p1,p2,p3) > 0; } bool first_pair_closer_than_second( - const Point_2& p1, const Point_2& p2, + const Point_2& p1, const Point_2& p2, const Point_2& p3, const Point_2& p4) const { CHECK(K.first_pair_closer_than_second(p1.checkrep(),p2.checkrep(), p3.checkrep(),p4.checkrep()), @@ -1218,7 +1218,7 @@ Direction_2 construct_direction( const Point_2& p1, const Point_2& p2) const { return Direction_2(p1,p2); } -bool strictly_ordered_ccw(const Direction_2& d1, +bool strictly_ordered_ccw(const Direction_2& d1, const Direction_2& d2, const Direction_2& d3) const { CHECK(K.strictly_ordered_ccw(convert(d1),convert(d2),convert(d3)), CGAL::strictly_ordered_ccw(d1,d2,d3)); @@ -1251,7 +1251,7 @@ void determine_frame_radius(Forward_iterator start, Forward_iterator end, while ( start != end ) { Point_2 p = *start; if ( is_standard(p) ) { - R = (CGAL::max)(CGAL_NTS abs(p.mx())/p.hw(), + R = (CGAL::max)(CGAL_NTS abs(p.mx())/p.hw(), CGAL_NTS abs(p.my())/p.hw()); } else { RT rx = CGAL_NTS abs(p.hx()), ry = CGAL_NTS abs(p.hy()); @@ -1263,7 +1263,7 @@ void determine_frame_radius(Forward_iterator start, Forward_iterator end, } } -const char* output_identifier() const +const char* output_identifier() const { return "Filtered_extended_homogeneous"; } diff --git a/Nef_2/include/CGAL/Nef_2/PM_io_parser.h b/Nef_2/include/CGAL/Nef_2/PM_io_parser.h index 666ff47cd32..85cc0ef8e93 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_io_parser.h +++ b/Nef_2/include/CGAL/Nef_2/PM_io_parser.h @@ -122,8 +122,8 @@ to output |H| to |os|.}*/ vn(Base::number_of_vertices()), en(Base::number_of_halfedges()), fn(Base::number_of_faces()) -{ verbose = (out.iword(CGAL::IO::mode) != CGAL::IO::ASCII && - out.iword(CGAL::IO::mode) != CGAL::IO::BINARY); +{ verbose = (get_mode(out) != CGAL::IO::ASCII && + get_mode(out) != CGAL::IO::BINARY); } @@ -135,8 +135,8 @@ PM_io_parser(std::ostream& os, const PMDEC& D) vn(Base::number_of_vertices()), en(Base::number_of_halfedges()), fn(Base::number_of_faces()) -{ verbose = (out.iword(CGAL::IO::mode) != CGAL::IO::ASCII && - out.iword(CGAL::IO::mode) != CGAL::IO::BINARY); +{ verbose = (get_mode(out) != CGAL::IO::ASCII && + get_mode(out) != CGAL::IO::BINARY); } diff --git a/Number_types/include/CGAL/FPU.h b/Number_types/include/CGAL/FPU.h index 94bedba4765..646a8d75b03 100644 --- a/Number_types/include/CGAL/FPU.h +++ b/Number_types/include/CGAL/FPU.h @@ -26,6 +26,7 @@ #define CGAL_FPU_H #include +#include #ifndef __INTEL_COMPILER #include // for HUGE_VAL @@ -66,11 +67,7 @@ extern "C" { # if defined CGAL_CFG_DENORMALS_COMPILE_BUG // For compilers crashing when dealing with denormalized values. // So we have to generate it at run time instead. -#ifdef CGAL_HEADER_ONLY # define CGAL_IA_MIN_DOUBLE (CGAL::internal::get_static_minimin()) -#else -# define CGAL_IA_MIN_DOUBLE (CGAL::internal::minimin) -#endif // CGAL_HEADER_ONLY # else # define CGAL_IA_MIN_DOUBLE (5e-324) # endif @@ -120,17 +117,7 @@ extern "C" { #endif #ifdef CGAL_CFG_DENORMALS_COMPILE_BUG - -#ifdef CGAL_HEADER_ONLY -#include // To define get_static_minimin(); -#else // CGAL_HEADER_ONLY -namespace CGAL { -namespace internal { -CGAL_EXPORT extern double minimin; -} -} -#endif // CGAL_HEADER_ONLY - +double& get_static_minimin(); // Defined in Interval_arithmetic_impl.h #endif namespace CGAL { @@ -143,6 +130,13 @@ const double infinity = HUGE_VAL; } // namespace internal +#ifdef CGAL_HEADER_ONLY +// Defined in test_FPU_rounding_mode_impl.h +struct Check_FPU_rounding_mode_is_restored; +inline const Check_FPU_rounding_mode_is_restored& +get_static_check_fpu_rounding_mode_is_restored(); +#endif + // Inline function to stop compiler optimizations that shouldn't happen with // pragma fenv on. // - constant propagation @@ -422,14 +416,6 @@ FPU_get_cw (void) return cw; } -} // namespace CGAL - -#ifdef CGAL_HEADER_ONLY -#include -#endif // CGAL_HEADER_ONLY - -namespace CGAL { - // User interface (cont): inline @@ -438,7 +424,12 @@ FPU_set_cw (FPU_CW_t cw) { #ifndef CGAL_NDEBUG #ifdef CGAL_HEADER_ONLY - const Check_FPU_rounding_mode_is_restored & tmp = get_static_check_fpu_rounding_mode_is_restored(); + // Call the get_static_check_fpu_rounding_mode_is_restored() + // function called so that the test located in the destructor + // of Check_FPU_rounding_mode_is_restored is run + const Check_FPU_rounding_mode_is_restored & tmp = + get_static_check_fpu_rounding_mode_is_restored(); + CGAL_USE(tmp); #endif #endif @@ -536,4 +527,8 @@ inline void force_ieee_double_precision() } //namespace CGAL +#ifdef CGAL_HEADER_ONLY +#include +#endif // CGAL_HEADER_ONLY + #endif // CGAL_FPU_H diff --git a/Number_types/include/CGAL/Interval_arithmetic_impl.h b/Number_types/include/CGAL/Interval_arithmetic_impl.h index 1d0ed4710f1..1cb6e680f76 100644 --- a/Number_types/include/CGAL/Interval_arithmetic_impl.h +++ b/Number_types/include/CGAL/Interval_arithmetic_impl.h @@ -43,7 +43,11 @@ double init_min_double() #ifndef CGAL_HEADER_ONLY namespace internal { -double minimin = init_min_double(); + double minimin = init_min_double(); + double& get_static_minimin() + { + return minimin; + } } #else // CGAL_HEADER_ONLY diff --git a/Number_types/include/CGAL/test_FPU_rounding_mode_impl.h b/Number_types/include/CGAL/test_FPU_rounding_mode_impl.h index 306330bd7dd..8fc6c69c460 100644 --- a/Number_types/include/CGAL/test_FPU_rounding_mode_impl.h +++ b/Number_types/include/CGAL/test_FPU_rounding_mode_impl.h @@ -48,8 +48,14 @@ struct Check_FPU_rounding_mode_is_restored { #ifdef CGAL_HEADER_ONLY -inline const Check_FPU_rounding_mode_is_restored& get_static_check_fpu_rounding_mode_is_restored() +inline const Check_FPU_rounding_mode_is_restored& +get_static_check_fpu_rounding_mode_is_restored() { + // A static object that emits a warning if the rounding mode at the + // beginning and the end of the program are not the same. + // Note that the get_static_check_fpu_rounding_mode_is_restored() function + // must be called at least once so that this object is created. + // It is done in the FPU_set_cw() function in FPU.h static const Check_FPU_rounding_mode_is_restored check_fpu_rounding_mode_is_restored; return check_fpu_rounding_mode_is_restored; } @@ -60,9 +66,6 @@ inline const Check_FPU_rounding_mode_is_restored& get_static_check_fpu_rounding_ // beginning and the end of the program are not the same. static const Check_FPU_rounding_mode_is_restored check_fpu_rounding_mode_is_restored; -inline const Check_FPU_rounding_mode_is_restored& get_static_check_fpu_rounding_mode_is_restored() -{ return check_fpu_rounding_mode_is_restored; } - #endif // CGAL_HEADER_ONLY } // end namespace CGAL diff --git a/Number_types/test/Number_types/Lazy_exact_nt.cpp b/Number_types/test/Number_types/Lazy_exact_nt.cpp index 2c2b7b3acc6..7e9e8f8723e 100644 --- a/Number_types/test/Number_types/Lazy_exact_nt.cpp +++ b/Number_types/test/Number_types/Lazy_exact_nt.cpp @@ -81,7 +81,7 @@ typedef CGAL::Delaunay_triangulation_3 > Delaunay; int my_rand() { - return int(CGAL::default_random.get_double()*(1<<31)); + return int(CGAL::get_default_random().get_double()*(1<<31)); } void delaunay() diff --git a/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/CMakeLists.txt b/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/CMakeLists.txt index 71e49e262a0..c03c48e2f10 100644 --- a/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/CMakeLists.txt +++ b/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/CMakeLists.txt @@ -49,7 +49,7 @@ if(CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND) ) set( - MOCS + CGAL_Qt5_MOC_FILES moc_dialog_options.cxx moc_glviewer.cxx moc_window.cxx @@ -74,9 +74,9 @@ if(CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND) qt5_generate_moc( "dialog_options.h" "${CMAKE_CURRENT_BINARY_DIR}/moc_dialog_options.cxx" ) add_file_dependencies( moc_dialog_options.cxx "${CMAKE_CURRENT_SOURCE_DIR}/dialog_options.h" ) - qt5_add_resources ( RESOURCE_FILES pwsrec.qrc ) + qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES pwsrec.qrc ) - add_executable ( Optimal_transportation_reconstruction_2_demo ${SRCS} ${MOCS} ${UI_FILES} ${RESOURCE_FILES} ${CGAL_ADDITIONAL_FILES} ${CGAL_RESOURCE_FILES}) + add_executable ( Optimal_transportation_reconstruction_2_demo ${SRCS} ${CGAL_Qt5_MOC_FILES} ${UI_FILES} ${CGAL_Qt5_RESOURCE_FILES}) qt5_use_modules(Optimal_transportation_reconstruction_2_demo OpenGL) diff --git a/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/CMakeLists.txt b/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/CMakeLists.txt index 95ebfb7d38a..a7b37df34f9 100644 --- a/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/CMakeLists.txt +++ b/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/CMakeLists.txt @@ -33,7 +33,7 @@ if (CGAL_FOUND AND CGAL_Qt5_FOUND AND OPENGL_FOUND AND Qt5_FOUND AND QGLVIEWER_F qt5_wrap_ui ( UI_FILES MainWindow.ui ) # qrc files (resource files) - qt5_add_resources( RESOURCE_FILES ./Periodic_3_triangulation_3.qrc ) + qt5_add_resources( CGAL_Qt5_RESOURCE_FILES ./Periodic_3_triangulation_3.qrc ) # use the Qt MOC preprocessor on classes that derive from QObject qt5_generate_moc( "Scene.h" "${CMAKE_CURRENT_BINARY_DIR}/moc_Scene.cpp" ) @@ -64,7 +64,7 @@ if (CGAL_FOUND AND CGAL_Qt5_FOUND AND OPENGL_FOUND AND Qt5_FOUND AND QGLVIEWER_F Viewer.cpp moc_Viewer.cpp periodic_3_triangulation_3_demo.cpp MainWindow.ui moc_MainWindow.cpp - ${UI_FILES} ${RESOURCE_FILES} Periodic_3_triangulation_3.qhc) + ${UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} Periodic_3_triangulation_3.qhc) qt5_use_modules(periodic_3_triangulation_3_demo Xml Help OpenGL) diff --git a/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/CMakeLists.txt b/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/CMakeLists.txt index f6de58ac955..1b1df1cd524 100644 --- a/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/CMakeLists.txt +++ b/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/CMakeLists.txt @@ -34,7 +34,7 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_ qt5_wrap_ui( uis MainWindow.ui ) # qrc files (resources files, that contain icons, at least) - qt5_add_resources ( RESOURCE_FILES ./Periodic_Lloyd_3.qrc ) + qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./Periodic_Lloyd_3.qrc ) if(DEFINED QT_QCOLLECTIONGENERATOR_EXECUTABLE) @@ -51,7 +51,7 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) - add_executable ( Periodic_Lloyd_3 Periodic_Lloyd_3.qhc Periodic_Lloyd_3.cpp MainWindow.cpp Viewer.cpp ${uis} ${RESOURCE_FILES} ) + add_executable ( Periodic_Lloyd_3 Periodic_Lloyd_3.qhc Periodic_Lloyd_3.cpp MainWindow.cpp Viewer.cpp ${uis} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) qt5_use_modules(Periodic_Lloyd_3 Xml Script Help OpenGL Svg) add_to_cached_list( CGAL_EXECUTABLE_TARGETS Periodic_Lloyd_3 ) diff --git a/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/include/CGAL/_test_periodic_3_static_filters.h b/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/include/CGAL/_test_periodic_3_static_filters.h index c249ed9636e..ffe6f547e31 100644 --- a/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/include/CGAL/_test_periodic_3_static_filters.h +++ b/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/include/CGAL/_test_periodic_3_static_filters.h @@ -304,7 +304,7 @@ void compute_epsilons() int _test_periodic_3_static_filters() { int loops = 2000; - int seed = CGAL::default_random.get_int(0, 1<<30); + int seed = CGAL::get_default_random().get_int(0, 1<<30); std::cout << "Initializing random generator with seed = " << seed << std::endl diff --git a/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Efficient_RANSAC.h b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Efficient_RANSAC.h index 2bb44098a2f..61ccf5820a5 100644 --- a/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Efficient_RANSAC.h +++ b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Efficient_RANSAC.h @@ -299,7 +299,7 @@ shape. The implementation follows \cgalCite{schnabel2007efficient}. if (s) { subsetSize >>= 1; for (std::size_t i = 0;i= remainingPoints) ? remainingPoints - 1 : index; indices[i] = index; @@ -494,7 +494,7 @@ shape. The implementation follows \cgalCite{schnabel2007efficient}. bool done = false; do { do - first_sample = default_random(m_num_available_points); + first_sample = get_default_random()(m_num_available_points); while (m_shape_index[first_sample] != -1); done = m_global_octree->drawSamplesFromCellContainingPoint( @@ -780,7 +780,7 @@ shape. The implementation follows \cgalCite{schnabel2007efficient}. private: int select_random_octree_level() { - return (int) default_random(m_global_octree->maxLevel() + 1); + return (int) get_default_random()(m_global_octree->maxLevel() + 1); } Shape* get_best_candidate(std::vector& candidates, diff --git a/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Octree.h b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Octree.h index 4f95926babb..2b3eb016c94 100644 --- a/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Octree.h +++ b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Octree.h @@ -525,7 +525,7 @@ namespace CGAL { } if (enough >= requiredSamples) { do { - std::size_t p = CGAL::default_random. + std::size_t p = CGAL::get_default_random(). uniform_int(0, cur->size() - 1); std::size_t j = this->index(cur->first + p); if (shapeIndex[j] == -1) diff --git a/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Shape_base.h b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Shape_base.h index a1c381abb96..a76b127cd1b 100644 --- a/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Shape_base.h +++ b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Shape_base.h @@ -507,7 +507,7 @@ namespace CGAL { int score = 0; std::vector indices(num); for (std::size_t i = 0;i dists(num), angles(num); other->squared_distance(indices, dists); @@ -521,7 +521,7 @@ namespace CGAL { return false; for (std::size_t i = 0;im_indices[default_random(other->m_indices.size())]; + indices[i] = other->m_indices[get_default_random()(other->m_indices.size())]; this->squared_distance(indices, dists); this->cos_to_normal(indices, angles); diff --git a/Point_set_shape_detection_3/test/Point_set_shape_detection_3/generators.h b/Point_set_shape_detection_3/test/Point_set_shape_detection_3/generators.h index f5d6cb2eebf..f1e0e877360 100644 --- a/Point_set_shape_detection_3/test/Point_set_shape_detection_3/generators.h +++ b/Point_set_shape_detection_3/test/Point_set_shape_detection_3/generators.h @@ -11,7 +11,7 @@ template fl_t random_float(fl_t min, fl_t max) { - return fl_t(CGAL::default_random.get_double(min, max)); + return fl_t(CGAL::get_default_random().get_double(min, max)); } template diff --git a/Polyhedron/demo/Polyhedron/CMakeLists.txt b/Polyhedron/demo/Polyhedron/CMakeLists.txt index 51f66006fdd..1b00717a632 100644 --- a/Polyhedron/demo/Polyhedron/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/CMakeLists.txt @@ -135,13 +135,14 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND) include( ${CMAKE_CURRENT_SOURCE_DIR}/polyhedron_demo_macros.cmake ) - qt5_add_resources ( RESOURCE_FILES Polyhedron_3.qrc ) + qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES Polyhedron_3.qrc ) qt5_add_resources(gl_splat_rc GlSplat/glsplat.qrc) add_library(gl_splat SHARED GlSplat/GlSplat.cpp GlSplat/Shader.cpp ${gl_splat_rc}) qt5_use_modules(gl_splat OpenGL Gui Xml) - - find_path(CGAL_THREE_VIEWER_INTERFACE_H_PATH + target_link_libraries(gl_splat ${OPENGL_gl_LIBRARY}) + + find_path(CGAL_THREE_VIEWER_INTERFACE_H_PATH NAME CGAL/Three/Viewer_interface.h PATHS ${CGAL_INCLUDE_DIRS} NO_DEFAULT_PATH @@ -215,6 +216,8 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND) ${CGAL_LIBRARIES} ${QGLVIEWER_LIBRARIES} ${OPENGL_gl_LIBRARY} + ${OPENGL_glu_LIBRARY} + gl_splat ) qt5_use_modules(scene_basic_objects OpenGL Gui Xml Script Widgets) add_library(point_dialog SHARED Show_point_dialog.cpp Show_point_dialog.ui ${Show_point_dialogUI_FILES}) @@ -254,8 +257,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND) target_link_libraries(scene_polyhedron_selection_item scene_polyhedron_item_decorator scene_polyhedron_item_k_ring_selection) add_item(scene_polyhedron_shortest_path_item Plugins/Surface_mesh/Scene_polyhedron_shortest_path_item.cpp) - - add_item(scene_surface_mesh_item Scene_surface_mesh_item.cpp) target_link_libraries(scene_polyhedron_shortest_path_item scene_polyhedron_item_decorator scene_polyhedron_item scene_polylines_item) @@ -297,7 +298,7 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND) MainWindow.cpp Polyhedron_demo.cpp File_loader_dialog_moc.cpp - ${FileLoaderDialogUI_files} ${MainWindowUI_files} ${PreferencesUI_FILES} ${RESOURCE_FILES} ${statisticsUI_FILES}) + ${FileLoaderDialogUI_files} ${MainWindowUI_files} ${PreferencesUI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${statisticsUI_FILES} ${CGAL_Qt5_MOC_FILES}) target_link_libraries(polyhedron_demo demo_framework point_dialog) qt5_use_modules(polyhedron_demo Gui OpenGL Xml Widgets Script Svg ) add_executable ( Polyhedron_3 Polyhedron_3.cpp ) diff --git a/Polyhedron/demo/Polyhedron/GlSplat/CMakeLists.txt b/Polyhedron/demo/Polyhedron/GlSplat/CMakeLists.txt index 3bf89f4260b..152bfd4cd86 100644 --- a/Polyhedron/demo/Polyhedron/GlSplat/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/GlSplat/CMakeLists.txt @@ -10,6 +10,7 @@ endif() set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) find_package(Qt4 REQUIRED) +find_package(OpenGL) set(QT_USE_QTOPENGL TRUE) set(QT_USE_QTXML TRUE) @@ -22,14 +23,14 @@ qt4_automoc( ${srcs}) qt4_add_resources(srcs glsplat.qrc) add_library(GlSplat SHARED ${srcs}) -target_link_libraries(GlSplat ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY} ) +target_link_libraries(GlSplat ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${OPENGL_gl_LIBRARY}) find_package(QGLViewer) -if(QGLVIEWER_FOUND) +if(QGLVIEWER_FOUND AND OPENGL_FOUND) include_directories( ${QGLViewer_INCLUDES}) add_executable(demo demo.cpp) - target_link_libraries(demo ${QT_QTXML_LIBRARY} ${QGLViewer_LIBRARIES} GlSplat) + target_link_libraries(demo ${QT_QTXML_LIBRARY} ${QGLViewer_LIBRARIES} ${OPENGL_gl_LIBRARY} GlSplat) else() - message("QGLViewer not found, demo won't be built") + message("QGLViewer or OpenGL not found, demo won't be built") endif() include( polyhedron_demo_macros ) diff --git a/Polyhedron/demo/Polyhedron/GlSplat/GlSplat_config.h b/Polyhedron/demo/Polyhedron/GlSplat/GlSplat_config.h index b64e4065a68..4c4457cc4b4 100644 --- a/Polyhedron/demo/Polyhedron/GlSplat/GlSplat_config.h +++ b/Polyhedron/demo/Polyhedron/GlSplat/GlSplat_config.h @@ -4,9 +4,9 @@ #include #ifdef gl_splat_EXPORTS - #define GLSPLAT_EXPORT CGAL_DLL_EXPORT + #define GLSPLAT_EXPORT Q_DECL_EXPORT #else - #define GLSPLAT_EXPORT CGAL_DLL_IMPORT + #define GLSPLAT_EXPORT Q_DECL_IMPORT #endif #endif // GLSPLAT_CONFIG_H diff --git a/Polyline_simplification_2/demo/Polyline_simplification_2/CMakeLists.txt b/Polyline_simplification_2/demo/Polyline_simplification_2/CMakeLists.txt index 808265d6f8f..f1743698eb8 100644 --- a/Polyline_simplification_2/demo/Polyline_simplification_2/CMakeLists.txt +++ b/Polyline_simplification_2/demo/Polyline_simplification_2/CMakeLists.txt @@ -27,13 +27,13 @@ add_definitions(-DQT_NO_KEYWORDS) qt5_wrap_ui( CDT_UI_FILES Polyline_simplification_2.ui ) # qrc files (resources files, that contain icons, at least) -qt5_add_resources ( CDT_RESOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Polyline_simplification_2.qrc ) +qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Polyline_simplification_2.qrc ) # use the Qt MOC preprocessor on classes that derives from QObject qt5_generate_moc( ${CMAKE_CURRENT_SOURCE_DIR}/Polyline_simplification_2.cpp Polyline_simplification_2.moc ) # The executable itself. -add_executable ( Polyline_simplification_2 ${CMAKE_CURRENT_SOURCE_DIR}/Polyline_simplification_2.cpp Polyline_simplification_2.moc ${CDT_UI_FILES} ${CDT_RESOURCE_FILES} ) +add_executable ( Polyline_simplification_2 ${CMAKE_CURRENT_SOURCE_DIR}/Polyline_simplification_2.cpp Polyline_simplification_2.moc ${CDT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) qt5_use_modules(Polyline_simplification_2 Xml Script OpenGL Widgets Svg) # Link with Qt libraries diff --git a/Principal_component_analysis/demo/Principal_component_analysis/CMakeLists.txt b/Principal_component_analysis/demo/Principal_component_analysis/CMakeLists.txt index 54fcf00ae45..f9627e8da97 100644 --- a/Principal_component_analysis/demo/Principal_component_analysis/CMakeLists.txt +++ b/Principal_component_analysis/demo/Principal_component_analysis/CMakeLists.txt @@ -44,11 +44,11 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND) qt5_generate_moc( "Viewer.h" "${CMAKE_CURRENT_BINARY_DIR}/Viewer_moc.cpp" ) add_file_dependencies( Viewer_moc.cpp "${CMAKE_CURRENT_SOURCE_DIR}/Viewer.h" ) - qt5_add_resources ( RESOURCE_FILES PCA_demo.qrc ) + qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES PCA_demo.qrc ) add_file_dependencies( PCA_demo.cpp "${CMAKE_CURRENT_BINARY_DIR}/MainWindow_moc.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Viewer_moc.cpp" ) - add_executable ( PCA_demo PCA_demo.cpp ${UI_FILES} ${RESOURCE_FILES} ) + add_executable ( PCA_demo PCA_demo.cpp ${UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) qt5_use_modules( PCA_demo Xml Script OpenGL) # Link with Qt libraries target_link_libraries( PCA_demo ${QT_LIBRARIES} ) diff --git a/Random_numbers/include/CGAL/Random.h b/Random_numbers/include/CGAL/Random.h index 665dd78cb23..7285071f569 100644 --- a/Random_numbers/include/CGAL/Random.h +++ b/Random_numbers/include/CGAL/Random.h @@ -228,21 +228,27 @@ public: boost::rand48 rng; }; -#ifndef CGAL_HEADER_ONLY -// Global variables -// ================ -CGAL_EXPORT extern Random default_random; -#endif // CGAL_HEADER_ONLY - #ifdef CGAL_HEADER_ONLY + inline Random& get_default_random() { static Random default_random; return default_random; } + +#ifndef CGAL_NO_DEPRECATED_CODE + namespace { CGAL_DEPRECATED CGAL::Random& default_random = get_default_random(); } +#endif // CGAL_NO_DEPRECATED_CODE + #else // CGAL_HEADER_ONLY + +// Global variables +// ================ +CGAL_EXPORT extern Random default_random; + inline Random& get_default_random() { return default_random; } + #endif // CGAL_HEADER_ONLY } //namespace CGAL diff --git a/Segment_Delaunay_graph_Linf_2/include/CGAL/Polychain_2.h b/Segment_Delaunay_graph_Linf_2/include/CGAL/Polychain_2.h index 542adfb98eb..6ec4a820fac 100644 --- a/Segment_Delaunay_graph_Linf_2/include/CGAL/Polychain_2.h +++ b/Segment_Delaunay_graph_Linf_2/include/CGAL/Polychain_2.h @@ -105,7 +105,7 @@ operator<<(std::ostream &os, ::Vertex_const_iterator i; - switch(os.iword(IO::mode)) { + switch(get_mode(os)) { case IO::ASCII : os << p.size() << ' '; for (i = p.vertices_begin(); i != p.vertices_end(); ++i) { @@ -278,7 +278,7 @@ operator<<(std::ostream &os, { typename Polychainray_2::Vertex_const_iterator i; - switch(os.iword(IO::mode)) { + switch(get_mode(os)) { case IO::ASCII : os << p.size() << ' '; for (i = p.vertices_begin(); i != p.vertices_end(); ++i) { @@ -794,7 +794,7 @@ operator<<(std::ostream &os, { typename Polychainline_2::Vertex_const_iterator i; - switch(os.iword(IO::mode)) { + switch(get_mode(os)) { case IO::ASCII : os << p.size() << ' '; os << ", dinc=" << p.get_incoming() << ", "; diff --git a/Spatial_searching/benchmark/Spatial_searching/binary.cpp b/Spatial_searching/benchmark/Spatial_searching/binary.cpp index 856fdcf1c9f..3c6be6f72b4 100644 --- a/Spatial_searching/benchmark/Spatial_searching/binary.cpp +++ b/Spatial_searching/benchmark/Spatial_searching/binary.cpp @@ -55,9 +55,9 @@ int main(int argc, char* argv[]) double dz = bb.zmax() - bb.zmin(); for(int i=0; i < N; i++){ - double rx = CGAL::default_random.get_double(); - double ry = CGAL::default_random.get_double(); - double rz = CGAL::default_random.get_double(); + double rx = CGAL::get_default_random().get_double(); + double ry = CGAL::get_default_random().get_double(); + double rz = CGAL::get_default_random().get_double(); bbox << Point_3(bb.xmin() + dx * rx , bb.ymin() + dy * ry , bb.zmin() + dz * rz); /*bbox << bb.xmin() + dx * rx << " "; bbox << bb.ymin() + dy * ry << " "; diff --git a/Spatial_searching/benchmark/Spatial_searching/tools/points_in_bbox.cpp b/Spatial_searching/benchmark/Spatial_searching/tools/points_in_bbox.cpp index 9b392c6c41f..9da6a869caf 100644 --- a/Spatial_searching/benchmark/Spatial_searching/tools/points_in_bbox.cpp +++ b/Spatial_searching/benchmark/Spatial_searching/tools/points_in_bbox.cpp @@ -26,9 +26,9 @@ int main() { double dz = bb.zmax() - bb.zmin(); for(int i = 0; i < points.size(); i++){ - double rx = CGAL::default_random.get_double(); - double ry = CGAL::default_random.get_double(); - double rz = CGAL::default_random.get_double(); + double rx = CGAL::get_default_random().get_double(); + double ry = CGAL::get_default_random().get_double(); + double rz = CGAL::get_default_random().get_double(); std::cout << bb.xmin() + dx * rx << " "; std::cout << bb.ymin() + dy * ry << " "; std::cout << bb.zmin() + dz * rz << std::endl; diff --git a/Surface_mesher/demo/Surface_mesher/CMakeLists.txt b/Surface_mesher/demo/Surface_mesher/CMakeLists.txt index 0c8ac87ed6f..51877a207ea 100644 --- a/Surface_mesher/demo/Surface_mesher/CMakeLists.txt +++ b/Surface_mesher/demo/Surface_mesher/CMakeLists.txt @@ -88,9 +88,9 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND CGAL_ImageIO_FOUND) qt5_wrap_ui( uis ui/values_list.ui ui/mainwindow.ui ui/optionsdialog.ui ui/raw_image.ui ) - qt5_add_resources( qrc_sources values_list.qrc surface_mesher.qrc ) + qt5_add_resources( CGAL_Qt5_RESOURCE_FILES values_list.qrc surface_mesher.qrc ) - add_executable ( ${prj} ${sources} ${uis} ${qrc_sources} ) + add_executable ( ${prj} ${sources} ${uis} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) qt5_use_modules(${prj} OpenGL Xml Svg) diff --git a/Triangulation_3/demo/Triangulation_3/CMakeLists.txt b/Triangulation_3/demo/Triangulation_3/CMakeLists.txt index f82fda1d864..ba826a000d0 100644 --- a/Triangulation_3/demo/Triangulation_3/CMakeLists.txt +++ b/Triangulation_3/demo/Triangulation_3/CMakeLists.txt @@ -57,14 +57,14 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_ qt5_wrap_ui( uis MainWindow.ui ) # qrc files (resources files, that contain icons, at least) - qt5_add_resources ( RESOURCE_FILES ./T3_demo.qrc ) + qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./T3_demo.qrc ) # cpp files add_executable ( T3_demo T3_demo.cpp MainWindow.cpp Viewer.cpp PreferenceDlg.cpp - Scene.cpp ${uis} ${RESOURCE_FILES} ) + Scene.cpp ${uis} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) qt5_use_modules(T3_demo Xml Script OpenGL) add_to_cached_list( CGAL_EXECUTABLE_TARGETS T3_demo )