Merge CGAL/master to get rid of the dependency to QGLViewer

This commit is contained in:
Maxime Gimeno 2018-06-11 12:10:57 +02:00
commit 4e8264b109
625 changed files with 30975 additions and 13768 deletions

View File

@ -53,7 +53,7 @@ env:
compiler: clang-3.6
install:
- echo "$PWD"
- if [ -n "$TRAVIS_PULL_REQUEST" ] && [ "$PACKAGE" != CHECK ]; then DO_IGNORE=FALSE; for ARG in $(echo "$PACKAGE");do . $PWD/.travis/test_package.sh "$PWD" "$ARG"; echo "DO_IGNORE is $DO_IGNORE"; if [ "$DO_IGNORE" = "TRUE" ]; then travis_terminate 0; fi; done;fi
- if [ -n "$TRAVIS_PULL_REQUEST" ] && [ "$PACKAGE" != CHECK ]; then DO_IGNORE=FALSE; for ARG in $(echo "$PACKAGE");do if [ "$ARG" = "Maintenance" ]; then continue; fi; . $PWD/.travis/test_package.sh "$PWD" "$ARG"; echo "DO_IGNORE is $DO_IGNORE"; if [ "$DO_IGNORE" = "FALSE" ]; then break; fi; done; if [ "$DO_IGNORE" = "TRUE" ]; then travis_terminate 0; fi;fi
- bash .travis/install.sh
- export CXX=clang++-3.6 CC=clang-3.6;
before_script:
@ -68,7 +68,7 @@ before_script:
- cd ..
script:
- cd ./.travis
- bash -x -e ./build_package.sh $PACKAGE
- bash ./build_package.sh $PACKAGE
notifications:
email:
on_success: change # default: always

View File

@ -1,5 +1,6 @@
#!/bin/bash
set -e
[ -n "$CGAL_DEBUG_TRAVIS" ] && set -x
CXX_FLAGS="-DCGAL_NDEBUG"
@ -53,6 +54,10 @@ ROOT="$PWD/.."
NEED_3D=0
for ARG in $(echo "$@")
do
#skip package maintenance
if [ "$ARG" = "Maintenance" ]; then
continue
fi
cd $ROOT
#install openmesh only if necessary
if [ "$ARG" = "CHECK" ] || [ "$ARG" = BGL ] || [ "$ARG" = Convex_hull_3 ] ||\
@ -72,7 +77,8 @@ cd $ROOT
zsh $ROOT/Scripts/developer_scripts/test_merge_of_branch HEAD
#test dependencies
cd $ROOT
bash Scripts/developer_scripts/cgal_check_dependencies.sh /usr/bin/doxygen
bash Scripts/developer_scripts/cgal_check_dependencies.sh --check_headers /usr/bin/doxygen
cd .travis
#parse current matrix and check that no package has been forgotten

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -x
[ -n "$CGAL_DEBUG_TRAVIS" ] && set -x
DONE=0
while [ $DONE = 0 ]
do

View File

@ -10,7 +10,7 @@ env:
compiler: clang-3.6
install:
- echo "$PWD"
- if [ -n "$TRAVIS_PULL_REQUEST" ] && [ "$PACKAGE" != CHECK ]; then DO_IGNORE=FALSE; for ARG in $(echo "$PACKAGE");do . $PWD/.travis/test_package.sh "$PWD" "$ARG"; echo "DO_IGNORE is $DO_IGNORE"; if [ "$DO_IGNORE" = "TRUE" ]; then travis_terminate 0; fi; done;fi
- if [ -n "$TRAVIS_PULL_REQUEST" ] && [ "$PACKAGE" != CHECK ]; then DO_IGNORE=FALSE; for ARG in $(echo "$PACKAGE");do if [ "$ARG" = "Maintenance" ]; then continue; fi; . $PWD/.travis/test_package.sh "$PWD" "$ARG"; echo "DO_IGNORE is $DO_IGNORE"; if [ "$DO_IGNORE" = "FALSE" ]; then break; fi; done; if [ "$DO_IGNORE" = "TRUE" ]; then travis_terminate 0; fi;fi
- bash .travis/install.sh
- export CXX=clang++-3.6 CC=clang-3.6;
before_script:
@ -25,7 +25,7 @@ before_script:
- cd ..
script:
- cd ./.travis
- bash -x -e ./build_package.sh $PACKAGE
- bash ./build_package.sh $PACKAGE
notifications:
email:
on_success: change # default: always

View File

@ -27,14 +27,8 @@ find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Gui Svg)
include( ${CGAL_USE_FILE} )
# Find QGLViewer
if(Qt5_FOUND)
find_package(QGLViewer)
endif(Qt5_FOUND)
if(CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND QGLVIEWER_FOUND)
include_directories ( ${QGLVIEWER_INCLUDE_DIR} )
if(CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND)
qt5_wrap_ui( UI_FILES MainWindow.ui )
@ -55,20 +49,22 @@ if(CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND QGLVIEWER_FOUND)
"${CMAKE_CURRENT_BINARY_DIR}/Viewer_moc.cpp"
"${CMAKE_CURRENT_BINARY_DIR}/Scene_moc.cpp" )
add_executable ( AABB_demo AABB_demo.cpp ${UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
add_executable ( AABB_demo AABB_demo.cpp ${UI_FILES} ${CGAL_Qt5_RESOURCE_FILES}
#${CGAL_Qt5_MOC_FILES}
)
# Link with Qt libraries
target_link_libraries( AABB_demo PRIVATE
Qt5::OpenGL Qt5::Gui
Qt5::OpenGL Qt5::Gui Qt5::Xml
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 QGLVIEWER_FOUND)
else (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND)
set(AABB_MISSING_DEPS "")
@ -84,10 +80,6 @@ else (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND QGLVIEWER_FOUND)
set(AABB_MISSING_DEPS "Qt5, ${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 QGLVIEWER_FOUND)
endif (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND )

View File

@ -76,7 +76,7 @@ void MainWindow::updateViewerBBox()
const double xmax = bbox.xmax();
const double ymax = bbox.ymax();
const double zmax = bbox.zmax();
qglviewer::Vec
CGAL::qglviewer::Vec
vec_min(xmin, ymin, zmin),
vec_max(xmax, ymax, zmax);
m_pViewer->setSceneBoundingBox(vec_min,vec_max);
@ -411,27 +411,18 @@ void MainWindow::on_actionRefine_loop_triggered()
void MainWindow::on_actionSave_snapshot_triggered()
{
// save snapshot to file
QApplication::setOverrideCursor(Qt::WaitCursor);
QString filename = QFileDialog::getSaveFileName(this,tr("Save snapshot to file..."),"snapshot00.png","*.png");
m_pViewer->saveSnapshot(filename);
QApplication::restoreOverrideCursor();
return;
}
void MainWindow::on_actionCopy_snapshot_triggered()
{
// copy snapshot to clipboard
QApplication::setOverrideCursor(Qt::WaitCursor);
QApplication::setOverrideCursor(Qt::WaitCursor);
QClipboard *qb = QApplication::clipboard();
m_pViewer->makeCurrent();
m_pViewer->raise();
#if QGLVIEWER_VERSION >= 0x020700
QImage snapshot = m_pViewer->grabFramebuffer();
#else
QImage snapshot = m_pViewer->grabFrameBuffer(true);
#endif
qb->setImage(snapshot);
QApplication::restoreOverrideCursor();
QApplication::restoreOverrideCursor();
}

View File

@ -68,7 +68,7 @@ class Refiner
typedef typename Polyhedron::Edge_iterator Edge_iterator;
typedef std::priority_queue<Edge,
std::vector<Edge>,
less<Edge> > PQueue;
::less<Edge> > PQueue;
// data
PQueue m_queue;
Polyhedron* m_pMesh;

View File

@ -490,7 +490,7 @@ void Scene::compute_texture(int i, int j,Color_ramp pos_ramp ,Color_ramp neg_ram
}
void Scene::attrib_buffers(QGLViewer* viewer)
void Scene::attrib_buffers(CGAL::QGLViewer* viewer)
{
QMatrix4x4 mvpMatrix;
double mat[16];
@ -589,7 +589,7 @@ void Scene::update_bbox()
<< " facets)" << std::endl;
}
void Scene::draw(QGLViewer* viewer)
void Scene::draw(CGAL::QGLViewer* viewer)
{
if(!gl_init)
initGL();
@ -766,8 +766,8 @@ Plane Scene::random_plane(const CGAL::Bbox_3& bbox)
Plane Scene::frame_plane() const
{
const qglviewer::Vec& pos = m_frame->position();
const qglviewer::Vec& n = m_frame->inverseTransformOf(qglviewer::Vec(0.f, 0.f, 1.f));
const CGAL::qglviewer::Vec& pos = m_frame->position();
const CGAL::qglviewer::Vec& n = m_frame->inverseTransformOf(CGAL::qglviewer::Vec(0.f, 0.f, 1.f));
return Plane(n[0], n[1], n[2], - n * pos);
}

View File

@ -17,9 +17,8 @@
#include <QtCore/qglobal.h>
#include <QMap>
#include <QGLViewer/manipulatedFrame.h>
#include <QGLViewer/qglviewer.h>
#include <QOpenGLFunctions_2_1>
#include <CGAL/Qt/manipulatedFrame.h>
#include <CGAL/Qt/qglviewer.h>
#include <QOpenGLVertexArrayObject>
#include <QOpenGLBuffer>
#include <QOpenGLShaderProgram>
@ -71,7 +70,7 @@ private:
typedef CGAL::AABB_traits<Kernel, Edge_Primitive> Edge_Traits;
typedef CGAL::AABB_tree<Edge_Traits> Edge_tree;
typedef qglviewer::ManipulatedFrame ManipulatedFrame;
typedef CGAL::qglviewer::ManipulatedFrame ManipulatedFrame;
enum Cut_planes_types {
NONE, UNSIGNED_FACETS, SIGNED_FACETS, UNSIGNED_EDGES, CUT_SEGMENTS
@ -79,7 +78,7 @@ private:
public:
QGLContext* context;
void draw(QGLViewer*);
void draw(CGAL::QGLViewer*);
void update_bbox();
Bbox bbox() { return m_bbox; }
ManipulatedFrame* manipulatedFrame() const { return m_frame; }
@ -171,7 +170,7 @@ private:
QOpenGLShaderProgram rendering_program;
void initialize_buffers();
void compute_elements(int mode);
void attrib_buffers(QGLViewer*);
void attrib_buffers(CGAL::QGLViewer*);
void compile_shaders();
void compute_texture(int, int, Color_ramp, Color_ramp);

View File

@ -5,7 +5,7 @@
#include <CGAL/Qt/CreateOpenGLContext.h>
Viewer::Viewer(QWidget* parent)
: QGLViewer(CGAL::Qt::createOpenGLContext(),parent),
: CGAL::QGLViewer(parent),
m_pScene(NULL),
m_custom_mouse(false)
{
@ -18,7 +18,7 @@ void Viewer::setScene(Scene* pScene)
void Viewer::draw()
{
QGLViewer::draw();
CGAL::QGLViewer::draw();
if(m_pScene != NULL)
{
m_pScene->draw(this);
@ -28,7 +28,7 @@ void Viewer::draw()
void Viewer::initializeGL()
{
QGLViewer::initializeGL();
CGAL::QGLViewer::initializeGL();
setBackgroundColor(::Qt::white);
//m_pScene->initGL(this);
}
@ -43,7 +43,7 @@ void Viewer::mousePressEvent(QMouseEvent* e)
m_custom_mouse = true;
}
QGLViewer::mousePressEvent(e);
CGAL::QGLViewer::mousePressEvent(e);
}
void Viewer::mouseReleaseEvent(QMouseEvent* e)
@ -59,6 +59,6 @@ void Viewer::mouseReleaseEvent(QMouseEvent* e)
m_custom_mouse = false;
}
QGLViewer::mouseReleaseEvent(e);
CGAL::QGLViewer::mouseReleaseEvent(e);
}

View File

@ -1,20 +1,20 @@
#ifndef VIEWER_H
#define VIEWER_H
#include <QMap>
#include <QGLViewer/qglviewer.h>
#include <CGAL/Qt/qglviewer.h>
// forward declarations
class QWidget;
class Scene;
class Viewer : public QGLViewer{
class Viewer : public CGAL::QGLViewer{
Q_OBJECT
public:
Viewer(QWidget * parent);
// overload several QGLViewer virtual functions
// overload several CGAL::QGLViewer virtual functions
void draw();
void initializeGL();
void setScene(Scene* pScene);

View File

@ -66,7 +66,8 @@ typedef unspecified_type Construct_sphere_3;
/*!
A functor object to compute the point on a geometric primitive which is closest from a query. Provides the operator:
`Point_3 operator()(const Type_2& type_2, const Point_3& p);` where `Type_2` is any type among `Segment_3` and `Triangle_3`. The operator returns the point on `type_2` which is closest to `p`.
`Point_3 operator()(const Type_2& type_2, const Point_3& p);` where `Type_2` can be any of the following types : `Segment_3`, `Ray_3`, or `Triangle_3`.
The operator returns the point on `type_2` which is closest to `p`.
*/
typedef unspecified_type Construct_projected_point_3;

View File

@ -291,7 +291,8 @@ public:
*/
class Sort_primitives
{
const AABB_traits<GeomTraits,AABBPrimitive,BboxMap>& m_traits;
typedef AABB_traits<GeomTraits,AABBPrimitive,BboxMap> Traits;
const Traits& m_traits;
public:
Sort_primitives(const AABB_traits<GeomTraits,AABBPrimitive,BboxMap>& traits)
: m_traits(traits) {}
@ -302,16 +303,16 @@ public:
const typename AT::Bounding_box& bbox) const
{
PrimitiveIterator middle = first + (beyond - first)/2;
switch(longest_axis(bbox))
switch(Traits::longest_axis(bbox))
{
case AT::CGAL_AXIS_X: // sort along x
std::nth_element(first, middle, beyond, boost::bind(less_x,_1,_2,m_traits));
std::nth_element(first, middle, beyond, boost::bind(Traits::less_x,_1,_2,m_traits));
break;
case AT::CGAL_AXIS_Y: // sort along y
std::nth_element(first, middle, beyond, boost::bind(less_y,_1,_2,m_traits));
std::nth_element(first, middle, beyond, boost::bind(Traits::less_y,_1,_2,m_traits));
break;
case AT::CGAL_AXIS_Z: // sort along z
std::nth_element(first, middle, beyond, boost::bind(less_z,_1,_2,m_traits));
std::nth_element(first, middle, beyond, boost::bind(Traits::less_z,_1,_2,m_traits));
break;
default:
CGAL_error();

View File

@ -29,7 +29,7 @@
#include <CGAL/AABB_face_graph_triangle_primitive.h>
#include <CGAL/AABB_halfedge_graph_segment_primitive.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/disable_warnings.h>

View File

@ -15,7 +15,6 @@
#include <CGAL/AABB_traits.h>
#include <CGAL/AABB_face_graph_triangle_primitive.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/Polyhedron_3.h>

View File

@ -32,7 +32,6 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/AABB_tree.h>

View File

@ -33,7 +33,6 @@
#include <CGAL/AABB_tree.h>
#include <CGAL/AABB_traits.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/Polyhedron_3.h>

View File

@ -33,7 +33,6 @@
#include <CGAL/AABB_tree.h>
#include <CGAL/AABB_traits.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/Polyhedron_3.h>

View File

@ -29,7 +29,6 @@
#include <CGAL/AABB_tree.h>
#include <CGAL/AABB_traits.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/Polyhedron_3.h>
#include "AABB_test_util.h"

View File

@ -32,7 +32,6 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/AABB_tree.h>

View File

@ -33,7 +33,6 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/AABB_tree.h>

View File

@ -35,7 +35,6 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/AABB_tree.h>

View File

@ -34,7 +34,6 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/AABB_tree.h>

View File

@ -12,7 +12,6 @@
#include <CGAL/AABB_tree.h>
#include <CGAL/AABB_traits.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/AABB_face_graph_triangle_primitive.h>
#include <CGAL/Timer.h>

View File

@ -201,7 +201,9 @@ public:
}; // class Algebraic_real_traits
struct Construct_algebraic_real_1;
// Functors of Algebraic_kernel_d_1
struct Solve_1 {
public:

View File

@ -45,7 +45,7 @@ namespace internal {
//
template < class Input_traits, class Kernel_approx, class Kernel_exact,
class Weighted_tag >
class Is_traits_point_convertible
class Is_traits_point_convertible_2
{
typedef typename Kernel_traits<typename Input_traits::Point_2>::Kernel Kernel_input;
@ -60,7 +60,7 @@ public:
};
template < class Input_traits, class Kernel_approx, class Kernel_exact >
class Is_traits_point_convertible<Input_traits, Kernel_approx, Kernel_exact,
class Is_traits_point_convertible_2<Input_traits, Kernel_approx, Kernel_exact,
::CGAL::Tag_true /* Weighted_tag */>
{
typedef typename Kernel_traits<typename Input_traits::Point_2>::Kernel Kernel_input;
@ -157,7 +157,7 @@ class Lazy_alpha_nt_2
Approx_point to_approx(const Input_point& wp) const
{
// The traits class' Point_2 must be convertible using the Cartesian converter
CGAL_static_assertion((Is_traits_point_convertible<
CGAL_static_assertion((Is_traits_point_convertible_2<
Input_traits, Kernel_approx, Kernel_exact, Weighted_tag>::value));
To_approx converter;
@ -167,7 +167,7 @@ class Lazy_alpha_nt_2
Exact_point to_exact(const Input_point& wp) const
{
// The traits class' Point_2 must be convertible using the Cartesian converter
CGAL_static_assertion((Is_traits_point_convertible<
CGAL_static_assertion((Is_traits_point_convertible_2<
Input_traits, Kernel_approx, Kernel_exact, Weighted_tag>::value));
To_exact converter;

View File

@ -21,15 +21,11 @@ include(${CGAL_USE_FILE})
find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg)
find_package(QGLViewer)
if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND QGLVIEWER_FOUND )
if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND )
add_definitions(-DQT_NO_KEYWORDS)
# include(${QT_USE_FILE})
include_directories (${QGLVIEWER_INCLUDE_DIR})
include_directories (BEFORE ../../include ./ )
# ui file, created wih Qt Designer
@ -43,14 +39,13 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND QGLVIEWER_FOUND )
target_link_libraries( Alpha_shape_3 PRIVATE
CGAL::CGAL CGAL::CGAL_Qt5
Qt5::OpenGL Qt5::Gui
${QGLVIEWER_LIBRARIES} )
Qt5::OpenGL Qt5::Gui )
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, and Qt5, and will not be compiled.")
message(STATUS "NOTICE: This demo requires CGAL, and Qt5, and will not be compiled.")
endif()

View File

@ -1,11 +1,11 @@
#include "Viewer.h"
#include <vector>
#include <CGAL/bounding_box.h>
#include <QGLViewer/vec.h>
#include <CGAL/Qt/vec.h>
#include "CGAL/Qt/CreateOpenGLContext.h"
Viewer::Viewer(QWidget* parent)
: QGLViewer(CGAL::Qt::createOpenGLContext(),parent)
: CGAL::QGLViewer(parent)
{
are_buffers_initialized = false;
}
@ -198,7 +198,7 @@ void Viewer::initialize_buffers()
}
void Viewer::attrib_buffers(QGLViewer* viewer)
void Viewer::attrib_buffers(CGAL::QGLViewer* viewer)
{
QMatrix4x4 mvpMatrix;
QMatrix4x4 mvMatrix;
@ -261,7 +261,7 @@ void Viewer::attrib_buffers(QGLViewer* viewer)
void Viewer::initializeGL()
{
QGLViewer::initializeGL();
CGAL::QGLViewer::initializeGL();
compile_shaders();
}
@ -272,8 +272,8 @@ Viewer::sceneChanged()
Iso_cuboid_3 bb = CGAL::bounding_box(scene->points.begin(), scene->points.end());
this->camera()->setSceneBoundingBox(qglviewer::Vec(bb.xmin(), bb.ymin(), bb.zmin()),
qglviewer::Vec(bb.xmax(),
this->camera()->setSceneBoundingBox(CGAL::qglviewer::Vec(bb.xmin(), bb.ymin(), bb.zmin()),
CGAL::qglviewer::Vec(bb.xmax(),
bb.ymax(),
bb.zmax()));

View File

@ -3,14 +3,14 @@
#include "typedefs.h"
#include <QMap>
#include <QGLViewer/qglviewer.h>
#include <CGAL/Qt/qglviewer.h>
#include <QOpenGLFunctions_2_1>
#include <QOpenGLVertexArrayObject>
#include <QOpenGLBuffer>
#include <QOpenGLShaderProgram>
class Viewer : public QGLViewer, protected QOpenGLFunctions_2_1{
class Viewer : public CGAL::QGLViewer{
Q_OBJECT
CGAL::Timer timer;
@ -61,7 +61,7 @@ private:
QOpenGLShaderProgram rendering_program_points;
void initialize_buffers();
void compute_elements();
void attrib_buffers(QGLViewer*);
void attrib_buffers(CGAL::QGLViewer*);
void compile_shaders();
public Q_SLOTS:
void initializeGL();

View File

@ -45,7 +45,7 @@ namespace internal{
//
template < class Input_traits, class Kernel_approx, class Kernel_exact,
class Weighted_tag >
class Is_traits_point_convertible
class Is_traits_point_convertible_3
{
typedef typename Kernel_traits<typename Input_traits::Point_3>::Kernel Kernel_input;
@ -60,7 +60,7 @@ public:
};
template < class Input_traits, class Kernel_approx, class Kernel_exact >
class Is_traits_point_convertible<Input_traits, Kernel_approx, Kernel_exact,
class Is_traits_point_convertible_3<Input_traits, Kernel_approx, Kernel_exact,
::CGAL::Tag_true /* Weighted_tag */>
{
typedef typename Kernel_traits<typename Input_traits::Point_3>::Kernel Kernel_input;
@ -148,7 +148,7 @@ class Lazy_alpha_nt_3{
Approx_point to_approx(const Input_point& wp) const
{
// The traits class' Point_3 must be convertible using the Cartesian converter
CGAL_static_assertion((Is_traits_point_convertible<
CGAL_static_assertion((Is_traits_point_convertible_3<
Input_traits, Kernel_approx, Kernel_exact, Weighted_tag>::value));
To_approx converter;
@ -158,7 +158,7 @@ class Lazy_alpha_nt_3{
Exact_point to_exact(const Input_point& wp) const
{
// The traits class' Point_3 must be convertible using the Cartesian converter
CGAL_static_assertion((Is_traits_point_convertible<
CGAL_static_assertion((Is_traits_point_convertible_3<
Input_traits, Kernel_approx, Kernel_exact, Weighted_tag>::value));
To_exact converter;

View File

@ -21,6 +21,7 @@
#include "NewTabDialog.h"
#include "ArrangementDemoWindow.h"
#include "ui_NewTabDialog.h"
#include <QButtonGroup>
NewTabDialog::NewTabDialog( QWidget* parent, Qt::WindowFlags f ) :
QDialog( parent, f ),

View File

@ -784,7 +784,7 @@ public:
* \return SMALLER if the curve is directed right;
* LARGER if the curve is directed left.
*/
Comparison_result operator() (const X_monotone_curve_2& cv)
Comparison_result operator() (const X_monotone_curve_2& cv) const
{
if (cv.is_directed_right())
return (SMALLER);

View File

@ -31,6 +31,7 @@
* The header file for the Arr_circle_segment_traits_2<Kenrel> class.
*/
#include <CGAL/atomic.h>
#include <CGAL/tags.h>
#include <CGAL/Arr_tags.h>
#include <CGAL/Arr_geometry_traits/Circle_segment_2.h>
@ -84,7 +85,11 @@ public:
/*! Get the next curve index. */
static unsigned int get_index ()
{
static unsigned int index = 0;
#ifdef CGAL_NO_ATOMIC
static unsigned int index;
#else
static CGAL::cpp11::atomic<unsigned int> index;
#endif
return (++index);
}

View File

@ -31,6 +31,7 @@
* The conic traits-class for the arrangement package.
*/
#include <CGAL/atomic.h>
#include <CGAL/tags.h>
#include <CGAL/Arr_tags.h>
#include <CGAL/Arr_geometry_traits/Conic_arc_2.h>
@ -114,7 +115,11 @@ public:
/*! Get the next conic index. */
static unsigned int get_index ()
{
static unsigned int index = 0;
#ifdef CGAL_NO_ATOMIC
static unsigned int index;
#else
static CGAL::cpp11::atomic<unsigned int> index;
#endif
return (++index);
}

View File

@ -16,15 +16,15 @@
// $Id$
// SPDX-License-Identifier: GPL-3.0+
//
// Author(s) : Oren Nechushtan <theoren@math.tau.ac.il>
// updated by: Michal Balas <balasmic@post.tau.ac.il>
// Author(s): Oren Nechushtan <theoren@math.tau.ac.il>
// Michal Balas <balasmic@post.tau.ac.il>
// Efi Fogel <efifogel@gmail.com>
#ifndef CGAL_TD_ACTIVE_FICTITIOUS_VERTEX_H
#define CGAL_TD_ACTIVE_FICTITIOUS_VERTEX_H
#include <CGAL/license/Arrangement_on_surface_2.h>
/*! \file
* Defintion of the Td_active_fictitious_vertex<Td_traits> class.
*/
@ -33,7 +33,6 @@
#include <boost/variant.hpp>
#include <boost/shared_ptr.hpp>
#ifdef CGAL_TD_DEBUG
#define CGAL_TD_INLINE
#else
@ -46,63 +45,61 @@ namespace CGAL {
* Implementation of a pseudo-trapezoid as two halfedges(top,bottom)
* and two curve-ends(left,right).
* Trapezoids are represented as two curve-ends called right and left and
* two halfedges called top and bottom. The curve-ends (points) lie on the
* right and left boundaries of the trapezoid respectively and the halfedges
* two halfedges called top and bottom. The curve-ends (points) lie on the
* right and left boundaries of the trapezoid respectively and the halfedges
* bound the trapezoid from above and below.
* There exist degenerate trapezoids called infinite trapezoid; this happens
* There exist degenerate trapezoids called infinite trapezoid; this happens
* when one of the four sides is on the parameter space boundary.
* Trapezoids are created as active and become inactive when Remove() member
* function called.
* Each trapezoid has at most four neighbouring trapezoids.
* X_trapezoid structure can represent a real trapezoid, a Td-edge or an
* X_trapezoid structure can represent a real trapezoid, a Td-edge or an
* edge-end (end point).
*/
template <class Td_traits_>
class Td_active_fictitious_vertex : public Handle
{
template <typename Td_traits_>
class Td_active_fictitious_vertex : public Handle {
public:
//type of traits class
typedef Td_traits_ Traits;
typedef Td_traits_ Traits;
//type of point (Point_2)
typedef typename Traits::Point Point;
typedef typename Traits::Point Point;
//type of X_monotone_curve_2
typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2;
typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2;
//type of Curve_end
typedef typename Traits::Curve_end Curve_end;
typedef typename Traits::Curve_end Curve_end;
//type of Halfedge_const_handle (trapezoid edge)
typedef typename Traits::Halfedge_const_handle Halfedge_const_handle;
typedef typename Traits::Halfedge_const_handle Halfedge_const_handle;
//type of Vertex_const_handle (trapezoid vertex)
typedef typename Traits::Vertex_const_handle Vertex_const_handle;
typedef typename Traits::Vertex_const_handle Vertex_const_handle;
//type of Halfedge_around_vertex_const_circulator
typedef typename Traits::Halfedge_around_vertex_const_circulator
typedef typename Traits::Halfedge_around_vertex_const_circulator
Halfedge_around_vertex_const_circulator;
//type of Td_active_fictitious_vertex (Self)
typedef typename Traits::Td_active_fictitious_vertex Self;
typedef typename Traits::Td_map_item Td_map_item;
typedef typename Traits::Td_active_fictitious_vertex Self;
typedef typename Traits::Td_map_item Td_map_item;
//type of Trapezoidal decomposition
typedef Trapezoidal_decomposition_2<Traits> TD;
typedef Trapezoidal_decomposition_2<Traits> TD;
//type of In face iterator
typedef typename TD::In_face_iterator In_face_iterator;
typedef typename TD::In_face_iterator In_face_iterator;
//type of Trapezoidal map search structure
typedef typename TD::Dag_node Dag_node;
typedef typename TD::Dag_node Dag_node;
//friend class declarations:
friend class Trapezoidal_decomposition_2<Traits>;
#ifdef CGAL_PM_FRIEND_CLASS
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
@ -113,199 +110,146 @@ public:
#else
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#endif
#else
friend class In_face_iterator;
#endif
#endif
/*! \class
* Inner class Data derived from Rep class
*/
class Data : public Rep
{
* Inner class Data derived from Rep class
*/
class Data : public Rep {
friend class Td_active_fictitious_vertex<Td_traits_>;
public:
//c'tors
Data (Vertex_const_handle _v,
Halfedge_const_handle _cw_he,
Dag_node* _p_node)
: v(_v),cw_he(_cw_he),p_node(_p_node)
{ }
~Data() { }
Data(Vertex_const_handle _v, Halfedge_const_handle _cw_he,
Dag_node* _p_node) :
v(_v), cw_he(_cw_he), p_node(_p_node)
{}
~Data() {}
protected:
Vertex_const_handle v;
Vertex_const_handle v;
Halfedge_const_handle cw_he; //holds the first edge going cw starting at 12 o'clock
Dag_node* p_node;
};
private:
Data* ptr() const { return (Data*)(PTR); }
private:
Data* ptr() const { return (Data*)(PTR); }
Curve_end vtx_to_ce(Vertex_const_handle v) const
{
//the circulator is of incoming halfedges
Halfedge_around_vertex_const_circulator he = v->incident_halfedges();
Halfedge_around_vertex_const_circulator he = v->incident_halfedges();
//if the vertex is associated with a point on the bounded coords,
// we can take any incident halfedge. o/w if the vertex lies at infinity,
// it has 2 fictitious incident halfedges
if (v->is_at_open_boundary() && he->source()->is_at_open_boundary()) ++he;
if (v->is_at_open_boundary() && he->source()->is_at_open_boundary()) ++he;
return Curve_end(he->curve(),
(he->direction() == ARR_RIGHT_TO_LEFT)?
ARR_MIN_END : ARR_MAX_END);
return Curve_end(he->curve(), ((he->direction() == ARR_RIGHT_TO_LEFT) ?
ARR_MIN_END : ARR_MAX_END));
}
#ifndef CGAL_TD_DEBUG
#ifdef CGAL_PM_FRIEND_CLASS
protected:
protected:
#else
public: // workaround
public: // workaround
#endif
#else //CGAL_TD_DEBUG
public:
public:
#endif //CGAL_TD_DEBUG
/*! Set the DAG node. */
inline void set_dag_node(Dag_node* p)
{
ptr()->p_node = p;
}
inline void set_dag_node(Dag_node* p) { ptr()->p_node = p; }
/*! Set the vertex handle (Vertex_const_handle). */
inline void set_vertex(Vertex_const_handle v)
inline void set_vertex(Vertex_const_handle v) { ptr()->v = v; }
/*! Set the first he going clockwise starting at 12 o'clock.
*/
inline void set_cw_he(Halfedge_const_handle he)
{
ptr()->v = v;
}
/*! Set the first he going clockwise starting at 12 o'clock (Halfedge_const_handle). */
inline void set_cw_he(Halfedge_const_handle he)
{
if (cw_he() != Traits::empty_he_handle() &&
cw_he()->direction() != he->direction())
{
ptr()->cw_he = he->twin();
}
else
{
ptr()->cw_he = he;
}
ptr()->cw_he = ((cw_he() != Traits::empty_he_handle()) &&
(cw_he()->direction() != he->direction())) ?
he->twin() : he;
}
public:
/*! Reset the first he going clockwise starting at 12 o'clock.
*/
inline void reset_cw_he() { ptr()->cw_he = Traits::empty_he_handle(); }
public:
/// \name Constructors.
//@{
Td_active_fictitious_vertex ()
Td_active_fictitious_vertex()
{
PTR = new Data
(Traits::empty_vtx_handle(), Traits::empty_he_handle(), NULL);
PTR = new Data(Traits::empty_vtx_handle(), Traits::empty_he_handle(), NULL);
}
/*! Constructor given Vertex & Halfedge handles. */
Td_active_fictitious_vertex (Vertex_const_handle v,
Halfedge_const_handle cw_he,
Dag_node* node = 0)
{
PTR = new Data(v, cw_he, node);
}
Td_active_fictitious_vertex(Vertex_const_handle v,
Halfedge_const_handle cw_he,
Dag_node* node = 0)
{ PTR = new Data(v, cw_he, node); }
/*! Copy constructor. */
Td_active_fictitious_vertex (const Self& tr) : Handle(tr)
{
}
Td_active_fictitious_vertex (const Self& tr) : Handle(tr) {}
//@}
/// \name Operator overloading.
//@{
/*! Assignment operator.
* operator= should not copy m_dag_node (or otherwise update
/*! Assignment operator.
* operator= should not copy m_dag_node (or otherwise update
* Dag_node::replace)
*/
inline Self& operator= (const Self& t2)
inline Self& operator=(const Self& t2)
{
Handle::operator=(t2);
return *this;
Handle::operator=(t2);
return *this;
}
/*! Operator==. */
inline bool operator== (const Self& t2) const
{
return (ptr() == t2.ptr());
}
inline bool operator==(const Self& t2) const { return (ptr() == t2.ptr()); }
/*! Operator!=. */
inline bool operator!= (const Self& t2) const
{
return !(operator==(t2));
}
inline bool operator!=(const Self& t2) const { return !(operator==(t2)); }
//@}
/// \name Access methods.
//@{
inline Self& self()
{
return *this;
}
inline const Self& self() const
{
return *this;
}
inline Self& self() { return *this; }
inline const Self& self() const { return *this; }
/*! Access the trapezoid id (PTR). */
inline unsigned long id() const
{
return (unsigned long) PTR;
}
inline unsigned long id() const { return (unsigned long) PTR; }
/*! Access trapezoid left.
* filters out the infinite case which returns predefined dummy values
*/
inline Vertex_const_handle vertex() const
{
return ptr()->v;
}
/*! Access trapezoid left.
* filters out the infinite case which returns predefined dummy values
*/
inline Vertex_const_handle vertex() const { return ptr()->v; }
Curve_end curve_end() const
{
return vtx_to_ce(vertex());
}
Curve_end curve_end() const { return vtx_to_ce(vertex()); }
/*! Access the first he starting at 12 o'clock clockwise.
*/
inline Halfedge_const_handle cw_he() const { return ptr()->cw_he; }
/*! Access the first he starting at 12 o'clock clockwise.
*/
inline Halfedge_const_handle cw_he () const
{
return ptr()->cw_he;
}
/*! Access DAG node. */
Dag_node* dag_node() const {return ptr()->p_node; } //m_dag_node;}
Dag_node* dag_node() const { return ptr()->p_node; } //m_dag_node;}
//@}
};
} //namespace CGAL

View File

@ -16,15 +16,15 @@
// $Id$
// SPDX-License-Identifier: GPL-3.0+
//
// Author(s) : Oren Nechushtan <theoren@math.tau.ac.il>
// updated by: Michal Balas <balasmic@post.tau.ac.il>
// Author(s): Oren Nechushtan <theoren@math.tau.ac.il>
// Michal Balas <balasmic@post.tau.ac.il>
// Efi Fogel <efifogel@gmail.com>
#ifndef CGAL_TD_ACTIVE_VERTEX_H
#define CGAL_TD_ACTIVE_VERTEX_H
#include <CGAL/license/Arrangement_on_surface_2.h>
/*! \file
* Defintion of the Td_active_vertex<Td_traits> class.
*/
@ -46,63 +46,62 @@ namespace CGAL {
* Implementation of a pseudo-trapezoid as two halfedges(top,bottom)
* and two curve-ends(left,right).
* Trapezoids are represented as two curve-ends called right and left and
* two halfedges called top and bottom. The curve-ends (points) lie on the
* right and left boundaries of the trapezoid respectively and the halfedges
* two halfedges called top and bottom. The curve-ends (points) lie on the
* right and left boundaries of the trapezoid respectively and the halfedges
* bound the trapezoid from above and below.
* There exist degenerate trapezoids called infinite trapezoid; this happens
* There exist degenerate trapezoids called infinite trapezoid; this happens
* when one of the four sides is on the parameter space boundary.
* Trapezoids are created as active and become inactive when Remove() member
* function called.
* Each trapezoid has at most four neighbouring trapezoids.
* X_trapezoid structure can represent a real trapezoid, a Td-edge or an
* X_trapezoid structure can represent a real trapezoid, a Td-edge or an
* edge-end (end point).
*/
template <class Td_traits_>
class Td_active_vertex : public Handle
{
public:
template <typename Td_traits_>
class Td_active_vertex : public Handle {
public:
//type of traits class
typedef Td_traits_ Traits;
typedef Td_traits_ Traits;
//type of point (Point_2)
typedef typename Traits::Point Point;
typedef typename Traits::Point Point;
//type of X_monotone_curve_2
typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2;
typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2;
//type of Curve_end
typedef typename Traits::Curve_end Curve_end;
typedef typename Traits::Curve_end Curve_end;
//type of Halfedge_const_handle (trapezoid edge)
typedef typename Traits::Halfedge_const_handle Halfedge_const_handle;
typedef typename Traits::Halfedge_const_handle Halfedge_const_handle;
//type of Vertex_const_handle (trapezoid vertex)
typedef typename Traits::Vertex_const_handle Vertex_const_handle;
typedef typename Traits::Vertex_const_handle Vertex_const_handle;
//type of Halfedge_around_vertex_const_circulator
typedef typename Traits::Halfedge_around_vertex_const_circulator
typedef typename Traits::Halfedge_around_vertex_const_circulator
Halfedge_around_vertex_const_circulator;
//type of Td_active_vertex (Self)
typedef typename Traits::Td_active_vertex Self;
typedef typename Traits::Td_map_item Td_map_item;
typedef typename Traits::Td_active_vertex Self;
typedef typename Traits::Td_map_item Td_map_item;
//type of Trapezoidal decomposition
typedef Trapezoidal_decomposition_2<Traits> TD;
typedef Trapezoidal_decomposition_2<Traits> TD;
//type of In face iterator
typedef typename TD::In_face_iterator In_face_iterator;
typedef typename TD::In_face_iterator In_face_iterator;
//type of Trapezoidal map search structure
typedef typename TD::Dag_node Dag_node;
typedef typename TD::Dag_node Dag_node;
//friend class declarations:
friend class Trapezoidal_decomposition_2<Traits>;
#ifdef CGAL_PM_FRIEND_CLASS
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
@ -113,201 +112,145 @@ class Td_active_vertex : public Handle
#else
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#endif
#else
friend class In_face_iterator;
#endif
#endif
/*! \class
* Inner class Data derived from Rep class
*/
class Data : public Rep
{
* Inner class Data derived from Rep class
*/
class Data : public Rep {
friend class Td_active_vertex<Td_traits_>;
public:
//c'tors
Data (Vertex_const_handle _v,
Halfedge_const_handle _cw_he,
Dag_node* _p_node)
: v(_v),cw_he(_cw_he),p_node(_p_node)
{ }
~Data() { }
Data(Vertex_const_handle _v, Halfedge_const_handle _cw_he,
Dag_node* _p_node) :
v(_v), cw_he(_cw_he), p_node(_p_node)
{}
~Data() {}
protected:
Vertex_const_handle v;
Vertex_const_handle v;
Halfedge_const_handle cw_he; //holds the first edge going cw starting at 12 o'clock
Dag_node* p_node;
Dag_node* p_node;
};
private:
Data* ptr() const { return (Data*)(PTR); }
private:
Data* ptr() const { return (Data*)(PTR); }
Curve_end vtx_to_ce(Vertex_const_handle v) const
{
//the circulator is of incoming halfedges
Halfedge_around_vertex_const_circulator he = v->incident_halfedges();
Halfedge_around_vertex_const_circulator he = v->incident_halfedges();
//if the vertex is associated with a point on the bounded coords,
// we can take any incident halfedge. o/w if the vertex lies at infinity,
// it has 2 fictitious incident halfedges
if (v->is_at_open_boundary() && he->source()->is_at_open_boundary()) ++he;
if (v->is_at_open_boundary() && he->source()->is_at_open_boundary()) ++he;
return Curve_end(he->curve(),
(he->direction() == ARR_RIGHT_TO_LEFT)?
ARR_MIN_END : ARR_MAX_END);
return Curve_end(he->curve(), ((he->direction() == ARR_RIGHT_TO_LEFT) ?
ARR_MIN_END : ARR_MAX_END));
}
#ifndef CGAL_TD_DEBUG
#ifdef CGAL_PM_FRIEND_CLASS
protected:
protected:
#else
public: // workaround
public: // workaround
#endif
#else //CGAL_TD_DEBUG
public:
public:
#endif //CGAL_TD_DEBUG
/*! Set the DAG node. */
inline void set_dag_node(Dag_node* p)
{
ptr()->p_node = p;
}
inline void set_dag_node(Dag_node* p) { ptr()->p_node = p; }
/*! Set the vertex handle (Vertex_const_handle). */
inline void set_vertex(Vertex_const_handle v)
inline void set_vertex(Vertex_const_handle v) { ptr()->v = v; }
/*! Set the first he going clockwise starting at 12 o'clock.
*/
inline void set_cw_he(Halfedge_const_handle he)
{
ptr()->v = v;
ptr()->cw_he = ((cw_he() != Traits::empty_he_handle()) &&
(cw_he()->direction() != he->direction())) ?
he->twin() : he;
}
/*! Set the first he going clockwise starting at 12 o'clock (Halfedge_const_handle). */
inline void set_cw_he(Halfedge_const_handle he)
{
if (cw_he() != Traits::empty_he_handle() &&
cw_he()->direction() != he->direction())
{
ptr()->cw_he = he->twin();
}
else
{
ptr()->cw_he = he;
}
}
public:
/*! Reset the first he going clockwise starting at 12 o'clock.
*/
inline void reset_cw_he() { ptr()->cw_he = Traits::empty_he_handle(); }
public:
/// \name Constructors.
//@{
Td_active_vertex ()
Td_active_vertex()
{
PTR = new Data
(Traits::empty_vtx_handle(), Traits::empty_he_handle(), NULL);
PTR = new Data(Traits::empty_vtx_handle(), Traits::empty_he_handle(), NULL);
}
/*! Constructor given Vertex & Halfedge handles. */
Td_active_vertex (Vertex_const_handle v,
Halfedge_const_handle cw_he,
Td_active_vertex(Vertex_const_handle v, Halfedge_const_handle cw_he,
Dag_node* node = 0)
{
PTR = new Data (v, cw_he, node);
}
{ PTR = new Data(v, cw_he, node); }
/*! Copy constructor. */
Td_active_vertex(const Self& tr) : Handle(tr)
{
}
Td_active_vertex(const Self& tr) : Handle(tr) {}
//@}
/// \name Operator overloading.
//@{
/*! Assignment operator.
* operator= should not copy m_dag_node (or otherwise update
/*! Assignment operator.
* operator= should not copy m_dag_node (or otherwise update
* Dag_node::replace)
*/
inline Self& operator= (const Self& t2)
inline Self& operator=(const Self& t2)
{
Handle::operator=(t2);
return *this;
Handle::operator=(t2);
return *this;
}
/*! Operator==. */
inline bool operator== (const Self& t2) const
{
return (ptr() == t2.ptr());
}
inline bool operator==(const Self& t2) const { return (ptr() == t2.ptr()); }
/*! Operator!=. */
inline bool operator!= (const Self& t2) const
{
return !(operator==(t2));
}
inline bool operator!=(const Self& t2) const { return !(operator==(t2)); }
//@}
/// \name Access methods.
//@{
inline Self& self()
{
return *this;
}
inline const Self& self() const
{
return *this;
}
inline Self& self() { return *this; }
inline const Self& self() const { return *this; }
/*! Access the trapezoid id (PTR). */
inline unsigned long id() const
{
return (unsigned long) PTR;
}
inline unsigned long id() const { return (unsigned long) PTR; }
inline Vertex_const_handle vertex() const
{
return ptr()->v;
}
inline Vertex_const_handle vertex() const { return ptr()->v; }
Curve_end curve_end() const { return vtx_to_ce(vertex()); }
inline const Point& point() const { return vertex()->point(); }
/*! Access the first he starting at 12 o'clock clockwise.
*/
inline Halfedge_const_handle cw_he() const { return ptr()->cw_he; }
Curve_end curve_end() const
{
return vtx_to_ce(vertex());
}
inline const Point& point() const
{
return vertex()->point();
}
/*! Access the first he starting at 12 o'clock clockwise.
*/
inline Halfedge_const_handle cw_he () const
{
return ptr()->cw_he;
}
/*! Access DAG node. */
Dag_node* dag_node() const {return ptr()->p_node; }
//@}
Dag_node* dag_node() const { return ptr()->p_node; }
//@}
};
} //namespace CGAL

View File

@ -16,8 +16,9 @@
// $Id$
// SPDX-License-Identifier: GPL-3.0+
//
// Author(s) : Oren Nechushtan <theoren@math.tau.ac.il>
// Iddo Hanniel <hanniel@math.tau.ac.il>
// Author(s): Oren Nechushtan <theoren@math.tau.ac.il>
// Iddo Hanniel <hanniel@math.tau.ac.il>
// Efi Fogel <efifogel@gmail.com>
#ifndef CGAL_TRAPEZOIDAL_DECOMPOSITION_2_H
#define CGAL_TRAPEZOIDAL_DECOMPOSITION_2_H
@ -617,29 +618,36 @@ public:
}
};
class set_cw_he_visitor : public boost::static_visitor<void>
{
/*! A visitor to set the cw halfedge of a vertex node.
*/
class set_cw_he_visitor : public boost::static_visitor<void> {
public:
set_cw_he_visitor (Halfedge_const_handle he) : m_cw_he(he) {}
set_cw_he_visitor(Halfedge_const_handle he) : m_cw_he(he) {}
void operator()(Td_active_vertex& t) const { t.set_cw_he(m_cw_he); }
void operator()(Td_active_vertex& t) const
{
t.set_cw_he(m_cw_he);
}
void operator()(Td_active_fictitious_vertex& t) const
{
t.set_cw_he(m_cw_he);
}
{ t.set_cw_he(m_cw_he); }
template <typename T>
void operator()(T& /*t*/) const { CGAL_assertion(false); }
template < typename T >
void operator()(T& /*t*/) const
{
CGAL_assertion(false);
}
private:
Halfedge_const_handle m_cw_he;
};
/*! A visitor to reset the cw halfedge of a vertex node.
*/
class reset_cw_he_visitor : public boost::static_visitor<void> {
public:
void operator()(Td_active_vertex& t) const { t.reset_cw_he(); }
void operator()(Td_active_fictitious_vertex& t) const { t.reset_cw_he(); }
template <typename T>
void operator()(T& /*t*/) const { CGAL_assertion(false); }
};
class dag_node_visitor : public boost::static_visitor<Dag_node*>
{
public:
@ -1151,6 +1159,11 @@ protected:
Halfedge_const_handle new_he,
Td_map_item& vtx_item);
/*! Update the cw halfedge of an active vertex after a halfedge is removed.
*/
void update_vtx_cw_he_after_remove(Halfedge_const_handle old_he,
Td_map_item& vtx_item);
////MICHAL: currently not in use since split is implemented as: remove and insert two
//void set_trp_params_after_split_halfedge_update(Halfedge_const_handle new_he,
// Td_map_item& vtx_item,
@ -1758,22 +1771,20 @@ public:
#endif
Halfedge_container container;
#ifdef CGAL_TD_DEBUG
unsigned long rep = Halfedge_filter(container, &dag_root());
#else
Halfedge_filter(container, &dag_root());
#endif
clear();
//// initialize container to point to curves in Td_map_item Tree
//if (rep>0)
//{
//if (rep>0) {
// bool o = set_with_guarantees(false);
// typename std::vector<Halfedge_const_handle>::iterator
// it = container.begin(),
// it_end = container.end();
// while(it!=it_end)
// {
// while (it != it_end) {
// insert(*it);
// ++it;
// }
@ -1787,8 +1798,7 @@ public:
#ifdef CGAL_TD_DEBUG
CGAL_assertion(is_valid());
unsigned long sz = number_of_curves();
if (sz != rep)
{
if (sz != rep) {
std::cerr << "\nnumber_of_curves()=" << sz;
std::cerr << "\nrepresentatives.size()=" << rep;
CGAL_assertion(number_of_curves() == rep);
@ -1832,46 +1842,37 @@ public:
// return container.size();
//}
/* Return a container for all active curves.
*/
template <typename Halfedge_container>
unsigned long Halfedge_filter(Halfedge_container& container,
const Dag_node* ds) const
/* Return a container for all active curves */
{
unsigned long sz = number_of_curves();
std::list<Td_map_item> representatives;
//X_trapezoid_list representatives;
ds->filter(representatives, Td_active_edge_item(*traits));
#ifndef CGAL_TD_DEBUG
CGAL_warning(sz==representatives.size());
CGAL_warning(sz == representatives.size());
#else
unsigned long rep=representatives.size();
if (sz != rep)
{
unsigned long rep = representatives.size();
if (sz != rep) {
std::cerr << "\nnumber_of_curves()=" << sz;
std::cerr << "\nrepresentatives.size()=" << rep;
CGAL_assertion(number_of_curves()==representatives.size());
}
#endif
if (sz > 0)
{
typename std::list<Td_map_item>::iterator it = representatives.begin(),
it_end = representatives.end();
//typename X_trapezoid_list::iterator it = representatives.begin(),
// it_end = representatives.end();
while(!(it==it_end))
if (sz > 0) {
for (typename std::list<Td_map_item>::iterator it =
representatives.begin(); it != representatives.end(); ++it)
{
Td_active_edge e (boost::get<Td_active_edge>(*it));
Td_active_edge e(boost::get<Td_active_edge>(*it));
container.push_back(e.halfedge()); //it represents an active trapezoid
++it;
}
}
if(! container.empty()) {
if (! container.empty()) {
CGAL::cpp98::random_shuffle(container.begin(),container.end());
}
return sz;
@ -2010,7 +2011,6 @@ public:
true, *m_dag_root, *m_dag_root);
}
protected:
//Trapezoidal Decomposition data members
@ -2138,7 +2138,6 @@ private:
#endif
void print_cv_data(const X_monotone_curve_2& cv,
std::ostream& out = std::cout) const
{
@ -2206,7 +2205,6 @@ private:
}
}
void print_dag_addresses(const Dag_node& curr) const
{

View File

@ -163,6 +163,9 @@ public:
/// \name Construction functors(based on the subcurve traits).
//@{
#ifndef DOXYGEN_RUNNING
class Push_back_2;
#endif
/*! \class
* A functor that divides an arc into x-monotone arcs. That are, arcs that
* do not cross the identification arc.

View File

@ -347,6 +347,9 @@ public:
return os;
}
class Parameter_space_in_x_2;
class Parameter_space_in_y_2;
/*! A functor that computes intersections between x-monotone curves. */
class Intersect_2 {
protected:

View File

@ -6,7 +6,7 @@ project( Arrangement_on_surface_2_Tests )
enable_testing()
cmake_minimum_required(VERSION 2.8.10)
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET COMPONENTS Core)
@ -33,8 +33,7 @@ if ( CGAL_FOUND )
endif()
else()
message(STATUS "This program requires the CGAL library, and will not be compiled.")
endif()
message(STATUS "This program requires the CGAL library, and will not be compiled.")
endif()

View File

@ -132,7 +132,7 @@ read_perform_opts(std::istream& is)
rc = false;
continue;
}
if (cmd == 'i') insert(*(this->m_arr), this->m_xcurves[id]);
if (cmd == 'i') CGAL::insert(*(this->m_arr), this->m_xcurves[id]);
if (cmd == 'd') {
if (!remove(this->m_xcurves[id])) rc = false;

View File

@ -0,0 +1,15 @@
i 0
i 1
i 2
i 3
i 4
i 5
i 6
i 7
d 7
d 6
d 5
d 4
d 3
d 2
d 1

View File

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

View File

@ -1 +1,3 @@
./data/empty.zero ./data/point_location/segments/xcurves/test10.txt ./data/empty.zero ./data/point_location/segments/ops/test10.txt ./data/point_location/segments/queries/test10.txt
./data/empty.zero ./data/point_location/segments/xcurves/test11.txt ./data/empty.zero ./data/point_location/segments/ops/test11.txt ./data/point_location/segments/queries/test03.txt
./data/empty.zero ./data/point_location/segments/xcurves/test11.txt ./data/empty.zero ./data/point_location/segments/ops/test12.txt ./data/point_location/segments/queries/test03.txt

View File

@ -618,6 +618,9 @@ user might encounter.
- `CGAL::is_quad()`
- `CGAL::is_quad_mesh()`
- `CGAL::is_isolated_quad()`
- `CGAL::is_valid_halfedge_graph()`
- `CGAL::is_valid_face_graph()`
- `CGAL::is_valid_polygon_mesh()`
- `CGAL::is_tetrahedron()`
- `CGAL::is_hexahedron()`

View File

@ -2,8 +2,6 @@
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/IO/Polyhedron_iostream.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/boost/graph/graph_traits_Linear_cell_complex_for_combinatorial_map.h>

View File

@ -1,5 +1,4 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/IO/Polyhedron_iostream.h>
#include <CGAL/boost/graph/graph_traits_Linear_cell_complex_for_combinatorial_map.h>
#include <CGAL/boost/graph/iterator.h>
#include <fstream>

View File

@ -1020,40 +1020,33 @@ add_face_to_border(typename boost::graph_traits<Graph>::halfedge_descriptor h1,
* collapses an edge in a graph.
*
* \tparam Graph must be a model of `MutableFaceGraph`
* Let `v0` and `v1` be the source and target vertices, and let `e` and `e'` be the halfedges of edge `v0v1`.
* Let `h` be the halfedge of `e`, and let `v0` and `v1` be the source and target vertices of `h`.
* Let `p_h` and `p_o_h` be respectively the edges of `prev(h,g)` and `prev(opposite(h, g), g)`.
* Let `o_n_h` and `o_n_o_h` be respectively the edges of `opposite(next(h,g))` and `opposite(next(opposite(h, g), g))`.
*
* For `e`, let `en` and `ep` be the next and previous
* halfedges, that is `en = next(e, g)`, `ep = prev(e, g)`, and let
* `eno` and `epo` be their opposite halfedges, that is
* `eno = opposite(en, g)` and `epo = opposite(ep, g)`.
* Analoguously, for `e'` define `en'`, `ep'`, `eno'`, and `epo'`.
* After the collapse of edge `e` the following holds:
* - The edge `e` is no longer in `g`.
* - The faces incident to edge `e` are no longer in `g`.
* - `v0` is no longer in `g`.
* - If `h` is not a border halfedge, `p_h` is no longer in `g` and is replaced by `o_n_h`.
* - If the opposite of `h` is not a border halfedge, `p_o_h` is no longer in `g` and is replaced by `o_n_o_h`.
* - The halfedges kept in `g` that had `v0` as target and source now have `v1` as target and source, respectively.
* - No other incidence information is changed in `g`.
*
* Then, after the collapse of edge `v0v1` the following holds for `e` (and analoguously for `e'`)
*
* <UL>
* <LI>The edge `v0v1` is no longer in `g`.
* <LI>The faces incident to edge `v0v1` are no longer in `g`.
* <LI>Either `v0`, or `v1` is no longer in `g` while the other remains.
* Let `vgone` be the removed vertex and `vkept` be the remaining vertex.
* <LI>If `e` was a border halfedge, that is `is_border(e, g) == true`, then `next(ep,g) == en`, and `prev(en,g) == ep`.
* <LI>If `e` was not a border halfedge, that is `is_border(e, g) == false`, then `ep` and `epo` are no longer in `g` while `en` and `eno` are kept in `g`.
* <LI>For all halfedges `hv` in `halfedges_around_target(vgone, g)`, `target(*hv, g) == vkept` and `source(opposite(*hv, g), g) == vkept`.
* <LI>No other incidence information has changed in `g`.
* </UL>
* \returns vertex `vkept` (which can be either `v0` or `v1`).
* \returns vertex `v1`.
* \pre g must be a triangulated graph
* \pre `does_satisfy_link_condition(v0v1,g) == true`.
* \pre `does_satisfy_link_condition(e,g) == true`.
*/
template<typename Graph>
typename boost::graph_traits<Graph>::vertex_descriptor
collapse_edge(typename boost::graph_traits<Graph>::edge_descriptor v0v1,
collapse_edge(typename boost::graph_traits<Graph>::edge_descriptor e,
Graph& g)
{
typedef boost::graph_traits< Graph > Traits;
typedef typename Traits::vertex_descriptor vertex_descriptor;
typedef typename Traits::halfedge_descriptor halfedge_descriptor;
halfedge_descriptor pq = halfedge(v0v1,g);
halfedge_descriptor pq = halfedge(e,g);
halfedge_descriptor qp = opposite(pq, g);
halfedge_descriptor pt = opposite(prev(pq, g), g);
halfedge_descriptor qb = opposite(prev(qp, g), g);
@ -1068,51 +1061,9 @@ collapse_edge(typename boost::graph_traits<Graph>::edge_descriptor v0v1,
vertex_descriptor q = target(pq, g);
vertex_descriptor p = source(pq, g);
#if 0
if(lTopLeftFaceExists && lBottomRightFaceExists){
std::cerr << " // do it low level" << std::endl;
halfedge_descriptor qt = next(pq,g);
halfedge_descriptor pb = next(qp,g);
halfedge_descriptor ppt = prev(pt,g);
halfedge_descriptor pqb = prev(qb,g);
if(halfedge(q,g) == pq){
set_halfedge(q, pqb,g);
}
vertex_descriptor t = target(qt,g);
if(halfedge(t,g) == pt){
set_halfedge(t, qt,g);
}
vertex_descriptor b = target(pb,g);
if(halfedge(b,g) == qb){
set_halfedge(t, pb,g);
}
set_face(qt, face(pt,g),g);
set_halfedge(face(qt,g),qt,g);
set_face(pb, face(qb,g),g);
set_halfedge(face(pb,g),pb,g);
set_next(qt, next(pt,g),g);
set_next(pb, next(qb,g),g);
set_next(ppt, qt,g);
set_next(pqb,pb,g);
remove_face(face(pq,g),g);
remove_face(face(qp,g),g);
remove_edge(v0v1,g);
remove_edge(edge(pt,g),g);
remove_edge(edge(qb,g),g);
remove_vertex(p,g);
Halfedge_around_target_circulator<Graph> beg(ppt,g), end(pqb,g);
while(beg != end){
CGAL_assertion(target(*beg,g) == p);
set_target(*beg,q,g);
--beg;
}
return q;
// return the vertex kept
}
#endif
bool lP_Erased = false, lQ_Erased = false ;
bool lP_Erased = false;
if ( lTopFaceExists )
{
@ -1137,7 +1088,7 @@ collapse_edge(typename boost::graph_traits<Graph>::edge_descriptor v0v1,
//CGAL_ECMS_TRACE(3, "Bottom face doesn't exist so vertex P already removed" ) ;
lP_Erased = true ;
}
}
}
}
@ -1158,19 +1109,20 @@ collapse_edge(typename boost::graph_traits<Graph>::edge_descriptor v0v1,
// << q.idx() << "->V" << target(qb, g).idx()
// << ") by erasing bottom face" ) ;
remove_face(opposite(qb, g),g);
if ( !lTopFaceExists )
{
//CGAL_ECMS_TRACE(3, "Top face doesn't exist so vertex Q already removed" ) ;
lQ_Erased = true ;
}
lP_Erased = true ;
// q will be removed, swap p and q
internal::swap_vertices(p, q, g);
}
remove_face(opposite(qb, g),g);
}
}
CGAL_assertion( !lP_Erased || !lQ_Erased ) ;
if ( !lP_Erased && !lQ_Erased )
if ( !lP_Erased )
{
//CGAL_ECMS_TRACE(3, "Removing vertex P by joining pQ" ) ;
@ -1178,21 +1130,24 @@ collapse_edge(typename boost::graph_traits<Graph>::edge_descriptor v0v1,
lP_Erased = true ;
}
CGAL_expensive_assertion(is_valid(g));
CGAL_expensive_assertion(is_valid_polygon_mesh(g));
return lP_Erased ? q : p ;
return q;
}
/**
* Collapses the edge `v0v1` replacing it with v0 or v1, as described in the paragraph above
* collapses an edge in a graph having non-collapsable edges.
*
* Let `h` be the halfedge of `e`, and let `v0` and `v1` be the source and target vertices of `h`.
* Collapses the edge `e` replacing it with `v1`, as described in the paragraph above
* and guarantees that an edge `e2`, for which `get(edge_is_constrained_map, e2)==true`,
* is not removed after the collapse.
*
*
* \tparam Graph must be a model of `MutableFaceGraph`
* \tparam EdgeIsConstrainedMap mut be a model of `ReadablePropertyMap` with the edge descriptor of `Graph`
* as key type and a Boolean as value type. It indicates if an edge is constrained or not.
*
* \returns vertex `v1`.
* \pre This function requires `g` to be an oriented 2-manifold with or without boundaries.
* Furthermore, the edge `v0v1` must satisfy the link condition, which guarantees that the surface mesh is also 2-manifold after the edge collapse.
* \pre `get(edge_is_constrained_map, v0v1)==false`.
@ -1262,14 +1217,16 @@ collapse_edge(typename boost::graph_traits<Graph>::edge_descriptor v0v1,
{
// the vertex is of valence 3 and we simply need to remove the vertex
// and its indicent edges
bool lP_Erased = false;
halfedge_descriptor edge =
next(edges_to_erase[0],g) == edges_to_erase[1]?
edges_to_erase[0]:edges_to_erase[1];
if (target(edge,g) == p)
lP_Erased = true;
if (target(edge,g) != p)
{
// q will be removed, swap it with p
internal::swap_vertices(p, q, g);
}
remove_center_vertex(edge,g);
return lP_Erased? q : p;
return q;
}
else
{
@ -1294,19 +1251,29 @@ collapse_edge(typename boost::graph_traits<Graph>::edge_descriptor v0v1,
join_vertex(pq,g);
return q;
}
bool lQ_Erased = is_border(opposite(next(pq,g),g),g);
if( is_border(opposite(next(pq,g),g),g) )
{
// q will be removed, swap it with p
internal::swap_vertices(p, q, g);
}
remove_face(opposite(edges_to_erase[0],g),g);
return lQ_Erased?p:q;
return q;
}
if (! (is_border(edges_to_erase[0],g))){
// q will be removed, swap it with p
internal::swap_vertices(p, q, g);
join_face(edges_to_erase[0],g);
join_vertex(qp,g);
return p;
return q;
}
if(!is_border(opposite(next(qp,g),g),g))
{
// q will be removed, swap it with p
internal::swap_vertices(p, q, g);
}
bool lP_Erased= is_border(opposite(next(qp,g),g),g);
remove_face(opposite(edges_to_erase[0],g),g);
return lP_Erased?q:p;
return q;
};
}

View File

@ -691,7 +691,7 @@ template <class Graph>
bool
is_valid(const Graph_with_descriptor_with_graph<Graph> & w, bool verbose = false)
{
return is_valid(*w.graph,verbose);
return is_valid_polygon_mesh(*w.graph,verbose);
}

View File

@ -34,7 +34,6 @@
#include <CGAL/assertions.h>
#include <CGAL/hash_openmesh.h>
#if defined(BOOST_MSVC)
# pragma warning(push)
# pragma warning(disable:4267)
@ -622,12 +621,6 @@ add_face(OPEN_MESH_CLASS& sm)
return sm.new_face();
}
template<typename K>
bool is_valid(OPEN_MESH_CLASS& sm, bool /* verbose */ = false)
{
return CGAL::is_valid_polygon_mesh(sm);
}
} // namespace OpenMesh
namespace CGAL {

View File

@ -29,6 +29,7 @@
#include <CGAL/boost/graph/internal/Has_member_clear.h>
#include <CGAL/function_objects.h>
#include <boost/unordered_set.hpp>
#include <CGAL/IO/Verbose_ostream.h>
namespace CGAL {
@ -355,30 +356,292 @@ bool is_valid_face_descriptor( typename boost::graph_traits<FaceGraph>::face_des
return true;
}
template <typename FaceGraph>
bool is_valid_polygon_mesh(const FaceGraph& g)
/*!
\ingroup PkgBGLHelperFct
* \brief checks the integrity of `g`.
*
* `g` is valid if it follows the rules of the `HalfedgeListGraph` concept,
* and all of its associations are reciprocal.
* For example, `prev(next(h, g), g)` must be `h`,
* and `next(prev(h, g), g)` must be `h`.
* \param g the `Graph` to test.
* \param verb : if `true`, the details of the check will be written in the standard output.
*
* \tparam `Graph` a model of `HalfedgeListGraph`
* \return `true` if `g` is valid, `false` otherwise.
*
*/
template<typename Graph>
bool is_valid_halfedge_graph(const Graph& g, bool verb = false)
{
typedef typename boost::graph_traits<FaceGraph>::halfedge_descriptor halfedge_descriptor;
typedef typename boost::graph_traits<FaceGraph>::vertex_descriptor vertex_descriptor;
typedef typename boost::graph_traits<FaceGraph>::face_descriptor face_descriptor;
BOOST_FOREACH(vertex_descriptor v, vertices(g)){
if(! is_valid_vertex_descriptor(v,g)){
return false;
typedef typename boost::graph_traits<Graph>::halfedge_descriptor halfedge_descriptor;
typedef typename boost::graph_traits<Graph>::vertex_descriptor vertex_descriptor;
typedef typename boost::graph_traits<Graph>::vertices_size_type vertex_size_type;
typedef typename boost::graph_traits<Graph>::halfedges_size_type halfedges_size_type;
Verbose_ostream verr(verb);
std::size_t num_v(std::distance(boost::begin(vertices(g)), boost::end(vertices(g)))),
num_h(std::distance(boost::begin(halfedges(g)), boost::end(halfedges(g))));
bool valid = ( 1 != (num_h& 1));
if ( ! valid)
verr << "number of halfedges is odd." << std::endl;
// All halfedges.
halfedges_size_type n = 0;
BOOST_FOREACH(halfedge_descriptor begin, halfedges(g)) {
if(!valid)
break;
verr << "halfedge " << n << std::endl;
// Pointer integrity.
valid = valid && ( next(begin, g) != boost::graph_traits<Graph>::null_halfedge());
valid = valid && ( opposite(begin, g) != boost::graph_traits<Graph>::null_halfedge());
if ( ! valid) {
verr << " pointer integrity corrupted (ptr==0)."
<< std::endl;
break;
}
}
BOOST_FOREACH(halfedge_descriptor h, halfedges(g)){
if(! is_valid_halfedge_descriptor(h,g)){
return false;
//edge integrity
valid = valid && ( halfedge(edge(begin, g), g) == begin);
// opposite integrity.
valid = valid && ( opposite(begin, g) != begin);
valid = valid && ( opposite(opposite(begin, g), g) == begin);
if ( ! valid) {
verr << " opposite pointer integrity corrupted."
<< std::endl;
break;
}
}
BOOST_FOREACH(face_descriptor f, faces(g)){
if(! is_valid_face_descriptor(f,g)){
return false;
// previous integrity.
valid = valid && ( prev(next(begin, g), g) == begin);
valid = valid && ( next(prev(begin, g), g) == begin);
if ( ! valid) {
verr << " previous pointer integrity corrupted."
<< std::endl;
break;
}
// vertex integrity.
valid = valid && ( target(begin, g) != boost::graph_traits<Graph>::null_vertex());
if ( ! valid) {
verr << " vertex pointer integrity corrupted."
<< std::endl;
break;
}
valid = valid && ( target(begin, g) ==
target(opposite(next(begin, g), g), g));
if ( ! valid) {
verr << " vertex pointer integrity2 corrupted."
<< std::endl;
break;
}
++n;
}
return true;
if ( valid && n != num_h)
verr << "counting halfedges failed." << std::endl;
// All vertices.
vertex_size_type v = 0;
n = 0;
BOOST_FOREACH(vertex_descriptor vbegin, vertices(g)){
if(!valid)
break;
verr << "vertex " << v << std::endl;
// Pointer integrity.
if ( halfedge(vbegin, g) != boost::graph_traits<Graph>::null_halfedge())
valid = valid && (
target( halfedge(vbegin, g), g) == vbegin);
else
valid = false;
if ( ! valid) {
verr << " halfedge pointer in vertex corrupted."
<< std::endl;
break;
}
// cycle-around-vertex test.
halfedge_descriptor h = halfedge(vbegin, g);
if ( h != boost::graph_traits<Graph>::null_halfedge()) {
halfedge_descriptor ge = h;
do {
verr << " halfedge " << n << std::endl;
++n;
h = opposite(next(h, g), g);
valid = valid && ( n <= num_h && n!=0);
if ( ! valid)
verr << " too many halfedges around vertices."
<< std::endl;
} while ( valid && (h != ge));
}
++v;
}
if ( valid && v != num_v)
verr << "counting vertices failed." << std::endl;
if ( valid && ( n != num_h))
verr << "counting halfedges via vertices failed." << std::endl;
valid = valid && ( v == num_v);
// All halfedges.
n = 0;
BOOST_FOREACH(halfedge_descriptor i, halfedges(g)){
verr << "halfedge " << n << std::endl;
// At least triangular facets and distinct geometry.
valid = valid && ( next(i, g) != i);
valid = valid && ( target(i, g) != target(opposite(i, g), g));
if ( ! valid) {
verr << " pointer validity corrupted."
<< std::endl;
break;
}
++n;
}
valid = valid && (n == num_h);
if ( n != num_h)
verr << "counting halfedges failed." << std::endl;
verr << "structure is "
<< ( valid ? "valid." : "NOT VALID.") << std::endl;
return valid;
}
/*!
\ingroup PkgBGLHelperFct
* \brief checks the integrity of `g`.
*
* `g` is valid if it is a valid `HalfedgeListGraph`, if it follows the rules
* of the `FaceListGraph` concept, and all of its associations are reciprocal.
* For example, `face(halfedge(f,g),g)` must be `f`.
* calls `is_valid_halfedge_graph()`
* \param g the `Graph` to test.
* \param verb : if `true`, the details of the check will be written in the standard output.
*
* \tparam `Graph` a model of `FaceListGraph`
* \return `true` if `g` is valid, `false` otherwise.
*
* \see `is_valid_halfedge_graph()`
*/
template<typename Graph>
bool is_valid_face_graph(const Graph& g, bool verb = false)
{
typedef typename boost::graph_traits<Graph>::halfedge_descriptor halfedge_descriptor;
typedef typename boost::graph_traits<Graph>::face_descriptor face_descriptor;
typedef typename boost::graph_traits<Graph>::faces_size_type faces_size_type;
typedef typename boost::graph_traits<Graph>::halfedges_size_type halfedges_size_type;
std::size_t num_f(std::distance(boost::begin(faces(g)), boost::end(faces(g)))),
num_h(std::distance(boost::begin(halfedges(g)), boost::end(halfedges(g))));
//is valid halfedge_graph ?
bool valid=is_valid_halfedge_graph(g, verb);
if ( ! valid) {
return false;
}
Verbose_ostream verr(verb);
// All faces.
faces_size_type f = 0;
std::size_t n = 0;
halfedges_size_type nb = 0;
BOOST_FOREACH(face_descriptor fbegin, faces(g)){
if(!valid)
break;
verr << "face " << f << std::endl;
// Pointer integrity.
if ( halfedge(fbegin, g) != boost::graph_traits<Graph>::null_halfedge())
valid = valid && (
face(halfedge(fbegin, g), g) == fbegin);
else
valid = false;
if ( ! valid) {
verr << " halfedge pointer in face corrupted." << std::endl;
break;
}
// cycle-around-face test.
halfedge_descriptor h = halfedge( fbegin, g);
if (h != boost::graph_traits<Graph>::null_halfedge()) {
halfedge_descriptor ge = h;
do {
verr << " halfedge " << n << std::endl;
++n;
h = next(h, g);
valid = valid && ( n <= num_h && n!=0);
if ( ! valid)
verr << " too many halfedges around faces."
<< std::endl;
} while ( valid && (h != ge));
}
++f;
}
if ( valid && f != num_f)
verr << "counting faces failed." << std::endl;
BOOST_FOREACH(halfedge_descriptor i, halfedges(g)){
//counting borders
if ( is_border(i, g))
++nb;
// face integrity.
valid = valid && ( face(i, g) == face(next(i, g), g));
if ( ! valid) {
verr << " face pointer integrity2 corrupted."
<< std::endl;
break;
}
}
verr << "sum border halfedges (2*nb) = " << 2 * nb << std::endl;
if ( valid && n + nb != num_h)
verr << "counting halfedges via faces failed." << std::endl;
valid = valid && ( f == num_f);
valid = valid && ( n + nb == num_h);
verr << "is_valid(): structure is " << ( valid ? "valid." :
"NOT VALID.") << std::endl;
return valid;
}
/*!
\ingroup PkgBGLHelperFct
* \brief checks the integrity of `g`.
*
* `g` is valid if it is a valid `FaceListGraph` and it has distinct faces on each side of an edge.
* calls `is_valid_face_graph()`.
*
* \param g the `Mesh` to test.
* \param verb : if `true`, the details of the check will be written in the standard output.
*
* \tparam Mesh a model of `FaceListGraph` and `HalfedgeListGraph`, and follows
* the definition of a \ref PMPDef "PolygonMesh"
* \return `true` if `g` is valid, `false` otherwise.
*
* \see `is_valid_face_graph()`
* \see `is_valid_halfedge_graph()`
*
*/
template <typename Mesh>
bool is_valid_polygon_mesh(const Mesh& g, bool verb = false)
{
typedef typename boost::graph_traits<Mesh>::halfedge_descriptor halfedge_descriptor;
Verbose_ostream verr(verb);
bool valid=is_valid_face_graph(g, verb);
//test for 2-manifoldness
// Distinct facets on each side of an halfedge.
BOOST_FOREACH(halfedge_descriptor i, halfedges(g)){
valid = valid && (face(i, g) != face(opposite(i, g), g));
if ( ! valid) {
verr << " both incident facets are equal." << std::endl;
break;
}
valid = valid && ( next(next(i, g), g) != i);
valid = valid && ( target(i, g) != target(next(i, g), g));
valid = valid && ( target(i, g) != target(next(next(i, g), g), g));
if ( ! valid) {
verr << " incident facet is not at least a triangle."
<< std::endl;
break;
}
if ( ! valid) {
verr << " incident facet is not at least a triangle."
<< std::endl;
break;
}
}
return valid;
}
/*!
\ingroup PkgBGLHelperFct
@ -1134,6 +1397,101 @@ clear_impl(FaceGraph& g)
}
}
template <class FaceGraph>
void swap_vertices(
typename boost::graph_traits<FaceGraph>::vertex_descriptor& p,
typename boost::graph_traits<FaceGraph>::vertex_descriptor& q,
FaceGraph& g)
{
typedef typename boost::graph_traits<FaceGraph>::halfedge_descriptor halfedge_descriptor;
halfedge_descriptor hq=halfedge(q, g);
halfedge_descriptor hp=halfedge(p, g);
BOOST_FOREACH(halfedge_descriptor h, halfedges_around_target(hq, g))
set_target(h, p, g);
BOOST_FOREACH(halfedge_descriptor h, halfedges_around_target(hp, g))
set_target(h, q, g);
set_halfedge(p, hq, g);
set_halfedge(q, hp, g);
}
template <class FaceGraph>
void swap_edges(
const typename boost::graph_traits<FaceGraph>::halfedge_descriptor& h1,
const typename boost::graph_traits<FaceGraph>::halfedge_descriptor& h2,
FaceGraph& g)
{
typedef typename boost::graph_traits<FaceGraph>::halfedge_descriptor halfedge_descriptor;
typedef typename boost::graph_traits<FaceGraph>::face_descriptor face_descriptor;
typedef typename boost::graph_traits<FaceGraph>::vertex_descriptor vertex_descriptor;
const halfedge_descriptor oh1 = opposite(h1, g), oh2 = opposite(h2, g);
// backup vertex pointers
vertex_descriptor s1 = target(oh1, g), s2 = target(oh2, g);
vertex_descriptor t1 = target(h1, g), t2 = target(h2, g);
// backup face pointers
face_descriptor f1 = face(h1, g), f2 = face(h2, g);
face_descriptor fo1 = face(oh1, g), fo2 = face(oh2, g);
// backup next prev pointers
halfedge_descriptor nh1 = next(h1, g), nh2 = next(h2, g);
halfedge_descriptor ph1 = prev(h1, g), ph2 = prev(h2, g);
halfedge_descriptor noh1 = next(oh1, g), noh2 = next(oh2, g);
halfedge_descriptor poh1 = prev(oh1, g), poh2 = prev(oh2, g);
// handle particular cases where next/prev are halfedges to be swapt
if (nh1 == oh2) nh1 = oh1;
if (nh1 == h2) nh1 = h1;
if (nh2 == oh1) nh2 = oh2;
if (nh2 == h1) nh2 = h2;
if (ph1 == oh2) ph1 = oh1;
if (ph1 == h2) ph1 = h1;
if (ph2 == oh1) ph2 = oh2;
if (ph2 == h1) ph2 = h2;
if (noh1 == oh2) noh1 = oh1;
if (noh1 == h2) noh1 = h1;
if (noh2 == oh1) noh2 = oh2;
if (noh2 == h1) noh2 = h2;
if (poh1 == oh2) poh1 = oh1;
if (poh1 == h2) poh1 = h1;
if (poh2 == oh1) poh2 = oh2;
if (poh2 == h1) poh2 = h2;
// (1) exchange next pointers
set_next(h1, nh2, g);
set_next(h2, nh1, g);
set_next(ph1, h2, g);
set_next(ph2, h1, g);
set_next(oh1, noh2, g);
set_next(oh2, noh1, g);
set_next(poh1, oh2, g);
set_next(poh2, oh1, g);
// (2) exchange vertex-halfedge pointers
set_target(h1, t2, g);
set_target(h2, t1, g);
set_target(oh1, s2, g);
set_target(oh2, s1, g);
if (halfedge(t1, g)==h1) set_halfedge(t1, h2, g);
if (halfedge(t2, g)==h2) set_halfedge(t2, h1, g);
if (halfedge(s1, g)==oh1) set_halfedge(s1, oh2, g);
if (halfedge(s2, g)==oh2) set_halfedge(s2, oh1, g);
// (3) exchange face-halfedge pointers
set_face(h1, f2, g);
set_face(h2, f1, g);
set_face(oh1, fo2, g);
set_face(oh2, fo1, g);
face_descriptor nf = boost::graph_traits<FaceGraph>::null_face();
if (f1 != nf && halfedge(f1, g)==h1) set_halfedge(f1, h2, g);
if (f2 != nf && halfedge(f2, g)==h2) set_halfedge(f2, h1, g);
if (fo1 != nf && halfedge(fo1, g)==oh1) set_halfedge(fo1, oh2, g);
if (fo2 != nf && halfedge(fo2, g)==oh2) set_halfedge(fo2, oh1, g);
}
} //end of internal namespace
/**

View File

@ -1,10 +1,9 @@
// Copyright (c) 2009 INRIA Sophia-Antipolis (France).
// All rights reserved.
// Copyright (c) 2014 GeometryFactory (France). All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
// You can redistribute it and/or modify it under the terms of the GNU
// General Public License as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 3 of the License,
// or (at your option) any later version.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
@ -14,23 +13,16 @@
//
// $URL$
// $Id$
// SPDX-License-Identifier: GPL-3.0+
// SPDX-License-Identifier: LGPL-3.0+
//
//
//
// Author(s) : Stephane Tayeb
//
//******************************************************************************
// File Description :
//******************************************************************************
#ifndef CGAL_MESH_3_GLOBAL_PARAMETERS_H
#define CGAL_MESH_3_GLOBAL_PARAMETERS_H
#include <CGAL/license/Mesh_3.h>
// Author(s) : Andreas Fabri
#ifndef CGAL_BOOST_PARAMETER_H
#define CGAL_BOOST_PARAMETER_H
#include <CGAL/config.h>
#include <CGAL/Mesh_3/config.h>
#ifdef BOOST_PARAMETER_MAX_ARITY
# if (BOOST_PARAMETER_MAX_ARITY < 12)
@ -40,12 +32,31 @@
# define BOOST_PARAMETER_MAX_ARITY 12
#endif
#include <boost/parameter.hpp>
#include <boost/parameter/name.hpp>
#if defined(__clang__) || (BOOST_GCC >= 40600)
# define CGAL_IGNORE_UNUSED_VARIABLES \
_Pragma("GCC diagnostic ignored \"-Wunused-variable\"") \
_Pragma("GCC diagnostic ignored \"-Wunused-parameter\"")
#else
# define CGAL_IGNORE_UNUSED_VARIABLES
#endif
#if __has_warning("-Wunneeded-internal-declaration")
# define CGAL_IGNORE_UNUSED_INTERNAL_DECLARATION \
_Pragma("clang diagnostic ignored \"-Wunneeded-internal-declaration\"")
#else
# define CGAL_IGNORE_UNUSED_INTERNAL_DECLARATION
#endif
#define CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS \
CGAL_IGNORE_UNUSED_VARIABLES \
CGAL_IGNORE_UNUSED_INTERNAL_DECLARATION
namespace CGAL {
namespace parameters {
namespace CGAL
{
namespace parameters
{
template <typename T>
struct Base
@ -56,33 +67,39 @@ private:
T t_;
};
#define CGAL_MESH_BOOLEAN_PARAMETER(Class, function_true, function_false) \
#define CGAL_BOOLEAN_PARAMETER(Class, function_true, function_false) \
struct Class : public Base<bool> { Class(bool b) : Base<bool>(b){} }; \
inline Class function_true() { return Class(true); } \
inline Class function_false() { return Class(false); }
#define CGAL_MESH_DOUBLE_PARAMETER(Class, function, precondition) \
#define CGAL_DOUBLE_PARAMETER(Class, function, precondition) \
struct Class : public Base<double> \
{ Class(double d) : Base<double>(d) { precondition(d); } }; \
inline Class function(double d) { return Class(d); }
// see <CGAL/config.h>
CGAL_PRAGMA_DIAG_PUSH
// see <CGAL/Mesh_3/config.h>
CGAL_MESH_3_IGNORE_BOOST_PARAMETER_NAME_WARNINGS
// see <CGAL/boost/parameter.h>
CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS
BOOST_PARAMETER_NAME( c3t3 )
BOOST_PARAMETER_NAME( domain )
BOOST_PARAMETER_NAME( criteria )
BOOST_PARAMETER_NAME( cdt )
BOOST_PARAMETER_NAME( (seeds_begin, tag) seeds_begin_)
BOOST_PARAMETER_NAME( (seeds_end, tag) seeds_end_)
BOOST_PARAMETER_NAME( (mark, tag) mark_)
BOOST_PARAMETER_NAME( (time_limit, tag) time_limit_ )
BOOST_PARAMETER_NAME( (convergence, tag) convergence_)
BOOST_PARAMETER_NAME( (max_iteration_number, tag) max_iteration_number_ )
BOOST_PARAMETER_NAME( (freeze_bound, tag) freeze_bound_)
BOOST_PARAMETER_NAME( (sliver_bound, tag) sliver_bound_)
BOOST_PARAMETER_NAME( (sliver_criterion, tag) sliver_criterion_)
BOOST_PARAMETER_NAME( (perturbation_vector, tag) perturbation_vector_)
BOOST_PARAMETER_NAME( (freeze_bound, tag) freeze_bound_)
BOOST_PARAMETER_NAME( (do_freeze, tag) do_freeze_)
BOOST_PARAMETER_NAME( (max_iteration_number, tag) max_iteration_number_ )
BOOST_PARAMETER_NAME( (convergence, tag) convergence_)
BOOST_PARAMETER_NAME( (mesh_topology, tag) mesh_topology_)
@ -96,13 +113,23 @@ BOOST_PARAMETER_NAME( (number_of_initial_points, tag) number_of_initial_points_)
BOOST_PARAMETER_NAME( (maximal_number_of_vertices, tag ) maximal_number_of_vertices_)
BOOST_PARAMETER_NAME( (pointer_to_error_code, tag ) pointer_to_error_code_)
// First used in <CGAL/Labeled_mesh_domain_3.h>
BOOST_PARAMETER_NAME( (function, tag ) function_)
BOOST_PARAMETER_NAME( (bounding_object, tag ) bounding_object_)
BOOST_PARAMETER_NAME( (relative_error_bound, tag ) relative_error_bound_)
BOOST_PARAMETER_NAME( (p_rng, tag ) p_rng_)
BOOST_PARAMETER_NAME( (null_subdomain_index, tag ) null_subdomain_index_)
BOOST_PARAMETER_NAME( (construct_surface_patch_index, tag ) construct_surface_patch_index_)
// First used in <CGAL/Gray_image_mesh_domain_3.h>
BOOST_PARAMETER_NAME( (image, tag ) image_)
BOOST_PARAMETER_NAME( (iso_value, tag) iso_value_)
BOOST_PARAMETER_NAME( (value_outside, tag) value_outside_)
BOOST_PARAMETER_NAME( (image_values_to_subdomain_indices, tag ) image_values_to_subdomain_indices_)
CGAL_PRAGMA_DIAG_POP
} // end namespace parameters
} // parameters
} // CGAL
} //namespace CGAL
#endif // CGAL_MESH_3_GLOBAL_PARAMETERS_H
#endif // CGAL_BOOST_PARAMETER_H

View File

@ -98,6 +98,8 @@ create_single_source_cgal_program( "test_Face_filtered_graph.cpp" )
create_single_source_cgal_program( "test_Euler_operations.cpp" )
create_single_source_cgal_program( "test_Collapse_edge.cpp" )
create_single_source_cgal_program( "test_graph_traits.cpp" )
create_single_source_cgal_program( "test_Properties.cpp" )
@ -105,6 +107,7 @@ create_single_source_cgal_program( "test_Properties.cpp" )
if(OpenMesh_FOUND)
target_link_libraries( test_clear PRIVATE ${OPENMESH_LIBRARIES})
target_link_libraries( test_Euler_operations PRIVATE ${OPENMESH_LIBRARIES})
target_link_libraries( test_Collapse_edge 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})

View File

@ -2,8 +2,6 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/IO/Polyhedron_iostream.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/boost/graph/split_graph_into_polylines.h>
#include <CGAL/boost/graph/helpers.h>
#include <boost/graph/filtered_graph.hpp>

View File

@ -0,0 +1,24 @@
OFF
10 10 0
-1.5 0 0
-0.5 0 0
0.5 0 0
1.5 0 0
-0.75 -0.5 0
0 -0.5 0
0.75 -0.5 0
-0.75 0.5 0
0 0.5 0
0.75 0.5 0
3 0 1 7
3 7 1 8
3 8 1 2
3 2 9 8
3 9 2 3
3 0 4 1
3 1 4 5
3 1 5 2
3 2 5 6
3 2 6 3

View File

@ -1,5 +1,5 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/boost/graph/graph_concepts.h>
#include <CGAL/Polyhedron_items_with_id_3.h>

View File

@ -1,5 +1,4 @@
#include <CGAL/boost/graph/graph_traits_Surface_mesh.h>
#include <CGAL/boost/graph/properties_Surface_mesh.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/Simple_cartesian.h>
#include <CGAL/boost/graph/Graph_with_descriptor_with_graph.h>

View File

@ -1,5 +1,5 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/boost/graph/graph_concepts.h>
#include <CGAL/Polyhedron_items_with_id_3.h>

View File

@ -1,5 +1,4 @@
#include <CGAL/boost/graph/graph_traits_Surface_mesh.h>
#include <CGAL/boost/graph/properties_Surface_mesh.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/boost/graph/Seam_mesh.h>
#include <CGAL/Simple_cartesian.h>

View File

@ -1,5 +1,4 @@
#include <CGAL/boost/graph/graph_traits_Surface_mesh.h>
#include <CGAL/boost/graph/properties_Surface_mesh.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/Simple_cartesian.h>
#include <boost/graph/graph_concepts.hpp>

View File

@ -0,0 +1,226 @@
#include "test_Prefix.h"
#include <boost/range/distance.hpp>
#include <CGAL/boost/graph/Euler_operations.h>
template < typename Mesh>
typename boost::graph_traits<Mesh>::
halfedge_descriptor find_halfedge(double x1, double y1,
double x2, double y2,
Mesh& m,
bool is_border = false)
{
typedef typename boost::property_map<Mesh, CGAL::vertex_point_t>::type VPMAP;
typedef typename boost::property_traits<VPMAP>::value_type Point;
typedef typename boost::graph_traits<Mesh>::halfedge_descriptor halfedge_descriptor;
VPMAP vpmap = get(CGAL::vertex_point, m);
BOOST_FOREACH(halfedge_descriptor h, halfedges(m))
{
if(get(vpmap, source(h, m)) == Point(x1,y1,0)
&& get(vpmap, target(h, m)) == Point(x2,y2,0))
{
if(is_border == CGAL::is_border(h, m))
return h;
else
return opposite(h, m);
}
}
return boost::graph_traits<Mesh>::null_halfedge();
}
template <typename Mesh>
void
collapse_edge_test()
{
CGAL_GRAPH_TRAITS_MEMBERS(Mesh);
typedef typename boost::graph_traits<Mesh>:: vertex_descriptor vertex_descriptor;
typedef typename boost::graph_traits<Mesh>:: halfedge_descriptor halfedge_descriptor;
const std::string fname = "data/flat_hexahedron.off";
Mesh m;
if(!CGAL::read_off(fname, m)) {
std::cout << "Error reading file: " << fname << std::endl;
}
bool m_is_valid = CGAL::is_valid(m);
assert(m_is_valid);
Mesh test_mesh;
CGAL::copy_face_graph(m, test_mesh);
m_is_valid = CGAL::is_valid(m);
assert(m_is_valid);
//case 1: General Case.
{
halfedge_descriptor he = find_halfedge(-0.5,0,
0.5,0,
test_mesh);
halfedge_descriptor en = next(he, test_mesh);
halfedge_descriptor eno = opposite(en, test_mesh);
halfedge_descriptor eno_prime = opposite(next(opposite(he, test_mesh), test_mesh), test_mesh);
vertex_descriptor v1 = target(he, test_mesh);
bool ok = CGAL::Euler::collapse_edge(edge(he, test_mesh), test_mesh) == v1;
assert(ok);
char found = 0;
BOOST_FOREACH(halfedge_descriptor it, CGAL::halfedges_around_target(v1,test_mesh))
{
if(it == eno
|| it == eno_prime){
++found;
}
}
assert(found == 2);
CGAL::clear(test_mesh);
}
//case 2: collapsing edge is not itself a border, but is incident upon a border edge that is removed.
{
CGAL::copy_face_graph(m, test_mesh);
halfedge_descriptor he = find_halfedge(0,0.5,
-0.75,0.5,
test_mesh);
CGAL::Euler::remove_face(he, test_mesh);
he = find_halfedge(-0.5,0,
0.5,0,
test_mesh);
halfedge_descriptor en = next(he, test_mesh);
halfedge_descriptor eno = opposite(en, test_mesh);
halfedge_descriptor eno_prime = opposite(next(opposite(he, test_mesh), test_mesh), test_mesh);
vertex_descriptor v1 = target(he, test_mesh);
bool ok = CGAL::Euler::collapse_edge(edge(he, test_mesh), test_mesh) == v1;
assert(ok);
char found = 0;
BOOST_FOREACH(halfedge_descriptor it, CGAL::halfedges_around_target(v1,test_mesh))
{
if(it == eno
|| it == eno_prime){
++found;
}
}
assert(found == 2);
CGAL::clear(test_mesh);
}
//case 3: collapsing edge is not itself a border, but is incident upon a border edge that is not removed
{
CGAL::copy_face_graph(m, test_mesh);
halfedge_descriptor he = find_halfedge(1.5,0,
0.75,0.5,
test_mesh);
CGAL::Euler::remove_face(he, test_mesh);
he = find_halfedge(-0.5,0,
0.5,0,
test_mesh);
halfedge_descriptor en = next(he, test_mesh);
halfedge_descriptor eno = opposite(en, test_mesh);
halfedge_descriptor eno_prime = opposite(next(opposite(he, test_mesh), test_mesh), test_mesh);
vertex_descriptor v1 = target(he, test_mesh);
bool ok = CGAL::Euler::collapse_edge(edge(he, test_mesh), test_mesh) == v1;
assert(ok);
char found = 0;
BOOST_FOREACH(halfedge_descriptor it, CGAL::halfedges_around_target(v1,test_mesh))
{
if(it == eno
|| it == eno_prime){
++found;
}
}
assert(found == 2);
CGAL::clear(test_mesh);
}
//case 4: collapsing edge is itself a border
{
CGAL::copy_face_graph(m, test_mesh);
halfedge_descriptor he = find_halfedge(-0.5, 0,
0, -0.5,
test_mesh);
CGAL::Euler::remove_face(he, test_mesh);
he = find_halfedge(0, -0.5,
-0.5, 0,
test_mesh);
CGAL::Euler::remove_face(he, test_mesh);
he = find_halfedge(0, -0.5,
0.75, -0.5,
test_mesh);
CGAL::Euler::remove_face(he, test_mesh);
he = find_halfedge(-0.5,0,
0.5,0,
test_mesh);
halfedge_descriptor en = next(he, test_mesh);
halfedge_descriptor eno = opposite(en, test_mesh);
halfedge_descriptor ep_prime = prev(opposite(he, test_mesh), test_mesh);
halfedge_descriptor eno_prime = opposite(next(opposite(he, test_mesh), test_mesh), test_mesh);
vertex_descriptor v1 = target(he, test_mesh);
bool ok = CGAL::Euler::collapse_edge(edge(he, test_mesh), test_mesh) == v1;
assert(ok);
char found = 0;
BOOST_FOREACH(halfedge_descriptor it, CGAL::halfedges_around_target(v1,test_mesh))
{
if(it == eno
|| it == eno_prime
|| it == ep_prime){
++found;
}
}
assert(found == 3);
CGAL::clear(test_mesh);
}
//case 5 singular case.
{
CGAL::copy_face_graph(m, test_mesh);
halfedge_descriptor he = find_halfedge(0.75,0.5,
1.5,0,
test_mesh);
CGAL::Euler::remove_face(he, test_mesh);
he = find_halfedge(0.75,-0.5,
1.5,0,
test_mesh);
CGAL::Euler::remove_face(he, test_mesh);
he = find_halfedge(0,0.5,
0.5,0,
test_mesh);
CGAL::Euler::remove_face(he, test_mesh);
he = find_halfedge(0.5,0,
0,-0.5,
test_mesh);
CGAL::Euler::remove_face(he, test_mesh);
he = find_halfedge(-0.5,0,
0.5,0,
test_mesh);
CGAL::Euler::remove_face(he, test_mesh);
halfedge_descriptor ep = prev(he, test_mesh);
halfedge_descriptor eno_prime = opposite(next(opposite(he, test_mesh), test_mesh), test_mesh);
vertex_descriptor v1 = target(he, test_mesh);
bool ok = CGAL::Euler::collapse_edge(edge(he, test_mesh), test_mesh) == v1;
assert(ok);
char found = 0;
BOOST_FOREACH(halfedge_descriptor it, CGAL::halfedges_around_target(v1,test_mesh))
{
if(it == ep)
++found;
else if( it == eno_prime){
++found;
}
}
assert(found == 2);
CGAL::clear(test_mesh);
}
}
int main()
{
collapse_edge_test<Polyhedron>();
collapse_edge_test<SM>();
#ifdef CGAL_USE_OPENMESH
collapse_edge_test<OMesh>();
#endif
std::cerr << "done\n";
return 0;
}

View File

@ -41,7 +41,7 @@ join_face_test()
assert(degree(f.w, f.m) == 2);
assert(degree(f.v, f.m) == 3);
assert(CGAL::is_valid(f.m));
assert(CGAL::is_valid_polygon_mesh(f.m));
}
@ -63,7 +63,7 @@ remove_face_test_1()
CGAL::Euler::remove_face(e,f.m);
assert(CGAL::is_valid(f.m));
assert(CGAL::is_valid_polygon_mesh(f.m));
assert_EQUAL(degree(f.v, f.m) == 3);
assert_EQUAL(degree(f.x, f.m) == 2);
@ -99,7 +99,7 @@ remove_face_test_2()
assert(found);
assert(face(e, f.m) == f.f1);
CGAL::Euler::remove_face(e,f.m);
assert(CGAL::is_valid(f.m));
assert(CGAL::is_valid_polygon_mesh(f.m));
assert(CGAL::internal::exact_num_faces(f.m) == 3);
assert(CGAL::internal::exact_num_edges(f.m) == 7);
@ -128,7 +128,7 @@ add_face_to_border_test()
CGAL::Euler::add_face_to_border(f.h1, f.h2, f.m);
assert(CGAL::is_valid(f.m));
assert(CGAL::is_valid_polygon_mesh(f.m));
}
@ -158,7 +158,7 @@ add_vertex_and_face_to_border_test()
}
halfedge_descriptor res = CGAL::Euler::add_vertex_and_face_to_border(f.h1, f.h2, f.m);
assert(CGAL::is_valid(f.m));
assert(CGAL::is_valid_polygon_mesh(f.m));
assert(! CGAL::is_border(res,m));
assert(CGAL::is_border(opposite(res,m),m));
@ -169,8 +169,6 @@ add_vertex_and_face_to_border_test()
}
assert(blength == 0);
}
@ -193,7 +191,7 @@ join_vertex_interior_test()
assert(boost::distance(CGAL::halfedges_around_face(halfedge(f.f1, f.m), f.m)) == 3);
assert(boost::distance(CGAL::halfedges_around_face(halfedge(f.f2, f.m), f.m)) == 3);
assert(degree(f.x, f.m) == 4);
assert(CGAL::is_valid(f.m));
assert(CGAL::is_valid_polygon_mesh(f.m));
}
template <typename T>
@ -218,7 +216,7 @@ join_vertex_exterior_test()
assert(boost::distance(CGAL::halfedges_around_face(halfedge(f.f1, f.m), f.m)) == 4);
assert(boost::distance(CGAL::halfedges_around_face(halfedge(f.f2, f.m), f.m)) == 3);
assert(degree(f.y, f.m) == 3);
assert(CGAL::is_valid(f.m));
assert(CGAL::is_valid_polygon_mesh(f.m));
}
{
@ -237,7 +235,7 @@ join_vertex_exterior_test()
assert(boost::distance(CGAL::halfedges_around_face(halfedge(f.f1, f.m), f.m)) == 4);
assert(boost::distance(CGAL::halfedges_around_face(halfedge(f.f2, f.m), f.m)) == 3);
assert(CGAL::is_valid(f.m));
assert(CGAL::is_valid_polygon_mesh(f.m));
assert(degree(f.w, f.m) == 3);
}
@ -261,7 +259,7 @@ split_vertex()
// split border vertex y
CGAL::Euler::split_vertex(h1, h2,f.m);
assert(CGAL::is_valid(f.m));
assert(CGAL::is_valid_polygon_mesh(f.m));
assert(CGAL::internal::exact_num_vertices(f.m) == 7);
assert(CGAL::internal::exact_num_edges(f.m) == 8);
assert(boost::distance(CGAL::halfedges_around_face(h1, f.m)) == 5);
@ -279,13 +277,13 @@ split_join_vertex_inverse()
boost::tie(h, found) = halfedge(f.w, f.x, f.m);
assert(found);
CGAL::Euler::join_vertex(h,f.m);
assert(CGAL::is_valid(f.m));
assert(CGAL::is_valid_polygon_mesh(f.m));
boost::tie(h1, found) = halfedge(f.z, f.x, f.m);
assert(found);
boost::tie(h2, found) = halfedge(f.v, f.x, f.m);
assert(found);
CGAL::Euler::join_vertex(CGAL::Euler::split_vertex(h1, h2,f.m),f.m);
assert(CGAL::is_valid(f.m));
assert(CGAL::is_valid_polygon_mesh(f.m));
assert(CGAL::internal::exact_num_vertices(f.m)== 5);
assert(CGAL::internal::exact_num_faces(f.m) == 2);
@ -305,7 +303,7 @@ join_loop_test()
CGAL::Euler::join_loop(f.h1, f.h2, f.m);
assert(CGAL::is_valid(f.m));
assert(CGAL::is_valid_polygon_mesh(f.m));
}
template <typename T>
@ -319,7 +317,7 @@ split_loop_test()
assert(CGAL::internal::exact_num_vertices(f.m) == 8);
assert(CGAL::internal::exact_num_faces(f.m) == 8);
assert(CGAL::internal::exact_num_halfedges(f.m) == 24);
assert(CGAL::is_valid(f.m));
assert(CGAL::is_valid_polygon_mesh(f.m));
}
template <typename T>
@ -382,7 +380,27 @@ does_satisfy_link_condition()
assert(CGAL::Euler::does_satisfy_link_condition(*edges(f.m).first,f.m));
}
template <typename Graph>
void
test_swap_edges()
{
typedef typename boost::graph_traits<Graph>::halfedge_descriptor halfedge_descriptor;
std::size_t nbh=12;
Kernel::Point_3 pt(0,0,0);
// test all possible pairs of halfedges
for (std::size_t i=0; i<nbh-1; ++i)
{
for(std::size_t j=i+1; j<nbh; ++j)
{
Graph g;
CGAL::make_tetrahedron(pt,pt,pt,pt,g);
halfedge_descriptor h1 = *CGAL::cpp11::next(boost::begin(halfedges(g)), i);
halfedge_descriptor h2 = *CGAL::cpp11::next(boost::begin(halfedges(g)), j);
CGAL::internal::swap_edges(h1, h2, g);
CGAL_assertion(CGAL::is_valid_polygon_mesh(g));
}
}
}
template <typename Graph>
void
@ -402,6 +420,7 @@ test_Euler_operations()
remove_center_vertex_test<Graph>();
join_split_inverse<Graph>();
does_satisfy_link_condition<Graph>();
test_swap_edges<Graph>();
}
int main()

View File

@ -272,7 +272,7 @@ void test_read(const Graph& g)
std::map<g_face_descriptor, std::size_t> map;
CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default());
Adapter fg(g, 0, boost::make_assoc_property_map(map));
assert(CGAL::is_valid(fg));
assert(CGAL::is_valid_polygon_mesh(fg));
}
template <typename Graph>
@ -357,7 +357,7 @@ void test_mesh(Adapter fga)
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
//check that there is the right number of simplices in fga
CGAL_assertion(CGAL::is_valid(fga));
CGAL_assertion(CGAL::is_valid_polygon_mesh(fga));
CGAL_assertion(num_faces(fga) == 2);
CGAL_assertion(num_edges(fga) == 5);
CGAL_assertion(num_halfedges(fga) == 10);

View File

@ -1,6 +1,5 @@
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/boost/graph/graph_traits_Surface_mesh.h>
#include <CGAL/Surface_mesh/IO.h>
#include <boost/unordered_map.hpp>
@ -56,7 +55,7 @@ int main()
}
assert(index == 25);
assert(is_valid(sm));
assert(is_valid_polygon_mesh(sm));
return 0;
}

View File

@ -157,7 +157,7 @@ template <typename Graph>
struct Surface_fixture_1 {
Surface_fixture_1() {
assert(read_a_mesh(m, "data/fixture1.off"));
assert(CGAL::is_valid(m));
assert(CGAL::is_valid_polygon_mesh(m));
typename boost::property_map<Graph, CGAL::vertex_point_t>::const_type
pm = get(CGAL::vertex_point, const_cast<const Graph&>(m));
@ -206,7 +206,7 @@ template <typename Graph>
struct Surface_fixture_2 {
Surface_fixture_2() {
assert(read_a_mesh(m, "data/fixture2.off"));
assert(CGAL::is_valid(m));
assert(CGAL::is_valid_polygon_mesh(m));
typename boost::property_map<Graph, CGAL::vertex_point_t>::const_type
pm = get(CGAL::vertex_point, const_cast<const Graph&>(m));
@ -267,7 +267,7 @@ template <typename Graph>
struct Surface_fixture_3 {
Surface_fixture_3() {
assert(read_a_mesh(m, "data/fixture3.off"));
assert(CGAL::is_valid(m));
assert(CGAL::is_valid_polygon_mesh(m));
typename boost::property_map<Graph, CGAL::vertex_point_t>::const_type
pm = get(CGAL::vertex_point, const_cast<const Graph&>(m));
@ -313,7 +313,7 @@ template <typename Graph>
struct Surface_fixture_4 {
Surface_fixture_4() {
assert(read_a_mesh(m, "data/fixture4.off"));
assert(CGAL::is_valid(m));
assert(CGAL::is_valid_polygon_mesh(m));
typename boost::property_map<Graph, CGAL::vertex_point_t>::const_type
pm = get(CGAL::vertex_point, const_cast<const Graph&>(m));
@ -348,7 +348,7 @@ template <typename Graph>
struct Surface_fixture_5 {
Surface_fixture_5() {
assert(read_a_mesh(m, "data/add_face_to_border.off"));
assert(CGAL::is_valid(m));
assert(CGAL::is_valid_polygon_mesh(m));
typename boost::property_map<Graph, CGAL::vertex_point_t>::const_type
pm = get(CGAL::vertex_point, const_cast<const Graph&>(m));
@ -378,7 +378,7 @@ template <typename Graph>
struct Surface_fixture_6 {
Surface_fixture_6() {
assert(read_a_mesh(m, "data/quad.off"));
assert(CGAL::is_valid(m));
assert(CGAL::is_valid_polygon_mesh(m));
typename boost::graph_traits<Graph>::halfedge_descriptor h;
@ -397,7 +397,7 @@ template <typename Graph>
struct Surface_fixture_7 {
Surface_fixture_7() {
assert(read_a_mesh(m, "data/cube.off"));
assert(CGAL::is_valid(m));
assert(CGAL::is_valid_polygon_mesh(m));
h = *(halfedges(m).first);
}
@ -410,7 +410,7 @@ template <typename Graph>
struct Surface_fixture_8 {
Surface_fixture_8() {
assert(read_a_mesh(m, "data/fixture5.off"));
assert(CGAL::is_valid(m));
assert(CGAL::is_valid_polygon_mesh(m));
typename boost::property_map<Graph, CGAL::vertex_point_t>::const_type
pm = get(CGAL::vertex_point, const_cast<const Graph&>(m));

View File

@ -1,10 +1,9 @@
#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/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>

View File

@ -1,7 +1,5 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/IO/Polyhedron_iostream.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/boost/graph/iterator.h>
#include <boost/foreach.hpp>

View File

@ -10,13 +10,13 @@ void test() {
std::cout << "Error reading file: " << fname << std::endl;
}
assert(CGAL::is_valid(m));
assert(CGAL::is_valid_polygon_mesh(m));
CGAL::clear(m);
assert(num_vertices(m) == 0);
assert(num_faces(m) == 0);
assert(num_edges(m) == 0);
assert(CGAL::is_valid(m));
assert(CGAL::is_valid_polygon_mesh(m));
}
int main()

View File

@ -254,9 +254,10 @@ void test_faces(const G& g)
template<typename G>
void test_read(const G& g)
{
assert(CGAL::is_valid(g));
assert(CGAL::is_valid_polygon_mesh(g));
}
template <typename Graph>
void
test(const std::vector<Graph>& graphs)

View File

@ -1,6 +1,7 @@
#include <iostream>
#include <fstream>
#include <CGAL/Surface_mesh.h>
#include <CGAL/boost/graph/graph_traits_Surface_mesh.h>
#include <CGAL/Simple_cartesian.h>
#include <CGAL/boost/graph/helpers.h>
#include <CGAL/boost/graph/Euler_operations.h>
@ -25,9 +26,85 @@ test(const char *fname, bool triangle, bool quad, bool tetrahedron, bool hexahed
assert(CGAL::is_hexahedron(hd, m) == hexahedron);
}
template <typename Mesh>
void
test_validity(Mesh& mesh)
{
typedef typename boost::graph_traits<Mesh>::vertex_descriptor vertex_descriptor;
typedef typename boost::graph_traits<Mesh>::edge_descriptor edge_descriptor;
typedef typename boost::graph_traits<Mesh>::face_descriptor face_descriptor;
typedef typename boost::property_map<Mesh, CGAL::vertex_point_t>::type VPMap;
VPMap vpmap = get(CGAL::vertex_point, mesh);
vertex_descriptor vertices[4];
edge_descriptor edges[4];
vertices[0] = add_vertex(mesh);
vertices[1] = add_vertex(mesh);
vertices[2] = add_vertex(mesh);
vertices[3] = add_vertex(mesh);
put(vpmap, vertices[0], Point_3(0,0,0));
put(vpmap, vertices[1], Point_3(1,0,0));
put(vpmap, vertices[2], Point_3(1,1,0));
put(vpmap, vertices[3], Point_3(0,1,0));
edges[0] = add_edge(mesh);
edges[1] = add_edge(mesh);
edges[2] = add_edge(mesh);
edges[3] = add_edge(mesh);
assert(!CGAL::is_valid_halfedge_graph(mesh));
for(int i=0; i<4; ++i)
{
set_target(halfedge(edges[i], mesh), vertices[i], mesh);
set_halfedge(vertices[i], halfedge(edges[i], mesh), mesh);
}
for(int i=0; i<4; ++i)
set_target(opposite(halfedge(edges[i], mesh), mesh), vertices[(i+1)%4], mesh);
for(int i=0; i<4; ++i)
{
set_next(halfedge(edges[(i+1)%4], mesh), halfedge(edges[i], mesh), mesh);
set_next(opposite(halfedge(edges[i], mesh), mesh),
opposite(halfedge(edges[(i+1)%4], mesh), mesh), mesh);
}
assert(CGAL::is_valid_halfedge_graph(mesh));
face_descriptor faces[1];
faces[0] = add_face(mesh);
assert(!CGAL::is_valid_face_graph(mesh));
for(int i=0; i<4; ++i)
{
set_face(opposite(halfedge(edges[i], mesh), mesh), faces[0], mesh);
}
set_halfedge(faces[0], opposite(halfedge(edges[0], mesh), mesh), mesh);
assert(CGAL::is_valid_face_graph(mesh));
assert(CGAL::is_valid_polygon_mesh(mesh));
Mesh dummy;
vertices[0] = add_vertex(dummy);
vertices[1] = add_vertex(dummy);
edges[0] = add_edge(dummy);
set_target(halfedge(edges[0], dummy), vertices[0], dummy);
set_halfedge(vertices[0], halfedge(edges[0], dummy), dummy);
set_target(opposite(halfedge(edges[0], dummy), dummy), vertices[1], dummy);
set_halfedge(vertices[1], opposite(halfedge(edges[0], dummy), dummy), dummy);
set_next(halfedge(edges[0], dummy), opposite(halfedge(edges[0], dummy), dummy), dummy);
set_next(opposite(halfedge(edges[0], dummy), dummy), halfedge(edges[0], dummy), dummy);
faces[0] = add_face(dummy);
set_halfedge(faces[0], opposite(halfedge(edges[0], dummy), dummy), dummy);
set_face(halfedge(edges[0], dummy), faces[0], dummy);
set_face(opposite(halfedge(edges[0], dummy), dummy), faces[0], dummy);
assert(CGAL::is_valid_face_graph(dummy));
assert(!CGAL::is_valid_polygon_mesh(dummy));
}
int main()
{
typedef CGAL::Surface_mesh<Point_3> Mesh;
Mesh mesh;
test_validity(mesh);
// triangle quad tetra hexa
test<Mesh>("data/triangle.off", true, false, false, false );
test<Mesh>("data/quad.off", false, true, false, false );
@ -43,43 +120,42 @@ int main()
halfedge_descriptor hd;
hd = CGAL::make_triangle(a,b,c,m);
assert(CGAL::is_isolated_triangle(hd,m));
assert(CGAL::is_valid(m));
assert(CGAL::is_valid_polygon_mesh(m));
m.clear();
hd = CGAL::make_quad(a,b,c,d,m);
assert(CGAL::is_isolated_quad(hd,m));
assert(CGAL::is_valid(m));
assert(CGAL::is_valid_polygon_mesh(m));
assert(CGAL::is_quad_mesh(m));
m.clear();
hd = CGAL::make_tetrahedron(a,b,c,d,m);
assert(CGAL::is_tetrahedron(hd,m));
assert(CGAL::is_triangle_mesh(m));
assert(CGAL::is_valid(m));
assert(CGAL::is_valid_polygon_mesh(m));
m.clear();
hd = CGAL::make_hexahedron(a,b,c,d,aa,bb,cc,dd,m);
assert(CGAL::is_hexahedron(hd,m));
assert(CGAL::is_quad_mesh(m));
assert(CGAL::is_valid(m));
assert(CGAL::is_valid_polygon_mesh(m));
m.clear();
CGAL::make_icosahedron<Mesh, Point_3>(m);
assert(num_faces(m) == 20);
assert(CGAL::is_triangle_mesh(m));
assert(CGAL::is_valid(m));
assert(CGAL::is_valid_polygon_mesh(m));
m.clear();
hd = CGAL::make_pyramid<Mesh, Point_3>(3, m);
assert(num_faces(m) == 6);
assert(CGAL::is_triangle_mesh(m));
assert(CGAL::is_valid(m));
assert(CGAL::is_valid_polygon_mesh(m));
m.clear();
hd = CGAL::make_regular_prism<Mesh, Point_3>(4, m);
assert(num_faces(m) == 16);
assert(CGAL::is_triangle_mesh(m));
assert(CGAL::is_valid(m));
assert(CGAL::is_valid_polygon_mesh(m));
m.clear();
CGAL::make_grid(3,3,m);
assert(num_faces(m) == 9);
assert(CGAL::is_quad_mesh(m));
assert(CGAL::is_valid(m));
assert(CGAL::is_valid_polygon_mesh(m));
std::cerr << "done" << std::endl;
return 0;
}

View File

@ -41,6 +41,7 @@
#include <CGAL/CORE/extLong.h>
#include <CGAL/atomic.h>
#include <CGAL/disable_warnings.h>
#ifdef CGAL_HEADER_ONLY
@ -54,7 +55,7 @@
#else // CGAL_HEADER_ONLY
#define CGAL_GLOBAL_STATE_VAR(TYPE, NAME, VALUE) \
CGAL_CORE_EXPORT extern TYPE NAME; \
CGAL_EXPORT extern TYPE NAME; \
inline TYPE& get_static_##NAME() \
{ \
return NAME; \
@ -340,4 +341,8 @@ inline void setPositionalFormat(std::ostream& o = std::cout) {
#include <CGAL/CORE/CoreDefs_impl.h>
#endif // CGAL_HEADER_ONLY
#include <CGAL/enable_warnings.h>
#undef CGAL_GLOBAL_STATE_VAR
#endif // _CORE_COREDEFS_H_

View File

@ -56,7 +56,7 @@ int readINT8little(FILE *f, CGAL_INT8 *i)
rc = fgetc(f);
if (rc == EOF)
return rc;
return EOF;
*i = CGAL_INT8(rc & 0xff);
return 0;
@ -69,7 +69,7 @@ int readUINT8little(FILE *f, CGAL_UINT8 *i)
rc = fgetc(f);
if (rc == EOF)
return rc;
return EOF;
*i = CGAL_UINT8(rc & 0xff);
return 0;
@ -91,7 +91,7 @@ int readINT16little(FILE *f, CGAL_INT16 *i)
rc = fgetc(f);
if (rc == EOF)
return rc;
return EOF;
temp = temp | CGAL_INT16((rc & 0xff) << 8);
*i = temp;
@ -108,7 +108,7 @@ int readUINT16little(FILE *f, CGAL_UINT16 *i)
rc = fgetc(f);
if (rc == EOF)
return rc;
return EOF;
temp = CGAL_INT16(temp | ((rc & 0xff) << 8));
*i = temp;
@ -132,7 +132,7 @@ int readINT32little(FILE *f, CGAL_INT32 *i)
rc = fgetc(f);
if (rc == EOF)
return rc;
return EOF;
temp = CGAL_INT32(temp | (((long)rc & 0xff) << 24));
*i = temp;
@ -151,7 +151,7 @@ int readUINT32little(FILE *f, CGAL_UINT32 *i)
rc = fgetc(f);
if (rc == EOF)
return rc;
return EOF;
temp = CGAL_UINT32(temp | (((long)rc & 0xff) << 24));
*i = temp;
@ -185,7 +185,7 @@ int writeINT16little(FILE *f, CGAL_INT16 i)
rc = fputc((i & 0xff), f);
if (rc == EOF)
return rc;
return EOF;
return fputc(((i >> 8) & 0xff), f);
}
@ -197,7 +197,7 @@ int writeUINT16little(FILE *f, CGAL_UINT16 i)
rc = fputc((i & 0xff), f);
if (rc == EOF)
return rc;
return EOF;
return fputc(((i >> 8) & 0xff), f);
}
@ -209,15 +209,15 @@ int writeINT32little(FILE *f, CGAL_INT32 i)
rc = fputc((i & 0xff), f);
if (rc == EOF)
return rc;
return EOF;
rc = fputc(((i >> 8) & 0xff), f);
if (rc == EOF)
return rc;
return EOF;
rc = fputc(((i >> 16) & 0xff), f);
if (rc == EOF)
return rc;
return EOF;
return fputc(((i >> 24) & 0xff), f);
}
@ -230,15 +230,15 @@ int writeUINT32little(FILE *f, CGAL_UINT32 i)
rc = fputc((i & 0xff), f);
if (rc == EOF)
return rc;
return EOF;
rc = fputc(((i >> 8) & 0xff), f);
if (rc == EOF)
return rc;
return EOF;
rc = fputc(((i >> 16) & 0xff), f);
if (rc == EOF)
return rc;
return EOF;
return fputc(((i >> 24) & 0xff), f);
}

View File

@ -699,3 +699,5 @@ static int GifError(const char *st) {
return -1;
}
#undef CGAL_GLOBAL_STATE_VAR

View File

@ -503,7 +503,7 @@ Image_3::labellized_trilinear_interpolation
static_cast<unsigned int>(lc));
if(lc == 1) {
return labels[0];
return static_cast<Target_type>(labels[0]);
}
double best_value = 0.;
@ -521,7 +521,7 @@ Image_3::labellized_trilinear_interpolation
}
}
// CGAL_assertion(best_value > 0.5);
return best;
return static_cast<Target_type>(best);
}
} // end namespace CGAL

View File

@ -69,7 +69,7 @@ VertexIndexMap vertex_id_map;
typedef boost::associative_property_map<VertexIndexMap> VertexIdPropertyMap;
VertexIdPropertyMap vertex_index_pmap(vertex_id_map);
void mstIpelet::protected_run(int fn)
void mstIpelet::protected_run(int /*fn*/)
{
std::list<Point_2> pt_list;

View File

@ -3,13 +3,33 @@ message( "== CMake setup ==" )
project(CGAL CXX C)
# Minimal version of CMake:
cmake_minimum_required(VERSION 2.8.11)
cmake_minimum_required(VERSION 3.1)
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})
function(CGAL_error_if_detect_in_source_build)
# If in a Git repository, forbid in-source builds
get_filename_component(srcdir "${CMAKE_SOURCE_DIR}" REALPATH)
get_filename_component(bindir "${CMAKE_BINARY_DIR}" REALPATH)
if("${srcdir}" STREQUAL "${bindir}")
message(FATAL_ERROR [=[
############
Since CGAL-4.12.1, you can no longer configure an in-source build in a Git
repository. See this StackOverlow question and answers for a way to create
a separate build directory:
https://stackoverflow.com/q/45518317/1728537
############
]=])
endif()
endfunction()
if ( "${CGAL_SCM_NAME}" STREQUAL "git" )
CGAL_error_if_detect_in_source_build()
endif()
# 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

@ -3181,6 +3181,7 @@ namespace CartesianKernelFunctors {
typedef typename K::Line_3 Line_3;
typedef typename K::Triangle_3 Triangle_3;
typedef typename K::Segment_3 Segment_3;
typedef typename K::Ray_3 Ray_3;
typedef typename K::FT FT;
public:
typedef Point_3 result_type;
@ -3215,6 +3216,10 @@ namespace CartesianKernelFunctors {
Point_3
operator()( const Segment_3& s, const Point_3& p ) const
{ return CommonKernelFunctors::Construct_projected_point_3<K>()(p,s,K()); }
Point_3
operator()( const Ray_3& r, const Point_3& p ) const
{ return CommonKernelFunctors::Construct_projected_point_3<K>()(p,r,K()); }
};
template <class K>

View File

@ -32,6 +32,7 @@
// provided you give a NT converter from A to B.
// There's a Homogeneous counterpart.
#include <CGAL/Cartesian_converter_fwd.h>
#include <CGAL/basic.h>
#include <CGAL/NT_converter.h>
#include <CGAL/Enum_converter.h>
@ -91,7 +92,7 @@ struct Converting_visitor : boost::static_visitor<> {
template < class K1, class K2,
// class Converter = NT_converter<typename K1::FT, typename K2::FT> >
class Converter = typename internal::Default_converter<K1, K2>::Type >
class Converter>
class Cartesian_converter : public Enum_converter
{
typedef Enum_converter Base;

View File

@ -24,7 +24,8 @@
// and a STREP (FET Open) Project under Contract No IST-006413
// (ACS -- Algorithms for Complex Shapes)
#define CGAL_NO_DEPRECATION_WARNINGS
#include <CGAL/internal/disable_deprecation_warnings_and_errors.h>
#include <CGAL/Cartesian.h>
#include <CGAL/Algebraic_kernel_for_circles_2_2.h>
#include <CGAL/Circular_kernel_2.h>

View File

@ -24,7 +24,8 @@
// and a STREP (FET Open) Project under Contract No IST-006413
// (ACS -- Algorithms for Complex Shapes)
#define CGAL_NO_DEPRECATION_WARNINGS
#include <CGAL/internal/disable_deprecation_warnings_and_errors.h>
#include <CGAL/basic.h>
#include <CGAL/Exact_circular_kernel_2.h>
#include <CGAL/intersections.h>

View File

@ -24,7 +24,8 @@
// and a STREP (FET Open) Project under Contract No IST-006413
// (ACS -- Algorithms for Complex Shapes)
#define CGAL_NO_DEPRECATION_WARNINGS
#include <CGAL/internal/disable_deprecation_warnings_and_errors.h>
#include <CGAL/Cartesian.h>
#include <CGAL/Algebraic_kernel_for_circles_2_2.h>
#include <CGAL/Circular_kernel_2.h>

View File

@ -24,7 +24,7 @@
// and a STREP (FET Open) Project under Contract No IST-006413
// (ACS -- Algorithms for Complex Shapes)
#define CGAL_NO_DEPRECATION_WARNINGS 1
#include <CGAL/internal/disable_deprecation_warnings_and_errors.h>
#include <CGAL/basic.h>
#include <CGAL/Exact_circular_kernel_2.h>

View File

@ -11,12 +11,9 @@ include(${CGAL_USE_FILE})
find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL)
find_package(QGLViewer)
if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND QGLVIEWER_FOUND )
if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND)
include_directories (${QGLVIEWER_INCLUDE_DIR})
include_directories (BEFORE ../../include ./ )
add_executable (Circular_kernel_3 Circular_kernel_3.cpp Viewer.cpp ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
@ -25,7 +22,7 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND QGLVIEWER_FOUND )
target_link_libraries( Circular_kernel_3 PRIVATE
CGAL::CGAL CGAL::CGAL_Qt5
Qt5::OpenGL Qt5::Gui ${QGLVIEWER_LIBRARIES} )
Qt5::OpenGL Qt5::Gui)
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Circular_kernel_3)
@ -35,6 +32,6 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND QGLVIEWER_FOUND )
else()
message(STATUS "NOTICE: This demo requires CGAL, the QGLViewer, and Qt5, and will not be compiled.")
message(STATUS "NOTICE: This demo requires CGAL, and Qt5, and will not be compiled.")
endif()

View File

@ -7,7 +7,7 @@
Viewer::Viewer(QWidget* parent )
: QGLViewer(CGAL::Qt::createOpenGLContext(),parent)
: CGAL::QGLViewer(parent)
{
extension_is_found = false;
}
@ -316,8 +316,8 @@ void Viewer::compute_elements()
P = rings*M_PI/180.0;
T = t*M_PI/180.0;
P = rings*CGAL_PI/180.0;
T = t*CGAL_PI/180.0;
x[1] = sin(P) * cos(T) ;
y[1] = sin(P) * sin(T) ;
z[1] = cos(P);
@ -331,8 +331,8 @@ void Viewer::compute_elements()
normals.push_back(z[1]);
//
P = rings*M_PI/180.0;
T = (t+sectors)*M_PI/180.0;
P = rings*CGAL_PI/180.0;
T = (t+sectors)*CGAL_PI/180.0;
x[2] = sin(P) * cos(T) ;
y[2] = sin(P) * sin(T) ;
z[2] = cos(P);
@ -351,8 +351,8 @@ void Viewer::compute_elements()
for(int t=0; t<360; t+=sectors)
{
//A
P = p*M_PI/180.0;
T = t*M_PI/180.0;
P = p*CGAL_PI/180.0;
T = t*CGAL_PI/180.0;
x[0] = sin(P) * cos(T) ;
y[0] = sin(P) * sin(T) ;
z[0] = cos(P);
@ -367,8 +367,8 @@ void Viewer::compute_elements()
normals.push_back(z[0]);
//B
P = (p+rings)*M_PI/180.0;
T = t*M_PI/180.0;
P = (p+rings)*CGAL_PI/180.0;
T = t*CGAL_PI/180.0;
x[1] = sin(P) * cos(T) ;
y[1] = sin(P) * sin(T) ;
z[1] = cos(P);
@ -382,8 +382,8 @@ void Viewer::compute_elements()
normals.push_back(z[1]);
//C
P = p*M_PI/180.0;
T = (t+sectors)*M_PI/180.0;
P = p*CGAL_PI/180.0;
T = (t+sectors)*CGAL_PI/180.0;
x[2] = sin(P) * cos(T) ;
y[2] = sin(P) * sin(T) ;
z[2] = cos(P);
@ -396,8 +396,8 @@ void Viewer::compute_elements()
normals.push_back(y[2]);
normals.push_back(z[2]);
//D
P = (p+rings)*M_PI/180.0;
T = (t+sectors)*M_PI/180.0;
P = (p+rings)*CGAL_PI/180.0;
T = (t+sectors)*CGAL_PI/180.0;
x[3] = sin(P) * cos(T) ;
y[3] = sin(P) * sin(T) ;
z[3] = cos(P);
@ -446,8 +446,8 @@ void Viewer::compute_elements()
normals.push_back(-1);
P = (180-rings)*M_PI/180.0;
T = t*M_PI/180.0;
P = (180-rings)*CGAL_PI/180.0;
T = t*CGAL_PI/180.0;
x[1] = sin(P) * cos(T) ;
y[1] = sin(P) * sin(T) ;
z[1] = cos(P);
@ -461,8 +461,8 @@ void Viewer::compute_elements()
normals.push_back(z[1]);
P = (180-rings)*M_PI/180.0;
T = (t+sectors)*M_PI/180.0;
P = (180-rings)*CGAL_PI/180.0;
T = (t+sectors)*CGAL_PI/180.0;
x[2] = sin(P) * cos(T) ;
y[2] = sin(P) * sin(T) ;
z[2] = cos(P);
@ -501,8 +501,8 @@ void Viewer::compute_elements()
P = rings*M_PI/180.0;
T = t*M_PI/180.0;
P = rings*CGAL_PI/180.0;
T = t*CGAL_PI/180.0;
x[1] = sin(P) * cos(T) ;
y[1] = sin(P) * sin(T) ;
z[1] = cos(P);
@ -516,8 +516,8 @@ void Viewer::compute_elements()
normals_inter.push_back(z[1]);
//
P = rings*M_PI/180.0;
T = (t+sectors)*M_PI/180.0;
P = rings*CGAL_PI/180.0;
T = (t+sectors)*CGAL_PI/180.0;
x[2] = sin(P) * cos(T) ;
y[2] = sin(P) * sin(T) ;
z[2] = cos(P);
@ -536,8 +536,8 @@ void Viewer::compute_elements()
for(int t=0; t<360; t+=sectors)
{
//A
P = p*M_PI/180.0;
T = t*M_PI/180.0;
P = p*CGAL_PI/180.0;
T = t*CGAL_PI/180.0;
x[0] = sin(P) * cos(T) ;
y[0] = sin(P) * sin(T) ;
z[0] = cos(P);
@ -552,8 +552,8 @@ void Viewer::compute_elements()
normals_inter.push_back(z[0]);
//B
P = (p+rings)*M_PI/180.0;
T = t*M_PI/180.0;
P = (p+rings)*CGAL_PI/180.0;
T = t*CGAL_PI/180.0;
x[1] = sin(P) * cos(T) ;
y[1] = sin(P) * sin(T) ;
z[1] = cos(P);
@ -567,8 +567,8 @@ void Viewer::compute_elements()
normals_inter.push_back(z[1]);
//C
P = p*M_PI/180.0;
T = (t+sectors)*M_PI/180.0;
P = p*CGAL_PI/180.0;
T = (t+sectors)*CGAL_PI/180.0;
x[2] = sin(P) * cos(T) ;
y[2] = sin(P) * sin(T) ;
z[2] = cos(P);
@ -581,8 +581,8 @@ void Viewer::compute_elements()
normals_inter.push_back(y[2]);
normals_inter.push_back(z[2]);
//D
P = (p+rings)*M_PI/180.0;
T = (t+sectors)*M_PI/180.0;
P = (p+rings)*CGAL_PI/180.0;
T = (t+sectors)*CGAL_PI/180.0;
x[3] = sin(P) * cos(T) ;
y[3] = sin(P) * sin(T) ;
z[3] = cos(P);
@ -631,8 +631,8 @@ void Viewer::compute_elements()
normals_inter.push_back(-1);
P = (180-rings)*M_PI/180.0;
T = t*M_PI/180.0;
P = (180-rings)*CGAL_PI/180.0;
T = t*CGAL_PI/180.0;
x[1] = sin(P) * cos(T) ;
y[1] = sin(P) * sin(T) ;
z[1] = cos(P);
@ -646,8 +646,8 @@ void Viewer::compute_elements()
normals_inter.push_back(z[1]);
P = (180-rings)*M_PI/180.0;
T = (t+sectors)*M_PI/180.0;
P = (180-rings)*CGAL_PI/180.0;
T = (t+sectors)*CGAL_PI/180.0;
x[2] = sin(P) * cos(T) ;
y[2] = sin(P) * sin(T) ;
z[2] = cos(P);
@ -722,7 +722,7 @@ void Viewer::compute_elements()
}
}
void Viewer::attrib_buffers(QGLViewer* viewer)
void Viewer::attrib_buffers(CGAL::QGLViewer* viewer)
{
QMatrix4x4 mvpMatrix;
QMatrix4x4 mvMatrix;

View File

@ -1,5 +1,5 @@
#include <QMap>
#include <QGLViewer/qglviewer.h>
#include <CGAL/Qt/qglviewer.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <QOpenGLFunctions_2_1>
@ -9,7 +9,7 @@
typedef CGAL::Exact_predicates_inexact_constructions_kernel EPIC;
class Viewer : public QGLViewer, QOpenGLFunctions_2_1
class Viewer : public CGAL::QGLViewer
{
public:
Viewer(QWidget* parent = 0);
@ -52,7 +52,7 @@ private:
void initialize_buffers();
void compute_elements();
void attrib_buffers(QGLViewer*);
void attrib_buffers(CGAL::QGLViewer*);
void compile_shaders();
};

View File

@ -496,7 +496,7 @@ private:
launch_feature_computation (new Feature_adder_verticality<VectorMap> (this, normal_map, 0));
}
void generate_normal_based_features(const CGAL::Default_property_map<Iterator, typename GeomTraits::Vector_3>&)
void generate_normal_based_features(const CGAL::Constant_property_map<Iterator, typename GeomTraits::Vector_3>&)
{
generate_multiscale_feature_variant_0<Verticality> ();
}
@ -544,7 +544,7 @@ private:
2, 25.f * float(i), 12.5f));
}
void generate_color_based_features(const CGAL::Default_property_map<Iterator, RGB_Color>&)
void generate_color_based_features(const CGAL::Constant_property_map<Iterator, RGB_Color>&)
{
}
@ -581,7 +581,7 @@ private:
launch_feature_computation (new Feature_adder_echo<EchoMap> (this, echo_map, i));
}
void generate_echo_based_features(const CGAL::Default_property_map<Iterator, std::size_t>&)
void generate_echo_based_features(const CGAL::Constant_property_map<Iterator, std::size_t>&)
{
}
@ -615,10 +615,10 @@ private:
}
template <typename T>
Default_property_map<Iterator, T>
Constant_property_map<Iterator, T>
get_parameter (const Default&)
{
return Default_property_map<Iterator, T>();
return Constant_property_map<Iterator, T>();
}
template<typename VectorMap, typename ColorMap, typename EchoMap>

View File

@ -1,8 +1,7 @@
#include <cstdlib>
#ifndef CGAL_NO_DEPRECATED_CODE
#include <CGAL/internal/disable_deprecation_warnings_and_errors.h>
#define CGAL_NO_DEPRECATION_WARNINGS 1
#define CGAL_CMAP_DART_DEPRECATED 1
#include <CGAL/Combinatorial_map.h>
@ -88,12 +87,3 @@ int main()
std::cout<<" Success."<<std::endl;
return EXIT_SUCCESS;
}
#else // CGAL_NO_DEPRECATED_CODE
int main()
{
return EXIT_SUCCESS;
}
#endif // CGAL_NO_DEPRECATED_CODE

View File

@ -5,7 +5,7 @@
#include <CGAL/point_generators_3.h>
#include <vector>
#include <CGAL/IO/Polyhedron_iostream.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/Surface_mesh.h>

View File

@ -1,4 +1,4 @@
#define CGAL_NO_DEPRECATION_WARNINGS
#include <CGAL/internal/disable_deprecation_warnings_and_errors.h>
#include <CGAL/basic.h>
#include <CGAL/Homogeneous.h>

View File

@ -1,4 +1,4 @@
#define CGAL_NO_DEPRECATION_WARNINGS
#include <CGAL/internal/disable_deprecation_warnings_and_errors.h>
#include <CGAL/basic.h>
#include <CGAL/Homogeneous_d.h>

View File

@ -15,6 +15,11 @@ class DefaultConstructible {};
/// See http://en.cppreference.com/w/cpp/concept/CopyConstructible
class CopyConstructible {};
/// \cgalConcept
/// Concept from the \cpp standard.
/// See http://en.cppreference.com/w/cpp/concept/Callable
class Callable {};
/// \cgalConcept
/// Concept from the \cpp standard.
/// See http://en.cppreference.com/w/cpp/concept/EqualityComparable

View File

@ -18,13 +18,13 @@ make # build the \cgal libraries
Compiling an example or a demo shipped with \cgal is similarly simple:
<PRE>
cd examples/Straight_skeleton_2 # go to an example directory
cd examples/Triangulation_2 # go to an example directory
cmake -DCGAL_DIR=$HOME/CGAL-\cgalReleaseNumber . # configure the examples
make # build the examples
</PRE>
<PRE>
cd demo/Straight_skeleton_2 # go to a demo directory
cd demo/Triangulation_2 # go to a demo directory
cmake -DCGAL_DIR=$HOME/CGAL-\cgalReleaseNumber . # configure the demos
make # build the demos
</PRE>
@ -41,11 +41,6 @@ make
where the second line creates a `CMakeLists.txt` file (check
its options in Section \ref seccreate_cgal_CMakeLists for various details).
Note that, until CGAL 4.6, \ref seccreate_cgal_CMakeLists only recognized
source files ending in `.cpp` or `.C`; if the above fails on the `cmake` command
or produces an empty `Makefile`, check whether your source files go by such a name.
Recent versions find all source files ending in
`.cc`, `.cp`, `.cxx`, `.cpp`, `.CPP`, `.c++`, or `.C`.
In a less ideal world, you probably have to install CMake, a makefile
generator, and third party libraries. That is what this manual is about.
@ -105,7 +100,7 @@ It is a self extracting executable that installs the \cgal source, and that allo
to select and download some precompiled third party libraries. However, you will need to compile
the library using your favorite compiler.
A <a href="https://www.cgal.org/windows_installation.html">tutorial</a> is provided on how to proceed with Microsoft Visual Studio 2010.
A <a href="https://www.cgal.org/windows_installation.html">tutorial</a> is provided on how to proceed with Microsoft Visual Studio.
@ -157,17 +152,18 @@ installation manual. The \cgal manual must be downloaded separately from
\section seccompilers Supported Compilers
In order to build the \cgal libraries, you need a \cpp compiler.
\cgal \cgalReleaseNumber is supported for the following compilers/operating systems:
\cgal \cgalReleaseNumber is supported, that is continuously tested, for the following compilers/operating systems:
| Compiler | Operating System |
| :------- | :--------------- |
|\sc{Gnu} `g++` 4.1 or later\cgalFootnote{<A HREF="http://gcc.gnu.org/">`http://gcc.gnu.org/`</A>} | Linux / MacOS X |
| | \sc{MS} Windows 95/98/2000/XP/NT4 |
| \sc{Intel} `C++` 15.0\cgalFootnote{<A HREF="http://software.intel.com/en-us/intel-compilers/">`http://software.intel.com/en-us/intel-compilers/`</A>} | Linux |
|\sc{MS} Visual `C++` 10.0, 11.0, 12.0, 14.0 (\sc{Visual Studio} 2010, 2012, 2013, and 2015)\cgalFootnote{<A HREF="http://msdn.microsoft.com/en-us/vstudio/">`http://msdn.microsoft.com/en-us/vstudio/`</A>} | \sc{MS} Windows 95/98/2000/XP/NT4/Vista/7/8 |
| `Clang` \cgalFootnote{<A HREF="http://clang.llvm.org/">`http://clang.llvm.org/`</A>} compiler version 3.5 and 3.6.2 | Linux / MacOS X |
| Apple `Clang` compiler version 6.0 and 4.2 | MacOS X |
| | \sc{MS} Windows |
|\sc{MS} Visual `C++` 12.0, 14.0, 15.0 (\sc{Visual Studio} 2013, 2015, and 2017)\cgalFootnote{<A HREF="http://msdn.microsoft.com/en-us/vstudio/">`http://msdn.microsoft.com/en-us/vstudio/`</A>} | \sc{MS} Windows |
| `Clang` \cgalFootnote{<A HREF="http://clang.llvm.org/">`http://clang.llvm.org/`</A>} compiler version 6.0.0 | Linux |
| Apple `Clang` compiler version 7.0.2 | MacOS X |
It may work for older versions of the above listed compilers.
\section secconfigwithcmake Configuring CGAL with CMake
@ -247,11 +243,11 @@ generators are added with each release.
Since the choice of the generator determines the type of build files to generate, in some cases
you choose a particular generator as a mean to choose a specific compiler (because they use different
build files). For example, the following generates solution files for
use in Visual \cpp 11.0 on a 64bit machine:
use in Visual \cpp 15.0 on a 64bit machine:
<PRE>
cd CGAL-\cgalReleaseNumber
cmake -G"Visual Studio 11 Win64" .
cmake -G"Visual Studio 15 2017 Win64" .
</PRE>
In other cases, however, the generator doesn't directly identify a
@ -381,8 +377,8 @@ libCGAL_Core, libCGAL_ImageIO, and libCGAL_Qt5).
\cgal heavily uses the \stl, and in particular adopted
many of its design ideas. You can find online
documentation for the \stl at various web sites, for instance,
<A HREF="http://www.sgi.com/tech/stl/">`http://www.sgi.com/tech/stl/`</A>, <A HREF="http://www.cplusplus.com/reference/">`http://www.cplusplus.com/reference/`</A>,
or <A HREF="http://msdn.microsoft.com/en-us/library/1fe2x6kt(VS.100).aspx">`http://msdn.microsoft.com/en-us/library/1fe2x6kt(VS.100).aspx`</A>.
<A HREF="http://www.cplusplus.com/reference/">`http://www.cplusplus.com/reference/`</A>,
or <A HREF="https://msdn.microsoft.com/en-us/library/1fe2x6kt(v=vs.140).aspx">`https://msdn.microsoft.com/en-us/library/1fe2x6kt(v=vs.140).aspx`</A>.
The \stl comes with the compiler, so there is nothing to install.
@ -555,14 +551,6 @@ and the \ref PkgRidges_3 packages.
The \sc{Eigen} web site is <A HREF="http://eigen.tuxfamily.org">`http://eigen.tuxfamily.org`</A>.
\subsection thirdpartylibQGLViewer libQGLViewer
libQGLViewer is a 3D widget based on \sc{Qt} 4's `QGLWidget`. In case of \sc{Qt}5 used, libQGLViewer needs to be recompiled with the proper \sc{Qt}5 version.
In \cgal some 3D demos are based on libQGLViewer.
It can be downloaded from <A HREF="http://www.libqglviewer.com/">`http://www.libqglviewer.com/`</A>.
\subsection thirdpartyESBTL ESBTL
The \sc{Esbtl} (Easy Structural Biology Template Library) is a library that allows
@ -677,9 +665,6 @@ make examples
# build all demos at once
make demos
# build only the Straight Skeleton demo
make Straight_skeleton_2_demo
</PRE>
\cgalAdvancedBegin
@ -761,7 +746,7 @@ Ideally, configuring and compiling a demo/example/program amounts to
<PRE>
cd CGAL-\cgalReleaseNumber/examples/Straight_skeleton_2
cd CGAL-\cgalReleaseNumber/examples/Triangulation_2
cmake -DCGAL_DIR=$HOME/CGAL-\cgalReleaseNumber .
make
@ -897,7 +882,7 @@ controlling variable right up front:
<PRE>
cd CGAL-\cgalReleaseNumber
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-g .
cd CGAL-\cgalReleaseNumber/examples/Straight_skeleton_2
cd CGAL-\cgalReleaseNumber/examples/Triangulation_2
cmake -DCGAL_DIR=CGAL-\cgalReleaseNumber -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS=-O2 -DCGAL_DONT_OVERRIDE_CMAKE_FLAGS=TRUE .
</PRE>
\cgalAdvancedEnd
@ -1176,22 +1161,6 @@ Only the <I>directory</I> containing the header files of \sc{Eigen} 3.1 (or grea
| `EIGEN3_INCLUDE_DIR` | Directory containing the file `signature_of_eigen3_matrix_library` | CMake |
| `EIGEN3_INC_DIR` | Idem | Environment |
\subsection installation_qgl QGLViewer Library
Some demos require the GLViewer library.
In most cases, if QGLViewer is not automatically found, setting the `QGLVIEWERROOT`
environment variable is sufficient. If it is not, you can specify the directory containing
the header files and the full pathnames of the release and debug libraries
| Variable | Description | Type |
| :- | :- | :- |
| `QGLVIEWERROOT` | Root directory of the QGLViewer library | Environment |
| `QGLVIEWER_INCLUDE_DIR` | Directory containing the `QGLViewer/qglviewer.h` file | CMake |
| `QGLVIEWER_LIBRARY_RELEASE` | Full pathname to a release build of the QGLViewer library | CMake |
| `QGLVIEWER_LIBRARY_DEBUG` | Full pathname to a debug build of the QGLViewer library | CMake |
\subsection installation_esbtl ESBTL Library
One skin surface example requires the \sc{Esbtl} library in order to read \sc{Pdb} files.

View File

@ -1571,7 +1571,7 @@ MATHJAX_FORMAT = HTML-CSS
# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2.
# This tag requires that the tag USE_MATHJAX is set to YES.
${CGAL_DOC_MATHJAX_LOCATION_FULL_OPTION_LINE}
MATHJAX_RELPATH = ${CGAL_DOC_MATHJAX_LOCATION}
# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
# extension names that should be enabled during MathJax rendering. For example

View File

@ -78,7 +78,8 @@ body {color: black; background-color: #C0C0D0; font-family: sans-serif;}
</style>
</head><body>
<h1 id="maintitle">Doxygen Manual Results</h1>'''
page_footer='''<table class="test-results">
page_footer='''<table border="1" cellspacing="2" cellpadding="5" class="test-results">
<tr><td/><th colspan="3">Doxygen 1.8.4</th><th colspan="3">Doxygen 1.8.13(official)</th><th colspan="3">Doxygen master</th></tr>
<tr>
<th>Package Name</th>
<th>Logs </th>
@ -101,7 +102,7 @@ body {color: black; background-color: #C0C0D0; font-family: sans-serif;}
suffix = ''
if args.doxygen_version2:
suffix = args.doxygen_version2
link2="\n<br><a href=\"output2/Manual/index.html\">Documentation built</a> with <a href=\"https://github.com/CGAL/doxygen\">our fork of Doxygen {_suffix}</a>\n".format(_suffix=suffix)
link2="\n<br><a href=\"output2/Manual/index.html\">Documentation built</a> with <a href=\"https://github.com/CGAL/doxygen\">our fork of Doxygen {_suffix} (used for the official CGAL documentation)</a>\n".format(_suffix=suffix)
suffix = ''
if args.master_describe:
suffix=args.master_describe

View File

@ -23,7 +23,7 @@
#define CGAL_EPIC_CONVERTER_H
#include <CGAL/basic.h>
#include <CGAL/config.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
namespace CGAL {
@ -54,6 +54,8 @@ class Epic_converter {
typedef typename Exact_predicates_inexact_constructions_kernel::Sphere_3 Sphere_3;
typedef typename Exact_predicates_inexact_constructions_kernel::Circle_3 Circle_3;
typedef typename Exact_predicates_inexact_constructions_kernel::Iso_cuboid_3 Iso_cuboid_3;
typedef typename IK::FT IK_FT;
public:
@ -61,6 +63,7 @@ public:
std::pair<double,bool> operator()(const typename IK::FT n) const
{
double d;
internal::init_double(d, (IK_FT*)(0));
if(fit_in_double(n,d)){
return std::make_pair(d,true);
}
@ -80,6 +83,7 @@ public:
std::pair<Point_2,bool> operator()(const typename IK::Point_2& p) const
{
double x, y;
internal::init_double(x, y, (IK_FT*)(0));
if(fit_in_double(p.x(),x) && fit_in_double(p.y(),y)){
return std::make_pair(Point_2(x,y),true);
}
@ -89,6 +93,7 @@ public:
std::pair<Vector_2,bool> operator()(const typename IK::Vector_2& v) const
{
double x, y;
internal::init_double(x, y, (IK_FT*)(0));
if(fit_in_double(v.x(),x) && fit_in_double(v.y(),y)){
return std::make_pair(Vector_2(x,y),true);
}
@ -98,6 +103,7 @@ public:
std::pair<Direction_2,bool> operator()(const typename IK::Direction_2& d) const
{
double x, y;
internal::init_double(x, y, (IK_FT*)(0));
if(fit_in_double(d.dx(),x) && fit_in_double(d.dy(),y)){
return std::make_pair(Direction_2(x,y),true);
}
@ -266,6 +272,7 @@ public:
std::pair<Point_3,bool> operator()(const typename IK::Point_3& p) const
{
double x, y, z;
internal::init_double(x, y, z, (IK_FT*)(0));
if(fit_in_double(p.x(),x) && fit_in_double(p.y(),y) && fit_in_double(p.z(),z)){
return std::make_pair(Point_3(x,y,z),true);
}
@ -275,6 +282,7 @@ public:
std::pair<Vector_3,bool> operator()(const typename IK::Vector_3& v) const
{
double x, y, z;
internal::init_double(x, y, z, (IK_FT*)(0));
if(fit_in_double(v.x(),x) && fit_in_double(v.y(),y) && fit_in_double(v.z(),z)){
return std::make_pair(Vector_3(x,y,z),true);
}
@ -284,6 +292,7 @@ public:
std::pair<Direction_3,bool> operator()(const typename IK::Direction_3& d) const
{
double x, y, z;
internal::init_double(x, y, z, (IK_FT*)(0));
if(fit_in_double(d.dx(),x) && fit_in_double(d.dy(),y) && fit_in_double(d.dz(),z)){
return std::make_pair(Direction_3(x,y,z),true);
}

View File

@ -31,6 +31,9 @@ namespace CGAL {
template < typename ET >
class Lazy_exact_nt;
template <bool Protected>
class Interval_nt;
namespace internal {
// Utility function to check a posteriori that a subtraction was performed
@ -152,6 +155,66 @@ template < typename ET >
inline void init_double(double& d0, double& d1, double& d2, double& d3, double& d4, double& d5, double& d6, double& d7, double&d8, double& d9, double& d10, double& d11, double& d12, double& d13, double& d14, Lazy_exact_nt<ET>* )
{d0 = d1 = d2 = d3 = d4 = d5 = d6 = d7 = d8 = d9 = d10 = d11 = d12 = d13 = d14 = 0;}
template < bool P >
inline void init_double(double& d0, Interval_nt<P>* )
{d0 = 0;}
template < bool P >
inline void init_double(double& d0, double& d1, Interval_nt<P>* )
{d0 = d1 = 0;}
template < bool P >
inline void init_double(double& d0, double& d1, double& d2, Interval_nt<P>* )
{d0 = d1 = d2 = 0;}
template < bool P >
inline void init_double(double& d0, double& d1, double& d2, double& d3, Interval_nt<P>* )
{d0 = d1 = d2 = d3 = 0;}
template < bool P >
inline void init_double(double& d0, double& d1, double& d2, double& d3, double& d4, Interval_nt<P>* )
{d0 = d1 = d2 = d3 = d4 = 0;}
template < bool P >
inline void init_double(double& d0, double& d1, double& d2, double& d3, double& d4, double& d5, Interval_nt<P>* )
{d0 = d1 = d2 = d3 = d4 = d5 = 0;}
template < bool P >
inline void init_double(double& d0, double& d1, double& d2, double& d3, double& d4, double& d5, double& d6, Interval_nt<P>* )
{d0 = d1 = d2 = d3 = d4 = d5 = d6 = 0;}
template < bool P >
inline void init_double(double& d0, double& d1, double& d2, double& d3, double& d4, double& d5, double& d6, double& d7, Interval_nt<P>* )
{d0 = d1 = d2 = d3 = d4 = d5 = d6 = d7 = 0;}
template < bool P >
inline void init_double(double& d0, double& d1, double& d2, double& d3, double& d4, double& d5, double& d6, double& d7, double& d8, Interval_nt<P>* )
{d0 = d1 = d2 = d3 = d4 = d5 = d6 = d7 = d8 = 0;}
template < bool P >
inline void init_double(double& d0, double& d1, double& d2, double& d3, double& d4, double& d5, double& d6, double& d7, double&d8, double& d9, Interval_nt<P>* )
{d0 = d1 = d2 = d3 = d4 = d5 = d6 = d7 = d8 = d9 = 0;}
template < bool P >
inline void init_double(double& d0, double& d1, double& d2, double& d3, double& d4, double& d5, double& d6, double& d7, double&d8, double& d9, double& d10, Interval_nt<P>* )
{d0 = d1 = d2 = d3 = d4 = d5 = d6 = d7 = d8 = d9 = d10 = 0;}
template < bool P >
inline void init_double(double& d0, double& d1, double& d2, double& d3, double& d4, double& d5, double& d6, double& d7, double&d8, double& d9, double& d10, double& d11, Interval_nt<P>* )
{d0 = d1 = d2 = d3 = d4 = d5 = d6 = d7 = d8 = d9 = d10 = d11 = 0;}
template < bool P >
inline void init_double(double& d0, double& d1, double& d2, double& d3, double& d4, double& d5, double& d6, double& d7, double&d8, double& d9, double& d10, double& d11, double& d12, Interval_nt<P>* )
{d0 = d1 = d2 = d3 = d4 = d5 = d6 = d7 = d8 = d9 = d10 = d11 = d12 = 0;}
template < bool P >
inline void init_double(double& d0, double& d1, double& d2, double& d3, double& d4, double& d5, double& d6, double& d7, double&d8, double& d9, double& d10, double& d11, double& d12, double& d13, Interval_nt<P>* )
{d0 = d1 = d2 = d3 = d4 = d5 = d6 = d7 = d8 = d9 = d10 = d11 = d12 = d13 = 0;}
template < bool P >
inline void init_double(double& d0, double& d1, double& d2, double& d3, double& d4, double& d5, double& d6, double& d7, double&d8, double& d9, double& d10, double& d11, double& d12, double& d13, double& d14, Interval_nt<P>* )
{d0 = d1 = d2 = d3 = d4 = d5 = d6 = d7 = d8 = d9 = d10 = d11 = d12 = d13 = d14 = 0;}
// Auxiliary function to check if static filters can be applied, that is,
// if to_double() does not add roundoff errors.

View File

@ -24,9 +24,7 @@
#include <CGAL/Generalized_map_operations.h>
#include <CGAL/Random.h>
#include <CGAL/IO/Polyhedron_iostream.h>
#include <iostream>
#include <fstream>
using namespace std;

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