From e4aaf2447caf6336d3872b399598e716128bcf5c Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 18 Jun 2019 15:50:15 +0200 Subject: [PATCH 01/10] Fix the use of offset in Labeled_mesh_domain_3 --- CGAL_ImageIO/include/CGAL/Image_3.h | 4 ++++ Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h | 12 ++++++------ Mesh_3/include/CGAL/Labeled_mesh_domain_3.h | 8 ++++---- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/CGAL_ImageIO/include/CGAL/Image_3.h b/CGAL_ImageIO/include/CGAL/Image_3.h index 9b6e9bbd32c..3ae77477dd6 100644 --- a/CGAL_ImageIO/include/CGAL/Image_3.h +++ b/CGAL_ImageIO/include/CGAL/Image_3.h @@ -146,6 +146,10 @@ public: double vy() const { return image_ptr->vy; } double vz() const { return image_ptr->vz; } + double tx() const { return image_ptr->tx; } + double ty() const { return image_ptr->ty; } + double tz() const { return image_ptr->tz; } + float value(const std::size_t i, const std::size_t j, const std::size_t k) const diff --git a/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h index 275a4b312d8..e934e0a4187 100644 --- a/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h @@ -109,12 +109,12 @@ private: /// Returns a box enclosing image \c im Bbox_3 compute_bounding_box(const Image& im) const { - return Bbox_3(-im.vx(), - -im.vy(), - -im.vz(), - double(im.xdim()+1)*im.vx(), - double(im.ydim()+1)*im.vy(), - double(im.zdim()+1)*im.vz()); + return Bbox_3(-im.vx()+im.tx(), + -im.vy()+im.ty(), + -im.vz()+im.tz(), + double(im.xdim()+1)*im.vx()+im.tx(), + double(im.ydim()+1)*im.vy()+im.ty(), + double(im.zdim()+1)*im.vz()+im.tz()); } }; // end class Labeled_image_mesh_domain_3 diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index 6a7acf56999..f5bd84ebd33 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -88,10 +88,10 @@ namespace internal { /// Returns a box enclosing image \c im inline Bbox_3 compute_bounding_box(const Image_3& im) { - return Bbox_3(-1,-1,-1, - double(im.xdim())*im.vx()+1, - double(im.ydim())*im.vy()+1, - double(im.zdim())*im.vz()+1); + return Bbox_3(-1+im.tx(),-1+im.ty(),-1+im.tz(), + double(im.xdim())*im.vx()+im.tx()+1, + double(im.ydim())*im.vy()+im.ty()+1, + double(im.zdim())*im.vz()+im.tz()+1); } template From aeac816801819212ed9e1d1b96e26246f8a56ec0 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 25 Jun 2019 15:06:10 +0200 Subject: [PATCH 02/10] Triangulation_2: Fix remove_vertex_from_constraint-GF --- .../CGAL/Polyline_constraint_hierarchy_2.h | 6 +- .../test/Triangulation_2/issue_4025.cpp | 89 +++++++++++++++++++ 2 files changed, 92 insertions(+), 3 deletions(-) create mode 100644 Triangulation_2/test/Triangulation_2/issue_4025.cpp diff --git a/Triangulation_2/include/CGAL/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Polyline_constraint_hierarchy_2.h index 1f3071db44e..7731a8686ec 100644 --- a/Triangulation_2/include/CGAL/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Polyline_constraint_hierarchy_2.h @@ -760,13 +760,13 @@ Polyline_constraint_hierarchy_2::concatenate2(Constraint_id firs // now we really concatenate the vertex lists // Note that all iterators pointing into second remain valid. first.vl_ptr()->pop_back(); // because it is the same as second.front() - Vertex_it back_it = first.vl_ptr()->skip_end(); - --back_it; + Vertex_it back_it = second.vl_ptr()->skip_begin(); + second.vl_ptr()->splice(second.vl_ptr()->skip_begin(), *(first.vl_ptr()), first.vl_ptr()->skip_begin(), first.vl_ptr()->skip_end()); // Note that for VC8 with iterator debugging the iterators pointing into second // are NOT valid So we have to update them - for(Vertex_it it = back_it, succ = it, end = first.vl_ptr()->skip_end(); + for(Vertex_it it = second.vl_ptr()->skip_begin(), succ = it, end = back_it; ++succ != end; ++it){ typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); diff --git a/Triangulation_2/test/Triangulation_2/issue_4025.cpp b/Triangulation_2/test/Triangulation_2/issue_4025.cpp new file mode 100644 index 00000000000..56c6e483ba0 --- /dev/null +++ b/Triangulation_2/test/Triangulation_2/issue_4025.cpp @@ -0,0 +1,89 @@ +#include +#include +#include +#include + + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef CGAL::Polygon_2 Polygon_2; +typedef CGAL::Exact_intersections_tag Itag_; +typedef CGAL::Constrained_Delaunay_triangulation_2 CDT; +typedef CGAL::Constrained_triangulation_plus_2 CDTP; + +typedef CDTP::Point Point; +typedef CDTP::Constraint_id Cid; +typedef CDTP::Vertex_handle Vertex_handle; + + + +int countVertex(CDTP &cdtp, CDTP::Constraint_id id) +{ + auto v=cdtp.vertices_in_constraint_begin(id); + + int count=0; + while(v!=cdtp.vertices_in_constraint_end(id)) + { + count++; + v++; + } + + return count; +} + + +int main() +{ + CDTP cdtp; + + std::list pointsListCollinear; + + pointsListCollinear.push_back(Point(0,0)); + pointsListCollinear.push_back(Point(0,1)); + pointsListCollinear.push_back(Point(0,2)); + pointsListCollinear.push_back(Point(0,3)); + pointsListCollinear.push_back(Point(0,4)); + pointsListCollinear.push_back(Point(0,5)); + + std::list pointsListNoCollinear; + + pointsListNoCollinear.push_back(Point(1,0)); + pointsListNoCollinear.push_back(Point(2,1)); + pointsListNoCollinear.push_back(Point(4,2)); + pointsListNoCollinear.push_back(Point(2,3)); + pointsListNoCollinear.push_back(Point(4,4)); + pointsListNoCollinear.push_back(Point(1,5)); + + + auto ctIdCollinear=cdtp.insert_constraint(pointsListCollinear.begin(),pointsListCollinear.end()); + auto ctIdNoCollinear=cdtp.insert_constraint(pointsListNoCollinear.begin(),pointsListNoCollinear.end()); + + + //******************************* attempt with the collinear constraint + auto vertexToRemoveCollinear=cdtp.vertices_in_constraint_begin(ctIdCollinear); + vertexToRemoveCollinear++; + vertexToRemoveCollinear++; + + + std::cout<<"attempt to remove vertex "<<(*vertexToRemoveCollinear)->point().x()<<" , "<<(*vertexToRemoveCollinear)->point().y() < 5, expected 4 + std::cout<<"number of constraints "< 1 + std::cout<<"number of vertex in constraint "< 6, expected 5 + + + //******************************* attempt with the collinear constraint + auto vertexToRemoveNoCollinear=cdtp.vertices_in_constraint_begin(ctIdNoCollinear); + vertexToRemoveNoCollinear++; + vertexToRemoveNoCollinear++; + + std::cout<<"attempt to remove vertex "<<(*vertexToRemoveNoCollinear)->point().x()<<" , "<<(*vertexToRemoveNoCollinear)->point().y() << std::endl; + cdtp.remove_vertex_from_constraint(ctIdNoCollinear,vertexToRemoveNoCollinear); + + std::cout<<"number of subconstraints "< 4, ok + std::cout<<"number of constraints "< 1 + std::cout<<"number of vertex in constraint "< 5, ok + + return 0; + +} From 060ec7c5c2a54e733209ac0a84f55016fa4a025d Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 26 Jun 2019 14:47:35 +0200 Subject: [PATCH 03/10] No auto --- .../test/Triangulation_2/issue_4025.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Triangulation_2/test/Triangulation_2/issue_4025.cpp b/Triangulation_2/test/Triangulation_2/issue_4025.cpp index 56c6e483ba0..af37b05ac06 100644 --- a/Triangulation_2/test/Triangulation_2/issue_4025.cpp +++ b/Triangulation_2/test/Triangulation_2/issue_4025.cpp @@ -13,12 +13,12 @@ typedef CGAL::Constrained_triangulation_plus_2 CDTP; typedef CDTP::Point Point; typedef CDTP::Constraint_id Cid; typedef CDTP::Vertex_handle Vertex_handle; - - +typedef CDTP::Constraint_id Constraint_id; +typedef CDTP::Vertices_in_constraint_iterator Vertices_in_constraint_iterator; int countVertex(CDTP &cdtp, CDTP::Constraint_id id) { - auto v=cdtp.vertices_in_constraint_begin(id); + Vertices_in_constraint_iterator v=cdtp.vertices_in_constraint_begin(id); int count=0; while(v!=cdtp.vertices_in_constraint_end(id)) @@ -54,12 +54,12 @@ int main() pointsListNoCollinear.push_back(Point(1,5)); - auto ctIdCollinear=cdtp.insert_constraint(pointsListCollinear.begin(),pointsListCollinear.end()); - auto ctIdNoCollinear=cdtp.insert_constraint(pointsListNoCollinear.begin(),pointsListNoCollinear.end()); + Constraint_id ctIdCollinear=cdtp.insert_constraint(pointsListCollinear.begin(),pointsListCollinear.end()); + Constraint_id ctIdNoCollinear=cdtp.insert_constraint(pointsListNoCollinear.begin(),pointsListNoCollinear.end()); //******************************* attempt with the collinear constraint - auto vertexToRemoveCollinear=cdtp.vertices_in_constraint_begin(ctIdCollinear); + Vertices_in_constraint_iterator vertexToRemoveCollinear=cdtp.vertices_in_constraint_begin(ctIdCollinear); vertexToRemoveCollinear++; vertexToRemoveCollinear++; @@ -73,7 +73,7 @@ int main() //******************************* attempt with the collinear constraint - auto vertexToRemoveNoCollinear=cdtp.vertices_in_constraint_begin(ctIdNoCollinear); + Vertices_in_constraint_iterator vertexToRemoveNoCollinear=cdtp.vertices_in_constraint_begin(ctIdNoCollinear); vertexToRemoveNoCollinear++; vertexToRemoveNoCollinear++; From aa0a9c848d545eb1537672cf1a78e243b7996dae Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 26 Jun 2019 15:16:36 +0200 Subject: [PATCH 04/10] Remove 'using namespace std' from namespaces --- CGAL_Core/include/CGAL/CORE/Gmp_impl.h | 37 ++++++++++++----------- CGAL_Core/include/CGAL/CORE/poly/Poly.h | 11 +++---- CGAL_Core/include/CGAL/CORE/poly/Poly.tcc | 36 +++++++++++----------- 3 files changed, 42 insertions(+), 42 deletions(-) diff --git a/CGAL_Core/include/CGAL/CORE/Gmp_impl.h b/CGAL_Core/include/CGAL/CORE/Gmp_impl.h index e12f7f1c81e..324746d69dc 100644 --- a/CGAL_Core/include/CGAL/CORE/Gmp_impl.h +++ b/CGAL_Core/include/CGAL/CORE/Gmp_impl.h @@ -46,15 +46,14 @@ MA 02110-1301, USA. */ #include #include -using namespace std; - namespace CORE { CGAL_INLINE_FUNCTION int -__gmp_istream_set_base (istream &i, char &c, bool &zero, bool &showbase) +__gmp_istream_set_base (std::istream &i, char &c, bool &zero, bool &showbase) { int base; + using std::ios; zero = showbase = false; switch (i.flags() & ios::basefield) @@ -96,7 +95,7 @@ __gmp_istream_set_base (istream &i, char &c, bool &zero, bool &showbase) CGAL_INLINE_FUNCTION void -__gmp_istream_set_digits (string &s, istream &i, char &c, bool &ok, int base) +__gmp_istream_set_digits (std::string &s, std::istream &i, char &c, bool &ok, int base) { switch (base) { @@ -131,13 +130,14 @@ __gmp_istream_set_digits (string &s, istream &i, char &c, bool &ok, int base) } CGAL_INLINE_FUNCTION -istream & -//operator>> (istream &i, mpz_ptr z) -io_read (istream &i, mpz_ptr z) +std::istream & +//operator>> (std::istream &i, mpz_ptr z) +io_read (std::istream &i, mpz_ptr z) { + using namespace std; int base; char c = 0; - string s; + std::string s; bool ok = false, zero, showbase; i.get(c); // start reading @@ -175,13 +175,14 @@ io_read (istream &i, mpz_ptr z) } CGAL_INLINE_FUNCTION -istream & -//operator>> (istream &i, mpq_ptr q) -io_read (istream &i, mpq_ptr q) +std::istream & +//operator>> (std::istream &i, mpq_ptr q) +io_read (std::istream &i, mpq_ptr q) { + using namespace std; int base; char c = 0; - string s; + std::string s; bool ok = false, zero, showbase; i.get(c); // start reading @@ -253,9 +254,9 @@ io_read (istream &i, mpq_ptr q) } CGAL_INLINE_FUNCTION -ostream& -//operator<< (ostream &o, mpz_srcptr z) -io_write (ostream &o, mpz_srcptr z) +std::ostream& +//operator<< (std::ostream &o, mpz_srcptr z) +io_write (std::ostream &o, mpz_srcptr z) { char *str = new char [mpz_sizeinbase(z,10) + 2]; str = mpz_get_str(str, 10, z); @@ -265,9 +266,9 @@ io_write (ostream &o, mpz_srcptr z) } CGAL_INLINE_FUNCTION -ostream& -//operator<< (ostream &o, mpq_srcptr q) -io_write (ostream &o, mpq_srcptr q) +std::ostream& +//operator<< (std::ostream &o, mpq_srcptr q) +io_write (std::ostream &o, mpq_srcptr q) { // size according to GMP documentation char *str = new char [mpz_sizeinbase(mpq_numref(q), 10) + diff --git a/CGAL_Core/include/CGAL/CORE/poly/Poly.h b/CGAL_Core/include/CGAL/CORE/poly/Poly.h index 913c4773c7a..6f2becd9317 100644 --- a/CGAL_Core/include/CGAL/CORE/poly/Poly.h +++ b/CGAL_Core/include/CGAL/CORE/poly/Poly.h @@ -65,7 +65,6 @@ #include namespace CORE { -using namespace std; class Expr; // ================================================== // Typedefs @@ -117,25 +116,25 @@ public: Polynomial(const Polynomial &); Polynomial(const VecNT &); Polynomial(int n, const char* s[]); - Polynomial(const string & s, char myX='x'); + Polynomial(const std::string & s, char myX='x'); Polynomial(const char* s, char myX='x'); ~Polynomial(); private: void constructX(int n, Polynomial& P); - void constructFromString(string & s, char myX='x'); + void constructFromString(std::string & s, char myX='x'); int getnumber(const char* c, int i, unsigned int len, Polynomial & P); bool isint(char c); int getint(const char* c, int i, unsigned int len, int & n); int matchparen(const char* cstr, int start); - int getbasicterm(string & s, Polynomial & P); - int getterm(string & s, Polynomial & P); + int getbasicterm(std::string & s, Polynomial & P); + int getterm(std::string & s, Polynomial & P); public: //Returns a Polynomial corresponding to s, which is supposed to //contain as place-holders the chars 'x' and 'y'. - Polynomial getpoly(string & s); + Polynomial getpoly(std::string & s); // Assignment: Polynomial & operator=(const Polynomial&); diff --git a/CGAL_Core/include/CGAL/CORE/poly/Poly.tcc b/CGAL_Core/include/CGAL/CORE/poly/Poly.tcc index a4af8cd1825..8455a22c52f 100644 --- a/CGAL_Core/include/CGAL/CORE/poly/Poly.tcc +++ b/CGAL_Core/include/CGAL/CORE/poly/Poly.tcc @@ -131,21 +131,21 @@ Polynomial::Polynomial(int n, const char * s[]) { // want to generalize this to BigFloat, etc. // template -Polynomial::Polynomial(const string & s, char myX) { - string ss(s); +Polynomial::Polynomial(const std::string & s, char myX) { + std::string ss(s); constructFromString(ss, myX); } template Polynomial::Polynomial(const char * s, char myX) { - string ss(s); + std::string ss(s); constructFromString(ss, myX); } template -void Polynomial::constructFromString(string & s, char myX) { +void Polynomial::constructFromString(std::string & s, char myX) { if(myX != 'x' || myX != 'X'){ //Replace myX with 'x'. - string::size_type loc = s.find(myX, 0); - while(loc != string::npos){ + std::string::size_type loc = s.find(myX, 0); + while(loc != std::string::npos){ s.replace(loc,1,1,'x'); loc = s.find(myX, loc+1); } @@ -241,7 +241,7 @@ int Polynomial::matchparen(const char* cstr, int start){ template -int Polynomial::getbasicterm(string & s, Polynomial & P){ +int Polynomial::getbasicterm(std::string & s, Polynomial & P){ const char * cstr = s.c_str(); unsigned int len = s.length(); int i=0; @@ -254,7 +254,7 @@ int Polynomial::getbasicterm(string & s, Polynomial & P){ }else if(cstr[i] =='('){ int oldi = i; i = matchparen(cstr, i); - string t = s.substr(oldi+1, i -oldi -1); + std::string t = s.substr(oldi+1, i -oldi -1); P = getpoly(t); }else{ #ifdef CGAL_CORE_TRACE @@ -272,7 +272,7 @@ int Polynomial::getbasicterm(string & s, Polynomial & P){ template -int Polynomial::getterm(string & s, Polynomial & P){ +int Polynomial::getterm(std::string & s, Polynomial & P){ unsigned int len = s.length(); if(len == 0){// Zero Polynomial P=Polynomial(); @@ -280,7 +280,7 @@ int Polynomial::getterm(string & s, Polynomial & P){ } unsigned int ind, oind; const char* cstr =s.c_str(); - string t; + std::string t; //P will be used to accumulate the product of basic terms. ind = getbasicterm(s, P); while(ind != len-1 && cstr[ind + 1]!='+' && cstr[ind + 1]!='-' ){ @@ -304,11 +304,11 @@ int Polynomial::getterm(string & s, Polynomial & P){ } template -Polynomial Polynomial::getpoly(string & s){ +Polynomial Polynomial::getpoly(std::string & s){ //Remove white spaces from the string - string::size_type cnt=s.find(' ',0); - while(cnt != string::npos){ + std::string::size_type cnt=s.find(' ',0); + while(cnt != std::string::npos){ s.erase(cnt, 1); cnt = s.find(' ', cnt); } @@ -321,10 +321,10 @@ Polynomial Polynomial::getpoly(string & s){ //To handle the case when there is one '=' sign //Suppose s is of the form s1 = s2. Then we assign s to //s1 + (-1)(s2) and reset len - string::size_type loc; - if((loc=s.find('=',0)) != string::npos){ + std::string::size_type loc; + if((loc=s.find('=',0)) != std::string::npos){ s.replace(loc,1,1,'+'); - string s3 = "(-1)("; + std::string s3 = "(-1)("; s.insert(loc+1, s3); len = s.length(); s.insert(len, 1, ')'); @@ -332,7 +332,7 @@ Polynomial Polynomial::getpoly(string & s){ len = s.length(); const char *cstr = s.c_str(); - string t; + std::string t; Polynomial P; // P will be the polynomial in which we accumulate the //sum and difference of the different terms. @@ -966,7 +966,7 @@ BigInt Polynomial::UpperBound() const { lhsNeg.makeCeilExact(); /* compute B^{deg} */ - if (rhs <= max(lhsPos,lhsNeg)) { + if (rhs <= (std::max)(lhsPos,lhsNeg)) { B <<= 1; rhs *= (BigInt(1)< Date: Thu, 27 Jun 2019 11:26:26 +0200 Subject: [PATCH 05/10] Fix warnings about uninitialized variables --- .../test/Kernel_23/include/CGAL/_test_cls_triangle_3.h | 6 +++--- Kernel_23/test/Kernel_23/include/CGAL/_test_new_3.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_triangle_3.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_triangle_3.h index 0b85fc87108..fbb1a21ef7a 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_triangle_3.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_triangle_3.h @@ -36,9 +36,6 @@ _test_cls_triangle_3(const R& ) typedef typename R::RT RT; typedef typename R::FT FT; - typename R::Triangle_3 it; - CGAL::Triangle_3 t0(it); - RT n0 = 0; RT n1 = 12; RT n2 = 16; @@ -61,7 +58,10 @@ _test_cls_triangle_3(const R& ) CGAL::Point_3 ps2( n0, n7, n0, n5); // (0, 3, 0) CGAL::Point_3 ps1( n7, n0, n0, n5); // (3, 0, 0) + typename R::Triangle_3 it; // test default-constructor + const CGAL::Triangle_3 t1(p1,p2,p3); + CGAL::Triangle_3 t0(t1); CGAL::Triangle_3 t2(p4,p2,p3); CGAL::Triangle_3 t3(ps1,ps2,ps3); CGAL::Triangle_3 t4(ps2,ps1,ps3); diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_new_3.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_new_3.h index 6b5939a9afa..c96987f970f 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_new_3.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_new_3.h @@ -221,8 +221,8 @@ test_new_3(const R& rep) typename R::Construct_tetrahedron_3 construct_tetrahedron = rep.construct_tetrahedron_3_object(); - Tetrahedron_3 th1; - Tetrahedron_3 th2 = construct_tetrahedron(p2,p3,p4,p5); + Tetrahedron_3 th0; // test default-constructor + Tetrahedron_3 th2 = construct_tetrahedron(p2,p3,p4,p5), th1 = th2; typename R::Construct_iso_cuboid_3 construct_iso_cuboid = rep.construct_iso_cuboid_3_object(); From e2b9c566754908cbeae365ab99a3805e84f9fbd5 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 27 Jun 2019 11:26:39 +0200 Subject: [PATCH 06/10] Fix the assertion "Expr: FPU_get_cw() == mode" --- Kernel_23/test/Kernel_23/Filtered_cartesian.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel_23/test/Kernel_23/Filtered_cartesian.cpp b/Kernel_23/test/Kernel_23/Filtered_cartesian.cpp index 25a57e1965e..ee48df866ac 100644 --- a/Kernel_23/test/Kernel_23/Filtered_cartesian.cpp +++ b/Kernel_23/test/Kernel_23/Filtered_cartesian.cpp @@ -58,7 +58,7 @@ void test(); int main() { - CGAL::force_ieee_double_precision(); + CGAL::Set_ieee_double_precision double_precision_guard; typedef CGAL::Cartesian Clsdb; typedef CGAL::Filtered_kernel Clsd; From 5341998c7e103bd3fe09b45650454b9e70d7e53f Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Fri, 28 Jun 2019 12:45:29 +0200 Subject: [PATCH 07/10] Add a new ctest fixture, that checks the build system That will avoid that `cmake` is run in parallel several times, when `ctest -j` is used. --- Installation/cmake/modules/CGAL_add_test.cmake | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Installation/cmake/modules/CGAL_add_test.cmake b/Installation/cmake/modules/CGAL_add_test.cmake index a40e3c2f90d..d1f30fcec3a 100644 --- a/Installation/cmake/modules/CGAL_add_test.cmake +++ b/Installation/cmake/modules/CGAL_add_test.cmake @@ -89,6 +89,21 @@ function(cgal_add_compilation_test exe_name) COMMAND ${TIME_COMMAND} "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target "${exe_name}") set_property(TEST "compilation_of__${exe_name}" APPEND PROPERTY LABELS "${PROJECT_NAME}") + if(NOT TARGET cgal_check_build_system) + add_custom_target(cgal_check_build_system) + endif() + if(NOT TEST check_build_system) + add_test(NAME "check_build_system" + COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target "cgal_check_build_system") + if(POLICY CMP0066) # cmake 3.7 or later + set_property(TEST "check_build_system" + PROPERTY FIXTURES_SETUP "check_build_system_SetupFixture") + endif() + endif() + if(POLICY CMP0066) # cmake 3.7 or later + set_property(TEST "compilation_of__${exe_name}" + APPEND PROPERTY FIXTURES_REQUIRED "check_build_system_SetupFixture") + endif() endfunction(cgal_add_compilation_test) function(cgal_setup_test_properties test_name) From 327b310add14b469ce495d78159d43c5ded85ffa Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 1 Jul 2019 10:30:52 +0200 Subject: [PATCH 08/10] Fix the hopefully last warning --- .../test/Kernel_23/include/CGAL/_test_cls_tetrahedron_3.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_tetrahedron_3.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_tetrahedron_3.h index 3d54525e066..0b12bcfd8eb 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_tetrahedron_3.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_tetrahedron_3.h @@ -36,9 +36,6 @@ _test_cls_tetrahedron_3(const R& ) typedef typename R::RT RT; typedef typename R::FT FT; - typename R::Tetrahedron_3 it; - CGAL::Tetrahedron_3 t0(it); - RT n0 = 0; RT n1 = 12; RT n2 = 16; @@ -60,6 +57,10 @@ _test_cls_tetrahedron_3(const R& ) CGAL::Point_3 ps1( n7, n0, n0, n5); // (3, 0, 0) CGAL::Point_3 ps0( CGAL::ORIGIN ); // (0, 0, 0) + typename R::Tetrahedron_3 it0; // check the default-constructor + typename R::Tetrahedron_3 it(p1,p2,p3,p4); + CGAL::Tetrahedron_3 t0(it); + const CGAL::Tetrahedron_3 t1(p1,p2,p3,p4); CGAL::Tetrahedron_3 t2(p2,p1,p3,p4); CGAL::Tetrahedron_3 t3(ps0,ps1,ps2,ps3); // positive oriented From 4395fa5c4821839131391db49f888ebe9fb03e1c Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 1 Jul 2019 10:51:28 +0200 Subject: [PATCH 09/10] warning, fix issue #4044 --- Polynomial/include/CGAL/Test/_test_polynomial_traits_d.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Polynomial/include/CGAL/Test/_test_polynomial_traits_d.h b/Polynomial/include/CGAL/Test/_test_polynomial_traits_d.h index 6527b0fb2c7..f53e5af0887 100644 --- a/Polynomial/include/CGAL/Test/_test_polynomial_traits_d.h +++ b/Polynomial/include/CGAL/Test/_test_polynomial_traits_d.h @@ -1860,7 +1860,9 @@ void test_rebind(const PT& /*traits*/){ typedef typename AT::Rational Rational; const int dimension = 4; typedef typename PT:: template Rebind::Other PT_Integer_4; + CGAL_USE_TYPE(PT_Integer_4); typedef typename PT:: template Rebind::Other PT_Rational_4; + CGAL_USE_TYPE(PT_Rational_4); CGAL_static_assertion((boost::is_same< typename PT_Integer_4::Innermost_coefficient_type, Integer>::value)); CGAL_static_assertion((boost::is_same< typename PT_Rational_4::Innermost_coefficient_type, From 2a96d5b42d95f67b41e2b47d811b52bcaf4eb218 Mon Sep 17 00:00:00 2001 From: Simon Giraudot Date: Mon, 1 Jul 2019 14:54:31 +0200 Subject: [PATCH 10/10] Remove lambda/auto from cxx03 code --- .../include/CGAL/Classification/Cluster.h | 30 +++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/Classification/include/CGAL/Classification/Cluster.h b/Classification/include/CGAL/Classification/Cluster.h index 46d0d49857b..85ce5a9893f 100644 --- a/Classification/include/CGAL/Classification/Cluster.h +++ b/Classification/include/CGAL/Classification/Cluster.h @@ -69,6 +69,28 @@ public: std::shared_ptr > neighbors; /// \endcond + /// \cond SKIP_IN_MANUAL + class Point_idx_to_point_unary_function + { + public: + typedef std::size_t argument_type; + typedef typename ItemMap::reference result_type; + typedef boost::readable_property_map_tag category; + + const ItemRange* m_range; + ItemMap m_item_map; + + Point_idx_to_point_unary_function (const ItemRange* range, ItemMap item_map) + : m_range (range), m_item_map (item_map) + { } + + result_type operator() (const argument_type& arg) const + { + return get (m_item_map, *(m_range->begin() + arg)); + } + }; + /// \endcond + private: const ItemRange* m_range; ItemMap m_item_map; @@ -139,14 +161,12 @@ public: */ const CGAL::Bbox_3& bbox() const { - auto transform = [&](const std::size_t& idx) -> typename ItemMap::reference - { - return get (m_item_map, *(m_range->begin() + idx)); - }; - if (m_bounding_box == CGAL::Bbox_3()) + { + Point_idx_to_point_unary_function transform (m_range, m_item_map); m_bounding_box = CGAL::bbox_3 (boost::make_transform_iterator (m_inliers->begin(), transform), boost::make_transform_iterator (m_inliers->end(), transform)); + } return m_bounding_box; }