Merge branch 'master' into BGL-generic_property_map-GF

This commit is contained in:
Laurent Rineau 2017-12-14 09:46:01 +01:00 committed by GitHub
commit 7df26c594b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
525 changed files with 10549 additions and 15455 deletions

3
.gitignore vendored
View File

@ -1094,6 +1094,9 @@ cgal_test_with_cmake.log
# File created by the Semantic Bovinator (an Emacs package)
semantic.cache
# Python cache files
*.pyc
# Files produced by a Qt compilation/execution
.qglviewer.xml
*.moc

View File

@ -42,9 +42,9 @@ env:
- PACKAGE='Snap_rounding_2 Solver_interface Spatial_searching '
- PACKAGE='Spatial_sorting STL_Extension Straight_skeleton_2 '
- PACKAGE='Stream_lines_2 Stream_support Subdivision_method_3 '
- PACKAGE='Surface_mesh Surface_mesh_deformation Surface_mesh_parameterization '
- PACKAGE='Surface_mesh_segmentation Surface_mesh_shortest_path Surface_mesh_simplification '
- PACKAGE='Surface_mesh_skeletonization Surface_mesher Sweep_line_2 '
- PACKAGE='Surface_mesh Surface_mesh_deformation Surface_mesher '
- PACKAGE='Surface_mesh_parameterization Surface_mesh_segmentation Surface_mesh_shortest_path '
- PACKAGE='Surface_mesh_simplification Surface_mesh_skeletonization Sweep_line_2 '
- PACKAGE='TDS_2 TDS_3 Testsuite '
- PACKAGE='Three Triangulation Triangulation_2 '
- PACKAGE='Triangulation_3 Union_find Visibility_2 '
@ -58,8 +58,9 @@ install:
before_script:
- mkdir -p build
- cd build
- cmake -DCGAL_HEADER_ONLY=ON -DQt5_DIR="/opt/qt55/lib/cmake/Qt5" -DQt5Svg_DIR="/opt/qt55/lib/cmake/Qt5Svg" -DQt5OpenGL_DIR="/opt/qt55/lib/cmake/Qt5OpenGL" -DWITH_demos:BOOL=TRUE -DWITH_examples:BOOL=true -DWITH_tests:BOOL=TRUE -DCMAKE_CXX_FLAGS_RELEASE=-DCGAL_NDEBUG ..
- cmake -DCGAL_HEADER_ONLY=ON -DQt5_DIR="/opt/qt55/lib/cmake/Qt5" -DQt5Svg_DIR="/opt/qt55/lib/cmake/Qt5Svg" -DQt5OpenGL_DIR="/opt/qt55/lib/cmake/Qt5OpenGL" -DCMAKE_CXX_FLAGS_RELEASE=-DCGAL_NDEBUG ..
- make
- sudo make install
- cd ..
script:
- cd ./.travis
@ -79,6 +80,7 @@ addons:
- libboost-thread1.55-dev
- libgmp-dev
- libmpfr-dev
- libmpfi-dev
- zlib1g-dev
- libeigen3-dev # too old
- qt55base
@ -93,7 +95,6 @@ addons:
# - geomview
# - libglew1.5-dev
# - libipe-dev
# - libmpfi-dev
notifications:
email:
on_success: change # default: always

View File

@ -6,7 +6,7 @@ CXX_FLAGS="-DCGAL_NDEBUG"
function build_examples {
mkdir -p build-travis
cd build-travis
cmake -DCGAL_DIR="$ROOT/build" -DCMAKE_CXX_FLAGS_RELEASE="${CXX_FLAGS}" ..
cmake -DCGAL_DIR="/usr/local/lib/cmake/CGAL" -DCMAKE_CXX_FLAGS_RELEASE="${CXX_FLAGS}" ..
make -j2
}
@ -44,7 +44,7 @@ function build_demo {
QGLVIEWERROOT=$PWD/qglviewer
export QGLVIEWERROOT
fi
cmake -DCGAL_DIR="$ROOT/build" -DQt5_DIR="/opt/qt55/lib/cmake/Qt5" -DQt5Svg_DIR="/opt/qt55/lib/cmake/Qt5Svg" -DQt5OpenGL_DIR="/opt/qt55/lib/cmake/Qt5OpenGL" -DCGAL_DONT_OVERRIDE_CMAKE_FLAGS:BOOL=ON -DCMAKE_CXX_FLAGS_RELEASE="${CXX_FLAGS} ${EXTRA_CXX_FLAGS}" ..
cmake -DCGAL_DIR="/usr/local/lib/cmake/CGAL" -DQt5_DIR="/opt/qt55/lib/cmake/Qt5" -DQt5Svg_DIR="/opt/qt55/lib/cmake/Qt5Svg" -DQt5OpenGL_DIR="/opt/qt55/lib/cmake/Qt5OpenGL" -DCGAL_DONT_OVERRIDE_CMAKE_FLAGS:BOOL=ON -DCMAKE_CXX_FLAGS_RELEASE="${CXX_FLAGS} ${EXTRA_CXX_FLAGS}" ..
make -j2
}

View File

@ -114,12 +114,12 @@ Stream_support
Subdivision_method_3
Surface_mesh
Surface_mesh_deformation
Surface_mesher
Surface_mesh_parameterization
Surface_mesh_segmentation
Surface_mesh_shortest_path
Surface_mesh_simplification
Surface_mesh_skeletonization
Surface_mesher
Sweep_line_2
TDS_2
TDS_3

View File

@ -13,8 +13,9 @@ install:
before_script:
- mkdir -p build
- cd build
- cmake -DCGAL_HEADER_ONLY=ON -DQt5_DIR="/opt/qt55/lib/cmake/Qt5" -DQt5Svg_DIR="/opt/qt55/lib/cmake/Qt5Svg" -DQt5OpenGL_DIR="/opt/qt55/lib/cmake/Qt5OpenGL" -DWITH_demos:BOOL=TRUE -DWITH_examples:BOOL=true -DWITH_tests:BOOL=TRUE -DCMAKE_CXX_FLAGS_RELEASE=-DCGAL_NDEBUG ..
- cmake -DCGAL_HEADER_ONLY=ON -DQt5_DIR="/opt/qt55/lib/cmake/Qt5" -DQt5Svg_DIR="/opt/qt55/lib/cmake/Qt5Svg" -DQt5OpenGL_DIR="/opt/qt55/lib/cmake/Qt5OpenGL" -DCMAKE_CXX_FLAGS_RELEASE=-DCGAL_NDEBUG ..
- make
- sudo make install
- cd ..
script:
- cd ./.travis
@ -34,6 +35,7 @@ addons:
- libboost-thread1.55-dev
- libgmp-dev
- libmpfr-dev
- libmpfi-dev
- zlib1g-dev
- libeigen3-dev # too old
- qt55base
@ -48,7 +50,6 @@ addons:
# - geomview
# - libglew1.5-dev
# - libipe-dev
# - libmpfi-dev
notifications:
email:
on_success: change # default: always

View File

