Merge branch 'master' into Triangulation_on_sphere_2-GF

This commit is contained in:
Mael 2021-04-17 11:22:30 +02:00 committed by GitHub
commit 8226666398
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
804 changed files with 5938 additions and 6202 deletions

5
.clang-tidy Normal file
View File

@ -0,0 +1,5 @@
---
Checks: '-clang-diagnostic*,-clang-analyzer*,modernize-use-nullptr'
HeaderFilterRegex: 'CGAL/*'
...

View File

@ -73,7 +73,7 @@ jobs:
wget --no-verbose cgal.github.io -O tmp.html wget --no-verbose cgal.github.io -O tmp.html
if ! egrep -q "\/$PR_NUMBER\/$ROUND" tmp.html; then if ! egrep -q "\/$PR_NUMBER\/$ROUND" tmp.html; then
#list impacted packages #list impacted packages
LIST_OF_PKGS=$(git diff --name-only HEAD^1 HEAD |cut -s -d/ -f1 |sort -u | xargs -I {} ls -d {}/package_info 2>/dev/null |cut -d/ -f1 |egrep -v Installation||true) LIST_OF_PKGS=$(git diff --name-only HEAD^1 HEAD |cut -s -d/ -f1 |sort -u | xargs -I {} echo {} && ls -d {}/package_info 2>/dev/null |cut -d/ -f1 |egrep -v Installation||true)
if [ "$LIST_OF_PKGS" = "" ]; then if [ "$LIST_OF_PKGS" = "" ]; then
exit 1 exit 1
fi fi

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.14) cmake_minimum_required(VERSION 3.1...3.20)
project(AABB_traits_benchmark) project(AABB_traits_benchmark)
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core)

View File

@ -1,6 +1,6 @@
# This is the CMake script for compiling the AABB tree demo. # This is the CMake script for compiling the AABB tree demo.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(AABB_tree_Demo) project(AABB_tree_Demo)
# Find includes in corresponding build directories # Find includes in corresponding build directories

View File

