diff --git a/.gitattributes b/.gitattributes index fa0e3ffdd7b..38d7151d460 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3219,12 +3219,17 @@ Polyhedron/doc_tex/Polyhedron_ref/fig/add_facet.pdf -text svneol=unset#applicati Polyhedron/doc_tex/Polyhedron_ref/fig/add_facet1.gif -text svneol=unset#image/gif Polyhedron/doc_tex/Polyhedron_ref/fig/add_facet2.gif -text svneol=unset#image/gif Polyhedron/doc_tex/Polyhedron_ref/fig/euler.pdf -text svneol=unset#application/pdf +Polyhedron/doc_tex/Polyhedron_ref/fig/euler.svg -text Polyhedron/doc_tex/Polyhedron_ref/fig/euler_center.gif -text svneol=unset#image/gif Polyhedron/doc_tex/Polyhedron_ref/fig/euler_center.pdf -text svneol=unset#application/pdf Polyhedron/doc_tex/Polyhedron_ref/fig/euler_facet.gif -text svneol=unset#image/gif +Polyhedron/doc_tex/Polyhedron_ref/fig/euler_facet.pdf -text svneol=unset#application/pdf +Polyhedron/doc_tex/Polyhedron_ref/fig/euler_facet.svg -text Polyhedron/doc_tex/Polyhedron_ref/fig/euler_loop.gif -text svneol=unset#image/gif Polyhedron/doc_tex/Polyhedron_ref/fig/euler_loop.pdf -text svneol=unset#application/pdf Polyhedron/doc_tex/Polyhedron_ref/fig/euler_vertex.gif -text svneol=unset#image/gif +Polyhedron/doc_tex/Polyhedron_ref/fig/euler_vertex.pdf -text svneol=unset#application/pdf +Polyhedron/doc_tex/Polyhedron_ref/fig/euler_vertex.svg -text Polyhedron/doc_tex/Polyhedron_ref/fig/halfedge.gif -text svneol=unset#image/gif Polyhedron/doc_tex/Polyhedron_ref/fig/halfedge.pdf -text svneol=unset#application/pdf Polyhedron/doc_tex/Polyhedron_ref/fig/halfedge_small.gif -text svneol=unset#image/gif diff --git a/AABB_tree/doc_tex/AABB_tree_ref/AABBTraits.tex b/AABB_tree/doc_tex/AABB_tree_ref/AABBTraits.tex index 0be28c2830a..095f8f5a732 100644 --- a/AABB_tree/doc_tex/AABB_tree_ref/AABBTraits.tex +++ b/AABB_tree/doc_tex/AABB_tree_ref/AABBTraits.tex @@ -95,10 +95,10 @@ for which the class \ccc{AABB_tree} may receive a distance query. \ccMethod{Closest_point closest_point_object();}{Returns the closest point constructor.} \ccHasModels -\ccc{AABB_traits}. +\ccc{AABB_traits}. \ccSeeAlso -\ccc{AABB_traits}\\ +\ccc{AABB_traits}\\ \ccc{AABB_tree} \ccc{AABBPrimitive} diff --git a/Arrangement_on_surface_2/include/CGAL/Sweep_line_2/Basic_sweep_line_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Sweep_line_2/Basic_sweep_line_2_impl.h index f34e7549469..76b9601f05d 100644 --- a/Arrangement_on_surface_2/include/CGAL/Sweep_line_2/Basic_sweep_line_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Sweep_line_2/Basic_sweep_line_2_impl.h @@ -218,9 +218,12 @@ void Basic_sweep_line_2::_init_structures() { CGAL_assertion(m_queue->empty()); CGAL_assertion((m_statusLine.size() == 0)); - - // Allocate all of the Subcurve objects as one block. - m_subCurves = m_subCurveAlloc.allocate(m_num_of_subCurves); + + // Allocate all of the Subcurve objects as one block. Don't allocate + // anything when there are no subcurves. + if (m_num_of_subCurves > 0) { + m_subCurves = m_subCurveAlloc.allocate(m_num_of_subCurves); + } return; } diff --git a/Distance_2/include/CGAL/squared_distance_2_1.h b/Distance_2/include/CGAL/squared_distance_2_1.h index 17590b17369..9851623ab28 100644 --- a/Distance_2/include/CGAL/squared_distance_2_1.h +++ b/Distance_2/include/CGAL/squared_distance_2_1.h @@ -32,10 +32,6 @@ #include -#include -#include -#include -#include #include #include #include diff --git a/Installation/INSTALL b/Installation/INSTALL index f35323a25a2..4b5b45a7f1d 100644 --- a/Installation/INSTALL +++ b/Installation/INSTALL @@ -11,7 +11,7 @@ are for the most common use cases, and cover the command line tools. For further information, or in case of problems, please see the detailed installation instructions, which can be found in this distribution in the file ./doc_html/index.html or on the CGAL website -http://www.cgal.org/Manual/beta/doc_html/cgal_manual/Installation/Chapter_main.html +http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Installation/Chapter_main.html The documentation of CGAL is available in PDF and HTML formats. It is not bundled with the software but can be downloaded separately diff --git a/Installation/changes.html b/Installation/changes.html index 02f0bc7250d..8b6a253da3f 100644 --- a/Installation/changes.html +++ b/Installation/changes.html @@ -108,7 +108,6 @@ David A. Wheeler's 'SLOCCount', restricted to the include/CGAL/
  • Minor bugfix.
-

Release 4.0.1

@@ -144,6 +143,24 @@ since CGAL-4.0:

could lead to wrong result when meshing from a 3D image. +

3D Boolean Operations on Nef Polygons Embedded on the Sphere

+
    +
  • Fix a memory leak due to the usage of an internal mechanism that has been replaced by boost::any. This also influences the packages +2D Boolean Operations on Nef Polygons, 3D Boolean Operations on Nef Polyhedra, Convex Decomposition of Polyhedra, and +3D Minkowski Sum of Polyhedra. +
+ +

Surface Mesh Parameterization

+
    +
  • Fixed a memory leak.
  • +
+ +

2D Arrangement

+
    +
  • Fixed several memory leaks.
  • +
+ +

Release 4.0

diff --git a/Intersections_3/test/Intersections_3/triangle_other_intersection_test.cpp b/Intersections_3/test/Intersections_3/triangle_other_intersection_test.cpp index 016e772b0b5..6f29a180e18 100644 --- a/Intersections_3/test/Intersections_3/triangle_other_intersection_test.cpp +++ b/Intersections_3/test/Intersections_3/triangle_other_intersection_test.cpp @@ -216,15 +216,20 @@ void random_test() // Precomputed results test // ----------------------------------- template -bool test_aux(const Triangle t, +bool test_aux(bool is_kernel_exact, + const Triangle t, const Query& q, const std::string& name, - const Result& expected) + const Result& expected, + double sq_espilon = 1e-20) { CGAL::Object object = CGAL::intersection(t,q); const Result* pr = CGAL::object_cast(&object); - if ( (NULL != pr) && (expected == *pr) ) + if ( (NULL != pr) && + (is_kernel_exact ? + (expected == *pr) : + CGAL::to_double(CGAL::squared_distance(expected, *pr)) < sq_espilon ) ) { return true; } @@ -243,7 +248,7 @@ bool test_aux(const Triangle t, } template -bool test() +bool test(bool is_kernel_exact = true) { // types typedef typename K::FT FT; @@ -281,10 +286,10 @@ bool test() Segment s32(p3,p2); Segment s31(p3,p1); - bool b = test_aux(t,s12,"t-s12",s12); - b &= test_aux(t,s21,"t-s21",s21); - b &= test_aux(t,s13,"t-s13",s13); - b &= test_aux(t,s23,"t-s23",s23); + bool b = test_aux(is_kernel_exact,t,s12,"t-s12",s12); + b &= test_aux(is_kernel_exact,t,s21,"t-s21",s21); + b &= test_aux(is_kernel_exact,t,s13,"t-s13",s13); + b &= test_aux(is_kernel_exact,t,s23,"t-s23",s23); // Inside points Point p4(FT(0.5), FT(0.5), FT(0.)); @@ -318,30 +323,30 @@ bool test() Segment s78(p7,p8); Segment s87(p8,p7); - b &= test_aux(t,s14,"t-s14",s14); - b &= test_aux(t,s41,"t-s41",s41); - b &= test_aux(t,s24,"t-s24",s24); - b &= test_aux(t,s42,"t-s42",s42); - b &= test_aux(t,s15,"t-s15",s15); - b &= test_aux(t,s25,"t-s25",s25); - b &= test_aux(t,s34,"t-s34",s34); - b &= test_aux(t,s35,"t-s35",s35); - b &= test_aux(t,s36,"t-s36",s36); - b &= test_aux(t,s45,"t-s45",s45); - b &= test_aux(t,s16,"t-s16",s16); - b &= test_aux(t,s26,"t-s26",s26); - b &= test_aux(t,s62,"t-s62",s62); - b &= test_aux(t,s46,"t-s46",s46); - b &= test_aux(t,s65,"t-s65",s65); - b &= test_aux(t,s64,"t-s64",s64); - b &= test_aux(t,s48,"t-s48",s48); - b &= test_aux(t,s56,"t-s56",s56); - b &= test_aux(t,s17,"t-t17",s17); - b &= test_aux(t,s67,"t-t67",s67); - b &= test_aux(t,s68,"t-s68",s68); - b &= test_aux(t,s86,"t-s86",s86); - b &= test_aux(t,s78,"t-t78",s78); - b &= test_aux(t,s87,"t-t87",s87); + b &= test_aux(is_kernel_exact,t,s14,"t-s14",s14); + b &= test_aux(is_kernel_exact,t,s41,"t-s41",s41); + b &= test_aux(is_kernel_exact,t,s24,"t-s24",s24); + b &= test_aux(is_kernel_exact,t,s42,"t-s42",s42); + b &= test_aux(is_kernel_exact,t,s15,"t-s15",s15); + b &= test_aux(is_kernel_exact,t,s25,"t-s25",s25); + b &= test_aux(is_kernel_exact,t,s34,"t-s34",s34); + b &= test_aux(is_kernel_exact,t,s35,"t-s35",s35); + b &= test_aux(is_kernel_exact,t,s36,"t-s36",s36); + b &= test_aux(is_kernel_exact,t,s45,"t-s45",s45); + b &= test_aux(is_kernel_exact,t,s16,"t-s16",s16); + b &= test_aux(is_kernel_exact,t,s26,"t-s26",s26); + b &= test_aux(is_kernel_exact,t,s62,"t-s62",s62); + b &= test_aux(is_kernel_exact,t,s46,"t-s46",s46); + b &= test_aux(is_kernel_exact,t,s65,"t-s65",s65); + b &= test_aux(is_kernel_exact,t,s64,"t-s64",s64); + b &= test_aux(is_kernel_exact,t,s48,"t-s48",s48); + b &= test_aux(is_kernel_exact,t,s56,"t-s56",s56); + b &= test_aux(is_kernel_exact,t,s17,"t-t17",s17); + b &= test_aux(is_kernel_exact,t,s67,"t-t67",s67); + b &= test_aux(is_kernel_exact,t,s68,"t-s68",s68); + b &= test_aux(is_kernel_exact,t,s86,"t-s86",s86); + b &= test_aux(is_kernel_exact,t,s78,"t-t78",s78); + b &= test_aux(is_kernel_exact,t,s87,"t-t87",s87); // Outside points (in triangle plane) Point pA(FT(-0.5), FT(1.), FT(0.5)); @@ -362,17 +367,17 @@ bool test() Segment s1F(p1,pF); Segment sF6(pF,p6); - b &= test_aux(t,sAB,"t-sAB",p2); - b &= test_aux(t,sBC,"t-sBC",s46); - b &= test_aux(t,s2E,"t-s2E",s26); - b &= test_aux(t,sE2,"t-sE2",s62); - b &= test_aux(t,s2A,"t-s2A",p2); - b &= test_aux(t,s6E,"t-s6E",p6); - b &= test_aux(t,sB8,"t-sB8",s48); - b &= test_aux(t,sC8,"t-sC8",s68); - b &= test_aux(t,s8C,"t-s8C",s86); - b &= test_aux(t,s1F,"t-s1F",s13); - b &= test_aux(t,sF6,"t-sF6",s36); + b &= test_aux(is_kernel_exact,t,sAB,"t-sAB",p2); + b &= test_aux(is_kernel_exact,t,sBC,"t-sBC",s46); + b &= test_aux(is_kernel_exact,t,s2E,"t-s2E",s26); + b &= test_aux(is_kernel_exact,t,sE2,"t-sE2",s62); + b &= test_aux(is_kernel_exact,t,s2A,"t-s2A",p2); + b &= test_aux(is_kernel_exact,t,s6E,"t-s6E",p6); + b &= test_aux(is_kernel_exact,t,sB8,"t-sB8",s48); + b &= test_aux(is_kernel_exact,t,sC8,"t-sC8",s68); + b &= test_aux(is_kernel_exact,t,s8C,"t-s8C",s86); + b &= test_aux(is_kernel_exact,t,s1F,"t-s1F",s13); + b &= test_aux(is_kernel_exact,t,sF6,"t-sF6",s36); // Outside triangle plane Point pa(FT(0.), FT(0.), FT(0.)); @@ -386,11 +391,11 @@ bool test() Segment sa8(pa,p8); Segment sb2(pb,p2); - b &= test_aux(t,sab,"t-sab",p1); - b &= test_aux(t,sac,"t-sac",p6); - b &= test_aux(t,sae,"t-sae",p8); - b &= test_aux(t,sa8,"t-sa8",p8); - b &= test_aux(t,sb2,"t-sb2",p2); + b &= test_aux(is_kernel_exact,t,sab,"t-sab",p1); + b &= test_aux(is_kernel_exact,t,sac,"t-sac",p6); + b &= test_aux(is_kernel_exact,t,sae,"t-sae",p8); + b &= test_aux(is_kernel_exact,t,sa8,"t-sa8",p8); + b &= test_aux(is_kernel_exact,t,sb2,"t-sb2",p2); // ----------------------------------- // ray queries @@ -401,10 +406,10 @@ bool test() Ray r13(p1,p3); Ray r23(p2,p3); - b &= test_aux(t,r12,"t-r12",s12); - b &= test_aux(t,r21,"t-r21",s21); - b &= test_aux(t,r13,"t-r13",s13); - b &= test_aux(t,r23,"t-r23",s23); + b &= test_aux(is_kernel_exact,t,r12,"t-r12",s12); + b &= test_aux(is_kernel_exact,t,r21,"t-r21",s21); + b &= test_aux(is_kernel_exact,t,r13,"t-r13",s13); + b &= test_aux(is_kernel_exact,t,r23,"t-r23",s23); // In triangle Point p9_(FT(0.), FT(0.5), FT(0.5)); @@ -432,26 +437,26 @@ bool test() Ray r68(p6,p8); Segment r89_res(p8,p9_); - b &= test_aux(t,r14,"t-r14",s12); - b &= test_aux(t,r41,"t-r41",s41); - b &= test_aux(t,r24,"t-r24",s21); - b &= test_aux(t,r42,"t-r42",s42); - b &= test_aux(t,r15,"t-r15",s15); - b &= test_aux(t,r25,"t-r25",s23); - b &= test_aux(t,r34,"t-r34",s34); - b &= test_aux(t,r35,"t-r35",s32); - b &= test_aux(t,r36,"t-r36",s31); - b &= test_aux(t,r45,"t-r45",s45); - b &= test_aux(t,r16,"t-r16",s13); - b &= test_aux(t,r26,"t-r26",s26); - b &= test_aux(t,r62,"t-r62",s62); - b &= test_aux(t,r46,"t-r46",s46); - b &= test_aux(t,r48,"t-r48",s46); - b &= test_aux(t,r56,"t-r56",s56); - b &= test_aux(t,r47,"t-r47",s45); - b &= test_aux(t,r89,"t-t89",r89_res); - b &= test_aux(t,r68,"t-r68",s64); - b &= test_aux(t,r86,"t-r86",s86); + b &= test_aux(is_kernel_exact,t,r14,"t-r14",s12); + b &= test_aux(is_kernel_exact,t,r41,"t-r41",s41); + b &= test_aux(is_kernel_exact,t,r24,"t-r24",s21); + b &= test_aux(is_kernel_exact,t,r42,"t-r42",s42); + b &= test_aux(is_kernel_exact,t,r15,"t-r15",s15); + b &= test_aux(is_kernel_exact,t,r25,"t-r25",s23); + b &= test_aux(is_kernel_exact,t,r34,"t-r34",s34); + b &= test_aux(is_kernel_exact,t,r35,"t-r35",s32); + b &= test_aux(is_kernel_exact,t,r36,"t-r36",s31); + b &= test_aux(is_kernel_exact,t,r45,"t-r45",s45); + b &= test_aux(is_kernel_exact,t,r16,"t-r16",s13); + b &= test_aux(is_kernel_exact,t,r26,"t-r26",s26); + b &= test_aux(is_kernel_exact,t,r62,"t-r62",s62); + b &= test_aux(is_kernel_exact,t,r46,"t-r46",s46); + b &= test_aux(is_kernel_exact,t,r48,"t-r48",s46); + b &= test_aux(is_kernel_exact,t,r56,"t-r56",s56); + b &= test_aux(is_kernel_exact,t,r47,"t-r47",s45); + b &= test_aux(is_kernel_exact,t,r89,"t-t89",r89_res); + b &= test_aux(is_kernel_exact,t,r68,"t-r68",s64); + b &= test_aux(is_kernel_exact,t,r86,"t-r86",s86); // Outside points (in triangre prane) @@ -467,17 +472,17 @@ bool test() Ray r1F(p1,pF); Ray rF6(pF,p6); - b &= test_aux(t,rAB,"t-rAB",p2); - b &= test_aux(t,rBC,"t-rBC",s46); - b &= test_aux(t,r2E,"t-r2E",s26); - b &= test_aux(t,rE2,"t-rE2",s62); - b &= test_aux(t,r2A,"t-r2A",p2); - b &= test_aux(t,r6E,"t-r6E",p6); - b &= test_aux(t,rB8,"t-rB8",s46); - b &= test_aux(t,rC8,"t-rC8",s64); - b &= test_aux(t,r8C,"t-r8C",s86); - b &= test_aux(t,r1F,"t-r1F",s13); - b &= test_aux(t,rF6,"t-rF6",s31); + b &= test_aux(is_kernel_exact,t,rAB,"t-rAB",p2); + b &= test_aux(is_kernel_exact,t,rBC,"t-rBC",s46); + b &= test_aux(is_kernel_exact,t,r2E,"t-r2E",s26); + b &= test_aux(is_kernel_exact,t,rE2,"t-rE2",s62); + b &= test_aux(is_kernel_exact,t,r2A,"t-r2A",p2); + b &= test_aux(is_kernel_exact,t,r6E,"t-r6E",p6); + b &= test_aux(is_kernel_exact,t,rB8,"t-rB8",s46); + b &= test_aux(is_kernel_exact,t,rC8,"t-rC8",s64); + b &= test_aux(is_kernel_exact,t,r8C,"t-r8C",s86); + b &= test_aux(is_kernel_exact,t,r1F,"t-r1F",s13); + b &= test_aux(is_kernel_exact,t,rF6,"t-rF6",s31); // Outside triangle plane Ray rab(pa,pb); @@ -486,11 +491,11 @@ bool test() Ray ra8(pa,p8); Ray rb2(pb,p2); - b &= test_aux(t,rab,"t-rab",p1); - b &= test_aux(t,rac,"t-rac",p6); - b &= test_aux(t,rae,"t-rae",p8); - b &= test_aux(t,ra8,"t-ra8",p8); - b &= test_aux(t,rb2,"t-rb2",p2); + b &= test_aux(is_kernel_exact,t,rab,"t-rab",p1); + b &= test_aux(is_kernel_exact,t,rac,"t-rac",p6); + b &= test_aux(is_kernel_exact,t,rae,"t-rae",p8); + b &= test_aux(is_kernel_exact,t,ra8,"t-ra8",p8); + b &= test_aux(is_kernel_exact,t,rb2,"t-rb2",p2); // ----------------------------------- // Line queries @@ -501,10 +506,10 @@ bool test() Line l13(p1,p3); Line l23(p2,p3); - b &= test_aux(t,l12,"t-l12",s12); - b &= test_aux(t,l21,"t-l21",s21); - b &= test_aux(t,l13,"t-l13",s13); - b &= test_aux(t,l23,"t-l23",s23); + b &= test_aux(is_kernel_exact,t,l12,"t-l12",s12); + b &= test_aux(is_kernel_exact,t,l21,"t-l21",s21); + b &= test_aux(is_kernel_exact,t,l13,"t-l13",s13); + b &= test_aux(is_kernel_exact,t,l23,"t-l23",s23); // In triangle Line l14(p1,p4); @@ -530,26 +535,26 @@ bool test() Segment l89_res(p1,p9_); - b &= test_aux(t,l14,"t-l14",s12); - b &= test_aux(t,l41,"t-l41",s21); - b &= test_aux(t,l24,"t-l24",s21); - b &= test_aux(t,l42,"t-l42",s12); - b &= test_aux(t,l15,"t-l15",s15); - b &= test_aux(t,l25,"t-l25",s23); - b &= test_aux(t,l34,"t-l34",s34); - b &= test_aux(t,l35,"t-l35",s32); - b &= test_aux(t,l36,"t-l36",s31); - b &= test_aux(t,l45,"t-l45",s45); - b &= test_aux(t,l16,"t-l16",s13); - b &= test_aux(t,l26,"t-l26",s26); - b &= test_aux(t,l62,"t-l62",s62); - b &= test_aux(t,l46,"t-l46",s46); - b &= test_aux(t,l48,"t-l48",s46); - b &= test_aux(t,l56,"t-l56",s56); - b &= test_aux(t,l47,"t-l47",s45); - b &= test_aux(t,l89,"t-t89",l89_res); - b &= test_aux(t,l68,"t-l68",s64); - b &= test_aux(t,l86,"t-l86",s46); + b &= test_aux(is_kernel_exact,t,l14,"t-l14",s12); + b &= test_aux(is_kernel_exact,t,l41,"t-l41",s21); + b &= test_aux(is_kernel_exact,t,l24,"t-l24",s21); + b &= test_aux(is_kernel_exact,t,l42,"t-l42",s12); + b &= test_aux(is_kernel_exact,t,l15,"t-l15",s15); + b &= test_aux(is_kernel_exact,t,l25,"t-l25",s23); + b &= test_aux(is_kernel_exact,t,l34,"t-l34",s34); + b &= test_aux(is_kernel_exact,t,l35,"t-l35",s32); + b &= test_aux(is_kernel_exact,t,l36,"t-l36",s31); + b &= test_aux(is_kernel_exact,t,l45,"t-l45",s45); + b &= test_aux(is_kernel_exact,t,l16,"t-l16",s13); + b &= test_aux(is_kernel_exact,t,l26,"t-l26",s26); + b &= test_aux(is_kernel_exact,t,l62,"t-l62",s62); + b &= test_aux(is_kernel_exact,t,l46,"t-l46",s46); + b &= test_aux(is_kernel_exact,t,l48,"t-l48",s46); + b &= test_aux(is_kernel_exact,t,l56,"t-l56",s56); + b &= test_aux(is_kernel_exact,t,l47,"t-l47",s45); + b &= test_aux(is_kernel_exact,t,l89,"t-t89",l89_res); + b &= test_aux(is_kernel_exact,t,l68,"t-l68",s64); + b &= test_aux(is_kernel_exact,t,l86,"t-l86",s46); // Outside points (in triangle plane) @@ -565,17 +570,17 @@ bool test() Line l1F(p1,pF); Line lF6(pF,p6); - b &= test_aux(t,lAB,"t-lAB",p2); - b &= test_aux(t,lBC,"t-lBC",s46); - b &= test_aux(t,l2E,"t-l2E",s26); - b &= test_aux(t,lE2,"t-lE2",s62); - b &= test_aux(t,l2A,"t-l2A",p2); - b &= test_aux(t,l6E,"t-l6E",s26); - b &= test_aux(t,lB8,"t-lB8",s46); - b &= test_aux(t,lC8,"t-lC8",s64); - b &= test_aux(t,l8C,"t-l8C",s46); - b &= test_aux(t,l1F,"t-l1F",s13); - b &= test_aux(t,lF6,"t-lF6",s31); + b &= test_aux(is_kernel_exact,t,lAB,"t-lAB",p2); + b &= test_aux(is_kernel_exact,t,lBC,"t-lBC",s46); + b &= test_aux(is_kernel_exact,t,l2E,"t-l2E",s26); + b &= test_aux(is_kernel_exact,t,lE2,"t-lE2",s62); + b &= test_aux(is_kernel_exact,t,l2A,"t-l2A",p2); + b &= test_aux(is_kernel_exact,t,l6E,"t-l6E",s26); + b &= test_aux(is_kernel_exact,t,lB8,"t-lB8",s46); + b &= test_aux(is_kernel_exact,t,lC8,"t-lC8",s64); + b &= test_aux(is_kernel_exact,t,l8C,"t-l8C",s46); + b &= test_aux(is_kernel_exact,t,l1F,"t-l1F",s13); + b &= test_aux(is_kernel_exact,t,lF6,"t-lF6",s31); // Outside triangle plane Line lab(pa,pb); @@ -584,11 +589,11 @@ bool test() Line la8(pa,p8); Line lb2(pb,p2); - b &= test_aux(t,lab,"t-lab",p1); - b &= test_aux(t,lac,"t-lac",p6); - b &= test_aux(t,lae,"t-lae",p8); - b &= test_aux(t,la8,"t-la8",p8); - b &= test_aux(t,lb2,"t-lb2",p2); + b &= test_aux(is_kernel_exact,t,lab,"t-lab",p1); + b &= test_aux(is_kernel_exact,t,lac,"t-lac",p6); + b &= test_aux(is_kernel_exact,t,lae,"t-lae",p8); + b &= test_aux(is_kernel_exact,t,la8,"t-la8",p8); + b &= test_aux(is_kernel_exact,t,lb2,"t-lb2",p2); return b; @@ -606,22 +611,22 @@ int main() // ----------------------------------- std::cout << "Test precomputed intersection results" << std::endl; std::cout << "\tTesting with Simple_cartesian..." << std::endl ; - bool b = test(); + bool b = test(false); std::cout << "\tTesting with Simple_cartesian..." << std::endl ; - b &= test(); + b &= test(false); std::cout << "\tTesting with Cartesian..." << std::endl ; - b &= test(); + b &= test(false); std::cout << "\tTesting with Cartesian..." << std::endl ; - b &= test(); + b &= test(false); std::cout << "\tTesting with Exact_predicates_inexact_constructions_kernel..." << std::endl ; - b &= test(); + b &= test(false); std::cout << "\tTesting with Exact_predicates_exact_constructions_kernel..." << std::endl ; - b &= test(); + b &= test(true); //test with a coplanar segment b &= CGAL::intersection( Epec::Segment_3(Epec::Point_3(0.125, 0, -0.125),Epec::Point_3(0.25, 0, -0.125) ), diff --git a/Kernel_23/doc_tex/Kernel_23_ref/intersection.tex b/Kernel_23/doc_tex/Kernel_23_ref/intersection.tex index 8cd6320dbdd..0e6ddab751e 100644 --- a/Kernel_23/doc_tex/Kernel_23_ref/intersection.tex +++ b/Kernel_23/doc_tex/Kernel_23_ref/intersection.tex @@ -37,27 +37,48 @@ following: \hline type A & type B & \parbox{4 cm}{\vspace{1 mm}{return type}} \\ \hline +\ccStyle{Iso_rectangle_2} & \ccStyle{Iso_rectangle_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Iso_rectangle_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Iso_rectangle_2} & \ccStyle{Line_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Segment_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Iso_rectangle_2} & \ccStyle{Ray_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Segment_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Iso_rectangle_2} & \ccStyle{Segment_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Segment_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Iso_rectangle_2} & \ccStyle{Triangle_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Segment_2} + \\ \ccStyle{Triangle_2} + \\ \ccStyle{std::vector} + \vspace{1 mm}} \\ +\hline \ccStyle{Line_2} & \ccStyle{Line_2} & \parbox{4 cm}{\vspace{1 mm} \ccStyle{Point_2} \\ \ccStyle{Line_2} \vspace{1 mm}} \\ \hline -\ccStyle{Segment_2} & \ccStyle{Line_2} & \parbox{4 cm}{\vspace{1 mm} - \ccStyle{Point_2} - \\ \ccStyle{Segment_2} - \vspace{1 mm}} \\ -\hline -\ccStyle{Segment_2} & \ccStyle{Segment_2} & \parbox{4 cm}{\vspace{1 mm} - \ccStyle{Point_2} - \\ \ccStyle{Segment_2} - \vspace{1 mm}} \\ -\hline -\ccStyle{Ray_2} & \ccStyle{Line_2} & \parbox{4 cm}{\vspace{1 mm} +\ccStyle{Line_2} & \ccStyle{Ray_2} & \parbox{4 cm}{\vspace{1 mm} \ccStyle{Point_2} \\ \ccStyle{Ray_2} \vspace{1 mm}} \\ \hline -\ccStyle{Ray_2} & \ccStyle{Segment_2} & \parbox{4 cm}{\vspace{1 mm} +\ccStyle{Line_2} & \ccStyle{Segment_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Segment_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Line_2} & \ccStyle{Triangle_2} & \parbox{4 cm}{\vspace{1 mm} \ccStyle{Point_2} \\ \ccStyle{Segment_2} \vspace{1 mm}} \\ @@ -68,17 +89,22 @@ type A & type B & \parbox{4 cm}{\vspace{1 mm}{return type}} \\ \\ \ccStyle{Ray_2} \vspace{1 mm}} \\ \hline -\ccStyle{Triangle_2} & \ccStyle{Line_2} & \parbox{4 cm}{\vspace{1 mm} +\ccStyle{Ray_2} & \ccStyle{Segment_2} & \parbox{4 cm}{\vspace{1 mm} \ccStyle{Point_2} \\ \ccStyle{Segment_2} \vspace{1 mm}} \\ \hline -\ccStyle{Triangle_2} & \ccStyle{Segment_2} & \parbox{4 cm}{\vspace{1 mm} +\ccStyle{Ray_2} & \ccStyle{Triangle_2} & \parbox{4 cm}{\vspace{1 mm} \ccStyle{Point_2} \\ \ccStyle{Segment_2} \vspace{1 mm}} \\ \hline -\ccStyle{Triangle_2} & \ccStyle{Ray_2} & \parbox{4 cm}{\vspace{1 mm} +\ccStyle{Segment_2} & \ccStyle{Segment_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Segment_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Segment_2} & \ccStyle{Triangle_2} & \parbox{4 cm}{\vspace{1 mm} \ccStyle{Point_2} \\ \ccStyle{Segment_2} \vspace{1 mm}} \\ @@ -90,25 +116,6 @@ type A & type B & \parbox{4 cm}{\vspace{1 mm}{return type}} \\ \\ \ccStyle{std::vector} \vspace{1 mm}} \\ \hline -\ccStyle{Iso_rectangle_2} & \ccStyle{Line_2} & \parbox{4 cm}{\vspace{1 mm} - \ccStyle{Point_2} - \\ \ccStyle{Segment_2} - \vspace{1 mm}} \\ -\hline -\ccStyle{Iso_rectangle_2} & \ccStyle{Segment_2} & \parbox{4 cm}{\vspace{1 mm} - \ccStyle{Point_2} - \\ \ccStyle{Segment_2} - \vspace{1 mm}} \\ -\hline -\ccStyle{Iso_rectangle_2} & \ccStyle{Ray_2} & \parbox{4 cm}{\vspace{1 mm} - \ccStyle{Point_2} - \\ \ccStyle{Segment_2} - \vspace{1 mm}} \\ -\hline -\ccStyle{Iso_rectangle_2} & \ccStyle{Iso_rectangle_2} & \parbox{4 cm}{\vspace{1 mm} - \ccStyle{Iso_rectangle_2} - \vspace{1 mm}} \\ -\hline {\ccStyle{Line_3}} & {\ccStyle{Line_3}} & \parbox{4 cm}{\vspace{1 mm} \ccStyle{Point_3} \\ \ccStyle{Line_3} @@ -209,6 +216,48 @@ type A & type B & \parbox{4 cm}{\vspace{1 mm}{return type}} \\ type B return type + + Iso_rectangle_2 + Iso_rectangle_2 + + +
Iso_rectangle_2
+ + + + Iso_rectangle_2 + Line_2 + + + +
Point_2
Segment_2
+ + + Iso_rectangle_2 + Ray_2 + + + +
Point_2
Segment_2
+ + + Iso_rectangle_2 + Segment_2 + + + +
Point_2
Segment_2
+ + + Iso_rectangle_2 + Triangle_2 + + + + + +
Point_2
Segment_2
Triangle_2
std::vector<Point_2>
+ Line_2 Line_2 @@ -218,37 +267,29 @@ type A & type B & \parbox{4 cm}{\vspace{1 mm}{return type}} \\ - Segment_2 Line_2 - - - -
Point_2
Segment_2
- - - Segment_2 - Segment_2 - - - -
Point_2
Segment_2
- - Ray_2 - Line_2
Point_2
Ray_2
- Ray_2 + Line_2 Segment_2
Point_2
Segment_2
+ + Line_2 + Triangle_2 + + + +
Point_2
Segment_2
+ Ray_2 Ray_2 @@ -259,15 +300,7 @@ type A & type B & \parbox{4 cm}{\vspace{1 mm}{return type}} \\ - Triangle_2 - Line_2 - - - -
Point_2
Segment_2
- - - Triangle_2 + Ray_2 Segment_2 @@ -275,8 +308,24 @@ type A & type B & \parbox{4 cm}{\vspace{1 mm}{return type}} \\
Point_2
- Triangle_2 Ray_2 + Triangle_2 + + + +
Point_2
Segment_2
+ + + Segment_2 + Segment_2 + + + +
Point_2
Segment_2
+ + + Segment_2 + Triangle_2 @@ -292,37 +341,6 @@ type A & type B & \parbox{4 cm}{\vspace{1 mm}{return type}} \\
Point_2
Segment_2
std::vector<Point_2>
- - Iso_rectangle_2 - Line_2 - - - -
Point_2
Segment_2
- - - Iso_rectangle_2 - Segment_2 - - - -
Point_2
Segment_2
- - - Iso_rectangle_2 - Ray_2 - - - -
Point_2
Segment_2
- - - Iso_rectangle_2 - Iso_rectangle_2 - - -
Iso_rectangle_2
- Line_3 Line_3 diff --git a/Kernel_23/include/CGAL/Kernel_traits.h b/Kernel_23/include/CGAL/Kernel_traits.h index 065b32dd94a..2ab73d5a12a 100644 --- a/Kernel_23/include/CGAL/Kernel_traits.h +++ b/Kernel_23/include/CGAL/Kernel_traits.h @@ -31,6 +31,7 @@ template struct Kernel_traits { typedef typename T::R Kernel; + typedef Kernel type; }; } // end namespace CGAL diff --git a/Linear_cell_complex/include/CGAL/Cell_attribute_with_point.h b/Linear_cell_complex/include/CGAL/Cell_attribute_with_point.h index abb7ca90938..52bccaf3fc1 100644 --- a/Linear_cell_complex/include/CGAL/Cell_attribute_with_point.h +++ b/Linear_cell_complex/include/CGAL/Cell_attribute_with_point.h @@ -85,10 +85,6 @@ namespace CGAL { Cell_attribute_with_point(const Point& apoint) : Base2(apoint) {} - /// Contructor with an attribute in parameter. - Cell_attribute_with_point(const Info& ainfo) : Base1(ainfo) - {} - /// Contructor with a point and an attribute in parameters. Cell_attribute_with_point(const Point& apoint, const Info& ainfo) : Base1(ainfo), diff --git a/Maintenance/infrastructure/cgal.geometryfactory.com/crontab b/Maintenance/infrastructure/cgal.geometryfactory.com/crontab index 175d6bc0540..257eda1008d 100644 --- a/Maintenance/infrastructure/cgal.geometryfactory.com/crontab +++ b/Maintenance/infrastructure/cgal.geometryfactory.com/crontab @@ -16,9 +16,8 @@ # Create internal release # The script also updates the manual tools. # "next" alone -#0 21 * * Mon,Tue,Wed,Thu,Fri,Sun cd $HOME/CGAL/create_internal_release; $HOME/bin/create_release $HOME/CGAL/next --public --do-it +0 21 * * Fri,Sat cd $HOME/CGAL/create_internal_release; $HOME/bin/create_release $HOME/CGAL/next --public --do-it -0 21 * * Fri cd $HOME/CGAL/create_internal_release; $HOME/bin/create_release $HOME/CGAL/next --public --do-it # "next" + candidates 0 21 * * Mon,Tue,Wed,Thu,Sun cd $HOME/CGAL/create_internal_release; $HOME/bin/create_release $HOME/CGAL/next $HOME/CGAL/candidate-packages --public --do-it diff --git a/Mesh_3/doc_tex/Mesh_3_ref/Mesh_polyhedron_3.tex b/Mesh_3/doc_tex/Mesh_3_ref/Mesh_polyhedron_3.tex index 836aff7874a..d88a91a6168 100644 --- a/Mesh_3/doc_tex/Mesh_3_ref/Mesh_polyhedron_3.tex +++ b/Mesh_3/doc_tex/Mesh_3_ref/Mesh_polyhedron_3.tex @@ -12,7 +12,7 @@ % +------------------------------------------------------------------------+ -\begin{ccRefClass}{Mesh_polyhedron_3} %% add template arg's if necessary +\begin{ccRefClass}{Mesh_polyhedron_3} %% add template arg's if necessary %% \ccHtmlCrossLink{} %% add further rules for cross referencing links %% \ccHtmlIndexC[class]{} %% add further index entries @@ -28,16 +28,18 @@ detection algorithm. \ccParameters -Template parameter \ccc{Gt} stands for the geometric traits associated -to the meshing process. It should be a model of concept \ccc{PolyhedronTraits_3}. +Template parameter \ccc{IGT} stands for the geometric traits associated +to the meshing process. It should be a model of the two concepts +\ccc{PolyhedronTraits_3} and \ccc{IntersectionGeometricTraits_3}. \ccTypes -\ccNestedType{type}{\ccc{CGAL::Polyhedron_3} type with customized \ccc{PolyhedronItems_3} +\ccNestedType{type}{\ccc{CGAL::Polyhedron_3} type with customized \ccc{PolyhedronItems_3} designed to handle sharp feature detection.} \ccSeeAlso +\ccRefIdfierPage{CGAL::Polyhedron_3} \ccRefIdfierPage{CGAL::Polyhedral_mesh_domain_with_features_3} \end{ccRefClass} diff --git a/Mesh_3/doc_tex/Mesh_3_ref/Polyhedral_mesh_domain_with_features_3.tex b/Mesh_3/doc_tex/Mesh_3_ref/Polyhedral_mesh_domain_with_features_3.tex index 3c7ccb9f9cf..ff07014507c 100644 --- a/Mesh_3/doc_tex/Mesh_3_ref/Polyhedral_mesh_domain_with_features_3.tex +++ b/Mesh_3/doc_tex/Mesh_3_ref/Polyhedral_mesh_domain_with_features_3.tex @@ -53,7 +53,7 @@ instantiated with a model of the concept \ccc{IntersectionGeometricTraits_3}. \ccConstructor{template Polyhedral_mesh_domain_with_features_3(const Polyhedron& p);}{ Constructs a \ccc{Polyhedral_mesh_domain_with_features_3} from a \ccc{Polyhedron}. -The only requirement on type \ccc{Polyhedron} is that \ccc{CGAL::Polyhedron_3} should +The only requirement on type \ccc{Polyhedron} is that \ccc{CGAL::Mesh_polyhedron_3::type} should be constructible from \ccc{Polyhedron}. No feature detection is done at this level. Note that a copy of \ccc{p} will be done.} @@ -73,7 +73,7 @@ those triangles is a feature edge.} \ccRefConceptPage{MeshDomainWithFeatures_3} \\ \ccRefIdfierPage{CGAL::Mesh_domain_with_polyline_features_3} \\ \ccRefIdfierPage{CGAL::Polyhedral_mesh_domain_3} \\ -\ccRefConceptPage{Mesh_polyhedron_3} +\ccRefIdfierPage{CGAL::Mesh_polyhedron_3} \end{ccRefClass} diff --git a/Mesh_3/doc_tex/Mesh_3_ref/intro.tex b/Mesh_3/doc_tex/Mesh_3_ref/intro.tex index dd1b5e63f7f..62b6ec7868c 100644 --- a/Mesh_3/doc_tex/Mesh_3_ref/intro.tex +++ b/Mesh_3/doc_tex/Mesh_3_ref/intro.tex @@ -51,7 +51,7 @@ and their associated classes: \ccRefIdfierPage{CGAL::Polyhedral_mesh_domain_with_features_3} \\ \ccRefIdfierPage{CGAL::Labeled_image_mesh_domain_3} \\ \ccRefIdfierPage{CGAL::Mesh_domain_with_polyline_features_3} \\ -\ccRefIdfierPage{CGAL::Mesh_polyhedron_3} \\ +\ccRefIdfierPage{CGAL::Mesh_polyhedron_3} \\ \ccRefIdfierPage{CGAL::Triangle_accessor_3,K>} \\ diff --git a/Nef_2/include/CGAL/Nef_2/HDS_items.h b/Nef_2/include/CGAL/Nef_2/HDS_items.h index 213e191b90c..ac11eea2930 100644 --- a/Nef_2/include/CGAL/Nef_2/HDS_items.h +++ b/Nef_2/include/CGAL/Nef_2/HDS_items.h @@ -26,6 +26,9 @@ #include #include #include +#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO +#include +#endif namespace CGAL { @@ -61,7 +64,11 @@ public: typedef typename Refs::Face_const_handle Face_const_handle; typedef typename Refs::Halfedge Halfedge; typedef typename Refs::Face Face; - typedef void* GenPtr; + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + typedef void* GenPtr; + #else + typedef boost::any GenPtr; + #endif typedef typename Traits::Point Point; // geometric embedding typedef typename Traits::Mark Mark; // information @@ -76,12 +83,20 @@ private: GenPtr _i; public: - Nef_vertex_2() : _h(),_f(),_ivit(),_m(0),_i((GenPtr)0xABCD) {} + Nef_vertex_2() : _h(),_f(),_ivit(),_m(0) + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + ,_i((GenPtr)0xABCD) + #endif + {} // constructs an uninitialized vertex concerning embedding // and mark. All links are initialized by their default value. Nef_vertex_2( const Point& p) : - _h(),_f(),_p(p),_ivit(),_m(0),_i((GenPtr)0xABCD) {} + _h(),_f(),_p(p),_ivit(),_m(0) + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + ,_i((GenPtr)0xABCD) + #endif + {} // constructs a vertex with embedding |p| and mark |m|. // All links are initialized by their default value. @@ -138,7 +153,11 @@ public: typedef typename Refs::Face_const_handle Face_const_handle; typedef typename Refs::Vertex Vertex; typedef typename Refs::Face Face; - typedef void* GenPtr; + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + typedef void* GenPtr; + #else + typedef boost::any GenPtr; + #endif typedef typename std::list::iterator fc_iterator; @@ -154,7 +173,11 @@ protected: public: Nef_halfedge_2() : - opp(),prv(),nxt(),_v(),_f(),_fcit(),_m(0),_i((GenPtr)0xABCD) {} + opp(),prv(),nxt(),_v(),_f(),_fcit(),_m(0) + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + ,_i((GenPtr)0xABCD) + #endif + {} /*{\Mcreate constructs an uninitialized halfedge concerning embedding and mark. All links are initialized by their default value.}*/ @@ -227,7 +250,11 @@ public: typedef typename Refs::Face_const_handle Face_const_handle; typedef typename Refs::Vertex Vertex; typedef typename Refs::Halfedge Halfedge; - typedef void* GenPtr; + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + typedef void* GenPtr; + #else + typedef boost::any GenPtr; + #endif typedef typename Traits::Mark Mark; // mark information @@ -300,7 +327,11 @@ private: GenPtr _i; public: - Nef_face_2() : _e(),_m(0),_i((GenPtr)0xABCD) {} + Nef_face_2() : _e(),_m(0) + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + ,_i((GenPtr)0xABCD) + #endif + {} /*{\Mcreate constructs an uninitialized face with undefined mark, empty face cycle list, and empty isolated vertices list.}*/ diff --git a/Nef_2/include/CGAL/Nef_2/PM_checker.h b/Nef_2/include/CGAL/Nef_2/PM_checker.h index a22caee7723..339baf0d0ad 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_checker.h +++ b/Nef_2/include/CGAL/Nef_2/PM_checker.h @@ -174,9 +174,9 @@ check_forward_prefix_condition(Vertex_const_handle v) const error_status << " el_forward = " << el_forward; error_status << " is_left_turn = " << is_left_turn; CGAL_assertion_msg( (ef == el || - ef_forward && !el_forward || - ef_forward && el_forward && is_left_turn || - !ef_forward && !el_forward && is_left_turn) , + (ef_forward && !el_forward) || + (ef_forward && el_forward && is_left_turn) || + (!ef_forward && !el_forward && is_left_turn)) , error_status.str().c_str()); } diff --git a/Nef_2/include/CGAL/Nef_2/PM_const_decorator.h b/Nef_2/include/CGAL/Nef_2/PM_const_decorator.h index e0f6245e4d8..946f3313e3e 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_const_decorator.h +++ b/Nef_2/include/CGAL/Nef_2/PM_const_decorator.h @@ -32,6 +32,10 @@ #define CGAL_NEF_DEBUG 7 #include +#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO +#include +#endif + namespace CGAL { template @@ -132,8 +136,13 @@ typedef typename Traits::Mark Mark; /*{\Mtypemember All objects (vertices, edges, faces) are attributed by a |Mark| object.}*/ typedef size_t Size_type; +#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO /*{\Mtypemember The size type.}*/ typedef void* GenPtr; +#else +typedef boost::any GenPtr; +#endif + typedef typename HDS::Vertex Vertex; @@ -403,7 +412,11 @@ std::string PE(HH e) { std::ostringstream os; if (e==HH()) return "nil"; os << "[" << PV(e->opposite()->vertex()) << "," - << PV(e->vertex()) << " " << e->info() << "]"; + << PV(e->vertex()) << " " + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + << e->info() + #endif + << "]"; return os.str(); } diff --git a/Nef_2/include/CGAL/Nef_2/PM_decorator.h b/Nef_2/include/CGAL/Nef_2/PM_decorator.h index d4b0df31fcb..61a791c47dd 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_decorator.h +++ b/Nef_2/include/CGAL/Nef_2/PM_decorator.h @@ -21,7 +21,11 @@ #ifndef CGAL_PM_DECORATOR_H #define CGAL_PM_DECORATOR_H #include +#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO #include +#else +#include +#endif #include #include diff --git a/Nef_2/include/CGAL/Nef_2/PM_overlayer.h b/Nef_2/include/CGAL/Nef_2/PM_overlayer.h index 3e5827408d7..9703b10b272 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_overlayer.h +++ b/Nef_2/include/CGAL/Nef_2/PM_overlayer.h @@ -25,7 +25,11 @@ #include #include #include +#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO #include +#else +#include +#endif #undef CGAL_NEF_DEBUG #define CGAL_NEF_DEBUG 13 #include @@ -49,7 +53,11 @@ struct PMO_from_segs { Vertex_handle new_vertex(const Point& p) { Vertex_handle v = G.new_vertex(p); + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::create(G.info(v)); + #else + G.info(v)=Halfedge_handle(); + #endif return v; } @@ -78,15 +86,32 @@ struct PMO_from_segs { { D.ending_segment(v,it); } void halfedge_below(Vertex_handle v, Halfedge_handle e) const - { geninfo::access(G.info(v)) = e; } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::access(G.info(v)) = e; + #else + *boost::any_cast(&G.info(v)) = e; + #endif + } Halfedge_handle halfedge_below(Vertex_handle v) const - { return geninfo::access(G.info(v)); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + return geninfo::access(G.info(v)); + #else + return + boost::any_cast(G.info(v)); + #endif + } void clear_temporary_vertex_info() const { Vertex_handle v; for(v = G.vertices_begin(); v!= G.vertices_end(); ++v) + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::clear(G.info(v)); + #else + G.info(v)=boost::any(); + #endif } @@ -634,13 +659,32 @@ struct vertex_info { }; void assoc_info(Vertex_handle v) const -{ geninfo::create(info(v)); } +{ + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::create(info(v)); + #else + info(v)=vertex_info(); + #endif +} void discard_info(Vertex_handle v) const -{ geninfo::clear(info(v)); } +{ + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::clear(info(v)); + #else + info(v)=boost::any(); + #endif +} vertex_info& ginfo(Vertex_handle v) const -{ return geninfo::access(info(v)); } +{ + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + return geninfo::access(info(v)); + #else + return + *boost::any_cast(&info(v)); + #endif +} Mark& mark(Vertex_handle v, int i) const { return ginfo(v).m[i]; } @@ -667,15 +711,36 @@ struct halfedge_info { }; void assoc_info(Halfedge_handle e) const -{ geninfo::create(info(e)); - geninfo::create(info(twin(e))); } +{ + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::create(info(e)); + geninfo::create(info(twin(e))); + #else + info(e)=halfedge_info(); + info(twin(e))=halfedge_info(); + #endif +} void discard_info(Halfedge_handle e) const -{ geninfo::clear(info(e)); - geninfo::clear(info(twin(e))); } +{ + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::clear(info(e)); + geninfo::clear(info(twin(e))); + #else + info(e)=boost::any(); + info(twin(e))=boost::any(); + #endif +} halfedge_info& ginfo(Halfedge_handle e) const -{ return geninfo::access(info(e)); } +{ + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + return geninfo::access(info(e)); + #else + return + *boost::any_cast(&info(e)); + #endif +} Mark& mark(Halfedge_handle e, int i) const // uedge information we store in the smaller one @@ -702,13 +767,32 @@ struct face_info { }; void assoc_info(Face_handle f) const -{ geninfo::create(info(f)); } +{ + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::create(info(f)); + #else + info(f)=face_info(); + #endif +} void discard_info(Face_handle f) const -{ geninfo::clear(info(f)); } +{ + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::clear(info(f)); + #else + info(f)=boost::any(); + #endif +} face_info& ginfo(Face_handle f) const -{ return geninfo::access(info(f)); } +{ + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + return geninfo::access(info(f)); + #else + return + *boost::any_cast(&info(f)); + #endif +} Mark& mark(Face_handle f, int i) const { return ginfo(f).m[i]; } diff --git a/Nef_2/include/CGAL/Nef_2/PM_point_locator.h b/Nef_2/include/CGAL/Nef_2/PM_point_locator.h index 2898d35fc71..e5a85a57dc8 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_point_locator.h +++ b/Nef_2/include/CGAL/Nef_2/PM_point_locator.h @@ -29,7 +29,11 @@ #undef CGAL_NEF_DEBUG #define CGAL_NEF_DEBUG 17 #include +#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO #include +#else +#include +#endif #ifdef CGAL_USE_LEDA #include @@ -468,27 +472,57 @@ public: void operator()(Vertex_handle vn, Vertex_const_handle vo) const { Face_const_handle f; if ( Po.is_isolated(vo) ) f = Po.face(vo); + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::create(info(vn)); geninfo::access(info(vn)) = VF_pair(vo,f); + #else + info(vn) = VF_pair(vo,f); + #endif CGAL_NEF_TRACEN("linking to org "<::create(info(hn)); + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::create(info(hn)); geninfo::access(info(hn)) = EF_pair(ho,Po.face(ho)); + #else + info(hn) = EF_pair(ho,Po.face(ho)); + #endif CGAL_NEF_TRACEN("linking to org "<::const_access(CT.info(v)).first; } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + return geninfo::const_access(CT.info(v)).first; + #else + return + boost::any_cast(CT.info(v)).first; + #endif + } Halfedge_const_handle input_halfedge(Halfedge_const_handle e) const - { return geninfo::const_access(CT.info(e)).first; } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + return geninfo::const_access(CT.info(e)).first; + #else + return + boost::any_cast(CT.info(e)).first; + #endif + } Face_const_handle input_face(Halfedge_const_handle e) const - { return geninfo::const_access(CT.info(e)).second; } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + return geninfo::const_access(CT.info(e)).second; + #else + return + boost::any_cast(CT.info(e)).second; + #endif + } Object_handle input_object(Vertex_const_handle v) const @@ -547,10 +581,19 @@ protected: { Halfedge_handle e_from = previous(e); Face_const_handle f; if ( is_closed_at_source(e) ) // source(e) was isolated before + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO f = geninfo::access(info(source(e))).second; else - f = geninfo::access(info(e_from)).second; + f = geninfo::access(info(e_from)).second; + #else + f = + boost::any_cast(info(source(e))).second; + else + f = + boost::any_cast(info(e_from)).second; + #endif mark(e) = _DP.mark(f); + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::create(info(e)); geninfo::create(info(twin(e))); @@ -560,6 +603,10 @@ protected: geninfo::access(info(e)).second = geninfo::access(info(twin(e))).second = f; + #else + info(e)=EF_pair(Halfedge_const_handle(),f); + info(twin(e))=EF_pair(Halfedge_const_handle(),f); + #endif CGAL_NEF_TRACEN("CT_new_edge "<:: { CGAL_NEF_TRACEN("clear_static_point_locator"); Vertex_iterator vit, vend = CT.vertices_end(); for (vit = CT.vertices_begin(); vit != vend; ++vit) { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::clear(CT.info(vit)); + #else + CT.info(vit)=boost::any(); + #endif } Halfedge_iterator eit, eend = CT.halfedges_end(); for (eit = CT.halfedges_begin(); eit != eend; ++eit) { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::clear(CT.info(eit)); + #else + CT.info(eit)=boost::any(); + #endif } CT.clear(); delete &(CT.plane_map()); diff --git a/Nef_2/include/CGAL/Nef_2/gen_point_location.h b/Nef_2/include/CGAL/Nef_2/gen_point_location.h index a9bbd396554..536ada6426c 100644 --- a/Nef_2/include/CGAL/Nef_2/gen_point_location.h +++ b/Nef_2/include/CGAL/Nef_2/gen_point_location.h @@ -33,7 +33,12 @@ #include #include #include +#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO #include +#else +#include +#endif + #undef CGAL_NEF_DEBUG #define CGAL_NEF_DEBUG 17 @@ -56,7 +61,11 @@ class GenericLocation { point location. It can store a node or an edge of a graph or the special value |nil| which is used to signal that no node or edge could be found. }*/ - typedef void* GenPtr; + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + typedef void* GenPtr; + #else + typedef boost::any GenPtr; + #endif public: /*{\Mtypes}*/ enum Type { NIL, NODE, EDGE }; @@ -85,7 +94,12 @@ public: if (type != NODE) CGAL_LEDA_SCOPE::error_handler(1, "Location: not convertible to node"); #endif + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO return geninfo::const_access(value); + #else + return + *boost::any_cast(&value); + #endif } /*{\Mconversion converts |\Mvar| into a node.\\ \precond |\Mvar| represents a node.}*/ @@ -96,7 +110,12 @@ public: if (type != EDGE) CGAL_LEDA_SCOPE::error_handler(1, "Location: not convertible to edge"); #endif + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO return geninfo::const_access(value); + #else + return + *boost::any_cast(&value); + #endif } /*{\Mconversion converts |\Mvar| into an edge.\\ \precond |\Mvar| represents an edge.}*/ @@ -125,20 +144,33 @@ public: void init() { type = NIL; } void init(Node n) { type = NODE; + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::create(value); - geninfo::access(value) = n; + geninfo::access(value) = n; + #else + value=n; + #endif } void init(Edge e) { type = EDGE; + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::create(value); - geninfo::access(value) = e; + geninfo::access(value) = e; + #else + value=e; + #endif } void clear() { switch(type) { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO case NODE: geninfo::clear(value); break; case EDGE: geninfo::clear(value); break; + #else + case NODE: value=boost::any(); break; + case EDGE: value=boost::any(); break; + #endif case NIL: break; } } @@ -148,10 +180,18 @@ public: type = L.type; switch(type) { case NODE: - geninfo::access(value) = geninfo::const_access(L.value); + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::access(value) = geninfo::const_access(L.value); + #else + *boost_any_cast(&value) = boost::any_cast(L.value); + #endif break; case EDGE: + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::access(value) = geninfo::const_access(L.value); + #else + *boost::any_cast(&value) = boost::any_cast(L.value); + #endif break; case NIL: break; } diff --git a/Nef_2/include/CGAL/Nef_2/geninfo.h b/Nef_2/include/CGAL/Nef_2/geninfo.h index f27c85eb19e..1a26b4fe7cf 100644 --- a/Nef_2/include/CGAL/Nef_2/geninfo.h +++ b/Nef_2/include/CGAL/Nef_2/geninfo.h @@ -21,6 +21,11 @@ #ifndef CGAL_NEF_2_GENINFO_H #define CGAL_NEF_2_GENINFO_H + +//This file is deprecated and something like boost::any or boost::variant should +//be used instead +#include + #include #include diff --git a/Nef_3/include/CGAL/Nef_3/Halfedge.h b/Nef_3/include/CGAL/Nef_3/Halfedge.h index b92186a7bdf..795578b10ca 100644 --- a/Nef_3/include/CGAL/Nef_3/Halfedge.h +++ b/Nef_3/include/CGAL/Nef_3/Halfedge.h @@ -34,12 +34,20 @@ #define CGAL_NEF_DEBUG 83 #include +#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO +#include +#endif + namespace CGAL { template class Halfedge_base { // == Halfedge + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; + #else + typedef boost::any GenPtr; + #endif typedef typename Refs::Mark Mark; typedef typename Refs::Vector_3 Vector_3; typedef typename Refs::Sphere_point Sphere_point; @@ -131,7 +139,11 @@ class Halfedge_base std::string debug() const { std::stringstream os; set_pretty_mode(os); - os<<"sv [ "< void initialize_hash(Handle h) {} + template void initialize_hash(Handle /*h*/) {} void initialize_hash(int i) {} void handle_support(SVertex_handle , SHalfedge_const_handle , diff --git a/Nef_3/include/CGAL/Nef_3/SFace.h b/Nef_3/include/CGAL/Nef_3/SFace.h index 2f617e185cc..f00c92682fe 100644 --- a/Nef_3/include/CGAL/Nef_3/SFace.h +++ b/Nef_3/include/CGAL/Nef_3/SFace.h @@ -33,11 +33,19 @@ #define CGAL_NEF_DEBUG 83 #include +#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO +#include +#endif + namespace CGAL { template class SFace_base { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; + #else + typedef boost::any GenPtr; + #endif typedef typename Refs::Mark Mark; typedef typename Refs::Vertex_handle Vertex_handle; typedef typename Refs::Vertex_const_handle Vertex_const_handle; diff --git a/Nef_3/include/CGAL/Nef_3/SHalfedge.h b/Nef_3/include/CGAL/Nef_3/SHalfedge.h index 1ee884bdc3a..b5a882a4040 100644 --- a/Nef_3/include/CGAL/Nef_3/SHalfedge.h +++ b/Nef_3/include/CGAL/Nef_3/SHalfedge.h @@ -33,11 +33,19 @@ #define CGAL_NEF_DEBUG 83 #include +#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO +#include +#endif + namespace CGAL { template class SHalfedge_base { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; + #else + typedef boost::any GenPtr; + #endif typedef typename Refs::Mark Mark; typedef typename Refs::Sphere_circle Sphere_circle; @@ -199,7 +207,11 @@ class SHalfedge_base { { std::stringstream os; set_pretty_mode(os); os <<"e[ "<debug()<<", " - <source_->debug()<<" "<source_->debug() + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + <<" "< +#else +#include +#endif #include #include #include @@ -123,7 +126,12 @@ std::vector& Support; unsigned edge_number; Vertex_handle new_vertex(const Point& p) const -{ geninfo::create(p.vertex()->info()); +{ + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::create(p.vertex()->info()); + #else + p.vertex()->info()=unsigned(); + #endif return p.vertex(); } Halfedge_handle new_halfedge_pair_at_source(Vertex_handle v) @@ -135,7 +143,12 @@ void supporting_segment(Halfedge_handle e, I it) void halfedge_below(Vertex_handle v, Halfedge_handle e) { CGAL_NEF_TRACEN("halfedge_below point "<< v->point() <<": " << e); - geninfo::access(v->info()) = e; } + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::access(v->info()) = e; + #else + v->info() = e; + #endif +} // all empty, no update necessary void link_as_target_and_append(Vertex_handle, Halfedge_handle) @@ -396,7 +409,11 @@ protected: int fc = FacetCycle[e]; SHalfedge_handle e_min = MinimalEdge[fc]; SHalfedge_handle e_below = + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO Edge_of[geninfo::access(info(e_min->twin()->source()->twin()->source()))]; + #else + Edge_of[ boost::any_cast(info(e_min->twin()->source()->twin()->source())) ]; + #endif CGAL_assertion( e_below != SHalfedge_handle() ); CGAL_NEF_TRACEN(" edge below " << debug(e_below)); Halffacet_handle f = e_below->facet(); @@ -631,7 +648,11 @@ create_facet_objects(const Plane_3& plane_supporting_facet, CGAL_forall_iterators(lit,SHalfloops) { l=*lit; SHalfedge_handle e_below = - Edge_of[geninfo::access(info(l->incident_sface()->center_vertex()))]; + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + Edge_of[geninfo::access(info(l->incident_sface()->center_vertex()))]; + #else + Edge_of[ boost::any_cast(info(l->incident_sface()->center_vertex())) ]; + #endif CGAL_assertion( e_below != SHalfedge_handle() ); CGAL_NEF_TRACEN("link sloop at vertex "<< l->incident_sface()->center_vertex()->point()); diff --git a/Nef_3/include/CGAL/Nef_3/SNC_SM_overlayer.h b/Nef_3/include/CGAL/Nef_3/SNC_SM_overlayer.h index 4d32ec743a7..f3c3c5a7806 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_SM_overlayer.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_SM_overlayer.h @@ -25,7 +25,11 @@ #include #include #include +#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO #include +#else +#include +#endif #include #include #include diff --git a/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h b/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h index 0bbeeae7f86..d556791b5cb 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h @@ -36,6 +36,10 @@ #define CGAL_NEF_DEBUG 191 #include +#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO +#include +#endif + namespace CGAL { template class SM_const_decorator; @@ -116,7 +120,11 @@ public: SHalfedge_around_sface_const_circulator; public: + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; + #else + typedef boost::any GenPtr; + #endif SNC_const_decorator() : sncp_(0) {} SNC_const_decorator(const SNC_structure& W) : sncp_(&W) {} diff --git a/Nef_3/include/CGAL/Nef_3/SNC_decorator.h b/Nef_3/include/CGAL/Nef_3/SNC_decorator.h index 7cda2e5eb80..e70fcd38e6e 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_decorator.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_decorator.h @@ -40,6 +40,10 @@ #define CGAL_NEF_DEBUG 19 #include +#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO +#include +#endif + namespace CGAL { template @@ -155,7 +159,11 @@ class SNC_decorator : public SNC_const_decorator { enum {NO_SNC, WITH_SNC}; public: + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; + #else + typedef boost::any GenPtr; + #endif SNC_decorator() : Base(), sncp_() {} SNC_decorator(SNC_structure& W) diff --git a/Nef_3/include/CGAL/Nef_3/SNC_io_parser.h b/Nef_3/include/CGAL/Nef_3/SNC_io_parser.h index 2b5d9beb8b7..031349c7d2c 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_io_parser.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_io_parser.h @@ -39,6 +39,10 @@ #define CGAL_NEF_DEBUG 293 #include +#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO +#include +#endif + namespace CGAL { template @@ -889,7 +893,11 @@ public: typedef typename Infi_box::Standard_vector Standard_vector; typedef typename Infi_box::Standard_plane Standard_plane; + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; + #else + typedef boost::any GenPtr; + #endif using Base::visit_shell_objects; diff --git a/Nef_3/include/CGAL/Nef_3/SNC_ray_shooter.h b/Nef_3/include/CGAL/Nef_3/SNC_ray_shooter.h index b55aa9769e5..0a94a198b88 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_ray_shooter.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_ray_shooter.h @@ -42,6 +42,10 @@ #define CGAL_NEF_DEBUG 37 #include +#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO +#include +#endif + namespace CGAL { // ---------------------------------------------------------------------------- @@ -87,7 +91,11 @@ public: typedef typename SNC_structure::Mark Mark; + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; + #else + typedef boost::any GenPtr; + #endif SNC_ray_shooter() {} void initialize(SNC_structure* W) { *this = SNC_ray_shooter(*W);} diff --git a/Nef_3/include/CGAL/Nef_3/SNC_structure.h b/Nef_3/include/CGAL/Nef_3/SNC_structure.h index 4977f1f5d7e..7f767760b84 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_structure.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_structure.h @@ -1212,7 +1212,8 @@ public: sfaces_.erase(h); put_sface_node(&*h); } - + //SL: in the following function, I guess the sizeof(void*) is related to the void* info that was + //used together with geninfo to store an arbitrary type. I replaced that with any and did not changed that std::size_t bytes() { // bytes used for the SNC_structure @@ -1253,7 +1254,8 @@ public: return result; } - + //SL: in the following function, I guess the sizeof(void*) is related to the void* info that was + //used together with geninfo to store an arbitrary type. I replaced that with any and did not changed that std::size_t bytes_reduced() { // bytes used for the SNC_structure diff --git a/Nef_3/include/CGAL/Nef_3/Vertex.h b/Nef_3/include/CGAL/Nef_3/Vertex.h index 11c5c8bfd60..1e9792c009e 100644 --- a/Nef_3/include/CGAL/Nef_3/Vertex.h +++ b/Nef_3/include/CGAL/Nef_3/Vertex.h @@ -33,12 +33,20 @@ #define CGAL_NEF_DEBUG 83 #include +#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO +#include +#endif + namespace CGAL { template class Vertex_base { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; + #else + typedef boost::any GenPtr; + #endif typedef typename Refs::Mark Mark; typedef typename Refs::Point_3 Point_3; diff --git a/Nef_S2/include/CGAL/Nef_S2/SM_const_decorator.h b/Nef_S2/include/CGAL/Nef_S2/SM_const_decorator.h index e7a1dae22ae..b674c70f59a 100644 --- a/Nef_S2/include/CGAL/Nef_S2/SM_const_decorator.h +++ b/Nef_S2/include/CGAL/Nef_S2/SM_const_decorator.h @@ -36,6 +36,9 @@ #undef CGAL_NEF_DEBUG #define CGAL_NEF_DEBUG 67 #include +#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO +#include +#endif namespace CGAL { @@ -74,7 +77,12 @@ typedef typename Map::Mark Mark; typedef size_t Size_type; /*{\Mtypemember size type.}*/ +#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; +#else +typedef boost::any GenPtr; +#endif + // typedef typename Map::Constructor_const_parameter Constructor_parameter; typedef typename Map::SVertex_const_handle SVertex_const_handle; diff --git a/Nef_S2/include/CGAL/Nef_S2/SM_decorator.h b/Nef_S2/include/CGAL/Nef_S2/SM_decorator.h index b6c4a6b0939..7f418b32a75 100644 --- a/Nef_S2/include/CGAL/Nef_S2/SM_decorator.h +++ b/Nef_S2/include/CGAL/Nef_S2/SM_decorator.h @@ -35,6 +35,9 @@ #include #include #include +#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO +#include +#endif namespace CGAL { @@ -83,7 +86,11 @@ enum { BEFORE = -1, AFTER = 1 }; typedef typename Sphere_kernel::Aff_transformation_3 Aff_transformation_3; +#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; +#else +typedef boost::any GenPtr; +#endif typedef typename Map::SVertex SVertex; typedef typename Map::SVertex_handle SVertex_handle; typedef typename Map::SVertex_iterator SVertex_iterator; diff --git a/Nef_S2/include/CGAL/Nef_S2/SM_items.h b/Nef_S2/include/CGAL/Nef_S2/SM_items.h index a07bd316b0c..efd63d54c3f 100644 --- a/Nef_S2/include/CGAL/Nef_S2/SM_items.h +++ b/Nef_S2/include/CGAL/Nef_S2/SM_items.h @@ -31,6 +31,9 @@ #include #include #include +#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO +#include +#endif namespace CGAL { @@ -44,7 +47,11 @@ public: template class SVertex { - typedef void* GenPtr; + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + typedef void* GenPtr; + #else + typedef boost::any GenPtr; + #endif typedef typename Refs::Mark Mark; typedef typename Refs::Sphere_point Sphere_point; typedef typename Refs::SVertex_handle SVertex_handle; @@ -108,7 +115,11 @@ public: public: std::string debug() const { std::ostringstream os; set_pretty_mode(os); - os<<"V"< class SHalfedge { - typedef void* GenPtr; + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + typedef void* GenPtr; + #else + typedef boost::any GenPtr; + #endif typedef typename Refs::Mark Mark; typedef typename Refs::Sphere_circle Sphere_circle; typedef typename Refs::SVertex_handle SVertex_handle; @@ -202,7 +217,11 @@ public: std::string debug() const { std::ostringstream os; set_pretty_mode(os); os <<"e["<debug()<<", " - <source_->debug()<<" "<source_->debug()<< + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + " "<< info_ << + #endif + "]"<<'\0'; std::string res(os.str()); return res; } @@ -211,7 +230,11 @@ public: template class SHalfloop { - typedef void* GenPtr; + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + typedef void* GenPtr; + #else + typedef boost::any GenPtr; + #endif typedef typename Refs::Mark Mark; typedef typename Refs::Sphere_circle Sphere_circle; typedef typename Refs::SHalfloop_handle SHalfloop_handle; @@ -272,7 +295,11 @@ public: std::string debug() const { std::ostringstream os; set_pretty_mode(os); - os<<"l"< class SFace { - typedef void* GenPtr; + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + typedef void* GenPtr; + #else + typedef boost::any GenPtr; + #endif typedef typename Refs::Mark Mark; typedef typename Refs::Object_handle Object_handle; typedef typename Refs::Object_list Object_list; diff --git a/Nef_S2/include/CGAL/Nef_S2/SM_overlayer.h b/Nef_S2/include/CGAL/Nef_S2/SM_overlayer.h index 881bd5b22b4..f4277148e8b 100644 --- a/Nef_S2/include/CGAL/Nef_S2/SM_overlayer.h +++ b/Nef_S2/include/CGAL/Nef_S2/SM_overlayer.h @@ -25,7 +25,11 @@ #include #include #include +#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO #include +#else +#include +#endif #include #include #include @@ -56,7 +60,11 @@ struct SMO_from_segs { Vertex_handle new_vertex(const Point& p) { Vertex_handle v = G.new_svertex(p); + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::create(G.info(v)); + #else + G.info(v)=Halfedge_handle(); + #endif return v; } @@ -85,16 +93,35 @@ struct SMO_from_segs { { if ( M[it] ) v->mark() = true; } void halfedge_below(Vertex_handle v, Halfedge_handle e) const - { geninfo::access(G.info(v)) = e; } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::access(G.info(v)) = e; + #else + G.info(v)=e; + #endif + } Halfedge_handle halfedge_below(Vertex_handle v) const - { return geninfo::access(G.info(v)); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + return geninfo::access(G.info(v)); + #else + return + boost::any_cast( G.info(v) ); + #endif + } void assert_equal_marks(Vertex_handle v1, Vertex_handle v2) const { CGAL_assertion(v1->mark()==v2->mark()); } void discard_info(Vertex_handle v) const - { geninfo::clear(G.info(v)); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::clear(G.info(v)); + #else + G.info(v)=boost::any(); + #endif + } void assert_equal_marks(Halfedge_handle e1, Halfedge_handle e2) const { CGAL_assertion(e1->mark()==e2->mark()); } @@ -104,7 +131,12 @@ struct SMO_from_segs { void clear_temporary_vertex_info() const { Vertex_handle v; CGAL_forall_svertices(v,G) + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::clear(G.info(v)); + #else + G.info(v)=boost::any(); + #endif + } @@ -500,13 +532,32 @@ public: }; // vertex_info void assoc_info(SVertex_handle v) const - { geninfo::create(info(v)); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::create(info(v)); + #else + info(v)=vertex_info(); + #endif + } void discard_info(SVertex_handle v) const - { geninfo::clear(info(v)); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::clear(info(v)); + #else + info(v)=boost::any(); + #endif + } vertex_info& ginfo(SVertex_handle v) const - { return geninfo::access(info(v)); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + return geninfo::access(info(v)); + #else + return + *boost::any_cast(&info(v)); + #endif + } Mark& mark(SVertex_handle v, int i) const { return ginfo(v).m[i]; } @@ -532,15 +583,36 @@ public: }; void assoc_info(SHalfedge_handle e) const - { geninfo::create(info(e)); - geninfo::create(info(e->twin())); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::create(info(e)); + geninfo::create(info(e->twin())); + #else + info(e)=edge_info(); + info(e->twin())=edge_info(); + #endif + } void discard_info(SHalfedge_handle e) const - { geninfo::clear(info(e)); - geninfo::clear(info(e->twin())); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::clear(info(e)); + geninfo::clear(info(e->twin())); + #else + info(e)=boost::any(); + info(e->twin())=boost::any(); + #endif + } edge_info& ginfo(SHalfedge_handle e) const - { return geninfo::access(info(e)); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + return geninfo::access(info(e)); + #else + return + *boost::any_cast(&info(e)); + #endif + } Mark& mark(SHalfedge_handle e, int i) const { return ginfo(e).m[i]; } @@ -567,13 +639,32 @@ public: }; void assoc_info(SFace_handle f) const - { geninfo::create(info(f)); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::create(info(f)); + #else + info(f)=face_info(); + #endif + } void discard_info(SFace_handle f) const - { geninfo::clear(info(f)); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::clear(info(f)); + #else + info(f)=boost::any(); + #endif + } face_info& ginfo(SFace_handle f) const - { return geninfo::access(info(f)); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + return geninfo::access(info(f)); + #else + return + *boost::any_cast(&info(f)); + #endif + } Mark& mark(SFace_handle f, int i) const { return ginfo(f).m[i]; } @@ -1393,13 +1484,19 @@ subdivide(const Map* M0, const Map* M1, // DEBUG CODE: to do: have all svertices a halfedge below associated? CGAL_NEF_TRACEN("Vertex info after swep"); CGAL_assertion_code(SVertex_iterator svi); + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO CGAL_assertion_code( for(svi=this->svertices_begin(); svi!=this->svertices_end(); svi++) { - CGAL_NEF_TRACEN("vertex "<point()<<" info "<point()<<" info "<< info(svi)<< " marks "<svertices_begin(); svi!=this->svertices_end(); svi++) { + CGAL_NEF_TRACEN("vertex "<point()<< " marks "<svertices_begin(),v,O); else @@ -1683,12 +1780,20 @@ subdivide(const Map* M0, const Map* M1, // DEBUG CODE: to do: have all svertices a halfedge below associated? CGAL_NEF_TRACEN("Vertex info after swep"); CGAL_assertion_code(SVertex_iterator svi); + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO CGAL_assertion_code( for(svi=this->svertices_begin(); svi!=this->svertices_end(); svi++) { - CGAL_NEF_TRACEN("vertex "<point()<<" info "<point() <<" info "<svertices_begin(); svi!=this->svertices_end(); svi++) { + CGAL_NEF_TRACEN("vertex "<point() << " marks "< #include #include +#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO #include +#else +#include +#endif #include #include #undef CGAL_NEF_DEBUG diff --git a/Nef_S2/include/CGAL/Nef_S2/SM_triangulator.h b/Nef_S2/include/CGAL/Nef_S2/SM_triangulator.h index 65f1e280a9a..824eb5f1a3e 100644 --- a/Nef_S2/include/CGAL/Nef_S2/SM_triangulator.h +++ b/Nef_S2/include/CGAL/Nef_S2/SM_triangulator.h @@ -24,7 +24,11 @@ #include #include #include +#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO #include +#else +#include +#endif #include #include #include @@ -201,13 +205,32 @@ public: }; void assoc_info(SVertex_handle v) const - { geninfo::create(info(v)); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::create(info(v)); + #else + info(v)=vertex_info(); + #endif + } void discard_info(SVertex_handle v) const - { geninfo::clear(info(v)); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::clear(info(v)); + #else + info(v)=boost::any(); + #endif + } vertex_info& ginfo(SVertex_handle v) const - { return geninfo::access(info(v)); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + return geninfo::access(info(v)); + #else + return + *boost::any_cast(&info(v)); + #endif + } Object_handle& support(SVertex_handle v) const { return ginfo(v).o_; } @@ -224,15 +247,36 @@ public: }; void assoc_info(SHalfedge_handle e) const - { geninfo::create(info(e)); - geninfo::create(info(e->twin())); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::create(info(e)); + geninfo::create(info(e->twin())); + #else + info(e)=edge_info(); + info(e->twin())=edge_info(); + #endif + } void discard_info(SHalfedge_handle e) const - { geninfo::clear(info(e)); - geninfo::clear(info(e->twin())); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::clear(info(e)); + geninfo::clear(info(e->twin())); + #else + info(e)=boost::any(); + info(e->twin())=boost::any(); + #endif + } edge_info& ginfo(SHalfedge_handle e) const - { return geninfo::access(info(e)); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + return geninfo::access(info(e)); + #else + return + *boost::any_cast(&info(e)); + #endif + } Object_handle& support(SHalfedge_handle e) const // uedge information we store in the smaller one @@ -244,7 +288,14 @@ public: { return ginfo(e).m_left_; } const edge_info& ginfo(SHalfedge_const_handle e) const - { return geninfo::const_access(info(e)); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + return geninfo::const_access(info(e)); + #else + return + *boost::any_cast(&info(e)); + #endif + } const Mark& incident_mark(SHalfedge_const_handle e) const { return ginfo(e).m_left_; } diff --git a/Number_types/test/Number_types/Root_of_traits.cpp b/Number_types/test/Number_types/Root_of_traits.cpp index 86d1ef54716..a9cb2f5c2a2 100644 --- a/Number_types/test/Number_types/Root_of_traits.cpp +++ b/Number_types/test/Number_types/Root_of_traits.cpp @@ -46,6 +46,7 @@ void test_root_of_traits_for_set(Integer, Rational, FWS){ } int main(){ + std::cout << "Testing with double" << std::endl; CGAL::Test::test_root_of_traits< double , double , double >(); try{// just compile and try to get as far as you can go. @@ -56,6 +57,7 @@ int main(){ #ifdef CGAL_HAS_GMP_ARITHMETIC_KERNEL //TODO: switch to Gmpq { + std::cout << "Testing with GMP" << std::endl; typedef CGAL::GMP_arithmetic_kernel AK; typedef AK::Integer Integer; typedef AK::Rational Rational; @@ -65,6 +67,7 @@ int main(){ #endif #ifdef CGAL_HAS_LEDA_ARITHMETIC_KERNEL { + std::cout << "Testing with LEDA" << std::endl; typedef CGAL::LEDA_arithmetic_kernel AK; typedef AK::Integer Integer; typedef AK::Rational Rational; @@ -74,6 +77,7 @@ int main(){ #endif #ifdef CGAL_HAS_CORE_ARITHMETIC_KERNEL { + std::cout << "Testing with CORE" << std::endl; typedef CGAL::CORE_arithmetic_kernel AK; typedef AK::Integer Integer; typedef AK::Rational Rational; @@ -82,6 +86,7 @@ int main(){ } #endif { + std::cout << "Testing with MP_Float" << std::endl; typedef CGAL::MP_Float_arithmetic_kernel AK; typedef AK::Integer Integer; typedef AK::Rational Rational; diff --git a/Polyhedron/doc_tex/Polyhedron_ref/fig/euler.svg b/Polyhedron/doc_tex/Polyhedron_ref/fig/euler.svg new file mode 100644 index 00000000000..84dbd660f59 --- /dev/null +++ b/Polyhedron/doc_tex/Polyhedron_ref/fig/euler.svg @@ -0,0 +1,319 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Polyhedron/doc_tex/Polyhedron_ref/fig/euler_facet.pdf b/Polyhedron/doc_tex/Polyhedron_ref/fig/euler_facet.pdf new file mode 100644 index 00000000000..259c5fb3a48 Binary files /dev/null and b/Polyhedron/doc_tex/Polyhedron_ref/fig/euler_facet.pdf differ diff --git a/Polyhedron/doc_tex/Polyhedron_ref/fig/euler_facet.svg b/Polyhedron/doc_tex/Polyhedron_ref/fig/euler_facet.svg new file mode 100644 index 00000000000..cde3e4a3371 --- /dev/null +++ b/Polyhedron/doc_tex/Polyhedron_ref/fig/euler_facet.svg @@ -0,0 +1,929 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Polyhedron/doc_tex/Polyhedron_ref/fig/euler_vertex.pdf b/Polyhedron/doc_tex/Polyhedron_ref/fig/euler_vertex.pdf new file mode 100644 index 00000000000..baca524996d Binary files /dev/null and b/Polyhedron/doc_tex/Polyhedron_ref/fig/euler_vertex.pdf differ diff --git a/Polyhedron/doc_tex/Polyhedron_ref/fig/euler_vertex.svg b/Polyhedron/doc_tex/Polyhedron_ref/fig/euler_vertex.svg new file mode 100644 index 00000000000..5201ecd87e1 --- /dev/null +++ b/Polyhedron/doc_tex/Polyhedron_ref/fig/euler_vertex.svg @@ -0,0 +1,938 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/STL_Extension/doc_tex/STL_Extension_ref/tuple.tex b/STL_Extension/doc_tex/STL_Extension_ref/tuple.tex index b366e999da4..8689874bea1 100644 --- a/STL_Extension/doc_tex/STL_Extension_ref/tuple.tex +++ b/STL_Extension/doc_tex/STL_Extension_ref/tuple.tex @@ -33,7 +33,8 @@ is taken from Boost. Some free functions part of the standard interface of \ccc{tuple} are also brought in namespace \ccc{CGAL::cpp0x} with using declarations, these are \ccc{make_tuple}, -\ccc{get}, \ccc{tie}. +\ccc{get}, \ccc{tie}. Like in C++0x, the \ccc{get} function template is +specialized so that it can take \ccc{std::pair} as argument. Two standard helper classes are also provided for convenience (\ccc{tuple_size} and \ccc{tuple_element}). \end{ccRefClass} diff --git a/STL_Extension/include/CGAL/tuple.h b/STL_Extension/include/CGAL/tuple.h index 65699b3c76e..698df419e55 100644 --- a/STL_Extension/include/CGAL/tuple.h +++ b/STL_Extension/include/CGAL/tuple.h @@ -27,12 +27,15 @@ #ifndef CGAL_CFG_NO_CPP0X_TUPLE # include -#elif !defined CGAL_CFG_NO_TR1_TUPLE -# include -#else -# include -# include #endif +#ifndef CGAL_CFG_NO_TR1_TUPLE +# include +# include +#endif + +#include +#include +#include namespace CGAL { @@ -68,6 +71,47 @@ struct tuple_element: public boost::tuples::element{}; #endif + +#if defined(CGAL_CFG_NO_CPP0X_TUPLE) && defined(CGAL_CFG_NO_TR1_TUPLE) +// If not TR1 or C++11 tuple, we need to add get(std::pair). + +//////////////////////////////////////////////////////////// +// // +// Allow CGAL::cpp0x::get(std::pair), if N==0 or N==1. // +// // +// That is already in TR1 and C++11, but not in Boost. // +// // +//////////////////////////////////////////////////////////// +template +struct pair_get; + +template +struct pair_get<0, T1, T2> { + static T1& get(std::pair& pair) { return pair.first; } + static const T1& get(const std::pair& pair) { return pair.first; } +}; // end specialization struct pair_get<0, T2, T2> + +template +struct pair_get<1, T1, T2> { + static T2& get(std::pair& pair) { return pair.second; } + static const T2& get(const std::pair& pair) { return pair.second; } +}; // end specialization struct pair_get<0, T2, T2> + +template +inline typename boost::tuples::element >::type& +get(std::pair& pair) { + return pair_get::get(pair); +} + +template +inline const typename boost::tuples::element >::type& +get(const std::pair& pair) { + return pair_get::get(pair); +} + +#endif // end if not C++11 tuple + + } // cpp0x #ifndef CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES diff --git a/STL_Extension/test/STL_Extension/test_is_streamable.cpp b/STL_Extension/test/STL_Extension/test_is_streamable.cpp index 8e18e004489..c969eb94cbe 100644 --- a/STL_Extension/test/STL_Extension/test_is_streamable.cpp +++ b/STL_Extension/test/STL_Extension/test_is_streamable.cpp @@ -2,9 +2,13 @@ #include #include #include // std::pair +#include +#include struct A {}; struct B {}; +struct C {}; +struct D {}; using std::ostream; using std::istream; @@ -12,6 +16,9 @@ using std::istream; ostream& operator<<(ostream& os, const B&) { return os; } istream& operator>>(istream& is, const B&) { return is; } +ostream& operator<<(ostream& os, const C&) { return os; } +istream& operator>>(istream& is, const D&) { return is; } + int main() { typedef std::vector::const_iterator vector_it; typedef int* int_p; @@ -19,7 +26,10 @@ int main() { CGAL_static_assertion(!is_streamable::value); CGAL_static_assertion(is_streamable::value); + CGAL_static_assertion(!is_streamable::value); + CGAL_static_assertion(!is_streamable::value); CGAL_static_assertion(is_streamable::value); CGAL_static_assertion(is_streamable::value); CGAL_static_assertion(! (is_streamable >::value) ); + CGAL_static_assertion( (is_streamable >::value) ); } diff --git a/STL_Extension/test/STL_Extension/test_stl_extension.cpp b/STL_Extension/test/STL_Extension/test_stl_extension.cpp index a7ab589d457..75e8bbbb05e 100644 --- a/STL_Extension/test/STL_Extension/test_stl_extension.cpp +++ b/STL_Extension/test/STL_Extension/test_stl_extension.cpp @@ -8110,13 +8110,31 @@ void test_tuple(){ T1 t1=CGAL::cpp0x::make_tuple(1,2); T1 t1_2=CGAL::cpp0x::make_tuple(1,2); + + CGAL_assertion(t1==t1_2); // test the equality operator + + // T2 t2 = T2(); + // CGAL_assertion( t2 == T2() ); + // + // Do not test equality between default initialized tuples, because + // GNU/g++ version 4.1.2 does not default-initialize correctly + // std::tr1::tuple. + + // Test CGAL::cpp0x::tie int i1=-1,i2=-1; CGAL::cpp0x::tie(i1,i2)=t1; CGAL_assertion( CGAL::cpp0x::get<0>(t1)==i1 ); CGAL_assertion( CGAL::cpp0x::get<1>(t1)==i2 ); - CGAL_assertion(t1==t1_2); // test the equality operator - T2 t2 = T2(); - CGAL_assertion( t2 == T2() ); + + // Test CGAL::cpp0x::get for a pair + double d = 1; + std::pair pair(-3, &d); + const std::pair const_pair(2, &d); + + assert(CGAL::cpp0x::get<0>(pair) == -3); + assert(CGAL::cpp0x::get<1>(pair) == &d); + assert(CGAL::cpp0x::get<0>(const_pair) == 2); + assert(CGAL::cpp0x::get<1>(const_pair) == &d); } void test_prev_next() diff --git a/Straight_skeleton_2/include/CGAL/create_straight_skeleton_2.h b/Straight_skeleton_2/include/CGAL/create_straight_skeleton_2.h index 7994b531c21..ded63d4ab9f 100644 --- a/Straight_skeleton_2/include/CGAL/create_straight_skeleton_2.h +++ b/Straight_skeleton_2/include/CGAL/create_straight_skeleton_2.h @@ -135,6 +135,7 @@ boost::shared_ptr< Straight_skeleton_2 > inline create_interior_straight_skeleton_2 ( Polygon const& aOutContour, K const& k ) { + CGAL_precondition(aOutContour.is_simple() || !"The input polygon is not simple."); return create_interior_straight_skeleton_2(CGAL_SS_i::vertices_begin(aOutContour) ,CGAL_SS_i::vertices_end(aOutContour) ,k @@ -221,6 +222,7 @@ boost::shared_ptr< Straight_skeleton_2 > inline create_exterior_straight_skeleton_2 ( FT const& aMaxOffset, Polygon const& aPoly, K const& k ) { + CGAL_precondition(aPoly.is_simple() || !"The input polygon is not simple."); return create_exterior_straight_skeleton_2(aMaxOffset ,CGAL_SS_i::vertices_begin(aPoly) ,CGAL_SS_i::vertices_end (aPoly) diff --git a/Stream_support/include/CGAL/IO/File_header_gocad.h b/Stream_support/include/CGAL/IO/File_header_gocad.h deleted file mode 100644 index 620b6e23c56..00000000000 --- a/Stream_support/include/CGAL/IO/File_header_gocad.h +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) 2009 GeometryFactory All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// -// Author(s) : Andreas Fabri - - -#ifndef CGAL_IO_FILE_HEADER_GOCAD_H -#define CGAL_IO_FILE_HEADER_GOCAD_H 1 - -#include -#include - -namespace CGAL { - -class File_header_gocad { -private: - std::string m_fname; - std::string m_color; -public: -explicit File_header_gocad(std::string fname, std::string color) : m_fname(fname), m_color(color) {} - - std::string fname() const - { - return m_fname; - } - - std::string color() const - { - return m_color; - } - - -}; - -// Write header. -inline std::ostream& operator<<( std::ostream& out, const File_header_gocad& h){ - - return out << "GOCAD TSurf 1\n" - "HEADER {\n" - "name:" << h.fname() << "\n" - "*solid*color:" << h.color() << "\n" - "}\n" - "TFACE\n"; -} - -} //namespace CGAL -#endif // CGAL_IO_FILE_HEADER_GOCAD_H diff --git a/Stream_support/include/CGAL/IO/File_writer_gocad.h b/Stream_support/include/CGAL/IO/File_writer_gocad.h deleted file mode 100644 index 2267c66e3a5..00000000000 --- a/Stream_support/include/CGAL/IO/File_writer_gocad.h +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) 1997 -// Utrecht University (The Netherlands), -// ETH Zurich (Switzerland), -// INRIA Sophia-Antipolis (France), -// Max-Planck-Institute Saarbruecken (Germany), -// and Tel-Aviv University (Israel). All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// -// Author(s) : Lutz Kettner - -#ifndef CGAL_IO_FILE_WRITER_GOCAD_H -#define CGAL_IO_FILE_WRITER_GOCAD_H 1 - -#include -#include -#include -#include - -namespace CGAL { - -class File_writer_gocad { - int m_vertex_index; - std::ostream* m_out; - File_header_gocad m_header; -public: - File_writer_gocad(std::string fname, std::string color) : m_vertex_index(0), m_header(fname, color) {} - File_writer_gocad( const File_header_gocad& h) : m_vertex_index(0), m_header( h) {} - - std::ostream& out() { return *m_out; } - File_header_gocad& header() { return m_header; } - const File_header_gocad& header() const { return m_header; } - - void write_header( std::ostream& o, - std::size_t vertices, - std::size_t halfedges, - std::size_t facets, - bool normals = false) - { - m_out = &o; - out() << header(); - } - - - void write_footer() - {} - - void write_vertex( const double& x, const double& y, const double& z) { - out() << "VRTX " << m_vertex_index++ << ' ' << x << ' ' << y << ' ' << z << '\n'; - } - - void write_facet_header() { - out() << '\n'; - } - - void write_facet_begin( std::size_t no) { - CGAL_assertion(no == 3); - out() << "TRGL " << ' '; - } - void write_facet_vertex_index( std::size_t index) { - out() << ' ' << index; - } - void write_facet_end() { - out() << '\n'; - } -}; - -} //namespace CGAL -#endif // CGAL_IO_FILE_WRITER_GOCAD_H // -// EOF // diff --git a/Surface_mesh_parameterization/include/CGAL/Parameterization_mesh_feature_extractor.h b/Surface_mesh_parameterization/include/CGAL/Parameterization_mesh_feature_extractor.h index 6942c73b5f5..b0c240174c0 100644 --- a/Surface_mesh_parameterization/include/CGAL/Parameterization_mesh_feature_extractor.h +++ b/Surface_mesh_parameterization/include/CGAL/Parameterization_mesh_feature_extractor.h @@ -98,7 +98,12 @@ public: m_nb_borders = -1; m_genus = -1; } - virtual ~Parameterization_mesh_feature_extractor() {} + + virtual ~Parameterization_mesh_feature_extractor() { + for (typename Skeleton::iterator iter = m_skeleton.begin(); + iter != m_skeleton.end(); ++iter) + delete *iter; + } /// Get number of borders. int get_nb_borders() diff --git a/Surface_mesh_parameterization/include/CGAL/Parameterization_polyhedron_adaptor_3.h b/Surface_mesh_parameterization/include/CGAL/Parameterization_polyhedron_adaptor_3.h index caa07bfbbb6..20ece77181c 100644 --- a/Surface_mesh_parameterization/include/CGAL/Parameterization_polyhedron_adaptor_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Parameterization_polyhedron_adaptor_3.h @@ -441,7 +441,7 @@ public: int index = 0; for (Vertex_iterator it=mesh_vertices_begin(); it!=mesh_vertices_end(); it++) { - Point_3 position = get_vertex_position(it); + // Point_3 position = get_vertex_position(it); /*#ifdef DEBUG_TRACE fprintf(stderr, " %d=(%f,%f,%f)\n", index, diff --git a/Surface_reconstruction_points_3/doc_tex/Surface_reconstruction_points_3/PkgDescription.tex b/Surface_reconstruction_points_3/doc_tex/Surface_reconstruction_points_3/PkgDescription.tex index 08859fd7c30..d2a19d5f902 100644 --- a/Surface_reconstruction_points_3/doc_tex/Surface_reconstruction_points_3/PkgDescription.tex +++ b/Surface_reconstruction_points_3/doc_tex/Surface_reconstruction_points_3/PkgDescription.tex @@ -2,7 +2,7 @@ \ccPkgHowToCiteCgal{cgal:asg-srps-12} \ccPkgSummary{ This \cgal\ package implements a surface reconstruction method: Poisson Surface Reconstruction. It takes as input a set of points with oriented normals and computes an implicit function. The \cgal\ surface mesh generator can then be used to extract an iso-surface from this function. } % -\ccPkgDependsOn{\ccThirdPartyEigen or \ccThirdPartyTaucs} +\ccPkgDependsOn{\ccThirdPartyEigen\ or \ccThirdPartyTaucs} \ccPkgIntroducedInCGAL{3.5} \ccPkgLicense{\ccLicenseGPL} \ccPkgDemo{Surface Reconstruction}{surface_reconstruction_points_3.zip} diff --git a/Surface_reconstruction_points_3/doc_tex/Surface_reconstruction_points_3_ref/Poisson_reconstruction_function.tex b/Surface_reconstruction_points_3/doc_tex/Surface_reconstruction_points_3_ref/Poisson_reconstruction_function.tex index 8d135f4d2f8..c3cdfda0a12 100644 --- a/Surface_reconstruction_points_3/doc_tex/Surface_reconstruction_points_3_ref/Poisson_reconstruction_function.tex +++ b/Surface_reconstruction_points_3/doc_tex/Surface_reconstruction_points_3_ref/Poisson_reconstruction_function.tex @@ -108,7 +108,7 @@ Creates a Poisson implicit function from the [first, beyond) range of points. \ccCommentHeading{Template Parameters} \\ \ccc{InputIterator}: iterator over input points. \ccc{PointPMap}: is a model of \ccc{boost::ReadablePropertyMap} with a \ccc{value_type} = \ccc{Point_3}. It can be omitted if \ccc{InputIterator} \ccc{value_type} is convertible to \ccc{Point_3}. \ccc{NormalPMap}: is a model of \ccc{boost::ReadablePropertyMap} with a \ccc{value_type} = \ccc{Vector_3}. \ccCommentHeading{Parameters} \\ -\ccc{first}: iterator over the first input point. \ccc{beyond}: past-the-end iterator over the input points. \ccc{point_pmap}: property map to access the position of an input point. \ccc{normal_pmap}: property map to access the {\bf oriented} normal of an input point. +\ccc{first}: iterator over the first input point. \ccc{beyond}: past-the-end iterator over the input points. \ccc{point_pmap}: property map to access the position of an input point. \ccc{normal_pmap}: property map to access the oriented normal of an input point. } \ccGlue diff --git a/Surface_reconstruction_points_3/examples/Surface_reconstruction_points_3/CMakeLists.txt b/Surface_reconstruction_points_3/examples/Surface_reconstruction_points_3/CMakeLists.txt index c52d576622a..2ed2390944e 100644 --- a/Surface_reconstruction_points_3/examples/Surface_reconstruction_points_3/CMakeLists.txt +++ b/Surface_reconstruction_points_3/examples/Surface_reconstruction_points_3/CMakeLists.txt @@ -55,35 +55,24 @@ if ( CGAL_FOUND ) find_package(Eigen3 3.0.91) #(requires 3.1.0-alpha1 or greater) - if (NOT EIGEN3_FOUND) - find_package(TAUCS) - if(TAUCS_FOUND) - include( ${TAUCS_USE_FILE} ) - endif(TAUCS_FOUND) - else() + if (EIGEN3_FOUND) include( ${EIGEN3_USE_FILE} ) endif() + find_package(TAUCS) + if(TAUCS_FOUND) + include( ${TAUCS_USE_FILE} ) + endif(TAUCS_FOUND) + if (EIGEN3_FOUND OR TAUCS_FOUND) # Executables that require Eigen 3 or TAUCS create_single_source_cgal_program( "poisson_reconstruction_example.cpp" ) + create_single_source_cgal_program( "poisson_reconstruction.cpp" ) else() - message(STATUS "NOTICE: Example poisson_reconstruction_example.cpp needs Eigen 3.1 (or greater) or the TAUCS library and will not be compiled.") + message(STATUS "NOTICE: The examples needs Eigen 3.1 (or greater) or the TAUCS library and will not be compiled.") endif() - if (EIGEN3_FOUND) - # Link with BLAS, LAPACK and TAUCS (optional) - find_package(TAUCS) - endif() - if(TAUCS_FOUND) - include( ${TAUCS_USE_FILE} ) - # Executables that require TAUCS - create_single_source_cgal_program( "poisson_reconstruction.cpp" ) - else(TAUCS_FOUND) - message(STATUS "NOTICE: Some of the executables in this directory need the TAUCS library and will not be compiled.") - endif(TAUCS_FOUND) - else() message(STATUS "NOTICE: This program requires the CGAL library, and will not be compiled.") diff --git a/Surface_reconstruction_points_3/examples/Surface_reconstruction_points_3/poisson_reconstruction.cpp b/Surface_reconstruction_points_3/examples/Surface_reconstruction_points_3/poisson_reconstruction.cpp index c9c9decd1e8..4e185deeacc 100644 --- a/Surface_reconstruction_points_3/examples/Surface_reconstruction_points_3/poisson_reconstruction.cpp +++ b/Surface_reconstruction_points_3/examples/Surface_reconstruction_points_3/poisson_reconstruction.cpp @@ -25,8 +25,9 @@ #include #include #include +#ifdef CGAL_TAUCS_ENABLED #include -//#include +#endif #include "compute_normal.h" @@ -92,7 +93,10 @@ int main(int argc, char * argv[]) std::cerr << "Options:\n"; std::cerr << " -sm_radius Radius upper bound (default=100 * average spacing)\n"; std::cerr << " -sm_distance Distance upper bound (default=0.25 * average spacing)\n"; - // std::cerr << " -solver taucs|mkl Sparse linear solver (default=TAUCS)\n"; + #if defined(CGAL_EIGEN3_ENABLED) && defined(CGAL_TAUCS_ENABLED) + std::cerr << " -solver eigen|taucs Sparse linear solver (default=eigen)\n"; + #endif + return EXIT_FAILURE; } @@ -100,7 +104,15 @@ int main(int argc, char * argv[]) FT sm_angle = 20.0; // Min triangle angle (degrees). FT sm_radius = 100; // Max triangle size w.r.t. point set average spacing. FT sm_distance = 0.25; // Approximation error w.r.t. point set average spacing. - std::string solver_name = "taucs"; // Sparse linear solver name. + #ifdef CGAL_EIGEN3_ENABLED + std::string solver_name = "eigen"; // Sparse linear solver name. + #else + #ifdef CGAL_TAUCS_ENABLED + std::string solver_name = "taucs"; // Sparse linear solver name. + #else + std::string solver_name = "no_solver_available"; + #endif + #endif // decode parameters std::string input_filename = argv[1]; @@ -217,6 +229,7 @@ int main(int argc, char * argv[]) points.begin(), points.end(), CGAL::make_normal_of_point_with_normal_pmap(points.begin())); + #ifdef CGAL_TAUCS_ENABLED if (solver_name == "taucs") { std::cerr << "Use TAUCS out-of-core Multifrontal Supernodal Cholesky Factorization\n"; @@ -242,29 +255,32 @@ int main(int argc, char * argv[]) return EXIT_FAILURE; } } - /* - else if (solver_name == "mkl") + else + #endif + #ifdef CGAL_EIGEN3_ENABLED { - std::cerr << "Use MKL Pardiso\n"; - - // Creates sparse linear solver: MKL Pardiso - //CGAL::MKL_symmetric_solver_traits solver; - CGAL::MKL_symmetric_solver_traits solver; - - // Computes the Poisson indicator function f() - // at each vertex of the triangulation. - if ( ! function.compute_implicit_function(solver) ) + if (solver_name == "eigen") { - std::cerr << "Error: cannot compute implicit function" << std::endl; + std::cerr << "Use Eigen 3\n"; + if ( ! function.compute_implicit_function() ) + { + std::cerr << "Error: cannot compute implicit function" << std::endl; + return EXIT_FAILURE; + } + } + else + { + std::cerr << "Error: invalid solver " << solver_name << "\n"; return EXIT_FAILURE; } } - */ - else + #else { std::cerr << "Error: invalid solver " << solver_name << "\n"; return EXIT_FAILURE; } + #endif + // Prints status std::cerr << "Total implicit function (triangulation+refinement+solver): " << task_timer.time() << " seconds\n"; diff --git a/Triangulation_2/doc_tex/Triangulation_2/triangulation_user.tex b/Triangulation_2/doc_tex/Triangulation_2/triangulation_user.tex index 18368831f49..e9fbf24047d 100644 --- a/Triangulation_2/doc_tex/Triangulation_2/triangulation_user.tex +++ b/Triangulation_2/doc_tex/Triangulation_2/triangulation_user.tex @@ -788,11 +788,11 @@ The class \ccc{Regular_triangulation_2} is designed to maintain the regular triangulation of a set of $2d$ weighted points. It derives from the class \ccc{Triangulation_2}. -The functions \ccc{insert} and +The functions \ccHtmlNoLinksFrom{\ccc{insert}} and \ccc{remove} are overwritten to handle weighted points and maintain the regular property. -In current version, function \ccc{move} is not +The function \ccHtmlNoLinksFrom{\ccc{move}} is not overwritten and thus does not preserve the regular property. The vertices of the regular triangulation of a set of weighted points ${PW}$ correspond only to a subset @@ -968,7 +968,7 @@ overrides the insertion and removal of a point to take care of the information about constrained edges. The class also allows inline insertion of a new constraint, given by its two endpoints or the removal of a constraint. -In current version, function \ccc{move} is not +In current version, function \ccHtmlNoLinksFrom{\ccc{move}} is not overwritten and thus does not take care of the constraints. \subsubsection{The Geometric Traits} @@ -1221,7 +1221,7 @@ classes. The class \ccc{Triangulation_hierarchy_2} inherits from the triangulation type passed as template parameter \ccc{Tr}. -The \ccc{insert}, \ccc{move}, and \ccc{remove} member functions +The \ccHtmlNoLinksFrom{\ccc{insert}}, \ccHtmlNoLinksFrom{\ccc{move}}, and \ccc{remove} member functions are overwritten to update the data structure at each operation. The locate queries are also overwritten to take advantage of the data structure for a fast processing. @@ -1382,7 +1382,7 @@ of the corresponding point given in the range. \subsubsection{Using an Iterator Over Pairs} Each point and its information are gathered into a pair. We provide -the \ccc{insert} function of the triangulation with a range of such pairs. +the \ccHtmlNoLinksFrom{\ccc{insert}} function of the triangulation with a range of such pairs. \ccIncludeExampleCode{Triangulation_2/info_insert_with_pair_iterator_2.cpp} diff --git a/Triangulation_2/doc_tex/Triangulation_2_ref/Constrained_triangulation_plus_2.tex b/Triangulation_2/doc_tex/Triangulation_2_ref/Constrained_triangulation_plus_2.tex index dc6a281517c..2f8d4476d4b 100644 --- a/Triangulation_2/doc_tex/Triangulation_2_ref/Constrained_triangulation_plus_2.tex +++ b/Triangulation_2/doc_tex/Triangulation_2_ref/Constrained_triangulation_plus_2.tex @@ -102,7 +102,7 @@ is \ccc{Context}.} \ccConstructor{Constrained_triangulation_plus_2(const Constrained_triangulation_plus_2& ct);}{Copy constructor.} -\ccConstructor{Constrained_triangulation_plus_2(std::list& lc, +\ccConstructor{Constrained_triangulation_plus_2(std::list& lc, const Geom_traits& t = Geom_traits())} {Introduces and builds a constrained triangulation from the list of constraints \ccc{lc}.} @@ -119,9 +119,9 @@ $\left[\right.$\ccc{first}, \ccc{last}$\left.\right)$. is \ccc{Constraint}. } -\ccFunction{void ~ctp();} -{Destructor. All vertices and faces are deleted. -The constraint hierarchy is deleted.} +%\ccFunction{void ~ctp();} +%{Destructor. All vertices and faces are deleted. +%The constraint hierarchy is deleted.} diff --git a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_hierarchy_2.h b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_hierarchy_2.h index fdc73205eb5..7fc3279c2cb 100644 --- a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_hierarchy_2.h +++ b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_hierarchy_2.h @@ -135,6 +135,8 @@ _test_cls_hierarchy_2() h.remove_constraint(v[3],v[4]); // h.print(); + for(int i=0; i <10; i++) { delete v[i];} + return; } diff --git a/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h b/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h index 79a8a521374..894fee0afbe 100644 --- a/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h +++ b/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h @@ -47,12 +47,18 @@ namespace CGAL { +// Here is the declaration of a class template with three arguments, one +// having a default value. There is no definition of that class template. template < class Gt, class Tds_ = Default, class Location_policy = Default > class Delaunay_triangulation_3; +// There is a specialization Delaunay_triangulation_3 +// defined in . +// Here is the specialization Delaunay_triangulation_3, with two +// arguments, that is if Location_policy being the default value 'Default'. template < class Gt, class Tds_ > class Delaunay_triangulation_3 : public Triangulation_3