@ -27,15 +27,12 @@ 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)
endif(Qt5_FOUND)
if(CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND)
if(CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND QGLVIEWER_FOUND)
include_directories ( ${QGLVIEWER_INCLUDE_DIR} )
@ -59,20 +56,19 @@ if(CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_FO
"${CMAKE_CURRENT_BINARY_DIR}/Scene_moc.cpp" )
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} )
# Link with CGAL
target_link_libraries( AABB_demo ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} )
# Link with libQGLViewer, OpenGL
target_link_libraries( AABB_demo ${QGLVIEWER_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY})
target_link_libraries( AABB_demo PRIVATE
Qt5::OpenGL Qt5::Gui
CGAL::CGAL
CGAL::CGAL_Qt5
${QGLVIEWER_LIBRARIES})
add_to_cached_list( CGAL_EXECUTABLE_TARGETS AABB_demo )
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(AABB_demo)
else (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND)
else (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND QGLVIEWER_FOUND)
set(AABB_MISSING_DEPS "")
@ -88,14 +84,10 @@ else (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER
set(AABB_MISSING_DEPS "Qt5, ${AABB_MISSING_DEPS}")
endif()
if(NOT OPENGL_FOUND)
set(AABB_MISSING_DEPS "OpenGL, ${AABB_MISSING_DEPS}")
endif()
if(NOT QGLVIEWER_FOUND)
set(AABB_MISSING_DEPS "QGLViewer, ${AABB_MISSING_DEPS}")
endif()
message(STATUS "NOTICE: This demo requires ${AABB_MISSING_DEPS}and will not be compiled.")
endif (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND)
endif (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND QGLVIEWER_FOUND)

View File

@ -595,6 +595,7 @@ void Scene::draw(QGLViewer* viewer)
initGL();
if(!are_buffers_initialized)
initialize_buffers();
gl->glEnable(GL_DEPTH_TEST);
QColor color;
QMatrix4x4 fMatrix;
fMatrix.setToIdentity();
@ -663,7 +664,7 @@ void Scene::draw(QGLViewer* viewer)
//cutting_segments
fMatrix.setToIdentity();
::glLineWidth(2.0f);
gl->glLineWidth(2.0f);
vao[3].bind();
attrib_buffers(viewer);
rendering_program.bind();
@ -671,7 +672,7 @@ void Scene::draw(QGLViewer* viewer)
rendering_program.setUniformValue(colorLocation, color);
rendering_program.setUniformValue(fLocation, fMatrix);
gl->glDrawArrays(GL_LINES, 0, static_cast<GLsizei>(pos_cut_segments.size()/3));
::glLineWidth(1.0f);
gl->glLineWidth(1.0f);
rendering_program.release();
vao[3].release();
//grid
@ -690,8 +691,8 @@ void Scene::draw(QGLViewer* viewer)
//cutting_plane
// for(int i=0; i< 16 ; i++)
// fMatrix.data()[i] = m_frame->matrix()[i];
::glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
::glEnable(GL_BLEND);
gl->glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
gl->glEnable(GL_BLEND);
vao[4].bind();
attrib_buffers(viewer);
rendering_program.bind();
@ -699,7 +700,7 @@ void Scene::draw(QGLViewer* viewer)
rendering_program.setUniformValue(colorLocation, color);
rendering_program.setUniformValue(fLocation, fMatrix);
gl->glDrawArrays(GL_TRIANGLES, 0, static_cast<GLsizei>(pos_plane.size()/3));
::glDisable(GL_BLEND);
gl->glDisable(GL_BLEND);
rendering_program.release();
vao[4].release();

View File

@ -18,7 +18,6 @@ void Viewer::setScene(Scene* pScene)
void Viewer::draw()
{
glEnable(GL_DEPTH_TEST);
QGLViewer::draw();
if(m_pScene != NULL)
{

View File

@ -29,7 +29,7 @@ Tag indicating that a type is a model of the
*/
class Euclidean_ring_tag : public Unique_factorization_domain_tag {
struct Euclidean_ring_tag : public Unique_factorization_domain_tag {
}; /* end Euclidean_ring_tag */
@ -45,7 +45,7 @@ Tag indicating that a type is a model of the `Field` concept.
*/
class Field_tag : public Integral_domain_tag {
struct Field_tag : public Integral_domain_tag {
}; /* end Field_tag */
@ -61,7 +61,7 @@ Tag indicating that a type is a model of the `FieldWithKthRoot` concept.
*/
class Field_with_kth_root_tag : public Field_with_sqrt_tag {
struct Field_with_kth_root_tag : public Field_with_sqrt_tag {
}; /* end Field_with_kth_root_tag */
@ -77,7 +77,7 @@ Tag indicating that a type is a model of the `FieldWithRootOf` concept.
*/
class Field_with_root_of_tag : public Field_with_kth_root_tag {
struct Field_with_root_of_tag : public Field_with_kth_root_tag {
}; /* end Field_with_root_of_tag */
@ -93,7 +93,7 @@ Tag indicating that a type is a model of the `FieldWithSqrt` concept.
*/
class Field_with_sqrt_tag : public Field_tag {
struct Field_with_sqrt_tag : public Field_tag {
}; /* end Field_with_sqrt_tag */
@ -109,7 +109,7 @@ Tag indicating that a type is a model of the `IntegralDomain` concept.
*/
class Integral_domain_tag : public Integral_domain_without_division_tag {
struct Integral_domain_tag : public Integral_domain_without_division_tag {
}; /* end Integral_domain_tag */
@ -124,7 +124,7 @@ Tag indicating that a type is a model of the `IntegralDomainWithoutDivision` con
*/
class Integral_domain_without_division_tag {
struct Integral_domain_without_division_tag {
}; /* end Integral_domain_without_division_tag */
@ -140,7 +140,7 @@ Tag indicating that a type is a model of the `UniqueFactorizationDomain` concept
*/
class Unique_factorization_domain_tag : public Integral_domain_tag {
struct Unique_factorization_domain_tag : public Integral_domain_tag {
}; /* end Unique_factorization_domain_tag */
} /* end namespace CGAL */

View File

@ -12,8 +12,7 @@ An instance of `Coercion_traits` reflects the type coercion of the types
*/
template< typename A, typename B >
class Coercion_traits {
public:
struct Coercion_traits {
/// \name Types
/// @{

View File

@ -1,22 +1,21 @@
# Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application.
project( Algebraic_kernel_d_Examples )
cmake_minimum_required(VERSION 2.8.11)
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET COMPONENTS Core MPFI)
find_package(CGAL QUIET COMPONENTS Core)
if ( CGAL_FOUND )
include( ${CGAL_USE_FILE} )
find_package(MPFI QUIET)
endif()
if( CGAL_FOUND AND MPFI_FOUND)
include( ${MPFI_USE_FILE} )
include( CGAL_CreateSingleSourceCGALProgram )
include( CGAL_VersionUtils )
include_directories (BEFORE ../../include)
create_single_source_cgal_program( "Compare_1.cpp" )
create_single_source_cgal_program( "Construct_algebraic_real_1.cpp" )
create_single_source_cgal_program( "Isolate_1.cpp" )
@ -25,7 +24,6 @@ if ( CGAL_FOUND )
else()
message(STATUS "This program requires the CGAL library, and will not be compiled.")
message(STATUS "This program requires the CGAL library and MPFI, and will not be compiled.")
endif()

View File

@ -1,13 +1,10 @@
# Created by the script cgal_create_CMakeLists
# This is the CMake script for compiling a set of CGAL applications.
project( Algebraic_kernel_d_Tests )
cmake_minimum_required(VERSION 2.8.11)
cmake_minimum_required(VERSION 3.1)
# CGAL and its components
find_package( CGAL QUIET COMPONENTS Core RS3)
find_package( CGAL QUIET COMPONENTS Core)
if ( NOT CGAL_FOUND )
@ -19,6 +16,15 @@ endif()
# include helper file
include( ${CGAL_USE_FILE} )
find_package(RS3 QUIET)
if(MPFI_FOUND)
include( ${MPFI_USE_FILE} )
endif()
if(RS3_FOUND)
include( ${RS3_USE_FILE} )
endif()
include( CGAL_CreateSingleSourceCGALProgram )
# Boost and its components

View File

@ -21,10 +21,9 @@ include(${CGAL_USE_FILE})
find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg)
find_package(OpenGL)
find_package(QGLViewer)
if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND )
if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND QGLVIEWER_FOUND )
add_definitions(-DQT_NO_KEYWORDS)
@ -40,15 +39,18 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_
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} ${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 )
target_link_libraries( Alpha_shape_3 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES})
target_link_libraries( Alpha_shape_3 ${QT_LIBRARIES} ${QGLVIEWER_LIBRARIES} )
target_link_libraries( Alpha_shape_3 ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY})
target_link_libraries( Alpha_shape_3 PRIVATE
CGAL::CGAL CGAL::CGAL_Qt5
Qt5::OpenGL Qt5::Gui
${QGLVIEWER_LIBRARIES} )
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Alpha_shape_3)
else()
message(STATUS "NOTICE: This demo requires CGAL, the QGLViewer, OpenGL and Qt5, and will not be compiled.")
message(STATUS "NOTICE: This demo requires CGAL, the QGLViewer, and Qt5, and will not be compiled.")
endif()

View File

@ -335,7 +335,7 @@ Viewer::draw()
rendering_program_points.bind();
color.setRgbF(1.0f, 0.0f, 0.0f);
glPointSize(5);
::glEnable(GL_POINT_SMOOTH);
glEnable(GL_POINT_SMOOTH);
rendering_program_points.setUniformValue(colorLocation_points, color);
glDrawArrays(GL_POINTS, 0, static_cast<GLsizei>(pos_points.size()/3));
rendering_program_points.release();

View File

@ -8,12 +8,14 @@ cmake_minimum_required(VERSION 2.8.11)
find_package(CGAL QUIET COMPONENTS Core GMP MPFR)
find_package(CGAL QUIET COMPONENTS Core)
if ( CGAL_FOUND)
include( ${CGAL_USE_FILE} )
endif()
find_package(GMP QUIET)
if ( CGAL_FOUND AND GMP_FOUND )
include( CGAL_VersionUtils )
@ -30,6 +32,8 @@ if ( CGAL_FOUND AND GMP_FOUND )
find_package( MPFI )
if( MPFI_FOUND )
include( ${MPFI_USE_FILE} )
# for the testsuite, the version of MPFI shipped with RS is used; this
# version needs GMP>=4.2, so we require this dependency only here and
# not in FindMPFI.cmake

File diff suppressed because it is too large Load Diff

View File

@ -11,7 +11,7 @@ endif()
find_package(CGAL COMPONENTS Core Qt5 )
include( ${CGAL_USE_FILE} )
find_package( Qt5 QUIET COMPONENTS Script Widgets )
find_package( Qt5 QUIET COMPONENTS Gui )
if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND CGAL_Core_FOUND)
include_directories( ./ )
@ -68,15 +68,15 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND CGAL_Core_FOUND)
${arrangement_2_uis}
${CGAL_Qt5_RESOURCE_FILES}
)
qt5_use_modules(arrangement_2 Widgets Script)
target_link_libraries( arrangement_2
${CGAL_LIBRARIES}
${CGAL_3RD_PARTY_LIBRARIES}
${QT_LIBRARIES}
target_link_libraries( arrangement_2 PRIVATE
CGAL::CGAL CGAL::CGAL_Qt5 CGAL::CGAL_Core
Qt5::Gui
)
add_to_cached_list( CGAL_EXECUTABLE_TARGETS arrangement_2 )
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(arrangement_2)
else()
message(STATUS "NOTICE: This demo requires CGAL, CGAL-Core and Qt5, and will not be compiled.")

View File

@ -40,9 +40,8 @@ or vertical ray-shoot query.
\sa `CGAL_ARR_POINT_LOCATION_VERSION`
*/
template <class Arrangement>
class Arr_point_location_result
struct Arr_point_location_result
{
public:
/*! The type of the arrangement feature that is the result of a
* point-location query or a vertical ray-shoot query, namely,
* `boost::variant<Arrangement::Vertex_const_handle, Arrangement::Halfedge_const_handle, Arrangement::Face_const_handle>`

View File

@ -16,8 +16,7 @@ arrangement.
*/
class Arr_oblivious_side_tag {
public:
struct Arr_oblivious_side_tag {
/// @}
@ -44,8 +43,7 @@ functions based on type of curves that induce the arrangement.
*/
class Arr_open_side_tag {
public:
struct Arr_open_side_tag {
/// @}

View File

@ -16,25 +16,26 @@
// $Id$
// SPDX-License-Identifier: GPL-3.0+
//
//
// Author(s) : Ron Wein <wein@post.tau.ac.il>
// Efi Fogel <efif@post.tau.ac.il>
// Efi Fogel <efifogel@gmail.com>
#ifndef CGAL_ARR_CURVE_DATA_TRAITS_2_H
#define CGAL_ARR_CURVE_DATA_TRAITS_2_H
#include <CGAL/license/Arrangement_on_surface_2.h>
/*! \file
* Definition of the Arr_curve_data_traits_2<> class template.
*/
#include<CGAL/Object.h>
#include<CGAL/tags.h>
#include<CGAL/Arr_tags.h>
#include<CGAL/Arr_geometry_traits/Curve_data_aux.h>
#include<list>
#include <list>
#include <boost/utility/enable_if.hpp>
#include <boost/mpl/has_xxx.hpp>
#include <CGAL/Object.h>
#include <CGAL/tags.h>
#include <CGAL/Arr_tags.h>
#include <CGAL/Arr_geometry_traits/Curve_data_aux.h>
namespace CGAL {
@ -50,183 +51,148 @@ namespace CGAL {
* the overlapping subcurve is obtained from the merge functor.
* All other functors are inherited from the base ordinary traits class.
*/
template <class Traits_, class XMonotoneCurveData_,
class Merge_ = _Default_merge_func<XMonotoneCurveData_>,
class CurveData_ = XMonotoneCurveData_,
class Convert_ = _Default_convert_func<CurveData_,
XMonotoneCurveData_> >
class Arr_curve_data_traits_2 : public Traits_
{
template <typename Traits_, typename XMonotoneCurveData_,
typename Merge_ = _Default_merge_func<XMonotoneCurveData_>,
typename CurveData_ = XMonotoneCurveData_,
typename Convert_ =
_Default_convert_func<CurveData_, XMonotoneCurveData_> >
class Arr_curve_data_traits_2 : public Traits_ {
public:
typedef Traits_ Base_traits_2;
typedef XMonotoneCurveData_ X_monotone_curve_data;
typedef Merge_ Merge;
typedef CurveData_ Curve_data;
typedef Convert_ Convert;
typedef Traits_ Base_traits_2;
typedef XMonotoneCurveData_ X_monotone_curve_data;
typedef Merge_ Merge;
typedef CurveData_ Curve_data;
typedef Convert_ Convert;
typedef typename Base_traits_2::Curve_2 Base_curve_2;
typedef typename Base_traits_2::X_monotone_curve_2 Base_x_monotone_curve_2;
typedef typename Base_traits_2::Point_2 Point_2;
typedef typename Base_traits_2::Curve_2 Base_curve_2;
typedef typename Base_traits_2::X_monotone_curve_2 Base_x_monotone_curve_2;
typedef typename Base_traits_2::Point_2 Point_2;
typedef typename Base_traits_2::Has_left_category Has_left_category;
typedef typename Base_traits_2::Has_merge_category Base_has_merge_category;
typedef Tag_true Has_merge_category;
typedef typename Base_traits_2::Has_left_category Has_left_category;
typedef typename Base_traits_2::Has_merge_category Base_has_merge_category;
typedef Tag_true Has_merge_category;
typedef typename Base_traits_2::Has_do_intersect_category
Has_do_intersect_category;
Has_do_intersect_category;
typedef typename internal::Arr_complete_left_side_category< Base_traits_2 >::Category
Left_side_category;
typedef typename internal::Arr_complete_bottom_side_category< Base_traits_2 >::Category
Bottom_side_category;
typedef typename internal::Arr_complete_top_side_category< Base_traits_2 >::Category
Top_side_category;
typedef typename internal::Arr_complete_right_side_category< Base_traits_2 >::Category
Right_side_category;
typedef typename internal::Arr_complete_left_side_category<Base_traits_2>::
Category Left_side_category;
typedef typename internal::Arr_complete_bottom_side_category<Base_traits_2>::
Category Bottom_side_category;
typedef typename internal::Arr_complete_top_side_category<Base_traits_2>::
Category Top_side_category;
typedef typename internal::Arr_complete_right_side_category<Base_traits_2>::
Category Right_side_category;
// Representation of a curve with an addtional data field:
typedef _Curve_data_ex<Base_curve_2, Curve_data> Curve_2;
// Representation of an x-monotone curve with an addtional data field:
typedef _Curve_data_ex<Base_x_monotone_curve_2,
X_monotone_curve_data> X_monotone_curve_2;
typedef _Curve_data_ex<Base_curve_2, Curve_data> Curve_2;
// Representation of an x-monotone curve with an addtional data field:
typedef _Curve_data_ex<Base_x_monotone_curve_2, X_monotone_curve_data>
X_monotone_curve_2;
typedef typename Base_traits_2::Multiplicity Multiplicity;
typedef typename Base_traits_2::Multiplicity Multiplicity;
public:
/// \name Construction.
//@{
/*! Default constructor. */
Arr_curve_data_traits_2 ()
{}
/*! Constructor from a base-traits class. */
Arr_curve_data_traits_2 (const Base_traits_2 & traits) :
Base_traits_2 (traits)
{}
/*! Construct default. */
Arr_curve_data_traits_2() {}
/*! Construct from a base-traits class. */
Arr_curve_data_traits_2(const Base_traits_2& traits) : Base_traits_2(traits) {}
//@}
/// \name Overriden functors.
//@{
class Make_x_monotone_2
{
class Make_x_monotone_2 {
private:
const Base_traits_2 * base;
const Base_traits_2& m_base;
public:
/*! Constructor. */
Make_x_monotone_2 (const Base_traits_2 * _base) :
base (_base)
{}
/*!
* Cut the given curve into x-monotone subcurves and insert them to the
Make_x_monotone_2(const Base_traits_2& base) : m_base(base) {}
/*! Cut the given curve into x-monotone subcurves and insert them to the
* given output iterator. As segments are always x_monotone, only one
* x-monotone curve will be contained in the iterator.
* \param cv The curve.
* \param oi The output iterator, whose value-type is X_monotone_curve_2.
* \return The past-the-end iterator.
*/
template<class OutputIterator>
OutputIterator operator() (const Curve_2& cv, OutputIterator oi) const
template<typename OutputIterator>
OutputIterator operator()(const Curve_2& cv, OutputIterator oi) const
{
// Make the original curve x-monotone.
std::list<CGAL::Object> base_objects;
base->make_x_monotone_2_object() (cv,
std::back_inserter (base_objects));
std::list<CGAL::Object> base_objects;
m_base.make_x_monotone_2_object()(cv, std::back_inserter(base_objects));
// Attach the data to each of the resulting x-monotone curves.
typename std::list<CGAL::Object>::const_iterator it;
const Base_x_monotone_curve_2 *base_x_curve;
X_monotone_curve_data xdata = Convert()(cv.data());
for (it = base_objects.begin(); it != base_objects.end(); ++it)
const Base_x_monotone_curve_2* base_x_curve;
X_monotone_curve_data xdata = Convert()(cv.data());
for (typename std::list<CGAL::Object>::const_iterator it =
base_objects.begin(); it != base_objects.end(); ++it)
{
base_x_curve = object_cast<Base_x_monotone_curve_2> (&(*it));
if (base_x_curve != NULL)
{
base_x_curve = object_cast<Base_x_monotone_curve_2>(&(*it));
if (base_x_curve != NULL) {
// Current object is an x-monotone curve: Attach data to it.
*oi = make_object (X_monotone_curve_2 (*base_x_curve,
xdata));
*oi++ = make_object(X_monotone_curve_2(*base_x_curve, xdata));
}
else
{
else {
// Current object is an isolated point: Leave it as is.
CGAL_assertion (object_cast<Point_2> (&(*it)) != NULL);
*oi = *it;
CGAL_assertion(object_cast<Point_2>(&(*it)) != NULL);
*oi++ = *it;
}
++oi;
}
return (oi);
return oi;
}
};
/*! Get a Make_x_monotone_2 functor object. */
Make_x_monotone_2 make_x_monotone_2_object () const
{
return Make_x_monotone_2 (this);
}
/*! Obtain a Make_x_monotone_2 functor object. */
Make_x_monotone_2 make_x_monotone_2_object() const
{ return Make_x_monotone_2(*this); }
class Split_2
{
class Split_2 {
private:
const Base_traits_2 * base;
const Base_traits_2& m_base;
public:
/*! Constructor. */
Split_2 (const Base_traits_2 * _base) :
base (_base)
{}
Split_2(const Base_traits_2& base) : m_base(base) {}
/*!
* Split a given x-monotone curve at a given point into two sub-curves.
* \param cv The curve to split
* \param p The split point.
* \param c1 Output: The left resulting subcurve (p is its right endpoint).
* \param c2 Output: The right resulting subcurve (p is its left endpoint).
/*! Split a given x-monotone curve at a given point into two sub-curves.
* \param cv[in] The curve to split
* \param p[in] The split point.
* \param c1[out] The left resulting subcurve (p is its right endpoint).
* \param c2[out] The right resulting subcurve (p is its left endpoint).
* \pre p lies on cv but is not one of its end-points.
*/
void operator() (const X_monotone_curve_2& cv, const Point_2 & p,
X_monotone_curve_2& c1, X_monotone_curve_2& c2) const
void operator()(const X_monotone_curve_2& cv, const Point_2& p,
X_monotone_curve_2& c1, X_monotone_curve_2& c2) const
{
// Split the original curve.
base->split_2_object() (cv, p, c1, c2);
m_base.split_2_object()(cv, p, c1, c2);
// Attach data to the split curves.
c1.set_data (cv.data());
c2.set_data (cv.data());
return;
c1.set_data(cv.data());
c2.set_data(cv.data());
}
};
/*! Get a Split_2 functor object. */
Split_2 split_2_object () const
{
return Split_2 (this);
}
/*! Obtain a Split_2 functor object. */
Split_2 split_2_object() const { return Split_2(*this); }
class Intersect_2
{
class Intersect_2 {
private:
const Base_traits_2 * base;
const Base_traits_2& m_base;
public:
/*! Constructor. */
Intersect_2 (const Base_traits_2 * _base) :
base (_base)
{}
Intersect_2(const Base_traits_2& base) : m_base(base) {}
/*!
* Find the intersections of the two given curves and insert them to the
/*! Find the intersections of the two given curves and insert them to the
* given output iterator. As two segments may itersect only once, only a
* single will be contained in the iterator.
* \param cv1 The first curve.
@ -234,223 +200,243 @@ public:
* \param oi The output iterator.
* \return The past-the-end iterator.
*/
template<class OutputIterator>
OutputIterator operator() (const X_monotone_curve_2& cv1,
const X_monotone_curve_2& cv2,
OutputIterator oi) const
template<typename OutputIterator>
OutputIterator operator()(const X_monotone_curve_2& cv1,
const X_monotone_curve_2& cv2,
OutputIterator oi) const
{
// Use the base functor to obtain all intersection objects.
std::list<CGAL::Object> base_objects;
base->intersect_2_object() (cv1, cv2,
std::back_inserter (base_objects));
std::list<CGAL::Object> base_objects;
m_base.intersect_2_object()(cv1, cv2, std::back_inserter(base_objects));
// Stop if the list is empty:
if (base_objects.empty())
return (oi);
if (base_objects.empty()) return oi;
// Go over all intersection objects and prepare the output.
typename std::list<CGAL::Object>::const_iterator it;
const Base_x_monotone_curve_2 *base_cv;
for (it = base_objects.begin(); it != base_objects.end(); ++it)
const Base_x_monotone_curve_2* base_cv;
for (typename std::list<CGAL::Object>::const_iterator it =
base_objects.begin(); it != base_objects.end(); ++it)
{
if ((base_cv = object_cast<Base_x_monotone_curve_2> (&(*it))) != NULL)
{
if ((base_cv = object_cast<Base_x_monotone_curve_2>(&(*it))) != NULL) {
// The current intersection object is an overlapping x-monotone
// curve: Merge the data fields of both intersecting curves and
// associate the result with the overlapping curve.
X_monotone_curve_2 cv (*base_cv,
Merge() (cv1.data(), cv2.data()));
*oi = make_object (cv);
X_monotone_curve_2 cv(*base_cv, Merge() (cv1.data(), cv2.data()));
*oi++ = make_object(cv);
}
else
{
else {
// The current intersection object is an intersection point:
// Copy it as is.
*oi = *it;
*oi++ = *it;
}
++oi;
}
return (oi);
return oi;
}
};
/*! Get an Intersect_2 functor object. */
Intersect_2 intersect_2_object () const
{
return Intersect_2 (this);
}
/*! Obtain an Intersect_2 functor object. */
Intersect_2 intersect_2_object() const { return Intersect_2(*this); }
class Are_mergeable_2
{
class Are_mergeable_2 {
private:
const Base_traits_2 * base;
const Base_traits_2& m_base;
public:
/*! Constructor. */
Are_mergeable_2 (const Base_traits_2 * _base) :
base (_base)
{}
/*!
* Check whether it is possible to merge two given x-monotone curves.
* \param cv1 The first curve.
* \param cv2 The second curve.
* \return (true) if the two curves are mergeable; (false) otherwise.
/*! Generate a helper class template to find out whether the base geometry
* traits has a nested type named Are_mergeable_2.
*/
bool operator() (const X_monotone_curve_2& cv1,
const X_monotone_curve_2& cv2) const
{
return (_are_mergeable_base_imp (cv1, cv2, Base_has_merge_category()));
}
BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_are_mergeable_2,
Are_mergeable_2, false)
private:
/*!
* Implementation of the base predicate in case the HasMerge tag is true.
/*! Implementation of the predicate in case the base geometry traits class
* has a nested type named Are_mergeable_2.
*/
bool _are_mergeable_base_imp (const X_monotone_curve_2& cv1,
const X_monotone_curve_2& cv2,
Tag_true) const
template <typename GeomeTraits_2>
typename boost::enable_if_c<has_are_mergeable_2<GeomeTraits_2>::value,
bool>::type
are_mergeable(const X_monotone_curve_2& cv1,
const X_monotone_curve_2& cv2) const
{
// In case the two base curves are not mergeable, the extended curves
// are not mergeable as well.
if (! (base->are_mergeable_2_object() (cv1, cv2)))
return (false);
if (! (m_base.are_mergeable_2_object()(cv1, cv2))) return false;
// In case the two base curves are mergeable, check that they have the
// same data fields.
return (cv1.data() == cv2.data());
}
/*!
* Implementation of the base predicate in case the HasMerge tag is false.
/*! Implementation of the predicate in case the base geometry traits class
* does not have a nested type named Are_mergeable_2.
* This function should never be called!
*/
bool _are_mergeable_base_imp (const X_monotone_curve_2& ,
const X_monotone_curve_2& ,
Tag_false) const
template <typename GeomeTraits_2>
typename boost::enable_if_c<!has_are_mergeable_2<GeomeTraits_2>::value,
bool>::type
are_mergeable(const X_monotone_curve_2& /* cv1 */,
const X_monotone_curve_2& /* cv2 */) const
{
// Curve merging is not supported:
return (false);
CGAL_error_msg("Are mergeable is not supported.");
return false;
}
public:
/*! Constructor. */
Are_mergeable_2(const Base_traits_2& base) : m_base(base) {}
/*! Check whether it is possible to merge two given x-monotone curves.
* \param cv1[in] The first curve.
* \param cv2[in] The second curve.
* \return (true) if the two curves are mergeable; (false) otherwise.
*/
bool operator()(const X_monotone_curve_2& cv1,
const X_monotone_curve_2& cv2) const
{ return are_mergeable<Base_traits_2>(cv1, cv2); }
};
/*! Get an Are_mergeable_2 functor object. */
Are_mergeable_2 are_mergeable_2_object () const
{
return Are_mergeable_2 (this);
}
/*! Obtain an Are_mergeable_2 functor object. */
Are_mergeable_2 are_mergeable_2_object() const
{ return Are_mergeable_2(*this); }
/*! \class Merge_2
* A functor that merges two x-monotone arcs into one.
*/
class Merge_2
{
class Merge_2 {
private:
const Base_traits_2 * base;
const Base_traits_2& m_base;
public:
/*! Constructor. */
Merge_2 (const Base_traits_2 * _base) :
base (_base)
{}
/*!
* Merge two given x-monotone curves into a single curve (segment).
* \param cv1 The first curve.
* \param cv2 The second curve.
* \param c Output: The merged curve.
* \pre The two curves are mergeable.
/*! Generate a helper class template to find out whether the base geometry
* traits has a nested type named Merge_2.
*/
void operator() (const X_monotone_curve_2& cv1,
const X_monotone_curve_2& cv2,
X_monotone_curve_2& c) const
BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_merge_2, Are_mergeable_2, false)
/*! Implementation of the predicate in case the base geometry traits class
* has a nested type named Merge_2.
*/
template <typename GeomeTraits_2>
typename boost::enable_if_c<has_merge_2<GeomeTraits_2>::value, void>::type
merge(const X_monotone_curve_2& cv1, const X_monotone_curve_2& cv2,
X_monotone_curve_2& c) const
{
// The function is implemented based on the base Has_merge category.
_merge_imp (cv1, cv2, c, Base_has_merge_category());
}
private:
/*!
* Implementation of the operator() in case the HasMerge tag is true.
*/
void _merge_imp (const X_monotone_curve_2& cv1,
const X_monotone_curve_2& cv2,
X_monotone_curve_2& c,
Tag_true) const
{
// Merge the two base curve.
Base_x_monotone_curve_2 base_cv;
Base_x_monotone_curve_2 base_cv;
base->merge_2_object() (cv1, cv2, base_cv);
m_base.merge_2_object()(cv1, cv2, base_cv);
// Attach data from one of the curves.
CGAL_precondition (cv1.data() == cv2.data());
CGAL_precondition(cv1.data() == cv2.data());
c = X_monotone_curve_2 (base_cv, cv1.data());
return;
c = X_monotone_curve_2(base_cv, cv1.data());
}
/*!
* Implementation of the operator() in case the HasMerge tag is false.
/*! Implementation of the predicate in case the base geometry traits class
* does not have a nested type named Merge_2.
* This function should never be called!
*/
void _merge_imp (const X_monotone_curve_2& ,
const X_monotone_curve_2& ,
X_monotone_curve_2& ,
Tag_false) const
{
// This function should never be called!
CGAL_error_msg("Merging curves is not supported.");
}
};
/*! Get a Merge_2 functor object. */
Merge_2 merge_2_object () const
{
return Merge_2 (this);
}
class Construct_x_monotone_curve_2
{
private:
const Base_traits_2 * base;
template <typename GeomeTraits_2>
typename boost::enable_if_c<!has_merge_2<GeomeTraits_2>::value, void>::type
merge(const X_monotone_curve_2& /* cv1 */,
const X_monotone_curve_2& /* cv2 */,
X_monotone_curve_2& /* c */) const
{ CGAL_error_msg("Merging curves is not supported."); }
public:
/*! Constructor. */
Construct_x_monotone_curve_2 (const Base_traits_2 * _base) :
base (_base)
{}
Merge_2(const Base_traits_2& base) : m_base(base) {}
/*!
* Return an x-monotone curve connecting the two given endpoints.
/*! Merge two given x-monotone curves into a single curve (segment).
* \param[in] cv1 The first curve.
* \param[in] cv2 The second curve.
* \param[out] c The merged curve.
* \pre The two curves are mergeable.
*/
void operator()(const X_monotone_curve_2& cv1,
const X_monotone_curve_2& cv2,
X_monotone_curve_2& c) const
{ merge<Base_traits_2>(cv1, cv2, c); }
};
/*! Obtain a Merge_2 functor object. */
Merge_2 merge_2_object() const { return Merge_2(*this); }
class Construct_x_monotone_curve_2 {
private:
const Base_traits_2& m_base;
public:
/*! Constructor. */
Construct_x_monotone_curve_2(const Base_traits_2& base) : m_base(base) {}
/*! Obtain an x-monotone curve connecting the two given endpoints.
* \param p The first point.
* \param q The second point.
* \pre p and q must not be the same.
* \return An x-monotone curve connecting p and q.
*/
X_monotone_curve_2 operator() (const Point_2& p, const Point_2& q) const
X_monotone_curve_2 operator()(const Point_2& p, const Point_2& q) const
{
Base_x_monotone_curve_2 base_cv =
base->construct_x_monotone_curve_2_object() (p, q);
return (X_monotone_curve_2 (base_cv, X_monotone_curve_data()));
m_base.construct_x_monotone_curve_2_object()(p, q);
return (X_monotone_curve_2(base_cv, X_monotone_curve_data()));
}
};
/*! Get a Construct_x_monotone_curve_2 functor object. */
Construct_x_monotone_curve_2 construct_x_monotone_curve_2_object () const
{
return Construct_x_monotone_curve_2 (this);
}
//@}
/*! Obtain a Construct_x_monotone_curve_2 functor object. */
Construct_x_monotone_curve_2 construct_x_monotone_curve_2_object() const
{ return Construct_x_monotone_curve_2(*this); }
class Construct_opposite_2 {
private:
const Base_traits_2& m_base;
/*! Generate a helper class template to find out whether the base geometry
* traits has a nested type named Construct_opposite_2.
*/
BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_construct_opposite_2,
Construct_opposite_2, false)
/*! Implementation of the predicate in case the base geometry traits class
* has a nested type named Construct_opposite_2.
*/
template <typename GeomeTraits_2>
typename boost::enable_if_c<has_construct_opposite_2<GeomeTraits_2>::value,
X_monotone_curve_2>::type
construct_opposite(const X_monotone_curve_2& cv) const
{
X_monotone_curve_2 new_cv(m_base.construct_opposite_2_object()(cv),
cv.data());
return new_cv;
}
/*! Implementation of the predicate in case the base geometry traits class
* does not have a nested type named Construct_opposite_2.
* This function should never be called!
*/
template <typename GeomeTraits_2>
typename boost::enable_if_c<!has_construct_opposite_2<GeomeTraits_2>::value,
X_monotone_curve_2>::type
construct_opposite(const X_monotone_curve_2& cv) const
{
CGAL_error_msg("Construct opposite curve is not supported!");
return X_monotone_curve_2();
}
public:
/*! Constructor. */
Construct_opposite_2(const Base_traits_2& base) : m_base(base) {}
/*! Construct an opposite x-monotone (with swapped source and target).
* \param cv The curve.
* \return The opposite curve.
*/
X_monotone_curve_2 operator()(const X_monotone_curve_2& cv) const
{ return construct_opposite<Base_traits_2>(cv); }
};
/*! Obtain a Construct_opposite_2 functor object. */
Construct_opposite_2 construct_opposite_2_object() const
{ return Construct_opposite_2(*this); }
//@}
};
} //namespace CGAL

View File

@ -2441,7 +2441,7 @@ protected:
{
x = x_left + x_jump*i;
disc = app_sqr_rad - CGAL::square(x - app_xcenter);
CGAL_precondition(disc >= 0);
if (disc < 0) disc = 0;
if(is_up)
y = app_ycenter + std::sqrt(disc);
else

View File

@ -450,8 +450,7 @@ protected:
* \param curve The subcurve to add.
* \return (true) if an overlap occured; (false) otherwise.
*/
virtual bool _add_curve_to_right(Event* event, Subcurve* curve,
bool overlap_exist = false);
virtual bool _add_curve_to_right(Event* event, Subcurve* curve);
/*! Remove a curve from the status line. */
void _remove_curve_from_status_line(Subcurve *leftCurve);

View File

@ -225,9 +225,19 @@ bool Construction_test<T_Geom_traits, T_Topol_traits>::are_same_results()
<< m_num_faces << ")" << std::endl;
}
if (m_arr->number_of_vertices() != m_num_vertices) return false;
if (m_arr->number_of_edges() != m_num_edges) return false;
if (m_arr->number_of_faces() != m_num_faces) return false;
if ((m_arr->number_of_vertices() != m_num_vertices) ||
(m_arr->number_of_edges() != m_num_edges) ||
(m_arr->number_of_faces() != m_num_faces)) {
std::cout << "# vertices, edge, faces obtained: ("
<< m_arr->number_of_vertices() << ","
<< m_arr->number_of_edges() << ","
<< m_arr->number_of_faces() << ")"
<< ", expected: ("
<< m_num_vertices << ","
<< m_num_edges << ","
<< m_num_faces << ")" << std::endl;
return false;
}
Point_container points_res(m_num_vertices);
typename Point_container::iterator pit = points_res.begin();
@ -239,13 +249,20 @@ bool Construction_test<T_Geom_traits, T_Topol_traits>::are_same_results()
std::sort(points_res.begin(), pit, pt_compare);
if (m_verbose_level > 2) {
std::copy(points_res.begin(), pit,
std::copy(points_res.begin(), points_res.end(),
std::ostream_iterator<Point_2>(std::cout, "\n"));
}
Point_equal point_eq(m_geom_traits);
if (! std::equal(points_res.begin(), pit, m_points.begin(), point_eq))
if (! std::equal(points_res.begin(), pit, m_points.begin(), point_eq)) {
std::cout << "Expected: " << std::endl;
std::copy(m_points.begin(), m_points.end(),
std::ostream_iterator<Point_2>(std::cout, "\n"));
std::cout << "Obtained: " << std::endl;
std::copy(points_res.begin(), points_res.end(),
std::ostream_iterator<Point_2>(std::cout, "\n"));
return false;
}
std::vector<X_monotone_curve_2> curves_res(m_arr->number_of_edges());
typename Xcurve_container::iterator xcit = curves_res.begin();
@ -259,13 +276,23 @@ bool Construction_test<T_Geom_traits, T_Topol_traits>::are_same_results()
std::sort(curves_res.begin(), xcit, curve_compare);
if (m_verbose_level > 2) {
std::copy(curves_res.begin(), xcit,
std::ostream_iterator<X_monotone_curve_2>(std::cout, "\n"));
for (typename Xcurve_container::iterator it = curves_res.begin();
it != curves_res.end(); ++it)
std::cout << *it << " " << it->data() << std::endl;
}
Curve_equal curve_eq(m_geom_traits);
if (! std::equal(curves_res.begin(), xcit, m_xcurves.begin(), curve_eq))
if (! std::equal(curves_res.begin(), xcit, m_xcurves.begin(), curve_eq)) {
std::cout << "Expected: " << std::endl;
for (typename Xcurve_container::iterator it = m_xcurves.begin();
it != m_xcurves.end(); ++it)
std::cout << *it << " " << it->data() << std::endl;
std::cout << "Obtained: " << std::endl;
for (typename Xcurve_container::iterator it = curves_res.begin();
it != curves_res.end(); ++it)
std::cout << *it << " " << it->data() << std::endl;
return false;
}
if (m_arr->number_of_faces() == 1) {
Face_const_iterator fit = m_arr->faces_begin();

View File

@ -686,6 +686,18 @@ function(test_construction_spherical_arcs)
compile_and_run_with_flags( test_construction geodesic_arcs_on_sphere "${flags}")
endfunction()
#---------------------------------------------------------------------#
# construction with polylines
#---------------------------------------------------------------------#
function(test_construction_polylines)
set(nt ${CGAL_GMPQ_NT})
set(kernel ${CARTESIAN_KERNEL})
set(geom_traits ${POLYLINE_GEOM_TRAITS})
set(flags "-DTEST_NT=${nt} -DTEST_KERNEL=${kernel} -DTEST_GEOM_TRAITS=${geom_traits}")
compile_and_run_with_flags( test_construction polylines "${flags}")
endfunction()
#---------------------------------------------------------------------#
# overlay with segments
#---------------------------------------------------------------------#
@ -1358,6 +1370,8 @@ test_algebraic_traits_core()
test_algebraic_traits_gmp()
test_algebraic_traits_leda()
compile_and_run(test_data_traits)
compile_and_run(test_insertion)
compile_and_run(test_unbounded_rational_insertion)
compile_and_run(test_unbounded_rational_direct_insertion)
@ -1369,6 +1383,7 @@ compile_and_run(test_vert_ray_shoot_vert_segments)
test_construction_segments()
test_construction_linear_curves()
test_construction_spherical_arcs()
test_construction_polylines()
test_overlay_segments()
test_overlay_spherical_arcs()

View File

@ -873,6 +873,18 @@ test_construction_spherical_arcs()
compile_and_run_with_flags test_construction geodesic_arcs_on_sphere "$flags"
}
#---------------------------------------------------------------------#
# construction with polylines
#---------------------------------------------------------------------#
test_construction_polylines()
{
local nt=$CGAL_GMPQ_NT;
local kernel=$CARTESIAN_KERNEL;
local geom_traits=$POLYLINE_GEOM_TRAITS;
local flags="-DTEST_NT=$nt -DTEST_KERNEL=$kernel -DTEST_GEOM_TRAITS=$geom_traits";
compile_and_run_with_flags test_construction polylines "$flags"
}
#---------------------------------------------------------------------#
# overlay with segments
#---------------------------------------------------------------------#
@ -1686,6 +1698,8 @@ test_algebraic_traits_core
test_algebraic_traits_gmp
test_algebraic_traits_leda
compile_and_run test_data_traits
compile_and_run test_insertion
compile_and_run test_unbounded_rational_insertion
compile_and_run test_unbounded_rational_direct_insertion
@ -1697,6 +1711,7 @@ compile_and_run test_vert_ray_shoot_vert_segments
test_construction_segments
test_construction_linear
test_construction_spherical_arcs
test_construction_polylines
test_overlay_segments
test_overlay_spherical_arcs

View File

@ -0,0 +1 @@
test06 covers the case "Overlap with common ancestors"

View File

@ -0,0 +1,25 @@
3
2 0 0 7 0
3 3 1 4 0 6 0
3 1 0 3 2 5 0
0
7
7
2
0 0
1 0
3 1
4 0
5 0
6 0
7 0
2 0 0 1 0 1
2 1 0 4 0 1
3 1 0 3 2 5 0 1
2 3 1 4 0 1
2 4 0 5 0 2
2 5 0 6 0 2
2 6 0 7 0 1

View File

@ -0,0 +1,27 @@
3
2 0 0 7 0
4 1 0 3 1 4 0 6 0
3 0 -1 3 2 5 0
0
7
8
3
0 -1
0 0
1 0
4 0
5 0
6 0
7 0
2 0 -1 1 0 1
2 0 0 1 0 1
2 1 0 4 0 1
3 1 0 3 1 4 0 1
3 1 0 3 2 5 0 1
2 4 0 5 0 2
2 5 0 6 0 2
2 6 0 7 0 1

View File

@ -0,0 +1,19 @@
3
4 5 0 4 1 3 1 2 1
5 5 0 4 1 3 1 2 1 0 0
3 1 2 3 1 4 1
0
6
5
1
0 0
1 2
2 1
3 1
4 1
5 0
2 2 1 0 0 1
2 1 2 3 1 1
2 2 1 3 1 2
2 3 1 4 1 3
2 4 1 5 0 2

View File

@ -0,0 +1,17 @@
3
4 1 2 2 1 3 1 4 0
4 0 0 2 1 3 1 4 0
2 2 1 3 1
0
5
4
1
0 0
1 2
2 1
3 1
4 0
2 0 0 2 1 1
2 1 2 2 1 1
2 2 1 3 1 3
2 3 1 4 0 2

View File

@ -0,0 +1,25 @@
3
3 0 3 1 2 2 0
3 0 1 1 2 2 0
2 0 2 3 0
0
8
8
2
0 1
0 2
0 3
3/5 8/5
1 2
3/2 1
2 0
3 0
2 0 1 3/5 8/5 1
2 0 2 3/5 8/5 1
2 0 3 1 2 1
2 3/5 8/5 3/2 1 1
2 3/5 8/5 1 2 1
2 1 2 3/2 1 2
2 3/2 1 2 0 2
2 3/2 1 3 0 1

View File

@ -0,0 +1,35 @@
4
3 0 0 2 3 3 0
2 0 3 4 0
3 0 2 2 3 3 0
3 0 1 2 3 3 0
0
11
13
4
0 0
0 1
0 2
0 3
4/5 12/5
8/7 15/7
4/3 2
2 3
8/3 1
3 0
4 0
2 0 0 4/3 2 1
2 0 1 8/7 15/7 1
2 0 2 4/5 12/5 1
2 0 3 4/5 12/5 1
2 4/5 12/5 8/7 15/7 1
2 4/5 12/5 2 3 1
2 8/7 15/7 4/3 2 1
2 8/7 15/7 2 3 1
2 4/3 2 8/3 1 1
2 4/3 2 2 3 1
2 2 3 8/3 1 3
2 8/3 1 3 0 3
2 8/3 1 4 0 1

View File

@ -0,0 +1,54 @@
3
11 0 1 2 1 3 0 5 0 6 1 8 1 9 0 11 0 12 1 14 1 15 0
11 0 0 1 1 3 1 4 0 6 0 7 1 9 1 10 0 12 0 13 1 15 1
12 0 0 1 0 2 1 4 1 5 0 7 0 8 1 10 1 11 0 13 0 14 1 15 1
0
18
26
10
0 0
0 1
1 1
2 1
3 1
4 0
5 0
6 0
7 1
8 1
9 1
10 0
11 0
12 0
13 1
14 1
15 0
15 1
3 0 0 1 0 2 1 1
2 0 0 1 1 1
2 0 1 1 1 1
2 1 1 2 1 2
3 2 1 3 0 4 0 1
2 2 1 3 1 2
2 3 1 4 0 1
3 3 1 4 1 5 0 1
2 4 0 5 0 2
2 5 0 6 0 2
3 5 0 6 1 7 1 1
3 6 0 7 0 8 1 1
2 6 0 7 1 1
2 7 1 8 1 2
3 8 1 9 0 10 0 1
2 8 1 9 1 2
2 9 1 10 0 1
3 9 1 10 1 11 0 1
2 10 0 11 0 2
2 11 0 12 0 2
3 11 0 12 1 13 1 1
3 12 0 13 0 14 1 1
2 12 0 13 1 1
2 13 1 14 1 2
2 14 1 15 0 1
2 14 1 15 1 2

View File

@ -0,0 +1,41 @@
4
4 0 0 4 1 11 1 15 0
6 0 0 1 0 5 1 10 1 14 0 15 0
6 0 0 2 0 6 1 9 1 13 0 15 0
6 0 0 3 0 7 1 8 1 12 0 15 0
0
12
17
7
0 0
1 0
2 0
5 1
6 1
7 1
8 1
9 1
10 1
13 0
14 0
15 0
2 0 0 1 0 3
3 0 0 4 1 5 1 1
2 1 0 2 0 2
2 1 0 5 1 1
3 2 0 3 0 7 1 1
2 2 0 6 1 1
2 5 1 6 1 2
2 6 1 7 1 3
2 7 1 8 1 4
3 8 1 12 0 13 0 1
2 8 1 9 1 3
2 9 1 13 0 1
2 9 1 10 1 2
2 10 1 14 0 1
3 10 1 11 1 15 0 1
2 13 0 14 0 2
2 14 0 15 0 3

View File

@ -0,0 +1,75 @@
4
4 0 4 4 0 13 0 17 4
4 0 3 5 0 12 0 17 3
4 0 2 6 0 11 0 17 2
4 0 1 7 0 10 0 17 1
0
26
37
13
0 1
0 2
0 3
0 4
5/2 3/2
3 1
7/2 1/2
15/4 3/4
35/8 3/8
5 0
21/4 1/4
6 0
7 0
10 0
11 0
47/4 1/4
12 0
101/8 3/8
53/4 3/4
27/2 1/2
14 1
29/2 3/2
17 1
17 2
17 3
17 4
2 0 1 7/2 1/2 1
2 0 2 3 1 1
2 0 3 5/2 3/2 1
2 0 4 5/2 3/2 1
2 5/2 3/2 3 1 1
2 5/2 3/2 15/4 3/4 1
2 3 1 7/2 1/2 1
2 3 1 15/4 3/4 1
3 7/2 1/2 4 0 5 0 1
2 7/2 1/2 35/8 3/8 1
2 15/4 3/4 35/8 3/8 1
2 15/4 3/4 21/4 1/4 1
2 35/8 3/8 5 0 1
2 35/8 3/8 21/4 1/4 1
2 5 0 6 0 2
2 21/4 1/4 6 0 1
2 21/4 1/4 7 0 1
2 6 0 7 0 3
2 7 0 10 0 4
2 10 0 11 0 3
2 10 0 47/4 1/4 1
2 11 0 12 0 2
2 11 0 47/4 1/4 1
2 47/4 1/4 101/8 3/8 1
2 47/4 1/4 53/4 3/4 1
3 12 0 13 0 27/2 1/2 1
2 12 0 101/8 3/8 1
2 101/8 3/8 27/2 1/2 1
2 101/8 3/8 53/4 3/4 1
2 53/4 3/4 14 1 1
2 53/4 3/4 29/2 3/2 1
2 27/2 1/2 17 1 1
2 27/2 1/2 14 1 1
2 14 1 17 2 1
2 14 1 29/2 3/2 1
2 29/2 3/2 17 3 1
2 29/2 3/2 17 4 1

View File

@ -0,0 +1,48 @@
3
4 0 4 4 0 13 0 17 4
4 0 3 5 0 12 0 17 3
4 0 2 6 0 11 0 17 2
0
16
21
7
0 2
0 3
0 4
5/2 3/2
3 1
15/4 3/4
5 0
6 0
11 0
12 0
53/4 3/4
14 1
29/2 3/2
17 2
17 3
17 4
2 0 2 3 1 1
2 0 3 5/2 3/2 1
2 0 4 5/2 3/2 1
2 5/2 3/2 3 1 1
2 5/2 3/2 15/4 3/4 1
3 3 1 4 0 5 0 1
2 3 1 15/4 3/4 1
2 15/4 3/4 5 0 1
2 15/4 3/4 6 0 1
2 5 0 6 0 2
2 6 0 11 0 3
2 11 0 12 0 2
2 11 0 53/4 3/4 1
3 12 0 13 0 14 1 1
2 12 0 53/4 3/4 1
2 53/4 3/4 14 1 1
2 53/4 3/4 29/2 3/2 1
2 14 1 17 2 1
2 14 1 29/2 3/2 1
2 29/2 3/2 17 3 1
2 29/2 3/2 17 4 1

View File

@ -0,0 +1,34 @@
6
1 3 4 0
4 0 5 0
5 0 7 2
0 0 9 0
3 0 6 0
2 0 8 0
0
10
9
1
0 0
1 3
2 0
3 0
4 0
5 0
6 0
7 2
8 0
9 0
0 0 2 0 1
1 3 4 0 1
2 0 3 0 2
3 0 4 0 3
4 0 5 0 4
5 0 6 0 3
5 0 7 2 1
6 0 8 0 2
8 0 9 0 1

View File

@ -0,0 +1,31 @@
5
1 3 4 0
4 0 5 0
0 0 9 0
3 0 6 0
2 0 8 0
0
9
8
1
0 0
1 3
2 0
3 0
4 0
5 0
6 0
8 0
9 0
0 0 2 0 1
1 3 4 0 1
2 0 3 0 2
3 0 4 0 3
4 0 5 0 4
5 0 6 0 3
6 0 8 0 2
8 0 9 0 1

View File

@ -0,0 +1,34 @@
6
1 3 4 0
4 0 5 0
0 0 9 0
3 0 6 0
7 1 8 0
2 0 8 0
0
10
9
1
0 0
1 3
2 0
3 0
4 0
5 0
6 0
7 1
8 0
9 0
0 0 2 0 1
1 3 4 0 1
2 0 3 0 2
3 0 4 0 3
4 0 5 0 4
5 0 6 0 3
6 0 8 0 2
7 1 8 0 1
8 0 9 0 1

View File

@ -0,0 +1,24 @@
4
0 0 4 0
1 0 3 0
2 0 5 0
2 0 3 0
0
6
5
1
0 0
1 0
2 0
3 0
4 0
5 0
0 0 1 0 1
1 0 2 0 2
2 0 3 0 4
3 0 4 0 2
4 0 5 0 1

View File

@ -0,0 +1,9 @@
./data/test_construction/polylines/test01.txt
./data/test_construction/polylines/test02.txt
./data/test_construction/polylines/test03.txt
./data/test_construction/polylines/test04.txt
./data/test_construction/polylines/test05.txt
./data/test_construction/polylines/test06.txt
./data/test_construction/polylines/test07.txt
./data/test_construction/polylines/test08.txt
./data/test_construction/polylines/test09.txt

View File

@ -45,3 +45,6 @@
./data/test_construction/segments/test45.txt
./data/test_construction/segments/test46.txt
./data/test_construction/segments/test47.txt
./data/test_construction/segments/test48.txt
./data/test_construction/segments/test49.txt
./data/test_construction/segments/test50.txt

View File

@ -0,0 +1,57 @@
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Arr_segment_traits_2.h>
#include <CGAL/Arr_curve_data_traits_2.h>
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
typedef Kernel::Point_2 Point_2;
typedef Kernel::Segment_2 Segment_2;
typedef CGAL::Arr_segment_traits_2<Kernel> Segment_traits_2;
typedef CGAL::Arr_curve_data_traits_2<Segment_traits_2, int> Traits_2;
typedef Traits_2::X_monotone_curve_2 X_monotone_curve_2;
int main()
{
Point_2 p1 = Point_2(0.0, 0.0);
Point_2 p2 = Point_2(1.0, 0.0);
Point_2 p3 = Point_2(2.0, 0.0);
Segment_2 s1 = Segment_2(p1, p2);
Segment_2 s2 = Segment_2(p2, p3);
Traits_2 traits;
X_monotone_curve_2 c1 = X_monotone_curve_2(s1, 1234);
X_monotone_curve_2 fc1 = traits.construct_opposite_2_object()(c1);
if (c1.data() != fc1.data()) {
std::cerr << "Construct opposite failed: "
<< c1.data() << " != " << fc1.data() << std::endl;
return 1;
}
std::cout << "Construct opposite data: " << c1.data() << std::endl;
X_monotone_curve_2 c2 = X_monotone_curve_2(s2, 1234);
X_monotone_curve_2 mc;
if (!traits.are_mergeable_2_object()(c1, c2)) return 1;
traits.merge_2_object()(c1, c2, mc);
if (c1.data() != mc.data()) {
std::cerr << "Merge failed: "
<< c1.data() << " != " << mc.data() << std::endl;
return 1;
}
std::cout << "Merge data: " << c1.data() << std::endl;
X_monotone_curve_2 sc1, sc2;
traits.split_2_object()(mc, p2, sc1, sc2);
if (mc.data() != sc1.data()) {
std::cerr << "Split failed (original curve and split curve data differ): "
<< mc.data() << " != " << sc1.data() << std::endl;
return 1;
}
if (sc1.data() != sc2.data()) {
std::cerr << "Split failed (data of split curves differ): "
<< sc1.data() << " != " << sc2.data() << std::endl;
return 1;
}
std::cout << "Split data: " << sc1.data() << std::endl;
return 0;
}

View File

@ -31,8 +31,7 @@ struct Linear_cell_complex_bgl_min_items
\sa `CGAL::Linear_cell_complex_min_item`
*/
class Linear_cell_complex_bgl_min_items {
public:
struct Linear_cell_complex_bgl_min_items {
/// @}

View File

@ -16,8 +16,7 @@ The class `Linear_cell_complex_for_bgl_combinatorial_map_helper` defines a `CGAL
*/
template< typename d, typename d2, typename LCCTraits, typename Alloc >
class Linear_cell_complex_for_bgl_combinatorial_map_helper {
public:
struct Linear_cell_complex_for_bgl_combinatorial_map_helper {
/// Type of the Linear_cell_complex_for_combinatorial_map.
typedef CGAL::Linear_cell_complex_for_combinatorial_map
<d, d2, LCCTraits, CGAL::Linear_cell_complex_bgl_min_items,

View File

@ -8,13 +8,25 @@ maintain faces described by halfedges, to provide access from a face to
an incident halfedge, and to provide access from a halfedge to its incident
face.
\cgalAssociatedTypesBegin
\cgalAssociatedTypeBegin{boost::graph_traits<FaceGraph>::%face_descriptor} A face descriptor corresponds to a unique face in an abstract graph instance.
A face descriptor must be `DefaultConstructible`, `Assignable`, `EqualityComparable`, and `Hashable`.
\cgalAssociatedTypeEnd
\cgalAssociatedTypesEnd
\cgalRefines `HalfedgeGraph`
\cgalHasModel `CGAL::Polyhedron_3`
\cgalHasModel `CGAL::Surface_mesh`
\cgalHasModel `CGAL::Linear_cell_complex_for_combinatorial_map`
*/
class FaceGraph {};
class FaceGraph {
/// Returns a special `boost::graph_traits<HalfedgeGraph>::face_descriptor` object which
/// does not refer to any face of graph object which type is `FaceGraph`.
static boost::graph_traits<HalfedgeGraph>::halfedge_descriptor null_face();
};
/*! \relates FaceGraph
returns the face incident to halfedge `h`.
@ -37,9 +49,3 @@ template <typename FaceGraph>
boost::graph_traits<FaceGraph>::degree_size_type
degree(boost::graph_traits<FaceGraph>::face_descriptor f, const FaceGraph& g);
/*! \relates FaceGraph
returns a special face that is not equal to any other face.
*/
template <typename FaceGraph>
boost::graph_traits<FaceGraph>::face_descriptor
null_face(const FaceGraph& g);

View File

@ -5,6 +5,16 @@
The concept `FaceListGraph` refines the concept `FaceGraph` and adds
the requirement for traversal of all faces in a graph.
\cgalAssociatedTypesBegin
\cgalAssociatedTypeBegin{boost::graph_traits<FaceListGraph>::%face_iterator} A face iterator (obtained via `faces(g)`) provides access to all of the faces in a graph.
A face iterator type must meet the requirements of `MultiPassInputIterator`. The value type of the
face iterator must be the same as the face descriptor of the graph.
\cgalAssociatedTypeEnd
\cgalAssociatedTypesEnd
\cgalRefines `FaceGraph`
\cgalHasModel `CGAL::Polyhedron_3`
\cgalHasModel `CGAL::Surface_mesh`

View File

@ -16,6 +16,24 @@ the same vertex. We refer to \ref PkgBGLIterators for a description of
iterators and circulators for these halfedge cycles.
\cgalAssociatedTypesBegin
\cgalAssociatedTypeBegin{boost::graph_traits<HalfedgeGraph>::%vertex_descriptor} A vertex descriptor corresponds to a unique vertex in an abstract graph instance.
A vertex descriptor must be `DefaultConstructible`, `Assignable`, `EqualityComparable`, and `Hashable`.
\cgalAssociatedTypeEnd
\cgalAssociatedTypeBegin{boost::graph_traits<HalfedgeGraph>::%halfedge_descriptor} A halfedge descriptor corresponds to a unique halfedge in an abstract graph instance.
A halfedge descriptor must be `DefaultConstructible`, `Assignable`, `EqualityComparable`, and `Hashable`.
\cgalAssociatedTypeEnd
\cgalAssociatedTypeBegin{boost::graph_traits<HalfedgeGraph>::%edge_descriptor} An edge descriptor corresponds to a unique edge in an abstract graph instance.
An edge descriptor must be `DefaultConstructible`, `Assignable`, `EqualityComparable`, and `Hashable`.
\cgalAssociatedTypeEnd
\cgalAssociatedTypesEnd
\cgalRefines <A HREF="http://www.boost.org/libs/graph/doc/IncidenceGraph.html">`IncidenceGraph`</A>
\cgalRefines <A HREF="http://www.boost.org/libs/graph/doc/PropertyGraph.html">`PropertyGraph`</A>
@ -24,7 +42,11 @@ A model of `HalfedgeGraph` must have the interior property `vertex_point` attach
\cgalHasModel `CGAL::Polyhedron_3`
\cgalHasModel `CGAL::Surface_mesh`
*/
class HalfedgeGraph {};
class HalfedgeGraph {
/// Returns a special `boost::graph_traits<HalfedgeGraph>::halfedge_descriptor` object which
/// does not refer to any halfedge of graph object which type is `HalfedgeGraph`.
static boost::graph_traits<HalfedgeGraph>::halfedge_descriptor null_halfedge();
};
/*! \relates HalfedgeGraph
returns the edge corresponding to halfedges `h` and `opposite(h,g)`.
@ -92,9 +114,3 @@ template <typename HalfedgeGraph>
boost::graph_traits<HalfedgeGraph>::halfedge_descriptor
prev(boost::graph_traits<HalfedgeGraph>::halfedge_descriptor h, const HalfedgeGraph& g);
/*! \relates HalfedgeGraph
returns a special halfedge that is not equal to any other halfedge.
*/
template <typename HalfedgeGraph>
boost::graph_traits<HalfedgeGraph>::halfedge_descriptor
null_halfedge();

View File

@ -5,6 +5,17 @@
The concept `HalfedgeListGraph` refines the concept `HalfedgeGraph`
and adds the requirements for traversal of all halfedges in the graph.
\cgalAssociatedTypesBegin
\cgalAssociatedTypeBegin{boost::graph_traits<HalfedgeListGraph>::%halfedge_iterator} A halfedge iterator (obtained via `halfedges(g)`) provides access to all of the halfedges in a graph.
A halfedge iterator type must meet the requirements of `MultiPassInputIterator`. The value type of the
halfedge iterator must be the same as the halfedge descriptor of the graph.
\cgalAssociatedTypeEnd
\cgalAssociatedTypesEnd
\cgalRefines `HalfedgeGraph`
\cgalHasModel `CGAL::Polyhedron_3`
\cgalHasModel `CGAL::Surface_mesh`

View File

@ -21,7 +21,7 @@ EXAMPLE_PATH = ${CGAL_Surface_mesh_skeletonization_EXAMPLE_DIR} \
${CGAL_BGL_EXAMPLE_DIR}
ALIASES += "bgllink{1}=<a href=\"http://www.boost.org/libs/graph/doc/\1.html\"><code>\1</code></a>"
ALIASES += "cgalNamedParamsBegin=<dl class=\"params\"><dt>Named Parameters</dt><dd> <table class=\"params\">"
# macros to be used inside the code
ALIASES += "cgalNamedParamsBegin=<dl class=\"params\"><dt>Named Parameters</dt><dd> <table class=\"params\">"
ALIASES += "cgalNamedParamsEnd=</table> </dd> </dl>"
@ -37,3 +37,10 @@ MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES
EXPAND_AS_DEFINED = CGAL_BGL_NP_TEMPLATE_PARAMETERS \
CGAL_BGL_NP_CLASS
# macros to be used inside the code
ALIASES += "cgalAssociatedTypesBegin=<dl class=\"params\"><dt>Associated Types</dt><dd> <table class=\"params\">"
ALIASES += "cgalAssociatedTypesEnd=</table> </dd> </dl>"
ALIASES += "cgalAssociatedTypeBegin{1}=<tr><td class=\"paramname\">\1</td><td>"
ALIASES += "cgalAssociatedTypeEnd=</td></tr>"

View File

@ -55,6 +55,6 @@ include( CGAL_CreateSingleSourceCGALProgram )
if(OpenMesh_FOUND)
create_single_source_cgal_program( "TriMesh.cpp" )
target_link_libraries( TriMesh ${OPENMESH_LIBRARIES} )
target_link_libraries( TriMesh PRIVATE ${OPENMESH_LIBRARIES} )
endif()

View File

@ -68,6 +68,6 @@ create_single_source_cgal_program( "transform_iterator.cpp" )
create_single_source_cgal_program( "copy_polyhedron.cpp" )
if(OpenMesh_FOUND)
target_link_libraries( copy_polyhedron ${OPENMESH_LIBRARIES} )
target_link_libraries( copy_polyhedron PRIVATE ${OPENMESH_LIBRARIES} )
endif()

View File

@ -28,6 +28,11 @@
#include <CGAL/circulator.h>
#include <CGAL/Cartesian_converter.h>
#include <boost/unordered_map.hpp>
#include <CGAL/Constrained_Delaunay_triangulation_2.h>
#include <CGAL/Triangulation_2_projection_traits_3.h>
#include <CGAL/Triangulation_vertex_base_with_info_2.h>
#include <CGAL/Triangulation_face_base_with_info_2.h>
namespace CGAL{
@ -65,6 +70,12 @@ struct Shell_vertex_index_visitor
{}
};
struct FaceInfo2
{
FaceInfo2() : visited(false) {}
bool visited;
};
//Visitor used to collect polygons
template <class Nef_polyhedron>
struct Shell_polygons_visitor
@ -90,21 +101,113 @@ struct Shell_polygons_visitor
typename Nef_polyhedron::Halffacet_const_handle f = opposite_facet->twin();
typename Nef_polyhedron::SHalfedge_around_facet_const_circulator
sfc1(f->facet_cycles_begin());
if (cpp11::next(f->facet_cycles_begin())==f->facet_cycles_end())
{
// create a new polygon
polygons.push_back( std::vector<std::size_t>() );
fc = f->facet_cycles_begin();
se = typename Nef_polyhedron::SHalfedge_const_handle(fc);
CGAL_assertion(se!=0);
typename Nef_polyhedron::SHalfedge_around_facet_const_circulator
hc_start(se), hc_end(hc_start);
// insert the vertex indices of the new polygon
CGAL_For_all(hc_start,hc_end)
polygons.back().push_back(vertex_indices[hc_start->source()->center_vertex()]);
if (!is_marked)
std::reverse(polygons.back().begin(), polygons.back().end());
}
else{
typedef typename Nef_polyhedron::Kernel Kernel;
typedef Triangulation_2_projection_traits_3<Kernel> P_traits;
typedef Triangulation_vertex_base_with_info_2<std::size_t, P_traits> Vb;
typedef Triangulation_face_base_with_info_2<FaceInfo2,P_traits> Fbb;
typedef Constrained_triangulation_face_base_2<P_traits,Fbb> Fb;
typedef Triangulation_data_structure_2<Vb,Fb> TDS;
typedef Exact_predicates_tag Itag;
typedef Constrained_Delaunay_triangulation_2<P_traits, TDS, Itag> CDT;
// create a new polygon
polygons.push_back( std::vector<std::size_t>() );
fc = f->facet_cycles_begin();
se = typename Nef_polyhedron::SHalfedge_const_handle(fc);
CGAL_assertion(se!=0);
typename Nef_polyhedron::SHalfedge_around_facet_const_circulator
hc_start(se), hc_end(hc_start);
// insert the vertex indices of the new polygon
CGAL_For_all(hc_start,hc_end)
polygons.back().push_back(vertex_indices[hc_start->source()->center_vertex()]);
if (!is_marked)
std::reverse(polygons.back().begin(), polygons.back().end());
P_traits p_traits(opposite_facet->plane().orthogonal_vector());
CDT cdt(p_traits);
// insert each connected component of the boundary of the face as
// a polygonal constraints
typename Nef_polyhedron::Halffacet_cycle_const_iterator
hfc_start=f->facet_cycles_begin(), hfc_end=f->facet_cycles_end();
CGAL_For_all(hfc_start, hfc_end)
{
fc=hfc_start;
se = typename Nef_polyhedron::SHalfedge_const_handle(fc);
CGAL_assertion(se!=0);
typename Nef_polyhedron::SHalfedge_around_facet_const_circulator
hc_start(se), hc_end(hc_start);
// collect contour vertices
std::vector< typename CDT::Vertex_handle > polygon;
CGAL_For_all(hc_start,hc_end)
{
typename CDT::Vertex_handle vh=cdt.insert(hc_start->source()->center_vertex()->point());
vh->info() = vertex_indices[hc_start->source()->center_vertex()];
polygon.push_back(vh);
}
std::size_t nb_constraints = polygon.size();
polygon.push_back(polygon.front());
for(std::size_t i=0; i<nb_constraints; ++i)
cdt.insert_constraint(polygon[i], polygon[i+1]);
}
//look for a triangle inside the domain of the face
typename CDT::Face_handle fh = cdt.infinite_face();
fh->info().visited=true;
std::vector<typename CDT::Edge> queue;
for (int i=0; i<3; ++i)
queue.push_back(typename CDT::Edge(fh, i) );
while(true)
{
typename CDT::Edge e = queue.back();
queue.pop_back();
e=cdt.mirror_edge(e);
if (e.first->info().visited) continue;
if (cdt.is_constrained(e))
{
queue.clear();
queue.push_back(e);
break;
}
else
{
for(int i=1; i<3; ++i)
{
typename CDT::Edge candidate(e.first, (e.second+i)%3);
if (!candidate.first->neighbor(candidate.second)->info().visited)
queue.push_back( candidate );
}
e.first->info().visited=true;
}
}
// now extract triangles inside the face
while(!queue.empty())
{
typename CDT::Edge e = queue.back();
queue.pop_back();
if (e.first->info().visited) continue;
e.first->info().visited=true;
polygons.resize(polygons.size()+1);
if (is_marked)
for (int i=2; i>=0; --i)
polygons.back().push_back(e.first->vertex(i)->info());
else
for (int i=0; i<3; ++i)
polygons.back().push_back(e.first->vertex(i)->info());
for(int i=1; i<3; ++i)
{
typename CDT::Edge candidate(e.first, (e.second+i)%3);
if (!cdt.is_constrained(candidate) &&
!candidate.first->neighbor(candidate.second)->info().visited)
{
queue.push_back( cdt.mirror_edge(candidate) );
}
}
}
}
}
void visit(typename Nef_polyhedron::SFace_const_handle)
@ -142,7 +245,8 @@ void collect_polygon_mesh_info(
/// \ingroup PkgBGL
/// Converts an objet of type `Nef_polyhedron_3` into a polygon mesh model of `MutableFaceGraph`.
/// Note that contrary to `Nef_polyhedron_3::convert_to_polyhedron()`, the output is not triangulated.
/// Note that contrary to `Nef_polyhedron_3::convert_to_polyhedron()`, the output is not triangulated
/// (but faces with more than one connected component of the boundary).
/// The polygon mesh can be triangulated using the function `triangulate_faces()`.
/// \pre `Polygon_mesh` must have an internal point property map with value type being `Nef_polyhedron_3::Point_3`.
/// \pre `nef.simple()`

View File

@ -660,7 +660,8 @@ void clear(OpenMesh::PolyMesh_ArrayKernelT<K>& sm)
template<typename K>
bool read_off(std::istream& is, OpenMesh::PolyMesh_ArrayKernelT<K>& sm)
{
return OpenMesh::IO::read_mesh(sm, is, ".OFF");
OpenMesh::IO::Options ropt;
return OpenMesh::IO::read_mesh(sm, is, ".OFF", ropt, false);
}

View File

@ -89,6 +89,10 @@ bool write_off(const char* fname,
return false;
}
template <typename FaceGraph>
bool write_off(const std::string& fname,
const FaceGraph& g)
{ return write_off(fname.c_str(), g); }
namespace internal { namespace read_off_tools {
@ -198,7 +202,11 @@ bool read_off(const char* fname,
return false;
}
template <typename FaceGraph>
bool read_off(const std::string& fname,
FaceGraph& g)
{ return read_off(fname.c_str(), g); }
template <typename FaceGraph>
bool write_inp(std::ostream& os,
const FaceGraph& g,

View File

@ -51,7 +51,7 @@ include( CGAL_CreateSingleSourceCGALProgram )
if(OpenMesh_FOUND)
create_single_source_cgal_program( "graph_concept_OpenMesh.cpp" )
target_link_libraries( graph_concept_OpenMesh ${OPENMESH_LIBRARIES} )
target_link_libraries( graph_concept_OpenMesh PRIVATE ${OPENMESH_LIBRARIES} )
endif()
create_single_source_cgal_program( "next.cpp" )
@ -101,10 +101,10 @@ create_single_source_cgal_program( "test_graph_traits.cpp" )
create_single_source_cgal_program( "test_Properties.cpp" )
if(OpenMesh_FOUND)
target_link_libraries( test_clear ${OPENMESH_LIBRARIES})
target_link_libraries( test_Euler_operations ${OPENMESH_LIBRARIES})
target_link_libraries( test_Face_filtered_graph ${OPENMESH_LIBRARIES})
target_link_libraries( test_graph_traits ${OPENMESH_LIBRARIES} )
target_link_libraries( test_Properties ${OPENMESH_LIBRARIES})
target_link_libraries( test_clear PRIVATE ${OPENMESH_LIBRARIES})
target_link_libraries( test_Euler_operations PRIVATE ${OPENMESH_LIBRARIES})
target_link_libraries( test_Face_filtered_graph PRIVATE ${OPENMESH_LIBRARIES})
target_link_libraries( test_graph_traits PRIVATE ${OPENMESH_LIBRARIES} )
target_link_libraries( test_Properties PRIVATE ${OPENMESH_LIBRARIES})
target_link_libraries( test_bgl_read_write PRIVATE ${OPENMESH_LIBRARIES})
endif()

View File

@ -27,6 +27,8 @@
#include <CGAL/boost/graph/properties_Surface_mesh.h>
#endif
#include <CGAL/boost/graph/io.h>
// ATTN: If you change this kernel remember to also hack
// properties_PolyMesh_ArrayKernelT.h accordingly
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
@ -106,18 +108,17 @@ static const char* data[] =
"data/rombus.off", "data/tetrahedron.off", "data/triangle.off",
"data/triangular_hole.off", "data/cube.off" };
/*
#if defined(CGAL_USE_OPENMESH)
bool read_a_mesh(OMesh& s, const std::string& str) {
return OpenMesh::IO::read_mesh(s, str);
}
#endif
*/
#if defined(CGAL_USE_SURFACE_MESH)
// quick hack to generically read a file
bool read_a_mesh(SM& s, const std::string& str) {
return CGAL::read_off(s, str);
}
#endif
template<typename T>
bool read_a_mesh(T& m, const std::string& str)
{ return CGAL::read_off(str, m); }
bool read_a_mesh(Polyhedron& p, const std::string& str) {
std::ifstream in(str.c_str());
@ -128,17 +129,6 @@ bool read_a_mesh(Polyhedron& p, const std::string& str) {
return success;
}
bool read_a_mesh(LCC& lcc, const std::string& str) {
std::ifstream in(str.c_str());
bool success = in.good();
if(success)
{
CGAL::read_off(in, lcc);
assert(lcc.is_valid());
}
return success;
}
template <typename T>
std::vector<T> t_data()
{

View File

@ -1,5 +1,22 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/boost/graph/graph_traits_Surface_mesh.h>
#include <CGAL/Polyhedron_items_with_id_3.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/Linear_cell_complex_for_bgl_combinatorial_map_helper.h>
#include <CGAL/boost/graph/graph_traits_Linear_cell_complex_for_combinatorial_map.h>
#if defined(CGAL_USE_OPENMESH)
#include <OpenMesh/Core/IO/MeshIO.hh>
#include <OpenMesh/Core/Mesh/PolyMesh_ArrayKernelT.hh>
#include <CGAL/boost/graph/graph_traits_PolyMesh_ArrayKernelT.h>
#endif
#include <CGAL/boost/graph/io.h>
#include <iostream>
@ -7,17 +24,41 @@
typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_3 Point;
typedef CGAL::Surface_mesh<Point> Mesh;
typedef CGAL::Polyhedron_3<Kernel, CGAL::Polyhedron_items_with_id_3> Polyhedron;
int main(int argc, char* argv[])
typedef CGAL::Surface_mesh<Point> SM;
typedef CGAL::Linear_cell_complex_traits<3, Kernel> MyTraits;
typedef CGAL::Linear_cell_complex_for_bgl_combinatorial_map_helper
<2, 3, MyTraits>::type LCC;
#if defined(CGAL_USE_OPENMESH)
typedef OpenMesh::PolyMesh_ArrayKernelT</* MyTraits*/> OMesh;
#endif
template<typename Mesh>
void test_bgl_read_write(const char* filename)
{
Mesh sm;
std::ifstream in((argc>1)?argv[1]:"data/prim.off");
std::ifstream in(filename);
CGAL::read_off(in,sm);
CGAL::write_off(std::cout, sm);
return 0;
}
int main(int argc, char** argv)
{
const char* filename=(argc>1)?argv[1]:"data/prim.off";
test_bgl_read_write<Polyhedron>(filename);
test_bgl_read_write<SM>(filename);
test_bgl_read_write<LCC>(filename);
#ifdef CGAL_USE_OPENMESH
test_bgl_read_write<OMesh>(filename);
#endif
return EXIT_SUCCESS;
}

View File

@ -6,7 +6,7 @@ template<typename Mesh>
void test() {
const std::string fname = "data/7_faces_triangle.off";
Mesh m;
if(!read_a_mesh(m, fname)) {
if(!CGAL::read_off(fname, m)) {
std::cout << "Error reading file: " << fname << std::endl;
}

File diff suppressed because it is too large Load Diff

View File

@ -26,8 +26,7 @@ number-type are `MP_Float`, `CORE::Expr`, and `Gmpq`.)
*/
template< typename K, typename ET >
class Approximate_min_ellipsoid_d_traits_2 {
public:
struct Approximate_min_ellipsoid_d_traits_2 {
/// \name Types
/// @{

View File

@ -27,8 +27,7 @@ number-type are `MP_Float`, `CORE::Expr`, and `Gmpq`.)
*/
template< typename K, typename ET >
class Approximate_min_ellipsoid_d_traits_3 {
public:
struct Approximate_min_ellipsoid_d_traits_3 {
/// \name Types
/// @{

View File

@ -26,8 +26,7 @@ number-type are `MP_Float`, `CORE::Expr`, and `Gmpq`.)
*/
template< typename K, typename ET >
class Approximate_min_ellipsoid_d_traits_d {
public:
struct Approximate_min_ellipsoid_d_traits_d {
/// \name Types
/// @{

View File

@ -18,8 +18,7 @@ functions `min_rectangle_2`, `min_parallelogram_2` and
*/
template< typename K >
class Min_quadrilateral_default_traits_2 {
public:
struct Min_quadrilateral_default_traits_2 {
/// \name Types
/// @{

View File

@ -33,8 +33,7 @@ const-pointer `const B*`, where `B` is a model of the
*/
template< typename BoxHandle >
class Box_traits_d {
public:
struct Box_traits_d {
/// \name Creation
/// @{

6
CGALConfig.cmake Normal file
View File

@ -0,0 +1,6 @@
#
# This file points to the CGALConfig.cmake for a pure header-only
# CGAL installation.
#
include(${CMAKE_CURRENT_LIST_DIR}/Installation/lib/cmake/CGAL/CGALConfig.cmake)

View File

@ -160,12 +160,12 @@ struct NodeInfo {
// Members: private: int refCount,
// public: NodeInfo* nodeInfo,
// filteredFp ffVal.
class ExprRep {
class CGAL_CORE_EXPORT ExprRep {
public:
/// \name Constructor and Destructor
//@{
/// default constructor
CGAL_CORE_EXPORT ExprRep();
ExprRep();
/// virtual destructor for this base class
virtual ~ExprRep() {
if (nodeInfo != NULL) // This check is only for optimization.
@ -197,8 +197,8 @@ public:
/// \name Helper Functions
//@{
/// Get the approximate value
CGAL_CORE_EXPORT const Real & getAppValue(const extLong& relPrec = get_static_defRelPrec(),
const extLong& absPrec = get_static_defAbsPrec());
const Real & getAppValue(const extLong& relPrec = get_static_defRelPrec(),
const extLong& absPrec = get_static_defAbsPrec());
/// Get the sign.
int getSign();
int getExactSign();
@ -433,23 +433,23 @@ public:
/// compute the sign, uMSB, lMSB, etc.
virtual void computeExactFlags() = 0;
/// compute the minimal root bound
CGAL_CORE_EXPORT extLong computeBound();
extLong computeBound();
/// driver function to approximate
CGAL_CORE_EXPORT void approx(const extLong& relPrec, const extLong& absPrec);
void approx(const extLong& relPrec, const extLong& absPrec);
/// compute an approximate value satifying the specified precisions
virtual void computeApproxValue(const extLong&, const extLong&) = 0;
/// Test whether the current approx. value satisfies [relPrec, absPrec]
CGAL_CORE_EXPORT bool withinKnownPrecision(const extLong&, const extLong&);
bool withinKnownPrecision(const extLong&, const extLong&);
//@}
/// \name Misc Functions
//@{
/// reduce current node
CGAL_CORE_EXPORT void reduceToBigRat(const BigRat&);
void reduceToBigRat(const BigRat&);
/// reduce current node
CGAL_CORE_EXPORT void reduceTo(const ExprRep*);
void reduceTo(const ExprRep*);
/// reduce current node to zero
CGAL_CORE_EXPORT void reduceToZero();
void reduceToZero();
/// return operator string
virtual const std::string op() const {
return "UNKNOWN";
@ -459,7 +459,7 @@ public:
/// \name Degree Bound Functions
//@{
/// compute "d_e" based on # of sqrts
CGAL_CORE_EXPORT extLong degreeBound();
extLong degreeBound();
/// count actually computes the degree bound of current node.
virtual extLong count() = 0;
/// reset the flag "visited"
@ -473,7 +473,7 @@ public:
/// \class ConstRep
/// \brief constant node
class ConstRep : public ExprRep {
class CGAL_CORE_EXPORT ConstRep : public ExprRep {
public:
/// \name Constructors and Destructor
//@{
@ -486,20 +486,20 @@ public:
/// \name Debug Functions
//@{
/// print debug information in list mode
CGAL_CORE_EXPORT void debugList(int level, int depthLimit) const;
void debugList(int level, int depthLimit) const;
/// print debug information in tree mode
CGAL_CORE_EXPORT void debugTree(int level, int indent, int depthLimit) const;
void debugTree(int level, int indent, int depthLimit) const;
//@}
protected:
/// initialize nodeInfo
CGAL_CORE_EXPORT virtual void initNodeInfo();
virtual void initNodeInfo();
/// return operator in string
const std::string op() const {
return "C";
}
/// count returns the degree of current node
//extLong count() { return d_e(); }
CGAL_CORE_EXPORT extLong count();
extLong count();
/// clear visited flag
void clearFlag() {
visited() = false;

View File

@ -1,33 +1,18 @@
include(CGAL_SetupCGAL_CoreDependencies)
message("Configuring libCGAL_Core")
if(CGAL_Core_FOUND)
use_essential_libs()
collect_cgal_library(CGAL_Core "")
if (NOT MSVC)
# See the release notes of CGAL-4.10: CGAL_Core now requires
# Boost.Thread, with all compilers but MSVC.
find_package( Boost 1.48 REQUIRED thread system )
cache_set(CGAL_Core_3RD_PARTY_LIBRARIES ${CGAL_Core_3RD_PARTY_LIBRARIES} ${Boost_LIBRARIES} )
endif(NOT MSVC)
if(CGAL_HEADER_ONLY)
set(keyword INTERFACE)
else()
set(keyword PUBLIC)
endif()
include_directories (SYSTEM ${CGAL_3RD_PARTY_INCLUDE_DIRS})
CGAL_setup_CGAL_Core_dependencies(CGAL_Core ${keyword})
add_definitions(${CGAL_3RD_PARTY_DEFINITIONS})
link_directories ( ${CGAL_LIBRARIES_DIR} ${CGAL_3RD_PARTY_LIBRARIES_DIRS} )
collect_cgal_library(CGAL_Core "")
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} )
target_link_libraries( CGAL_Core ${CGAL_Core_3RD_PARTY_LIBRARIES} )
add_dependencies( CGAL_Core CGAL )
else()
target_link_libraries( CGAL_Core INTERFACE ${CGAL_3RD_PARTY_LIBRARIES} )
target_link_libraries( CGAL_Core INTERFACE ${CGAL_Core_3RD_PARTY_LIBRARIES} )
message("libCGAL_Core is configured")
endif()
message("libCGAL_Core is configured")

View File

@ -1,52 +1,22 @@
message("Configuring libCGAL_ImageIO")
find_package( ZLIB )
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()
use_essential_libs()
if (CGAL_HEADER_ONLY)
cache_set(CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS ${CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR})
else()
include_directories( SYSTEM ${CGAL_3RD_PARTY_INCLUDE_DIRS} ${CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS} )
link_directories ( ${CGAL_LIBRARIES_DIR} ${CGAL_3RD_PARTY_LIBRARIES_DIRS} )
add_definitions ( ${CGAL_3RD_PARTY_DEFINITIONS} ${CGAL_ImageIO_3RD_PARTY_DEFINITIONS} )
endif()
collect_cgal_library( CGAL_ImageIO "")
if (NOT CGAL_HEADER_ONLY)
include(CGAL_SetupCGAL_ImageIODependencies)
add_dependencies( CGAL_ImageIO CGAL )
if(CGAL_HEADER_ONLY)
set(keyword "INTERFACE")
endif()
# 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} )
CGAL_setup_CGAL_ImageIO_dependencies(CGAL_ImageIO ${keyword})
else()
target_link_libraries( CGAL_ImageIO INTERFACE ${CGAL_3RD_PARTY_LIBRARIES} ${CGAL_ImageIO_3RD_PARTY_LIBRARIES} )
target_include_directories( CGAL_ImageIO INTERFACE ${CGAL_3RD_PARTY_LIBRARIES_DIRS})
if(COMMAND add_config_flag)
set( CGAL_HAS_IMAGEIO TRUE )
add_config_flag( CGAL_HAS_IMAGEIO )
endif()
if(ZLIB_FOUND)
get_dependency_version(ZLIB)
endif()
message("libCGAL_ImageIO is configured")
if(NOT ZLIB_FOUND)
message( STATUS "NOTICE: libCGAL_ImageIO needs ZLib to read compressed files. That feature will not be activated.")
endif()

View File

@ -125,22 +125,28 @@ if ( CGAL_FOUND )
message(STATUS "Set Ipelets install dir: ${IPELET_INSTALL_DIR}")
endif()
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
foreach(IPELET ${CGAL_IPELETS})
add_library(CGAL_${IPELET} MODULE ${IPELET}.cpp)
add_to_cached_list(CGAL_EXECUTABLE_TARGETS CGAL_${IPELET})
target_link_libraries(CGAL_${IPELET} ${IPE_LIBRARIES})
target_link_libraries(CGAL_${IPELET} PRIVATE CGAL::CGAL ${IPE_LIBRARIES})
if ( IPELET_INSTALL_DIR )
install(TARGETS CGAL_${IPELET} DESTINATION ${IPELET_INSTALL_DIR})
if (WITH_IPE_7)
install(FILES ./lua/libCGAL_${IPELET}.lua DESTINATION ${IPELET_INSTALL_DIR}) #only for ipe 7
endif()
endif ()
cgal_add_compilation_test(CGAL_${IPELET})
endforeach(IPELET)
target_link_libraries(CGAL_cone_spanners PRIVATE CGAL::CGAL_Core)
#example in doc not installed
add_library(simple_triangulation MODULE simple_triangulation.cpp)
add_to_cached_list(CGAL_EXECUTABLE_TARGETS simple_triangulation)
target_link_libraries(simple_triangulation ${IPE_LIBRARIES})
cgal_add_compilation_test(simple_triangulation)
else()
message(STATUS "NOTICE: This program requires the Ipe include files and library, and will not be compiled.")
endif()

View File

@ -8,6 +8,7 @@ cmake_minimum_required(VERSION 2.8.11)
set( CGAL_BRANCH_BUILD ON CACHE INTERNAL "Create CGAL from a Git branch" FORCE)
include(${CMAKE_SOURCE_DIR}/Installation/cmake/modules/CGAL_SCM.cmake)
CGAL_detect_git(${CMAKE_SOURCE_DIR})
# add option for duplicate file detection
option( CGAL_REPORT_DUPLICATE_FILES "Switch on to start (naive) detection of duplicate source- and headerfiles in packages" OFF)

View File

@ -1803,10 +1803,21 @@ namespace CartesianKernelFunctors {
result_type
operator()(const Triangle_2& t) const
{
Bbox_2 bb = this->operator()(t.vertex(0));
bb += this->operator()(t.vertex(1));
bb += this->operator()(t.vertex(2));
return bb;
/*
Microsoft (R) C/C++ Optimizing Compiler Version 18.00.40629.0 for x64
produces a segfault of this functor for Simple_cartesian<Interval_nt<0>>
with the original version of the code below
Note that it also worked for 18.00.21005.1
typename K::Construct_bbox_2 construct_bbox_2;
return construct_bbox_2(t.vertex(0))
+ construct_bbox_2(t.vertex(1))
+ construct_bbox_2(t.vertex(2));
*/
}
result_type

View File

@ -8,8 +8,7 @@ namespace CGAL {
*/
template< typename RT >
class Algebraic_kernel_for_circles_2_2 {
public:
struct Algebraic_kernel_for_circles_2_2 {
/// @}

View File

@ -24,8 +24,7 @@ manipulation of algebraic curves.
*/
template< typename Kernel, typename AlgebraicKernelForCircles >
class Circular_kernel_2 : public Kernel {
public:
struct Circular_kernel_2 : public Kernel {
/// \name Types
/// The circular kernel uses basic number types of the algebraic

View File

@ -11,10 +11,9 @@ include(${CGAL_USE_FILE})
find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL)
find_package(OpenGL)
find_package(QGLViewer)
if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND )
if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND QGLVIEWER_FOUND )
include_directories (${QGLVIEWER_INCLUDE_DIR})
@ -22,16 +21,20 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_
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)
add_to_cached_list( CGAL_EXECUTABLE_TARGETS Circular_kernel_3 )
target_link_libraries( Circular_kernel_3 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES})
target_link_libraries( Circular_kernel_3 ${QT_LIBRARIES} ${QGLVIEWER_LIBRARIES} )
target_link_libraries( Circular_kernel_3 ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY})
target_link_libraries( Circular_kernel_3 PRIVATE
CGAL::CGAL CGAL::CGAL_Qt5
Qt5::OpenGL Qt5::Gui ${QGLVIEWER_LIBRARIES} )
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Circular_kernel_3)
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Circular_kernel_3)
else()
message(STATUS "NOTICE: This demo requires CGAL, the QGLViewer, OpenGL and Qt5, and will not be compiled.")
message(STATUS "NOTICE: This demo requires CGAL, the QGLViewer, and Qt5, and will not be compiled.")
endif()

View File

@ -860,10 +860,10 @@ void Viewer::init()
compile_shaders();
compute_elements();
initialize_buffers();
::glEnable(GL_BLEND);
glEnable(GL_BLEND);
::glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
::glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_POINT_SMOOTH);
glEnable(GL_LINE_SMOOTH);

View File

@ -8,8 +8,7 @@ namespace CGAL {
*/
template< typename RT >
class Algebraic_kernel_for_spheres_2_3 {
public:
struct Algebraic_kernel_for_spheres_2_3 {
/// @}

View File

@ -24,8 +24,7 @@ manipulation of algebraic curves.
*/
template< typename Kernel, typename AlgebraicKernelForSpheres >
class Spherical_kernel_3 : public Kernel {
public:
struct Spherical_kernel_3 : public Kernel {
/// \name Types
/// The spherical kernel uses basic number types of the algebraic

View File

@ -340,8 +340,7 @@ void bar( IC i, IC j) { // calls the correct function
*/
template< typename C >
class Circulator_traits {
public:
struct Circulator_traits {
/// \name Types
/// @{

View File

@ -32,11 +32,6 @@ if ( NOT Boost_FOUND )
endif()
find_package( TBB )
if( TBB_FOUND )
include(${TBB_USE_FILE})
list(APPEND CGAL_3RD_PARTY_LIBRARIES ${TBB_LIBRARIES})
endif()
find_package(OpenCV QUIET)
@ -54,13 +49,16 @@ include( CGAL_CreateSingleSourceCGALProgram )
set(needed_cxx_features cxx_rvalue_references cxx_variadic_templates)
create_single_source_cgal_program( "example_classification.cpp" CXX_FEATURES ${needed_cxx_features} )
if(TBB_FOUND)
CGAL_target_use_TBB(example_classification)
endif()
create_single_source_cgal_program( "example_generation_and_training.cpp" CXX_FEATURES ${needed_cxx_features} )
create_single_source_cgal_program( "example_feature.cpp" CXX_FEATURES ${needed_cxx_features} )
if( OpenCV_FOUND )
include_directories( ${OpenCV_INCLUDE_DIRS} )
create_single_source_cgal_program( "example_random_forest.cpp" CXX_FEATURES ${needed_cxx_features} )
target_link_libraries( example_random_forest ${OpenCV_LIBS} )
target_link_libraries( example_random_forest PRIVATE ${OpenCV_LIBS} )
else()
message(STATUS "OpenCV not found, random forest example won't be compiled.")
endif()

View File

@ -38,10 +38,6 @@ if ( NOT Boost_FOUND )
endif()
find_package( TBB )
if( TBB_FOUND )
include(${TBB_USE_FILE})
list(APPEND CGAL_3RD_PARTY_LIBRARIES ${TBB_LIBRARIES})
endif()
# include for local directory
include_directories( BEFORE include )
@ -60,3 +56,6 @@ include( CGAL_CreateSingleSourceCGALProgram )
set(needed_cxx_features cxx_rvalue_references cxx_variadic_templates)
create_single_source_cgal_program( "test_classification_point_set.cpp" CXX_FEATURES ${needed_cxx_features} )
if(TBB_FOUND)
CGAL_target_use_TBB( test_classification_point_set )
endif()

View File

@ -31,8 +31,7 @@ struct Combinatorial_map_min_items
*/
template< unsigned int d >
class Combinatorial_map_min_items {
public:
struct Combinatorial_map_min_items {
/// @}

View File

@ -10,8 +10,7 @@ The class `Dart` represents a <I>d</I>D dart in a combinatorial map.
*/
template< typename d, typename CMap >
class Dart {
public:
struct Dart {
/*!
*/

View File

@ -25,8 +25,7 @@ struct Generic_map_min_items
\sa `Generalized_map<d,Items,Alloc>`
*/
class Generic_map_min_items {
public:
struct Generic_map_min_items {
/// @}

View File

@ -713,18 +713,18 @@ namespace CGAL
typename CMap::Dart_handle d1, d2;
typename CMap::Dart_handle dg1=amap.null_handle, dg2=amap.null_handle;
typename CMap::size_type mark = amap.get_new_mark();
typename CMap::size_type amark = amap.get_new_mark();
// First we store and mark all the darts of the 1-cell to contract.
std::deque<typename CMap::Dart_handle> to_erase;
for ( CGAL::CMap_dart_iterator_basic_of_cell<CMap,1> it(amap,adart,mark);
for ( CGAL::CMap_dart_iterator_basic_of_cell<CMap,1> it(amap,adart,amark);
it.cont(); ++it )
{
to_erase.push_back(it);
if ( dg1==amap.null_handle && !amap.template is_free<0>(it) &&
!amap.template is_free<1>(it) )
{ dg1=amap.template beta<0>(it); dg2=amap.template beta<1>(it); }
amap.mark(it, mark);
amap.mark(it, amark);
++res;
}
@ -757,7 +757,8 @@ namespace CGAL
if ( (*it)->beta(0)!=(*it)->beta(1) )*/
if ( amap.are_attributes_automatically_managed() && update_attributes )
{
modified_darts.push_back(amap.template beta<1>(*it));
if (!amap.is_marked(amap.template beta<1>(*it), amark))
{ modified_darts.push_back(amap.template beta<1>(*it)); }
}
amap.basic_link_beta_1(amap.template beta<0>(*it),
amap.template beta<1>(*it));
@ -767,7 +768,8 @@ namespace CGAL
{
if ( amap.are_attributes_automatically_managed() && update_attributes )
{
modified_darts2.push_back(amap.template beta<0>(*it));
if (!amap.is_marked(amap.template beta<0>(*it), amark))
{ modified_darts2.push_back(amap.template beta<0>(*it)); }
}
amap.template dart_unlink_beta<1>(amap.template beta<0>(*it));
}
@ -778,7 +780,8 @@ namespace CGAL
{
if ( amap.are_attributes_automatically_managed() && update_attributes )
{
modified_darts.push_back(amap.template beta<1>(*it));
if (!amap.is_marked(amap.template beta<1>(*it), amark))
{ modified_darts.push_back(amap.template beta<1>(*it)); }
}
amap.template dart_unlink_beta<0>(amap.template beta<1>(*it));
}
@ -789,8 +792,8 @@ namespace CGAL
for ( it=to_erase.begin(); it!=to_erase.end(); ++it )
{ amap.erase_dart(*it); }
CGAL_assertion( amap.is_whole_map_unmarked(mark) );
amap.free_mark(mark);
CGAL_assertion( amap.is_whole_map_unmarked(amark) );
amap.free_mark(amark);
if ( amap.are_attributes_automatically_managed() && update_attributes )
{

View File

@ -30,6 +30,7 @@
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Combinatorial_map_functors.h>
#include <algorithm>
#include <map>
@ -40,6 +41,8 @@
namespace CGAL {
typedef Exact_predicates_inexact_constructions_kernel::Point_2 RPoint_2;
typedef Exact_predicates_exact_constructions_kernel::Point_2 EPoint_2;
typedef Exact_predicates_inexact_constructions_kernel::Point_3 RPoint_3;
typedef Exact_predicates_exact_constructions_kernel::Point_3 EPoint_3;
@ -126,6 +129,20 @@ namespace CGAL {
const std::string& val)
{node.add("v",val);}
inline
void write_cmap_attribute_node(boost::property_tree::ptree & node,
const RPoint_2& val)
{
node.add("p.x",val.x());
node.add("p.y",val.y());
}
inline
void write_cmap_attribute_node(boost::property_tree::ptree & node,
const EPoint_2& val)
{
node.add("p.x",CGAL::to_double(val.x()));
node.add("p.y",CGAL::to_double(val.y()));
}
inline
void write_cmap_attribute_node(boost::property_tree::ptree & node,
const RPoint_3& val)
{
@ -167,7 +184,7 @@ namespace CGAL {
boost::property_tree::ptree& ndim = ptree.add("dimension", "");
ndim.put("<xmlattr>.index", i);
ndim.add("type", typeid(typename CMap::template Attribute_type<i>::type::Info).name());
ndim.add("type_point", typeid(RPoint_3).name());
ndim.add("type_point", typeid(typename CMap::Point).name());
// for every attribute of the dimension
for (; it_attrib!=itend_attrib; ++it_attrib)
@ -202,7 +219,7 @@ namespace CGAL {
boost::property_tree::ptree& ndim = ptree.add("dimension", "");
ndim.put("<xmlattr>.index", i);
ndim.add("type", "void");
ndim.add("type_point", typeid(RPoint_3).name());
ndim.add("type_point", typeid(typename CMap::Point).name());
// for every attribute of the dimension
for (; it_attrib!=itend_attrib; ++it_attrib)
@ -355,13 +372,26 @@ namespace CGAL {
return pt;
}
template < class CMap >
bool save_combinatorial_map(const CMap& amap, std::ostream & output)
struct EmptyFunctor
{
void operator() (boost::property_tree::ptree & /*node*/) const
{
// node.add("myinfo.myvalie",15);
}
};
template < class CMap, class Functor >
bool save_combinatorial_map(const CMap& amap, std::ostream & output,
const Functor& f)
{
using boost::property_tree::ptree;
ptree tree;
tree.put("data", "");
/** First we save general information of the map (by default nothing,
the fuction can be specialized by users). */
f(tree);
// map dart => number
std::map<typename CMap::Dart_const_handle, typename CMap::size_type> myDarts;
@ -379,14 +409,29 @@ namespace CGAL {
return true;
}
template < class CMap >
bool save_combinatorial_map(const CMap& amap, const char* filename)
template < class CMap, class Functor >
bool save_combinatorial_map(const CMap& amap, const char* filename,
const Functor& f)
{
std::ofstream output(filename);
if (!output) return false;
return save_combinatorial_map(amap, output);
return save_combinatorial_map(amap, output, f);
}
template < class CMap >
bool save_combinatorial_map(const CMap& amap, std::ostream & output)
{
EmptyFunctor f;
return save_combinatorial_map(amap, output, f);
}
template < class CMap >
bool save_combinatorial_map(const CMap& amap, const char* filename)
{
EmptyFunctor f;
return save_combinatorial_map(amap, filename, f);
}
// Here T is a Dart_handle so no need of &
template<typename T>
void read_cmap_dart_node
@ -450,6 +495,14 @@ namespace CGAL {
{val=boost::lexical_cast< std::string >(v.second.data());}
template<> inline
void read_cmap_attribute_node
(const boost::property_tree::ptree::value_type &v,RPoint_2 &val)
{
double x=v.second.get<double>("x");
double y=v.second.get<double>("y");
val = RPoint_2(x,y);
}
template<> inline
void read_cmap_attribute_node
(const boost::property_tree::ptree::value_type &v,RPoint_3 &val)
{
double x=v.second.get<double>("x");
@ -771,26 +824,47 @@ namespace CGAL {
<My_functor_cmap_load_attrib<CMap> >::run(pt, amap, myDarts);
}
template < class CMap >
bool load_combinatorial_map(std::ifstream & input, CMap& amap)
template < class CMap, class Functor >
bool load_combinatorial_map(std::ifstream & input, CMap& amap,
Functor& f)
{
using boost::property_tree::ptree;
ptree pt;
read_xml(input, pt);
/** First we load general information of the map (by default nothing,
the fuction can be specialized by users). */
f(pt);
// Then we load darts and attributes.
std::vector<typename CMap::Dart_handle> myDarts;
cmap_load_darts(pt,amap,myDarts);
cmap_load_attributes(pt,amap,myDarts);
return true;
}
template < class CMap >
bool load_combinatorial_map(const char* filename, CMap& amap)
template < class CMap, class Functor >
bool load_combinatorial_map(const char* filename, CMap& amap,
Functor& f)
{
std::ifstream input(filename);
if (!input) return false;
return load_combinatorial_map(input, amap);
return load_combinatorial_map(input, amap, f);
}
template < class CMap >
bool load_combinatorial_map(std::ifstream & input, CMap& amap)
{
EmptyFunctor f;
return load_combinatorial_map(input, amap, f);
}
template < class CMap >
bool load_combinatorial_map(const char* filename, CMap& amap)
{
EmptyFunctor f;
return load_combinatorial_map(filename, amap, f);
}
} // namespace CGAL
#endif // CGAL_COMBINATORIAL_MAP_SAVE_LOAD_H //

View File

@ -347,7 +347,7 @@ namespace CGAL {
// Get the dart of the i-cell attribute associated with the given dart
template<unsigned int i>
Dart_handle & dart(Dart_handle adart)
Dart_handle dart(Dart_handle adart)
{
CGAL_assertion( adart!=NULL );
CGAL_assertion( attribute<i>(adart)!=NULL );

View File

@ -69,6 +69,6 @@ if(OpenMesh_FOUND)
create_single_source_cgal_program( "quickhull_OM_3.cpp" )
create_single_source_cgal_program( "dynamic_hull_OM_3.cpp" )
target_link_libraries( quickhull_OM_3 ${OPENMESH_LIBRARIES} )
target_link_libraries( dynamic_hull_OM_3 ${OPENMESH_LIBRARIES} )
target_link_libraries( quickhull_OM_3 PRIVATE ${OPENMESH_LIBRARIES} )
target_link_libraries( dynamic_hull_OM_3 PRIVATE ${OPENMESH_LIBRARIES} )
endif()

View File

@ -17,8 +17,7 @@ low-dimensional standard kernel model, e.g. `Homogeneous<RT>` or
*/
template< typename R >
class Convex_hull_d_traits_3 {
public:
struct Convex_hull_d_traits_3 {
/// \name Creation
/// @{

View File

@ -320,14 +320,13 @@ employing the authors) of this work,
are allowed in \cgal), and a pointer to the file containing its text in the
\cgal distribution,
<LI>a disclaimer notice,
<LI>then, there are 2 keywords, which are automatically expanded by SVN
(there are options in SVN to suppress these expansions if you need):
<LI>then, there are 2 keywords, which are automatically expanded at the creation of a new release:
<UL>
<LI>\$URL: \$ : the name of the source file in the repository, it also
helps figuring out which package the file comes from,
<LI>\$Id: \$ : the SVN revision number of the file, the date of this revision,
and the author of the last commit.
<LI>\$URL\$ : canonical path to the file on github,
<LI>\$Id\$ : the release version the file is from.
</UL>
<LI> Then [SPDX license identifier](https://spdx.org/). For GPL-3+ it should be `SPDX-License-Identifier: GPL-3.0+`,
and `SPDX-License-Identifier: LGPL-3.0+` for LGPL-3+.
<LI>Then the authors of (non-negligible parts of) this file are listed, with
optional affiliation or e-mail address.
</UL>
@ -362,9 +361,9 @@ Here follows what this gives for a file under the GPL :
// 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: svn+ssh://pmoeller@scm.gforge.inria.fr/svn/cgal/branches/features/doxy-port-pmoeller/Developers_manual/doc_tex/Developers_manual/code_format.tex $
// $Id: code_format.tex 70968 2012-08-02 12:55:15Z pmoeller $
//
// $URL$
// $Id$
// SPDX-License-Identifier: GPL-3.0+
//
// Author(s) : Monique Teillaud <Monique.Teillaud@sophia.inria.fr>
// Sylvain Pion
@ -392,9 +391,9 @@ Here follows what this gives for a file under the LGPL :
// 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: svn+ssh://pmoeller@scm.gforge.inria.fr/svn/cgal/branches/features/doxy-port-pmoeller/Developers_manual/doc_tex/Developers_manual/code_format.tex $
// $Id: code_format.tex 70968 2012-08-02 12:55:15Z pmoeller $
//
// $URL$
// $Id$
// SPDX-License-Identifier: LGPL-3.0+
//
// Author(s) : Herve Bronnimann, Sylvain Pion
\endcode

View File

@ -323,7 +323,7 @@ variable `BUILD_SHARED_LIBS` to `FALSE`. If you use
\subsection subsection_headeronly Header-only option
Since \cgal 4.9, \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 demos. This possibility can be enabled by setting the value of the CMake variable `CGAL_HEADER_ONLY` to `ON`. CMake version 3.0.0 or higher is required to use this option.
Since \cgal 4.11, \cgal can be used in header-only mode, i.e. without configuring nor building any \cgal library. In this case, the program using \cgal (example, test, demo, etc.) must be directly configured using CMake. The variable `CGAL_DIR` must point to the root directory of the CGAL source code.
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:

View File

@ -21,7 +21,6 @@
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="$relpath^../Manual/search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="$relpath^../Manual/search/searchdata.js"></script>

View File

@ -1,7 +1,7 @@
#!/bin/bash
if [ "$1" == '--help' ]; then
echo "Usage: $0 <doc 1> [doc 2]"
exho "doc 1 and doc 2 are paths to doxygen outputs (doc_output)."
echo "doc 1 and doc 2 are paths to doxygen outputs (doc_output)."
echo "Parse the xml output of doc 1 and creates a directory with organized text files."
echo "Then, if doc_2 is specified, do the same for its xml output and make the diff between them."
exit 0

Some files were not shown because too many files have changed in this diff Show More