Fix Conflicts

This commit is contained in:
Maxime Gimeno 2018-06-26 15:17:58 +02:00
commit 8e3eebea0d
739 changed files with 30269 additions and 10622 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -27,14 +27,8 @@ find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Gui Svg)
include( ${CGAL_USE_FILE} )
# Find QGLViewer
if(Qt5_FOUND)
find_package(QGLViewer)
endif(Qt5_FOUND)
if(CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND QGLVIEWER_FOUND)
include_directories ( ${QGLVIEWER_INCLUDE_DIR} )
if(CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND)
qt5_wrap_ui( UI_FILES MainWindow.ui )
@ -55,20 +49,22 @@ if(CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND QGLVIEWER_FOUND)
"${CMAKE_CURRENT_BINARY_DIR}/Viewer_moc.cpp"
"${CMAKE_CURRENT_BINARY_DIR}/Scene_moc.cpp" )
add_executable ( AABB_demo AABB_demo.cpp ${UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
add_executable ( AABB_demo AABB_demo.cpp ${UI_FILES} ${CGAL_Qt5_RESOURCE_FILES}
#${CGAL_Qt5_MOC_FILES}
)
# Link with Qt libraries
target_link_libraries( AABB_demo PRIVATE
Qt5::OpenGL Qt5::Gui
Qt5::OpenGL Qt5::Gui Qt5::Xml
CGAL::CGAL
CGAL::CGAL_Qt5
${QGLVIEWER_LIBRARIES})
)
add_to_cached_list( CGAL_EXECUTABLE_TARGETS AABB_demo )
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(AABB_demo)
else (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND QGLVIEWER_FOUND)
else (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND)
set(AABB_MISSING_DEPS "")
@ -84,10 +80,6 @@ else (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND QGLVIEWER_FOUND)
set(AABB_MISSING_DEPS "Qt5, ${AABB_MISSING_DEPS}")
endif()
if(NOT QGLVIEWER_FOUND)
set(AABB_MISSING_DEPS "QGLViewer, ${AABB_MISSING_DEPS}")
endif()
message(STATUS "NOTICE: This demo requires ${AABB_MISSING_DEPS}and will not be compiled.")
endif (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND QGLVIEWER_FOUND)
endif (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND )

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2313,7 +2313,7 @@ namespace CGAL {
}
struct Remove : public CGAL::unary_function<Vertex_handle, bool>
struct Remove : public CGAL::cpp98::unary_function<Vertex_handle, bool>
{
Extract& E;
@ -2451,7 +2451,7 @@ namespace CGAL {
namespace AFSR {
template <typename T>
struct Auto_count : public CGAL::unary_function<const T&,std::pair<T,std::size_t> >{
struct Auto_count : public CGAL::cpp98::unary_function<const T&,std::pair<T,std::size_t> >{
mutable std::size_t i;
Auto_count()
@ -2464,7 +2464,7 @@ namespace CGAL {
};
template <typename T, typename CC>
struct Auto_count_cc : public CGAL::unary_function<const T&,std::pair<T,std::size_t> >{
struct Auto_count_cc : public CGAL::cpp98::unary_function<const T&,std::pair<T,std::size_t> >{
mutable std::size_t i;
CC cc;

View File

@ -47,7 +47,7 @@ public:
//! computes the factor which normalizes a number to be integral after
// multiplication
class Normalization_factor
: public CGAL::unary_function<Type,Type> {
: public CGAL::cpp98::unary_function<Type,Type> {
private:
static Type
normalization_factor(const Type&,Integral_domain_without_division_tag){
@ -68,7 +68,7 @@ public:
};
class Denominator_for_algebraic_integers
: public CGAL::unary_function<Type,Type> {
: public CGAL::cpp98::unary_function<Type,Type> {
public:
//! determine normalization factor
Type operator () (const Type&) {

View File

@ -112,7 +112,7 @@ class Algebraic_structure_traits_base< Type_, Null_tag > {
// does nothing by default
class Simplify
: public CGAL::unary_function< Type&, void > {
: public CGAL::cpp98::unary_function< Type&, void > {
public:
void operator()( Type& ) const {}
};
@ -151,7 +151,7 @@ class Algebraic_structure_traits_base< Type_,
// returns Type(1) by default
class Unit_part
: public CGAL::unary_function< Type, Type > {
: public CGAL::cpp98::unary_function< Type, Type > {
public:
Type operator()( const Type& x ) const {
return( x < Type(0)) ?
@ -160,7 +160,7 @@ class Algebraic_structure_traits_base< Type_,
};
class Square
: public CGAL::unary_function< Type, Type > {
: public CGAL::cpp98::unary_function< Type, Type > {
public:
Type operator()( const Type& x ) const {
return x*x;
@ -168,7 +168,7 @@ class Algebraic_structure_traits_base< Type_,
};
class Is_zero
: public CGAL::unary_function< Type, bool > {
: public CGAL::cpp98::unary_function< Type, bool > {
public:
bool operator()( const Type& x ) const {
return x == Type(0);
@ -176,7 +176,7 @@ class Algebraic_structure_traits_base< Type_,
};
class Is_one
: public CGAL::unary_function< Type, bool > {
: public CGAL::cpp98::unary_function< Type, bool > {
public:
bool operator()( const Type& x ) const {
return x == Type(1);
@ -221,7 +221,7 @@ class Algebraic_structure_traits_base< Type_,
// Default implementation of Divides functor for unique factorization domains
// x divides y if gcd(y,x) equals x up to inverses
class Divides
: public CGAL::binary_function<Type,Type,bool>{
: public CGAL::cpp98::binary_function<Type,Type,bool>{
public:
bool operator()( const Type& x, const Type& y) const {
typedef CGAL::Algebraic_structure_traits<Type> AST;
@ -257,7 +257,7 @@ class Algebraic_structure_traits_base< Type_,
// maps to \c Div by default.
class Integral_division
: public CGAL::binary_function< Type, Type,
: public CGAL::cpp98::binary_function< Type, Type,
Type > {
public:
Type operator()(
@ -279,7 +279,7 @@ class Algebraic_structure_traits_base< Type_,
// Algorithm from NiX/euclids_algorithm.h
class Gcd
: public CGAL::binary_function< Type, Type,
: public CGAL::cpp98::binary_function< Type, Type,
Type > {
public:
Type operator()(
@ -372,7 +372,7 @@ class Algebraic_structure_traits_base< Type_,
// based on \c Div_mod.
class Div
: public CGAL::binary_function< Type, Type,
: public CGAL::cpp98::binary_function< Type, Type,
Type > {
public:
Type operator()( const Type& x,
@ -390,7 +390,7 @@ class Algebraic_structure_traits_base< Type_,
// based on \c Div_mod.
class Mod
: public CGAL::binary_function< Type, Type,
: public CGAL::cpp98::binary_function< Type, Type,
Type > {
public:
Type operator()( const Type& x,
@ -408,7 +408,7 @@ class Algebraic_structure_traits_base< Type_,
// Divides for Euclidean Ring
class Divides
: public CGAL::binary_function<Type, Type, bool>{
: public CGAL::cpp98::binary_function<Type, Type, bool>{
public:
bool operator()( const Type& x, const Type& y) const {
typedef Algebraic_structure_traits<Type> AST;
@ -448,7 +448,7 @@ class Algebraic_structure_traits_base< Type_, Field_tag >
// returns the argument \a a by default
class Unit_part
: public CGAL::unary_function< Type, Type > {
: public CGAL::cpp98::unary_function< Type, Type > {
public:
Type operator()( const Type& x ) const {
return( x == Type(0)) ? Type(1) : x;
@ -456,7 +456,7 @@ class Algebraic_structure_traits_base< Type_, Field_tag >
};
// maps to \c operator/ by default.
class Integral_division
: public CGAL::binary_function< Type, Type,
: public CGAL::cpp98::binary_function< Type, Type,
Type > {
public:
Type operator()( const Type& x,
@ -475,7 +475,7 @@ class Algebraic_structure_traits_base< Type_, Field_tag >
// maps to \c 1/x by default.
class Inverse
: public CGAL::unary_function< Type, Type > {
: public CGAL::cpp98::unary_function< Type, Type > {
public:
Type operator()( const Type& x ) const {
return Type(1)/x;
@ -487,7 +487,7 @@ class Algebraic_structure_traits_base< Type_, Field_tag >
// returns always true
// \pre: x != 0
class Divides
: public CGAL::binary_function< Type, Type, bool > {
: public CGAL::cpp98::binary_function< Type, Type, bool > {
public:
bool operator()( const Type& CGAL_precondition_code(x), const Type& /* y */) const {
CGAL_precondition_code( typedef Algebraic_structure_traits<Type> AST);
@ -523,7 +523,7 @@ class Algebraic_structure_traits_base< Type_,
typedef Field_with_sqrt_tag Algebraic_category;
struct Is_square
:public CGAL::binary_function<Type,Type&,bool>
:public CGAL::cpp98::binary_function<Type,Type&,bool>
{
bool operator()(const Type& ) const {return true;}
bool operator()(
@ -580,7 +580,7 @@ class Algebraic_structure_traits_base< Type_,
namespace INTERN_AST {
template< class Type >
class Div_per_operator
: public CGAL::binary_function< Type, Type,
: public CGAL::cpp98::binary_function< Type, Type,
Type > {
public:
Type operator()( const Type& x,
@ -593,7 +593,7 @@ namespace INTERN_AST {
template< class Type >
class Mod_per_operator
: public CGAL::binary_function< Type, Type,
: public CGAL::cpp98::binary_function< Type, Type,
Type > {
public:
Type operator()( const Type& x,
@ -606,7 +606,7 @@ namespace INTERN_AST {
template< class Type >
class Is_square_per_sqrt
: public CGAL::binary_function< Type, Type&,
: public CGAL::cpp98::binary_function< Type, Type&,
bool > {
public:
bool operator()( const Type& x,

View File

@ -37,7 +37,7 @@ struct Is_zero_selector{ typedef AST_is_zero Type; };
template< class T >
struct Is_zero_selector< T, Null_functor >
{
struct Type : public CGAL::unary_function< T, bool >{
struct Type : public CGAL::cpp98::unary_function< T, bool >{
bool operator()( const T& x ) const {
return x == T(0);
}
@ -81,7 +81,7 @@ public:
Is_zero;
//! The generic \c Is_finite functor returns true
class Is_finite : public CGAL::unary_function< Type, Boolean > {
class Is_finite : public CGAL::cpp98::unary_function< Type, Boolean > {
public:
Boolean operator()( const Type& ) const {
return true;
@ -91,7 +91,7 @@ public:
//! The generic \c Abs functor implementation
//! uses one comparisons and the unary minus if necessary.
class Abs
: public CGAL::unary_function< Type, Type > {
: public CGAL::cpp98::unary_function< Type, Type > {
public:
//! the function call.
Type operator()( const Type& x ) const {
@ -101,7 +101,7 @@ public:
//! The generic \c Sgn functor implementation uses two comparisons.
class Sgn
: public CGAL::unary_function< Type, ::CGAL::Sign > {
: public CGAL::cpp98::unary_function< Type, ::CGAL::Sign > {
public:
//! the function call.
::CGAL::Sign operator()( const Type& x ) const {
@ -115,7 +115,7 @@ public:
//! The generic \c Is_positive functor implementation uses one comparison.
class Is_positive
: public CGAL::unary_function< Type, Boolean > {
: public CGAL::cpp98::unary_function< Type, Boolean > {
public:
//! the function call.
Boolean operator()( const Type& x ) const {
@ -125,7 +125,7 @@ public:
//! The generic \c Is_negative functor implementation uses one comparison.
class Is_negative
: public CGAL::unary_function< Type, Boolean > {
: public CGAL::cpp98::unary_function< Type, Boolean > {
public:
//! the function call.
Boolean operator()( const Type& x ) const {
@ -135,7 +135,7 @@ public:
//! The generic \c Compare functor implementation uses two comparisons.
class Compare
: public CGAL::binary_function< Type, Type,
: public CGAL::cpp98::binary_function< Type, Type,
Comparison_result > {
public:
//! the function call.
@ -152,7 +152,7 @@ public:
Comparison_result )
};
class To_double : public CGAL::unary_function< Type, double > {
class To_double : public CGAL::cpp98::unary_function< Type, double > {
public:
double operator()( const Type& x ) const {
return static_cast<double>(x);
@ -160,7 +160,7 @@ public:
};
class To_interval
: public CGAL::unary_function< Type, std::pair<double,double> > {
: public CGAL::cpp98::unary_function< Type, std::pair<double,double> > {
public:
std::pair<double,double> operator()( const Type& x ) const {
double dx(static_cast<double>(x));

View File

@ -102,7 +102,7 @@ struct Is_zero :
namespace internal {
template <class NT, class Compare> struct Compare_base: public Compare {};
template <class NT> struct Compare_base<NT,Null_functor>
:public CGAL::binary_function< NT, NT, Comparison_result > {
:public CGAL::cpp98::binary_function< NT, NT, Comparison_result > {
Comparison_result operator()( const NT& x, const NT& y) const
{
if (x < y) return SMALLER;

View File

@ -194,7 +194,7 @@ protected:
//! polynomial canonicalizer, needed for the cache
template <class Poly>
struct Poly_canonicalizer : public CGAL::unary_function< Poly, Poly >
struct Poly_canonicalizer : public CGAL::cpp98::unary_function< Poly, Poly >
{
// use Polynomial_traits_d<>::Canonicalize ?
Poly operator()(Poly p)
@ -356,7 +356,7 @@ public:
// Composition of two unary functors
template<typename InnerFunctor,typename OuterFunctor>
class Unary_compose
: public CGAL::unary_function<typename InnerFunctor::argument_type,
: public CGAL::cpp98::unary_function<typename InnerFunctor::argument_type,
typename OuterFunctor::result_type> {
public:
@ -419,7 +419,7 @@ public:
* when appropriate
*/
class Construct_curve_2 :
public CGAL::unary_function< Polynomial_2, Curve_analysis_2 > {
public CGAL::cpp98::unary_function< Polynomial_2, Curve_analysis_2 > {
public:
@ -443,7 +443,7 @@ public:
* caching is used when appropriate
*/
class Construct_curve_pair_2 :
public CGAL::binary_function<Curve_analysis_2, Curve_analysis_2,
public CGAL::cpp98::binary_function<Curve_analysis_2, Curve_analysis_2,
Curve_pair_analysis_2> {
public:
@ -636,7 +636,7 @@ public:
class Compute_polynomial_x_2 :
public CGAL::unary_function<Algebraic_real_2, Polynomial_1> {
public CGAL::cpp98::unary_function<Algebraic_real_2, Polynomial_1> {
public:
@ -656,7 +656,7 @@ public:
compute_polynomial_x_2_object);
class Compute_polynomial_y_2 :
public CGAL::unary_function<Algebraic_real_2, Polynomial_1> {
public CGAL::cpp98::unary_function<Algebraic_real_2, Polynomial_1> {
public:
@ -676,7 +676,7 @@ public:
compute_polynomial_y_2_object);
class Isolate_x_2 : public CGAL::binary_function<Algebraic_real_2,
class Isolate_x_2 : public CGAL::cpp98::binary_function<Algebraic_real_2,
Polynomial_1,
std::pair<Bound,Bound> > {
@ -699,7 +699,7 @@ public:
CGAL_Algebraic_Kernel_cons(Isolate_x_2,
isolate_x_2_object);
class Isolate_y_2 : public CGAL::binary_function<Algebraic_real_2,
class Isolate_y_2 : public CGAL::cpp98::binary_function<Algebraic_real_2,
Polynomial_1,
std::pair<Bound,Bound> > {
@ -887,7 +887,7 @@ public:
//! returns the x-coordinate of an \c Algebraic_real_2 object
class Compute_x_2 :
public CGAL::unary_function<Algebraic_real_2, Algebraic_real_1> {
public CGAL::cpp98::unary_function<Algebraic_real_2, Algebraic_real_1> {
public:
@ -922,7 +922,7 @@ public:
* return approximation of the y-coordinate.
*/
class Compute_y_2 :
public CGAL::unary_function<Algebraic_real_2, Algebraic_real_1> {
public CGAL::cpp98::unary_function<Algebraic_real_2, Algebraic_real_1> {
public:
@ -945,7 +945,7 @@ public:
#endif
class Approximate_absolute_x_2
: public CGAL::binary_function<Algebraic_real_2,int,std::pair<Bound,Bound> >{
: public CGAL::cpp98::binary_function<Algebraic_real_2,int,std::pair<Bound,Bound> >{
public:
@ -968,7 +968,7 @@ public:
approximate_absolute_x_2_object);
class Approximate_relative_x_2
: public CGAL::binary_function<Algebraic_real_2,int,std::pair<Bound,Bound> >{
: public CGAL::cpp98::binary_function<Algebraic_real_2,int,std::pair<Bound,Bound> >{
public:
@ -990,7 +990,7 @@ public:
approximate_relative_x_2_object);
class Approximate_absolute_y_2
: public CGAL::binary_function<Algebraic_real_2,int,std::pair<Bound,Bound> >{
: public CGAL::cpp98::binary_function<Algebraic_real_2,int,std::pair<Bound,Bound> >{
public:
@ -1020,7 +1020,7 @@ public:
approximate_absolute_y_2_object);
class Approximate_relative_y_2
: public CGAL::binary_function<Algebraic_real_2,int,std::pair<Bound,Bound> >{
: public CGAL::cpp98::binary_function<Algebraic_real_2,int,std::pair<Bound,Bound> >{
public:
@ -1171,7 +1171,7 @@ public:
//! \brief comparison of x-coordinates
class Compare_x_2 :
public CGAL::binary_function<Algebraic_real_2, Algebraic_real_2,
public CGAL::cpp98::binary_function<Algebraic_real_2, Algebraic_real_2,
Comparison_result > {
public:
@ -1264,7 +1264,7 @@ public:
* If possible, it is recommended to avoid this functor for efficiency.}
*/
class Compare_y_2 :
public CGAL::binary_function< Algebraic_real_2, Algebraic_real_2,
public CGAL::cpp98::binary_function< Algebraic_real_2, Algebraic_real_2,
Comparison_result > {
public:
@ -1376,7 +1376,7 @@ public:
* to have equal x-coordinates, thus only the y-coordinates are compared.
*/
class Compare_xy_2 :
public CGAL::binary_function<Algebraic_real_2, Algebraic_real_2,
public CGAL::cpp98::binary_function<Algebraic_real_2, Algebraic_real_2,
Comparison_result > {
public:
@ -1507,7 +1507,7 @@ public:
* the polynomial \c p is square free.
*/
class Has_finite_number_of_self_intersections_2 :
public CGAL::unary_function< Polynomial_2, bool > {
public CGAL::cpp98::unary_function< Polynomial_2, bool > {
public:
@ -1536,7 +1536,7 @@ public:
* the two polynomials \c f and \c g are coprime.
*/
class Has_finite_number_of_intersections_2 :
public CGAL::binary_function< Polynomial_2, Polynomial_2, bool > {
public CGAL::cpp98::binary_function< Polynomial_2, Polynomial_2, bool > {
public:
@ -1720,7 +1720,7 @@ public:
//! Non-Algebraic name
typedef Algebraic_real_2 Coordinate_2;
class Is_square_free_2 : public CGAL::unary_function<Polynomial_2,bool> {
class Is_square_free_2 : public CGAL::cpp98::unary_function<Polynomial_2,bool> {
public:
@ -1742,7 +1742,7 @@ public:
typedef Has_finite_number_of_intersections_2 Is_coprime_2;
CGAL_Algebraic_Kernel_cons(Is_coprime_2, is_coprime_2_object);
class Make_square_free_2 : public CGAL::unary_function<Polynomial_2,
class Make_square_free_2 : public CGAL::cpp98::unary_function<Polynomial_2,
Polynomial_2> {
public:
@ -1807,9 +1807,9 @@ public:
* In pariticular, each singular point is x-critical.
*/
class X_critical_points_2 :
public CGAL::binary_function< Curve_analysis_2,
CGAL::iterator<std::output_iterator_tag, Algebraic_real_2>,
CGAL::iterator<std::output_iterator_tag, Algebraic_real_2> > {
public CGAL::cpp98::binary_function< Curve_analysis_2,
CGAL::cpp98::iterator<std::output_iterator_tag, Algebraic_real_2>,
CGAL::cpp98::iterator<std::output_iterator_tag, Algebraic_real_2> > {
public:
@ -1886,9 +1886,9 @@ public:
* In pariticular, each singular point is y-critical.
*/
class Y_critical_points_2 :
public CGAL::binary_function< Curve_analysis_2,
CGAL::iterator<std::output_iterator_tag, Algebraic_real_2>,
CGAL::iterator<std::output_iterator_tag, Algebraic_real_2> > {
public CGAL::cpp98::binary_function< Curve_analysis_2,
CGAL::cpp98::iterator<std::output_iterator_tag, Algebraic_real_2>,
CGAL::cpp98::iterator<std::output_iterator_tag, Algebraic_real_2> > {
public:
@ -1981,7 +1981,7 @@ public:
// Overload the Sign_at_1 functor, to enable filter steps in the
// Curve analysis in a coherent way
class Sign_at_1
: public::CGAL::binary_function<Polynomial_1,Algebraic_real_1,Sign> {
: public::CGAL::cpp98::binary_function<Polynomial_1,Algebraic_real_1,Sign> {
public:
@ -2058,7 +2058,7 @@ public:
* curve. Returns a value convertible to \c CGAL::Sign
*/
class Sign_at_2 :
public CGAL::binary_function<Polynomial_2, Algebraic_real_2, Sign > {
public CGAL::cpp98::binary_function<Polynomial_2, Algebraic_real_2, Sign > {
public:
@ -2154,7 +2154,7 @@ public:
CGAL_Algebraic_Kernel_pred(Sign_at_2, sign_at_2_object);
class Is_zero_at_2
: public CGAL::binary_function<Polynomial_2,Algebraic_real_2,bool> {
: public CGAL::cpp98::binary_function<Polynomial_2,Algebraic_real_2,bool> {
public:
@ -2498,7 +2498,7 @@ public:
CGAL_Algebraic_Kernel_cons(Solve_2, solve_2_object);
class Number_of_solutions_2
: public CGAL::binary_function<Polynomial_2,Polynomial_2,size_type> {
: public CGAL::cpp98::binary_function<Polynomial_2,Polynomial_2,size_type> {
public:
@ -2524,7 +2524,7 @@ public:
// Functor used to evaluate a Polynomial_2 in a Bound, up to a
// constant factor
class Evaluate_utcf_2
: public CGAL::binary_function<Polynomial_2,Bound,Polynomial_1> {
: public CGAL::cpp98::binary_function<Polynomial_2,Bound,Polynomial_1> {
public:
@ -2600,7 +2600,7 @@ public:
//! Refines the x-coordinate of an Algebraic_real_2 object
class Refine_x_2 :
public CGAL::unary_function<Algebraic_real_2, void> {
public CGAL::cpp98::unary_function<Algebraic_real_2, void> {
public:
@ -2624,7 +2624,7 @@ public:
CGAL_Algebraic_Kernel_pred(Refine_x_2, refine_x_2_object);
class Refine_y_2 :
public CGAL::unary_function<Algebraic_real_2, void> {
public CGAL::cpp98::unary_function<Algebraic_real_2, void> {
public:

View File

@ -385,7 +385,7 @@ public:
typedef internal::Algebraic_real_d_1< Coefficient, Rational, HandlePolicy, RepClass > Type;
class Compare
: public CGAL::binary_function< Type, Type, CGAL::Comparison_result > {
: public CGAL::cpp98::binary_function< Type, Type, CGAL::Comparison_result > {
public:
CGAL::Comparison_result operator()( const Type& a, const Type& b ) const
{ return a.compare( b ); }
@ -414,7 +414,7 @@ public:
};
class Sgn
: public CGAL::unary_function< Type, CGAL::Sign > {
: public CGAL::cpp98::unary_function< Type, CGAL::Sign > {
public:
CGAL::Sign operator()( const Type& a ) const {
return a.compare( Rational(0) );
@ -422,7 +422,7 @@ public:
};
class To_double
: public CGAL::unary_function< Type, double > {
: public CGAL::cpp98::unary_function< Type, double > {
public:
double operator()(const Type& a) const {
return a.to_double();
@ -430,7 +430,7 @@ public:
};
class To_interval
: public CGAL::unary_function< Type, std::pair<double, double> > {
: public CGAL::cpp98::unary_function< Type, std::pair<double, double> > {
public:
typename std::pair<double, double> operator()(const Type& a) const {
return a.to_interval();

View File

@ -50,7 +50,7 @@ template <typename Coefficient_> struct Bitstream_coefficient_kernel {
return Is_zero();
}
struct Convert_to_bfi : public CGAL::unary_function
struct Convert_to_bfi : public CGAL::cpp98::unary_function
<Coefficient,Bigfloat_interval> {
Bigfloat_interval operator() (Coefficient c) const {

View File

@ -120,7 +120,7 @@ public:
//! \name Functors
//! @{
struct Is_zero : public CGAL::unary_function<Coefficient,bool> {
struct Is_zero : public CGAL::cpp98::unary_function<Coefficient,bool> {
Is_zero(Algebraic_kernel_d_1* kernel,Algebraic_real_1 alpha)
: _m_kernel(kernel),_m_alpha(alpha) {}
@ -140,7 +140,7 @@ public:
}
struct Convert_to_bfi
: public CGAL::unary_function<Coefficient,Bigfloat_interval> {
: public CGAL::cpp98::unary_function<Coefficient,Bigfloat_interval> {
Convert_to_bfi(Algebraic_kernel_d_1* kernel,
Algebraic_real_1 alpha)

View File

@ -108,7 +108,7 @@ template<typename Comparable>
};
template<typename Comparable> struct Compare_for_vert_line_map
: public CGAL::binary_function<Comparable,Comparable,bool> {
: public CGAL::cpp98::binary_function<Comparable,Comparable,bool> {
BOOST_MPL_HAS_XXX_TRAIT_DEF(T)
BOOST_MPL_HAS_XXX_TRAIT_DEF(Handle_policy)

View File

@ -66,7 +66,7 @@ template<>
class Float_traits< leda_bigfloat > {
public:
struct Get_mantissa
: public CGAL::unary_function< leda_bigfloat, leda_integer > {
: public CGAL::cpp98::unary_function< leda_bigfloat, leda_integer > {
leda_integer operator()( const leda_bigfloat& x ) const {
//std::cout << x.get_significant() << std::endl;
return x.get_significant();
@ -74,14 +74,14 @@ public:
};
struct Get_exponent
: public CGAL::unary_function< leda_bigfloat, long > {
: public CGAL::cpp98::unary_function< leda_bigfloat, long > {
long operator()( const leda_bigfloat& x ) const {
return x.get_exponent().to_long();
}
};
struct Mul_by_pow_of_2
: public CGAL::binary_function< leda_bigfloat, long, leda_bigfloat> {
: public CGAL::cpp98::binary_function< leda_bigfloat, long, leda_bigfloat> {
leda_bigfloat operator()( const leda_bigfloat& a, long e ) const {
return leda_bigfloat(a.get_significant(), a.get_exponent()+e);
}
@ -98,21 +98,21 @@ class Float_traits< CORE::BigFloat > {
public:
struct Get_mantissa
: public CGAL::unary_function< CORE::BigFloat, CORE::BigInt > {
: public CGAL::cpp98::unary_function< CORE::BigFloat, CORE::BigInt > {
CORE::BigInt operator()( const CORE::BigFloat& x ) const {
return x.m();
}
};
struct Get_exponent
: public CGAL::unary_function< CORE::BigFloat, long > {
: public CGAL::cpp98::unary_function< CORE::BigFloat, long > {
long operator()( const CORE::BigFloat& x ) const {
return CORE::CHUNK_BIT*x.exp(); // The basis is 2^CORE::CHUNK_BIT
}
};
struct Mul_by_pow_of_2
: public CGAL::binary_function
: public CGAL::cpp98::binary_function
< CORE::BigFloat, long , CORE::BigFloat> {
CORE::BigFloat operator()( const CORE::BigFloat& a, long e ) const {
return a*CORE::BigFloat::exp2(e);
@ -127,7 +127,7 @@ public:
template<> class Float_traits< Gmpfr > {
struct Get_mantissa_exponent
: public CGAL::unary_function< Gmpfr, std::pair<Gmpz,long> > {
: public CGAL::cpp98::unary_function< Gmpfr, std::pair<Gmpz,long> > {
std::pair<Gmpz,long> operator()( const Gmpfr& x ) const {
return x.to_integer_exp();
@ -135,21 +135,21 @@ template<> class Float_traits< Gmpfr > {
};
public:
struct Get_mantissa
: public CGAL::unary_function< Gmpfr, Gmpz > {
: public CGAL::cpp98::unary_function< Gmpfr, Gmpz > {
Gmpz operator()( const Gmpfr& x ) const {
return Get_mantissa_exponent()(x).first;
}
};
struct Get_exponent
: public CGAL::unary_function< Gmpfr, long > {
: public CGAL::cpp98::unary_function< Gmpfr, long > {
long operator()( const Gmpfr& x ) const {
return Get_mantissa_exponent()(x).second;
}
};
struct Mul_by_pow_of_2
: public CGAL::binary_function< Gmpfr, Gmpz, Gmpfr> {
: public CGAL::cpp98::binary_function< Gmpfr, Gmpz, Gmpfr> {
Gmpfr operator()( const Gmpfr& a, long e ) const {
Gmpfr result(0,a.get_precision()); // just to get the prec of a
if (e >= 0 ){

View File

@ -39,7 +39,7 @@ namespace CGAL {
namespace internal {
template<typename Polynomial_1, typename Bound>
struct Interval_evaluate_1 : public CGAL::binary_function
struct Interval_evaluate_1 : public CGAL::cpp98::binary_function
<Polynomial_1,std::pair<Bound,Bound>,
std::pair<typename CGAL::Coercion_traits<typename
CGAL::Polynomial_traits_d<Polynomial_1>::Coefficient_type,Bound>::Type,

View File

@ -40,7 +40,7 @@ namespace CGAL {
namespace internal {
template<typename Polynomial_2, typename Bound>
struct Interval_evaluate_2 : public CGAL::binary_function
struct Interval_evaluate_2 : public CGAL::cpp98::binary_function
<Polynomial_2,CGAL::cpp11::array<Bound,4>,
std::pair<typename CGAL::Coercion_traits<typename CGAL::Polynomial_traits_d<Polynomial_2>::Innermost_coefficient_type,Bound>::Type,
typename CGAL::Coercion_traits<typename CGAL::Polynomial_traits_d<Polynomial_2>::Innermost_coefficient_type,Bound>::Type> > {

View File

@ -103,7 +103,7 @@ template<>
class Real_embeddable_extension< long > {
public:
struct Ceil_log2_abs
: public CGAL::unary_function< long, long > {
: public CGAL::cpp98::unary_function< long, long > {
long operator()( long x ) {
if (x < 0) x = -x;
CGAL_precondition(x > 0);
@ -113,7 +113,7 @@ public:
};
struct Floor_log2_abs
: public CGAL::unary_function< long, long > {
: public CGAL::cpp98::unary_function< long, long > {
private:
signed char floor_log2_4bit[16];
public:
@ -149,11 +149,11 @@ public:
};
struct Floor
: public CGAL::unary_function< long, long > {
: public CGAL::cpp98::unary_function< long, long > {
long operator() (long x) { return x;}
};
struct Ceil
: public CGAL::unary_function< long, long > {
: public CGAL::cpp98::unary_function< long, long > {
long operator() (long x) { return x;}
};
};
@ -168,7 +168,7 @@ public:
typedef leda_integer Type;
struct Ceil_log2_abs
: public CGAL::unary_function< leda_integer, long > {
: public CGAL::cpp98::unary_function< leda_integer, long > {
long operator()( const leda_integer& x ) const {
CGAL_precondition(x != leda_integer(0));
::leda::digit_sz ldgzeros = ::leda::digLeadingZeros(x.highword());
@ -188,7 +188,7 @@ public:
};
struct Floor_log2_abs
: public CGAL::unary_function< leda_integer, long > {
: public CGAL::cpp98::unary_function< leda_integer, long > {
long operator()( const leda_integer& x ) const {
CGAL_precondition(x != leda_integer(0));
::leda::digit_sz ldgzeros
@ -200,11 +200,11 @@ public:
};
struct Floor
: public CGAL::unary_function< leda_integer, leda_integer > {
: public CGAL::cpp98::unary_function< leda_integer, leda_integer > {
leda_integer operator() (const leda_integer& x) const { return x;}
};
struct Ceil
: public CGAL::unary_function< leda_integer, leda_integer > {
: public CGAL::cpp98::unary_function< leda_integer, leda_integer > {
leda_integer operator() (const leda_integer& x) const { return x;}
};
};
@ -216,7 +216,7 @@ public:
typedef leda_bigfloat Type;
struct Floor_log2_abs
: public CGAL::unary_function< leda_bigfloat, long > {
: public CGAL::cpp98::unary_function< leda_bigfloat, long > {
long operator()( const leda_bigfloat& x ) const {
CGAL_precondition(CGAL::sign(x) != CGAL::ZERO);
::leda::integer abs_sign = abs(x.get_significant());
@ -226,7 +226,7 @@ public:
};
struct Ceil_log2_abs
: public CGAL::unary_function< leda_bigfloat, long > {
: public CGAL::cpp98::unary_function< leda_bigfloat, long > {
long operator()( const leda_bigfloat& x ) const {
CGAL_precondition(CGAL::sign(x) != CGAL::ZERO);
return ::leda::ilog2(x).to_long();
@ -234,14 +234,14 @@ public:
};
struct Floor
: public CGAL::unary_function< leda_bigfloat, leda_integer > {
: public CGAL::cpp98::unary_function< leda_bigfloat, leda_integer > {
leda_integer operator() ( const leda_bigfloat& x ) const {
return leda::to_integer( x, leda::TO_N_INF );
}
};
struct Ceil
: public CGAL::unary_function< leda_bigfloat, leda_integer > {
: public CGAL::cpp98::unary_function< leda_bigfloat, leda_integer > {
leda_integer operator() ( const leda_bigfloat& x ) const {
return leda::to_integer( x, leda::TO_P_INF );
}
@ -255,7 +255,7 @@ public:
typedef leda_bigfloat_interval Type;
struct Floor_log2_abs
: public CGAL::unary_function< leda_bigfloat_interval, long > {
: public CGAL::cpp98::unary_function< leda_bigfloat_interval, long > {
result_type operator() (const argument_type& x) const {
CGAL_precondition(! ::boost::numeric::in_zero(x));
@ -264,7 +264,7 @@ public:
};
struct Ceil_log2_abs
: public CGAL::unary_function< leda_bigfloat_interval, long > {
: public CGAL::cpp98::unary_function< leda_bigfloat_interval, long > {
long operator()( const leda_bigfloat_interval& x ) const {
CGAL_precondition(!(::boost::numeric::in_zero(x) &&
::boost::numeric::singleton(x)));
@ -273,7 +273,7 @@ public:
};
struct Floor
: public CGAL::unary_function< leda_bigfloat_interval, leda_integer > {
: public CGAL::cpp98::unary_function< leda_bigfloat_interval, leda_integer > {
leda_integer operator() ( const leda_bigfloat_interval& x )
const {
return internal::floor( x.lower() );
@ -281,7 +281,7 @@ public:
};
struct Ceil
: public CGAL::unary_function< leda_bigfloat_interval, leda_integer > {
: public CGAL::cpp98::unary_function< leda_bigfloat_interval, leda_integer > {
leda_integer operator() ( const leda_bigfloat_interval& x )
const {
return internal::ceil( x.upper() );
@ -299,27 +299,27 @@ class Real_embeddable_extension< CORE::BigInt > {
public:
typedef CORE::BigInt Type;
struct Floor_log2_abs
: public CGAL::unary_function< CORE::BigInt, long > {
: public CGAL::cpp98::unary_function< CORE::BigInt, long > {
long operator()( const CORE::BigInt& x ) const {
return CORE::floorLg(x);
}
};
struct Ceil_log2_abs
: public CGAL::unary_function< CORE::BigInt, long > {
: public CGAL::cpp98::unary_function< CORE::BigInt, long > {
long operator()( const CORE::BigInt& x ) const {
return CORE::ceilLg(x);
}
};
struct Floor
: public CGAL::unary_function< CORE::BigInt, CORE::BigInt > {
: public CGAL::cpp98::unary_function< CORE::BigInt, CORE::BigInt > {
CORE::BigInt operator() (const CORE::BigInt& x) const {
return x;
}
};
struct Ceil
: public CGAL::unary_function< CORE::BigInt, CORE::BigInt > {
: public CGAL::cpp98::unary_function< CORE::BigInt, CORE::BigInt > {
CORE::BigInt operator() (const CORE::BigInt& x) const {
return x;
}
@ -332,7 +332,7 @@ class Real_embeddable_extension< CORE::BigFloat > {
public:
typedef CORE::BigFloat Type;
struct Floor_log2_abs
: public CGAL::unary_function< CORE::BigFloat, long > {
: public CGAL::cpp98::unary_function< CORE::BigFloat, long > {
long operator()( CORE::BigFloat x ) const {
CGAL_precondition(!CGAL::zero_in(x));
x = CGAL::abs(x);
@ -341,7 +341,7 @@ public:
};
struct Ceil_log2_abs
: public CGAL::unary_function< CORE::BigFloat, long > {
: public CGAL::cpp98::unary_function< CORE::BigFloat, long > {
long operator()( CORE::BigFloat x ) const {
// (already commented out in EXACUS)...
// NiX_precond(!(NiX::in_zero(x) && NiX::singleton(x)));
@ -351,7 +351,7 @@ public:
};
struct Floor
: public CGAL::unary_function< CORE::BigFloat, CORE::BigInt > {
: public CGAL::cpp98::unary_function< CORE::BigFloat, CORE::BigInt > {
CORE::BigInt operator() ( const CORE::BigFloat& x ) const {
CORE::BigInt xi = x.BigIntValue();
if(x.sign() < 0 && x.cmp(xi)!=0) {
@ -362,7 +362,7 @@ public:
};
struct Ceil
: public CGAL::unary_function< CORE::BigFloat, CORE::BigInt > {
: public CGAL::cpp98::unary_function< CORE::BigFloat, CORE::BigInt > {
CORE::BigInt operator() ( const CORE::BigFloat& x ) const {
CORE::BigInt xi = x.BigIntValue();
if(x.sign() >0 && x.cmp(xi)!=0) {
@ -385,7 +385,7 @@ public:
typedef Gmpz Type;
struct Floor_log2_abs
: public CGAL::unary_function< Gmpz, long > {
: public CGAL::cpp98::unary_function< Gmpz, long > {
long operator()( const Gmpz& x ) const {
CGAL_precondition(!CGAL::is_zero(x));
return static_cast<long>(mpz_sizeinbase(x.mpz(),2)-1);
@ -393,7 +393,7 @@ public:
};
struct Ceil_log2_abs
: public CGAL::unary_function< Gmpz, long > {
: public CGAL::cpp98::unary_function< Gmpz, long > {
long operator()( const Gmpz& x ) const {
long pos = mpz_scan1(x.mpz(),0);
long size = static_cast<long>(mpz_sizeinbase(x.mpz(),2));
@ -405,13 +405,13 @@ public:
};
struct Floor
: public CGAL::unary_function< Gmpz, Gmpz > {
: public CGAL::cpp98::unary_function< Gmpz, Gmpz > {
Gmpz operator() (const Gmpz& x) const {
return x;
}
};
struct Ceil
: public CGAL::unary_function< Gmpz, Gmpz > {
: public CGAL::cpp98::unary_function< Gmpz, Gmpz > {
Gmpz operator() (const Gmpz& x) const {
return x;
}
@ -427,7 +427,7 @@ public:
typedef Gmpfr Type;
struct Floor_log2_abs
: public CGAL::unary_function< Gmpfr, long > {
: public CGAL::cpp98::unary_function< Gmpfr, long > {
long operator()( const Gmpfr& x ) const {
Float_traits<Gmpfr>::Get_mantissa get_mantissa;
Float_traits<Gmpfr>::Get_exponent get_exponent;
@ -438,7 +438,7 @@ public:
};
struct Ceil_log2_abs
: public CGAL::unary_function< Gmpfr, long > {
: public CGAL::cpp98::unary_function< Gmpfr, long > {
long operator()( const Gmpfr& x ) const {
Float_traits<Gmpfr>::Get_mantissa get_mantissa;
Float_traits<Gmpfr>::Get_exponent get_exponent;
@ -449,7 +449,7 @@ public:
};
struct Floor
: public CGAL::unary_function< Gmpfr, Gmpz > {
: public CGAL::cpp98::unary_function< Gmpfr, Gmpz > {
Gmpz operator() ( const Gmpfr& x ) const {
Gmpz result;
mpfr_get_z (result.mpz(),x.fr(),GMP_RNDD);
@ -458,7 +458,7 @@ public:
};
struct Ceil
: public CGAL::unary_function< Gmpfr, Gmpz > {
: public CGAL::cpp98::unary_function< Gmpfr, Gmpz > {
Gmpz operator() ( const Gmpfr& x ) const {
Gmpz result;
mpfr_get_z (result.mpz(),x.fr(),GMP_RNDU);
@ -476,7 +476,7 @@ public:
typedef Gmpfi Type;
struct Floor_log2_abs
: public CGAL::unary_function< Gmpfi, long > {
: public CGAL::cpp98::unary_function< Gmpfi, long > {
result_type operator() (const argument_type& x) const {
CGAL_precondition(!x.is_zero());
return internal::floor_log2_abs(x.abs().inf());
@ -484,7 +484,7 @@ public:
};
struct Ceil_log2_abs
: public CGAL::unary_function< Gmpfi, long > {
: public CGAL::cpp98::unary_function< Gmpfi, long > {
long operator()( const Gmpfi& x ) const {
CGAL_precondition(!x.inf().is_zero() || !x.sup().is_zero());
return internal::ceil_log2_abs(x.abs().sup());
@ -492,7 +492,7 @@ public:
};
struct Floor
: public CGAL::unary_function< Gmpfi, Gmpz > {
: public CGAL::cpp98::unary_function< Gmpfi, Gmpz > {
Gmpz operator() ( const Gmpfi& x )
const {
return internal::floor( x.inf() );
@ -500,7 +500,7 @@ public:
};
struct Ceil
: public CGAL::unary_function< Gmpfi, Gmpz > {
: public CGAL::cpp98::unary_function< Gmpfi, Gmpz > {
Gmpz operator() ( const Gmpfi& x )
const {
return internal::ceil( x.sup() );

View File

@ -71,12 +71,12 @@ protected:
// Some functors used for STL calls
template<typename A,typename B>
struct Pair_first : public CGAL::unary_function<std::pair<A,B>,A> {
struct Pair_first : public CGAL::cpp98::unary_function<std::pair<A,B>,A> {
A operator() (std::pair<A,B> pair) const { return pair.first; }
};
template<typename A,typename B>
struct Pair_second : public CGAL::unary_function<std::pair<A,B>,B> {
struct Pair_second : public CGAL::cpp98::unary_function<std::pair<A,B>,B> {
B operator() (std::pair<A,B> pair) const { return pair.second; }
};
@ -86,7 +86,7 @@ public:
typedef Algebraic_real_1 Type;
struct Bound_between
: public CGAL::binary_function< Type, Type, Bound > {
: public CGAL::cpp98::binary_function< Type, Type, Bound > {
Bound operator()( const Type& t1,
const Type& t2 ) const {
#if CGAL_AK_DONT_USE_SIMPLE_BOUND_BETWEEN
@ -99,21 +99,21 @@ public:
};
struct Lower_bound
: public CGAL::unary_function< Type, Bound > {
: public CGAL::cpp98::unary_function< Type, Bound > {
Bound operator()( const Type& t ) const {
return t.low();
}
};
struct Upper_bound
: public CGAL::unary_function< Type, Bound > {
: public CGAL::cpp98::unary_function< Type, Bound > {
Bound operator()( const Type& t ) const {
return t.high();
}
};
struct Refine
: public CGAL::unary_function< Type, void > {
: public CGAL::cpp98::unary_function< Type, void > {
void operator()( const Type& t ) const {
t.refine();
}
@ -151,7 +151,7 @@ public:
};
struct Approximate_absolute_1:
public CGAL::binary_function<Algebraic_real_1,int,std::pair<Bound,Bound> >{
public CGAL::cpp98::binary_function<Algebraic_real_1,int,std::pair<Bound,Bound> >{
std::pair<Bound,Bound>
operator()(const Algebraic_real_1& x, int prec) const {
Lower_bound lower;
@ -170,7 +170,7 @@ public:
};
struct Approximate_relative_1:
public CGAL::binary_function<Algebraic_real_1,int,std::pair<Bound,Bound> >{
public CGAL::cpp98::binary_function<Algebraic_real_1,int,std::pair<Bound,Bound> >{
std::pair<Bound,Bound>
operator()(const Algebraic_real_1& x, int prec) const {
@ -201,7 +201,9 @@ public:
}; // class Algebraic_real_traits
struct Construct_algebraic_real_1;
// Functors of Algebraic_kernel_d_1
struct Solve_1 {
public:
@ -278,7 +280,7 @@ public:
/*
// TODO: Can we avoid to use this?
struct Greater_compare :
public CGAL::binary_function<Algebraic_real_1,Algebraic_real_1,bool> {
public CGAL::cpp98::binary_function<Algebraic_real_1,Algebraic_real_1,bool> {
bool operator() (const Algebraic_real_1& a, const Algebraic_real_1& b)
const {
@ -336,7 +338,7 @@ public:
};
class Number_of_solutions_1
: public CGAL::unary_function<Polynomial_1,size_type> {
: public CGAL::cpp98::unary_function<Polynomial_1,size_type> {
public:
@ -352,7 +354,7 @@ public:
struct Sign_at_1
: public CGAL::binary_function< Polynomial_1, Algebraic_real_1, CGAL::Sign > {
: public CGAL::cpp98::binary_function< Polynomial_1, Algebraic_real_1, CGAL::Sign > {
CGAL::Sign operator()( const Polynomial_1& p, const Algebraic_real_1& ar ) const {
if(CGAL::is_zero(p)) return ZERO;
if(CGAL::degree(p)==0) return p.sign_at(0);
@ -375,7 +377,7 @@ public:
}
};
struct Is_zero_at_1
: public CGAL::binary_function< Polynomial_1, Algebraic_real_1, bool > {
: public CGAL::cpp98::binary_function< Polynomial_1, Algebraic_real_1, bool > {
bool operator()( const Polynomial_1& p, const Algebraic_real_1& ar ) const {
if(CGAL::is_zero(p)) return true;
if( ar.low() == ar.high() ) return p.sign_at( ar.low() ) == ZERO;
@ -385,7 +387,7 @@ public:
};
struct Is_square_free_1
: public CGAL::unary_function< Polynomial_1, bool > {
: public CGAL::cpp98::unary_function< Polynomial_1, bool > {
bool operator()( const Polynomial_1& p ) const {
typename CGAL::Polynomial_traits_d< Polynomial_1 >::Is_square_free isf;
return isf(p);
@ -393,7 +395,7 @@ public:
};
struct Is_coprime_1
: public CGAL::binary_function< Polynomial_1, Polynomial_1, bool > {
: public CGAL::cpp98::binary_function< Polynomial_1, Polynomial_1, bool > {
bool operator()( const Polynomial_1& p1, const Polynomial_1& p2 ) const {
typename CGAL::Polynomial_traits_d< Polynomial_1 >::Total_degree total_degree;
@ -403,7 +405,7 @@ public:
};
struct Make_square_free_1
: public CGAL::unary_function< Polynomial_1, Polynomial_1 > {
: public CGAL::cpp98::unary_function< Polynomial_1, Polynomial_1 > {
Polynomial_1 operator()( const Polynomial_1& p ) const {
return typename CGAL::Polynomial_traits_d< Polynomial_1 >::Make_square_free()( p );
}
@ -438,7 +440,7 @@ public:
}
};
struct Compute_polynomial_1 : public CGAL::unary_function<Algebraic_real_1,
struct Compute_polynomial_1 : public CGAL::cpp98::unary_function<Algebraic_real_1,
Polynomial_1> {
Polynomial_1 operator()(const Algebraic_real_1& x) const {
return x.polynomial();
@ -488,7 +490,7 @@ public:
};
struct Compare_1
: public CGAL::binary_function<Algebraic_real_1,
: public CGAL::cpp98::binary_function<Algebraic_real_1,
Algebraic_real_1,
CGAL::Comparison_result>{
@ -533,7 +535,7 @@ public:
public:
struct Isolate_1 : public CGAL::binary_function
struct Isolate_1 : public CGAL::cpp98::binary_function
< Algebraic_real_1,Polynomial_1,std::pair<Bound,Bound> > {
public:

View File

@ -259,39 +259,39 @@ public INTERN_RET::Real_embeddable_traits_base<
Base;
typedef typename Base::Compare Compare;
class Sgn:public CGAL::unary_function<Type,CGAL::Sign>{
class Sgn:public CGAL::cpp98::unary_function<Type,CGAL::Sign>{
public:
CGAL::Sign operator()(const Type &a)const{
return Compare()(a,Type(0));
}
};
class To_double:public CGAL::unary_function<Type,double>{
class To_double:public CGAL::cpp98::unary_function<Type,double>{
public:
double operator()(const Type &a)const{return a.to_double();}
};
class To_interval:
public CGAL::unary_function<Type,std::pair<double,double> >{
public CGAL::cpp98::unary_function<Type,std::pair<double,double> >{
public:
std::pair<double,double> operator()(const Type &a)const{
return a.to_interval();
}
};
class Is_zero:public CGAL::unary_function<Type,Boolean>{
class Is_zero:public CGAL::cpp98::unary_function<Type,Boolean>{
public:
bool operator()(const Type &a)const{
return Sgn()(a)==CGAL::ZERO;
}
};
class Is_finite:public CGAL::unary_function<Type,Boolean>{
class Is_finite:public CGAL::cpp98::unary_function<Type,Boolean>{
public:
bool operator()(const Type&)const{return true;}
};
class Abs:public CGAL::unary_function<Type,Type>{
class Abs:public CGAL::cpp98::unary_function<Type,Type>{
public:
Type operator()(const Type &a)const{
return Sgn()(a)==CGAL::NEGATIVE?-a:a;

View File

@ -250,39 +250,39 @@ public INTERN_RET::Real_embeddable_traits_base<
Base;
typedef typename Base::Compare Compare;
class Sgn:public CGAL::unary_function<Type,CGAL::Sign>{
class Sgn:public CGAL::cpp98::unary_function<Type,CGAL::Sign>{
public:
CGAL::Sign operator()(const Type &a)const{
return Compare()(a,Type(0));
}
};
class To_double:public CGAL::unary_function<Type,double>{
class To_double:public CGAL::cpp98::unary_function<Type,double>{
public:
double operator()(const Type &a)const{return a.to_double();}
};
class To_interval:
public CGAL::unary_function<Type,std::pair<double,double> >{
public CGAL::cpp98::unary_function<Type,std::pair<double,double> >{
public:
std::pair<double,double> operator()(const Type &a)const{
return a.to_interval();
}
};
class Is_zero:public CGAL::unary_function<Type,Boolean>{
class Is_zero:public CGAL::cpp98::unary_function<Type,Boolean>{
public:
bool operator()(const Type &a)const{
return Sgn()(a)==CGAL::ZERO;
}
};
class Is_finite:public CGAL::unary_function<Type,Boolean>{
class Is_finite:public CGAL::cpp98::unary_function<Type,Boolean>{
public:
bool operator()(const Type&)const{return true;}
};
class Abs:public CGAL::unary_function<Type,Type>{
class Abs:public CGAL::cpp98::unary_function<Type,Type>{
public:
Type operator()(const Type &a)const{
return Sgn()(a)==CGAL::NEGATIVE?-a:a;

View File

@ -61,7 +61,7 @@ struct Construct_algebraic_real_1{
template <class Polynomial_,class Algebraic_>
struct Compute_polynomial_1:
public CGAL::unary_function<Algebraic_,Polynomial_>{
public CGAL::cpp98::unary_function<Algebraic_,Polynomial_>{
typedef Polynomial_ Polynomial;
typedef Algebraic_ Algebraic;
Polynomial operator()(const Algebraic &x)const{
@ -71,7 +71,7 @@ public CGAL::unary_function<Algebraic_,Polynomial_>{
template <class Polynomial_,class Ptraits_>
struct Is_coprime_1:
public CGAL::binary_function<Polynomial_,Polynomial_,bool>{
public CGAL::cpp98::binary_function<Polynomial_,Polynomial_,bool>{
typedef Polynomial_ Polynomial;
typedef Ptraits_ Ptraits;
typedef typename Ptraits::Gcd_up_to_constant_factor Gcd;
@ -257,7 +257,7 @@ template <class Polynomial_,
class Signat_,
class Ptraits_>
class Sign_at_1:
public CGAL::binary_function<Polynomial_,Algebraic_,CGAL::Sign>{
public CGAL::cpp98::binary_function<Polynomial_,Algebraic_,CGAL::Sign>{
// This implementation will work with any polynomial type whose
// coefficient type is explicit interoperable with Gmpfi.
// TODO: Make this function generic.
@ -363,7 +363,7 @@ template <class Polynomial_,
class Signat_,
class Ptraits_>
class Is_zero_at_1:
public CGAL::binary_function<Polynomial_,Algebraic_,bool>{
public CGAL::cpp98::binary_function<Polynomial_,Algebraic_,bool>{
// This implementation will work with any polynomial type whose
// coefficient type is explicit interoperable with Gmpfi.
// TODO: Make this function generic.
@ -443,7 +443,7 @@ public CGAL::binary_function<Polynomial_,Algebraic_,bool>{
// programs assume that this is equal to int
template <class Polynomial_,class Isolator_>
struct Number_of_solutions_1:
public CGAL::unary_function<Polynomial_,int>{
public CGAL::cpp98::unary_function<Polynomial_,int>{
typedef Polynomial_ Polynomial_1;
typedef Isolator_ Isolator;
size_t operator()(const Polynomial_1 &p)const{
@ -459,7 +459,7 @@ template <class Algebraic_,
class Bound_,
class Comparator_>
struct Compare_1:
public CGAL::binary_function<Algebraic_,Algebraic_,CGAL::Comparison_result>{
public CGAL::cpp98::binary_function<Algebraic_,Algebraic_,CGAL::Comparison_result>{
typedef Algebraic_ Algebraic;
typedef Bound_ Bound;
typedef Comparator_ Comparator;
@ -511,7 +511,7 @@ template <class Algebraic_,
class Bound_,
class Comparator_>
struct Bound_between_1:
public CGAL::binary_function<Algebraic_,Algebraic_,Bound_>{
public CGAL::cpp98::binary_function<Algebraic_,Algebraic_,Bound_>{
typedef Algebraic_ Algebraic;
typedef Bound_ Bound;
typedef Comparator_ Comparator;
@ -551,7 +551,7 @@ template <class Polynomial_,
class Signat_,
class Ptraits_>
struct Isolate_1:
public CGAL::binary_function<Algebraic_,Polynomial_,std::pair<Bound_,Bound_> >{
public CGAL::cpp98::binary_function<Algebraic_,Polynomial_,std::pair<Bound_,Bound_> >{
typedef Polynomial_ Polynomial_1;
typedef Bound_ Bound;
typedef Algebraic_ Algebraic;
@ -589,7 +589,7 @@ template <class Polynomial_,
class Algebraic_,
class Refiner_>
struct Approximate_absolute_1:
public CGAL::binary_function<Algebraic_,int,std::pair<Bound_,Bound_> >{
public CGAL::cpp98::binary_function<Algebraic_,int,std::pair<Bound_,Bound_> >{
typedef Polynomial_ Polynomial_1;
typedef Bound_ Bound;
typedef Algebraic_ Algebraic;
@ -621,7 +621,7 @@ template <class Polynomial_,
class Algebraic_,
class Refiner_>
struct Approximate_relative_1:
public CGAL::binary_function<Algebraic_,int,std::pair<Bound_,Bound_> >{
public CGAL::cpp98::binary_function<Algebraic_,int,std::pair<Bound_,Bound_> >{
typedef Polynomial_ Polynomial_1;
typedef Bound_ Bound;
typedef Algebraic_ Algebraic;

View File

@ -69,7 +69,7 @@ struct Construct_algebraic_real_z_1{
template <class Polynomial_,class Algebraic_>
struct Compute_polynomial_z_1:
public CGAL::unary_function<Algebraic_,Polynomial_>{
public CGAL::cpp98::unary_function<Algebraic_,Polynomial_>{
typedef Polynomial_ Polynomial;
typedef Algebraic_ Algebraic;
Polynomial operator()(const Algebraic &x)const{
@ -79,7 +79,7 @@ public CGAL::unary_function<Algebraic_,Polynomial_>{
template <class Polynomial_,class Ptraits_>
struct Is_coprime_z_1:
public CGAL::binary_function<Polynomial_,Polynomial_,bool>{
public CGAL::cpp98::binary_function<Polynomial_,Polynomial_,bool>{
typedef Polynomial_ Polynomial;
typedef Ptraits_ Ptraits;
typedef typename Ptraits::Gcd_up_to_constant_factor Gcd;
@ -285,7 +285,7 @@ template <class Polynomial_,
class Ptraits_,
class ZPtraits_>
class Sign_at_z_1:
public CGAL::binary_function<Polynomial_,Algebraic_,CGAL::Sign>{
public CGAL::cpp98::binary_function<Polynomial_,Algebraic_,CGAL::Sign>{
// This implementation will work with any polynomial type whose
// coefficient type is explicit interoperable with Gmpfi.
// TODO: Make this function generic.
@ -397,7 +397,7 @@ template <class Polynomial_,
class Ptraits_,
class ZPtraits_>
class Is_zero_at_z_1:
public CGAL::binary_function<Polynomial_,Algebraic_,bool>{
public CGAL::cpp98::binary_function<Polynomial_,Algebraic_,bool>{
// This implementation will work with any polynomial type whose
// coefficient type is explicit interoperable with Gmpfi.
// TODO: Make this function generic.
@ -483,7 +483,7 @@ template <class Polynomial_,
class PolConverter_,
class Isolator_>
struct Number_of_solutions_z_1:
public CGAL::unary_function<Polynomial_,int>{
public CGAL::cpp98::unary_function<Polynomial_,int>{
typedef Polynomial_ Polynomial_1;
typedef ZPolynomial_ ZPolynomial_1;
typedef PolConverter_ PolConverter;
@ -501,7 +501,7 @@ template <class Algebraic_,
class Bound_,
class Comparator_>
struct Compare_z_1:
public CGAL::binary_function<Algebraic_,Algebraic_,CGAL::Comparison_result>{
public CGAL::cpp98::binary_function<Algebraic_,Algebraic_,CGAL::Comparison_result>{
typedef Algebraic_ Algebraic;
typedef Bound_ Bound;
typedef Comparator_ Comparator;
@ -553,7 +553,7 @@ template <class Algebraic_,
class Bound_,
class Comparator_>
struct Bound_between_z_1:
public CGAL::binary_function<Algebraic_,Algebraic_,Bound_>{
public CGAL::cpp98::binary_function<Algebraic_,Algebraic_,Bound_>{
typedef Algebraic_ Algebraic;
typedef Bound_ Bound;
typedef Comparator_ Comparator;
@ -596,7 +596,7 @@ template <class Polynomial_,
class Ptraits_,
class ZPtraits_>
struct Isolate_z_1:
public CGAL::binary_function<Algebraic_,Polynomial_,std::pair<Bound_,Bound_> >{
public CGAL::cpp98::binary_function<Algebraic_,Polynomial_,std::pair<Bound_,Bound_> >{
typedef Polynomial_ Polynomial_1;
typedef ZPolynomial_ ZPolynomial_1;
typedef PolConverter_ PolConverter;
@ -640,7 +640,7 @@ template <class Polynomial_,
class Algebraic_,
class Refiner_>
struct Approximate_absolute_z_1:
public CGAL::binary_function<Algebraic_,int,std::pair<Bound_,Bound_> >{
public CGAL::cpp98::binary_function<Algebraic_,int,std::pair<Bound_,Bound_> >{
typedef Polynomial_ Polynomial_1;
typedef Bound_ Bound;
typedef Algebraic_ Algebraic;
@ -672,7 +672,7 @@ template <class Polynomial_,
class Algebraic_,
class Refiner_>
struct Approximate_relative_z_1:
public CGAL::binary_function<Algebraic_,int,std::pair<Bound_,Bound_> >{
public CGAL::cpp98::binary_function<Algebraic_,int,std::pair<Bound_,Bound_> >{
typedef Polynomial_ Polynomial_1;
typedef Bound_ Bound;
typedef Algebraic_ Algebraic;

View File

@ -27,7 +27,7 @@ namespace RS_AK1{
template <class InputPolynomial_,class OutputPolynomial_>
struct Polynomial_converter_1:
public CGAL::unary_function<InputPolynomial_,OutputPolynomial_>{
public CGAL::cpp98::unary_function<InputPolynomial_,OutputPolynomial_>{
typedef InputPolynomial_ InpPolynomial_1;
typedef OutputPolynomial_ OutPolynomial_1;
OutPolynomial_1 operator()(const InpPolynomial_1&)const;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -35,7 +35,7 @@ template < class Td_traits> class Trapezoidal_decomposition_2;
////MICHAL: not in use
//template <class map_item>
//struct Td_active_map_item : public CGAL::unary_function<map_item,bool>
//struct Td_active_map_item : public CGAL::cpp98::unary_function<map_item,bool>
//{
// bool operator()(const map_item& item) const
// {
@ -46,7 +46,7 @@ template < class Td_traits> class Trapezoidal_decomposition_2;
////MICHAL: not in use
//template <class X_trapezoid,class Traits>
//struct Td_active_non_degenerate_trapezoid :
//public CGAL::unary_function<X_trapezoid,bool>
//public CGAL::cpp98::unary_function<X_trapezoid,bool>
//{
// Td_active_non_degenerate_trapezoid(Traits& t) : traits(t) {}
// bool operator()(const X_trapezoid& tr) const
@ -59,7 +59,7 @@ template < class Td_traits> class Trapezoidal_decomposition_2;
template <class map_item,class Traits>
struct Td_active_edge_item:
public CGAL::unary_function<map_item,bool>
public CGAL::cpp98::unary_function<map_item,bool>
{
Td_active_edge_item(const Traits& t) : traits(t) {}
bool operator()(const map_item& item) const
@ -71,7 +71,7 @@ struct Td_active_edge_item:
};
template <class _Tp>
struct Td_map_item_handle_less : public CGAL::binary_function<_Tp, _Tp, bool>
struct Td_map_item_handle_less : public CGAL::cpp98::binary_function<_Tp, _Tp, bool>
{
bool operator()(const _Tp& __x, const _Tp& __y) const {
return __x->id() < __y->id(); }

View File

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

View File

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

View File

@ -1432,7 +1432,7 @@ public:
CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES
//! the result type
typedef CGAL::iterator< std::output_iterator_tag, CGAL::Object >
typedef CGAL::cpp98::iterator< std::output_iterator_tag, CGAL::Object >
result_type;
//! the arity of the functor
@ -1888,7 +1888,7 @@ public:
CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES
//! the result type
typedef CGAL::iterator< std::output_iterator_tag, CGAL::Object >
typedef CGAL::cpp98::iterator< std::output_iterator_tag, CGAL::Object >
result_type;
//! the arity of the functor
@ -2511,7 +2511,7 @@ public:
typedef typename Curve_analysis_2::Coordinate_2 Coordinate_2;
//! the result type
typedef CGAL::iterator< std::output_iterator_tag, Coordinate_2 >
typedef CGAL::cpp98::iterator< std::output_iterator_tag, Coordinate_2 >
result_type;
//! the arity of the functor
@ -2576,7 +2576,7 @@ public:
typedef typename Curve_analysis_2::Coordinate_2 Coordinate_2;
//! the result type
typedef CGAL::iterator< std::output_iterator_tag, Coordinate_2 >
typedef CGAL::cpp98::iterator< std::output_iterator_tag, Coordinate_2 >
result_type;
//! the arity of the functor

View File

@ -57,9 +57,9 @@ template < class CurvedKernelViaAnalysis_2,
class ConstructArc_2 =
typename CurvedKernelViaAnalysis_2::Construct_arc_2 >
struct Make_x_monotone_2 :
public CGAL::binary_function< typename CurvedKernelViaAnalysis_2::Curve_2,
CGAL::iterator<std::output_iterator_tag, CGAL::Object>,
CGAL::iterator<std::output_iterator_tag, CGAL::Object> > {
public CGAL::cpp98::binary_function< typename CurvedKernelViaAnalysis_2::Curve_2,
CGAL::cpp98::iterator<std::output_iterator_tag, CGAL::Object>,
CGAL::cpp98::iterator<std::output_iterator_tag, CGAL::Object> > {
//!\name Public types
//!@{

View File

@ -693,7 +693,7 @@ class Make_x_monotone_2
typedef typename SweepCurvesAdapter_2::Generic_arc_2 Generic_arc_2;
public:
typedef CGAL::iterator<std::output_iterator_tag, Generic_arc_2>
typedef CGAL::cpp98::iterator<std::output_iterator_tag, Generic_arc_2>
result_type;
//! standard constructor

View File

@ -1041,7 +1041,7 @@ public:
//! \brief constructs \c Curve_analysis_2 object, uses caching if appropriate
struct Construct_curve_2 :
public CGAL::unary_function< Polynomial_2, Curve_analysis_2 >
public CGAL::cpp98::unary_function< Polynomial_2, Curve_analysis_2 >
{
//! \brief constructs an object from \c Algebraic_curve_kernel_2 type
//! no default constructor provided
@ -1060,7 +1060,7 @@ public:
* caching is used when appropriate
*/
struct Construct_curve_pair_2 :
public CGAL::binary_function<Curve_analysis_2, Curve_analysis_2,
public CGAL::cpp98::binary_function<Curve_analysis_2, Curve_analysis_2,
Curve_pair_analysis_2> {
Curve_pair_analysis_2 operator()
@ -1078,7 +1078,7 @@ public:
//! returns the first coordinate of \c Xy_coordinate_2
struct Get_x_2 :
public CGAL::unary_function<Xy_coordinate_2, Algebraic_real_1> {
public CGAL::cpp98::unary_function<Xy_coordinate_2, Algebraic_real_1> {
Algebraic_real_1 operator()(const Xy_coordinate_2& xy) const {
return xy.x();
@ -1088,7 +1088,7 @@ public:
//! returns the second coordinate of \c Xy_coordinate_2
struct Get_y_2 :
public CGAL::unary_function<Xy_coordinate_2, Algebraic_real_1> {
public CGAL::cpp98::unary_function<Xy_coordinate_2, Algebraic_real_1> {
Algebraic_real_1 operator()(const Xy_coordinate_2& xy) const {
return xy.y();
@ -1097,7 +1097,7 @@ public:
CGAL_Algebraic_Kernel_cons(Get_y_2, Get_y_2_object);
struct Refine_x_2 :
public CGAL::unary_function<Xy_coordinate_2, void> {
public CGAL::cpp98::unary_function<Xy_coordinate_2, void> {
void operator()(const Xy_coordinate_2& r) const { }
@ -1106,7 +1106,7 @@ public:
CGAL_Algebraic_Kernel_pred(Refine_x_2, refine_x_2_object);
struct Refine_y_2 :
public CGAL::unary_function<Xy_coordinate_2, void> {
public CGAL::cpp98::unary_function<Xy_coordinate_2, void> {
void operator()(const Xy_coordinate_2& r) const { }
@ -1196,7 +1196,7 @@ public:
//! \brief comparison of x-coordinates
struct Compare_x_2 :
public CGAL::binary_function<Algebraic_real_1, Algebraic_real_1,
public CGAL::cpp98::binary_function<Algebraic_real_1, Algebraic_real_1,
Comparison_result > {
Comparison_result operator()(const Algebraic_real_1& x1,
@ -1212,7 +1212,7 @@ public:
//! \brief comparison of y-coordinates of two points
struct Compare_y_2 :
public CGAL::binary_function< Xy_coordinate_2, Xy_coordinate_2,
public CGAL::cpp98::binary_function< Xy_coordinate_2, Xy_coordinate_2,
Comparison_result > {
Comparison_result operator()(const Xy_coordinate_2& xy1,
@ -1226,7 +1226,7 @@ public:
//!
//! \c equal_x specifies that only y-coordinates need to be compared
struct Compare_xy_2 :
public CGAL::binary_function<Xy_coordinate_2, Xy_coordinate_2,
public CGAL::cpp98::binary_function<Xy_coordinate_2, Xy_coordinate_2,
Comparison_result >
{
Comparison_result operator()(const Xy_coordinate_2& xy1,
@ -1243,7 +1243,7 @@ public:
//! for algerbaic curves this means that supporting polynomial is
//! square-free
struct Has_finite_number_of_self_intersections_2 :
public CGAL::unary_function< Polynomial_2, bool > {
public CGAL::cpp98::unary_function< Polynomial_2, bool > {
bool operator()(const Polynomial_2& p) const {
return true; //is_square_free(p);
@ -1258,7 +1258,7 @@ public:
//! in case of algerbaic curves: checks whether supporting polynomials are
//! coprime
struct Has_finite_number_of_intersections_2 :
public CGAL::binary_function< Curve_analysis_2, Curve_analysis_2, bool > {
public CGAL::cpp98::binary_function< Curve_analysis_2, Curve_analysis_2, bool > {
bool operator()(const Curve_analysis_2& c1,
const Curve_analysis_2& c2) const {
@ -1315,7 +1315,7 @@ public:
//! \brief computes the derivative w.r.t. the first (innermost) variable
struct Derivative_x_2 :
public CGAL::unary_function< Polynomial_2, Polynomial_2 > {
public CGAL::cpp98::unary_function< Polynomial_2, Polynomial_2 > {
Polynomial_2 operator()(const Polynomial_2& p) const {
return p;
@ -1325,7 +1325,7 @@ public:
//! \brief computes the derivative w.r.t. the first (outermost) variable
struct Derivative_y_2 :
public CGAL::unary_function< Polynomial_2, Polynomial_2 > {
public CGAL::cpp98::unary_function< Polynomial_2, Polynomial_2 > {
Polynomial_2 operator()(const Polynomial_2& p) const {
return p;
@ -1374,7 +1374,7 @@ public:
* returns a value convertible to \c CGAL::Sign
*/
struct Sign_at_2 :
public CGAL::binary_function< Polynomial_2, Xy_coordinate_2, Sign > {
public CGAL::cpp98::binary_function< Polynomial_2, Xy_coordinate_2, Sign > {
Sign operator()(const Polynomial_2& p, const Xy_coordinate_2& r) const
{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -153,7 +153,7 @@ struct Graph_with_descriptor_with_graph
template <typename Graph, typename Graph_descriptor, typename Descriptor>
struct Descriptor2Descriptor: public CGAL::unary_function<Graph_descriptor,Descriptor>
struct Descriptor2Descriptor: public CGAL::cpp98::unary_function<Graph_descriptor,Descriptor>
{
Descriptor2Descriptor()
@ -691,7 +691,7 @@ template <class Graph>
bool
is_valid(const Graph_with_descriptor_with_graph<Graph> & w, bool verbose = false)
{
return is_valid(*w.graph,verbose);
return is_valid_polygon_mesh(*w.graph,verbose);
}

View File

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

View File

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

View File

@ -46,6 +46,7 @@ CGAL_add_named_parameter(sparse_linear_solver_t, sparse_linear_solver, sparse_li
CGAL_add_named_parameter(number_of_relaxation_steps_t, number_of_relaxation_steps, number_of_relaxation_steps)
CGAL_add_named_parameter(protect_constraints_t, protect_constraints, protect_constraints)
CGAL_add_named_parameter(relax_constraints_t, relax_constraints, relax_constraints)
CGAL_add_named_parameter(collapse_constraints_t, collapse_constraints, collapse_constraints)
CGAL_add_named_parameter(vertex_is_constrained_t, vertex_is_constrained, vertex_is_constrained_map)
CGAL_add_named_parameter(face_patch_t, face_patch, face_patch_map)
CGAL_add_named_parameter(random_uniform_sampling_t, random_uniform_sampling, use_random_uniform_sampling)
@ -64,6 +65,7 @@ CGAL_add_named_parameter(nb_points_per_distance_unit_t, nb_points_per_distance_u
CGAL_add_named_parameter(outward_orientation_t, outward_orientation, outward_orientation)
CGAL_add_named_parameter(overlap_test_t, overlap_test, do_overlap_test_of_bounded_sides)
CGAL_add_named_parameter(preserve_genus_t, preserve_genus, preserve_genus)
CGAL_add_named_parameter(projection_functor_t, projection_functor, projection_functor)
// List of named parameters that we use in the package 'Surface Mesh Simplification'
CGAL_add_named_parameter(get_cost_policy_t, get_cost_policy, get_cost)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,10 +1,9 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/boost/graph/graph_traits_Surface_mesh.h>
#include <CGAL/Polyhedron_items_with_id_3.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/Linear_cell_complex_for_bgl_combinatorial_map_helper.h>
#include <CGAL/boost/graph/graph_traits_Linear_cell_complex_for_combinatorial_map.h>

View File

@ -57,6 +57,7 @@ void test(const NamedParameters& np)
assert(get_param(np, CGAL::internal_np::number_of_relaxation_steps).v == 16);
assert(get_param(np, CGAL::internal_np::protect_constraints).v == 17);
assert(get_param(np, CGAL::internal_np::relax_constraints).v == 18);
assert(get_param(np, CGAL::internal_np::collapse_constraints).v == 43);
assert(get_param(np, CGAL::internal_np::vertex_is_constrained).v == 19);
assert(get_param(np, CGAL::internal_np::face_patch).v == 20);
assert(get_param(np, CGAL::internal_np::random_uniform_sampling).v == 21);
@ -86,6 +87,7 @@ void test(const NamedParameters& np)
assert(get_param(np, CGAL::internal_np::weight_calculator).v == 39);
assert(get_param(np, CGAL::internal_np::preserve_genus).v == 40);
assert(get_param(np, CGAL::internal_np::verbosity_level).v == 41);
assert(get_param(np, CGAL::internal_np::projection_functor).v == 42);
// Test types
@ -121,6 +123,7 @@ void test(const NamedParameters& np)
check_same_type<16>(get_param(np, CGAL::internal_np::number_of_relaxation_steps));
check_same_type<17>(get_param(np, CGAL::internal_np::protect_constraints));
check_same_type<18>(get_param(np, CGAL::internal_np::relax_constraints));
check_same_type<43>(get_param(np, CGAL::internal_np::collapse_constraints));
check_same_type<19>(get_param(np, CGAL::internal_np::vertex_is_constrained));
check_same_type<20>(get_param(np, CGAL::internal_np::face_patch));
check_same_type<21>(get_param(np, CGAL::internal_np::random_uniform_sampling));
@ -150,6 +153,7 @@ void test(const NamedParameters& np)
check_same_type<39>(get_param(np, CGAL::internal_np::weight_calculator));
check_same_type<40>(get_param(np, CGAL::internal_np::preserve_genus));
check_same_type<41>(get_param(np, CGAL::internal_np::verbosity_level));
check_same_type<42>(get_param(np, CGAL::internal_np::projection_functor));
}
int main()
@ -176,6 +180,7 @@ int main()
.number_of_relaxation_steps(A<16>(16))
.protect_constraints(A<17>(17))
.relax_constraints(A<18>(18))
.collapse_constraints(A<43>(43))
.vertex_is_constrained_map(A<19>(19))
.face_patch_map(A<20>(20))
.use_random_uniform_sampling(A<21>(21))
@ -199,6 +204,7 @@ int main()
.weight_calculator(A<39>(39))
.preserve_genus(A<40>(40))
.verbosity_level(A<41>(41))
.projection_functor(A<42>(42))
);
return EXIT_SUCCESS;

View File

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

View File

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

View File

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

View File

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

View File

@ -95,7 +95,7 @@ namespace MA_detail {
// functor for a fixed column of A
template <class NT, class Iterator>
class A_column : public CGAL::unary_function <int, NT>
class A_column : public CGAL::cpp98::unary_function <int, NT>
{
public:
typedef NT result_type;
@ -133,7 +133,7 @@ namespace MA_detail {
// functor for matrix A
template <class NT, class Access_coordinate_begin_d,
class Point_iterator >
class A_matrix : public CGAL::unary_function
class A_matrix : public CGAL::cpp98::unary_function
<int, boost::transform_iterator <A_column
<NT, typename Access_coordinate_begin_d::Coordinate_iterator>,
boost::counting_iterator<int> > >
@ -167,7 +167,7 @@ namespace MA_detail {
// The functor necessary to realize access to b
template <class NT>
class B_vector : public CGAL::unary_function<int, NT>
class B_vector : public CGAL::cpp98::unary_function<int, NT>
{
public:
typedef NT result_type;

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