mirror of https://github.com/CGAL/cgal
Merge CGAL/master to get rid of the dependency to QGLViewer
This commit is contained in:
commit
4e8264b109
|
|
@ -53,7 +53,7 @@ env:
|
||||||
compiler: clang-3.6
|
compiler: clang-3.6
|
||||||
install:
|
install:
|
||||||
- echo "$PWD"
|
- 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
|
- bash .travis/install.sh
|
||||||
- export CXX=clang++-3.6 CC=clang-3.6;
|
- export CXX=clang++-3.6 CC=clang-3.6;
|
||||||
before_script:
|
before_script:
|
||||||
|
|
@ -68,7 +68,7 @@ before_script:
|
||||||
- cd ..
|
- cd ..
|
||||||
script:
|
script:
|
||||||
- cd ./.travis
|
- cd ./.travis
|
||||||
- bash -x -e ./build_package.sh $PACKAGE
|
- bash ./build_package.sh $PACKAGE
|
||||||
notifications:
|
notifications:
|
||||||
email:
|
email:
|
||||||
on_success: change # default: always
|
on_success: change # default: always
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
[ -n "$CGAL_DEBUG_TRAVIS" ] && set -x
|
||||||
|
|
||||||
CXX_FLAGS="-DCGAL_NDEBUG"
|
CXX_FLAGS="-DCGAL_NDEBUG"
|
||||||
|
|
||||||
|
|
@ -53,6 +54,10 @@ ROOT="$PWD/.."
|
||||||
NEED_3D=0
|
NEED_3D=0
|
||||||
for ARG in $(echo "$@")
|
for ARG in $(echo "$@")
|
||||||
do
|
do
|
||||||
|
#skip package maintenance
|
||||||
|
if [ "$ARG" = "Maintenance" ]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
cd $ROOT
|
cd $ROOT
|
||||||
#install openmesh only if necessary
|
#install openmesh only if necessary
|
||||||
if [ "$ARG" = "CHECK" ] || [ "$ARG" = BGL ] || [ "$ARG" = Convex_hull_3 ] ||\
|
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
|
zsh $ROOT/Scripts/developer_scripts/test_merge_of_branch HEAD
|
||||||
#test dependencies
|
#test dependencies
|
||||||
cd $ROOT
|
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
|
cd .travis
|
||||||
#parse current matrix and check that no package has been forgotten
|
#parse current matrix and check that no package has been forgotten
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -x
|
[ -n "$CGAL_DEBUG_TRAVIS" ] && set -x
|
||||||
DONE=0
|
DONE=0
|
||||||
while [ $DONE = 0 ]
|
while [ $DONE = 0 ]
|
||||||
do
|
do
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ env:
|
||||||
compiler: clang-3.6
|
compiler: clang-3.6
|
||||||
install:
|
install:
|
||||||
- echo "$PWD"
|
- 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
|
- bash .travis/install.sh
|
||||||
- export CXX=clang++-3.6 CC=clang-3.6;
|
- export CXX=clang++-3.6 CC=clang-3.6;
|
||||||
before_script:
|
before_script:
|
||||||
|
|
@ -25,7 +25,7 @@ before_script:
|
||||||
- cd ..
|
- cd ..
|
||||||
script:
|
script:
|
||||||
- cd ./.travis
|
- cd ./.travis
|
||||||
- bash -x -e ./build_package.sh $PACKAGE
|
- bash ./build_package.sh $PACKAGE
|
||||||
notifications:
|
notifications:
|
||||||
email:
|
email:
|
||||||
on_success: change # default: always
|
on_success: change # default: always
|
||||||
|
|
|
||||||
|
|
@ -27,14 +27,8 @@ find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Gui Svg)
|
||||||
|
|
||||||
include( ${CGAL_USE_FILE} )
|
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)
|
if(CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND)
|
||||||
|
|
||||||
include_directories ( ${QGLVIEWER_INCLUDE_DIR} )
|
|
||||||
|
|
||||||
qt5_wrap_ui( UI_FILES MainWindow.ui )
|
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}/Viewer_moc.cpp"
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/Scene_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
|
# Link with Qt libraries
|
||||||
target_link_libraries( AABB_demo PRIVATE
|
target_link_libraries( AABB_demo PRIVATE
|
||||||
Qt5::OpenGL Qt5::Gui
|
Qt5::OpenGL Qt5::Gui Qt5::Xml
|
||||||
CGAL::CGAL
|
CGAL::CGAL
|
||||||
CGAL::CGAL_Qt5
|
CGAL::CGAL_Qt5
|
||||||
${QGLVIEWER_LIBRARIES})
|
)
|
||||||
|
|
||||||
add_to_cached_list( CGAL_EXECUTABLE_TARGETS AABB_demo )
|
add_to_cached_list( CGAL_EXECUTABLE_TARGETS AABB_demo )
|
||||||
|
|
||||||
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
|
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
|
||||||
cgal_add_compilation_test(AABB_demo)
|
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 "")
|
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}")
|
set(AABB_MISSING_DEPS "Qt5, ${AABB_MISSING_DEPS}")
|
||||||
endif()
|
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.")
|
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 )
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ void MainWindow::updateViewerBBox()
|
||||||
const double xmax = bbox.xmax();
|
const double xmax = bbox.xmax();
|
||||||
const double ymax = bbox.ymax();
|
const double ymax = bbox.ymax();
|
||||||
const double zmax = bbox.zmax();
|
const double zmax = bbox.zmax();
|
||||||
qglviewer::Vec
|
CGAL::qglviewer::Vec
|
||||||
vec_min(xmin, ymin, zmin),
|
vec_min(xmin, ymin, zmin),
|
||||||
vec_max(xmax, ymax, zmax);
|
vec_max(xmax, ymax, zmax);
|
||||||
m_pViewer->setSceneBoundingBox(vec_min,vec_max);
|
m_pViewer->setSceneBoundingBox(vec_min,vec_max);
|
||||||
|
|
@ -411,11 +411,7 @@ void MainWindow::on_actionRefine_loop_triggered()
|
||||||
|
|
||||||
void MainWindow::on_actionSave_snapshot_triggered()
|
void MainWindow::on_actionSave_snapshot_triggered()
|
||||||
{
|
{
|
||||||
// save snapshot to file
|
return;
|
||||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
|
||||||
QString filename = QFileDialog::getSaveFileName(this,tr("Save snapshot to file..."),"snapshot00.png","*.png");
|
|
||||||
m_pViewer->saveSnapshot(filename);
|
|
||||||
QApplication::restoreOverrideCursor();
|
|
||||||
}
|
}
|
||||||
void MainWindow::on_actionCopy_snapshot_triggered()
|
void MainWindow::on_actionCopy_snapshot_triggered()
|
||||||
{
|
{
|
||||||
|
|
@ -424,12 +420,7 @@ void MainWindow::on_actionCopy_snapshot_triggered()
|
||||||
QClipboard *qb = QApplication::clipboard();
|
QClipboard *qb = QApplication::clipboard();
|
||||||
m_pViewer->makeCurrent();
|
m_pViewer->makeCurrent();
|
||||||
m_pViewer->raise();
|
m_pViewer->raise();
|
||||||
#if QGLVIEWER_VERSION >= 0x020700
|
|
||||||
QImage snapshot = m_pViewer->grabFramebuffer();
|
QImage snapshot = m_pViewer->grabFramebuffer();
|
||||||
#else
|
|
||||||
QImage snapshot = m_pViewer->grabFrameBuffer(true);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
qb->setImage(snapshot);
|
qb->setImage(snapshot);
|
||||||
QApplication::restoreOverrideCursor();
|
QApplication::restoreOverrideCursor();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ class Refiner
|
||||||
typedef typename Polyhedron::Edge_iterator Edge_iterator;
|
typedef typename Polyhedron::Edge_iterator Edge_iterator;
|
||||||
typedef std::priority_queue<Edge,
|
typedef std::priority_queue<Edge,
|
||||||
std::vector<Edge>,
|
std::vector<Edge>,
|
||||||
less<Edge> > PQueue;
|
::less<Edge> > PQueue;
|
||||||
// data
|
// data
|
||||||
PQueue m_queue;
|
PQueue m_queue;
|
||||||
Polyhedron* m_pMesh;
|
Polyhedron* m_pMesh;
|
||||||
|
|
|
||||||
|
|
@ -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;
|
QMatrix4x4 mvpMatrix;
|
||||||
double mat[16];
|
double mat[16];
|
||||||
|
|
@ -589,7 +589,7 @@ void Scene::update_bbox()
|
||||||
<< " facets)" << std::endl;
|
<< " facets)" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene::draw(QGLViewer* viewer)
|
void Scene::draw(CGAL::QGLViewer* viewer)
|
||||||
{
|
{
|
||||||
if(!gl_init)
|
if(!gl_init)
|
||||||
initGL();
|
initGL();
|
||||||
|
|
@ -766,8 +766,8 @@ Plane Scene::random_plane(const CGAL::Bbox_3& bbox)
|
||||||
|
|
||||||
Plane Scene::frame_plane() const
|
Plane Scene::frame_plane() const
|
||||||
{
|
{
|
||||||
const qglviewer::Vec& pos = m_frame->position();
|
const CGAL::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& n = m_frame->inverseTransformOf(CGAL::qglviewer::Vec(0.f, 0.f, 1.f));
|
||||||
|
|
||||||
return Plane(n[0], n[1], n[2], - n * pos);
|
return Plane(n[0], n[1], n[2], - n * pos);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,8 @@
|
||||||
|
|
||||||
#include <QtCore/qglobal.h>
|
#include <QtCore/qglobal.h>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QGLViewer/manipulatedFrame.h>
|
#include <CGAL/Qt/manipulatedFrame.h>
|
||||||
#include <QGLViewer/qglviewer.h>
|
#include <CGAL/Qt/qglviewer.h>
|
||||||
#include <QOpenGLFunctions_2_1>
|
|
||||||
#include <QOpenGLVertexArrayObject>
|
#include <QOpenGLVertexArrayObject>
|
||||||
#include <QOpenGLBuffer>
|
#include <QOpenGLBuffer>
|
||||||
#include <QOpenGLShaderProgram>
|
#include <QOpenGLShaderProgram>
|
||||||
|
|
@ -71,7 +70,7 @@ private:
|
||||||
typedef CGAL::AABB_traits<Kernel, Edge_Primitive> Edge_Traits;
|
typedef CGAL::AABB_traits<Kernel, Edge_Primitive> Edge_Traits;
|
||||||
typedef CGAL::AABB_tree<Edge_Traits> Edge_tree;
|
typedef CGAL::AABB_tree<Edge_Traits> Edge_tree;
|
||||||
|
|
||||||
typedef qglviewer::ManipulatedFrame ManipulatedFrame;
|
typedef CGAL::qglviewer::ManipulatedFrame ManipulatedFrame;
|
||||||
|
|
||||||
enum Cut_planes_types {
|
enum Cut_planes_types {
|
||||||
NONE, UNSIGNED_FACETS, SIGNED_FACETS, UNSIGNED_EDGES, CUT_SEGMENTS
|
NONE, UNSIGNED_FACETS, SIGNED_FACETS, UNSIGNED_EDGES, CUT_SEGMENTS
|
||||||
|
|
@ -79,7 +78,7 @@ private:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QGLContext* context;
|
QGLContext* context;
|
||||||
void draw(QGLViewer*);
|
void draw(CGAL::QGLViewer*);
|
||||||
void update_bbox();
|
void update_bbox();
|
||||||
Bbox bbox() { return m_bbox; }
|
Bbox bbox() { return m_bbox; }
|
||||||
ManipulatedFrame* manipulatedFrame() const { return m_frame; }
|
ManipulatedFrame* manipulatedFrame() const { return m_frame; }
|
||||||
|
|
@ -171,7 +170,7 @@ private:
|
||||||
QOpenGLShaderProgram rendering_program;
|
QOpenGLShaderProgram rendering_program;
|
||||||
void initialize_buffers();
|
void initialize_buffers();
|
||||||
void compute_elements(int mode);
|
void compute_elements(int mode);
|
||||||
void attrib_buffers(QGLViewer*);
|
void attrib_buffers(CGAL::QGLViewer*);
|
||||||
void compile_shaders();
|
void compile_shaders();
|
||||||
void compute_texture(int, int, Color_ramp, Color_ramp);
|
void compute_texture(int, int, Color_ramp, Color_ramp);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
#include <CGAL/Qt/CreateOpenGLContext.h>
|
#include <CGAL/Qt/CreateOpenGLContext.h>
|
||||||
|
|
||||||
Viewer::Viewer(QWidget* parent)
|
Viewer::Viewer(QWidget* parent)
|
||||||
: QGLViewer(CGAL::Qt::createOpenGLContext(),parent),
|
: CGAL::QGLViewer(parent),
|
||||||
m_pScene(NULL),
|
m_pScene(NULL),
|
||||||
m_custom_mouse(false)
|
m_custom_mouse(false)
|
||||||
{
|
{
|
||||||
|
|
@ -18,7 +18,7 @@ void Viewer::setScene(Scene* pScene)
|
||||||
|
|
||||||
void Viewer::draw()
|
void Viewer::draw()
|
||||||
{
|
{
|
||||||
QGLViewer::draw();
|
CGAL::QGLViewer::draw();
|
||||||
if(m_pScene != NULL)
|
if(m_pScene != NULL)
|
||||||
{
|
{
|
||||||
m_pScene->draw(this);
|
m_pScene->draw(this);
|
||||||
|
|
@ -28,7 +28,7 @@ void Viewer::draw()
|
||||||
|
|
||||||
void Viewer::initializeGL()
|
void Viewer::initializeGL()
|
||||||
{
|
{
|
||||||
QGLViewer::initializeGL();
|
CGAL::QGLViewer::initializeGL();
|
||||||
setBackgroundColor(::Qt::white);
|
setBackgroundColor(::Qt::white);
|
||||||
//m_pScene->initGL(this);
|
//m_pScene->initGL(this);
|
||||||
}
|
}
|
||||||
|
|
@ -43,7 +43,7 @@ void Viewer::mousePressEvent(QMouseEvent* e)
|
||||||
m_custom_mouse = true;
|
m_custom_mouse = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
QGLViewer::mousePressEvent(e);
|
CGAL::QGLViewer::mousePressEvent(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Viewer::mouseReleaseEvent(QMouseEvent* e)
|
void Viewer::mouseReleaseEvent(QMouseEvent* e)
|
||||||
|
|
@ -59,6 +59,6 @@ void Viewer::mouseReleaseEvent(QMouseEvent* e)
|
||||||
m_custom_mouse = false;
|
m_custom_mouse = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QGLViewer::mouseReleaseEvent(e);
|
CGAL::QGLViewer::mouseReleaseEvent(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,20 @@
|
||||||
#ifndef VIEWER_H
|
#ifndef VIEWER_H
|
||||||
#define VIEWER_H
|
#define VIEWER_H
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QGLViewer/qglviewer.h>
|
#include <CGAL/Qt/qglviewer.h>
|
||||||
|
|
||||||
|
|
||||||
// forward declarations
|
// forward declarations
|
||||||
class QWidget;
|
class QWidget;
|
||||||
class Scene;
|
class Scene;
|
||||||
class Viewer : public QGLViewer{
|
class Viewer : public CGAL::QGLViewer{
|
||||||
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Viewer(QWidget * parent);
|
Viewer(QWidget * parent);
|
||||||
|
|
||||||
// overload several QGLViewer virtual functions
|
// overload several CGAL::QGLViewer virtual functions
|
||||||
void draw();
|
void draw();
|
||||||
void initializeGL();
|
void initializeGL();
|
||||||
void setScene(Scene* pScene);
|
void setScene(Scene* pScene);
|
||||||
|
|
|
||||||
|
|
@ -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:
|
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;
|
typedef unspecified_type Construct_projected_point_3;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -291,7 +291,8 @@ public:
|
||||||
*/
|
*/
|
||||||
class Sort_primitives
|
class Sort_primitives
|
||||||
{
|
{
|
||||||
const AABB_traits<GeomTraits,AABBPrimitive,BboxMap>& m_traits;
|
typedef AABB_traits<GeomTraits,AABBPrimitive,BboxMap> Traits;
|
||||||
|
const Traits& m_traits;
|
||||||
public:
|
public:
|
||||||
Sort_primitives(const AABB_traits<GeomTraits,AABBPrimitive,BboxMap>& traits)
|
Sort_primitives(const AABB_traits<GeomTraits,AABBPrimitive,BboxMap>& traits)
|
||||||
: m_traits(traits) {}
|
: m_traits(traits) {}
|
||||||
|
|
@ -302,16 +303,16 @@ public:
|
||||||
const typename AT::Bounding_box& bbox) const
|
const typename AT::Bounding_box& bbox) const
|
||||||
{
|
{
|
||||||
PrimitiveIterator middle = first + (beyond - first)/2;
|
PrimitiveIterator middle = first + (beyond - first)/2;
|
||||||
switch(longest_axis(bbox))
|
switch(Traits::longest_axis(bbox))
|
||||||
{
|
{
|
||||||
case AT::CGAL_AXIS_X: // sort along x
|
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;
|
break;
|
||||||
case AT::CGAL_AXIS_Y: // sort along y
|
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;
|
break;
|
||||||
case AT::CGAL_AXIS_Z: // sort along z
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
CGAL_error();
|
CGAL_error();
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
#include <CGAL/AABB_face_graph_triangle_primitive.h>
|
#include <CGAL/AABB_face_graph_triangle_primitive.h>
|
||||||
#include <CGAL/AABB_halfedge_graph_segment_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>
|
#include <CGAL/disable_warnings.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@
|
||||||
#include <CGAL/AABB_traits.h>
|
#include <CGAL/AABB_traits.h>
|
||||||
|
|
||||||
#include <CGAL/AABB_face_graph_triangle_primitive.h>
|
#include <CGAL/AABB_face_graph_triangle_primitive.h>
|
||||||
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
|
|
||||||
#include <CGAL/Polyhedron_3.h>
|
#include <CGAL/Polyhedron_3.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,6 @@
|
||||||
#include <CGAL/Simple_cartesian.h>
|
#include <CGAL/Simple_cartesian.h>
|
||||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.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/Polyhedron_3.h>
|
||||||
|
|
||||||
#include <CGAL/AABB_tree.h>
|
#include <CGAL/AABB_tree.h>
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@
|
||||||
|
|
||||||
#include <CGAL/AABB_tree.h>
|
#include <CGAL/AABB_tree.h>
|
||||||
#include <CGAL/AABB_traits.h>
|
#include <CGAL/AABB_traits.h>
|
||||||
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
|
|
||||||
#include <CGAL/Polyhedron_3.h>
|
#include <CGAL/Polyhedron_3.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@
|
||||||
|
|
||||||
#include <CGAL/AABB_tree.h>
|
#include <CGAL/AABB_tree.h>
|
||||||
#include <CGAL/AABB_traits.h>
|
#include <CGAL/AABB_traits.h>
|
||||||
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
|
|
||||||
#include <CGAL/Polyhedron_3.h>
|
#include <CGAL/Polyhedron_3.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@
|
||||||
|
|
||||||
#include <CGAL/AABB_tree.h>
|
#include <CGAL/AABB_tree.h>
|
||||||
#include <CGAL/AABB_traits.h>
|
#include <CGAL/AABB_traits.h>
|
||||||
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
|
|
||||||
#include <CGAL/Polyhedron_3.h>
|
#include <CGAL/Polyhedron_3.h>
|
||||||
|
|
||||||
#include "AABB_test_util.h"
|
#include "AABB_test_util.h"
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,6 @@
|
||||||
#include <CGAL/Simple_cartesian.h>
|
#include <CGAL/Simple_cartesian.h>
|
||||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.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/Polyhedron_3.h>
|
||||||
|
|
||||||
#include <CGAL/AABB_tree.h>
|
#include <CGAL/AABB_tree.h>
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@
|
||||||
#include <CGAL/Simple_cartesian.h>
|
#include <CGAL/Simple_cartesian.h>
|
||||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.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/Polyhedron_3.h>
|
||||||
|
|
||||||
#include <CGAL/AABB_tree.h>
|
#include <CGAL/AABB_tree.h>
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,6 @@
|
||||||
#include <CGAL/Simple_cartesian.h>
|
#include <CGAL/Simple_cartesian.h>
|
||||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.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/Polyhedron_3.h>
|
||||||
|
|
||||||
#include <CGAL/AABB_tree.h>
|
#include <CGAL/AABB_tree.h>
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,6 @@
|
||||||
#include <CGAL/Simple_cartesian.h>
|
#include <CGAL/Simple_cartesian.h>
|
||||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.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/Polyhedron_3.h>
|
||||||
|
|
||||||
#include <CGAL/AABB_tree.h>
|
#include <CGAL/AABB_tree.h>
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@
|
||||||
|
|
||||||
#include <CGAL/AABB_tree.h>
|
#include <CGAL/AABB_tree.h>
|
||||||
#include <CGAL/AABB_traits.h>
|
#include <CGAL/AABB_traits.h>
|
||||||
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
|
|
||||||
#include <CGAL/Polyhedron_3.h>
|
#include <CGAL/Polyhedron_3.h>
|
||||||
#include <CGAL/AABB_face_graph_triangle_primitive.h>
|
#include <CGAL/AABB_face_graph_triangle_primitive.h>
|
||||||
#include <CGAL/Timer.h>
|
#include <CGAL/Timer.h>
|
||||||
|
|
|
||||||
|
|
@ -202,6 +202,8 @@ public:
|
||||||
|
|
||||||
}; // class Algebraic_real_traits
|
}; // class Algebraic_real_traits
|
||||||
|
|
||||||
|
struct Construct_algebraic_real_1;
|
||||||
|
|
||||||
// Functors of Algebraic_kernel_d_1
|
// Functors of Algebraic_kernel_d_1
|
||||||
struct Solve_1 {
|
struct Solve_1 {
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ namespace internal {
|
||||||
//
|
//
|
||||||
template < class Input_traits, class Kernel_approx, class Kernel_exact,
|
template < class Input_traits, class Kernel_approx, class Kernel_exact,
|
||||||
class Weighted_tag >
|
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;
|
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 >
|
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 */>
|
::CGAL::Tag_true /* Weighted_tag */>
|
||||||
{
|
{
|
||||||
typedef typename Kernel_traits<typename Input_traits::Point_2>::Kernel Kernel_input;
|
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
|
Approx_point to_approx(const Input_point& wp) const
|
||||||
{
|
{
|
||||||
// The traits class' Point_2 must be convertible using the Cartesian converter
|
// 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));
|
Input_traits, Kernel_approx, Kernel_exact, Weighted_tag>::value));
|
||||||
|
|
||||||
To_approx converter;
|
To_approx converter;
|
||||||
|
|
@ -167,7 +167,7 @@ class Lazy_alpha_nt_2
|
||||||
Exact_point to_exact(const Input_point& wp) const
|
Exact_point to_exact(const Input_point& wp) const
|
||||||
{
|
{
|
||||||
// The traits class' Point_2 must be convertible using the Cartesian converter
|
// 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));
|
Input_traits, Kernel_approx, Kernel_exact, Weighted_tag>::value));
|
||||||
|
|
||||||
To_exact converter;
|
To_exact converter;
|
||||||
|
|
|
||||||
|
|
@ -21,15 +21,11 @@ include(${CGAL_USE_FILE})
|
||||||
|
|
||||||
find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg)
|
find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg)
|
||||||
|
|
||||||
find_package(QGLViewer)
|
if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND )
|
||||||
|
|
||||||
if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND QGLVIEWER_FOUND )
|
|
||||||
|
|
||||||
add_definitions(-DQT_NO_KEYWORDS)
|
add_definitions(-DQT_NO_KEYWORDS)
|
||||||
|
|
||||||
# include(${QT_USE_FILE})
|
# include(${QT_USE_FILE})
|
||||||
|
|
||||||
include_directories (${QGLVIEWER_INCLUDE_DIR})
|
|
||||||
include_directories (BEFORE ../../include ./ )
|
include_directories (BEFORE ../../include ./ )
|
||||||
|
|
||||||
# ui file, created wih Qt Designer
|
# 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
|
target_link_libraries( Alpha_shape_3 PRIVATE
|
||||||
CGAL::CGAL CGAL::CGAL_Qt5
|
CGAL::CGAL CGAL::CGAL_Qt5
|
||||||
Qt5::OpenGL Qt5::Gui
|
Qt5::OpenGL Qt5::Gui )
|
||||||
${QGLVIEWER_LIBRARIES} )
|
|
||||||
|
|
||||||
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
|
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
|
||||||
cgal_add_compilation_test(Alpha_shape_3)
|
cgal_add_compilation_test(Alpha_shape_3)
|
||||||
|
|
||||||
else()
|
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()
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
#include "Viewer.h"
|
#include "Viewer.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <CGAL/bounding_box.h>
|
#include <CGAL/bounding_box.h>
|
||||||
#include <QGLViewer/vec.h>
|
#include <CGAL/Qt/vec.h>
|
||||||
#include "CGAL/Qt/CreateOpenGLContext.h"
|
#include "CGAL/Qt/CreateOpenGLContext.h"
|
||||||
|
|
||||||
Viewer::Viewer(QWidget* parent)
|
Viewer::Viewer(QWidget* parent)
|
||||||
: QGLViewer(CGAL::Qt::createOpenGLContext(),parent)
|
: CGAL::QGLViewer(parent)
|
||||||
{
|
{
|
||||||
are_buffers_initialized = false;
|
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 mvpMatrix;
|
||||||
QMatrix4x4 mvMatrix;
|
QMatrix4x4 mvMatrix;
|
||||||
|
|
@ -261,7 +261,7 @@ void Viewer::attrib_buffers(QGLViewer* viewer)
|
||||||
|
|
||||||
void Viewer::initializeGL()
|
void Viewer::initializeGL()
|
||||||
{
|
{
|
||||||
QGLViewer::initializeGL();
|
CGAL::QGLViewer::initializeGL();
|
||||||
compile_shaders();
|
compile_shaders();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -272,8 +272,8 @@ Viewer::sceneChanged()
|
||||||
|
|
||||||
Iso_cuboid_3 bb = CGAL::bounding_box(scene->points.begin(), scene->points.end());
|
Iso_cuboid_3 bb = CGAL::bounding_box(scene->points.begin(), scene->points.end());
|
||||||
|
|
||||||
this->camera()->setSceneBoundingBox(qglviewer::Vec(bb.xmin(), bb.ymin(), bb.zmin()),
|
this->camera()->setSceneBoundingBox(CGAL::qglviewer::Vec(bb.xmin(), bb.ymin(), bb.zmin()),
|
||||||
qglviewer::Vec(bb.xmax(),
|
CGAL::qglviewer::Vec(bb.xmax(),
|
||||||
bb.ymax(),
|
bb.ymax(),
|
||||||
bb.zmax()));
|
bb.zmax()));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,14 @@
|
||||||
|
|
||||||
#include "typedefs.h"
|
#include "typedefs.h"
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QGLViewer/qglviewer.h>
|
#include <CGAL/Qt/qglviewer.h>
|
||||||
#include <QOpenGLFunctions_2_1>
|
#include <QOpenGLFunctions_2_1>
|
||||||
#include <QOpenGLVertexArrayObject>
|
#include <QOpenGLVertexArrayObject>
|
||||||
#include <QOpenGLBuffer>
|
#include <QOpenGLBuffer>
|
||||||
#include <QOpenGLShaderProgram>
|
#include <QOpenGLShaderProgram>
|
||||||
|
|
||||||
|
|
||||||
class Viewer : public QGLViewer, protected QOpenGLFunctions_2_1{
|
class Viewer : public CGAL::QGLViewer{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
CGAL::Timer timer;
|
CGAL::Timer timer;
|
||||||
|
|
@ -61,7 +61,7 @@ private:
|
||||||
QOpenGLShaderProgram rendering_program_points;
|
QOpenGLShaderProgram rendering_program_points;
|
||||||
void initialize_buffers();
|
void initialize_buffers();
|
||||||
void compute_elements();
|
void compute_elements();
|
||||||
void attrib_buffers(QGLViewer*);
|
void attrib_buffers(CGAL::QGLViewer*);
|
||||||
void compile_shaders();
|
void compile_shaders();
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
void initializeGL();
|
void initializeGL();
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ namespace internal{
|
||||||
//
|
//
|
||||||
template < class Input_traits, class Kernel_approx, class Kernel_exact,
|
template < class Input_traits, class Kernel_approx, class Kernel_exact,
|
||||||
class Weighted_tag >
|
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;
|
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 >
|
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 */>
|
::CGAL::Tag_true /* Weighted_tag */>
|
||||||
{
|
{
|
||||||
typedef typename Kernel_traits<typename Input_traits::Point_3>::Kernel Kernel_input;
|
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
|
Approx_point to_approx(const Input_point& wp) const
|
||||||
{
|
{
|
||||||
// The traits class' Point_3 must be convertible using the Cartesian converter
|
// 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));
|
Input_traits, Kernel_approx, Kernel_exact, Weighted_tag>::value));
|
||||||
|
|
||||||
To_approx converter;
|
To_approx converter;
|
||||||
|
|
@ -158,7 +158,7 @@ class Lazy_alpha_nt_3{
|
||||||
Exact_point to_exact(const Input_point& wp) const
|
Exact_point to_exact(const Input_point& wp) const
|
||||||
{
|
{
|
||||||
// The traits class' Point_3 must be convertible using the Cartesian converter
|
// 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));
|
Input_traits, Kernel_approx, Kernel_exact, Weighted_tag>::value));
|
||||||
|
|
||||||
To_exact converter;
|
To_exact converter;
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
#include "NewTabDialog.h"
|
#include "NewTabDialog.h"
|
||||||
#include "ArrangementDemoWindow.h"
|
#include "ArrangementDemoWindow.h"
|
||||||
#include "ui_NewTabDialog.h"
|
#include "ui_NewTabDialog.h"
|
||||||
|
#include <QButtonGroup>
|
||||||
|
|
||||||
NewTabDialog::NewTabDialog( QWidget* parent, Qt::WindowFlags f ) :
|
NewTabDialog::NewTabDialog( QWidget* parent, Qt::WindowFlags f ) :
|
||||||
QDialog( parent, f ),
|
QDialog( parent, f ),
|
||||||
|
|
|
||||||
|
|
@ -784,7 +784,7 @@ public:
|
||||||
* \return SMALLER if the curve is directed right;
|
* \return SMALLER if the curve is directed right;
|
||||||
* LARGER if the curve is directed left.
|
* 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())
|
if (cv.is_directed_right())
|
||||||
return (SMALLER);
|
return (SMALLER);
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@
|
||||||
* The header file for the Arr_circle_segment_traits_2<Kenrel> class.
|
* The header file for the Arr_circle_segment_traits_2<Kenrel> class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <CGAL/atomic.h>
|
||||||
#include <CGAL/tags.h>
|
#include <CGAL/tags.h>
|
||||||
#include <CGAL/Arr_tags.h>
|
#include <CGAL/Arr_tags.h>
|
||||||
#include <CGAL/Arr_geometry_traits/Circle_segment_2.h>
|
#include <CGAL/Arr_geometry_traits/Circle_segment_2.h>
|
||||||
|
|
@ -84,7 +85,11 @@ public:
|
||||||
/*! Get the next curve index. */
|
/*! Get the next curve index. */
|
||||||
static unsigned int get_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);
|
return (++index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@
|
||||||
* The conic traits-class for the arrangement package.
|
* The conic traits-class for the arrangement package.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <CGAL/atomic.h>
|
||||||
#include <CGAL/tags.h>
|
#include <CGAL/tags.h>
|
||||||
#include <CGAL/Arr_tags.h>
|
#include <CGAL/Arr_tags.h>
|
||||||
#include <CGAL/Arr_geometry_traits/Conic_arc_2.h>
|
#include <CGAL/Arr_geometry_traits/Conic_arc_2.h>
|
||||||
|
|
@ -114,7 +115,11 @@ public:
|
||||||
/*! Get the next conic index. */
|
/*! Get the next conic index. */
|
||||||
static unsigned int get_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);
|
return (++index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,15 +16,15 @@
|
||||||
// $Id$
|
// $Id$
|
||||||
// SPDX-License-Identifier: GPL-3.0+
|
// SPDX-License-Identifier: GPL-3.0+
|
||||||
//
|
//
|
||||||
// Author(s) : Oren Nechushtan <theoren@math.tau.ac.il>
|
// Author(s): Oren Nechushtan <theoren@math.tau.ac.il>
|
||||||
// updated by: Michal Balas <balasmic@post.tau.ac.il>
|
// Michal Balas <balasmic@post.tau.ac.il>
|
||||||
|
// Efi Fogel <efifogel@gmail.com>
|
||||||
|
|
||||||
#ifndef CGAL_TD_ACTIVE_FICTITIOUS_VERTEX_H
|
#ifndef CGAL_TD_ACTIVE_FICTITIOUS_VERTEX_H
|
||||||
#define CGAL_TD_ACTIVE_FICTITIOUS_VERTEX_H
|
#define CGAL_TD_ACTIVE_FICTITIOUS_VERTEX_H
|
||||||
|
|
||||||
#include <CGAL/license/Arrangement_on_surface_2.h>
|
#include <CGAL/license/Arrangement_on_surface_2.h>
|
||||||
|
|
||||||
|
|
||||||
/*! \file
|
/*! \file
|
||||||
* Defintion of the Td_active_fictitious_vertex<Td_traits> class.
|
* Defintion of the Td_active_fictitious_vertex<Td_traits> class.
|
||||||
*/
|
*/
|
||||||
|
|
@ -33,7 +33,6 @@
|
||||||
#include <boost/variant.hpp>
|
#include <boost/variant.hpp>
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
|
|
||||||
|
|
||||||
#ifdef CGAL_TD_DEBUG
|
#ifdef CGAL_TD_DEBUG
|
||||||
#define CGAL_TD_INLINE
|
#define CGAL_TD_INLINE
|
||||||
#else
|
#else
|
||||||
|
|
@ -57,9 +56,8 @@ namespace CGAL {
|
||||||
* 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).
|
* edge-end (end point).
|
||||||
*/
|
*/
|
||||||
template <class Td_traits_>
|
template <typename Td_traits_>
|
||||||
class Td_active_fictitious_vertex : public Handle
|
class Td_active_fictitious_vertex : public Handle {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//type of traits class
|
//type of traits class
|
||||||
|
|
@ -98,7 +96,6 @@ public:
|
||||||
//type of Trapezoidal map search structure
|
//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 declarations:
|
||||||
|
|
||||||
friend class Trapezoidal_decomposition_2<Traits>;
|
friend class Trapezoidal_decomposition_2<Traits>;
|
||||||
|
|
@ -122,19 +119,17 @@ public:
|
||||||
/*! \class
|
/*! \class
|
||||||
* Inner class Data derived from Rep class
|
* Inner class Data derived from Rep class
|
||||||
*/
|
*/
|
||||||
class Data : public Rep
|
class Data : public Rep {
|
||||||
{
|
|
||||||
friend class Td_active_fictitious_vertex<Td_traits_>;
|
friend class Td_active_fictitious_vertex<Td_traits_>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//c'tors
|
//c'tors
|
||||||
Data (Vertex_const_handle _v,
|
Data(Vertex_const_handle _v, Halfedge_const_handle _cw_he,
|
||||||
Halfedge_const_handle _cw_he,
|
Dag_node* _p_node) :
|
||||||
Dag_node* _p_node)
|
v(_v), cw_he(_cw_he), p_node(_p_node)
|
||||||
: v(_v),cw_he(_cw_he),p_node(_p_node)
|
{}
|
||||||
{ }
|
|
||||||
|
|
||||||
~Data() { }
|
~Data() {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Vertex_const_handle v;
|
Vertex_const_handle v;
|
||||||
|
|
@ -142,8 +137,7 @@ public:
|
||||||
Dag_node* p_node;
|
Dag_node* p_node;
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Data* ptr() const { return (Data*)(PTR); }
|
Data* ptr() const { return (Data*)(PTR); }
|
||||||
|
|
||||||
Curve_end vtx_to_ce(Vertex_const_handle v) const
|
Curve_end vtx_to_ce(Vertex_const_handle v) const
|
||||||
|
|
@ -156,75 +150,57 @@ public:
|
||||||
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;
|
||||||
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(),
|
return Curve_end(he->curve(), ((he->direction() == ARR_RIGHT_TO_LEFT) ?
|
||||||
(he->direction() == ARR_RIGHT_TO_LEFT)?
|
ARR_MIN_END : ARR_MAX_END));
|
||||||
ARR_MIN_END : ARR_MAX_END);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef CGAL_TD_DEBUG
|
#ifndef CGAL_TD_DEBUG
|
||||||
#ifdef CGAL_PM_FRIEND_CLASS
|
#ifdef CGAL_PM_FRIEND_CLASS
|
||||||
protected:
|
protected:
|
||||||
#else
|
#else
|
||||||
public: // workaround
|
public: // workaround
|
||||||
#endif
|
#endif
|
||||||
#else //CGAL_TD_DEBUG
|
#else //CGAL_TD_DEBUG
|
||||||
public:
|
public:
|
||||||
#endif //CGAL_TD_DEBUG
|
#endif //CGAL_TD_DEBUG
|
||||||
|
|
||||||
|
|
||||||
/*! Set the DAG node. */
|
/*! Set the DAG node. */
|
||||||
inline void set_dag_node(Dag_node* p)
|
inline void set_dag_node(Dag_node* p) { ptr()->p_node = p; }
|
||||||
{
|
|
||||||
ptr()->p_node = p;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*! Set the vertex handle (Vertex_const_handle). */
|
/*! 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; }
|
||||||
{
|
|
||||||
ptr()->v = v;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*! Set the first he going clockwise starting at 12 o'clock (Halfedge_const_handle). */
|
/*! Set the first he going clockwise starting at 12 o'clock.
|
||||||
|
*/
|
||||||
inline void set_cw_he(Halfedge_const_handle he)
|
inline void set_cw_he(Halfedge_const_handle he)
|
||||||
{
|
{
|
||||||
if (cw_he() != Traits::empty_he_handle() &&
|
ptr()->cw_he = ((cw_he() != Traits::empty_he_handle()) &&
|
||||||
cw_he()->direction() != he->direction())
|
(cw_he()->direction() != he->direction())) ?
|
||||||
{
|
he->twin() : he;
|
||||||
ptr()->cw_he = he->twin();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ptr()->cw_he = he;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*! Reset the first he going clockwise starting at 12 o'clock.
|
||||||
|
*/
|
||||||
|
inline void reset_cw_he() { ptr()->cw_he = Traits::empty_he_handle(); }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// \name Constructors.
|
/// \name Constructors.
|
||||||
//@{
|
//@{
|
||||||
|
|
||||||
Td_active_fictitious_vertex ()
|
Td_active_fictitious_vertex()
|
||||||
{
|
{
|
||||||
PTR = new Data
|
PTR = new Data(Traits::empty_vtx_handle(), Traits::empty_he_handle(), NULL);
|
||||||
(Traits::empty_vtx_handle(), Traits::empty_he_handle(), NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! Constructor given Vertex & Halfedge handles. */
|
/*! Constructor given Vertex & Halfedge handles. */
|
||||||
Td_active_fictitious_vertex (Vertex_const_handle v,
|
Td_active_fictitious_vertex(Vertex_const_handle v,
|
||||||
Halfedge_const_handle cw_he,
|
Halfedge_const_handle cw_he,
|
||||||
Dag_node* node = 0)
|
Dag_node* node = 0)
|
||||||
|
{ PTR = new Data(v, cw_he, node); }
|
||||||
|
|
||||||
{
|
|
||||||
PTR = new Data(v, cw_he, node);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*! Copy constructor. */
|
/*! Copy constructor. */
|
||||||
Td_active_fictitious_vertex (const Self& tr) : Handle(tr)
|
Td_active_fictitious_vertex (const Self& tr) : Handle(tr) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
|
|
@ -235,77 +211,45 @@ public:
|
||||||
* operator= should not copy m_dag_node (or otherwise update
|
* operator= should not copy m_dag_node (or otherwise update
|
||||||
* Dag_node::replace)
|
* Dag_node::replace)
|
||||||
*/
|
*/
|
||||||
inline Self& operator= (const Self& t2)
|
inline Self& operator=(const Self& t2)
|
||||||
{
|
{
|
||||||
Handle::operator=(t2);
|
Handle::operator=(t2);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! Operator==. */
|
/*! Operator==. */
|
||||||
inline bool operator== (const Self& t2) const
|
inline bool operator==(const Self& t2) const { return (ptr() == t2.ptr()); }
|
||||||
{
|
|
||||||
return (ptr() == t2.ptr());
|
|
||||||
}
|
|
||||||
|
|
||||||
/*! Operator!=. */
|
/*! Operator!=. */
|
||||||
inline bool operator!= (const Self& t2) const
|
inline bool operator!=(const Self& t2) const { return !(operator==(t2)); }
|
||||||
{
|
|
||||||
return !(operator==(t2));
|
|
||||||
}
|
|
||||||
|
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
|
|
||||||
/// \name Access methods.
|
/// \name Access methods.
|
||||||
//@{
|
//@{
|
||||||
|
|
||||||
inline Self& self()
|
inline Self& self() { return *this; }
|
||||||
{
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline const Self& self() const
|
inline const Self& self() const { return *this; }
|
||||||
{
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*! Access the trapezoid id (PTR). */
|
/*! Access the trapezoid id (PTR). */
|
||||||
inline unsigned long id() const
|
inline unsigned long id() const { return (unsigned long) PTR; }
|
||||||
{
|
|
||||||
return (unsigned long) PTR;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*! Access trapezoid left.
|
/*! Access trapezoid left.
|
||||||
* filters out the infinite case which returns predefined dummy values
|
* filters out the infinite case which returns predefined dummy values
|
||||||
*/
|
*/
|
||||||
inline Vertex_const_handle vertex() const
|
inline Vertex_const_handle vertex() const { return ptr()->v; }
|
||||||
{
|
|
||||||
return ptr()->v;
|
|
||||||
}
|
|
||||||
|
|
||||||
Curve_end curve_end() const
|
Curve_end curve_end() const { return vtx_to_ce(vertex()); }
|
||||||
{
|
|
||||||
return vtx_to_ce(vertex());
|
|
||||||
}
|
|
||||||
|
|
||||||
/*! Access the first he starting at 12 o'clock clockwise.
|
/*! Access the first he starting at 12 o'clock clockwise.
|
||||||
*/
|
*/
|
||||||
inline Halfedge_const_handle cw_he () const
|
inline Halfedge_const_handle cw_he() const { return ptr()->cw_he; }
|
||||||
{
|
|
||||||
return ptr()->cw_he;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*! Access DAG node. */
|
/*! 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
|
} //namespace CGAL
|
||||||
|
|
|
||||||
|
|
@ -16,15 +16,15 @@
|
||||||
// $Id$
|
// $Id$
|
||||||
// SPDX-License-Identifier: GPL-3.0+
|
// SPDX-License-Identifier: GPL-3.0+
|
||||||
//
|
//
|
||||||
// Author(s) : Oren Nechushtan <theoren@math.tau.ac.il>
|
// Author(s): Oren Nechushtan <theoren@math.tau.ac.il>
|
||||||
// updated by: Michal Balas <balasmic@post.tau.ac.il>
|
// Michal Balas <balasmic@post.tau.ac.il>
|
||||||
|
// Efi Fogel <efifogel@gmail.com>
|
||||||
|
|
||||||
#ifndef CGAL_TD_ACTIVE_VERTEX_H
|
#ifndef CGAL_TD_ACTIVE_VERTEX_H
|
||||||
#define CGAL_TD_ACTIVE_VERTEX_H
|
#define CGAL_TD_ACTIVE_VERTEX_H
|
||||||
|
|
||||||
#include <CGAL/license/Arrangement_on_surface_2.h>
|
#include <CGAL/license/Arrangement_on_surface_2.h>
|
||||||
|
|
||||||
|
|
||||||
/*! \file
|
/*! \file
|
||||||
* Defintion of the Td_active_vertex<Td_traits> class.
|
* Defintion of the Td_active_vertex<Td_traits> class.
|
||||||
*/
|
*/
|
||||||
|
|
@ -57,10 +57,9 @@ namespace CGAL {
|
||||||
* 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).
|
* edge-end (end point).
|
||||||
*/
|
*/
|
||||||
template <class Td_traits_>
|
template <typename Td_traits_>
|
||||||
class Td_active_vertex : public Handle
|
class Td_active_vertex : public Handle {
|
||||||
{
|
public:
|
||||||
public:
|
|
||||||
|
|
||||||
//type of traits class
|
//type of traits class
|
||||||
typedef Td_traits_ Traits;
|
typedef Td_traits_ Traits;
|
||||||
|
|
@ -122,19 +121,17 @@ class Td_active_vertex : public Handle
|
||||||
/*! \class
|
/*! \class
|
||||||
* Inner class Data derived from Rep class
|
* Inner class Data derived from Rep class
|
||||||
*/
|
*/
|
||||||
class Data : public Rep
|
class Data : public Rep {
|
||||||
{
|
|
||||||
friend class Td_active_vertex<Td_traits_>;
|
friend class Td_active_vertex<Td_traits_>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//c'tors
|
//c'tors
|
||||||
Data (Vertex_const_handle _v,
|
Data(Vertex_const_handle _v, Halfedge_const_handle _cw_he,
|
||||||
Halfedge_const_handle _cw_he,
|
Dag_node* _p_node) :
|
||||||
Dag_node* _p_node)
|
v(_v), cw_he(_cw_he), p_node(_p_node)
|
||||||
: v(_v),cw_he(_cw_he),p_node(_p_node)
|
{}
|
||||||
{ }
|
|
||||||
|
|
||||||
~Data() { }
|
~Data() {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Vertex_const_handle v;
|
Vertex_const_handle v;
|
||||||
|
|
@ -142,8 +139,7 @@ class Td_active_vertex : public Handle
|
||||||
Dag_node* p_node;
|
Dag_node* p_node;
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Data* ptr() const { return (Data*)(PTR); }
|
Data* ptr() const { return (Data*)(PTR); }
|
||||||
|
|
||||||
Curve_end vtx_to_ce(Vertex_const_handle v) const
|
Curve_end vtx_to_ce(Vertex_const_handle v) const
|
||||||
|
|
@ -156,77 +152,57 @@ class Td_active_vertex : public Handle
|
||||||
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;
|
||||||
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(),
|
return Curve_end(he->curve(), ((he->direction() == ARR_RIGHT_TO_LEFT) ?
|
||||||
(he->direction() == ARR_RIGHT_TO_LEFT)?
|
ARR_MIN_END : ARR_MAX_END));
|
||||||
ARR_MIN_END : ARR_MAX_END);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifndef CGAL_TD_DEBUG
|
#ifndef CGAL_TD_DEBUG
|
||||||
#ifdef CGAL_PM_FRIEND_CLASS
|
#ifdef CGAL_PM_FRIEND_CLASS
|
||||||
protected:
|
protected:
|
||||||
#else
|
#else
|
||||||
public: // workaround
|
public: // workaround
|
||||||
#endif
|
#endif
|
||||||
#else //CGAL_TD_DEBUG
|
#else //CGAL_TD_DEBUG
|
||||||
public:
|
public:
|
||||||
#endif //CGAL_TD_DEBUG
|
#endif //CGAL_TD_DEBUG
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*! Set the DAG node. */
|
/*! Set the DAG node. */
|
||||||
inline void set_dag_node(Dag_node* p)
|
inline void set_dag_node(Dag_node* p) { ptr()->p_node = p; }
|
||||||
{
|
|
||||||
ptr()->p_node = p;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*! Set the vertex handle (Vertex_const_handle). */
|
/*! 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; }
|
||||||
{
|
|
||||||
ptr()->v = v;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*! Set the first he going clockwise starting at 12 o'clock (Halfedge_const_handle). */
|
/*! Set the first he going clockwise starting at 12 o'clock.
|
||||||
|
*/
|
||||||
inline void set_cw_he(Halfedge_const_handle he)
|
inline void set_cw_he(Halfedge_const_handle he)
|
||||||
{
|
{
|
||||||
if (cw_he() != Traits::empty_he_handle() &&
|
ptr()->cw_he = ((cw_he() != Traits::empty_he_handle()) &&
|
||||||
cw_he()->direction() != he->direction())
|
(cw_he()->direction() != he->direction())) ?
|
||||||
{
|
he->twin() : he;
|
||||||
ptr()->cw_he = he->twin();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ptr()->cw_he = he;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*! Reset the first he going clockwise starting at 12 o'clock.
|
||||||
|
*/
|
||||||
|
inline void reset_cw_he() { ptr()->cw_he = Traits::empty_he_handle(); }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// \name Constructors.
|
/// \name Constructors.
|
||||||
//@{
|
//@{
|
||||||
|
|
||||||
Td_active_vertex ()
|
Td_active_vertex()
|
||||||
{
|
{
|
||||||
PTR = new Data
|
PTR = new Data(Traits::empty_vtx_handle(), Traits::empty_he_handle(), NULL);
|
||||||
(Traits::empty_vtx_handle(), Traits::empty_he_handle(), NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*! Constructor given Vertex & Halfedge handles. */
|
/*! Constructor given Vertex & Halfedge handles. */
|
||||||
Td_active_vertex (Vertex_const_handle v,
|
Td_active_vertex(Vertex_const_handle v, Halfedge_const_handle cw_he,
|
||||||
Halfedge_const_handle cw_he,
|
|
||||||
Dag_node* node = 0)
|
Dag_node* node = 0)
|
||||||
|
|
||||||
{
|
{ PTR = new Data(v, cw_he, node); }
|
||||||
PTR = new Data (v, cw_he, node);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*! Copy constructor. */
|
/*! Copy constructor. */
|
||||||
Td_active_vertex(const Self& tr) : Handle(tr)
|
Td_active_vertex(const Self& tr) : Handle(tr) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
|
|
@ -237,77 +213,44 @@ class Td_active_vertex : public Handle
|
||||||
* operator= should not copy m_dag_node (or otherwise update
|
* operator= should not copy m_dag_node (or otherwise update
|
||||||
* Dag_node::replace)
|
* Dag_node::replace)
|
||||||
*/
|
*/
|
||||||
inline Self& operator= (const Self& t2)
|
inline Self& operator=(const Self& t2)
|
||||||
{
|
{
|
||||||
Handle::operator=(t2);
|
Handle::operator=(t2);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! Operator==. */
|
/*! Operator==. */
|
||||||
inline bool operator== (const Self& t2) const
|
inline bool operator==(const Self& t2) const { return (ptr() == t2.ptr()); }
|
||||||
{
|
|
||||||
return (ptr() == t2.ptr());
|
|
||||||
}
|
|
||||||
|
|
||||||
/*! Operator!=. */
|
/*! Operator!=. */
|
||||||
inline bool operator!= (const Self& t2) const
|
inline bool operator!=(const Self& t2) const { return !(operator==(t2)); }
|
||||||
{
|
|
||||||
return !(operator==(t2));
|
|
||||||
}
|
|
||||||
|
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
|
|
||||||
/// \name Access methods.
|
/// \name Access methods.
|
||||||
//@{
|
//@{
|
||||||
|
|
||||||
inline Self& self()
|
inline Self& self() { return *this; }
|
||||||
{
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline const Self& self() const
|
inline const Self& self() const { return *this; }
|
||||||
{
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*! Access the trapezoid id (PTR). */
|
/*! Access the trapezoid id (PTR). */
|
||||||
inline unsigned long id() const
|
inline unsigned long id() const { return (unsigned long) PTR; }
|
||||||
{
|
|
||||||
return (unsigned long) PTR;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Vertex_const_handle vertex() const
|
inline Vertex_const_handle vertex() const { return ptr()->v; }
|
||||||
{
|
|
||||||
return ptr()->v;
|
|
||||||
}
|
|
||||||
|
|
||||||
Curve_end curve_end() const
|
Curve_end curve_end() const { return vtx_to_ce(vertex()); }
|
||||||
{
|
|
||||||
return vtx_to_ce(vertex());
|
|
||||||
}
|
|
||||||
|
|
||||||
inline const Point& point() const
|
inline const Point& point() const { return vertex()->point(); }
|
||||||
{
|
|
||||||
return vertex()->point();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*! Access the first he starting at 12 o'clock clockwise.
|
/*! Access the first he starting at 12 o'clock clockwise.
|
||||||
*/
|
*/
|
||||||
inline Halfedge_const_handle cw_he () const
|
inline Halfedge_const_handle cw_he() const { return ptr()->cw_he; }
|
||||||
{
|
|
||||||
return ptr()->cw_he;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*! Access DAG node. */
|
/*! Access DAG node. */
|
||||||
Dag_node* dag_node() const {return ptr()->p_node; }
|
Dag_node* dag_node() const { return ptr()->p_node; }
|
||||||
|
|
||||||
|
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} //namespace CGAL
|
} //namespace CGAL
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,9 @@
|
||||||
// $Id$
|
// $Id$
|
||||||
// SPDX-License-Identifier: GPL-3.0+
|
// SPDX-License-Identifier: GPL-3.0+
|
||||||
//
|
//
|
||||||
// Author(s) : Oren Nechushtan <theoren@math.tau.ac.il>
|
// Author(s): Oren Nechushtan <theoren@math.tau.ac.il>
|
||||||
// Iddo Hanniel <hanniel@math.tau.ac.il>
|
// Iddo Hanniel <hanniel@math.tau.ac.il>
|
||||||
|
// Efi Fogel <efifogel@gmail.com>
|
||||||
|
|
||||||
#ifndef CGAL_TRAPEZOIDAL_DECOMPOSITION_2_H
|
#ifndef CGAL_TRAPEZOIDAL_DECOMPOSITION_2_H
|
||||||
#define 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:
|
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
|
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:
|
private:
|
||||||
Halfedge_const_handle m_cw_he;
|
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*>
|
class dag_node_visitor : public boost::static_visitor<Dag_node*>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -1151,6 +1159,11 @@ protected:
|
||||||
Halfedge_const_handle new_he,
|
Halfedge_const_handle new_he,
|
||||||
Td_map_item& vtx_item);
|
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
|
////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,
|
//void set_trp_params_after_split_halfedge_update(Halfedge_const_handle new_he,
|
||||||
// Td_map_item& vtx_item,
|
// Td_map_item& vtx_item,
|
||||||
|
|
@ -1758,22 +1771,20 @@ public:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Halfedge_container container;
|
Halfedge_container container;
|
||||||
|
|
||||||
#ifdef CGAL_TD_DEBUG
|
#ifdef CGAL_TD_DEBUG
|
||||||
unsigned long rep = Halfedge_filter(container, &dag_root());
|
unsigned long rep = Halfedge_filter(container, &dag_root());
|
||||||
|
#else
|
||||||
|
Halfedge_filter(container, &dag_root());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
clear();
|
clear();
|
||||||
|
|
||||||
//// initialize container to point to curves in Td_map_item Tree
|
//// initialize container to point to curves in Td_map_item Tree
|
||||||
//if (rep>0)
|
//if (rep>0) {
|
||||||
//{
|
|
||||||
// bool o = set_with_guarantees(false);
|
// bool o = set_with_guarantees(false);
|
||||||
// typename std::vector<Halfedge_const_handle>::iterator
|
// typename std::vector<Halfedge_const_handle>::iterator
|
||||||
// it = container.begin(),
|
// it = container.begin(),
|
||||||
// it_end = container.end();
|
// it_end = container.end();
|
||||||
// while(it!=it_end)
|
// while (it != it_end) {
|
||||||
// {
|
|
||||||
// insert(*it);
|
// insert(*it);
|
||||||
// ++it;
|
// ++it;
|
||||||
// }
|
// }
|
||||||
|
|
@ -1787,8 +1798,7 @@ public:
|
||||||
#ifdef CGAL_TD_DEBUG
|
#ifdef CGAL_TD_DEBUG
|
||||||
CGAL_assertion(is_valid());
|
CGAL_assertion(is_valid());
|
||||||
unsigned long sz = number_of_curves();
|
unsigned long sz = number_of_curves();
|
||||||
if (sz != rep)
|
if (sz != rep) {
|
||||||
{
|
|
||||||
std::cerr << "\nnumber_of_curves()=" << sz;
|
std::cerr << "\nnumber_of_curves()=" << sz;
|
||||||
std::cerr << "\nrepresentatives.size()=" << rep;
|
std::cerr << "\nrepresentatives.size()=" << rep;
|
||||||
CGAL_assertion(number_of_curves() == rep);
|
CGAL_assertion(number_of_curves() == rep);
|
||||||
|
|
@ -1832,46 +1842,37 @@ public:
|
||||||
// return container.size();
|
// return container.size();
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
/* Return a container for all active curves.
|
||||||
|
*/
|
||||||
template <typename Halfedge_container>
|
template <typename Halfedge_container>
|
||||||
unsigned long Halfedge_filter(Halfedge_container& container,
|
unsigned long Halfedge_filter(Halfedge_container& container,
|
||||||
const Dag_node* ds) const
|
const Dag_node* ds) const
|
||||||
/* Return a container for all active curves */
|
|
||||||
{
|
{
|
||||||
unsigned long sz = number_of_curves();
|
unsigned long sz = number_of_curves();
|
||||||
std::list<Td_map_item> representatives;
|
std::list<Td_map_item> representatives;
|
||||||
//X_trapezoid_list representatives;
|
|
||||||
ds->filter(representatives, Td_active_edge_item(*traits));
|
ds->filter(representatives, Td_active_edge_item(*traits));
|
||||||
|
|
||||||
#ifndef CGAL_TD_DEBUG
|
#ifndef CGAL_TD_DEBUG
|
||||||
|
CGAL_warning(sz == representatives.size());
|
||||||
CGAL_warning(sz==representatives.size());
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
unsigned long rep=representatives.size();
|
unsigned long rep = representatives.size();
|
||||||
if (sz != rep)
|
if (sz != rep) {
|
||||||
{
|
|
||||||
std::cerr << "\nnumber_of_curves()=" << sz;
|
std::cerr << "\nnumber_of_curves()=" << sz;
|
||||||
std::cerr << "\nrepresentatives.size()=" << rep;
|
std::cerr << "\nrepresentatives.size()=" << rep;
|
||||||
CGAL_assertion(number_of_curves()==representatives.size());
|
CGAL_assertion(number_of_curves()==representatives.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (sz > 0)
|
if (sz > 0) {
|
||||||
|
for (typename std::list<Td_map_item>::iterator it =
|
||||||
|
representatives.begin(); it != representatives.end(); ++it)
|
||||||
{
|
{
|
||||||
typename std::list<Td_map_item>::iterator it = representatives.begin(),
|
Td_active_edge e(boost::get<Td_active_edge>(*it));
|
||||||
it_end = representatives.end();
|
|
||||||
//typename X_trapezoid_list::iterator it = representatives.begin(),
|
|
||||||
// it_end = representatives.end();
|
|
||||||
while(!(it==it_end))
|
|
||||||
{
|
|
||||||
Td_active_edge e (boost::get<Td_active_edge>(*it));
|
|
||||||
container.push_back(e.halfedge()); //it represents an active trapezoid
|
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());
|
CGAL::cpp98::random_shuffle(container.begin(),container.end());
|
||||||
}
|
}
|
||||||
return sz;
|
return sz;
|
||||||
|
|
@ -2010,7 +2011,6 @@ public:
|
||||||
true, *m_dag_root, *m_dag_root);
|
true, *m_dag_root, *m_dag_root);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
//Trapezoidal Decomposition data members
|
//Trapezoidal Decomposition data members
|
||||||
|
|
@ -2138,7 +2138,6 @@ private:
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
void print_cv_data(const X_monotone_curve_2& cv,
|
void print_cv_data(const X_monotone_curve_2& cv,
|
||||||
std::ostream& out = std::cout) const
|
std::ostream& out = std::cout) const
|
||||||
{
|
{
|
||||||
|
|
@ -2206,7 +2205,6 @@ private:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void print_dag_addresses(const Dag_node& curr) const
|
void print_dag_addresses(const Dag_node& curr) const
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -163,6 +163,9 @@ public:
|
||||||
/// \name Construction functors(based on the subcurve traits).
|
/// \name Construction functors(based on the subcurve traits).
|
||||||
//@{
|
//@{
|
||||||
|
|
||||||
|
#ifndef DOXYGEN_RUNNING
|
||||||
|
class Push_back_2;
|
||||||
|
#endif
|
||||||
/*! \class
|
/*! \class
|
||||||
* A functor that divides an arc into x-monotone arcs. That are, arcs that
|
* A functor that divides an arc into x-monotone arcs. That are, arcs that
|
||||||
* do not cross the identification arc.
|
* do not cross the identification arc.
|
||||||
|
|
|
||||||
|
|
@ -347,6 +347,9 @@ public:
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class Parameter_space_in_x_2;
|
||||||
|
class Parameter_space_in_y_2;
|
||||||
|
|
||||||
/*! A functor that computes intersections between x-monotone curves. */
|
/*! A functor that computes intersections between x-monotone curves. */
|
||||||
class Intersect_2 {
|
class Intersect_2 {
|
||||||
protected:
|
protected:
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ project( Arrangement_on_surface_2_Tests )
|
||||||
|
|
||||||
enable_testing()
|
enable_testing()
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 2.8.10)
|
cmake_minimum_required(VERSION 3.1)
|
||||||
|
|
||||||
find_package(CGAL QUIET COMPONENTS Core)
|
find_package(CGAL QUIET COMPONENTS Core)
|
||||||
|
|
||||||
|
|
@ -37,4 +37,3 @@ else()
|
||||||
message(STATUS "This program requires the CGAL library, and will not be compiled.")
|
message(STATUS "This program requires the CGAL library, and will not be compiled.")
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,7 @@ read_perform_opts(std::istream& is)
|
||||||
rc = false;
|
rc = false;
|
||||||
continue;
|
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 (cmd == 'd') {
|
||||||
if (!remove(this->m_xcurves[id])) rc = false;
|
if (!remove(this->m_xcurves[id])) rc = false;
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -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
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
i 0
|
||||||
|
i 1
|
||||||
|
d 1
|
||||||
|
i 1
|
||||||
|
|
@ -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
|
||||||
|
|
@ -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/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
|
||||||
|
|
|
||||||
|
|
@ -618,6 +618,9 @@ user might encounter.
|
||||||
- `CGAL::is_quad()`
|
- `CGAL::is_quad()`
|
||||||
- `CGAL::is_quad_mesh()`
|
- `CGAL::is_quad_mesh()`
|
||||||
- `CGAL::is_isolated_quad()`
|
- `CGAL::is_isolated_quad()`
|
||||||
|
- `CGAL::is_valid_halfedge_graph()`
|
||||||
|
- `CGAL::is_valid_face_graph()`
|
||||||
|
- `CGAL::is_valid_polygon_mesh()`
|
||||||
|
|
||||||
- `CGAL::is_tetrahedron()`
|
- `CGAL::is_tetrahedron()`
|
||||||
- `CGAL::is_hexahedron()`
|
- `CGAL::is_hexahedron()`
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,6 @@
|
||||||
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
|
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
|
||||||
|
|
||||||
#include <CGAL/Polyhedron_3.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>
|
#include <CGAL/boost/graph/graph_traits_Linear_cell_complex_for_combinatorial_map.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
#include <CGAL/Simple_cartesian.h>
|
#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/graph_traits_Linear_cell_complex_for_combinatorial_map.h>
|
||||||
#include <CGAL/boost/graph/iterator.h>
|
#include <CGAL/boost/graph/iterator.h>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
|
||||||
|
|
@ -1020,40 +1020,33 @@ add_face_to_border(typename boost::graph_traits<Graph>::halfedge_descriptor h1,
|
||||||
* collapses an edge in a graph.
|
* collapses an edge in a graph.
|
||||||
*
|
*
|
||||||
* \tparam Graph must be a model of `MutableFaceGraph`
|
* \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
|
* After the collapse of edge `e` the following holds:
|
||||||
* halfedges, that is `en = next(e, g)`, `ep = prev(e, g)`, and let
|
* - The edge `e` is no longer in `g`.
|
||||||
* `eno` and `epo` be their opposite halfedges, that is
|
* - The faces incident to edge `e` are no longer in `g`.
|
||||||
* `eno = opposite(en, g)` and `epo = opposite(ep, g)`.
|
* - `v0` is no longer in `g`.
|
||||||
* Analoguously, for `e'` define `en'`, `ep'`, `eno'`, and `epo'`.
|
* - 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'`)
|
* \returns vertex `v1`.
|
||||||
*
|
|
||||||
* <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`).
|
|
||||||
* \pre g must be a triangulated graph
|
* \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>
|
template<typename Graph>
|
||||||
typename boost::graph_traits<Graph>::vertex_descriptor
|
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)
|
Graph& g)
|
||||||
{
|
{
|
||||||
typedef boost::graph_traits< Graph > Traits;
|
typedef boost::graph_traits< Graph > Traits;
|
||||||
typedef typename Traits::vertex_descriptor vertex_descriptor;
|
typedef typename Traits::vertex_descriptor vertex_descriptor;
|
||||||
typedef typename Traits::halfedge_descriptor halfedge_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 qp = opposite(pq, g);
|
||||||
halfedge_descriptor pt = opposite(prev(pq, g), g);
|
halfedge_descriptor pt = opposite(prev(pq, g), g);
|
||||||
halfedge_descriptor qb = opposite(prev(qp, 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 q = target(pq, g);
|
||||||
vertex_descriptor p = source(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 )
|
if ( lTopFaceExists )
|
||||||
{
|
{
|
||||||
|
|
@ -1158,19 +1109,20 @@ collapse_edge(typename boost::graph_traits<Graph>::edge_descriptor v0v1,
|
||||||
// << q.idx() << "->V" << target(qb, g).idx()
|
// << q.idx() << "->V" << target(qb, g).idx()
|
||||||
// << ") by erasing bottom face" ) ;
|
// << ") by erasing bottom face" ) ;
|
||||||
|
|
||||||
remove_face(opposite(qb, g),g);
|
|
||||||
|
|
||||||
if ( !lTopFaceExists )
|
if ( !lTopFaceExists )
|
||||||
{
|
{
|
||||||
//CGAL_ECMS_TRACE(3, "Top face doesn't exist so vertex Q already removed" ) ;
|
//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 )
|
||||||
|
|
||||||
if ( !lP_Erased && !lQ_Erased )
|
|
||||||
{
|
{
|
||||||
//CGAL_ECMS_TRACE(3, "Removing vertex P by joining pQ" ) ;
|
//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 ;
|
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`,
|
* and guarantees that an edge `e2`, for which `get(edge_is_constrained_map, e2)==true`,
|
||||||
* is not removed after the collapse.
|
* is not removed after the collapse.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* \tparam Graph must be a model of `MutableFaceGraph`
|
* \tparam Graph must be a model of `MutableFaceGraph`
|
||||||
* \tparam EdgeIsConstrainedMap mut be a model of `ReadablePropertyMap` with the edge descriptor of `Graph`
|
* \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.
|
* 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.
|
* \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.
|
* 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`.
|
* \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
|
// the vertex is of valence 3 and we simply need to remove the vertex
|
||||||
// and its indicent edges
|
// and its indicent edges
|
||||||
bool lP_Erased = false;
|
|
||||||
halfedge_descriptor edge =
|
halfedge_descriptor edge =
|
||||||
next(edges_to_erase[0],g) == edges_to_erase[1]?
|
next(edges_to_erase[0],g) == edges_to_erase[1]?
|
||||||
edges_to_erase[0]:edges_to_erase[1];
|
edges_to_erase[0]:edges_to_erase[1];
|
||||||
if (target(edge,g) == p)
|
if (target(edge,g) != p)
|
||||||
lP_Erased = true;
|
{
|
||||||
|
// q will be removed, swap it with p
|
||||||
|
internal::swap_vertices(p, q, g);
|
||||||
|
}
|
||||||
remove_center_vertex(edge,g);
|
remove_center_vertex(edge,g);
|
||||||
return lP_Erased? q : p;
|
return q;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -1294,19 +1251,29 @@ collapse_edge(typename boost::graph_traits<Graph>::edge_descriptor v0v1,
|
||||||
join_vertex(pq,g);
|
join_vertex(pq,g);
|
||||||
return q;
|
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);
|
remove_face(opposite(edges_to_erase[0],g),g);
|
||||||
return lQ_Erased?p:q;
|
return q;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! (is_border(edges_to_erase[0],g))){
|
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_face(edges_to_erase[0],g);
|
||||||
join_vertex(qp,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);
|
remove_face(opposite(edges_to_erase[0],g),g);
|
||||||
return lP_Erased?q:p;
|
return q;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -691,7 +691,7 @@ template <class Graph>
|
||||||
bool
|
bool
|
||||||
is_valid(const Graph_with_descriptor_with_graph<Graph> & w, bool verbose = false)
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,6 @@
|
||||||
#include <CGAL/assertions.h>
|
#include <CGAL/assertions.h>
|
||||||
#include <CGAL/hash_openmesh.h>
|
#include <CGAL/hash_openmesh.h>
|
||||||
|
|
||||||
|
|
||||||
#if defined(BOOST_MSVC)
|
#if defined(BOOST_MSVC)
|
||||||
# pragma warning(push)
|
# pragma warning(push)
|
||||||
# pragma warning(disable:4267)
|
# pragma warning(disable:4267)
|
||||||
|
|
@ -622,12 +621,6 @@ add_face(OPEN_MESH_CLASS& sm)
|
||||||
return sm.new_face();
|
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 OpenMesh
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@
|
||||||
#include <CGAL/boost/graph/internal/Has_member_clear.h>
|
#include <CGAL/boost/graph/internal/Has_member_clear.h>
|
||||||
#include <CGAL/function_objects.h>
|
#include <CGAL/function_objects.h>
|
||||||
#include <boost/unordered_set.hpp>
|
#include <boost/unordered_set.hpp>
|
||||||
|
#include <CGAL/IO/Verbose_ostream.h>
|
||||||
|
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
@ -355,30 +356,292 @@ bool is_valid_face_descriptor( typename boost::graph_traits<FaceGraph>::face_des
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
template <typename FaceGraph>
|
\ingroup PkgBGLHelperFct
|
||||||
bool is_valid_polygon_mesh(const FaceGraph& g)
|
* \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<Graph>::halfedge_descriptor halfedge_descriptor;
|
||||||
typedef typename boost::graph_traits<FaceGraph>::vertex_descriptor vertex_descriptor;
|
typedef typename boost::graph_traits<Graph>::vertex_descriptor vertex_descriptor;
|
||||||
typedef typename boost::graph_traits<FaceGraph>::face_descriptor face_descriptor;
|
typedef typename boost::graph_traits<Graph>::vertices_size_type vertex_size_type;
|
||||||
BOOST_FOREACH(vertex_descriptor v, vertices(g)){
|
typedef typename boost::graph_traits<Graph>::halfedges_size_type halfedges_size_type;
|
||||||
if(! is_valid_vertex_descriptor(v,g)){
|
Verbose_ostream verr(verb);
|
||||||
return false;
|
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;
|
||||||
}
|
}
|
||||||
|
//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(halfedge_descriptor h, halfedges(g)){
|
// previous integrity.
|
||||||
if(! is_valid_halfedge_descriptor(h,g)){
|
valid = valid && ( prev(next(begin, g), g) == begin);
|
||||||
return false;
|
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;
|
||||||
}
|
}
|
||||||
BOOST_FOREACH(face_descriptor f, faces(g)){
|
valid = valid && ( target(begin, g) ==
|
||||||
if(! is_valid_face_descriptor(f,g)){
|
target(opposite(next(begin, g), g), g));
|
||||||
return false;
|
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
|
\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
|
} //end of internal namespace
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
// Copyright (c) 2009 INRIA Sophia-Antipolis (France).
|
// Copyright (c) 2014 GeometryFactory (France). All rights reserved.
|
||||||
// All rights reserved.
|
|
||||||
//
|
//
|
||||||
// This file is part of CGAL (www.cgal.org).
|
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
||||||
// You can redistribute it and/or modify it under the terms of the GNU
|
// modify it under the terms of the GNU Lesser General Public License as
|
||||||
// General Public License as published by the Free Software Foundation,
|
// published by the Free Software Foundation; either version 3 of the License,
|
||||||
// either version 3 of the License, or (at your option) any later version.
|
// or (at your option) any later version.
|
||||||
//
|
//
|
||||||
// Licensees holding a valid commercial license may use this file in
|
// Licensees holding a valid commercial license may use this file in
|
||||||
// accordance with the commercial license agreement provided with the software.
|
// accordance with the commercial license agreement provided with the software.
|
||||||
|
|
@ -14,23 +13,16 @@
|
||||||
//
|
//
|
||||||
// $URL$
|
// $URL$
|
||||||
// $Id$
|
// $Id$
|
||||||
// SPDX-License-Identifier: GPL-3.0+
|
// SPDX-License-Identifier: LGPL-3.0+
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// Author(s) : Stephane Tayeb
|
// Author(s) : Andreas Fabri
|
||||||
//
|
|
||||||
//******************************************************************************
|
|
||||||
// File Description :
|
|
||||||
//******************************************************************************
|
|
||||||
|
|
||||||
#ifndef CGAL_MESH_3_GLOBAL_PARAMETERS_H
|
|
||||||
#define CGAL_MESH_3_GLOBAL_PARAMETERS_H
|
|
||||||
|
|
||||||
#include <CGAL/license/Mesh_3.h>
|
|
||||||
|
|
||||||
|
#ifndef CGAL_BOOST_PARAMETER_H
|
||||||
|
#define CGAL_BOOST_PARAMETER_H
|
||||||
|
|
||||||
#include <CGAL/config.h>
|
#include <CGAL/config.h>
|
||||||
#include <CGAL/Mesh_3/config.h>
|
|
||||||
|
|
||||||
#ifdef BOOST_PARAMETER_MAX_ARITY
|
#ifdef BOOST_PARAMETER_MAX_ARITY
|
||||||
# if (BOOST_PARAMETER_MAX_ARITY < 12)
|
# if (BOOST_PARAMETER_MAX_ARITY < 12)
|
||||||
|
|
@ -40,12 +32,31 @@
|
||||||
# define BOOST_PARAMETER_MAX_ARITY 12
|
# define BOOST_PARAMETER_MAX_ARITY 12
|
||||||
#endif
|
#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 CGAL
|
||||||
|
{
|
||||||
namespace parameters {
|
namespace parameters
|
||||||
|
{
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct Base
|
struct Base
|
||||||
|
|
@ -56,33 +67,39 @@ private:
|
||||||
T t_;
|
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){} }; \
|
struct Class : public Base<bool> { Class(bool b) : Base<bool>(b){} }; \
|
||||||
inline Class function_true() { return Class(true); } \
|
inline Class function_true() { return Class(true); } \
|
||||||
inline Class function_false() { return Class(false); }
|
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> \
|
struct Class : public Base<double> \
|
||||||
{ Class(double d) : Base<double>(d) { precondition(d); } }; \
|
{ Class(double d) : Base<double>(d) { precondition(d); } }; \
|
||||||
inline Class function(double d) { return Class(d); }
|
inline Class function(double d) { return Class(d); }
|
||||||
|
|
||||||
// see <CGAL/config.h>
|
// see <CGAL/config.h>
|
||||||
CGAL_PRAGMA_DIAG_PUSH
|
CGAL_PRAGMA_DIAG_PUSH
|
||||||
// see <CGAL/Mesh_3/config.h>
|
// see <CGAL/boost/parameter.h>
|
||||||
CGAL_MESH_3_IGNORE_BOOST_PARAMETER_NAME_WARNINGS
|
CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS
|
||||||
|
|
||||||
BOOST_PARAMETER_NAME( c3t3 )
|
BOOST_PARAMETER_NAME( c3t3 )
|
||||||
BOOST_PARAMETER_NAME( domain )
|
BOOST_PARAMETER_NAME( domain )
|
||||||
BOOST_PARAMETER_NAME( criteria )
|
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( (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_bound, tag) sliver_bound_)
|
||||||
BOOST_PARAMETER_NAME( (sliver_criterion, tag) sliver_criterion_)
|
BOOST_PARAMETER_NAME( (sliver_criterion, tag) sliver_criterion_)
|
||||||
BOOST_PARAMETER_NAME( (perturbation_vector, tag) perturbation_vector_)
|
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( (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_)
|
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( (maximal_number_of_vertices, tag ) maximal_number_of_vertices_)
|
||||||
BOOST_PARAMETER_NAME( (pointer_to_error_code, tag ) pointer_to_error_code_)
|
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
|
CGAL_PRAGMA_DIAG_POP
|
||||||
} // end namespace parameters
|
} // parameters
|
||||||
|
} // CGAL
|
||||||
|
|
||||||
|
|
||||||
|
#endif // CGAL_BOOST_PARAMETER_H
|
||||||
|
|
||||||
|
|
||||||
} //namespace CGAL
|
|
||||||
|
|
||||||
#endif // CGAL_MESH_3_GLOBAL_PARAMETERS_H
|
|
||||||
|
|
@ -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_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_graph_traits.cpp" )
|
||||||
|
|
||||||
create_single_source_cgal_program( "test_Properties.cpp" )
|
create_single_source_cgal_program( "test_Properties.cpp" )
|
||||||
|
|
@ -105,6 +107,7 @@ create_single_source_cgal_program( "test_Properties.cpp" )
|
||||||
if(OpenMesh_FOUND)
|
if(OpenMesh_FOUND)
|
||||||
target_link_libraries( test_clear PRIVATE ${OPENMESH_LIBRARIES})
|
target_link_libraries( test_clear PRIVATE ${OPENMESH_LIBRARIES})
|
||||||
target_link_libraries( test_Euler_operations 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_Face_filtered_graph PRIVATE ${OPENMESH_LIBRARIES})
|
||||||
target_link_libraries( test_graph_traits PRIVATE ${OPENMESH_LIBRARIES} )
|
target_link_libraries( test_graph_traits PRIVATE ${OPENMESH_LIBRARIES} )
|
||||||
target_link_libraries( test_Properties PRIVATE ${OPENMESH_LIBRARIES})
|
target_link_libraries( test_Properties PRIVATE ${OPENMESH_LIBRARIES})
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
#include <CGAL/Simple_cartesian.h>
|
#include <CGAL/Simple_cartesian.h>
|
||||||
#include <CGAL/Polyhedron_3.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/split_graph_into_polylines.h>
|
||||||
#include <CGAL/boost/graph/helpers.h>
|
#include <CGAL/boost/graph/helpers.h>
|
||||||
#include <boost/graph/filtered_graph.hpp>
|
#include <boost/graph/filtered_graph.hpp>
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
#include <CGAL/Simple_cartesian.h>
|
#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/boost/graph/graph_concepts.h>
|
||||||
#include <CGAL/Polyhedron_items_with_id_3.h>
|
#include <CGAL/Polyhedron_items_with_id_3.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
#include <CGAL/boost/graph/graph_traits_Surface_mesh.h>
|
#include <CGAL/Surface_mesh.h>
|
||||||
#include <CGAL/boost/graph/properties_Surface_mesh.h>
|
|
||||||
#include <CGAL/Simple_cartesian.h>
|
#include <CGAL/Simple_cartesian.h>
|
||||||
#include <CGAL/boost/graph/Graph_with_descriptor_with_graph.h>
|
#include <CGAL/boost/graph/Graph_with_descriptor_with_graph.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
#include <CGAL/Simple_cartesian.h>
|
#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/boost/graph/graph_concepts.h>
|
||||||
#include <CGAL/Polyhedron_items_with_id_3.h>
|
#include <CGAL/Polyhedron_items_with_id_3.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
#include <CGAL/boost/graph/graph_traits_Surface_mesh.h>
|
#include <CGAL/Surface_mesh.h>
|
||||||
#include <CGAL/boost/graph/properties_Surface_mesh.h>
|
|
||||||
#include <CGAL/boost/graph/Seam_mesh.h>
|
#include <CGAL/boost/graph/Seam_mesh.h>
|
||||||
#include <CGAL/Simple_cartesian.h>
|
#include <CGAL/Simple_cartesian.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
#include <CGAL/boost/graph/graph_traits_Surface_mesh.h>
|
#include <CGAL/Surface_mesh.h>
|
||||||
#include <CGAL/boost/graph/properties_Surface_mesh.h>
|
|
||||||
#include <CGAL/Simple_cartesian.h>
|
#include <CGAL/Simple_cartesian.h>
|
||||||
|
|
||||||
#include <boost/graph/graph_concepts.hpp>
|
#include <boost/graph/graph_concepts.hpp>
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
@ -41,7 +41,7 @@ join_face_test()
|
||||||
|
|
||||||
assert(degree(f.w, f.m) == 2);
|
assert(degree(f.w, f.m) == 2);
|
||||||
assert(degree(f.v, f.m) == 3);
|
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);
|
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.v, f.m) == 3);
|
||||||
assert_EQUAL(degree(f.x, f.m) == 2);
|
assert_EQUAL(degree(f.x, f.m) == 2);
|
||||||
|
|
@ -99,7 +99,7 @@ remove_face_test_2()
|
||||||
assert(found);
|
assert(found);
|
||||||
assert(face(e, f.m) == f.f1);
|
assert(face(e, f.m) == f.f1);
|
||||||
CGAL::Euler::remove_face(e,f.m);
|
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_faces(f.m) == 3);
|
||||||
assert(CGAL::internal::exact_num_edges(f.m) == 7);
|
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);
|
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);
|
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(res,m));
|
||||||
assert(CGAL::is_border(opposite(res,m),m));
|
assert(CGAL::is_border(opposite(res,m),m));
|
||||||
|
|
@ -169,8 +169,6 @@ add_vertex_and_face_to_border_test()
|
||||||
}
|
}
|
||||||
assert(blength == 0);
|
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.f1, f.m), f.m)) == 3);
|
||||||
assert(boost::distance(CGAL::halfedges_around_face(halfedge(f.f2, 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(degree(f.x, f.m) == 4);
|
||||||
assert(CGAL::is_valid(f.m));
|
assert(CGAL::is_valid_polygon_mesh(f.m));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
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.f1, f.m), f.m)) == 4);
|
||||||
assert(boost::distance(CGAL::halfedges_around_face(halfedge(f.f2, f.m), f.m)) == 3);
|
assert(boost::distance(CGAL::halfedges_around_face(halfedge(f.f2, f.m), f.m)) == 3);
|
||||||
assert(degree(f.y, 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.f1, f.m), f.m)) == 4);
|
||||||
assert(boost::distance(CGAL::halfedges_around_face(halfedge(f.f2, f.m), f.m)) == 3);
|
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);
|
assert(degree(f.w, f.m) == 3);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -261,7 +259,7 @@ split_vertex()
|
||||||
|
|
||||||
// split border vertex y
|
// split border vertex y
|
||||||
CGAL::Euler::split_vertex(h1, h2,f.m);
|
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_vertices(f.m) == 7);
|
||||||
assert(CGAL::internal::exact_num_edges(f.m) == 8);
|
assert(CGAL::internal::exact_num_edges(f.m) == 8);
|
||||||
assert(boost::distance(CGAL::halfedges_around_face(h1, f.m)) == 5);
|
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);
|
boost::tie(h, found) = halfedge(f.w, f.x, f.m);
|
||||||
assert(found);
|
assert(found);
|
||||||
CGAL::Euler::join_vertex(h,f.m);
|
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);
|
boost::tie(h1, found) = halfedge(f.z, f.x, f.m);
|
||||||
assert(found);
|
assert(found);
|
||||||
boost::tie(h2, found) = halfedge(f.v, f.x, f.m);
|
boost::tie(h2, found) = halfedge(f.v, f.x, f.m);
|
||||||
assert(found);
|
assert(found);
|
||||||
CGAL::Euler::join_vertex(CGAL::Euler::split_vertex(h1, h2,f.m),f.m);
|
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_vertices(f.m)== 5);
|
||||||
assert(CGAL::internal::exact_num_faces(f.m) == 2);
|
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);
|
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>
|
template <typename T>
|
||||||
|
|
@ -319,7 +317,7 @@ split_loop_test()
|
||||||
assert(CGAL::internal::exact_num_vertices(f.m) == 8);
|
assert(CGAL::internal::exact_num_vertices(f.m) == 8);
|
||||||
assert(CGAL::internal::exact_num_faces(f.m) == 8);
|
assert(CGAL::internal::exact_num_faces(f.m) == 8);
|
||||||
assert(CGAL::internal::exact_num_halfedges(f.m) == 24);
|
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>
|
template <typename T>
|
||||||
|
|
@ -382,7 +380,27 @@ does_satisfy_link_condition()
|
||||||
assert(CGAL::Euler::does_satisfy_link_condition(*edges(f.m).first,f.m));
|
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>
|
template <typename Graph>
|
||||||
void
|
void
|
||||||
|
|
@ -402,6 +420,7 @@ test_Euler_operations()
|
||||||
remove_center_vertex_test<Graph>();
|
remove_center_vertex_test<Graph>();
|
||||||
join_split_inverse<Graph>();
|
join_split_inverse<Graph>();
|
||||||
does_satisfy_link_condition<Graph>();
|
does_satisfy_link_condition<Graph>();
|
||||||
|
test_swap_edges<Graph>();
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
|
|
|
||||||
|
|
@ -272,7 +272,7 @@ void test_read(const Graph& g)
|
||||||
std::map<g_face_descriptor, std::size_t> map;
|
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());
|
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));
|
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>
|
template <typename Graph>
|
||||||
|
|
@ -357,7 +357,7 @@ void test_mesh(Adapter fga)
|
||||||
|
|
||||||
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
||||||
//check that there is the right number of simplices in fga
|
//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_faces(fga) == 2);
|
||||||
CGAL_assertion(num_edges(fga) == 5);
|
CGAL_assertion(num_edges(fga) == 5);
|
||||||
CGAL_assertion(num_halfedges(fga) == 10);
|
CGAL_assertion(num_halfedges(fga) == 10);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||||
#include <CGAL/Surface_mesh.h>
|
#include <CGAL/Surface_mesh.h>
|
||||||
#include <CGAL/boost/graph/graph_traits_Surface_mesh.h>
|
|
||||||
#include <CGAL/Surface_mesh/IO.h>
|
#include <CGAL/Surface_mesh/IO.h>
|
||||||
|
|
||||||
#include <boost/unordered_map.hpp>
|
#include <boost/unordered_map.hpp>
|
||||||
|
|
@ -56,7 +55,7 @@ int main()
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(index == 25);
|
assert(index == 25);
|
||||||
assert(is_valid(sm));
|
assert(is_valid_polygon_mesh(sm));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,7 @@ template <typename Graph>
|
||||||
struct Surface_fixture_1 {
|
struct Surface_fixture_1 {
|
||||||
Surface_fixture_1() {
|
Surface_fixture_1() {
|
||||||
assert(read_a_mesh(m, "data/fixture1.off"));
|
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
|
typename boost::property_map<Graph, CGAL::vertex_point_t>::const_type
|
||||||
pm = get(CGAL::vertex_point, const_cast<const Graph&>(m));
|
pm = get(CGAL::vertex_point, const_cast<const Graph&>(m));
|
||||||
|
|
||||||
|
|
@ -206,7 +206,7 @@ template <typename Graph>
|
||||||
struct Surface_fixture_2 {
|
struct Surface_fixture_2 {
|
||||||
Surface_fixture_2() {
|
Surface_fixture_2() {
|
||||||
assert(read_a_mesh(m, "data/fixture2.off"));
|
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
|
typename boost::property_map<Graph, CGAL::vertex_point_t>::const_type
|
||||||
pm = get(CGAL::vertex_point, const_cast<const Graph&>(m));
|
pm = get(CGAL::vertex_point, const_cast<const Graph&>(m));
|
||||||
|
|
@ -267,7 +267,7 @@ template <typename Graph>
|
||||||
struct Surface_fixture_3 {
|
struct Surface_fixture_3 {
|
||||||
Surface_fixture_3() {
|
Surface_fixture_3() {
|
||||||
assert(read_a_mesh(m, "data/fixture3.off"));
|
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
|
typename boost::property_map<Graph, CGAL::vertex_point_t>::const_type
|
||||||
pm = get(CGAL::vertex_point, const_cast<const Graph&>(m));
|
pm = get(CGAL::vertex_point, const_cast<const Graph&>(m));
|
||||||
|
|
@ -313,7 +313,7 @@ template <typename Graph>
|
||||||
struct Surface_fixture_4 {
|
struct Surface_fixture_4 {
|
||||||
Surface_fixture_4() {
|
Surface_fixture_4() {
|
||||||
assert(read_a_mesh(m, "data/fixture4.off"));
|
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
|
typename boost::property_map<Graph, CGAL::vertex_point_t>::const_type
|
||||||
pm = get(CGAL::vertex_point, const_cast<const Graph&>(m));
|
pm = get(CGAL::vertex_point, const_cast<const Graph&>(m));
|
||||||
|
|
@ -348,7 +348,7 @@ template <typename Graph>
|
||||||
struct Surface_fixture_5 {
|
struct Surface_fixture_5 {
|
||||||
Surface_fixture_5() {
|
Surface_fixture_5() {
|
||||||
assert(read_a_mesh(m, "data/add_face_to_border.off"));
|
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
|
typename boost::property_map<Graph, CGAL::vertex_point_t>::const_type
|
||||||
pm = get(CGAL::vertex_point, const_cast<const Graph&>(m));
|
pm = get(CGAL::vertex_point, const_cast<const Graph&>(m));
|
||||||
|
|
@ -378,7 +378,7 @@ template <typename Graph>
|
||||||
struct Surface_fixture_6 {
|
struct Surface_fixture_6 {
|
||||||
Surface_fixture_6() {
|
Surface_fixture_6() {
|
||||||
assert(read_a_mesh(m, "data/quad.off"));
|
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;
|
typename boost::graph_traits<Graph>::halfedge_descriptor h;
|
||||||
|
|
||||||
|
|
@ -397,7 +397,7 @@ template <typename Graph>
|
||||||
struct Surface_fixture_7 {
|
struct Surface_fixture_7 {
|
||||||
Surface_fixture_7() {
|
Surface_fixture_7() {
|
||||||
assert(read_a_mesh(m, "data/cube.off"));
|
assert(read_a_mesh(m, "data/cube.off"));
|
||||||
assert(CGAL::is_valid(m));
|
assert(CGAL::is_valid_polygon_mesh(m));
|
||||||
|
|
||||||
h = *(halfedges(m).first);
|
h = *(halfedges(m).first);
|
||||||
}
|
}
|
||||||
|
|
@ -410,7 +410,7 @@ template <typename Graph>
|
||||||
struct Surface_fixture_8 {
|
struct Surface_fixture_8 {
|
||||||
Surface_fixture_8() {
|
Surface_fixture_8() {
|
||||||
assert(read_a_mesh(m, "data/fixture5.off"));
|
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
|
typename boost::property_map<Graph, CGAL::vertex_point_t>::const_type
|
||||||
pm = get(CGAL::vertex_point, const_cast<const Graph&>(m));
|
pm = get(CGAL::vertex_point, const_cast<const Graph&>(m));
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
#include <CGAL/Simple_cartesian.h>
|
#include <CGAL/Simple_cartesian.h>
|
||||||
|
|
||||||
#include <CGAL/Surface_mesh.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/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/Linear_cell_complex_for_bgl_combinatorial_map_helper.h>
|
||||||
#include <CGAL/boost/graph/graph_traits_Linear_cell_complex_for_combinatorial_map.h>
|
#include <CGAL/boost/graph/graph_traits_Linear_cell_complex_for_combinatorial_map.h>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
#include <CGAL/Simple_cartesian.h>
|
#include <CGAL/Simple_cartesian.h>
|
||||||
#include <CGAL/Polyhedron_3.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 <CGAL/boost/graph/iterator.h>
|
||||||
|
|
||||||
#include <boost/foreach.hpp>
|
#include <boost/foreach.hpp>
|
||||||
|
|
|
||||||
|
|
@ -10,13 +10,13 @@ void test() {
|
||||||
std::cout << "Error reading file: " << fname << std::endl;
|
std::cout << "Error reading file: " << fname << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(CGAL::is_valid(m));
|
assert(CGAL::is_valid_polygon_mesh(m));
|
||||||
|
|
||||||
CGAL::clear(m);
|
CGAL::clear(m);
|
||||||
assert(num_vertices(m) == 0);
|
assert(num_vertices(m) == 0);
|
||||||
assert(num_faces(m) == 0);
|
assert(num_faces(m) == 0);
|
||||||
assert(num_edges(m) == 0);
|
assert(num_edges(m) == 0);
|
||||||
assert(CGAL::is_valid(m));
|
assert(CGAL::is_valid_polygon_mesh(m));
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
|
|
|
||||||
|
|
@ -254,9 +254,10 @@ void test_faces(const G& g)
|
||||||
template<typename G>
|
template<typename G>
|
||||||
void test_read(const G& g)
|
void test_read(const G& g)
|
||||||
{
|
{
|
||||||
assert(CGAL::is_valid(g));
|
assert(CGAL::is_valid_polygon_mesh(g));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <typename Graph>
|
template <typename Graph>
|
||||||
void
|
void
|
||||||
test(const std::vector<Graph>& graphs)
|
test(const std::vector<Graph>& graphs)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <CGAL/Surface_mesh.h>
|
#include <CGAL/Surface_mesh.h>
|
||||||
|
#include <CGAL/boost/graph/graph_traits_Surface_mesh.h>
|
||||||
#include <CGAL/Simple_cartesian.h>
|
#include <CGAL/Simple_cartesian.h>
|
||||||
#include <CGAL/boost/graph/helpers.h>
|
#include <CGAL/boost/graph/helpers.h>
|
||||||
#include <CGAL/boost/graph/Euler_operations.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);
|
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()
|
int main()
|
||||||
{
|
{
|
||||||
typedef CGAL::Surface_mesh<Point_3> Mesh;
|
typedef CGAL::Surface_mesh<Point_3> Mesh;
|
||||||
|
Mesh mesh;
|
||||||
|
test_validity(mesh);
|
||||||
// triangle quad tetra hexa
|
// triangle quad tetra hexa
|
||||||
test<Mesh>("data/triangle.off", true, false, false, false );
|
test<Mesh>("data/triangle.off", true, false, false, false );
|
||||||
test<Mesh>("data/quad.off", false, true, false, false );
|
test<Mesh>("data/quad.off", false, true, false, false );
|
||||||
|
|
@ -43,43 +120,42 @@ int main()
|
||||||
halfedge_descriptor hd;
|
halfedge_descriptor hd;
|
||||||
hd = CGAL::make_triangle(a,b,c,m);
|
hd = CGAL::make_triangle(a,b,c,m);
|
||||||
assert(CGAL::is_isolated_triangle(hd,m));
|
assert(CGAL::is_isolated_triangle(hd,m));
|
||||||
assert(CGAL::is_valid(m));
|
assert(CGAL::is_valid_polygon_mesh(m));
|
||||||
m.clear();
|
m.clear();
|
||||||
hd = CGAL::make_quad(a,b,c,d,m);
|
hd = CGAL::make_quad(a,b,c,d,m);
|
||||||
assert(CGAL::is_isolated_quad(hd,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));
|
assert(CGAL::is_quad_mesh(m));
|
||||||
m.clear();
|
m.clear();
|
||||||
hd = CGAL::make_tetrahedron(a,b,c,d,m);
|
hd = CGAL::make_tetrahedron(a,b,c,d,m);
|
||||||
assert(CGAL::is_tetrahedron(hd,m));
|
assert(CGAL::is_tetrahedron(hd,m));
|
||||||
assert(CGAL::is_triangle_mesh(m));
|
assert(CGAL::is_triangle_mesh(m));
|
||||||
assert(CGAL::is_valid(m));
|
assert(CGAL::is_valid_polygon_mesh(m));
|
||||||
m.clear();
|
m.clear();
|
||||||
hd = CGAL::make_hexahedron(a,b,c,d,aa,bb,cc,dd,m);
|
hd = CGAL::make_hexahedron(a,b,c,d,aa,bb,cc,dd,m);
|
||||||
assert(CGAL::is_hexahedron(hd,m));
|
assert(CGAL::is_hexahedron(hd,m));
|
||||||
assert(CGAL::is_quad_mesh(m));
|
assert(CGAL::is_quad_mesh(m));
|
||||||
assert(CGAL::is_valid(m));
|
assert(CGAL::is_valid_polygon_mesh(m));
|
||||||
m.clear();
|
m.clear();
|
||||||
CGAL::make_icosahedron<Mesh, Point_3>(m);
|
CGAL::make_icosahedron<Mesh, Point_3>(m);
|
||||||
assert(num_faces(m) == 20);
|
assert(num_faces(m) == 20);
|
||||||
assert(CGAL::is_triangle_mesh(m));
|
assert(CGAL::is_triangle_mesh(m));
|
||||||
assert(CGAL::is_valid(m));
|
assert(CGAL::is_valid_polygon_mesh(m));
|
||||||
m.clear();
|
m.clear();
|
||||||
hd = CGAL::make_pyramid<Mesh, Point_3>(3, m);
|
hd = CGAL::make_pyramid<Mesh, Point_3>(3, m);
|
||||||
assert(num_faces(m) == 6);
|
assert(num_faces(m) == 6);
|
||||||
assert(CGAL::is_triangle_mesh(m));
|
assert(CGAL::is_triangle_mesh(m));
|
||||||
assert(CGAL::is_valid(m));
|
assert(CGAL::is_valid_polygon_mesh(m));
|
||||||
m.clear();
|
m.clear();
|
||||||
hd = CGAL::make_regular_prism<Mesh, Point_3>(4, m);
|
hd = CGAL::make_regular_prism<Mesh, Point_3>(4, m);
|
||||||
assert(num_faces(m) == 16);
|
assert(num_faces(m) == 16);
|
||||||
assert(CGAL::is_triangle_mesh(m));
|
assert(CGAL::is_triangle_mesh(m));
|
||||||
assert(CGAL::is_valid(m));
|
assert(CGAL::is_valid_polygon_mesh(m));
|
||||||
m.clear();
|
m.clear();
|
||||||
CGAL::make_grid(3,3,m);
|
CGAL::make_grid(3,3,m);
|
||||||
assert(num_faces(m) == 9);
|
assert(num_faces(m) == 9);
|
||||||
assert(CGAL::is_quad_mesh(m));
|
assert(CGAL::is_quad_mesh(m));
|
||||||
assert(CGAL::is_valid(m));
|
assert(CGAL::is_valid_polygon_mesh(m));
|
||||||
|
|
||||||
std::cerr << "done" << std::endl;
|
std::cerr << "done" << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@
|
||||||
|
|
||||||
#include <CGAL/CORE/extLong.h>
|
#include <CGAL/CORE/extLong.h>
|
||||||
#include <CGAL/atomic.h>
|
#include <CGAL/atomic.h>
|
||||||
|
#include <CGAL/disable_warnings.h>
|
||||||
|
|
||||||
#ifdef CGAL_HEADER_ONLY
|
#ifdef CGAL_HEADER_ONLY
|
||||||
|
|
||||||
|
|
@ -54,7 +55,7 @@
|
||||||
#else // CGAL_HEADER_ONLY
|
#else // CGAL_HEADER_ONLY
|
||||||
|
|
||||||
#define CGAL_GLOBAL_STATE_VAR(TYPE, NAME, VALUE) \
|
#define CGAL_GLOBAL_STATE_VAR(TYPE, NAME, VALUE) \
|
||||||
CGAL_CORE_EXPORT extern TYPE NAME; \
|
CGAL_EXPORT extern TYPE NAME; \
|
||||||
inline TYPE& get_static_##NAME() \
|
inline TYPE& get_static_##NAME() \
|
||||||
{ \
|
{ \
|
||||||
return NAME; \
|
return NAME; \
|
||||||
|
|
@ -340,4 +341,8 @@ inline void setPositionalFormat(std::ostream& o = std::cout) {
|
||||||
#include <CGAL/CORE/CoreDefs_impl.h>
|
#include <CGAL/CORE/CoreDefs_impl.h>
|
||||||
#endif // CGAL_HEADER_ONLY
|
#endif // CGAL_HEADER_ONLY
|
||||||
|
|
||||||
|
#include <CGAL/enable_warnings.h>
|
||||||
|
|
||||||
|
#undef CGAL_GLOBAL_STATE_VAR
|
||||||
|
|
||||||
#endif // _CORE_COREDEFS_H_
|
#endif // _CORE_COREDEFS_H_
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ int readINT8little(FILE *f, CGAL_INT8 *i)
|
||||||
|
|
||||||
rc = fgetc(f);
|
rc = fgetc(f);
|
||||||
if (rc == EOF)
|
if (rc == EOF)
|
||||||
return rc;
|
return EOF;
|
||||||
|
|
||||||
*i = CGAL_INT8(rc & 0xff);
|
*i = CGAL_INT8(rc & 0xff);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -69,7 +69,7 @@ int readUINT8little(FILE *f, CGAL_UINT8 *i)
|
||||||
|
|
||||||
rc = fgetc(f);
|
rc = fgetc(f);
|
||||||
if (rc == EOF)
|
if (rc == EOF)
|
||||||
return rc;
|
return EOF;
|
||||||
|
|
||||||
*i = CGAL_UINT8(rc & 0xff);
|
*i = CGAL_UINT8(rc & 0xff);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -91,7 +91,7 @@ int readINT16little(FILE *f, CGAL_INT16 *i)
|
||||||
|
|
||||||
rc = fgetc(f);
|
rc = fgetc(f);
|
||||||
if (rc == EOF)
|
if (rc == EOF)
|
||||||
return rc;
|
return EOF;
|
||||||
|
|
||||||
temp = temp | CGAL_INT16((rc & 0xff) << 8);
|
temp = temp | CGAL_INT16((rc & 0xff) << 8);
|
||||||
*i = temp;
|
*i = temp;
|
||||||
|
|
@ -108,7 +108,7 @@ int readUINT16little(FILE *f, CGAL_UINT16 *i)
|
||||||
|
|
||||||
rc = fgetc(f);
|
rc = fgetc(f);
|
||||||
if (rc == EOF)
|
if (rc == EOF)
|
||||||
return rc;
|
return EOF;
|
||||||
|
|
||||||
temp = CGAL_INT16(temp | ((rc & 0xff) << 8));
|
temp = CGAL_INT16(temp | ((rc & 0xff) << 8));
|
||||||
*i = temp;
|
*i = temp;
|
||||||
|
|
@ -132,7 +132,7 @@ int readINT32little(FILE *f, CGAL_INT32 *i)
|
||||||
|
|
||||||
rc = fgetc(f);
|
rc = fgetc(f);
|
||||||
if (rc == EOF)
|
if (rc == EOF)
|
||||||
return rc;
|
return EOF;
|
||||||
|
|
||||||
temp = CGAL_INT32(temp | (((long)rc & 0xff) << 24));
|
temp = CGAL_INT32(temp | (((long)rc & 0xff) << 24));
|
||||||
*i = temp;
|
*i = temp;
|
||||||
|
|
@ -151,7 +151,7 @@ int readUINT32little(FILE *f, CGAL_UINT32 *i)
|
||||||
|
|
||||||
rc = fgetc(f);
|
rc = fgetc(f);
|
||||||
if (rc == EOF)
|
if (rc == EOF)
|
||||||
return rc;
|
return EOF;
|
||||||
|
|
||||||
temp = CGAL_UINT32(temp | (((long)rc & 0xff) << 24));
|
temp = CGAL_UINT32(temp | (((long)rc & 0xff) << 24));
|
||||||
*i = temp;
|
*i = temp;
|
||||||
|
|
@ -185,7 +185,7 @@ int writeINT16little(FILE *f, CGAL_INT16 i)
|
||||||
|
|
||||||
rc = fputc((i & 0xff), f);
|
rc = fputc((i & 0xff), f);
|
||||||
if (rc == EOF)
|
if (rc == EOF)
|
||||||
return rc;
|
return EOF;
|
||||||
|
|
||||||
return fputc(((i >> 8) & 0xff), f);
|
return fputc(((i >> 8) & 0xff), f);
|
||||||
}
|
}
|
||||||
|
|
@ -197,7 +197,7 @@ int writeUINT16little(FILE *f, CGAL_UINT16 i)
|
||||||
|
|
||||||
rc = fputc((i & 0xff), f);
|
rc = fputc((i & 0xff), f);
|
||||||
if (rc == EOF)
|
if (rc == EOF)
|
||||||
return rc;
|
return EOF;
|
||||||
|
|
||||||
return fputc(((i >> 8) & 0xff), f);
|
return fputc(((i >> 8) & 0xff), f);
|
||||||
}
|
}
|
||||||
|
|
@ -209,15 +209,15 @@ int writeINT32little(FILE *f, CGAL_INT32 i)
|
||||||
|
|
||||||
rc = fputc((i & 0xff), f);
|
rc = fputc((i & 0xff), f);
|
||||||
if (rc == EOF)
|
if (rc == EOF)
|
||||||
return rc;
|
return EOF;
|
||||||
|
|
||||||
rc = fputc(((i >> 8) & 0xff), f);
|
rc = fputc(((i >> 8) & 0xff), f);
|
||||||
if (rc == EOF)
|
if (rc == EOF)
|
||||||
return rc;
|
return EOF;
|
||||||
|
|
||||||
rc = fputc(((i >> 16) & 0xff), f);
|
rc = fputc(((i >> 16) & 0xff), f);
|
||||||
if (rc == EOF)
|
if (rc == EOF)
|
||||||
return rc;
|
return EOF;
|
||||||
|
|
||||||
return fputc(((i >> 24) & 0xff), f);
|
return fputc(((i >> 24) & 0xff), f);
|
||||||
}
|
}
|
||||||
|
|
@ -230,15 +230,15 @@ int writeUINT32little(FILE *f, CGAL_UINT32 i)
|
||||||
|
|
||||||
rc = fputc((i & 0xff), f);
|
rc = fputc((i & 0xff), f);
|
||||||
if (rc == EOF)
|
if (rc == EOF)
|
||||||
return rc;
|
return EOF;
|
||||||
|
|
||||||
rc = fputc(((i >> 8) & 0xff), f);
|
rc = fputc(((i >> 8) & 0xff), f);
|
||||||
if (rc == EOF)
|
if (rc == EOF)
|
||||||
return rc;
|
return EOF;
|
||||||
|
|
||||||
rc = fputc(((i >> 16) & 0xff), f);
|
rc = fputc(((i >> 16) & 0xff), f);
|
||||||
if (rc == EOF)
|
if (rc == EOF)
|
||||||
return rc;
|
return EOF;
|
||||||
|
|
||||||
return fputc(((i >> 24) & 0xff), f);
|
return fputc(((i >> 24) & 0xff), f);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -699,3 +699,5 @@ static int GifError(const char *st) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef CGAL_GLOBAL_STATE_VAR
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -503,7 +503,7 @@ Image_3::labellized_trilinear_interpolation
|
||||||
static_cast<unsigned int>(lc));
|
static_cast<unsigned int>(lc));
|
||||||
|
|
||||||
if(lc == 1) {
|
if(lc == 1) {
|
||||||
return labels[0];
|
return static_cast<Target_type>(labels[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
double best_value = 0.;
|
double best_value = 0.;
|
||||||
|
|
@ -521,7 +521,7 @@ Image_3::labellized_trilinear_interpolation
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// CGAL_assertion(best_value > 0.5);
|
// CGAL_assertion(best_value > 0.5);
|
||||||
return best;
|
return static_cast<Target_type>(best);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end namespace CGAL
|
} // end namespace CGAL
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ VertexIndexMap vertex_id_map;
|
||||||
typedef boost::associative_property_map<VertexIndexMap> VertexIdPropertyMap;
|
typedef boost::associative_property_map<VertexIndexMap> VertexIdPropertyMap;
|
||||||
VertexIdPropertyMap vertex_index_pmap(vertex_id_map);
|
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;
|
std::list<Point_2> pt_list;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,33 @@ message( "== CMake setup ==" )
|
||||||
project(CGAL CXX C)
|
project(CGAL CXX C)
|
||||||
|
|
||||||
# Minimal version of CMake:
|
# 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)
|
set( CGAL_BRANCH_BUILD ON CACHE INTERNAL "Create CGAL from a Git branch" FORCE)
|
||||||
|
|
||||||
include(${CMAKE_SOURCE_DIR}/Installation/cmake/modules/CGAL_SCM.cmake)
|
include(${CMAKE_SOURCE_DIR}/Installation/cmake/modules/CGAL_SCM.cmake)
|
||||||
CGAL_detect_git(${CMAKE_SOURCE_DIR})
|
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
|
# 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)
|
option( CGAL_REPORT_DUPLICATE_FILES "Switch on to start (naive) detection of duplicate source- and headerfiles in packages" OFF)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3181,6 +3181,7 @@ namespace CartesianKernelFunctors {
|
||||||
typedef typename K::Line_3 Line_3;
|
typedef typename K::Line_3 Line_3;
|
||||||
typedef typename K::Triangle_3 Triangle_3;
|
typedef typename K::Triangle_3 Triangle_3;
|
||||||
typedef typename K::Segment_3 Segment_3;
|
typedef typename K::Segment_3 Segment_3;
|
||||||
|
typedef typename K::Ray_3 Ray_3;
|
||||||
typedef typename K::FT FT;
|
typedef typename K::FT FT;
|
||||||
public:
|
public:
|
||||||
typedef Point_3 result_type;
|
typedef Point_3 result_type;
|
||||||
|
|
@ -3215,6 +3216,10 @@ namespace CartesianKernelFunctors {
|
||||||
Point_3
|
Point_3
|
||||||
operator()( const Segment_3& s, const Point_3& p ) const
|
operator()( const Segment_3& s, const Point_3& p ) const
|
||||||
{ return CommonKernelFunctors::Construct_projected_point_3<K>()(p,s,K()); }
|
{ 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>
|
template <class K>
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@
|
||||||
// provided you give a NT converter from A to B.
|
// provided you give a NT converter from A to B.
|
||||||
// There's a Homogeneous counterpart.
|
// There's a Homogeneous counterpart.
|
||||||
|
|
||||||
|
#include <CGAL/Cartesian_converter_fwd.h>
|
||||||
#include <CGAL/basic.h>
|
#include <CGAL/basic.h>
|
||||||
#include <CGAL/NT_converter.h>
|
#include <CGAL/NT_converter.h>
|
||||||
#include <CGAL/Enum_converter.h>
|
#include <CGAL/Enum_converter.h>
|
||||||
|
|
@ -91,7 +92,7 @@ struct Converting_visitor : boost::static_visitor<> {
|
||||||
|
|
||||||
template < class K1, class K2,
|
template < class K1, class K2,
|
||||||
// class Converter = NT_converter<typename K1::FT, typename K2::FT> >
|
// 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
|
class Cartesian_converter : public Enum_converter
|
||||||
{
|
{
|
||||||
typedef Enum_converter Base;
|
typedef Enum_converter Base;
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,8 @@
|
||||||
// and a STREP (FET Open) Project under Contract No IST-006413
|
// and a STREP (FET Open) Project under Contract No IST-006413
|
||||||
// (ACS -- Algorithms for Complex Shapes)
|
// (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/Cartesian.h>
|
||||||
#include <CGAL/Algebraic_kernel_for_circles_2_2.h>
|
#include <CGAL/Algebraic_kernel_for_circles_2_2.h>
|
||||||
#include <CGAL/Circular_kernel_2.h>
|
#include <CGAL/Circular_kernel_2.h>
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,8 @@
|
||||||
// and a STREP (FET Open) Project under Contract No IST-006413
|
// and a STREP (FET Open) Project under Contract No IST-006413
|
||||||
// (ACS -- Algorithms for Complex Shapes)
|
// (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/basic.h>
|
||||||
#include <CGAL/Exact_circular_kernel_2.h>
|
#include <CGAL/Exact_circular_kernel_2.h>
|
||||||
#include <CGAL/intersections.h>
|
#include <CGAL/intersections.h>
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,8 @@
|
||||||
// and a STREP (FET Open) Project under Contract No IST-006413
|
// and a STREP (FET Open) Project under Contract No IST-006413
|
||||||
// (ACS -- Algorithms for Complex Shapes)
|
// (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/Cartesian.h>
|
||||||
#include <CGAL/Algebraic_kernel_for_circles_2_2.h>
|
#include <CGAL/Algebraic_kernel_for_circles_2_2.h>
|
||||||
#include <CGAL/Circular_kernel_2.h>
|
#include <CGAL/Circular_kernel_2.h>
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
// and a STREP (FET Open) Project under Contract No IST-006413
|
// and a STREP (FET Open) Project under Contract No IST-006413
|
||||||
// (ACS -- Algorithms for Complex Shapes)
|
// (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/basic.h>
|
||||||
#include <CGAL/Exact_circular_kernel_2.h>
|
#include <CGAL/Exact_circular_kernel_2.h>
|
||||||
|
|
|
||||||
|
|
@ -11,12 +11,9 @@ include(${CGAL_USE_FILE})
|
||||||
|
|
||||||
find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL)
|
find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL)
|
||||||
|
|
||||||
find_package(QGLViewer)
|
if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND)
|
||||||
|
|
||||||
if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND QGLVIEWER_FOUND )
|
|
||||||
|
|
||||||
|
|
||||||
include_directories (${QGLVIEWER_INCLUDE_DIR})
|
|
||||||
include_directories (BEFORE ../../include ./ )
|
include_directories (BEFORE ../../include ./ )
|
||||||
|
|
||||||
add_executable (Circular_kernel_3 Circular_kernel_3.cpp Viewer.cpp ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
|
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
|
target_link_libraries( Circular_kernel_3 PRIVATE
|
||||||
CGAL::CGAL CGAL::CGAL_Qt5
|
CGAL::CGAL CGAL::CGAL_Qt5
|
||||||
Qt5::OpenGL Qt5::Gui ${QGLVIEWER_LIBRARIES} )
|
Qt5::OpenGL Qt5::Gui)
|
||||||
|
|
||||||
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
|
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
|
||||||
cgal_add_compilation_test(Circular_kernel_3)
|
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()
|
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()
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
|
|
||||||
Viewer::Viewer(QWidget* parent )
|
Viewer::Viewer(QWidget* parent )
|
||||||
: QGLViewer(CGAL::Qt::createOpenGLContext(),parent)
|
: CGAL::QGLViewer(parent)
|
||||||
{
|
{
|
||||||
extension_is_found = false;
|
extension_is_found = false;
|
||||||
}
|
}
|
||||||
|
|
@ -316,8 +316,8 @@ void Viewer::compute_elements()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
P = rings*M_PI/180.0;
|
P = rings*CGAL_PI/180.0;
|
||||||
T = t*M_PI/180.0;
|
T = t*CGAL_PI/180.0;
|
||||||
x[1] = sin(P) * cos(T) ;
|
x[1] = sin(P) * cos(T) ;
|
||||||
y[1] = sin(P) * sin(T) ;
|
y[1] = sin(P) * sin(T) ;
|
||||||
z[1] = cos(P);
|
z[1] = cos(P);
|
||||||
|
|
@ -331,8 +331,8 @@ void Viewer::compute_elements()
|
||||||
normals.push_back(z[1]);
|
normals.push_back(z[1]);
|
||||||
|
|
||||||
//
|
//
|
||||||
P = rings*M_PI/180.0;
|
P = rings*CGAL_PI/180.0;
|
||||||
T = (t+sectors)*M_PI/180.0;
|
T = (t+sectors)*CGAL_PI/180.0;
|
||||||
x[2] = sin(P) * cos(T) ;
|
x[2] = sin(P) * cos(T) ;
|
||||||
y[2] = sin(P) * sin(T) ;
|
y[2] = sin(P) * sin(T) ;
|
||||||
z[2] = cos(P);
|
z[2] = cos(P);
|
||||||
|
|
@ -351,8 +351,8 @@ void Viewer::compute_elements()
|
||||||
for(int t=0; t<360; t+=sectors)
|
for(int t=0; t<360; t+=sectors)
|
||||||
{
|
{
|
||||||
//A
|
//A
|
||||||
P = p*M_PI/180.0;
|
P = p*CGAL_PI/180.0;
|
||||||
T = t*M_PI/180.0;
|
T = t*CGAL_PI/180.0;
|
||||||
x[0] = sin(P) * cos(T) ;
|
x[0] = sin(P) * cos(T) ;
|
||||||
y[0] = sin(P) * sin(T) ;
|
y[0] = sin(P) * sin(T) ;
|
||||||
z[0] = cos(P);
|
z[0] = cos(P);
|
||||||
|
|
@ -367,8 +367,8 @@ void Viewer::compute_elements()
|
||||||
normals.push_back(z[0]);
|
normals.push_back(z[0]);
|
||||||
|
|
||||||
//B
|
//B
|
||||||
P = (p+rings)*M_PI/180.0;
|
P = (p+rings)*CGAL_PI/180.0;
|
||||||
T = t*M_PI/180.0;
|
T = t*CGAL_PI/180.0;
|
||||||
x[1] = sin(P) * cos(T) ;
|
x[1] = sin(P) * cos(T) ;
|
||||||
y[1] = sin(P) * sin(T) ;
|
y[1] = sin(P) * sin(T) ;
|
||||||
z[1] = cos(P);
|
z[1] = cos(P);
|
||||||
|
|
@ -382,8 +382,8 @@ void Viewer::compute_elements()
|
||||||
normals.push_back(z[1]);
|
normals.push_back(z[1]);
|
||||||
|
|
||||||
//C
|
//C
|
||||||
P = p*M_PI/180.0;
|
P = p*CGAL_PI/180.0;
|
||||||
T = (t+sectors)*M_PI/180.0;
|
T = (t+sectors)*CGAL_PI/180.0;
|
||||||
x[2] = sin(P) * cos(T) ;
|
x[2] = sin(P) * cos(T) ;
|
||||||
y[2] = sin(P) * sin(T) ;
|
y[2] = sin(P) * sin(T) ;
|
||||||
z[2] = cos(P);
|
z[2] = cos(P);
|
||||||
|
|
@ -396,8 +396,8 @@ void Viewer::compute_elements()
|
||||||
normals.push_back(y[2]);
|
normals.push_back(y[2]);
|
||||||
normals.push_back(z[2]);
|
normals.push_back(z[2]);
|
||||||
//D
|
//D
|
||||||
P = (p+rings)*M_PI/180.0;
|
P = (p+rings)*CGAL_PI/180.0;
|
||||||
T = (t+sectors)*M_PI/180.0;
|
T = (t+sectors)*CGAL_PI/180.0;
|
||||||
x[3] = sin(P) * cos(T) ;
|
x[3] = sin(P) * cos(T) ;
|
||||||
y[3] = sin(P) * sin(T) ;
|
y[3] = sin(P) * sin(T) ;
|
||||||
z[3] = cos(P);
|
z[3] = cos(P);
|
||||||
|
|
@ -446,8 +446,8 @@ void Viewer::compute_elements()
|
||||||
normals.push_back(-1);
|
normals.push_back(-1);
|
||||||
|
|
||||||
|
|
||||||
P = (180-rings)*M_PI/180.0;
|
P = (180-rings)*CGAL_PI/180.0;
|
||||||
T = t*M_PI/180.0;
|
T = t*CGAL_PI/180.0;
|
||||||
x[1] = sin(P) * cos(T) ;
|
x[1] = sin(P) * cos(T) ;
|
||||||
y[1] = sin(P) * sin(T) ;
|
y[1] = sin(P) * sin(T) ;
|
||||||
z[1] = cos(P);
|
z[1] = cos(P);
|
||||||
|
|
@ -461,8 +461,8 @@ void Viewer::compute_elements()
|
||||||
normals.push_back(z[1]);
|
normals.push_back(z[1]);
|
||||||
|
|
||||||
|
|
||||||
P = (180-rings)*M_PI/180.0;
|
P = (180-rings)*CGAL_PI/180.0;
|
||||||
T = (t+sectors)*M_PI/180.0;
|
T = (t+sectors)*CGAL_PI/180.0;
|
||||||
x[2] = sin(P) * cos(T) ;
|
x[2] = sin(P) * cos(T) ;
|
||||||
y[2] = sin(P) * sin(T) ;
|
y[2] = sin(P) * sin(T) ;
|
||||||
z[2] = cos(P);
|
z[2] = cos(P);
|
||||||
|
|
@ -501,8 +501,8 @@ void Viewer::compute_elements()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
P = rings*M_PI/180.0;
|
P = rings*CGAL_PI/180.0;
|
||||||
T = t*M_PI/180.0;
|
T = t*CGAL_PI/180.0;
|
||||||
x[1] = sin(P) * cos(T) ;
|
x[1] = sin(P) * cos(T) ;
|
||||||
y[1] = sin(P) * sin(T) ;
|
y[1] = sin(P) * sin(T) ;
|
||||||
z[1] = cos(P);
|
z[1] = cos(P);
|
||||||
|
|
@ -516,8 +516,8 @@ void Viewer::compute_elements()
|
||||||
normals_inter.push_back(z[1]);
|
normals_inter.push_back(z[1]);
|
||||||
|
|
||||||
//
|
//
|
||||||
P = rings*M_PI/180.0;
|
P = rings*CGAL_PI/180.0;
|
||||||
T = (t+sectors)*M_PI/180.0;
|
T = (t+sectors)*CGAL_PI/180.0;
|
||||||
x[2] = sin(P) * cos(T) ;
|
x[2] = sin(P) * cos(T) ;
|
||||||
y[2] = sin(P) * sin(T) ;
|
y[2] = sin(P) * sin(T) ;
|
||||||
z[2] = cos(P);
|
z[2] = cos(P);
|
||||||
|
|
@ -536,8 +536,8 @@ void Viewer::compute_elements()
|
||||||
for(int t=0; t<360; t+=sectors)
|
for(int t=0; t<360; t+=sectors)
|
||||||
{
|
{
|
||||||
//A
|
//A
|
||||||
P = p*M_PI/180.0;
|
P = p*CGAL_PI/180.0;
|
||||||
T = t*M_PI/180.0;
|
T = t*CGAL_PI/180.0;
|
||||||
x[0] = sin(P) * cos(T) ;
|
x[0] = sin(P) * cos(T) ;
|
||||||
y[0] = sin(P) * sin(T) ;
|
y[0] = sin(P) * sin(T) ;
|
||||||
z[0] = cos(P);
|
z[0] = cos(P);
|
||||||
|
|
@ -552,8 +552,8 @@ void Viewer::compute_elements()
|
||||||
normals_inter.push_back(z[0]);
|
normals_inter.push_back(z[0]);
|
||||||
|
|
||||||
//B
|
//B
|
||||||
P = (p+rings)*M_PI/180.0;
|
P = (p+rings)*CGAL_PI/180.0;
|
||||||
T = t*M_PI/180.0;
|
T = t*CGAL_PI/180.0;
|
||||||
x[1] = sin(P) * cos(T) ;
|
x[1] = sin(P) * cos(T) ;
|
||||||
y[1] = sin(P) * sin(T) ;
|
y[1] = sin(P) * sin(T) ;
|
||||||
z[1] = cos(P);
|
z[1] = cos(P);
|
||||||
|
|
@ -567,8 +567,8 @@ void Viewer::compute_elements()
|
||||||
normals_inter.push_back(z[1]);
|
normals_inter.push_back(z[1]);
|
||||||
|
|
||||||
//C
|
//C
|
||||||
P = p*M_PI/180.0;
|
P = p*CGAL_PI/180.0;
|
||||||
T = (t+sectors)*M_PI/180.0;
|
T = (t+sectors)*CGAL_PI/180.0;
|
||||||
x[2] = sin(P) * cos(T) ;
|
x[2] = sin(P) * cos(T) ;
|
||||||
y[2] = sin(P) * sin(T) ;
|
y[2] = sin(P) * sin(T) ;
|
||||||
z[2] = cos(P);
|
z[2] = cos(P);
|
||||||
|
|
@ -581,8 +581,8 @@ void Viewer::compute_elements()
|
||||||
normals_inter.push_back(y[2]);
|
normals_inter.push_back(y[2]);
|
||||||
normals_inter.push_back(z[2]);
|
normals_inter.push_back(z[2]);
|
||||||
//D
|
//D
|
||||||
P = (p+rings)*M_PI/180.0;
|
P = (p+rings)*CGAL_PI/180.0;
|
||||||
T = (t+sectors)*M_PI/180.0;
|
T = (t+sectors)*CGAL_PI/180.0;
|
||||||
x[3] = sin(P) * cos(T) ;
|
x[3] = sin(P) * cos(T) ;
|
||||||
y[3] = sin(P) * sin(T) ;
|
y[3] = sin(P) * sin(T) ;
|
||||||
z[3] = cos(P);
|
z[3] = cos(P);
|
||||||
|
|
@ -631,8 +631,8 @@ void Viewer::compute_elements()
|
||||||
normals_inter.push_back(-1);
|
normals_inter.push_back(-1);
|
||||||
|
|
||||||
|
|
||||||
P = (180-rings)*M_PI/180.0;
|
P = (180-rings)*CGAL_PI/180.0;
|
||||||
T = t*M_PI/180.0;
|
T = t*CGAL_PI/180.0;
|
||||||
x[1] = sin(P) * cos(T) ;
|
x[1] = sin(P) * cos(T) ;
|
||||||
y[1] = sin(P) * sin(T) ;
|
y[1] = sin(P) * sin(T) ;
|
||||||
z[1] = cos(P);
|
z[1] = cos(P);
|
||||||
|
|
@ -646,8 +646,8 @@ void Viewer::compute_elements()
|
||||||
normals_inter.push_back(z[1]);
|
normals_inter.push_back(z[1]);
|
||||||
|
|
||||||
|
|
||||||
P = (180-rings)*M_PI/180.0;
|
P = (180-rings)*CGAL_PI/180.0;
|
||||||
T = (t+sectors)*M_PI/180.0;
|
T = (t+sectors)*CGAL_PI/180.0;
|
||||||
x[2] = sin(P) * cos(T) ;
|
x[2] = sin(P) * cos(T) ;
|
||||||
y[2] = sin(P) * sin(T) ;
|
y[2] = sin(P) * sin(T) ;
|
||||||
z[2] = cos(P);
|
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 mvpMatrix;
|
||||||
QMatrix4x4 mvMatrix;
|
QMatrix4x4 mvMatrix;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QGLViewer/qglviewer.h>
|
#include <CGAL/Qt/qglviewer.h>
|
||||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||||
|
|
||||||
#include <QOpenGLFunctions_2_1>
|
#include <QOpenGLFunctions_2_1>
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
typedef CGAL::Exact_predicates_inexact_constructions_kernel EPIC;
|
typedef CGAL::Exact_predicates_inexact_constructions_kernel EPIC;
|
||||||
|
|
||||||
class Viewer : public QGLViewer, QOpenGLFunctions_2_1
|
class Viewer : public CGAL::QGLViewer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Viewer(QWidget* parent = 0);
|
Viewer(QWidget* parent = 0);
|
||||||
|
|
@ -52,7 +52,7 @@ private:
|
||||||
|
|
||||||
void initialize_buffers();
|
void initialize_buffers();
|
||||||
void compute_elements();
|
void compute_elements();
|
||||||
void attrib_buffers(QGLViewer*);
|
void attrib_buffers(CGAL::QGLViewer*);
|
||||||
void compile_shaders();
|
void compile_shaders();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -496,7 +496,7 @@ private:
|
||||||
launch_feature_computation (new Feature_adder_verticality<VectorMap> (this, normal_map, 0));
|
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> ();
|
generate_multiscale_feature_variant_0<Verticality> ();
|
||||||
}
|
}
|
||||||
|
|
@ -544,7 +544,7 @@ private:
|
||||||
2, 25.f * float(i), 12.5f));
|
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));
|
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>
|
template <typename T>
|
||||||
Default_property_map<Iterator, T>
|
Constant_property_map<Iterator, T>
|
||||||
get_parameter (const Default&)
|
get_parameter (const Default&)
|
||||||
{
|
{
|
||||||
return Default_property_map<Iterator, T>();
|
return Constant_property_map<Iterator, T>();
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename VectorMap, typename ColorMap, typename EchoMap>
|
template<typename VectorMap, typename ColorMap, typename EchoMap>
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
#include <cstdlib>
|
#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
|
#define CGAL_CMAP_DART_DEPRECATED 1
|
||||||
|
|
||||||
#include <CGAL/Combinatorial_map.h>
|
#include <CGAL/Combinatorial_map.h>
|
||||||
|
|
@ -88,12 +87,3 @@ int main()
|
||||||
std::cout<<" Success."<<std::endl;
|
std::cout<<" Success."<<std::endl;
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else // CGAL_NO_DEPRECATED_CODE
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
return EXIT_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // CGAL_NO_DEPRECATED_CODE
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
#include <CGAL/point_generators_3.h>
|
#include <CGAL/point_generators_3.h>
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <CGAL/IO/Polyhedron_iostream.h>
|
#include <CGAL/Polyhedron_3.h>
|
||||||
#include <CGAL/Surface_mesh.h>
|
#include <CGAL/Surface_mesh.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#define CGAL_NO_DEPRECATION_WARNINGS
|
#include <CGAL/internal/disable_deprecation_warnings_and_errors.h>
|
||||||
|
|
||||||
#include <CGAL/basic.h>
|
#include <CGAL/basic.h>
|
||||||
#include <CGAL/Homogeneous.h>
|
#include <CGAL/Homogeneous.h>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#define CGAL_NO_DEPRECATION_WARNINGS
|
#include <CGAL/internal/disable_deprecation_warnings_and_errors.h>
|
||||||
|
|
||||||
#include <CGAL/basic.h>
|
#include <CGAL/basic.h>
|
||||||
#include <CGAL/Homogeneous_d.h>
|
#include <CGAL/Homogeneous_d.h>
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,11 @@ class DefaultConstructible {};
|
||||||
/// See http://en.cppreference.com/w/cpp/concept/CopyConstructible
|
/// See http://en.cppreference.com/w/cpp/concept/CopyConstructible
|
||||||
class CopyConstructible {};
|
class CopyConstructible {};
|
||||||
|
|
||||||
|
/// \cgalConcept
|
||||||
|
/// Concept from the \cpp standard.
|
||||||
|
/// See http://en.cppreference.com/w/cpp/concept/Callable
|
||||||
|
class Callable {};
|
||||||
|
|
||||||
/// \cgalConcept
|
/// \cgalConcept
|
||||||
/// Concept from the \cpp standard.
|
/// Concept from the \cpp standard.
|
||||||
/// See http://en.cppreference.com/w/cpp/concept/EqualityComparable
|
/// See http://en.cppreference.com/w/cpp/concept/EqualityComparable
|
||||||
|
|
|
||||||
|
|
@ -18,13 +18,13 @@ make # build the \cgal libraries
|
||||||
Compiling an example or a demo shipped with \cgal is similarly simple:
|
Compiling an example or a demo shipped with \cgal is similarly simple:
|
||||||
|
|
||||||
<PRE>
|
<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
|
cmake -DCGAL_DIR=$HOME/CGAL-\cgalReleaseNumber . # configure the examples
|
||||||
make # build the examples
|
make # build the examples
|
||||||
</PRE>
|
</PRE>
|
||||||
|
|
||||||
<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
|
cmake -DCGAL_DIR=$HOME/CGAL-\cgalReleaseNumber . # configure the demos
|
||||||
make # build the demos
|
make # build the demos
|
||||||
</PRE>
|
</PRE>
|
||||||
|
|
@ -41,11 +41,6 @@ make
|
||||||
where the second line creates a `CMakeLists.txt` file (check
|
where the second line creates a `CMakeLists.txt` file (check
|
||||||
its options in Section \ref seccreate_cgal_CMakeLists for various details).
|
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
|
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.
|
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
|
to select and download some precompiled third party libraries. However, you will need to compile
|
||||||
the library using your favorite compiler.
|
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
|
\section seccompilers Supported Compilers
|
||||||
|
|
||||||
In order to build the \cgal libraries, you need a \cpp compiler.
|
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 |
|
| 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{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{MS} Windows |
|
||||||
| \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++` 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 |
|
||||||
|\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 6.0.0 | Linux |
|
||||||
| `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 7.0.2 | MacOS X |
|
||||||
| Apple `Clang` compiler version 6.0 and 4.2 | MacOS X |
|
|
||||||
|
It may work for older versions of the above listed compilers.
|
||||||
|
|
||||||
|
|
||||||
\section secconfigwithcmake Configuring CGAL with CMake
|
\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
|
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
|
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
|
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>
|
<PRE>
|
||||||
cd CGAL-\cgalReleaseNumber
|
cd CGAL-\cgalReleaseNumber
|
||||||
cmake -G"Visual Studio 11 Win64" .
|
cmake -G"Visual Studio 15 2017 Win64" .
|
||||||
</PRE>
|
</PRE>
|
||||||
|
|
||||||
In other cases, however, the generator doesn't directly identify a
|
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
|
\cgal heavily uses the \stl, and in particular adopted
|
||||||
many of its design ideas. You can find online
|
many of its design ideas. You can find online
|
||||||
documentation for the \stl at various web sites, for instance,
|
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>,
|
<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>.
|
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.
|
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>.
|
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
|
\subsection thirdpartyESBTL ESBTL
|
||||||
|
|
||||||
The \sc{Esbtl} (Easy Structural Biology Template Library) is a library that allows
|
The \sc{Esbtl} (Easy Structural Biology Template Library) is a library that allows
|
||||||
|
|
@ -677,9 +665,6 @@ make examples
|
||||||
# build all demos at once
|
# build all demos at once
|
||||||
make demos
|
make demos
|
||||||
|
|
||||||
# build only the Straight Skeleton demo
|
|
||||||
make Straight_skeleton_2_demo
|
|
||||||
|
|
||||||
</PRE>
|
</PRE>
|
||||||
|
|
||||||
\cgalAdvancedBegin
|
\cgalAdvancedBegin
|
||||||
|
|
@ -761,7 +746,7 @@ Ideally, configuring and compiling a demo/example/program amounts to
|
||||||
|
|
||||||
<PRE>
|
<PRE>
|
||||||
|
|
||||||
cd CGAL-\cgalReleaseNumber/examples/Straight_skeleton_2
|
cd CGAL-\cgalReleaseNumber/examples/Triangulation_2
|
||||||
cmake -DCGAL_DIR=$HOME/CGAL-\cgalReleaseNumber .
|
cmake -DCGAL_DIR=$HOME/CGAL-\cgalReleaseNumber .
|
||||||
make
|
make
|
||||||
|
|
||||||
|
|
@ -897,7 +882,7 @@ controlling variable right up front:
|
||||||
<PRE>
|
<PRE>
|
||||||
cd CGAL-\cgalReleaseNumber
|
cd CGAL-\cgalReleaseNumber
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-g .
|
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 .
|
cmake -DCGAL_DIR=CGAL-\cgalReleaseNumber -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS=-O2 -DCGAL_DONT_OVERRIDE_CMAKE_FLAGS=TRUE .
|
||||||
</PRE>
|
</PRE>
|
||||||
\cgalAdvancedEnd
|
\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_INCLUDE_DIR` | Directory containing the file `signature_of_eigen3_matrix_library` | CMake |
|
||||||
| `EIGEN3_INC_DIR` | Idem | Environment |
|
| `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
|
\subsection installation_esbtl ESBTL Library
|
||||||
|
|
||||||
One skin surface example requires the \sc{Esbtl} library in order to read \sc{Pdb} files.
|
One skin surface example requires the \sc{Esbtl} library in order to read \sc{Pdb} files.
|
||||||
|
|
|
||||||
|
|
@ -1571,7 +1571,7 @@ MATHJAX_FORMAT = HTML-CSS
|
||||||
# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2.
|
# 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.
|
# 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
|
# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
|
||||||
# extension names that should be enabled during MathJax rendering. For example
|
# extension names that should be enabled during MathJax rendering. For example
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,8 @@ body {color: black; background-color: #C0C0D0; font-family: sans-serif;}
|
||||||
</style>
|
</style>
|
||||||
</head><body>
|
</head><body>
|
||||||
<h1 id="maintitle">Doxygen Manual Results</h1>'''
|
<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>
|
<tr>
|
||||||
<th>Package Name</th>
|
<th>Package Name</th>
|
||||||
<th>Logs </th>
|
<th>Logs </th>
|
||||||
|
|
@ -101,7 +102,7 @@ body {color: black; background-color: #C0C0D0; font-family: sans-serif;}
|
||||||
suffix = ''
|
suffix = ''
|
||||||
if args.doxygen_version2:
|
if args.doxygen_version2:
|
||||||
suffix = 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 = ''
|
suffix = ''
|
||||||
if args.master_describe:
|
if args.master_describe:
|
||||||
suffix=args.master_describe
|
suffix=args.master_describe
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
#define CGAL_EPIC_CONVERTER_H
|
#define CGAL_EPIC_CONVERTER_H
|
||||||
|
|
||||||
|
|
||||||
#include <CGAL/basic.h>
|
#include <CGAL/config.h>
|
||||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||||
|
|
||||||
namespace CGAL {
|
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::Sphere_3 Sphere_3;
|
||||||
typedef typename Exact_predicates_inexact_constructions_kernel::Circle_3 Circle_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 Exact_predicates_inexact_constructions_kernel::Iso_cuboid_3 Iso_cuboid_3;
|
||||||
|
|
||||||
|
typedef typename IK::FT IK_FT;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -61,6 +63,7 @@ public:
|
||||||
std::pair<double,bool> operator()(const typename IK::FT n) const
|
std::pair<double,bool> operator()(const typename IK::FT n) const
|
||||||
{
|
{
|
||||||
double d;
|
double d;
|
||||||
|
internal::init_double(d, (IK_FT*)(0));
|
||||||
if(fit_in_double(n,d)){
|
if(fit_in_double(n,d)){
|
||||||
return std::make_pair(d,true);
|
return std::make_pair(d,true);
|
||||||
}
|
}
|
||||||
|
|
@ -80,6 +83,7 @@ public:
|
||||||
std::pair<Point_2,bool> operator()(const typename IK::Point_2& p) const
|
std::pair<Point_2,bool> operator()(const typename IK::Point_2& p) const
|
||||||
{
|
{
|
||||||
double x, y;
|
double x, y;
|
||||||
|
internal::init_double(x, y, (IK_FT*)(0));
|
||||||
if(fit_in_double(p.x(),x) && fit_in_double(p.y(),y)){
|
if(fit_in_double(p.x(),x) && fit_in_double(p.y(),y)){
|
||||||
return std::make_pair(Point_2(x,y),true);
|
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
|
std::pair<Vector_2,bool> operator()(const typename IK::Vector_2& v) const
|
||||||
{
|
{
|
||||||
double x, y;
|
double x, y;
|
||||||
|
internal::init_double(x, y, (IK_FT*)(0));
|
||||||
if(fit_in_double(v.x(),x) && fit_in_double(v.y(),y)){
|
if(fit_in_double(v.x(),x) && fit_in_double(v.y(),y)){
|
||||||
return std::make_pair(Vector_2(x,y),true);
|
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
|
std::pair<Direction_2,bool> operator()(const typename IK::Direction_2& d) const
|
||||||
{
|
{
|
||||||
double x, y;
|
double x, y;
|
||||||
|
internal::init_double(x, y, (IK_FT*)(0));
|
||||||
if(fit_in_double(d.dx(),x) && fit_in_double(d.dy(),y)){
|
if(fit_in_double(d.dx(),x) && fit_in_double(d.dy(),y)){
|
||||||
return std::make_pair(Direction_2(x,y),true);
|
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
|
std::pair<Point_3,bool> operator()(const typename IK::Point_3& p) const
|
||||||
{
|
{
|
||||||
double x, y, z;
|
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)){
|
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);
|
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
|
std::pair<Vector_3,bool> operator()(const typename IK::Vector_3& v) const
|
||||||
{
|
{
|
||||||
double x, y, z;
|
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)){
|
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);
|
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
|
std::pair<Direction_3,bool> operator()(const typename IK::Direction_3& d) const
|
||||||
{
|
{
|
||||||
double x, y, z;
|
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)){
|
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);
|
return std::make_pair(Direction_3(x,y,z),true);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,9 @@ namespace CGAL {
|
||||||
template < typename ET >
|
template < typename ET >
|
||||||
class Lazy_exact_nt;
|
class Lazy_exact_nt;
|
||||||
|
|
||||||
|
template <bool Protected>
|
||||||
|
class Interval_nt;
|
||||||
|
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
// Utility function to check a posteriori that a subtraction was performed
|
// 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>* )
|
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;}
|
{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,
|
// Auxiliary function to check if static filters can be applied, that is,
|
||||||
// if to_double() does not add roundoff errors.
|
// if to_double() does not add roundoff errors.
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,7 @@
|
||||||
#include <CGAL/Generalized_map_operations.h>
|
#include <CGAL/Generalized_map_operations.h>
|
||||||
#include <CGAL/Random.h>
|
#include <CGAL/Random.h>
|
||||||
|
|
||||||
#include <CGAL/IO/Polyhedron_iostream.h>
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue