diff --git a/Algebraic_foundations/include/CGAL/Test/_test_algebraic_structure.h b/Algebraic_foundations/include/CGAL/Test/_test_algebraic_structure.h index 56c421eee1f..08412f96ea4 100644 --- a/Algebraic_foundations/include/CGAL/Test/_test_algebraic_structure.h +++ b/Algebraic_foundations/include/CGAL/Test/_test_algebraic_structure.h @@ -426,7 +426,7 @@ void test_algebraic_structure_intern( //commutative assert(a+b+c==c+b+a); assert(a*b*c==c*b*a); - //distributiv + //distributive assert((a-b)*c==a*c-b*c); assert((a+b)*c==a*c+b*c); //binom diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CurveInputMethods.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CurveInputMethods.cpp index 91a64dad22e..06ebae10a20 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CurveInputMethods.cpp +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CurveInputMethods.cpp @@ -111,13 +111,10 @@ void CurveInputMethod::beginInput_() static inline void clearPainterPath(QPainterPath& ppath) { -#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)) ppath.clear(); -#else - ppath = {}; -#endif } + void CurveInputMethod::reset() { this->resetInput(); diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/GridGraphicsItem.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/GridGraphicsItem.cpp index 535f4684975..01723db026e 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/GridGraphicsItem.cpp +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/GridGraphicsItem.cpp @@ -67,11 +67,7 @@ void GridGraphicsItem::setSpacing(int spacing_) static inline qreal horizontalAdvance(const QFontMetrics& fm, const QString& text) { -#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)) return fm.horizontalAdvance(text); -#else - return fm.boundingRect(text).width(); -#endif } void GridGraphicsItem::paint( diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circle_segments/intersect b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circle_segments/intersect index b0e0bbe6a46..6a3783c9cfc 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circle_segments/intersect +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circle_segments/intersect @@ -1,6 +1,6 @@ # Input is based on the curves and points indexes from intersect.pt # intersect.xcv. The first two numbers are the numbers of the input curves -# to be intersected. After that there is the number of intesections and +# to be intersected. After that there is the number of intersections and # 2-3 numbers representing each intersection. Meaning, the input is of the form: # intersect \ # [ \ diff --git a/Convex_decomposition_3/include/CGAL/Convex_decomposition_3/External_structure_builder.h b/Convex_decomposition_3/include/CGAL/Convex_decomposition_3/External_structure_builder.h index 8c4c546590d..c6ecee86c0b 100644 --- a/Convex_decomposition_3/include/CGAL/Convex_decomposition_3/External_structure_builder.h +++ b/Convex_decomposition_3/include/CGAL/Convex_decomposition_3/External_structure_builder.h @@ -76,62 +76,13 @@ class External_structure_builder : public Modifier_base sedge2sface; - /* - SFace_iterator sfi; - CGAL_forall_sfaces(sfi, *sncp) { - SFace_cycle_iterator sfc; - for(sfc = sfi->sface_cycles_begin(); sfc != sfi->sface_cycles_end(); ++sfc) { - if(sfc.is_shalfedge()){ - SHalfedge_around_sface_circulator eaf(sfc), end(eaf); - CGAL_For_all(eaf,end) { - SHalfedge_handle se(eaf); - sedge2sface[eaf] = sfi; - } - } - } - } - - // CGAL::SNC_io_parser O0(std::cerr, *sncp, false); - // O0.print(); - - SHalfedge_iterator sei; - CGAL_forall_shalfedges(sei, *sncp) { - SHalfedge_handle se(sei); - if(sedge2sface[se] == SFace_handle()) { - SM_decorator SD(&*sei->source()->source()); - SFace_handle sf_new = SD.new_sface(); - sf_new->mark() = sei->incident_sface()->mark(); - - CGAL_NEF_TRACEN("new entry sedge " << sei->source()->point() - << "->" << sei->twin()->source()->point() - << " at " << sei->source()->source()->point()); - - SD.link_as_face_cycle(sei, sf_new); - - SHalfedge_around_sface_circulator eaf(se), end(eaf); - CGAL_For_all(eaf,end) { - SHalfedge_handle se(eaf); - sedge2sface[eaf] = sf_new; - } - - // TODO: relink inner sface cycles - } - } - */ SNC_point_locator* old_pl = pl; pl = pl->clone(); sncpl.pl = pl; - delete old_pl; SNC_external_structure C(*sncp,pl); C.clear_external_structure(); C.build_external_structure(); - - // CGAL::SNC_io_parser Ox(std::cerr, *sncp, false); - // Ox.print(); + delete old_pl; } }; diff --git a/Convex_decomposition_3/test/Convex_decomposition_3/cd_nested_holes_test.cpp b/Convex_decomposition_3/test/Convex_decomposition_3/cd_nested_holes_test.cpp new file mode 100644 index 00000000000..37a3c68264f --- /dev/null +++ b/Convex_decomposition_3/test/Convex_decomposition_3/cd_nested_holes_test.cpp @@ -0,0 +1,53 @@ +#include +#include +#include +#include +#include +#include +#include + +typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; +typedef CGAL::Polyhedron_3 Polyhedron_3; +typedef CGAL::Nef_polyhedron_3 Nef_polyhedron_3; +typedef Nef_polyhedron_3::Volume_const_iterator Volume_const_iterator; + +std::size_t run(std::string path) +{ + Polyhedron_3 input; + std::ifstream(path) >> input; + + Nef_polyhedron_3 N(input); + + CGAL::convex_decomposition_3(N); + std::list convex_parts; + + Volume_const_iterator ci = ++N.volumes_begin(); + for( ; ci != N.volumes_end(); ++ci) { + if(ci->mark()) { + Polyhedron_3 P; + N.convert_inner_shell_to_polyhedron(ci->shells_begin(), P); + convex_parts.push_back(P); + } + } + +// int i=0; + for (const Polyhedron_3& P : convex_parts) + { +// std::ofstream("out_"+std::to_string(i++)+".off") << std::setprecision(17) << P; + assert(P.size_of_vertices()!=0); + } + + return convex_parts.size(); +} + +int main() +{ + std::size_t val = run("data/in1.off"); + assert(val==9); + val = run("data/in2.off"); + assert(val==10); + val = run("data/in3.off"); + assert(val==13); + val = run("data/in4.off"); + assert(val==17); +} diff --git a/Convex_decomposition_3/test/Convex_decomposition_3/data/in1.off b/Convex_decomposition_3/test/Convex_decomposition_3/data/in1.off new file mode 100644 index 00000000000..dabda4d9d3e --- /dev/null +++ b/Convex_decomposition_3/test/Convex_decomposition_3/data/in1.off @@ -0,0 +1,117 @@ +OFF 40 76 0 +5 -5 4 +5 -5 2 +5 5 2 +5 5 4 +5 -5 -2 +5 -5 -4 +5 5 -4 +5 5 -2 +-5 5 4 +-5 -5 4 +-4 -4 4 +-4 4 4 +4 4 4 +4 -4 4 +-5 -5 -4 +-5 5 -4 +-4 4 -4 +-4 -4 -4 +4 -4 -4 +4 4 -4 +-5 5 2 +-5 -5 2 +-5 -5 -2 +-5 5 -2 +4 4 2 +4 -4 2 +4 -4 -2 +4 4 -2 +-4 4 2 +-4 -4 2 +-4 4 -2 +-4 -4 -2 +6 -6 2 +6 -6 -2 +6 6 -2 +6 6 2 +-6 6 2 +-6 -6 2 +-6 -6 -2 +-6 6 -2 +3 0 2 3 +3 2 0 1 +3 4 6 7 +3 6 4 5 +3 3 12 0 +3 3 11 12 +3 11 8 10 +3 8 11 3 +3 13 0 12 +3 10 0 13 +3 10 9 0 +3 9 10 8 +3 5 18 6 +3 5 17 18 +3 17 14 16 +3 14 17 5 +3 19 6 18 +3 16 6 19 +3 16 15 6 +3 15 16 14 +3 21 8 20 +3 8 21 9 +3 14 23 15 +3 23 14 22 +3 2 8 3 +3 8 2 20 +3 6 23 7 +3 23 6 15 +3 21 0 9 +3 0 21 1 +3 14 4 22 +3 4 14 5 +3 25 12 24 +3 12 25 13 +3 18 27 19 +3 27 18 26 +3 10 28 11 +3 28 10 29 +3 31 16 30 +3 16 31 17 +3 28 12 11 +3 12 28 24 +3 16 27 30 +3 27 16 19 +3 25 10 13 +3 10 25 29 +3 18 31 26 +3 31 18 17 +3 32 34 35 +3 34 32 33 +3 35 2 32 +3 35 20 2 +3 20 36 21 +3 36 20 35 +3 1 32 2 +3 21 32 1 +3 21 37 32 +3 37 21 36 +3 28 25 24 +3 25 28 29 +3 33 4 34 +3 33 22 4 +3 22 38 23 +3 38 22 33 +3 7 34 4 +3 23 34 7 +3 23 39 34 +3 39 23 38 +3 31 27 26 +3 27 31 30 +3 38 36 39 +3 36 38 37 +3 34 36 35 +3 36 34 39 +3 38 32 37 +3 32 38 33 diff --git a/Convex_decomposition_3/test/Convex_decomposition_3/data/in2.off b/Convex_decomposition_3/test/Convex_decomposition_3/data/in2.off new file mode 100644 index 00000000000..d09ff781d58 --- /dev/null +++ b/Convex_decomposition_3/test/Convex_decomposition_3/data/in2.off @@ -0,0 +1,144 @@ +OFF +48 92 0 + +2 2 2 +2 -2 2 +-2 2 2 +-2 -2 2 +-2 2 4 +2 2 4 +-2 -2 4 +2 -2 4 +5 -5 4 +-4 4 4 +5 5 4 +4 -4 4 +-5 -5 4 +-4 -4 -4 +5 -5 -4 +4 4 -4 +-5 5 -4 +-5 5 4 +5 5 -4 +-5 -5 -4 +4 4 4 +4 -4 -2 +-4 -4 4 +-4 4 -2 +-4 4 -4 +4 4 -2 +4 -4 -4 +6 -6 2 +5 5 2 +-5 5 2 +6 6 2 +5 -5 2 +-5 -5 2 +-6 -6 2 +5 -5 -2 +-5 -5 -2 +6 -6 -2 +5 5 -2 +-5 5 -2 +-6 6 -2 +-4 -4 -2 +-6 6 2 +6 6 -2 +-6 -6 -2 +-4 -4 2 +-4 4 2 +4 4 2 +4 -4 2 +3 2 4 5 +3 7 6 3 +3 5 7 1 +3 6 7 5 +3 3 6 4 +3 5 0 2 +3 3 1 7 +3 1 0 5 +3 5 4 6 +3 4 2 3 +3 8 28 10 +3 28 8 31 +3 34 18 37 +3 18 34 14 +3 10 20 8 +3 10 9 20 +3 9 17 22 +3 17 9 10 +3 11 8 20 +3 22 8 11 +3 22 12 8 +3 12 22 17 +3 14 26 18 +3 14 13 26 +3 13 19 24 +3 19 13 14 +3 15 18 26 +3 24 18 15 +3 24 16 18 +3 16 24 19 +3 32 17 29 +3 17 32 12 +3 19 38 16 +3 38 19 35 +3 28 17 10 +3 17 28 29 +3 18 38 37 +3 38 18 16 +3 32 8 12 +3 8 32 31 +3 19 34 35 +3 34 19 14 +3 47 20 46 +3 20 47 11 +3 26 25 15 +3 25 26 21 +3 22 45 9 +3 45 22 44 +3 40 24 23 +3 24 40 13 +3 45 20 9 +3 20 45 46 +3 24 25 23 +3 25 24 15 +3 47 22 11 +3 22 47 44 +3 26 40 21 +3 40 26 13 +3 27 42 30 +3 42 27 36 +3 30 28 27 +3 30 29 28 +3 29 41 32 +3 41 29 30 +3 31 27 28 +3 32 27 31 +3 32 33 27 +3 33 32 41 +3 2 0 45 +3 1 44 47 +3 36 34 42 +3 36 35 34 +3 35 43 38 +3 43 35 36 +3 37 42 34 +3 38 42 37 +3 38 39 42 +3 39 38 43 +3 40 25 21 +3 25 40 23 +3 43 41 39 +3 41 43 33 +3 42 41 30 +3 41 42 39 +3 43 27 33 +3 27 43 36 +3 44 1 3 +3 44 3 45 +3 45 3 2 +3 46 45 0 +3 46 0 47 +3 47 0 1 + diff --git a/Convex_decomposition_3/test/Convex_decomposition_3/data/in3.off b/Convex_decomposition_3/test/Convex_decomposition_3/data/in3.off new file mode 100644 index 00000000000..7685150981d --- /dev/null +++ b/Convex_decomposition_3/test/Convex_decomposition_3/data/in3.off @@ -0,0 +1,180 @@ +OFF +60 116 0 + +1 1 4 +1 0.33333333333333337 4 +1 -1 4 +0.33333333333333337 -1 4 +-1 -1 4 +-1 0.33333333333333337 4 +-1 1 4 +0.33333333333333337 1 4 +-2 2 2 +5 -5 4 +-4 4 4 +5 5 4 +4 -4 4 +-5 -5 4 +-4 -4 -4 +5 -5 -4 +4 4 -4 +-5 5 -4 +-5 5 4 +5 5 -4 +-5 -5 -4 +4 4 4 +4 -4 -2 +-4 -4 4 +-4 4 -2 +-4 4 -4 +4 4 -2 +4 -4 -4 +6 -6 2 +5 5 2 +-5 5 2 +6 6 2 +5 -5 2 +-5 -5 2 +-6 -6 2 +5 -5 -2 +-5 -5 -2 +6 -6 -2 +5 5 -2 +-5 5 -2 +-6 6 -2 +-4 -4 -2 +-6 6 2 +6 6 -2 +-6 -6 -2 +-2 -2 2 +-4 -4 2 +-4 4 2 +4 4 2 +4 -4 2 +2 -2 2 +2 2 2 +-2 2 4 +2 2 4 +2 -2 4 +-2 -2 4 +1 1 2 +1 -1 2 +-1 -1 2 +-1 1 2 +3 8 52 53 +3 54 55 45 +3 53 54 50 +3 0 1 53 +3 45 55 52 +3 53 51 8 +3 45 50 54 +3 50 51 53 +3 4 5 55 +3 52 8 45 +3 9 29 11 +3 29 9 32 +3 35 19 38 +3 19 35 15 +3 11 21 9 +3 11 10 21 +3 10 18 23 +3 18 10 11 +3 12 9 21 +3 23 9 12 +3 23 13 9 +3 13 23 18 +3 15 27 19 +3 15 14 27 +3 14 20 25 +3 20 14 15 +3 16 19 27 +3 25 19 16 +3 25 17 19 +3 17 25 20 +3 33 18 30 +3 18 33 13 +3 20 39 17 +3 39 20 36 +3 29 18 11 +3 18 29 30 +3 19 39 38 +3 39 19 17 +3 33 9 13 +3 9 33 32 +3 20 35 36 +3 35 20 15 +3 49 21 48 +3 21 49 12 +3 27 26 16 +3 26 27 22 +3 23 47 10 +3 47 23 46 +3 41 25 24 +3 25 41 14 +3 47 21 10 +3 21 47 48 +3 25 26 24 +3 26 25 16 +3 49 23 12 +3 23 49 46 +3 27 41 22 +3 41 27 14 +3 28 43 31 +3 43 28 37 +3 31 29 28 +3 31 30 29 +3 30 42 33 +3 42 30 31 +3 32 28 29 +3 33 28 32 +3 33 34 28 +3 34 33 42 +3 8 51 47 +3 50 46 49 +3 37 35 43 +3 37 36 35 +3 36 44 39 +3 44 36 37 +3 38 43 35 +3 39 43 38 +3 39 40 43 +3 40 39 44 +3 41 26 22 +3 26 41 24 +3 44 42 40 +3 42 44 34 +3 43 42 31 +3 42 43 40 +3 44 28 34 +3 28 44 37 +3 46 50 45 +3 46 45 47 +3 47 45 8 +3 48 47 51 +3 48 51 49 +3 49 51 50 +3 52 55 5 +3 52 7 53 +3 52 5 6 +3 53 7 0 +3 52 6 7 +3 54 53 1 +3 54 2 3 +3 54 1 2 +3 55 54 3 +3 55 3 4 +3 58 57 56 +3 59 56 7 +3 2 57 3 +3 0 56 1 +3 5 59 6 +3 56 59 58 +3 57 1 56 +3 57 2 1 +3 58 5 4 +3 7 56 0 +3 58 3 57 +3 4 3 58 +3 59 5 58 +3 7 6 59 + diff --git a/Convex_decomposition_3/test/Convex_decomposition_3/data/in4.off b/Convex_decomposition_3/test/Convex_decomposition_3/data/in4.off new file mode 100644 index 00000000000..1a7bbd1ba82 --- /dev/null +++ b/Convex_decomposition_3/test/Convex_decomposition_3/data/in4.off @@ -0,0 +1,180 @@ +OFF +60 116 0 + +1 1 4 +1 0.5 4 +1 -1 4 +0.5 -1 4 +-1 -1 4 +-1 0.5 4 +-1 1 4 +0.5 1 4 +-2 2 2 +5 -5 4 +-4 4 4 +5 5 4 +4 -4 4 +-5 -5 4 +-4 -4 -4 +5 -5 -4 +4 4 -4 +-5 5 -4 +-5 5 4 +5 5 -4 +-5 -5 -4 +4 4 4 +4 -4 -2 +-4 -4 4 +-4 4 -2 +-4 4 -4 +4 4 -2 +4 -4 -4 +6 -6 2 +5 5 2 +-5 5 2 +6 6 2 +5 -5 2 +-5 -5 2 +-6 -6 2 +5 -5 -2 +-5 -5 -2 +6 -6 -2 +5 5 -2 +-5 5 -2 +-6 6 -2 +-4 -4 -2 +-6 6 2 +6 6 -2 +-6 -6 -2 +-2 -2 2 +-4 -4 2 +-4 4 2 +4 4 2 +4 -4 2 +2 -2 2 +2 2 2 +-2 2 4 +2 2 4 +2 -2 4 +-2 -2 4 +1 1 1 +1 -1 1 +-1 -1 1 +-1 1 1 +3 8 52 53 +3 54 55 45 +3 53 54 50 +3 0 1 53 +3 45 55 52 +3 53 51 8 +3 45 50 54 +3 50 51 53 +3 4 5 55 +3 52 8 45 +3 9 29 11 +3 29 9 32 +3 35 19 38 +3 19 35 15 +3 11 21 9 +3 11 10 21 +3 10 18 23 +3 18 10 11 +3 12 9 21 +3 23 9 12 +3 23 13 9 +3 13 23 18 +3 15 27 19 +3 15 14 27 +3 14 20 25 +3 20 14 15 +3 16 19 27 +3 25 19 16 +3 25 17 19 +3 17 25 20 +3 33 18 30 +3 18 33 13 +3 20 39 17 +3 39 20 36 +3 29 18 11 +3 18 29 30 +3 19 39 38 +3 39 19 17 +3 33 9 13 +3 9 33 32 +3 20 35 36 +3 35 20 15 +3 49 21 48 +3 21 49 12 +3 27 26 16 +3 26 27 22 +3 23 47 10 +3 47 23 46 +3 41 25 24 +3 25 41 14 +3 47 21 10 +3 21 47 48 +3 25 26 24 +3 26 25 16 +3 49 23 12 +3 23 49 46 +3 27 41 22 +3 41 27 14 +3 28 43 31 +3 43 28 37 +3 31 29 28 +3 31 30 29 +3 30 42 33 +3 42 30 31 +3 32 28 29 +3 33 28 32 +3 33 34 28 +3 34 33 42 +3 8 51 47 +3 50 46 49 +3 37 35 43 +3 37 36 35 +3 36 44 39 +3 44 36 37 +3 38 43 35 +3 39 43 38 +3 39 40 43 +3 40 39 44 +3 41 26 22 +3 26 41 24 +3 44 42 40 +3 42 44 34 +3 43 42 31 +3 42 43 40 +3 44 28 34 +3 28 44 37 +3 46 50 45 +3 46 45 47 +3 47 45 8 +3 48 47 51 +3 48 51 49 +3 49 51 50 +3 52 55 5 +3 52 7 53 +3 52 5 6 +3 53 7 0 +3 52 6 7 +3 54 53 1 +3 54 2 3 +3 54 1 2 +3 55 54 3 +3 55 3 4 +3 58 57 56 +3 59 56 7 +3 2 57 3 +3 0 56 1 +3 5 59 6 +3 56 59 58 +3 57 1 56 +3 57 2 1 +3 58 5 4 +3 7 56 0 +3 58 3 57 +3 4 3 58 +3 59 5 58 +3 7 6 59 + diff --git a/Documentation/doc/Documentation/Third_party.txt b/Documentation/doc/Documentation/Third_party.txt index d2eeb5d9b7e..e012763b266 100644 --- a/Documentation/doc/Documentation/Third_party.txt +++ b/Documentation/doc/Documentation/Third_party.txt @@ -72,23 +72,32 @@ As there is no canonical directory for where to find \boost on Windows, we recommend that you define the environment variable `BOOST_ROOT` and set it to where you have installed \boost, e.g., `C:\boost\boost_1_70_0`. -\subsection thirdpartyMPFR GNU Multiple Precision Arithmetic (GMP) and GNU Multiple Precision Floating-Point Reliably (MPFR) Libraries -GMP Version 5.0.1 or later, MPFR Version 3.0.0 or later +\subsection thirdpartyMP Multi Precision Number Type Library -The components \cgal, `CGAL_Core`, and `CGAL_Qt6` require -\gmp and \mpfr which are libraries for multi precision integers and rational numbers, -and for multi precision floating point numbers. - -\cgal combines floating point arithmetic with exact arithmetic -in order to be efficient and reliable. \cgal has a built-in -number type for that, but \gmp and \mpfr provide a faster -solution, and we recommend using them. +GNU Multiple Precision Arithmetic (GMP) and GNU Multiple Precision Floating-Point Reliably (MPFR) Libraries +are libraries for multi precision integers and rational numbers, and for multi precision floating point numbers. These libraries can be obtained from `https://gmplib.org/` and `https://www.mpfr.org/`. Since Visual \cpp is not properly supported by the \gmp and \mpfr projects, we provide precompiled versions of \gmp and \mpfr, which can be downloaded from the assets of a release. +Version supported are GMP Version 5.0.1 or later, MPFR Version 3.0.0 or later. + +The \boost library also provides a module for multi precision integers and rational numbers: +\boost multiprecision. +Versions supported are \boost Version 1.72 or later. + +The components \cgal, and `CGAL_Qt6` require either \gmp and \mpfr, or \boost multiprecision +for multi precision numbers. `CGAL_Core` requires \boost multiprecision. + +\cgal combines floating point arithmetic with exact arithmetic +in order to be efficient and reliable. \cgal has a built-in +number type for that, but previous alternatives are faster +solutions, and we recommend using one of them. + +The CMake variable `CGAL_CMAKE_EXACT_NT_BACKEND` can be used to select +the library that will be used internally for multi precision number types. \section secoptional3rdpartysoftware Optional Third Party Libraries diff --git a/Documentation/doc/Documentation/Usage.txt b/Documentation/doc/Documentation/Usage.txt index 68a3ae85001..8547affb691 100644 --- a/Documentation/doc/Documentation/Usage.txt +++ b/Documentation/doc/Documentation/Usage.txt @@ -36,7 +36,7 @@ Using \cgal requires a few core components to be previously installed:
  • a supported compiler (see Section \ref seccompilers),
  • \ref seccmake,
  • \ref thirdpartyBoost,
  • -
  • \ref thirdpartyMPFR.
  • +
  • a \ref thirdpartyMP.
  • Optional third-party software might be required to build examples and demos shipped with \cgal, diff --git a/Documentation/doc/Documentation/windows.txt b/Documentation/doc/Documentation/windows.txt index c7d613e5c3a..b0b8875c2ee 100644 --- a/Documentation/doc/Documentation/windows.txt +++ b/Documentation/doc/Documentation/windows.txt @@ -6,7 +6,7 @@ 15.9, 16.0, 17.0 (\visualstudio 2017, 2019, and 2022). \cgal is a library that has mandatory dependencies that must be first installed: -\ref thirdpartyBoost and \ref thirdpartyMPFR. +\ref thirdpartyBoost and a \ref thirdpartyMP. You have two options to install \cgal and its dependencies: you can either use the *Vcpkg library manager*, which will automatically install an appropriate version of diff --git a/Documentation/doc/biblio/geom.bib b/Documentation/doc/biblio/geom.bib index d6b9488ec1f..ab364082bf8 100644 --- a/Documentation/doc/biblio/geom.bib +++ b/Documentation/doc/biblio/geom.bib @@ -92400,7 +92400,7 @@ some 2 curves cross exponentially many times." @inproceedings{kn-afrmt-97 , author = "Yoshiyuki Kusakari and Takao Nishizeki" -, title = "An Algorithm for Finding a Region with the Minimum Total {$L_1$}-Distance from Prescibed Terminals" +, title = "An Algorithm for Finding a Region with the Minimum Total {$L_1$}-Distance from Prescribed Terminals" , booktitle = "Proc. 8th Annu. Internat. Sympos. Algorithms Comput." , nickname = "ISAAC '97" , site = "Singapore" diff --git a/Generator/include/CGAL/Generator/internal/Generic_random_point_generator.h b/Generator/include/CGAL/Generator/internal/Generic_random_point_generator.h index 958915aa635..2c6bfaf40e6 100644 --- a/Generator/include/CGAL/Generator/internal/Generic_random_point_generator.h +++ b/Generator/include/CGAL/Generator/internal/Generic_random_point_generator.h @@ -105,7 +105,7 @@ void Generic_random_point_generator: ); // generate the points - GeneratorOnObject pointCreator(object_from_id_map(ids[target])); + GeneratorOnObject pointCreator(object_from_id_map(ids[target]), random); this->d_item = *pointCreator; } diff --git a/GraphicsView/include/CGAL/Qt/qglviewer.h b/GraphicsView/include/CGAL/Qt/qglviewer.h index 8ee3b4135f2..e24a5fcd6d7 100644 --- a/GraphicsView/include/CGAL/Qt/qglviewer.h +++ b/GraphicsView/include/CGAL/Qt/qglviewer.h @@ -478,7 +478,6 @@ public: qreal bufferTextureMaxU() const { return bufferTextureMaxU_; } /*! Same as bufferTextureMaxU(), but for the v texture coordinate. */ qreal bufferTextureMaxV() const { return bufferTextureMaxV_; } -#if (QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)) // These methods are part of the QGLWidget public API. // As of version 2.7.0, the use of QOpenGLWidget instead means that they have // to be provided for backward compatibility. @@ -486,7 +485,6 @@ public: const QFont &font = QFont()); void renderText(double x, double y, double z, const QString &str, const QFont &font = QFont()); -#endif public Q_SLOTS: void copyBufferToTexture(GLint, GLenum = GL_NONE); diff --git a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h index 7387b1f4874..01e8a68433d 100644 --- a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h +++ b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h @@ -354,7 +354,6 @@ camera is manipulated) : main drawing method. Should be overloaded. \arg postDraw() : display of visual hints (world axis, FPS...) */ CGAL_INLINE_FUNCTION void CGAL::QGLViewer::paintGL() { - makeCurrent(); // Clears screen, set model view matrix... preDraw(); // Used defined method. Default calls draw() @@ -364,7 +363,6 @@ void CGAL::QGLViewer::paintGL() { draw(); // Add visual hints: axis, camera, grid... postDraw(); - doneCurrent(); Q_EMIT drawFinished(true); } @@ -720,7 +718,6 @@ CGAL_INLINE_FUNCTION void CGAL::QGLViewer::drawLight(GLenum, qreal ) const { } -#if (QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)) CGAL_INLINE_FUNCTION void CGAL::QGLViewer::renderText(int x, int y, const QString &str, const QFont &font) { @@ -742,7 +739,6 @@ void CGAL::QGLViewer::renderText(double x, double y, double z, const QString &st const Vec proj = camera_->projectedCoordinatesOf(Vec(x, y, z)); renderText(int(proj.x), int(proj.y), str, font); } -#endif /*! Draws \p text at position \p x, \p y (expressed in screen coordinates pixels, origin in the upper left corner of the widget). diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index a8ddd38c1a1..d1e95e2a771 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -13,6 +13,8 @@ Release date: June 2024 - LLVM Clang version 15.0.7 or later (on Linux) - Apple Clang compiler versions 10.0.1, 12.0.5, and 15.0.0 (on macOS) - The minimal supported version of Boost is now 1.72.0. +- GMP/MPFR are no longer mandatory to use CGAL, [Boost.Multiprecision](https://www.boost.org/doc/libs/1_72_0/libs/multiprecision/doc/html/index.html). + can be used instead. - The CGAL `Core` library is no longer based on GMP, but on [Boost.Multiprecision](https://www.boost.org/doc/libs/1_72_0/libs/multiprecision/doc/html/index.html). Either GMP backend or Boost backend can be used. @@ -144,10 +146,6 @@ Release date: June 2024 to the [`GenericMap`](https://doc.cgal.org/6.0/Combinatorial_map/classGenericMap.html) concept, which enables users to insert an edge between two different faces in order to create faces with holes. -- Added new meshing criterion `edge_distance`, an upper bound for the distance from the edge to the 1D feature. -- **Breaking change**: the concept `MeshEdgeCriteria_3` was modified to include the new meshing criterion `edge_distance`. - - ### [Quadtrees, Octrees, and Orthtrees](https://doc.cgal.org/6.0/Manual/packages.html#PkgOrthtree) - **Breaking change**: @@ -225,6 +223,9 @@ Release date: June 2024 as well as the class `Triangle_accessor`. These were no longer used for several releases. - **Breaking change**: Removed the class templates `CGAL::Gray_image_mesh_domain_3`, `CGAL::Implicit_mesh_domain_3`, and `CGAL::Labeled_image_mesh_domain_3`, which were deprecated since CGAL-4.13. +- Added new meshing criterion `edge_distance`, an upper bound for the distance from the edge to the 1D feature. +- **Breaking change**: the concept `MeshEdgeCriteria_3` was modified to include the new meshing criterion `edge_distance`. + ### [3D Surface Mesh Generation](https://doc.cgal.org/6.0/Manual/packages.html#PkgSurfaceMesher3) diff --git a/Installation/REUSE.toml b/Installation/REUSE.toml index 4ceda7b2279..34a4baee435 100644 --- a/Installation/REUSE.toml +++ b/Installation/REUSE.toml @@ -4,13 +4,44 @@ SPDX-PackageSupplier = "CGAL Editorial Board " SPDX-PackageDownloadLocation = "https://github.com/CGAL/cgal" [[annotations]] -path = ["**.cmake", "**.md", "doc/**", "doc_html/**", "scripts/**", "developer_scripts/**", "package_info/**", "demo/**", "examples/**", "src/**", "test/**", "benchmarks/**", "benchmark/**", "data/**", "cmake/**"] +path = [ + "**.cmake", + "**.md", + "doc/**", + "doc_html/**", + "scripts/**", + "developer_scripts/**", + "package_info/**", + "demo/**", + "examples/**", + "src/**", + "test/**", + "benchmarks/**", + "benchmark/**", + "data/**", + "cmake/**", + "**/*.natvis", +] precedence = "aggregate" SPDX-FileCopyrightText = "1995-2024 The CGAL Project" SPDX-License-Identifier = "CC0-1.0" [[annotations]] -path = ["REUSE.toml", "lib/cmake/CGAL/CGALConfig-installation-dirs.cmake.in", "include/CGAL/Qt/ImageInterface.ui", "include/CGAL/Qt/resources/qglviewer-icon.xpm", "AUTHORS", "CMakeLists.txt", "README", "auxiliary/cgal_create_cmake_script.1", "auxiliary/gmp/README", "include/CGAL/license/gpl_package_list.txt", "auxiliary/cgal_app.icns", "copyright", "VERSION"] +path = [ + "REUSE.toml", + "lib/cmake/CGAL/CGALConfig-installation-dirs.cmake.in", + "include/CGAL/Qt/ImageInterface.ui", + "include/CGAL/Qt/resources/qglviewer-icon.xpm", + "AUTHORS", + "CMakeLists.txt", + "README", + "auxiliary/cgal_create_cmake_script.1", + "auxiliary/gmp/README", + "include/CGAL/license/gpl_package_list.txt", + "auxiliary/cgal_app.icns", + "copyright", + "VERSION", +] precedence = "aggregate" SPDX-FileCopyrightText = "1995-2024 The CGAL Project" SPDX-License-Identifier = "CC0-1.0" diff --git a/Installation/cmake/modules/CGAL_LASLIB_support.cmake b/Installation/cmake/modules/CGAL_LASLIB_support.cmake index 7c65da9ebf0..e471c93f02b 100644 --- a/Installation/cmake/modules/CGAL_LASLIB_support.cmake +++ b/Installation/cmake/modules/CGAL_LASLIB_support.cmake @@ -1,8 +1,19 @@ -if(LASLIB_FOUND AND NOT TARGET CGAL::LASLIB_support) - add_library(CGAL::LASLIB_support INTERFACE IMPORTED) - set_target_properties(CGAL::LASLIB_support PROPERTIES - INTERFACE_COMPILE_DEFINITIONS "CGAL_LINKED_WITH_LASLIB" - INTERFACE_INCLUDE_DIRECTORIES "${LASLIB_INCLUDE_DIR};${LASZIP_INCLUDE_DIR}" - INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${LASLIB_INCLUDE_DIR};${LASZIP_INCLUDE_DIR}" - INTERFACE_LINK_LIBRARIES "${LASLIB_LIBRARIES}") +if(LASLIB_FOUND) + if (NOT TARGET CGAL::LASLIB_support) + if (NOT TARGET LASlib) + # message(STATUS "Found using MODULE mode") + add_library(CGAL::LASLIB_support INTERFACE IMPORTED) + set_target_properties(CGAL::LASLIB_support PROPERTIES + INTERFACE_COMPILE_DEFINITIONS "CGAL_LINKED_WITH_LASLIB" + INTERFACE_INCLUDE_DIRECTORIES "${LASLIB_INCLUDE_DIR}" + INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${LASLIB_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "${LASLIB_LIBRARIES}") + else() + # message(STATUS "Found using CONFIG mode") + add_library(CGAL::LASLIB_support INTERFACE IMPORTED) + set_target_properties(CGAL::LASLIB_support PROPERTIES + INTERFACE_COMPILE_DEFINITIONS "CGAL_LINKED_WITH_LASLIB") + target_link_libraries(CGAL::LASLIB_support INTERFACE LASlib) + endif() + endif() endif() diff --git a/Installation/cmake/modules/FindLASLIB.cmake b/Installation/cmake/modules/FindLASLIB.cmake index 2353480c245..76c090e7edd 100644 --- a/Installation/cmake/modules/FindLASLIB.cmake +++ b/Installation/cmake/modules/FindLASLIB.cmake @@ -9,14 +9,16 @@ # first look in user defined locations find_path(LASLIB_INCLUDE_DIR NAMES lasreader.hpp - PATHS /usr/local/include/LASlib/ + PATHS /usr/local/include/LASlib/ ENV LASLIB_INC_DIR ) - + find_path(LASZIP_INCLUDE_DIR NAMES mydefs.hpp PATHS /usr/local/include/LASzip/ ${LASLIB_INCLUDE_DIR}/../../LASzip/src + ${LASLIB_INCLUDE_DIR}/../LASzip + ${LASLIB_INCLUDE_DIR} ) find_library(LASLIB_LIBRARIES @@ -27,9 +29,22 @@ find_library(LASLIB_LIBRARIES ${LASLIB_INCLUDE_DIR}/../../lib ENV LASLIB_LIB_DIR ) +if (NOT LASLIB_LIBRARIES) + #library was renamed in recent versions of LAStools + find_library(LASLIB_LIBRARIES + NAMES LASlib + PATHS ENV LD_LIBRARY_PATH + ENV LIBRARY_PATH + /usr/local/lib + ${LASLIB_INCLUDE_DIR}/../../lib + ENV LASLIB_LIB_DIR + ) +endif() -if(LASLIB_LIBRARIES AND LASLIB_INCLUDE_DIR) +if(LASLIB_LIBRARIES AND LASLIB_INCLUDE_DIR AND LASZIP_INCLUDE_DIR) + if (NOT ${LASLIB_INCLUDE_DIR} STREQUAL ${LASZIP_INCLUDE_DIR}) + list(APPEND LASLIB_INCLUDE_DIR ${LASZIP_INCLUDE_DIR}) + endif() set(LASLIB_FOUND TRUE) set(LASLIB_USE_FILE "UseLASLIB") endif() - diff --git a/Installation/cmake/modules/UseLASLIB.cmake b/Installation/cmake/modules/UseLASLIB.cmake index 1af7a023ceb..f1ffb0bd906 100644 --- a/Installation/cmake/modules/UseLASLIB.cmake +++ b/Installation/cmake/modules/UseLASLIB.cmake @@ -3,4 +3,4 @@ add_definitions(-DCGAL_LINKED_WITH_LASLIB) -message(DEPRECATION "This file UseLASLIB.cmake is deprecated, and the imported target `CGAL::TBB_support` from CGAL_LASLIB_support.cmake should be used instead.") +message(DEPRECATION "This file UseLASLIB.cmake is deprecated, and the imported target `CGAL::LASLIB_support` from CGAL_LASLIB_support.cmake should be used instead.") diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Ray_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Ray_3_do_intersect.h index f4aa1e8e37c..1cafde62ad3 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Ray_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Ray_3_do_intersect.h @@ -38,11 +38,8 @@ do_intersect(const typename K::Line_3& l, if(p0p1s == COLLINEAR) return true; - CGAL::Orientation stp0 = pred(r.source(), r.second_point(), l.point(0)); - if(stp0 == COLLINEAR) - return Ray_3_has_on_collinear_Point_3(r,l.point(0),k); - - return (p0p1s != stp0); + typename K::Point_3 lst = l.point(0) + (r.point(1) - r.point(0)); + return (pred(l.point(0), l.point(1), r.point(0), lst) != CGAL::POSITIVE); } template diff --git a/Intersections_3/test/Intersections_3/test_intersections_Line_3.cpp b/Intersections_3/test/Intersections_3/test_intersections_Line_3.cpp index 6fe55a40654..936e077e018 100644 --- a/Intersections_3/test/Intersections_3/test_intersections_Line_3.cpp +++ b/Intersections_3/test/Intersections_3/test_intersections_Line_3.cpp @@ -232,6 +232,10 @@ public: check_no_intersection(L(p(0,0,0),p(1,0,0)), R(p(3,0,1),p(6,0,1))); check_no_intersection(L(p(0,0,0),p(1,0,0)), R(p(0,2,0),p(0,4,0))); check_no_intersection(L(p(0,0,0),p(1,0,0)), R(p(6,2,0),p(5,4,0))); + check_no_intersection(L(p(0,0,0),p(0,1,0)), R(p(1,-1,0),p(1,0,0))); + check_no_intersection(L(p(0,-10,0),p(0,-9,0)), R(p(1,-1,0),p(2,0,0))); + check_no_intersection(L(p(0,-10,0),p(0,0,0)), R(p(1,-1,0),p(2,0,0))); + check_no_intersection(L(p(0,0,0),p(0,1,0)), R(p(1,-1,0),p(2,0,0))); // Point intersection check_intersection (L(p(0,0,0),p(1,0,0)), R(p(3,0,0),p(6,4,0)), diff --git a/Intersections_3/test/Intersections_3/test_intersections_Ray_3.cpp b/Intersections_3/test/Intersections_3/test_intersections_Ray_3.cpp index e1d603d4a5e..1ce4ab53642 100644 --- a/Intersections_3/test/Intersections_3/test_intersections_Ray_3.cpp +++ b/Intersections_3/test/Intersections_3/test_intersections_Ray_3.cpp @@ -74,6 +74,14 @@ public: check_no_intersection (R(p(0,0,0), p(1,0,0)), R(p(0,1,0), p(0,2,0))); check_no_intersection (R(p(0,0,0), p(1,0,0)), R(p(-1,0,0), p(-1,-1,0))); + check_no_intersection (R(p(1,-1,0), p(2,0,0)), R(p(2,-1,0), p(3,0,0))); + check_no_intersection (R(p(1,-1,0), p(2,0,0)), R(p(2,-1,0), p(3,-1,0))); + check_no_intersection (R(p(1,-1,0), p(2,0,0)), R(p(2,-1,0), p(3,-2,0))); + check_no_intersection (R(p(0,0,0), p(0,1,0)), R(p(0,-1,0), p(1,-1,0))); + check_no_intersection (R(p(0,0,0), p(0,1,0)), R(p(-1,-3,0),p(2,0,0))); + check_no_intersection (R(p(0,0,0), p(0,1,0)), R(p(-2,-4,0),p(-1,-3,0))); + check_no_intersection (R(p(0,0,0), p(0,1,0)), R(p(1,-1,0), p(2,0,0))); + // Point check_intersection (R(p(0,0,0), p(1,0,0)), R(p(0,0,0), p(-1,0,0)), p(0,0,0)); @@ -88,6 +96,10 @@ public: check_intersection (R(p(0,0,0), p(1,0,0)), R(p(1,-2,0), p(1,-1,0)), p(1,0,0)); + check_intersection (R(p(0,0,0), p(1,0,0)), R(p(1,-2,0), p(1,-1,0)), + p(1,0,0)); + + // Segment check_intersection (R(p(0,0,0), p(1,0,0)), R(p(2,0,0), p(-3,0,0)), S(p(0,0,0), p(2,0,0)), false); @@ -161,6 +173,8 @@ public: for(int i=0; i= QT_VERSION_CHECK(5, 3, 0)) + // for windows QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL); -#endif return i; } diff --git a/Lab/demo/Lab/MainWindow.cpp b/Lab/demo/Lab/MainWindow.cpp index 2269b4a2839..dd133dbf44f 100644 --- a/Lab/demo/Lab/MainWindow.cpp +++ b/Lab/demo/Lab/MainWindow.cpp @@ -663,15 +663,7 @@ void MainWindow::loadPlugins() } } QString env_path = qgetenv("LAB_DEMO_PLUGINS_PATH"); -#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) QChar separator = QDir::listSeparator(); -#else -#if defined(_WIN32) - QChar separator = ';'; -#else - QChar separator = ':'; -#endif -#endif if(!env_path.isEmpty()) { #if defined(_WIN32) QString path = qgetenv("PATH"); @@ -2652,17 +2644,10 @@ void MainWindow::resetHeader() sceneView->header()->setSectionResizeMode(Scene::RenderingModeColumn, QHeaderView::ResizeToContents); sceneView->header()->setSectionResizeMode(Scene::ABColumn, QHeaderView::Fixed); sceneView->header()->setSectionResizeMode(Scene::VisibleColumn, QHeaderView::Fixed); -#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) sceneView->header()->resizeSection(Scene::ColorColumn, sceneView->header()->fontMetrics().horizontalAdvance("_#_")); sceneView->resizeColumnToContents(Scene::RenderingModeColumn); sceneView->header()->resizeSection(Scene::ABColumn, sceneView->header()->fontMetrics().horizontalAdvance(QString("_AB_"))); sceneView->header()->resizeSection(Scene::VisibleColumn, sceneView->header()->fontMetrics().horizontalAdvance(QString("_View_"))); -#else - sceneView->header()->resizeSection(Scene::ColorColumn, sceneView->header()->fontMetrics().width("_#_")); - sceneView->resizeColumnToContents(Scene::RenderingModeColumn); - sceneView->header()->resizeSection(Scene::ABColumn, sceneView->header()->fontMetrics().width(QString("_AB_"))); - sceneView->header()->resizeSection(Scene::VisibleColumn, sceneView->header()->fontMetrics().width(QString("_View_"))); -#endif } void MainWindow::reset_default_loaders() diff --git a/Lab/demo/Lab/Plugins/Mesh_3/Io_image_plugin.cpp b/Lab/demo/Lab/Plugins/Mesh_3/Io_image_plugin.cpp index 4720d8aa35b..780511846aa 100644 --- a/Lab/demo/Lab/Plugins/Mesh_3/Io_image_plugin.cpp +++ b/Lab/demo/Lab/Plugins/Mesh_3/Io_image_plugin.cpp @@ -705,11 +705,7 @@ private: // Find the right width for the label to accommodate at least 9999 QFontMetrics metric = x_cubeLabel->fontMetrics(); -#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) x_cubeLabel->setFixedWidth(metric.horizontalAdvance(QString(".9999."))); -#else - x_cubeLabel->setFixedWidth(metric.width(QString(".9999."))); -#endif x_cubeLabel->setText("0"); x_cubeLabel->setValidator(validator); @@ -735,11 +731,7 @@ private: // Find the right width for the label to accommodate at least 9999 QFontMetrics metric = y_cubeLabel->fontMetrics(); -#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) y_cubeLabel->setFixedWidth(metric.horizontalAdvance(QString(".9999."))); -#else - y_cubeLabel->setFixedWidth(metric.width(QString(".9999."))); -#endif y_cubeLabel->setText("0"); y_cubeLabel->setValidator(validator); y_slider = new QSlider(mw); @@ -764,11 +756,7 @@ private: // Find the right width for the label to accommodate at least 9999 QFontMetrics metric = z_cubeLabel->fontMetrics(); -#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) z_cubeLabel->setFixedWidth(metric.horizontalAdvance(QString(".9999."))); -#else - z_cubeLabel->setFixedWidth(metric.width(QString(".9999."))); -#endif z_cubeLabel->setText("0"); z_cubeLabel->setValidator(validator); z_slider = new QSlider(mw); diff --git a/Lab/demo/Lab/Plugins/Mesh_3/Mesh_3_plugin.cpp b/Lab/demo/Lab/Plugins/Mesh_3/Mesh_3_plugin.cpp index d84bd9fc6f6..2aadc761957 100644 --- a/Lab/demo/Lab/Plugins/Mesh_3/Mesh_3_plugin.cpp +++ b/Lab/demo/Lab/Plugins/Mesh_3/Mesh_3_plugin.cpp @@ -750,7 +750,9 @@ void Mesh_3_plugin::mesh_3(const Mesh_type mesh_type, } } - if(mesh_type != Mesh_type::SURFACE_ONLY && !material_ids_valid) + if(mesh_type != Mesh_type::SURFACE_ONLY + && !material_ids_valid + && bounding_sm_item != nullptr) { sm_items.removeAll(make_not_null(bounding_sm_item)); } diff --git a/Lab/demo/Lab/Plugins/Mesh_3/Mesh_function.h b/Lab/demo/Lab/Plugins/Mesh_3/Mesh_function.h index 68c8300f9ee..ec38a369ea0 100644 --- a/Lab/demo/Lab/Plugins/Mesh_3/Mesh_function.h +++ b/Lab/demo/Lab/Plugins/Mesh_3/Mesh_function.h @@ -171,8 +171,10 @@ log() const .arg(detect_connected_components); res << QString("use weights: %1").arg(weights_ptr != nullptr); } - res << QString("use aabb tree: %1").arg(use_sizing_field_with_aabb_tree); - res << QString("manifold: %1").arg(manifold); + if(use_sizing_field_with_aabb_tree) + res << QString("use sizing field with aabb tree: %1").arg(use_sizing_field_with_aabb_tree); + if(manifold) + res << QString("manifold: %1").arg(manifold); return res; } diff --git a/Lab/demo/Lab/Plugins/PMP/Engrave_text_plugin.cpp b/Lab/demo/Lab/Plugins/PMP/Engrave_text_plugin.cpp index 27a3ba46f0d..1adc2ae81ea 100644 --- a/Lab/demo/Lab/Plugins/PMP/Engrave_text_plugin.cpp +++ b/Lab/demo/Lab/Plugins/PMP/Engrave_text_plugin.cpp @@ -250,11 +250,7 @@ protected: } case QEvent::Wheel: { QWheelEvent* event = static_cast(ev); -#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) - QPoint pos = event->pos(); -#else QPointF pos = event->position(); -#endif QPointF old_pos = v->mapToScene(pos.x(), pos.y()); if(event->angleDelta().y() <0) v->scale(1.2, 1.2); diff --git a/Lab/demo/Lab/Plugins/Surface_mesh/Parameterization_plugin.cpp b/Lab/demo/Lab/Plugins/Surface_mesh/Parameterization_plugin.cpp index d9ec9149133..38d593c2b40 100644 --- a/Lab/demo/Lab/Plugins/Surface_mesh/Parameterization_plugin.cpp +++ b/Lab/demo/Lab/Plugins/Surface_mesh/Parameterization_plugin.cpp @@ -142,11 +142,7 @@ protected: } case QEvent::Wheel: { QWheelEvent* event = static_cast(ev); -#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) - QPoint pos = event->pos(); -#else QPointF pos = event->position(); -#endif QPointF old_pos = v->mapToScene(pos.x(), pos.y()); if(event->angleDelta().y() <0) v->scale(1.2, 1.2); diff --git a/Lab/demo/Lab/Viewer.cpp b/Lab/demo/Lab/Viewer.cpp index 70c2b60e838..b93cb2cb7b1 100644 --- a/Lab/demo/Lab/Viewer.cpp +++ b/Lab/demo/Lab/Viewer.cpp @@ -1152,13 +1152,7 @@ void Viewer::drawVisualHints() //Prints the displayMessage QFont font = QFont(); QFontMetrics fm(font); - TextItem *message_text = new TextItem(float(10 + - #if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) - fm.horizontalAdvance(d->message)/2) - #else - fm.width(d->message)/2) - #endif - , + TextItem *message_text = new TextItem(float(10 + fm.horizontalAdvance(d->message)/2), float(height()-20), 0, d->message, false, QFont(), Qt::gray ); diff --git a/Maintenance/infrastructure/cgal.geometryfactory.com/bin/cgal_release.py b/Maintenance/infrastructure/cgal.geometryfactory.com/bin/cgal_release.py index a835da2c812..daa87aa614a 100644 --- a/Maintenance/infrastructure/cgal.geometryfactory.com/bin/cgal_release.py +++ b/Maintenance/infrastructure/cgal.geometryfactory.com/bin/cgal_release.py @@ -19,7 +19,7 @@ class Release: """return the command to create and publish the release""" return ( f"PATH=/home/lrineau/bin-cmake3:/bin:/usr/bin:/home/lrineau/bin; cd {self.cwd} &&" - + " /usr/bin/time scl enable rh-git29 -- " + + " /usr/bin/time -v bash -x " + f"$HOME/bin/create_release {self.repo}{self.extra_options} --do-it" ) diff --git a/Maintenance/infrastructure/cgal.geometryfactory.com/bin/create_internal_release_of_the_day.py b/Maintenance/infrastructure/cgal.geometryfactory.com/bin/create_internal_release_of_the_day.py index f2a97610321..ab1b640f42a 100644 --- a/Maintenance/infrastructure/cgal.geometryfactory.com/bin/create_internal_release_of_the_day.py +++ b/Maintenance/infrastructure/cgal.geometryfactory.com/bin/create_internal_release_of_the_day.py @@ -13,8 +13,8 @@ from cgal_release import release, integration, master, beta_release, master, bet # Define a dictionary that maps day of the week to an action actions = { "Monday": integration, - "Tuesday": integration, - "Wednesday": integration, + "Tuesday": release("5.5"), #integration, + "Wednesday": release("5.6"), #integration, "Thursday": integration, "Friday": release("5.5"), "Saturday": release("5.6"), diff --git a/Maintenance/test_handling/create_testresult_page b/Maintenance/test_handling/create_testresult_page index ca62a592828..a2825253e70 100755 --- a/Maintenance/test_handling/create_testresult_page +++ b/Maintenance/test_handling/create_testresult_page @@ -103,13 +103,13 @@ sub write_select() print OUTPUTV '\n"; my %results; foreach $_ (glob("results-*.shtml")) { - my $ctime = (stat($_))[10]; - $results{$_} = $ctime; + my $mtime = (stat($_))[9]; + $results{$_} = $mtime; } foreach $_ (sort { $results{$b} <=> $results{$a} } keys %results) { $_ =~ /results-${pattern}(\.\d+)?(-.*|)\.shtml/ || next; - my $ctime = (stat($_))[10]; - my $date = time2str('%a %Y/%m/%d', $ctime); + my $mtime = (stat($_))[9]; + my $date = time2str('%a %Y/%m/%d', $mtime); print OUTPUTV '\n", $filename, $date; diff --git a/Maintenance/test_handling/to_zipped_format b/Maintenance/test_handling/to_zipped_format index fdf62712b02..9131d100065 100755 --- a/Maintenance/test_handling/to_zipped_format +++ b/Maintenance/test_handling/to_zipped_format @@ -117,7 +117,7 @@ sub reformat_results($) # if (/BOOST_BIMAP_VERSION = '([^']+)'/) { # $BOOST="$BOOST+bimap"; # } - if (/USING +CXXFLAGS = '([^']*)'/) { + if (/USING +CXXFLAGS = '([^']*)'/ && !$CXXFLAGS) { $CXXFLAGS="$CXXFLAGS $1"; } if (/USING +LDFLAGS = '([^']*)'/) { diff --git a/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h b/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h index 4a0e3f131de..e84e7dd933f 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h +++ b/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h @@ -152,7 +152,7 @@ public: Protect_edges_sizing_field(C3T3& c3t3, const MeshDomain& domain, SizingFunction size=SizingFunction(), - const FT minimal_size = FT(-1), + const FT minimal_size = FT(0), const Distance_Function edge_distance = Distance_Function(), const std::size_t maximal_number_of_vertices = 0, Mesh_error_code* error_code = 0 @@ -273,8 +273,7 @@ private: /// Returns `true` if the edge `(va,vb)` is a not good enough approximation /// of its feature. - bool approx_is_too_large(const Vertex_handle& va, - const Vertex_handle& vb, + bool approx_is_too_large(const Edge& e, const bool is_edge_in_complex) const; /// Returns `true` if the balls of `va` and `vb` intersect. @@ -458,10 +457,12 @@ private: dim = -1 - dim; const FT s = field(p, dim, index); - if(s <= FT(0)) { + if(s < minimal_size_) + { std::stringstream msg; msg.precision(17); - msg << "Error: the field is null at "; + msg << "Error: the field is smaller than minimal size (" + << minimal_size_ << ") at "; if(dim == 0) msg << "corner ("; else msg << "point ("; msg << p << ")"; @@ -493,7 +494,7 @@ private: bool use_minimal_size() const { - return minimal_size_ != FT(-1); + return minimal_size_ != FT(0); } Weight minimal_weight() const { @@ -645,7 +646,10 @@ insert_corners() #endif // Get weight (the ball radius is given by the 'query_size' function) - FT w = CGAL::square(query_size(p, 0, p_index)); + const FT query_weight = CGAL::square(query_size(p, 0, p_index)); + FT w = use_minimal_size() + ? (std::min)(minimal_weight_, query_weight) + : query_weight; #if CGAL_MESH_3_PROTECTION_DEBUG & 1 std::cerr << "Weight from sizing field: " << w << std::endl; @@ -716,7 +720,10 @@ insert_point(const Bare_point& p, const Weight& w, int dim, const Index& index, typename GT::Construct_weighted_point_3 cwp = c3t3_.triangulation().geom_traits().construct_weighted_point_3_object(); - const Weighted_point wp = cwp(p,w*weight_modifier); + const FT wwm = use_minimal_size() + ? (std::max)(w * weight_modifier, minimal_weight()) + : w * weight_modifier; + const Weighted_point wp = cwp(p, wwm); typename Tr::Locate_type lt; int li, lj; @@ -734,7 +741,7 @@ insert_point(const Bare_point& p, const Weight& w, int dim, const Index& index, std::cerr << "SPECIAL "; std::cerr << "protecting ball "; if(v == Vertex_handle()) - std::cerr << cwp(p,w*weight_modifier); + std::cerr << cwp(p, wwm); else std::cerr << disp_vert(v); @@ -860,13 +867,11 @@ smart_insert_point(const Bare_point& p, Weight w, int dim, const Index& index, std::back_inserter(cells_in_conflicts), CGAL::Emptyset_iterator()); - for(typename std::vector::const_iterator - it = cells_in_conflicts.begin(), - end = cells_in_conflicts.end(); it != end; ++it) + for(Cell_handle cit : cells_in_conflicts) { for(int i=0, d=tr.dimension(); i<=d; ++i) { - const Vertex_handle v = (*it)->vertex(i); + const Vertex_handle v = cit->vertex(i); if(c3t3_.triangulation().is_infinite(v)) continue; if(!vertices_in_conflict_zone_set.insert(v).second) @@ -1023,21 +1028,20 @@ insert_balls_on_edges() domain_.get_curves(std::back_inserter(input_features)); // Iterate on edges - for ( typename Input_features::iterator fit = input_features.begin(), - end = input_features.end() ; fit != end ; ++fit ) + for (const Feature_tuple& ft : input_features) { if(forced_stop()) break; - const Curve_index& curve_index = std::get<0>(*fit); + const Curve_index& curve_index = std::get<0>(ft); if ( ! is_treated(curve_index) ) { #if CGAL_MESH_3_PROTECTION_DEBUG & 1 std::cerr << "\n** treat curve #" << curve_index << std::endl; #endif - const Bare_point& p = std::get<1>(*fit).first; - const Bare_point& q = std::get<2>(*fit).first; + const Bare_point& p = std::get<1>(ft).first; + const Bare_point& q = std::get<2>(ft).first; - const Index& p_index = std::get<1>(*fit).second; - const Index& q_index = std::get<2>(*fit).second; + const Index& p_index = std::get<1>(ft).second; + const Index& q_index = std::get<2>(ft).second; Vertex_handle vp,vq; if ( ! domain_.is_loop(curve_index) ) @@ -1178,12 +1182,12 @@ insert_balls(const Vertex_handle& vp, const Weighted_point& vp_wp = c3t3_.triangulation().point(vp); #if ! defined(CGAL_NO_PRECONDITIONS) - if(sp <= 0) { - std::stringstream msg;; + if(sp < minimal_size_) { + std::stringstream msg; msg.precision(17); - msg << "Error: the mesh sizing field is null at point ("; - msg << cp(vp_wp) << ")!"; - CGAL_precondition_msg(sp > 0, msg.str().c_str()); + msg << "Error: the mesh sizing field is smaller than minimal size "; + msg << " at point (" << cp(vp_wp) << ")!"; + CGAL_precondition_msg(sp > minimal_size_, msg.str().c_str()); } #endif // ! CGAL_NO_PRECONDITIONS @@ -1428,7 +1432,7 @@ refine_balls() if( // topology condition non_adjacent_but_intersect(va, vb, is_edge_in_complex) // approximation condition - || (use_distance_field() && approx_is_too_large(va, vb, is_edge_in_complex))) + || (use_distance_field() && approx_is_too_large(*eit, is_edge_in_complex))) { using CGAL::Mesh_3::internal::distance_divisor; @@ -1480,14 +1484,11 @@ refine_balls() new_sizes.clear(); // Update size of balls - for ( typename std::vector >::iterator - it = new_sizes_copy.begin(), - end = new_sizes_copy.end(); - it != end ; ++it ) + for (const std::pair& it : new_sizes_copy) { if(forced_stop()) break; - const Vertex_handle v = it->first; - const FT new_size = it->second; + const Vertex_handle v = it.first; + const FT new_size = it.second; // Set size of the ball to new value if(use_minimal_size() && new_size < minimal_size_) { if(!is_special(v)) { @@ -1557,34 +1558,27 @@ do_balls_intersect(const Vertex_handle& va, const Vertex_handle& vb) const template bool Protect_edges_sizing_field:: -approx_is_too_large(const Vertex_handle& va, const Vertex_handle& vb, const bool is_edge_in_complex) const +approx_is_too_large(const Edge& e, const bool is_edge_in_complex) const { if ( ! is_edge_in_complex ) - { return false; - } - typedef typename Kernel::Point_3 Point_3; - Curve_index curve_index = domain_.curve_index((va->in_dimension() < vb->in_dimension()) ? vb->index() : va->index()); + const Bare_point& pa = e.first->vertex(e.second)->point().point(); + const Bare_point& pb = e.first->vertex(e.third)->point().point(); - const Point_3& pa = va->point().point(); - const Point_3& pb = vb->point().point(); - const Point_3& segment_middle = CGAL::midpoint(pa, pb); - // Obtain the geodesic middle point - FT signed_geodesic_distance = domain_.signed_geodesic_distance(pa, pb, curve_index); - Point_3 geodesic_middle; - if (signed_geodesic_distance >= FT(0)) - { - geodesic_middle = domain_.construct_point_on_curve(pa, curve_index, signed_geodesic_distance / 2); - } - else - { - geodesic_middle = domain_.construct_point_on_curve(pb, curve_index, -signed_geodesic_distance / 2); - } - // Compare distance to the parameter's distance - FT squared_evaluated_distance = CGAL::squared_distance(segment_middle, geodesic_middle); - FT segment_middle_edge_distance = query_distance(segment_middle, 1, curve_index); - return squared_evaluated_distance > CGAL::square(segment_middle_edge_distance); + // Construct the geodesic middle point + const Curve_index curve_index = c3t3_.curve_index(e); + const FT signed_geodesic_distance = domain_.signed_geodesic_distance(pa, pb, curve_index); + const Bare_point geodesic_middle = (signed_geodesic_distance >= FT(0)) + ? domain_.construct_point_on_curve(pa, curve_index, signed_geodesic_distance / 2) + : domain_.construct_point_on_curve(pb, curve_index, -signed_geodesic_distance / 2); + + const Bare_point edge_middle = CGAL::midpoint(pa, pb); + const FT squared_evaluated_distance = CGAL::squared_distance(edge_middle, geodesic_middle); + + // Compare distance to the distance field from criteria + const FT max_distance_to_curve = query_distance(edge_middle, 1, curve_index); + return squared_evaluated_distance > CGAL::square(max_distance_to_curve); } template diff --git a/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h b/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h index 61eb0682d83..ddb1ba1109f 100644 --- a/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h +++ b/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h @@ -252,8 +252,8 @@ public: : (- negative_distance); } else { return (pit <= qit) - ? curve_segment_length(p, q, CGAL::POSITIVE) - : ( - curve_segment_length(p, q, CGAL::NEGATIVE) ); + ? curve_segment_length(p, q, CGAL::POSITIVE, pit, qit) + : ( - curve_segment_length(p, q, CGAL::NEGATIVE, pit, qit) ); } } diff --git a/Mesh_3/include/CGAL/Mesh_edge_criteria_3.h b/Mesh_3/include/CGAL/Mesh_edge_criteria_3.h index 8d6215cd512..f743eb3f0fa 100644 --- a/Mesh_3/include/CGAL/Mesh_edge_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_edge_criteria_3.h @@ -177,7 +177,13 @@ public: /// Returns size of tuple (p,dim,index) FT sizing_field(const Point_3& p, const int dim, const Index& index) const - { return (*p_size_)(p,dim,index); } + { + const FT s = (*p_size_)(p, dim, index); + if (min_length_bound_ == FT(0)) + return s; + else + return (std::max)(s, min_length_bound_); + } FT distance_field(const Point_3& p, const int dim, const Index& index) const { diff --git a/Nef_3/include/CGAL/Nef_polyhedron_3.h b/Nef_3/include/CGAL/Nef_polyhedron_3.h index 74bb56ba885..bb41e3417a3 100644 --- a/Nef_3/include/CGAL/Nef_polyhedron_3.h +++ b/Nef_3/include/CGAL/Nef_polyhedron_3.h @@ -901,10 +901,11 @@ protected: Unique_hash_map& omit_vertex; int nov, nof; + bool hh; public: Find_holes(Unique_hash_map& omit_vertex_) - : omit_vertex(omit_vertex_), nov(0), nof(0) {} + : omit_vertex(omit_vertex_), nov(0), nof(0), hh(false) {} void visit(Halffacet_const_handle f) { ++nof; @@ -917,10 +918,11 @@ protected: CGAL_For_all(sfc, send) { omit_vertex[sfc->source()->source()] = true; --nov; + hh=true; } } else if(fc.is_shalfloop()) { SHalfloop_const_handle sl(fc); - omit_vertex[sl->incident_sface()->center_vertex()]; + omit_vertex[sl->incident_sface()->center_vertex()] = true; --nov; } else CGAL_error_msg( "wrong handle type"); @@ -940,6 +942,63 @@ protected: int number_of_facets() const { return nof; } + + bool holes_detected() const { + return hh; + } + }; + + class Nested_holes { + + Unique_hash_map& omit_vertex; + int norv, nof; + + public: + Nested_holes(Unique_hash_map& omit_vertex_) + : omit_vertex(omit_vertex_), norv(0), nof(0) {} + + void visit(Halffacet_const_handle f) { + Halffacet_cycle_const_iterator fc = f->facet_cycles_begin(); + CGAL_assertion(fc.is_shalfedge()); + + SHalfedge_around_facet_const_circulator sfc(fc), send(sfc); + bool all_in=true; + bool all_out=true; + CGAL_For_all(sfc, send) { + if (omit_vertex[sfc->source()->source()]) + all_in=false; + else + all_out=false; + } + if (!all_in && !all_out) + { + SHalfedge_around_facet_const_circulator sfc(fc), send(sfc); + ++nof; + CGAL_For_all(sfc, send) { + if (!omit_vertex[sfc->source()->source()]) + { + omit_vertex[sfc->source()->source()]=true; + ++norv; + } + } + } + if (all_in) + ++nof; + } + + void visit(Vertex_const_handle) {} + void visit(SFace_const_handle) {} + void visit(Halfedge_const_handle) {} + void visit(SHalfedge_const_handle) {} + void visit(SHalfloop_const_handle) {} + + int number_of_removed_vertices() const { + return norv; + } + + int number_of_facets() const { + return nof; + } }; class Add_vertices { @@ -998,14 +1057,19 @@ protected: se = SHalfedge_const_handle(fc); CGAL_assertion(se!=0); if(omit_vertex[se->source()->source()]) return; - B.begin_facet(); + SHalfedge_around_facet_const_circulator hc_start(se); SHalfedge_around_facet_const_circulator hc_end(hc_start); + std::vector vids; CGAL_For_all(hc_start,hc_end) { - CGAL_NEF_TRACEN(" add vertex " << hc_start->source()->center_vertex()->point()); - B.add_vertex_to_facet(VI[hc_start->source()->center_vertex()]); + if (omit_vertex[hc_start->source()->center_vertex()]) + { + std::cout << "issue with " << se->source()->source()->point() << "\n"; + return; + } + vids.push_back(VI[hc_start->source()->center_vertex()]); } - B.end_facet(); + B.add_facet (vids.begin(), vids.end()); } void visit(SFace_const_handle) {} @@ -1030,11 +1094,29 @@ protected: Polyhedron_incremental_builder_3 B(hds, true); + // first mark vertices of holes of each halffacet as omitted. Find_holes F(omit_vertex); scd.visit_shell_objects(sf, F); + std::size_t nb_v = F.number_of_vertices(); + std::size_t nb_f = F.number_of_facets(); - B.begin_surface(F.number_of_vertices(), - F.number_of_facets(), + // then if a halffacet contains a vertex marked as omitted, all its vertices + // must be marked as such + if (F.holes_detected()) + { + while(true) + { + Nested_holes F2(omit_vertex); + scd.visit_shell_objects(sf, F2); + if (F2.number_of_removed_vertices()==0) break; + nb_v-=F2.number_of_removed_vertices(); + nb_f=F2.number_of_facets(); + } + } + + + B.begin_surface(nb_v, + nb_f, F.number_of_vertices()+F.number_of_facets()-2); Add_vertices A(B,omit_vertex, VI); diff --git a/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h b/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h index a5e5e619120..3ecd0e1b805 100644 --- a/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h +++ b/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h @@ -25,6 +25,7 @@ #include #include #include +#include #include @@ -81,6 +82,7 @@ struct Shell_polygons_visitor Vertex_index_map& vertex_indices; PolygonRange& polygons; bool triangulate_all_faces; + CGAL::Generic_handle_map Done; Shell_polygons_visitor(Vertex_index_map& vertex_indices, PolygonRange& polygons, @@ -88,6 +90,7 @@ struct Shell_polygons_visitor : vertex_indices( vertex_indices ) , polygons(polygons) , triangulate_all_faces(triangulate_all_faces) + , Done(false) {} std::size_t get_cycle_length( typename Nef_polyhedron::Halffacet_cycle_const_iterator hfc) const @@ -103,6 +106,14 @@ struct Shell_polygons_visitor void visit(typename Nef_polyhedron::Halffacet_const_handle opposite_facet) { + typename Nef_polyhedron::Halffacet_const_handle twin_facet = opposite_facet->twin(); + + // skip when we have to do with the unbounded volume and a surface with boundaries + if ((twin_facet->incident_volume() == opposite_facet->incident_volume()) && Done[twin_facet]) + return; + + Done[opposite_facet] = true; + bool is_marked=opposite_facet->incident_volume()->mark(); CGAL_assertion(Nef_polyhedron::Infi_box::is_standard(opposite_facet->plane())); @@ -351,18 +362,50 @@ void convert_nef_polyhedron_to_polygon_soup(const Nef_polyhedron& nef, typedef Cartesian_converter Converter; typename Nef_polyhedron::Volume_const_iterator vol_it = nef.volumes_begin(), vol_end = nef.volumes_end(); - if ( Nef_polyhedron::Infi_box::extended_kernel() ) ++vol_it; // skip Infi_box - CGAL_assertion ( vol_it != vol_end ); - ++vol_it; // skip unbounded volume + + if (Nef_polyhedron::Infi_box::extended_kernel()) ++vol_it; // skip Infi_box + + if ( vol_it == vol_end ) return; Converter to_output; + bool handling_unbounded_volume = true; + + auto shell_is_closed = [](typename Nef_polyhedron::Shell_entry_const_iterator sfh) + { + typename Nef_polyhedron::SFace_const_handle sf = sfh; + + typename Nef_polyhedron::SFace_cycle_const_iterator fc; + for(fc = sf->sface_cycles_begin(); fc != sf->sface_cycles_end(); ++fc) + { + if (fc.is_shalfedge() ) { + typename Nef_polyhedron::SHalfedge_const_handle e(fc); + typename Nef_polyhedron::SHalfedge_around_sface_const_circulator ec(e),ee(e); + CGAL_For_all(ec,ee) + { + typename Nef_polyhedron::Halffacet_const_handle f = ec->twin()->facet(); + if (f->incident_volume()==f->twin()->incident_volume()) + return false; + } + } + } + + return true; + }; + for (;vol_it!=vol_end;++vol_it) - nef_to_pm::collect_polygon_mesh_info(points, - polygons, - nef, - vol_it->shells_begin(), - to_output, - triangulate_all_faces); + { + for(auto sit = vol_it->shells_begin(); sit != vol_it->shells_end(); ++sit) + { + if ( (handling_unbounded_volume || sit!=vol_it->shells_begin()) && shell_is_closed(sit)) continue; + nef_to_pm::collect_polygon_mesh_info(points, + polygons, + nef, + sit, + to_output, + triangulate_all_faces); + } + handling_unbounded_volume = false; + } } template diff --git a/Nef_3/test/Nef_3/issue_6423.cpp b/Nef_3/test/Nef_3/issue_6423.cpp new file mode 100644 index 00000000000..441dd0b7939 --- /dev/null +++ b/Nef_3/test/Nef_3/issue_6423.cpp @@ -0,0 +1,45 @@ +#include +#include +#include +#include +#include +#include + +typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; +typedef Kernel::Point_3 Point_3; +typedef CGAL::Surface_mesh SurfaceMesh; +typedef CGAL::Nef_polyhedron_3 NefPolyhedron; + + +int main() +{ + SurfaceMesh surfaceMesh; + SurfaceMesh::Vertex_index v0 = surfaceMesh.add_vertex(Point_3(-1, 0, 0)); + SurfaceMesh::Vertex_index v1 = surfaceMesh.add_vertex(Point_3(1, 0, 0)); + SurfaceMesh::Vertex_index v2 = surfaceMesh.add_vertex(Point_3(0, 1, 0)); + + SurfaceMesh::Vertex_index v3 = surfaceMesh.add_vertex(Point_3(-1, 0, 1)); + SurfaceMesh::Vertex_index v4 = surfaceMesh.add_vertex(Point_3(1, 0, 1)); + SurfaceMesh::Vertex_index v5 = surfaceMesh.add_vertex(Point_3(0, 1, 1)); + + surfaceMesh.add_face(v0, v1, v2); + surfaceMesh.add_face(v3, v4, v5); + + make_tetrahedron(Point_3(-1, 0, 10), + Point_3(1, 0, 10), + Point_3(0, 1, 10), + Point_3(-1, 0, 11), + surfaceMesh); + + std::cout << "Before conversion, number_of_faces: " << surfaceMesh.number_of_faces() << std::endl; + + NefPolyhedron nefPoly(surfaceMesh); + std::cout << "NefPolyhedron, number_of_faces: " << nefPoly.number_of_facets() << std::endl; + SurfaceMesh convertedSurfaceMesh; + CGAL::convert_nef_polyhedron_to_polygon_mesh(nefPoly, convertedSurfaceMesh, true); + std::cout << "After conversion, number_of_faces: " << convertedSurfaceMesh.number_of_faces() << std::endl; + std::ofstream("out.off") << convertedSurfaceMesh; + assert(vertices(convertedSurfaceMesh).size()==10); + assert(faces(convertedSurfaceMesh).size()==6); + return EXIT_SUCCESS; +} diff --git a/Point_set_3/test/Point_set_3/CMakeLists.txt b/Point_set_3/test/Point_set_3/CMakeLists.txt index 264891b55ba..2546c7495a8 100644 --- a/Point_set_3/test/Point_set_3/CMakeLists.txt +++ b/Point_set_3/test/Point_set_3/CMakeLists.txt @@ -14,7 +14,7 @@ create_single_source_cgal_program("issue7996.cpp") #Use LAS #disable if MSVC 2017 -if(NOT MSVC_VERSION OR (MSVC_VERSION GREATER_EQUAL 1919 AND MSVC_VERSION LESS 1910)) +if(NOT MSVC_VERSION OR MSVC_VERSION GREATER_EQUAL 1919 OR MSVC_VERSION LESS 1910) find_package(LASLIB QUIET) include(CGAL_LASLIB_support) if (TARGET CGAL::LASLIB_support) @@ -23,5 +23,5 @@ if(NOT MSVC_VERSION OR (MSVC_VERSION GREATER_EQUAL 1919 AND MSVC_VERSION LESS 1 message(STATUS "NOTICE: the LAS reader test requires LASlib, and will not be compiled.") endif() else() - message(STATUS "NOTICE: the LAS reader does not work with Visual Studio 2017.") + message(STATUS "NOTICE: the LAS reader does not work with your version of Visual Studio 2017.") endif() diff --git a/Point_set_processing_3/examples/Point_set_processing_3/CMakeLists.txt b/Point_set_processing_3/examples/Point_set_processing_3/CMakeLists.txt index e202d670a22..fbb9b2d78d1 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/CMakeLists.txt +++ b/Point_set_processing_3/examples/Point_set_processing_3/CMakeLists.txt @@ -58,7 +58,9 @@ find_package(LASLIB QUIET) include(CGAL_LASLIB_support) if(TARGET CGAL::LASLIB_support) create_single_source_cgal_program("read_las_example.cpp") + create_single_source_cgal_program("write_las_example.cpp") target_link_libraries(read_las_example PRIVATE ${CGAL_libs} CGAL::LASLIB_support) + target_link_libraries(write_las_example PRIVATE ${CGAL_libs} CGAL::LASLIB_support) else() message(STATUS "NOTICE: the LAS reader example requires LASlib and will not be compiled.") endif() diff --git a/Point_set_processing_3/examples/Point_set_processing_3/write_las_example.cpp b/Point_set_processing_3/examples/Point_set_processing_3/write_las_example.cpp new file mode 100644 index 00000000000..200d31cc7e4 --- /dev/null +++ b/Point_set_processing_3/examples/Point_set_processing_3/write_las_example.cpp @@ -0,0 +1,45 @@ +#include + +#include +#include +#include + +#include +#include +#include + +// types +typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; +typedef Kernel::FT FT; +typedef Kernel::Point_3 Point; +typedef std::array Color; +typedef std::pair PointWithColor; + +int main(int argc, char*argv[]) +{ + const char* fname = "colored_points.las"; + + std::ofstream os(fname, std::ios::binary); + + std::vector points; // store points + points.push_back(std::make_pair(Point(0, 0, 0), Color{ 65535, 0, 0, 0 })); + points.push_back(std::make_pair(Point(1, 0, 0), Color{ 0, 65535, 0, 0 })); + points.push_back(std::make_pair(Point(0, 1, 0), Color{ 0, 0, 65535, 0 })); + points.push_back(std::make_pair(Point(1, 1, 0), Color{ 0, 65535, 65535, 0 })); + points.push_back(std::make_pair(Point(1, 1, 1), Color{ 65535, 65535, 0, 0 })); + + // Writes a .las point set file with colors + if(!CGAL::IO::write_LAS_with_properties(os, points, + CGAL::IO::make_las_point_writer(CGAL::First_of_pair_property_map()), + std::make_tuple(CGAL::Second_of_pair_property_map(), + CGAL::IO::LAS_property::R(), + CGAL::IO::LAS_property::G(), + CGAL::IO::LAS_property::B(), + CGAL::IO::LAS_property::I()))) + { + std::cerr << "Error: cannot write file " << fname << std::endl; + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} diff --git a/Point_set_processing_3/include/CGAL/IO/read_las_points.h b/Point_set_processing_3/include/CGAL/IO/read_las_points.h index ebc1744cc7e..c1dc8453fc9 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_las_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_las_points.h @@ -43,7 +43,7 @@ # pragma GCC diagnostic ignored "-Wstrict-aliasing" #endif -#define USE_AS_DLL +#define USE_AS_DLL 1 #include #undef USE_AS_DLL @@ -384,7 +384,11 @@ bool read_LAS_with_properties(std::istream& is, if(!is) return false; +#if LAS_TOOLS_VERSION < 240319 LASreaderLAS lasreader; +#else + LASreaderLAS lasreader(nullptr); +#endif lasreader.open(is); while(lasreader.read_point()) diff --git a/Point_set_processing_3/include/CGAL/IO/write_las_points.h b/Point_set_processing_3/include/CGAL/IO/write_las_points.h index 400aed2092a..3c1425fb41f 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_las_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_las_points.h @@ -37,7 +37,7 @@ # pragma GCC diagnostic ignored "-Wstrict-aliasing" #endif -#define USE_AS_DLL +#define USE_AS_DLL 1 #include #include #include @@ -84,41 +84,41 @@ make_las_point_writer(PointMap point_map) namespace internal { namespace LAS { - inline void output_value(LASpoint& r, const unsigned short& v, LAS_property::Intensity&) + inline void output_value(LASpoint& r, const unsigned short& v, const LAS_property::Intensity&) { r.set_intensity(v); } - inline void output_value(LASpoint& r, const unsigned char& v, LAS_property::Return_number&) + inline void output_value(LASpoint& r, const unsigned char& v, const LAS_property::Return_number&) { r.set_return_number(v); } - inline void output_value(LASpoint& r, const unsigned char& v, LAS_property::Number_of_returns&) + inline void output_value(LASpoint& r, const unsigned char& v, const LAS_property::Number_of_returns&) { r.set_number_of_returns(v); } - inline void output_value(LASpoint& r, const unsigned char& v, LAS_property::Scan_direction_flag&) + inline void output_value(LASpoint& r, const unsigned char& v, const LAS_property::Scan_direction_flag&) { r.set_scan_direction_flag(v); } - inline void output_value(LASpoint& r, const unsigned char& v, LAS_property::Edge_of_flight_line&) + inline void output_value(LASpoint& r, const unsigned char& v, const LAS_property::Edge_of_flight_line&) { r.set_edge_of_flight_line(v); } - inline void output_value(LASpoint& r, const unsigned char& v, LAS_property::Classification&) + inline void output_value(LASpoint& r, const unsigned char& v, const LAS_property::Classification&) { r.set_classification(v); } - inline void output_value(LASpoint& r, const unsigned char& v, LAS_property::Synthetic_flag&) + inline void output_value(LASpoint& r, const unsigned char& v, const LAS_property::Synthetic_flag&) { r.set_synthetic_flag(v); } - inline void output_value(LASpoint& r, const unsigned char& v, LAS_property::Keypoint_flag&) + inline void output_value(LASpoint& r, const unsigned char& v, const LAS_property::Keypoint_flag&) { r.set_keypoint_flag(v); } - inline void output_value(LASpoint& r, const unsigned char& v, LAS_property::Withheld_flag&) + inline void output_value(LASpoint& r, const unsigned char& v, const LAS_property::Withheld_flag&) { r.set_withheld_flag(v); } - inline void output_value(LASpoint& r, const float& v, LAS_property::Scan_angle&) + inline void output_value(LASpoint& r, const float& v, const LAS_property::Scan_angle&) { r.set_scan_angle_rank(char(v)); } - inline void output_value(LASpoint& r, const unsigned char& v, LAS_property::User_data&) + inline void output_value(LASpoint& r, const unsigned char& v, const LAS_property::User_data&) { r.set_user_data(v); } - inline void output_value(LASpoint& r, const unsigned short& v, LAS_property::Point_source_ID&) + inline void output_value(LASpoint& r, const unsigned short& v, const LAS_property::Point_source_ID&) { r.set_point_source_ID(v); } - inline void output_value(LASpoint& r, const unsigned int& v, LAS_property::Deleted_flag&) + inline void output_value(LASpoint& r, const unsigned int& v, const LAS_property::Deleted_flag&) { r.set_deleted_flag(v); } - inline void output_value(LASpoint& r, const double& v, LAS_property::GPS_time&) + inline void output_value(LASpoint& r, const double& v, const LAS_property::GPS_time&) { r.set_gps_time(v); } - inline void output_value(LASpoint& r, const unsigned short& v, LAS_property::R&) + inline void output_value(LASpoint& r, const unsigned short& v, const LAS_property::R&) { r.set_R(v); } - inline void output_value(LASpoint& r, const unsigned short& v, LAS_property::G&) + inline void output_value(LASpoint& r, const unsigned short& v, const LAS_property::G&) { r.set_G(v); } - inline void output_value(LASpoint& r, const unsigned short& v, LAS_property::B&) + inline void output_value(LASpoint& r, const unsigned short& v, const LAS_property::B&) { r.set_B(v); } - inline void output_value(LASpoint& r, const unsigned short& v, LAS_property::I&) + inline void output_value(LASpoint& r, const unsigned short& v, const LAS_property::I&) { r.set_I(v); } template @@ -134,20 +134,57 @@ namespace LAS { output_value (point, get(current.first, *it), current.second); } + template + void output_tuple(LASpoint& point, const Value& v, const Tuple& t, std::index_sequence) { + output_value(point, std::get(v), std::get(t)); + } + + template + void output_tuple(LASpoint& point, const Value& v, const Tuple& t, std::index_sequence) { + output_value(point, std::get(v), std::get(t)); + output_tuple(point, v, t, std::index_sequence()); + } + template + typename PropertyMap, + typename ... T> void output_properties(LASpoint& point, - ForwardIterator it, - std::pair&& current, - NextPropertyHandler&& next, - PropertyHandler&& ... properties) + ForwardIterator it, + std::tuple&& current) { - output_value (point, get(current.first, *it), current.second); - output_properties (point, it, std::forward(next), - std::forward(properties)...); + output_tuple(point, get(std::get<0>(current), *it), std::tuple(), std::index_sequence_for{}); + } + + template + void output_properties(LASpoint& point, + ForwardIterator it, + std::pair&& current, + NextPropertyHandler&& next, + PropertyHandler&& ... properties) + { + output_value(point, get(current.first, *it), current.second); + output_properties(point, it, std::forward(next), + std::forward(properties)...); + } + + template + void output_properties(LASpoint& point, + ForwardIterator it, + std::tuple&& current, + NextPropertyHandler&& next, + PropertyHandler&& ... properties) + { + output_tuple(point, get(std::get<0>(current), *it), std::tuple(), std::index_sequence_for{}); + output_properties(point, it, std::forward(next), + std::forward(properties)...); } } // namespace LAS diff --git a/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt b/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt index 7c13d2912e3..a15b69cad1a 100644 --- a/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt +++ b/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt @@ -33,7 +33,7 @@ create_single_source_cgal_program( "structuring_test.cpp" ) #Use LAS #disable if MSVC 2017 -if(NOT MSVC_VERSION OR (MSVC_VERSION GREATER_EQUAL 1919 AND MSVC_VERSION LESS 1910)) +if(NOT MSVC_VERSION OR MSVC_VERSION GREATER_EQUAL 1919 OR MSVC_VERSION LESS 1910) find_package(LASLIB QUIET) include(CGAL_LASLIB_support) if (TARGET CGAL::LASLIB_support) @@ -43,7 +43,7 @@ if(NOT MSVC_VERSION OR (MSVC_VERSION GREATER_EQUAL 1919 AND MSVC_VERSION LESS 1 message(STATUS "NOTICE: the LAS reader test requires LASlib and will not be compiled.") endif() else() - message(STATUS "NOTICE: the LAS reader does not work with Visual Studio 2017.") + message(STATUS "NOTICE: the LAS reader does not work with your version of Visual Studio 2017.") endif() # Use Eigen diff --git a/REUSE.toml b/REUSE.toml index a36f899b03c..5cca2b91384 100644 --- a/REUSE.toml +++ b/REUSE.toml @@ -4,13 +4,50 @@ SPDX-PackageSupplier = "CGAL Editorial Board " SPDX-PackageDownloadLocation = "https://github.com/CGAL/cgal" [[annotations]] -path = [".**", "**.cmake", "**.md", ".github/**", "Maintenance/**", "**/TODO", "**/doc/**", "**/deb/**", "**/applications/**", "**/doc_html/**", "**/scripts/**", "**/developer_scripts/**", "**/demo/**", "**/examples/**", "**/src/**", "**/test/**", "**/benchmarks/**", "**/benchmark/**", "**/package_info/**", "**/data/**", "**/cmake/**"] +path = [ + ".**", + "**.cmake", + "**.md", + ".github/**", + "Maintenance/**", + "**/TODO", + "**/doc/**", + "**/deb/**", + "**/applications/**", + "**/doc_html/**", + "**/scripts/**", + "**/developer_scripts/**", + "**/demo/**", + "**/examples/**", + "**/src/**", + "**/test/**", + "**/benchmarks/**", + "**/benchmark/**", + "**/package_info/**", + "**/data/**", + "**/cmake/**", + "**/*.natvis", +] precedence = "aggregate" SPDX-FileCopyrightText = "1995-2024 The CGAL Project" SPDX-License-Identifier = "CC0-1.0" [[annotations]] -path = ["REUSE.toml", "CMakeLists.txt", "cmake_uninstall.cmake.in", "GraphicsView/include/CGAL/Qt/ImageInterface.ui", "GraphicsView/include/CGAL/Qt/resources/qglviewer-icon.xpm", "Installation/AUTHORS", "Installation/CMakeLists.txt", "Installation/README", "Installation/auxiliary/cgal_create_cmake_script.1", "Installation/auxiliary/gmp/README", "Installation/include/CGAL/license/gpl_package_list.txt", "MacOSX/auxiliary/cgal_app.icns", "copyright"] +path = [ + "REUSE.toml", + "CMakeLists.txt", + "cmake_uninstall.cmake.in", + "GraphicsView/include/CGAL/Qt/ImageInterface.ui", + "GraphicsView/include/CGAL/Qt/resources/qglviewer-icon.xpm", + "Installation/AUTHORS", + "Installation/CMakeLists.txt", + "Installation/README", + "Installation/auxiliary/cgal_create_cmake_script.1", + "Installation/auxiliary/gmp/README", + "Installation/include/CGAL/license/gpl_package_list.txt", + "MacOSX/auxiliary/cgal_app.icns", + "copyright", +] precedence = "aggregate" SPDX-FileCopyrightText = "1995-2024 The CGAL Project" SPDX-License-Identifier = "CC0-1.0" diff --git a/Ridges_3/doc/Ridges_3/Ridges_3.txt b/Ridges_3/doc/Ridges_3/Ridges_3.txt index e6e30e83d92..b532262f57f 100644 --- a/Ridges_3/doc/Ridges_3/Ridges_3.txt +++ b/Ridges_3/doc/Ridges_3/Ridges_3.txt @@ -45,7 +45,7 @@ functions of the package are provided in Section \ref Ridges_3Examples. For a detailed introduction to ridges and related topics, the reader may consult \cgalCite{cgal:hgygm-ttdpf-99},\cgalCite{cgal:p-gd-01}, as well as -the following survey article \cgalCite{cgal:cp-ssulc-05}. +the survey article \cgalCite{cgal:cp-ssulc-05}. In the sequel, we just introduce the basic notions so as to explain our algorithms. Consider a smooth embedded surface, and denote \f$ k_1\f$ and \f$ k_2\f$ the principal curvatures, with \f$ k_1\geq k_2\f$. Umbilics are @@ -399,7 +399,7 @@ neighborhood. \subsection Ridges_3Exampleprogram Example Program The following program computes ridges and umbilics from an off -file.\cgalFootnote{Model data may be downloaded via ftp://ftp.mpi-sb.mpg.de/pub/outgoing/CGAL/Ridges_3_datafiles.tgz . The mechanical part model has been provided courtesy of Dassault System to produce \cgalFigureRef{figmechanical_crest_filteredintro}, due to copyright issues the available model is not the same, it is provided by the AIM\@SHAPE Shape Repository.} It uses the package \ref PkgJetFitting3 to estimate the differential +file. It uses the package \ref PkgJetFitting3 to estimate the differential quantities. The default output file gives rough data for visualization purpose, a verbose output file may also be asked for. Parameters are @@ -533,11 +533,7 @@ Ridges on the ellipsoid, normals pointing outward. Color coding : \subsection Ridges_3ExampleFilteringofCrestRidgesona Example: Filtering of Crest Ridges on a Mechanical Part \cgalFigureRef{figmechanical_crest_filteredintro} illustrates the filtering -of crest ridges on a mechanical model, and has been computed as follows: - -\code{.cpp} -./Compute_Ridges_Umbilics -f data/mecanic.off -d 4 -m 4 -a 4 -t 4 -\endcode +of crest ridges on a mechanical model. \cgalFigureBegin{figmechanical_crest_filteredintro,mecanic-sub1_crest-jpg.png} Mechanical part (37k pts). Left: All crest lines. Middle: crests filtered diff --git a/Scripts/developer_scripts/cgal_create_package_dir.py b/Scripts/developer_scripts/cgal_create_package_dir.py index 90900b1304d..e2445915d5b 100755 --- a/Scripts/developer_scripts/cgal_create_package_dir.py +++ b/Scripts/developer_scripts/cgal_create_package_dir.py @@ -26,9 +26,8 @@ creationpath = args.creationpath doxystring = \ r"""@INCLUDE = ${CGAL_DOC_PACKAGE_DEFAULTS} + PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - Put title of project here" -INPUT = ${CMAKE_SOURCE_DIR}/PACKAGENAME/doc/PACKAGENAME/ \ - ${CMAKE_SOURCE_DIR}/PACKAGENAME/include """ descrstring = \ diff --git a/Scripts/developer_scripts/create_new_release b/Scripts/developer_scripts/create_new_release index 692ed94e7fa..2b0e0f2ff2b 100755 --- a/Scripts/developer_scripts/create_new_release +++ b/Scripts/developer_scripts/create_new_release @@ -323,6 +323,9 @@ if [ -n "$DO_PUBLIC" ]; then zip -q -r ${public_release_name}-library.zip ${public_release_name} mv ${public_release_name}*.tar.xz "${HTML_DIR}/${release_name}-public/" mv ${public_release_name}*.zip "${HTML_DIR}/${release_name}-public/" + if command -v sestatus >/dev/null 2>&1; then + sestatus && restorecon -R "${HTML_DIR}/${release_name}-public" + fi rm -f "$HTML_DIR/CGAL-last-public" ln -s "${release_name}-public" "$HTML_DIR/CGAL-last-public" fi diff --git a/Scripts/developer_scripts/run_doxygen_testsuite b/Scripts/developer_scripts/run_doxygen_testsuite index 470eb295d84..5aaab01d981 100755 --- a/Scripts/developer_scripts/run_doxygen_testsuite +++ b/Scripts/developer_scripts/run_doxygen_testsuite @@ -6,7 +6,7 @@ cd /home/cgal-testsuite # Rotate log files on one month: the logfile name contains the number of # the day -LOGFILE=$PWD/doxygen_testsuite-`date '+%d'`.log +LOGFILE=$PWD/doxygen_testsuite-$(date '+%d').log exec > "$LOGFILE" @@ -39,8 +39,8 @@ if [ -r "${CGAL_DOC_BUILD}" ]; then rm -rf "${CGAL_DOC_BUILD}" fi -mkdir ${CGAL_DOC_BUILD} -cd ${CGAL_DOC_BUILD} +mkdir "${CGAL_DOC_BUILD}" +cd "${CGAL_DOC_BUILD}" if [ -r "LATEST" ]; then rm -rf LATEST @@ -52,12 +52,12 @@ if [ ! -f "LATEST" ]; then error "COULD NOT DOWNLOAD LATEST!" fi -for i in `cat LATEST` +for i in $(cat LATEST) do CGAL_LOCATION="${CGAL_URL}/${i}"; CGAL_ZIPFILE="${i}"; done -CGAL_RELEASE_ID=`echo $CGAL_ZIPFILE | sed "s/.tar.gz//"` +CGAL_RELEASE_ID=$(echo "$CGAL_ZIPFILE" | sed "s/.tar.gz//") curl ${CURL_OPTS} "${CGAL_LOCATION}" tar xvzf "${CGAL_ZIPFILE}" && rm "${CGAL_ZIPFILE}" @@ -68,11 +68,16 @@ cd "${CGAL_RELEASE_ID}" PATH=/home/cgal-testsuite/local/bin:$PATH export PATH -cd "$PWD/doc/scripts" +cd "${PWD}/doc/scripts" bash -$- ./process_doc.sh /home/cgal-testsuite/bin/doxygen_1_8_13 /home/cgal-testsuite/bin/doxygen_1_9_6 /srv/CGAL/www/Members/Manual_doxygen_test if head -2 ../../.scm-branch | grep -q cgal/master; then rsync -a --delete "/srv/CGAL/www/Members/Manual_doxygen_test/${CGAL_RELEASE_ID}/output2/" /srv/CGAL/www/doc/master/ fi +if sestatus &>/dev/null && [ -d "/srv/CGAL/www/doc/master/" ] && [ -d "/srv/CGAL/www/Members/Manual_doxygen_test/${CGAL_RELEASE_ID}" ]; then + restorecon -R /srv/CGAL/www/doc/master/ /srv/CGAL/www/Members/Manual_doxygen_test/${CGAL_RELEASE_ID} || error "restorecon command failed" +else + error "SELinux is not enabled or the paths do not exist" +fi rm -rf "${CGAL_DOC_BUILD}" # Then gzip the log file, to save space exec diff --git a/Stream_support/test/Stream_support/CMakeLists.txt b/Stream_support/test/Stream_support/CMakeLists.txt index 911f06a0bbf..4cd06abb69a 100644 --- a/Stream_support/test/Stream_support/CMakeLists.txt +++ b/Stream_support/test/Stream_support/CMakeLists.txt @@ -13,6 +13,9 @@ find_library( NAMES 3MF DOC "Path to the lib3MF library") +find_package(LASLIB QUIET) +include(CGAL_LASLIB_support) + # create a target per cppfile file( GLOB cppfiles @@ -30,6 +33,15 @@ foreach(cppfile ${cppfiles}) message(STATUS "NOTICE: Some tests require the lib3MF library, and will not be compiled.") endif() else() - create_single_source_cgal_program("${cppfile}") + if("${cppfile}" STREQUAL "test_LAS.cpp") + if(TARGET CGAL::LASLIB_support) + create_single_source_cgal_program("test_LAS.cpp") + target_link_libraries(test_LAS PRIVATE CGAL::LASLIB_support) + else() + message(STATUS "NOTICE: Some tests require the LASlib library, and will not be compiled.") + endif() + else() + create_single_source_cgal_program("${cppfile}") + endif() endif() endforeach() diff --git a/Stream_support/test/Stream_support/data/colored_points.las b/Stream_support/test/Stream_support/data/colored_points.las new file mode 100644 index 00000000000..102aee9443e Binary files /dev/null and b/Stream_support/test/Stream_support/data/colored_points.las differ diff --git a/Stream_support/test/Stream_support/data/simple_ascii.ply b/Stream_support/test/Stream_support/data/simple_ascii.ply new file mode 100644 index 00000000000..5bc4a19d34f --- /dev/null +++ b/Stream_support/test/Stream_support/data/simple_ascii.ply @@ -0,0 +1,16 @@ +ply +format ascii 1.0 +comment VCGLIB generated +element vertex 3 +property float x +property float y +property float z +property float nx +property float ny +property float nz +element face 0 +property list uchar int vertex_indices +end_header +1 1 1 2 2 2 +3 3 3 4 4 4 +5 5 5 6 6 6 diff --git a/Stream_support/test/Stream_support/issue8155.cpp b/Stream_support/test/Stream_support/issue8155.cpp new file mode 100644 index 00000000000..f92bf9cca84 --- /dev/null +++ b/Stream_support/test/Stream_support/issue8155.cpp @@ -0,0 +1,50 @@ +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +typedef CGAL::Simple_cartesian Kernel; +typedef Kernel::FT FT; +typedef Kernel::Point_3 Point_3; +typedef Kernel::Vector_3 Vector_3; +typedef std::pair PointVectorPair; +typedef CGAL::First_of_pair_property_map Point_map; +typedef CGAL::Second_of_pair_property_map Normal_map; + +int main() +{ + std::vector pv_pairs; + const std::function lambda = + [&](const PointVectorPair& p) { + FT len = p.second.squared_length(); + if (len > 0 || len != 1.0) { + Vector_3 n = p.second * (1.0 / CGAL::sqrt(len)); + pv_pairs.push_back(std::make_pair(p.first, n)); + } + else pv_pairs.push_back(p); + }; + + pv_pairs.clear(); + std::ifstream file("data/simple_ascii.ply"); + CGAL::IO::read_PLY_with_properties(file, boost::function_output_iterator(lambda), + CGAL::make_ply_point_reader(Point_map()), + CGAL::make_ply_normal_reader(Normal_map())); + + assert(pv_pairs[0].first == Point_3(1, 1, 1)); + assert(pv_pairs[1].first == Point_3(3, 3, 3)); + assert(pv_pairs[2].first == Point_3(5, 5, 5)); + + for (std::size_t i = 0; i < pv_pairs.size(); i++) { + FT dev = CGAL::abs(1.0 - pv_pairs[i].second.squared_length()); + assert(dev < 0.01); + } + + return 0; +} diff --git a/Stream_support/test/Stream_support/test_LAS.cpp b/Stream_support/test/Stream_support/test_LAS.cpp new file mode 100644 index 00000000000..555e80f533a --- /dev/null +++ b/Stream_support/test/Stream_support/test_LAS.cpp @@ -0,0 +1,63 @@ +#include + +#include +#include + +#include +#include +#include + +// types +typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; +typedef Kernel::FT FT; +typedef Kernel::Point_3 Point; +typedef std::array Color; +typedef std::pair PointWithColor; + +int main(int argc, char* argv[]) +{ + std::ifstream is("data/colored_points.las"); + + // Reads a .las point set file with normal vectors and colors + std::vector points; // store points + if (!CGAL::IO::read_LAS_with_properties(is, std::back_inserter(points), + CGAL::IO::make_las_point_reader(CGAL::First_of_pair_property_map()), + std::make_tuple(CGAL::Second_of_pair_property_map(), + CGAL::Construct_array(), + CGAL::IO::LAS_property::R(), + CGAL::IO::LAS_property::G(), + CGAL::IO::LAS_property::B(), + CGAL::IO::LAS_property::I()))) + { + std::cerr << "Error: cannot read file data/colored_points.las" << std::endl; + return EXIT_FAILURE; + } + + CGAL_assertion(points.size() == 5); + CGAL_assertion(points[0].second[0] == 65535); + CGAL_assertion(points[0].second[1] == 0); + CGAL_assertion(points[0].second[2] == 0); + CGAL_assertion(points[0].second[3] == 0); + + CGAL_assertion(points[1].second[0] == 0); + CGAL_assertion(points[1].second[1] == 65535); + CGAL_assertion(points[1].second[2] == 0); + CGAL_assertion(points[1].second[3] == 0); + + CGAL_assertion(points[2].second[0] == 0); + CGAL_assertion(points[2].second[1] == 0); + CGAL_assertion(points[2].second[2] == 65535); + CGAL_assertion(points[2].second[3] == 0); + + CGAL_assertion(points[3].second[0] == 0); + CGAL_assertion(points[3].second[1] == 65535); + CGAL_assertion(points[3].second[2] == 65535); + CGAL_assertion(points[3].second[3] == 0); + + CGAL_assertion(points[4].second[0] == 65535); + CGAL_assertion(points[4].second[1] == 65535); + CGAL_assertion(points[4].second[2] == 0); + CGAL_assertion(points[4].second[3] == 0); + + return EXIT_SUCCESS; +} diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Square_border_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Square_border_parameterizer_3.h index cb97d65430a..35c16dae10a 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Square_border_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Square_border_parameterizer_3.h @@ -234,7 +234,7 @@ private: // If the target is a corner vertex, we have the complete length of a side in 'len' // and we must "normalize" the previous entries if(get(vpmap, vt)) { - // If both extremeties of a segment are corners, offsets are already correct + // If both extremities of a segment are corners, offsets are already correct if(!get(vpmap, vs)) { CGAL_assertion(len != 0.0); double ld = 1.0 / len; diff --git a/Tetrahedral_remeshing/doc/Tetrahedral_remeshing/Tetrahedral_remeshing.txt b/Tetrahedral_remeshing/doc/Tetrahedral_remeshing/Tetrahedral_remeshing.txt index e8d94344cfc..49823e27292 100644 --- a/Tetrahedral_remeshing/doc/Tetrahedral_remeshing/Tetrahedral_remeshing.txt +++ b/Tetrahedral_remeshing/doc/Tetrahedral_remeshing/Tetrahedral_remeshing.txt @@ -156,7 +156,7 @@ setting the named parameter `remesh_boundaries` to `false`. It is also possible to define the polyline features as the ones stored as complex edges in a `Mesh_complex_3_in_triangulation_3` -(e.g., generated by the \ref PkgMesh3 package mesh generation algorithms). +(e.g., generated by the \ref PkgMesh3 package). \cgalExample{Tetrahedral_remeshing/mesh_and_remesh_c3t3.cpp } diff --git a/Three/include/CGAL/Three/TextRenderer.h b/Three/include/CGAL/Three/TextRenderer.h index c5c729ec032..f04535841f7 100644 --- a/Three/include/CGAL/Three/TextRenderer.h +++ b/Three/include/CGAL/Three/TextRenderer.h @@ -52,12 +52,7 @@ public : :x(p_x), y(p_y), z(p_z),_3D(p_3D), _is_always_visible(always_visible), m_text(p_text), m_font(font), m_color(p_color) { QFontMetrics fm(m_font); -#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) _width = float(fm.horizontalAdvance(m_text)+2); -#else - _width = float(fm.width(m_text)+2); -#endif - _height = float(fm.height()); } //!\brief Accessor for the string diff --git a/Three/include/CGAL/Three/Three.h b/Three/include/CGAL/Three/Three.h index 3dac95792a3..e3e6366d5b6 100644 --- a/Three/include/CGAL/Three/Three.h +++ b/Three/include/CGAL/Three/Three.h @@ -31,11 +31,7 @@ # define THREE_EXPORT Q_DECL_IMPORT #endif -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) -#define CGAL_QT_SKIP_EMPTY_PARTS QString::SkipEmptyParts -#else #define CGAL_QT_SKIP_EMPTY_PARTS ::Qt::SkipEmptyParts -#endif namespace CGAL{ namespace Three{