@ -154,7 +154,7 @@ void MainWindow::on_actionInside_points_triggered()
bool ok; bool ok;
const unsigned int nb_points = (unsigned) const unsigned int nb_points = (unsigned)
QInputDialog::getInt(NULL, "#Points", QInputDialog::getInt(nullptr, "#Points",
"#Points:",10000,1,100000000,9,&ok); "#Points:",10000,1,100000000,9,&ok);
if(!ok) if(!ok)
@ -171,19 +171,19 @@ void MainWindow::on_actionPoints_in_interval_triggered()
bool ok; bool ok;
const unsigned int nb_points = (unsigned) const unsigned int nb_points = (unsigned)
QInputDialog::getInt(NULL, "#Points", QInputDialog::getInt(nullptr, "#Points",
"#Points:",10000,1,100000000,9,&ok); "#Points:",10000,1,100000000,9,&ok);
if(!ok) if(!ok)
return; return;
const double min = const double min =
QInputDialog::getDouble(NULL, "min", QInputDialog::getDouble(nullptr, "min",
"Min:",-0.1,-1000.0,1000.0,9,&ok); "Min:",-0.1,-1000.0,1000.0,9,&ok);
if(!ok) if(!ok)
return; return;
const double max = const double max =
QInputDialog::getDouble(NULL, "max", QInputDialog::getDouble(nullptr, "max",
"Max:",0.1,-1000.0,1000.0,9,&ok); "Max:",0.1,-1000.0,1000.0,9,&ok);
if(!ok) if(!ok)
return; return;
@ -199,7 +199,7 @@ void MainWindow::on_actionBoundary_segments_triggered()
bool ok; bool ok;
const unsigned int nb_slices = (unsigned) const unsigned int nb_slices = (unsigned)
QInputDialog::getInt(NULL, "#Slices", QInputDialog::getInt(nullptr, "#Slices",
"Slices:",100,1,1000000,8,&ok); "Slices:",100,1,1000000,8,&ok);
if(!ok) if(!ok)
@ -216,7 +216,7 @@ void MainWindow::on_actionBoundary_points_triggered()
bool ok; bool ok;
const unsigned int nb_points = (unsigned) const unsigned int nb_points = (unsigned)
QInputDialog::getInt(NULL, "#Points", QInputDialog::getInt(nullptr, "#Points",
"Points:",1000,1,10000000,8,&ok); "Points:",1000,1,10000000,8,&ok);
if(!ok) if(!ok)
@ -233,7 +233,7 @@ void MainWindow::on_actionEdge_points_triggered()
bool ok; bool ok;
const unsigned int nb_points = (unsigned) const unsigned int nb_points = (unsigned)
QInputDialog::getInt(NULL, "#Points", QInputDialog::getInt(nullptr, "#Points",
"Points:",1000,1,10000000,8,&ok); "Points:",1000,1,10000000,8,&ok);
if(!ok) if(!ok)
@ -248,7 +248,7 @@ void MainWindow::on_actionEdge_points_triggered()
void MainWindow::on_actionBench_distances_triggered() void MainWindow::on_actionBench_distances_triggered()
{ {
bool ok; bool ok;
const double duration = QInputDialog::getDouble(NULL, "Duration", const double duration = QInputDialog::getDouble(nullptr, "Duration",
"Duration (s):",1.0,0.01,1000,8,&ok); "Duration (s):",1.0,0.01,1000,8,&ok);
if(!ok) if(!ok)
return; return;
@ -262,7 +262,7 @@ void MainWindow::on_actionBench_distances_triggered()
void MainWindow::on_actionBench_intersections_triggered() void MainWindow::on_actionBench_intersections_triggered()
{ {
bool ok; bool ok;
const double duration = QInputDialog::getDouble(NULL, "Duration", const double duration = QInputDialog::getDouble(nullptr, "Duration",
"Duration (s):",1.0,0.01,1000.0,8,&ok); "Duration (s):",1.0,0.01,1000.0,8,&ok);
if(!ok) if(!ok)
return; return;
@ -361,7 +361,7 @@ void MainWindow::on_actionRefine_bisection_triggered()
{ {
bool ok; bool ok;
const double max_len = const double max_len =
QInputDialog::getDouble(NULL, "Max edge len", QInputDialog::getDouble(nullptr, "Max edge len",
"Max edge len:",0.1,0.001,100.0,9,&ok); "Max edge len:",0.1,0.001,100.0,9,&ok);
if(!ok) if(!ok)
return; return;

View File

@ -18,7 +18,7 @@ class MainWindow :
{ {
Q_OBJECT Q_OBJECT
public: public:
MainWindow(QWidget* parent = 0); MainWindow(QWidget* parent = nullptr);
~MainWindow(); ~MainWindow();
public slots: public slots:

View File

@ -33,7 +33,7 @@ Scene::Scene()
, m_grid_size(slow_distance_grid_size) , m_grid_size(slow_distance_grid_size)
, m_cut_plane(NONE) , m_cut_plane(NONE)
{ {
m_pPolyhedron = NULL; m_pPolyhedron = nullptr;
// view options // view options
m_view_points = true; m_view_points = true;
@ -541,7 +541,7 @@ int Scene::open(QString filename)
return -1; return -1;
} }
if(m_pPolyhedron != NULL) if(m_pPolyhedron != nullptr)
delete m_pPolyhedron; delete m_pPolyhedron;
// allocate new polyhedron // allocate new polyhedron
@ -553,7 +553,7 @@ int Scene::open(QString filename)
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();
delete m_pPolyhedron; delete m_pPolyhedron;
m_pPolyhedron = NULL; m_pPolyhedron = nullptr;
return -1; return -1;
} }
@ -571,7 +571,7 @@ void Scene::update_bbox()
std::cout << "Compute bbox..."; std::cout << "Compute bbox...";
m_bbox = Bbox(); m_bbox = Bbox();
if(m_pPolyhedron == NULL) if(m_pPolyhedron == nullptr)
{ {
std::cout << "failed (no polyhedron)." << std::endl; std::cout << "failed (no polyhedron)." << std::endl;
return; return;
@ -794,7 +794,7 @@ FT Scene::bbox_diag() const
void Scene::build_facet_tree() void Scene::build_facet_tree()
{ {
if ( NULL == m_pPolyhedron ) if ( nullptr == m_pPolyhedron )
{ {
std::cerr << "Build facet tree failed: load polyhedron first." << std::endl; std::cerr << "Build facet tree failed: load polyhedron first." << std::endl;
return; return;
@ -813,7 +813,7 @@ void Scene::build_facet_tree()
void Scene::build_edge_tree() void Scene::build_edge_tree()
{ {
if ( NULL == m_pPolyhedron ) if ( nullptr == m_pPolyhedron )
{ {
std::cerr << "Build edge tree failed: load polyhedron first." << std::endl; std::cerr << "Build edge tree failed: load polyhedron first." << std::endl;
return; return;
@ -860,7 +860,7 @@ void Scene::generate_points_in(const unsigned int nb_points,
const double vmin, const double vmin,
const double vmax) const double vmax)
{ {
if(m_pPolyhedron == NULL) if(m_pPolyhedron == nullptr)
{ {
std::cout << "Load polyhedron first." << std::endl; std::cout << "Load polyhedron first." << std::endl;
return; return;
@ -913,7 +913,7 @@ void Scene::generate_points_in(const unsigned int nb_points,
void Scene::generate_inside_points(const unsigned int nb_points) void Scene::generate_inside_points(const unsigned int nb_points)
{ {
if(m_pPolyhedron == NULL) if(m_pPolyhedron == nullptr)
{ {
std::cout << "Load polyhedron first." << std::endl; std::cout << "Load polyhedron first." << std::endl;
return; return;
@ -955,7 +955,7 @@ void Scene::generate_inside_points(const unsigned int nb_points)
void Scene::generate_boundary_segments(const unsigned int nb_slices) void Scene::generate_boundary_segments(const unsigned int nb_slices)
{ {
if(m_pPolyhedron == NULL) if(m_pPolyhedron == nullptr)
{ {
std::cout << "Load polyhedron first." << std::endl; std::cout << "Load polyhedron first." << std::endl;
return; return;
@ -1005,7 +1005,7 @@ void Scene::generate_boundary_segments(const unsigned int nb_slices)
void Scene::generate_boundary_points(const unsigned int nb_points) void Scene::generate_boundary_points(const unsigned int nb_points)
{ {
if(m_pPolyhedron == NULL) if(m_pPolyhedron == nullptr)
{ {
std::cout << "Load polyhedron first." << std::endl; std::cout << "Load polyhedron first." << std::endl;
return; return;
@ -1055,7 +1055,7 @@ void Scene::generate_boundary_points(const unsigned int nb_points)
void Scene::generate_edge_points(const unsigned int nb_points) void Scene::generate_edge_points(const unsigned int nb_points)
{ {
if(m_pPolyhedron == NULL) if(m_pPolyhedron == nullptr)
{ {
std::cout << "Load polyhedron first." << std::endl; std::cout << "Load polyhedron first." << std::endl;
return; return;
@ -1219,7 +1219,7 @@ void Scene::cut_segment_plane()
{ {
const Segment* inter_seg = CGAL::object_cast<Segment>(&(it->first)); const Segment* inter_seg = CGAL::object_cast<Segment>(&(it->first));
if ( NULL != inter_seg ) if ( nullptr != inter_seg )
{ {
m_cut_segments.push_back(*inter_seg); m_cut_segments.push_back(*inter_seg);
} }
@ -1280,7 +1280,7 @@ void Scene::toggle_view_plane()
void Scene::refine_bisection(const FT max_sqlen) void Scene::refine_bisection(const FT max_sqlen)
{ {
if(m_pPolyhedron == NULL) if(m_pPolyhedron == nullptr)
{ {
std::cout << "Load polyhedron first." << std::endl; std::cout << "Load polyhedron first." << std::endl;
return; return;
@ -1295,7 +1295,7 @@ void Scene::refine_bisection(const FT max_sqlen)
void Scene::refine_loop() void Scene::refine_loop()
{ {
if(m_pPolyhedron == NULL) if(m_pPolyhedron == nullptr)
{ {
std::cout << "Load polyhedron first." << std::endl; std::cout << "Load polyhedron first." << std::endl;
return; return;

View File

@ -6,7 +6,7 @@
Viewer::Viewer(QWidget* parent) Viewer::Viewer(QWidget* parent)
: CGAL::QGLViewer(parent), : CGAL::QGLViewer(parent),
m_pScene(NULL), m_pScene(nullptr),
m_custom_mouse(false) m_custom_mouse(false)
{ {
} }
@ -19,7 +19,7 @@ void Viewer::setScene(Scene* pScene)
void Viewer::draw() void Viewer::draw()
{ {
CGAL::QGLViewer::draw(); CGAL::QGLViewer::draw();
if(m_pScene != NULL) if(m_pScene != nullptr)
{ {
m_pScene->draw(this); m_pScene->draw(this);
} }

View File

@ -6,7 +6,7 @@
void Scene::benchmark_intersections(const double duration) void Scene::benchmark_intersections(const double duration)
{ {
if(m_pPolyhedron == NULL) if(m_pPolyhedron == nullptr)
{ {
std::cout << "Load polyhedron first." << std::endl; std::cout << "Load polyhedron first." << std::endl;
return; return;
@ -67,7 +67,7 @@ void Scene::bench_intersections(Facet_tree& tree,
void Scene::benchmark_distances(const double duration) void Scene::benchmark_distances(const double duration)
{ {
if(m_pPolyhedron == NULL) if(m_pPolyhedron == nullptr)
{ {
std::cout << "Load polyhedron first." << std::endl; std::cout << "Load polyhedron first." << std::endl;
return; return;
@ -101,7 +101,7 @@ std::size_t Scene::nb_digits(std::size_t value)
// refinement loop // refinement loop
void Scene::bench_memory() void Scene::bench_memory()
{ {
if(m_pPolyhedron == NULL) if(m_pPolyhedron == nullptr)
{ {
std::cout << "Load polyhedron first." << std::endl; std::cout << "Load polyhedron first." << std::endl;
return; return;
@ -137,7 +137,7 @@ void Scene::bench_memory()
void Scene::bench_construction() void Scene::bench_construction()
{ {
if(m_pPolyhedron == NULL) if(m_pPolyhedron == nullptr)
{ {
std::cout << "Load polyhedron first." << std::endl; std::cout << "Load polyhedron first." << std::endl;
return; return;
@ -174,7 +174,7 @@ void Scene::bench_construction()
void Scene::bench_intersections_vs_nbt() void Scene::bench_intersections_vs_nbt()
{ {
if(m_pPolyhedron == NULL) if(m_pPolyhedron == nullptr)
{ {
std::cout << "Load polyhedron first." << std::endl; std::cout << "Load polyhedron first." << std::endl;
return; return;
@ -218,7 +218,7 @@ void Scene::bench_intersections_vs_nbt()
void Scene::bench_distances_vs_nbt() void Scene::bench_distances_vs_nbt()
{ {
if(m_pPolyhedron == NULL) if(m_pPolyhedron == nullptr)
{ {
std::cout << "Load polyhedron first." << std::endl; std::cout << "Load polyhedron first." << std::endl;
return; return;

View File

@ -45,11 +45,9 @@ typedef unspecified_type Do_intersect_3;
/*! /*!
A functor object to construct the intersection between two geometric objects. A functor object to construct the intersection between two geometric objects.
This functor must support the result_of protocol, that is the return
type of the `operator()(A, B)` is `CGAL::cpp11::result<Intersect_3(A,B)>`.
Provides the operators: Provides the operators:
`CGAL::cpp11::result<Intersect_3(A,B)> operator()(const A& a, const B& b);` `decltype(auto) operator()(const A& a, const B& b);`
where `A` and `B` are any relevant types among `Ray_3`, `Segment_3`, `Line_3`, where `A` and `B` are any relevant types among `Ray_3`, `Segment_3`, `Line_3`,
`Triangle_3`, `Plane_3` and `Bbox_3`. `Triangle_3`, `Plane_3` and `Bbox_3`.
Relevant herein means that a line primitive (ray, segment, line) is tested Relevant herein means that a line primitive (ray, segment, line) is tested

View File

@ -99,7 +99,7 @@ public:
// types // types
typedef CGAL::AABB_traits<K, My_triangle_primitive> My_AABB_traits; typedef CGAL::AABB_traits<K, My_triangle_primitive> My_AABB_traits;
typedef CGAL::AABB_tree<My_AABB_traits> Tree; typedef CGAL::AABB_tree<My_AABB_traits> Tree;
const double* My_triangle_primitive::point_container = 0; const double* My_triangle_primitive::point_container = nullptr;
int main() int main()
{ {

View File

@ -106,7 +106,7 @@ public:
// types // types
typedef CGAL::AABB_traits<K, My_triangle_primitive> My_AABB_traits; typedef CGAL::AABB_traits<K, My_triangle_primitive> My_AABB_traits;
typedef CGAL::AABB_tree<My_AABB_traits> Tree; typedef CGAL::AABB_tree<My_AABB_traits> Tree;
const std::vector<My_point>* My_triangle_primitive::point_container = 0; const std::vector<My_point>* My_triangle_primitive::point_container = nullptr;
int main() int main()
{ {

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(AABB_tree_Examples) project(AABB_tree_Examples)
find_package(CGAL REQUIRED) find_package(CGAL REQUIRED)

View File

@ -20,7 +20,6 @@
#include <CGAL/disable_warnings.h> #include <CGAL/disable_warnings.h>
#include <CGAL/AABB_primitive.h> #include <CGAL/AABB_primitive.h>
#include <CGAL/result_of.h>
#include <iterator> #include <iterator>
namespace CGAL { namespace CGAL {
@ -31,14 +30,17 @@ namespace internal {
//classical typedefs //classical typedefs
typedef Iterator key_type; typedef Iterator key_type;
typedef typename GeomTraits::Point_3 value_type; typedef typename GeomTraits::Point_3 value_type;
typedef typename cpp11::result_of< // typedef decltype(
typename GeomTraits::Construct_source_3(typename GeomTraits::Segment_3) // std::declval<typename GeomTraits::Construct_source_3>()(
>::type reference; // std::declval<typename GeomTraits::Segment_3>())) reference;
typedef decltype(
typename GeomTraits::Construct_source_3()(
*std::declval<key_type&>())) reference;
typedef boost::readable_property_map_tag category; typedef boost::readable_property_map_tag category;
typedef Source_of_segment_3_iterator_property_map<GeomTraits, Iterator> Self;
inline friend inline friend reference
typename Source_of_segment_3_iterator_property_map<GeomTraits,Iterator>::reference get(Self, key_type it)
get(Source_of_segment_3_iterator_property_map<GeomTraits,Iterator>, Iterator it)
{ {
return typename GeomTraits::Construct_source_3()( *it ); return typename GeomTraits::Construct_source_3()( *it );
} }
@ -57,7 +59,6 @@ namespace internal {
* \tparam GeomTraits is a traits class providing the nested type `Point_3` and `Segment_3`. * \tparam GeomTraits is a traits class providing the nested type `Point_3` and `Segment_3`.
* It also provides the functor `Construct_source_3` that has an operator taking a `Segment_3` * It also provides the functor `Construct_source_3` that has an operator taking a `Segment_3`
* and returning its source as a type convertible to `Point_3`. * and returning its source as a type convertible to `Point_3`.
* In addition `Construct_source_3` must support the result_of protocol.
* \tparam Iterator is a model of `ForwardIterator` with its value type convertible to `GeomTraits::Segment_3` * \tparam Iterator is a model of `ForwardIterator` with its value type convertible to `GeomTraits::Segment_3`
* \tparam CacheDatum is either `CGAL::Tag_true` or `CGAL::Tag_false`. In the former case, * \tparam CacheDatum is either `CGAL::Tag_true` or `CGAL::Tag_false`. In the former case,
* the datum is stored in the primitive, while in the latter it is * the datum is stored in the primitive, while in the latter it is

View File

@ -24,6 +24,8 @@
#include <CGAL/internal/AABB_tree/Has_nested_type_Shared_data.h> #include <CGAL/internal/AABB_tree/Has_nested_type_Shared_data.h>
#include <CGAL/internal/AABB_tree/Is_ray_intersection_geomtraits.h> #include <CGAL/internal/AABB_tree/Is_ray_intersection_geomtraits.h>
#include <CGAL/internal/AABB_tree/Primitive_helper.h> #include <CGAL/internal/AABB_tree/Primitive_helper.h>
#include <CGAL/internal/Has_boolean_tags.h>
#include <boost/optional.hpp> #include <boost/optional.hpp>
@ -190,14 +192,14 @@ public:
typedef typename std::pair<typename GeomTraits::Point_3, typename Primitive::Id> Point_and_primitive_id; typedef typename std::pair<typename GeomTraits::Point_3, typename Primitive::Id> Point_and_primitive_id;
/// `Intersection_and_primitive_id<Query>::%Type::first_type` is found according to /// `Intersection_and_primitive_id<Query>::%Type::first_type` is found according to
/// the result type of `GeomTraits::Intersect_3::operator()`, /// the result type of `GeomTraits::Intersect_3::operator()`. If it is
/// (that is cpp11::result_of<GeomTraits::Intersect_3(Query, Primitive::Datum)>::type). If it is
/// `boost::optional<T>` then it is `T`, and the result type otherwise. /// `boost::optional<T>` then it is `T`, and the result type otherwise.
template<typename Query> template<typename Query>
struct Intersection_and_primitive_id { struct Intersection_and_primitive_id {
typedef typename cpp11::result_of< typedef decltype(
typename GeomTraits::Intersect_3(Query, typename Primitive::Datum) std::declval<typename GeomTraits::Intersect_3>()(
>::type Intersection_type; std::declval<Query>(),
std::declval<typename Primitive::Datum>())) Intersection_type;
typedef std::pair< typedef std::pair<
typename internal::AABB_tree::Remove_optional<Intersection_type>::type, typename internal::AABB_tree::Remove_optional<Intersection_type>::type,
@ -364,8 +366,7 @@ public:
template<typename Query> template<typename Query>
boost::optional< typename Intersection_and_primitive_id<Query>::Type > boost::optional< typename Intersection_and_primitive_id<Query>::Type >
operator()(const Query& query, const typename AT::Primitive& primitive) const { operator()(const Query& query, const typename AT::Primitive& primitive) const {
typename cpp11::result_of<typename GeomTraits::Intersect_3(Query, typename Primitive::Datum) >::type auto inter_res = GeomTraits().intersect_3_object()(internal::Primitive_helper<AT>::get_datum(primitive,m_traits),query);
inter_res = GeomTraits().intersect_3_object()(internal::Primitive_helper<AT>::get_datum(primitive,m_traits),query);
if (!inter_res) if (!inter_res)
return boost::none; return boost::none;
return boost::make_optional( std::make_pair(*inter_res, primitive.id()) ); return boost::make_optional( std::make_pair(*inter_res, primitive.id()) );
@ -414,6 +415,27 @@ public:
CGAL::SMALLER : CGAL::LARGER; CGAL::SMALLER : CGAL::LARGER;
} }
CGAL::Comparison_result operator()(const Point& p, const Bounding_box& bb, const Point& bound, Tag_true) const
{
return GeomTraits().do_intersect_3_object()
(GeomTraits().construct_sphere_3_object()
(p, GeomTraits().compute_squared_distance_3_object()(p, bound)), bb,true)?
CGAL::SMALLER : CGAL::LARGER;
}
CGAL::Comparison_result operator()(const Point& p, const Bounding_box& bb, const Point& bound, Tag_false) const
{
return GeomTraits().do_intersect_3_object()
(GeomTraits().construct_sphere_3_object()
(p, GeomTraits().compute_squared_distance_3_object()(p, bound)), bb)?
CGAL::SMALLER : CGAL::LARGER;
}
CGAL::Comparison_result operator()(const Point& p, const Bounding_box& bb, const Point& bound) const
{
return (*this)(p, bb, bound, Boolean_tag<internal::Has_static_filters<GeomTraits>::value>());
}
template <class Solid> template <class Solid>
CGAL::Comparison_result operator()(const Point& p, const Solid& pr, const FT& sq_distance) const CGAL::Comparison_result operator()(const Point& p, const Solid& pr, const FT& sq_distance) const
{ {
@ -423,6 +445,7 @@ public:
CGAL::SMALLER : CGAL::SMALLER :
CGAL::LARGER; CGAL::LARGER;
} }
}; };
Closest_point closest_point_object() const {return Closest_point(*this);} Closest_point closest_point_object() const {return Closest_point(*this);}

View File

@ -20,7 +20,6 @@
#include <CGAL/disable_warnings.h> #include <CGAL/disable_warnings.h>
#include <CGAL/AABB_primitive.h> #include <CGAL/AABB_primitive.h>
#include <CGAL/result_of.h>
#include <iterator> #include <iterator>
namespace CGAL { namespace CGAL {
@ -31,14 +30,18 @@ namespace internal {
//classical typedefs //classical typedefs
typedef Iterator key_type; typedef Iterator key_type;
typedef typename GeomTraits::Point_3 value_type; typedef typename GeomTraits::Point_3 value_type;
typedef typename cpp11::result_of< // typedef decltype(
typename GeomTraits::Construct_vertex_3(typename GeomTraits::Triangle_3,int) // std::declval<typename GeomTraits::Construct_vertex_3>()(
>::type reference; // std::declval<typename GeomTraits::Triangle_3>(),
// std::declval<int>())) reference;
typedef decltype(
typename GeomTraits::Construct_vertex_3()(
*std::declval<key_type&>(), 0)) reference;
typedef boost::readable_property_map_tag category; typedef boost::readable_property_map_tag category;
typedef Point_from_triangle_3_iterator_property_map<GeomTraits, Iterator> Self;
inline friend inline friend reference
typename Point_from_triangle_3_iterator_property_map<GeomTraits,Iterator>::reference get(Self, key_type it)
get(Point_from_triangle_3_iterator_property_map<GeomTraits,Iterator>, Iterator it)
{ {
return typename GeomTraits::Construct_vertex_3()( *it, 0 ); return typename GeomTraits::Construct_vertex_3()( *it, 0 );
} }
@ -57,7 +60,6 @@ namespace internal {
* \tparam GeomTraits is a traits class providing the nested type `Point_3` and `Triangle_3`. * \tparam GeomTraits is a traits class providing the nested type `Point_3` and `Triangle_3`.
* It also provides the functor `Construct_vertex_3` that has an operator taking a `Triangle_3` * It also provides the functor `Construct_vertex_3` that has an operator taking a `Triangle_3`
* and an integer as parameters and returning a triangle point as a type convertible to `Point_3`. * and an integer as parameters and returning a triangle point as a type convertible to `Point_3`.
* In addition `Construct_vertex_3` must support the result_of protocol.
* \tparam Iterator is a model of `ForwardIterator` with its value type convertible to `GeomTraits::Triangle_3` * \tparam Iterator is a model of `ForwardIterator` with its value type convertible to `GeomTraits::Triangle_3`
* \tparam CacheDatum is either `CGAL::Tag_true` or `CGAL::Tag_false`. In the former case, * \tparam CacheDatum is either `CGAL::Tag_true` or `CGAL::Tag_false`. In the former case,
* the datum is stored in the primitive, while in the latter it is * the datum is stored in the primitive, while in the latter it is

View File

@ -18,7 +18,6 @@
#include <CGAL/AABB_primitive.h> #include <CGAL/AABB_primitive.h>
#include <CGAL/result_of.h>
#include <iterator> #include <iterator>
namespace CGAL namespace CGAL
@ -31,14 +30,18 @@ namespace CGAL
//classical typedefs //classical typedefs
typedef Iterator key_type; typedef Iterator key_type;
typedef typename GeomTraits::Point_3 value_type; typedef typename GeomTraits::Point_3 value_type;
typedef typename cpp11::result_of< typedef decltype(
typename GeomTraits::Construct_vertex_3(typename GeomTraits::Tetrahedron_3, int) std::declval<typename GeomTraits::Construct_vertex_3>()(
>::type reference; std::declval<typename GeomTraits::Tetrahedron_3>(),
std::declval<int>())) reference;
// typedef decltype(
// typename GeomTraits::Construct_vertex_3()(
// *std::declval<key_type&>(), 0)) reference; // fails polyhedron demo!
typedef boost::readable_property_map_tag category; typedef boost::readable_property_map_tag category;
typedef Point_from_cell_iterator_proprety_map<GeomTraits, Iterator> Self;
inline friend inline friend reference
typename Point_from_cell_iterator_proprety_map<GeomTraits, Iterator>::reference get(Self, key_type it)
get(Point_from_cell_iterator_proprety_map<GeomTraits, Iterator>, Iterator it)
{ {
typename GeomTraits::Construct_point_3 point; typename GeomTraits::Construct_point_3 point;
return point(it->vertex(1)->point()); return point(it->vertex(1)->point());

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(AABB_tree_Tests) project(AABB_tree_Tests)
find_package(CGAL REQUIRED) find_package(CGAL REQUIRED)

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Advancing_front_surface_reconstruction_Examples) project(Advancing_front_surface_reconstruction_Examples)
find_package(CGAL REQUIRED) find_package(CGAL REQUIRED)

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Advancing_front_surface_reconstruction_Tests) project(Advancing_front_surface_reconstruction_Tests)
find_package(CGAL REQUIRED) find_package(CGAL REQUIRED)

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Algebraic_foundations_Examples) project(Algebraic_foundations_Examples)
find_package(CGAL REQUIRED) find_package(CGAL REQUIRED)

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Algebraic_foundations_Tests) project(Algebraic_foundations_Tests)
find_package(CGAL REQUIRED COMPONENTS Core) find_package(CGAL REQUIRED COMPONENTS Core)

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Algebraic_kernel_d_Examples) project(Algebraic_kernel_d_Examples)
find_package(CGAL REQUIRED COMPONENTS Core) find_package(CGAL REQUIRED COMPONENTS Core)

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Algebraic_kernel_d_Tests) project(Algebraic_kernel_d_Tests)
# CGAL and its components # CGAL and its components

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Algebraic_kernel_for_circles_Tests) project(Algebraic_kernel_for_circles_Tests)
find_package(CGAL REQUIRED) find_package(CGAL REQUIRED)

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Algebraic_kernel_for_spheres_Tests) project(Algebraic_kernel_for_spheres_Tests)
find_package(CGAL REQUIRED) find_package(CGAL REQUIRED)

View File

@ -37,7 +37,7 @@ does not make sense if the traits class already provides exact constructions.
<ul> <ul>
<li>When the tag `ExactAlphaComparisonTag` is set to \link Tag_true `Tag_true`\endlink, <li>When the tag `ExactAlphaComparisonTag` is set to \link Tag_true `Tag_true`\endlink,
the class `Cartesian_converter` is used internally to switch between the traits class the class `Cartesian_converter` is used internally to switch between the traits class
and the %CGAL kernel `CGAL::Simple_cartesian<NT>`, where `NT` can be either `CGAL::Interval_nt` or and the \cgal kernel `CGAL::Simple_cartesian<NT>`, where `NT` can be either `CGAL::Interval_nt` or
`CGAL::Exact_rational`. `Cartesian_converter` must thus offer the necessary functors `CGAL::Exact_rational`. `Cartesian_converter` must thus offer the necessary functors
to convert a two-dimensional point of the traits class to a two-dimensional point to convert a two-dimensional point of the traits class to a two-dimensional point
of `CGAL::Simple_cartesian<NT>`. However, these functors are not necessarily provided by of `CGAL::Simple_cartesian<NT>`. However, these functors are not necessarily provided by
@ -106,7 +106,7 @@ allowing filtered exact comparisons (that is, interval arithmetic is first used
resorting to exact arithmetic). Access to the interval containing the exact value is provided through the function resorting to exact arithmetic). Access to the interval containing the exact value is provided through the function
`FT::Approximate_nt approx() const` where `FT::Approximate_nt` is `CGAL::Interval_nt<Protected>` `FT::Approximate_nt approx() const` where `FT::Approximate_nt` is `CGAL::Interval_nt<Protected>`
with `Protected=true`. Access to the exact value is provided through the function with `Protected=true`. Access to the exact value is provided through the function
`FT::Exact_nt exact() const` where `FT::Exact_nt` depends on the configuration of %CGAL `FT::Exact_nt exact() const` where `FT::Exact_nt` depends on the configuration of \cgal
(it is `Gmpq` if `gmp` is available and `Quotient<CGAL::MP_Float>` otherwise). (it is `Gmpq` if `gmp` is available and `Quotient<CGAL::MP_Float>` otherwise).
An overload for the function `double to_double(FT)` is also available. Its An overload for the function `double to_double(FT)` is also available. Its
precision is controlled through `FT::set_relative_precision_of_to_double()` in precision is controlled through `FT::set_relative_precision_of_to_double()` in

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Alpha_shapes_2_Examples) project(Alpha_shapes_2_Examples)
find_package(CGAL REQUIRED) find_package(CGAL REQUIRED)

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Alpha_shapes_2_Tests) project(Alpha_shapes_2_Tests)
find_package(CGAL REQUIRED) find_package(CGAL REQUIRED)

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Alpha_shapes_3_Demo) project(Alpha_shapes_3_Demo)
# Find includes in corresponding build directories # Find includes in corresponding build directories

View File

@ -16,7 +16,7 @@ class MainWindow : public CGAL::Qt::DemosMainWindow, private Ui::MainWindow
Q_OBJECT Q_OBJECT
public: public:
MainWindow(QWidget* parent = 0); MainWindow(QWidget* parent = nullptr);
void connectActions(); void connectActions();

View File

@ -71,7 +71,7 @@ meaning in particular that the alpha complex may have
singular faces. For \f$ 0 \leq k \leq d-1\f$, singular faces. For \f$ 0 \leq k \leq d-1\f$,
a \f$ k\f$-simplex of the alpha complex is said to be a \f$ k\f$-simplex of the alpha complex is said to be
singular if it is not a facet of a \f$ (k+1)\f$-simplex of the complex. singular if it is not a facet of a \f$ (k+1)\f$-simplex of the complex.
%CGAL provides two versions of alpha shapes. In the general mode, \cgal provides two versions of alpha shapes. In the general mode,
the alpha shapes correspond strictly to the above definition. the alpha shapes correspond strictly to the above definition.
The regularized mode provides a regularized version of the alpha shapes. The regularized mode provides a regularized version of the alpha shapes.
It corresponds to the domain covered by a regularized version It corresponds to the domain covered by a regularized version

View File

@ -36,7 +36,7 @@ does not make sense if the traits class already provides exact constructions.
<ul> <ul>
<li>When the tag `ExactAlphaComparisonTag` is set to \link Tag_true `Tag_true`\endlink, <li>When the tag `ExactAlphaComparisonTag` is set to \link Tag_true `Tag_true`\endlink,
the class `Cartesian_converter` is used internally to switch between the traits class the class `Cartesian_converter` is used internally to switch between the traits class
and the %CGAL kernel `CGAL::Simple_cartesian<NT>`, where `NT` can be either `CGAL::Interval_nt` or and the \cgal kernel `CGAL::Simple_cartesian<NT>`, where `NT` can be either `CGAL::Interval_nt` or
`CGAL::Exact_rational`. `Cartesian_converter` must thus offer the necessary functors `CGAL::Exact_rational`. `Cartesian_converter` must thus offer the necessary functors
to convert a three-dimensional point of the traits class to a three-dimensional point to convert a three-dimensional point of the traits class to a three-dimensional point
of `CGAL::Simple_cartesian<NT>`. However, these functors are not necessarily provided by of `CGAL::Simple_cartesian<NT>`. However, these functors are not necessarily provided by
@ -103,7 +103,7 @@ allowing filtered exact comparisons (that is, interval arithmetic is first used
resorting to exact arithmetic). Access to the interval containing the exact value is provided through the function resorting to exact arithmetic). Access to the interval containing the exact value is provided through the function
`FT::Approximate_nt approx() const` where `FT::Approximate_nt` is `Interval_nt<Protected>` `FT::Approximate_nt approx() const` where `FT::Approximate_nt` is `Interval_nt<Protected>`
with `Protected=true`. Access to the exact value is provided through the function with `Protected=true`. Access to the exact value is provided through the function
`FT::Exact_nt exact() const` where `FT::Exact_nt` depends on the configuration of %CGAL `FT::Exact_nt exact() const` where `FT::Exact_nt` depends on the configuration of \cgal
(it may be `mpq_class`, `Gmpq`, `Quotient<CGAL::MP_Float>`, etc). (it may be `mpq_class`, `Gmpq`, `Quotient<CGAL::MP_Float>`, etc).
An overload for the function `double to_double(FT)` is also available. Its An overload for the function `double to_double(FT)` is also available. Its
precision is controlled through `FT::set_relative_precision_of_to_double()` in precision is controlled through `FT::set_relative_precision_of_to_double()` in

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Alpha_shapes_3_Examples) project(Alpha_shapes_3_Examples)
find_package(CGAL REQUIRED) find_package(CGAL REQUIRED)

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Alpha_shapes_3_Tests) project(Alpha_shapes_3_Tests)
find_package(CGAL REQUIRED) find_package(CGAL REQUIRED)

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Apollonius_graph_2_Examples) project(Apollonius_graph_2_Examples)
find_package(CGAL REQUIRED COMPONENTS Core) find_package(CGAL REQUIRED COMPONENTS Core)

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Apollonius_graph_2_Tests) project(Apollonius_graph_2_Tests)
find_package(CGAL REQUIRED) find_package(CGAL REQUIRED)

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Arithmetic_kernel_Tests) project(Arithmetic_kernel_Tests)
find_package(CGAL REQUIRED COMPONENTS Core) find_package(CGAL REQUIRED COMPONENTS Core)

View File

@ -22,7 +22,7 @@ class AlgebraicCurveInputDialog : public QDialog
Q_OBJECT Q_OBJECT
public: public:
explicit AlgebraicCurveInputDialog(QWidget *parent = 0); explicit AlgebraicCurveInputDialog(QWidget *parent = nullptr);
~AlgebraicCurveInputDialog(); ~AlgebraicCurveInputDialog();
std::string getLineEditText(); std::string getLineEditText();
Ui::AlgebraicCurveInputDialog* getUi(){return this->ui;} Ui::AlgebraicCurveInputDialog* getUi(){return this->ui;}

View File

@ -21,7 +21,7 @@ class QPaintEvent;
class ArrangementDemoGraphicsView : public QGraphicsView class ArrangementDemoGraphicsView : public QGraphicsView
{ {
public: public:
ArrangementDemoGraphicsView( QWidget* parent = 0 ); ArrangementDemoGraphicsView( QWidget* parent = nullptr );
void setBackgroundColor( QColor color ); void setBackgroundColor( QColor color );
QColor getBackgroundColor( ) const; QColor getBackgroundColor( ) const;

View File

@ -41,7 +41,7 @@ QVariant ArrangementDemoPropertiesDialog::property( int index )
} }
QTableWidgetItem* item = this->ui->tableWidget->item( index, 0 ); QTableWidgetItem* item = this->ui->tableWidget->item( index, 0 );
if ( item == 0 ) if ( item == nullptr )
{ {
return res; return res;
} }
@ -102,17 +102,17 @@ void ArrangementDemoPropertiesDialog::setupUi( )
*/ */
void ArrangementDemoPropertiesDialog::updateUi( ) void ArrangementDemoPropertiesDialog::updateUi( )
{ {
if ( this->parent == NULL ) if ( this->parent == nullptr )
{ {
return; return;
} }
ArrangementDemoTab* currentTab = this->parent->getCurrentTab(); ArrangementDemoTab* currentTab = this->parent->getCurrentTab();
if ( currentTab == NULL ) if ( currentTab == nullptr )
{ {
return; return;
} }
CGAL::Qt::ArrangementGraphicsItemBase* agi = currentTab->getArrangementGraphicsItem( ); CGAL::Qt::ArrangementGraphicsItemBase* agi = currentTab->getArrangementGraphicsItem( );
if ( agi == NULL ) if ( agi == nullptr )
{ {
return; return;
} }

View File

@ -41,7 +41,7 @@ class ArrangementDemoPropertiesDialog : public QDialog
GRID_COLOR_KEY /*!< color of the grid */ GRID_COLOR_KEY /*!< color of the grid */
}; };
ArrangementDemoPropertiesDialog( ArrangementDemoWindow* parent_ = 0 ); ArrangementDemoPropertiesDialog( ArrangementDemoWindow* parent_ = nullptr );
QVariant property( int index ); QVariant property( int index );
protected: protected:

View File

@ -1,6 +1,6 @@
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Arrangement_on_surface_2_Demo) project(Arrangement_on_surface_2_Demo)
if(NOT POLICY CMP0070 AND POLICY CMP0053) if(NOT POLICY CMP0070 AND POLICY CMP0053)

View File

@ -56,7 +56,7 @@ class ColorItemEditor : public QPushButton
Q_PROPERTY(QColor color READ color WRITE setColor USER true) Q_PROPERTY(QColor color READ color WRITE setColor USER true)
public: public:
ColorItemEditor(QWidget *widget = 0); ColorItemEditor(QWidget *widget = nullptr);
public: public:
QColor color( ) const; QColor color( ) const;

View File

@ -23,7 +23,7 @@ namespace Ui
class NewTabDialog : public QDialog class NewTabDialog : public QDialog
{ {
public: public:
NewTabDialog( QWidget* parent = 0 ); NewTabDialog( QWidget* parent = nullptr );
int checkedId( ) const; int checkedId( ) const;
protected: protected:

View File

@ -22,7 +22,7 @@ class PropertyValueDelegate : public QItemDelegate
Q_OBJECT Q_OBJECT
public: public:
PropertyValueDelegate( QObject* parent = 0 ); PropertyValueDelegate( QObject* parent = nullptr );
public: public:
QWidget* createEditor( QWidget* parent, const QStyleOptionViewItem& option, QWidget* createEditor( QWidget* parent, const QStyleOptionViewItem& option,

View File

@ -24,7 +24,7 @@ class RationalCurveInputDialog : public QDialog
Q_OBJECT Q_OBJECT
public: public:
explicit RationalCurveInputDialog(QWidget *parent = 0); explicit RationalCurveInputDialog(QWidget *parent = nullptr);
~RationalCurveInputDialog(); ~RationalCurveInputDialog();
std::string getNumeratorText(); std::string getNumeratorText();
std::string getDenominatorText(); std::string getDenominatorText();

View File

@ -126,7 +126,7 @@ operator()(const Point_2& p, const X_monotone_curve_2& c) const
// AlgKernel ker; // AlgKernel ker;
int n = 100; int n = 100;
if (this->scene != NULL && this->scene->views().size() != 0) if (this->scene != nullptr && this->scene->views().size() != 0)
{ // use the scene to approximate the resolution of the curve { // use the scene to approximate the resolution of the curve
QGraphicsView* view = this->scene->views().first(); QGraphicsView* view = this->scene->views().first();
CGAL::Bbox_2 bb = c.bbox(); // assumes bounded curve CGAL::Bbox_2 bb = c.bbox(); // assumes bounded curve

View File

@ -185,7 +185,7 @@ void VerticalRayGraphicsItem::modelChanged( )
QRectF VerticalRayGraphicsItem::viewportRect( ) const QRectF VerticalRayGraphicsItem::viewportRect( ) const
{ {
QRectF res; QRectF res;
if ( this->scene( ) == NULL ) if ( this->scene( ) == nullptr )
{ {
return res; return res;
} }
@ -207,7 +207,7 @@ QRectF VerticalRayGraphicsItem::viewportRect( ) const
void VerticalRayGraphicsItem::drawArrowhead( QPainter* painter, void VerticalRayGraphicsItem::drawArrowhead( QPainter* painter,
double targetY, bool isShootingUp ) double targetY, bool isShootingUp )
{ {
if ( this->scene( ) == 0 || this->scene( )->views( ).size( ) == 0 ) if ( this->scene( ) == nullptr || this->scene( )->views( ).size( ) == 0 )
{ {
return; return;
} }

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Arrangement_on_surface_2_Examples) project(Arrangement_on_surface_2_Examples)
find_package(CGAL REQUIRED COMPONENTS Core) find_package(CGAL REQUIRED COMPONENTS Core)

View File

@ -37,6 +37,8 @@
#include <CGAL/Curved_kernel_via_analysis_2/Sweep_curves_adapter_2.h> #include <CGAL/Curved_kernel_via_analysis_2/Sweep_curves_adapter_2.h>
#include <CGAL/kernel_assertions.h>
namespace CGAL { namespace CGAL {
namespace internal { namespace internal {
@ -1818,8 +1820,7 @@ protected:
*/ */
void _check_arc_interior() const { void _check_arc_interior() const {
#if !(defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ #if !(defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS))
|| defined(NDEBUG))
if(is_vertical()) { if(is_vertical()) {
Coordinate_1 x0 = _minpoint().x(); Coordinate_1 x0 = _minpoint().x();

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Arrangement_on_surface_2_Tests) project(Arrangement_on_surface_2_Tests)
enable_testing() enable_testing()

View File

@ -172,7 +172,7 @@ Construction_test<T_Geom_traits, T_Topol_traits>::
Construction_test(const Geom_traits& geom_traits) : Construction_test(const Geom_traits& geom_traits) :
Base(geom_traits), Base(geom_traits),
m_geom_traits(geom_traits), m_geom_traits(geom_traits),
m_arr(NULL), m_arr(nullptr),
m_verbose_level(0) m_verbose_level(0)
{} {}
@ -188,7 +188,7 @@ void Construction_test<T_Geom_traits, T_Topol_traits>::deallocate_arrangement()
{ {
if (m_arr) { if (m_arr) {
delete m_arr; delete m_arr;
m_arr = NULL; m_arr = nullptr;
} }
} }

View File

@ -1680,7 +1680,7 @@ bool IO_base_test<Base_geom_traits>::read_xcurve(InputStream_& is,
read_point(is, p2); read_point(is, p2);
assert(p1 != p2); assert(p1 != p2);
unsigned int flag; unsigned int flag = static_cast<unsigned int>(-1);
is >> flag; is >> flag;
if (flag == 1) { if (flag == 1) {
X_monotone_curve_2::Direction_3 normal; X_monotone_curve_2::Direction_3 normal;

View File

@ -252,7 +252,7 @@ private:
template <typename Strategy, Pl_strategy id> template <typename Strategy, Pl_strategy id>
void init_pl(const std::string& name) void init_pl(const std::string& name)
{ {
m_locators[id].m_variant = static_cast<Strategy*>(NULL); m_locators[id].m_variant = static_cast<Strategy*>(nullptr);
m_locators[id].m_name = name; m_locators[id].m_name = name;
m_locators[id].m_active = true; m_locators[id].m_active = true;
} }
@ -293,7 +293,7 @@ private:
Strategy* strategy = boost::get<Strategy*>(m_locators[id].m_variant); Strategy* strategy = boost::get<Strategy*>(m_locators[id].m_variant);
if (strategy) { if (strategy) {
delete strategy; delete strategy;
m_locators[id].m_variant = static_cast<Strategy*>(NULL); m_locators[id].m_variant = static_cast<Strategy*>(nullptr);
} }
} }
@ -667,12 +667,12 @@ Point_location_test<GeomTraits, TopolTraits>::
Point_location_test(const Geom_traits& geom_traits) : Point_location_test(const Geom_traits& geom_traits) :
Base(geom_traits), Base(geom_traits),
m_geom_traits(geom_traits), m_geom_traits(geom_traits),
m_arr(NULL), m_arr(nullptr),
m_random_g(NULL), m_random_g(nullptr),
m_grid_g(NULL), m_grid_g(nullptr),
m_halton_g(NULL), m_halton_g(nullptr),
m_middle_edges_g(NULL), m_middle_edges_g(nullptr),
m_specified_points_g(NULL) m_specified_points_g(nullptr)
{ {
m_locators.resize(NUM_PL_STRATEGIES); m_locators.resize(NUM_PL_STRATEGIES);
@ -773,7 +773,7 @@ deallocate_arrangement()
{ {
if (m_arr) { if (m_arr) {
delete m_arr; delete m_arr;
m_arr = NULL; m_arr = nullptr;
} }
} }

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_CMakeLists # Created by the script cgal_create_CMakeLists
# This is the CMake script for compiling a set of CGAL applications. # This is the CMake script for compiling a set of CGAL applications.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(BGL_LCC_Examples) project(BGL_LCC_Examples)
# CGAL and its components # CGAL and its components

View File

@ -24,7 +24,7 @@ struct Source {
const G* g; const G* g;
Source() Source()
: g(NULL) : g(nullptr)
{} {}
Source(const G& g) Source(const G& g)

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_CMakeLists # Created by the script cgal_create_CMakeLists
# This is the CMake script for compiling a set of CGAL applications. # This is the CMake script for compiling a set of CGAL applications.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(BGL_OpenMesh_Examples) project(BGL_OpenMesh_Examples)
# CGAL and its components # CGAL and its components

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(BGL_arrangement_2_Examples) project(BGL_arrangement_2_Examples)
find_package(CGAL REQUIRED) find_package(CGAL REQUIRED)

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_CMakeLists # Created by the script cgal_create_CMakeLists
# This is the CMake script for compiling a set of CGAL applications. # This is the CMake script for compiling a set of CGAL applications.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(BGL_graphcut_Examples) project(BGL_graphcut_Examples)

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_CMakeLists # Created by the script cgal_create_CMakeLists
# This is the CMake script for compiling a set of CGAL applications. # This is the CMake script for compiling a set of CGAL applications.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(BGL_polyhedron_3_Examples) project(BGL_polyhedron_3_Examples)
# CGAL and its components # CGAL and its components
@ -51,12 +51,10 @@ else()
endif() endif()
find_package( METIS ) find_package( METIS )
if( METIS_FOUND ) include(CGAL_METIS_support)
if( TARGET CGAL::METIS_support )
create_single_source_cgal_program( "polyhedron_partition.cpp" ) create_single_source_cgal_program( "polyhedron_partition.cpp" )
if( METIS_FOUND ) target_link_libraries( polyhedron_partition PUBLIC CGAL::METIS_support)
target_include_directories( polyhedron_partition PRIVATE ${METIS_INCLUDE_DIRS} ) else()
target_link_libraries( polyhedron_partition PRIVATE ${METIS_LIBRARIES} ) message( STATUS "Examples that use the METIS library will not be compiled." )
else()
message( STATUS "Examples that use the METIS library will not be compiled." )
endif()
endif() endif()

View File

@ -21,7 +21,7 @@ struct Source {
const G* g; const G* g;
Source() Source()
: g(NULL) : g(nullptr)
{} {}
Source(const G& g) Source(const G& g)

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(BGL_surface_mesh_Examples) project(BGL_surface_mesh_Examples)
find_package(CGAL REQUIRED) find_package(CGAL REQUIRED)
@ -13,10 +13,10 @@ create_single_source_cgal_program("surface_mesh_dual.cpp")
create_single_source_cgal_program("connected_components.cpp") create_single_source_cgal_program("connected_components.cpp")
find_package(METIS) find_package(METIS)
if( METIS_FOUND ) include(CGAL_METIS_support)
if( TARGET CGAL::METIS_support )
create_single_source_cgal_program( "surface_mesh_partition.cpp" ) create_single_source_cgal_program( "surface_mesh_partition.cpp" )
target_include_directories( surface_mesh_partition PRIVATE ${METIS_INCLUDE_DIRS} ) target_link_libraries( surface_mesh_partition PUBLIC CGAL::METIS_support )
target_link_libraries( surface_mesh_partition PRIVATE ${METIS_LIBRARIES} )
else() else()
message(STATUS "Examples that use the METIS library will not be compiled.") message(STATUS "Examples that use the METIS library will not be compiled.")
endif() endif()

View File

@ -17,7 +17,7 @@ typedef boost::graph_traits<Dual>::edge_descriptor edge_descriptor;
template <typename G> template <typename G>
struct noborder { struct noborder {
noborder() : g(NULL) {} // default-constructor required by filtered_graph noborder() : g(nullptr) {} // default-constructor required by filtered_graph
noborder(G& g) : g(&g) {} noborder(G& g) : g(&g) {}
bool operator()(const edge_descriptor& e) const bool operator()(const edge_descriptor& e) const

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(BGL_triangulation_2_Examples) project(BGL_triangulation_2_Examples)
find_package(CGAL REQUIRED) find_package(CGAL REQUIRED)

View File

@ -737,7 +737,7 @@ add_face(const VertexRange& vr, Graph& g)
patch_start, patch_end; patch_start, patch_end;
// cache for set_next and vertex' set_halfedge // cache for set_next and vertex' set_halfedge
typedef std::pair<halfedge_descriptor, halfedge_descriptor> NextCacheEntry; typedef std::pair<halfedge_descriptor, halfedge_descriptor> NextCacheEntry;
typedef std::vector<NextCacheEntry> NextCache; typedef boost::container::small_vector<NextCacheEntry,9> NextCache;
NextCache next_cache; NextCache next_cache;
next_cache.reserve(3 * n); next_cache.reserve(3 * n);

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_cmake_script_with_options # Created by the script cgal_create_cmake_script_with_options
# This is the CMake script for compiling a set of CGAL applications. # This is the CMake script for compiling a set of CGAL applications.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(BGL_Tests) project(BGL_Tests)
# CGAL and its components # CGAL and its components

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Barycentric_coordinates_2_Examples) project(Barycentric_coordinates_2_Examples)
find_package(CGAL REQUIRED) find_package(CGAL REQUIRED)

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Barycentric_coordinates_2_Tests) project(Barycentric_coordinates_2_Tests)
find_package(CGAL REQUIRED) find_package(CGAL REQUIRED)

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Boolean_set_operations_2_GraphicsView_Demo) project(Boolean_set_operations_2_GraphicsView_Demo)
if(NOT POLICY CMP0070 AND POLICY CMP0053) if(NOT POLICY CMP0070 AND POLICY CMP0053)

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Boolean_set_operations_2_Examples) project(Boolean_set_operations_2_Examples)
find_package(CGAL REQUIRED COMPONENTS Core) find_package(CGAL REQUIRED COMPONENTS Core)

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Boolean_set_operations_2_Tests) project(Boolean_set_operations_2_Tests)
find_package(CGAL REQUIRED) find_package(CGAL REQUIRED)

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Approximate_min_ellipsoid_d_Examples) project(Approximate_min_ellipsoid_d_Examples)
find_package(CGAL REQUIRED) find_package(CGAL REQUIRED)

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Min_annulus_d_Examples) project(Min_annulus_d_Examples)
find_package(CGAL REQUIRED) find_package(CGAL REQUIRED)

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Min_circle_2_Examples) project(Min_circle_2_Examples)
find_package(CGAL REQUIRED) find_package(CGAL REQUIRED)

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Min_ellipse_2_Examples) project(Min_ellipse_2_Examples)
find_package(CGAL REQUIRED) find_package(CGAL REQUIRED)

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Min_quadrilateral_2_Examples) project(Min_quadrilateral_2_Examples)
find_package(CGAL REQUIRED) find_package(CGAL REQUIRED)

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Min_sphere_d_Examples) project(Min_sphere_d_Examples)
find_package(CGAL REQUIRED) find_package(CGAL REQUIRED)

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Min_sphere_of_spheres_d_Examples) project(Min_sphere_of_spheres_d_Examples)
find_package(CGAL REQUIRED) find_package(CGAL REQUIRED)

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Rectangular_p_center_2_Examples) project(Rectangular_p_center_2_Examples)
find_package(CGAL REQUIRED) find_package(CGAL REQUIRED)

View File

@ -20,7 +20,7 @@
#include <iostream> #include <iostream>
#include <iomanip> #include <iomanip>
#if (defined(CGAL_NO_ASSERTIONS) || defined(NDEBUG)) #if defined(CGAL_NO_ASSERTIONS)
#undef CGAL_APPEL_ASSERTION_MODE #undef CGAL_APPEL_ASSERTION_MODE
#undef CGAL_APPEL_EXP_ASSERTION_MODE #undef CGAL_APPEL_EXP_ASSERTION_MODE
#undef CGAL_APPEL_LOG_MODE #undef CGAL_APPEL_LOG_MODE

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Bounding_volumes_Tests) project(Bounding_volumes_Tests)
find_package(CGAL REQUIRED COMPONENTS Core) find_package(CGAL REQUIRED COMPONENTS Core)

View File

@ -246,7 +246,7 @@ void box_intersection_all_pairs_d(
The first template parameter of the function enables to choose whether The first template parameter of the function enables to choose whether
the algorithm is to be run in parallel, if `CGAL::Parallel_tag` is specified the algorithm is to be run in parallel, if `CGAL::Parallel_tag` is specified
and %CGAL has been linked with the Intel TBB library, or sequentially, and \cgal has been linked with the Intel TBB library, or sequentially,
if `CGAL::Sequential_tag` - the default value - is specified. if `CGAL::Sequential_tag` - the default value - is specified.
The parallelization of the algorithm is based on a divide-and-conquer The parallelization of the algorithm is based on a divide-and-conquer
approach: the two ranges are split in a number of smaller ranges, and approach: the two ranges are split in a number of smaller ranges, and

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Box_intersection_d_Examples) project(Box_intersection_d_Examples)
find_package(CGAL REQUIRED) find_package(CGAL REQUIRED)

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Box_intersection_d_Tests) project(Box_intersection_d_Tests)
find_package(CGAL REQUIRED) find_package(CGAL REQUIRED)

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Core_Examples) project(Core_Examples)
# CGAL and its components # CGAL and its components

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(CGALimageIO_Demo) project(CGALimageIO_Demo)
if(NOT POLICY CMP0070 AND POLICY CMP0053) if(NOT POLICY CMP0070 AND POLICY CMP0053)
@ -30,8 +30,8 @@ if(VTK_FOUND)
if(TARGET vtkRenderingQt AND TARGET vtkFiltersModeling) if(TARGET vtkRenderingQt AND TARGET vtkFiltersModeling)
find_package(VTK COMPONENTS vtkRenderingQt vtkFiltersModeling NO_MODULE) find_package(VTK COMPONENTS vtkRenderingQt vtkFiltersModeling NO_MODULE)
include(${VTK_USE_FILE}) include(${VTK_USE_FILE})
find_package(Qt${VTK_QT_VERSION} COMPONENTS QtGui) find_package(Qt${VTK_QT_VERSION} COMPONENTS Gui)
if(NOT TARGET Qt${VTK_QT_VERSION}::QtGui) if(NOT TARGET Qt${VTK_QT_VERSION}::Gui)
message( message(
STATUS STATUS
"NOTICE: vtkRenderingQt needs Qt${VTK_QT_VERSION}, and will not be compiled." "NOTICE: vtkRenderingQt needs Qt${VTK_QT_VERSION}, and will not be compiled."
@ -44,7 +44,7 @@ if(VTK_FOUND)
target_link_libraries( target_link_libraries(
image_to_vtk_viewer ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} image_to_vtk_viewer ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}
${VTK_LIBRARIES} Qt${VTK_QT_VERSION}::QtGui) ${VTK_LIBRARIES} Qt${VTK_QT_VERSION}::Gui)
else() else()
message( message(
STATUS STATUS

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(CGALimageIO_Examples) project(CGALimageIO_Examples)
if(POLICY CMP0074) if(POLICY CMP0074)
@ -16,6 +16,7 @@ if(CGAL_ImageIO_FOUND)
create_single_source_cgal_program("convert_raw_image_to_inr.cpp") create_single_source_cgal_program("convert_raw_image_to_inr.cpp")
create_single_source_cgal_program("test_imageio.cpp") create_single_source_cgal_program("test_imageio.cpp")
create_single_source_cgal_program("extract_a_sub_image.cpp") create_single_source_cgal_program("extract_a_sub_image.cpp")
create_single_source_cgal_program("slice_image.cpp")
else() else()
message( message(
STATUS STATUS

View File

@ -33,7 +33,7 @@ int main(int argc, char **argv) {
for (auto k = zmin; k < zmax; ++k) for (auto k = zmin; k < zmax; ++k)
for (auto j = ymin; j <= ymax; ++j) for (auto j = ymin; j <= ymax; ++j)
for (auto i = xmin; i <= xmax; ++i) { for (auto i = xmin; i <= xmax; ++i) {
auto pos = data + image->wdim * (i + image->xdim * (j + image->zdim * k)); auto pos = data + image->wdim * (i + image->xdim * (j + image->ydim * k));
std::copy(pos, pos + image->wdim, new_data); std::copy(pos, pos + image->wdim, new_data);
new_data += image->wdim; new_data += image->wdim;
} }

View File

@ -0,0 +1,27 @@
#include <CGAL/ImageIO.h>
#include <iostream>
#include <string>
int main(int argc, char **argv) {
if (argc != 3) {
std::cerr << "Usage: slice_size <input> <output>\n";
return argc != 1;
}
_image *image = ::_readImage(argv[1]);
if (!image)
return 2;
auto *new_image = ::_createImage(image->xdim, image->ydim, image->zdim / 2 + 1, 1,
image->vx, image->vy, image->vz*2, image->wdim,
image->wordKind, image->sign);
const auto* const data = static_cast<char*>(image->data);
auto* new_data = static_cast<char*>(new_image->data);
const auto slice_size = image->wdim * image->xdim * image->ydim;
for (auto k = 0ul; k < image->zdim; k+=2) {
auto pos = data + slice_size * k;
new_data = std::copy(pos, pos + slice_size, new_data);
}
auto r = ::_writeImage(new_image, argv[2]);
if(r != ImageIO_NO_ERROR) return 3;
::_freeImage(image);
::_freeImage(new_image);
}

View File

@ -110,6 +110,9 @@ struct VTK_type_generator<boost::uint32_t> {
vtk_image->SetSpacing(image.vx(), vtk_image->SetSpacing(image.vx(),
image.vy(), image.vy(),
image.vz()); image.vz());
vtk_image->SetOrigin(image.tx(),
image.ty(),
image.tz());
vtk_image->AllocateScalars(type, 1); vtk_image->AllocateScalars(type, 1);
vtk_image->GetPointData()->SetScalars(data_array); vtk_image->GetPointData()->SetScalars(data_array);
return vtk_image; return vtk_image;

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(CGAL_ImageIO_Tests) project(CGAL_ImageIO_Tests)
if(POLICY CMP0074) if(POLICY CMP0074)

View File

@ -188,7 +188,7 @@ int main() {
<< "timer new implementation: " << timer_new_implementation.time() << "timer new implementation: " << timer_new_implementation.time()
<< "\ntimer old implementation: " << timer_old_implementation.time() << "\ntimer old implementation: " << timer_old_implementation.time()
<< "\n"; << "\n";
image.set_data(0); // trick to avoid ~Image_3 segfault. image.set_data(nullptr); // trick to avoid ~Image_3 segfault.
const char* filenames[] = { const char* filenames[] = {

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(CGAL_ipelets_Demo) project(CGAL_ipelets_Demo)
if(NOT POLICY CMP0070 AND POLICY CMP0053) if(NOT POLICY CMP0070 AND POLICY CMP0053)

View File

@ -37,7 +37,7 @@ template <typename T>
struct Is_finite { struct Is_finite {
const T* t_; const T* t_;
Is_finite() Is_finite()
: t_(NULL) : t_(nullptr)
{} {}
Is_finite(const T& t) Is_finite(const T& t)
: t_(&t) : t_(&t)

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(CGAL_ipelets_Examples) project(CGAL_ipelets_Examples)
find_package(CGAL REQUIRED) find_package(CGAL REQUIRED)

View File

@ -1,10 +1,9 @@
# Top level CMakeLists.txt for CGAL-branchbuild # Top level CMakeLists.txt for CGAL-branchbuild
# Minimal version of CMake: # Minimal version of CMake:
cmake_minimum_required(VERSION 3.1) cmake_minimum_required(VERSION 3.1...3.20)
message("== CMake setup ==") message("== CMake setup ==")
cmake_minimum_required(VERSION 3.1...3.15)
project(CGAL CXX C) project(CGAL CXX C)
export(PACKAGE CGAL) export(PACKAGE CGAL)
@ -12,14 +11,14 @@ set(CGAL_BRANCH_BUILD
ON ON
CACHE INTERNAL "Create CGAL from a Git branch" FORCE) CACHE INTERNAL "Create CGAL from a Git branch" FORCE)
include(${CMAKE_SOURCE_DIR}/CGALConfigVersion.cmake) include(${CMAKE_CURRENT_SOURCE_DIR}/CGALConfigVersion.cmake)
include(${CMAKE_SOURCE_DIR}/Installation/cmake/modules/CGAL_SCM.cmake) include(${CMAKE_CURRENT_SOURCE_DIR}/Installation/cmake/modules/CGAL_SCM.cmake)
cgal_detect_git(${CMAKE_SOURCE_DIR}) cgal_detect_git(${CMAKE_CURRENT_SOURCE_DIR})
function(CGAL_error_if_detect_in_source_build) function(CGAL_error_if_detect_in_source_build)
# If in a Git repository, forbid in-source builds # If in a Git repository, forbid in-source builds
get_filename_component(srcdir "${CMAKE_SOURCE_DIR}" REALPATH) get_filename_component(srcdir "${CMAKE_CURRENT_SOURCE_DIR}" REALPATH)
get_filename_component(bindir "${CMAKE_BINARY_DIR}" REALPATH) get_filename_component(bindir "${CMAKE_CURRENT_BINARY_DIR}" REALPATH)
if("${srcdir}" STREQUAL "${bindir}") if("${srcdir}" STREQUAL "${bindir}")
message( message(
FATAL_ERROR FATAL_ERROR

View File

@ -17,6 +17,7 @@
#define CGAL_CARTESIAN_CIRCLEC3_H #define CGAL_CARTESIAN_CIRCLEC3_H
#include <CGAL/Interval_nt.h> #include <CGAL/Interval_nt.h>
#include "boost/tuple/tuple.hpp"
namespace CGAL { namespace CGAL {
@ -29,13 +30,9 @@ class CircleC3 {
typedef typename R_::Direction_3 Direction_3; typedef typename R_::Direction_3 Direction_3;
typedef typename R_::FT FT; typedef typename R_::FT FT;
struct Rep //using a boost::tuple because std::pair and tuple cannot work with incomplete types.
{ typedef boost::tuple<Sphere_3, Plane_3> Rep;
Sphere_3 first;
Plane_3 second;
Rep () : first(), second() { }
Rep (const Sphere_3& s, const Plane_3& p) : first(s), second(p) { }
};
typedef typename R_::template Handle<Rep>::type Base; typedef typename R_::template Handle<Rep>::type Base;
Base base; Base base;
@ -125,7 +122,7 @@ public:
const Plane_3& supporting_plane() const const Plane_3& supporting_plane() const
{ {
return get_pointee_or_identity(base).second; return boost::get<1>(get_pointee_or_identity(base));
} }
const Sphere_3& supporting_sphere() const const Sphere_3& supporting_sphere() const
@ -145,7 +142,7 @@ public:
const Sphere_3& diametral_sphere() const const Sphere_3& diametral_sphere() const
{ {
return get_pointee_or_identity(base).first; return boost::get<0>(get_pointee_or_identity(base));
} }
double approximate_area() const double approximate_area() const

View File

@ -1,7 +1,7 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.20)
project(Circular_kernel_2_Examples) project(Circular_kernel_2_Examples)
find_package(CGAL REQUIRED) find_package(CGAL REQUIRED)

View File

@ -22,7 +22,6 @@
#include <CGAL/config.h> #include <CGAL/config.h>
#include <CGAL/result_of.h>
#include <CGAL/Bbox_2.h> #include <CGAL/Bbox_2.h>
#include <CGAL/enum.h> #include <CGAL/enum.h>
namespace CGAL { namespace CGAL {
@ -107,25 +106,25 @@ public:
{} {}
typename cpp11::result_of<typename R::Construct_circular_source_vertex_2(Circular_arc_2)>::type decltype(auto)
source() const source() const
{ {
return typename R::Construct_circular_source_vertex_2()(*this); return typename R::Construct_circular_source_vertex_2()(*this);
} }
typename cpp11::result_of<typename R::Construct_circular_target_vertex_2(Circular_arc_2)>::type decltype(auto)
target() const target() const
{ {
return typename R::Construct_circular_target_vertex_2()(*this); return typename R::Construct_circular_target_vertex_2()(*this);
} }
typename cpp11::result_of<typename R::Construct_circular_min_vertex_2(Circular_arc_2)>::type decltype(auto)
left() const left() const
{ {
return typename R::Construct_circular_min_vertex_2()(*this); return typename R::Construct_circular_min_vertex_2()(*this);
} }
typename cpp11::result_of<typename R::Construct_circular_max_vertex_2(Circular_arc_2)>::type decltype(auto)
right() const right() const
{ {
return typename R::Construct_circular_max_vertex_2()(*this); return typename R::Construct_circular_max_vertex_2()(*this);
@ -141,19 +140,19 @@ public:
return typename R::Is_y_monotone_2()(*this); return typename R::Is_y_monotone_2()(*this);
} }
typename cpp11::result_of<typename R::Construct_circle_2(Circular_arc_2)>::type decltype(auto)
supporting_circle() const supporting_circle() const
{ {
return typename R::Construct_circle_2()(*this); return typename R::Construct_circle_2()(*this);
} }
typename cpp11::result_of<typename R::Construct_center_2(Circular_arc_2)>::type decltype(auto)
center() const center() const
{ {
return typename R::Construct_center_2()(*this); return typename R::Construct_center_2()(*this);
} }
typename cpp11::result_of<typename R::Compute_squared_radius_2( Circular_arc_2)>::type decltype(auto)
squared_radius() const squared_radius() const
{ {
return typename R::Compute_squared_radius_2()(*this); return typename R::Compute_squared_radius_2()(*this);

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