diff --git a/.gitattributes b/.gitattributes index 0e5f06ef313..0132bd7041d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -266,8 +266,7 @@ Approximate_min_ellipsoid_d/documentation/boundingbox.mw -text svneol=native#app Arithmetic_kernel/include/CGAL/CORE_arithmetic_kernel.h -text Arithmetic_kernel/include/CGAL/GMP_arithmetic_kernel.h -text Arithmetic_kernel/include/CGAL/LEDA_arithmetic_kernel.h -text -Arithmetic_kernel/include/CGAL/OLD/GMP/Gmpfr_interval_type.h -text -Arithmetic_kernel/include/CGAL/OLD/Gmpfr_interval.h -text +Arithmetic_kernel/include/CGAL/MP_Float_arithmetic_kernel.h -text Arithmetic_kernel/package_info/Arithmetic_kernel/description.txt -text Arithmetic_kernel/package_info/Arithmetic_kernel/maintainer -text Arithmetic_kernel/test/Arithmetic_kernel/Arithmetic_kernel.cpp -text @@ -1579,6 +1578,8 @@ Envelope_3/test/Envelope_3/data/spheres/stest6.cin -text Envelope_3/test/Envelope_3/data/spheres/stest7.cin -text Envelope_3/test/Envelope_3/data/spheres/stest8.cin -text Envelope_3/test/Envelope_3/data/spheres/stest9.cin -text +Envelope_3/test/Envelope_3/data/triangles/edge_bug.cin -text +Envelope_3/test/Envelope_3/data/triangles/edge_bug_all.cin -text Envelope_3/test/Envelope_3/data/triangles/grid_inter_tri_const_envelope.cin -text Envelope_3/test/Envelope_3/data/triangles/grid_inter_tri_const_envelope_40.cin -text Envelope_3/test/Envelope_3/data/triangles/grid_intersecting_triangles.cin -text @@ -1917,6 +1918,8 @@ Kernel_23/include/CGAL/internal/Projection_traits_3.h -text Kernel_23/test/Kernel_23/CMakeLists.txt -text Kernel_d/doc_tex/Kernel_d/hypercube.png -text Kernel_d/doc_tex/Kernel_d_ref/Kernel_Compute_coordinate_d.tex -text +Kernel_d/doc_tex/Kernel_d_ref/Kernel_Less_coordinate_d.tex -text +Kernel_d/doc_tex/Kernel_d_ref/Kernel_Point_dimension_d.tex -text Kernel_d/include/CGAL/Kernel_d/Cartesian_const_iterator_d.h -text Kernel_d/test/Kernel_d/Linear_algebra-test.cmd eol=lf Kinetic_data_structures/demo/Kinetic_data_structures/data/after002 -text @@ -2859,6 +2862,7 @@ Number_types/doc_tex/NumberTypeSupport_ref/CORE_BigFloat.tex -text Number_types/doc_tex/NumberTypeSupport_ref/Gmpfi.tex -text Number_types/doc_tex/NumberTypeSupport_ref/Gmpfr.tex -text Number_types/doc_tex/NumberTypeSupport_ref/fundamental_types.tex -text +Number_types/doc_tex/NumberTypeSupport_ref/make_sqrt.tex -text Number_types/doc_tex/NumberTypeSupport_ref/open.tex -text Number_types/include/CGAL/GMP/Gmpfi_type.h -text Number_types/include/CGAL/GMP/Gmpfi_type_static.h -text @@ -2867,6 +2871,7 @@ Number_types/include/CGAL/GMP/Gmpfr_type_static.h -text Number_types/include/CGAL/Gmpfi.h -text Number_types/include/CGAL/Gmpfr.h -text Number_types/include/CGAL/Quotient_fwd.h -text +Number_types/include/CGAL/Root_of_traits_specializations.h -text Number_types/include/CGAL/Sqrt_extension/Algebraic_extension_traits.h -text Number_types/include/CGAL/Sqrt_extension/Algebraic_structure_traits.h -text Number_types/include/CGAL/Sqrt_extension/Coercion_traits.h -text @@ -2879,12 +2884,15 @@ Number_types/include/CGAL/Sqrt_extension/Sqrt_extension_type.h -text Number_types/include/CGAL/Sqrt_extension/Wang_traits.h -text Number_types/include/CGAL/Sqrt_extension/convert_to_bfi.h -text Number_types/include/CGAL/Sqrt_extension/io.h -text +Number_types/include/CGAL/Sqrt_extension_fwd.h -text +Number_types/include/CGAL/Test/test_root_of_traits.h -text Number_types/include/CGAL/mpfi_coercion_traits.h -text Number_types/include/CGAL/mpfr_coercion_traits.h -text Number_types/test/Number_types/CMakeLists.txt -text Number_types/test/Number_types/Gmpfi.cpp -text Number_types/test/Number_types/Gmpfr.cpp -text Number_types/test/Number_types/Gmpfr_bug.cpp -text +Number_types/test/Number_types/include/CGAL/Test/test_root_of_2_traits.h -text Number_types/test/Number_types/include/CGAL/_test_io.h -text Optimisation_doc/doc_tex/Bounding_volumes/annulus.gif -text svneol=unset#image/gif Optimisation_doc/doc_tex/Bounding_volumes/annulus.pdf -text svneol=unset#application/pdf @@ -3049,6 +3057,7 @@ Polygon/doc_tex/Polygon/polygon.png -text Polyhedron/demo/Polyhedron/MainWindow.ui -text Polyhedron/demo/Polyhedron/Polyhedron_3.qrc -text Polyhedron/demo/Polyhedron/Remeshing_dialog.ui -text +Polyhedron/demo/Polyhedron/Show_point_dialog.ui -text Polyhedron/demo/Polyhedron/cgal_test_with_cmake eol=lf Polyhedron/demo/Polyhedron/data/anchor.off -text svneol=unset#application/octet-stream Polyhedron/demo/Polyhedron/data/bones.off -text svneol=unset#application/octet-stream @@ -3503,12 +3512,38 @@ Spatial_searching/doc_tex/Spatial_searching/windowQuery.png -text Spatial_searching/include/CGAL/internal/K_neighbor_search.h -text Spatial_searching/include/CGAL/internal/bounded_priority_queue.h -text Spatial_searching/test/Spatial_searching/Compare_methods.cpp -text +Spatial_sorting/doc_tex/Spatial_sorting/fig/Hilbert-median.gif -text +Spatial_sorting/doc_tex/Spatial_sorting/fig/Hilbert-median.pdf -text +Spatial_sorting/doc_tex/Spatial_sorting/fig/Hilbert-middle.gif -text +Spatial_sorting/doc_tex/Spatial_sorting/fig/Hilbert-middle.pdf -text +Spatial_sorting/doc_tex/Spatial_sorting/fig/Hilbert8.gif -text +Spatial_sorting/doc_tex/Spatial_sorting/fig/Hilbert8.pdf -text Spatial_sorting/doc_tex/Spatial_sorting/fig/hilbert.png -text Spatial_sorting/doc_tex/Spatial_sorting/fig/hilbertLarge.jpg -text -Spatial_sorting/dont_submit -text -Spatial_sorting/examples/Spatial_sorting/data/input.cin -text -Spatial_sorting/examples/Spatial_sorting/example_delaunay_2.cmd -text -Spatial_sorting/examples/Spatial_sorting/sort_indices.cmd -text +Spatial_sorting/doc_tex/Spatial_sorting_ref/Hilbert_policy_tags.tex -text +Spatial_sorting/doc_tex/Spatial_sorting_ref/Hilbert_sort_d.tex -text +Spatial_sorting/doc_tex/Spatial_sorting_ref/SpatialSortingTraits_d.tex -text +Spatial_sorting/doc_tex/Spatial_sorting_ref/Spatial_sort_traits_adapter_2.tex -text +Spatial_sorting/doc_tex/Spatial_sorting_ref/Spatial_sort_traits_adapter_3.tex -text +Spatial_sorting/doc_tex/Spatial_sorting_ref/Spatial_sort_traits_adapter_d.tex -text +Spatial_sorting/examples/Spatial_sorting/hilbert.cpp -text +Spatial_sorting/examples/Spatial_sorting/hilbert_policies.cpp -text +Spatial_sorting/examples/Spatial_sorting/small_example_delaunay_2.cpp -text +Spatial_sorting/examples/Spatial_sorting/sp_sort_using_property_map_2.cpp -text +Spatial_sorting/examples/Spatial_sorting/sp_sort_using_property_map_3.cpp -text +Spatial_sorting/examples/Spatial_sorting/sp_sort_using_property_map_d.cpp -text +Spatial_sorting/include/CGAL/Hilbert_policy_tags.h -text +Spatial_sorting/include/CGAL/Hilbert_sort_d.h -text +Spatial_sorting/include/CGAL/Hilbert_sort_median_2.h -text +Spatial_sorting/include/CGAL/Hilbert_sort_median_3.h -text +Spatial_sorting/include/CGAL/Hilbert_sort_median_d.h -text +Spatial_sorting/include/CGAL/Hilbert_sort_middle_2.h -text +Spatial_sorting/include/CGAL/Hilbert_sort_middle_3.h -text +Spatial_sorting/include/CGAL/Hilbert_sort_middle_base.h -text +Spatial_sorting/include/CGAL/Hilbert_sort_middle_d.h -text +Spatial_sorting/include/CGAL/Spatial_sort_traits_adapter_2.h -text +Spatial_sorting/include/CGAL/Spatial_sort_traits_adapter_3.h -text +Spatial_sorting/include/CGAL/Spatial_sort_traits_adapter_d.h -text Straight_skeleton_2/demo/Straight_skeleton_2/data/complex_0.poly -text svneol=unset#application/octet-stream Straight_skeleton_2/demo/Straight_skeleton_2/data/complex_1.poly -text svneol=unset#application/octet-stream Straight_skeleton_2/demo/Straight_skeleton_2/data/complex_2.poly -text svneol=unset#application/octet-stream @@ -4295,7 +4330,7 @@ Triangulation_3/examples/Triangulation_3/info_insert_with_zip_iterator.cpp -text Triangulation_3/include/CGAL/internal/Static_filters/Compare_weighted_squared_radius_3.h -text Triangulation_3/include/CGAL/internal/Static_filters/Power_test_3.h -text Triangulation_3/include/CGAL/internal/Static_filters/Regular_triangulation_static_filters_traits_3.h -text -Triangulation_3/include/CGAL/internal/spatial_sorting_traits_with_indices.h -text +Triangulation_3/include/CGAL/internal/info_check.h -text Triangulation_3/test/Triangulation_3/include/CGAL/_test_remove_cluster.h -text Triangulation_3/test/Triangulation_3/test_regular_insert_range_with_info.cpp -text Triangulation_3/test/Triangulation_3/test_static_filters.cpp -text diff --git a/AABB_tree/demo/AABB_tree/MainWindow.cpp b/AABB_tree/demo/AABB_tree/MainWindow.cpp index c4ffcc8ae3f..e3282019ab2 100644 --- a/AABB_tree/demo/AABB_tree/MainWindow.cpp +++ b/AABB_tree/demo/AABB_tree/MainWindow.cpp @@ -402,8 +402,10 @@ void MainWindow::on_actionRefine_loop_triggered() void MainWindow::on_actionSave_snapshot_triggered() { + // save snapshot to file QApplication::setOverrideCursor(Qt::WaitCursor); - m_pViewer->saveSnapshot(QString("snapshot.png")); + QString filename = QFileDialog::getSaveFileName(this,tr("Save snapshot to file..."),"snapshot00.png","*.png"); + m_pViewer->saveSnapshot(filename); QApplication::restoreOverrideCursor(); } void MainWindow::on_actionCopy_snapshot_triggered() diff --git a/AABB_tree/doc_tex/AABB_tree/examples.tex b/AABB_tree/doc_tex/AABB_tree/examples.tex index f302144f425..a0e9fc71438 100644 --- a/AABB_tree/doc_tex/AABB_tree/examples.tex +++ b/AABB_tree/doc_tex/AABB_tree/examples.tex @@ -6,7 +6,7 @@ In the following example a set of 3D triangles is stored in a list. The AABB pri \ccIncludeExampleCode{AABB_tree/AABB_triangle_3_example.cpp} \subsection{Tree of Polyhedron Triangle Facets for Intersection Queries} -In the following example the AABB primitive wraps a facet handle of a triangle polyhedral surface as \ccc{id} and the corresponding 3D triangle as geometric object. From a segment query we test the intersections, then compute the number of intersections, compute the first encountered intersection (generally a point), compute all intersections (where each intersection is a pair of one CGAL object and one primitive id - here a face handle) and compute all intersected primitives. The latter involves only tests and no predicates and is hence faster than computing all intersections. We also compute the first encountered intersection with a plane query, which is generally a segment. +In the following example the AABB primitive wraps a facet handle of a triangle polyhedral surface as \ccc{id} and the corresponding 3D triangle as geometric object. From a segment query we test the intersections, then compute the number of intersections, compute the first encountered intersection (generally a point), compute all intersections (where each intersection is a pair of one \cgal\ object and one primitive id - here a face handle) and compute all intersected primitives. The latter involves only tests and no predicates and is hence faster than computing all intersections. We also compute the first encountered intersection with a plane query, which is generally a segment. \ccIncludeExampleCode{AABB_tree/AABB_polyhedron_facet_intersection_example.cpp} \subsection{Tree of Polyhedron Triangle Facets for Distance Queries} diff --git a/AABB_tree/doc_tex/AABB_tree/performances.tex b/AABB_tree/doc_tex/AABB_tree/performances.tex index b2498bffe7a..b118c086ddf 100644 --- a/AABB_tree/doc_tex/AABB_tree/performances.tex +++ b/AABB_tree/doc_tex/AABB_tree/performances.tex @@ -115,7 +115,7 @@ The experiments described above are neither exhaustive nor conclusive as we have \begin{itemize} -\item Kernel: The type of CGAL kernel turns out to dominate the final execution times, the maximum performances being obtained with the simple Cartesian kernel parameterized with the double precision number type. In applications where the intersection and distance execution times are crucial it is possible to use this kernel for the AABB tree in combination with a more robust kernel for the main data structure. +\item Kernel: The type of \cgal\ kernel turns out to dominate the final execution times, the maximum performances being obtained with the simple Cartesian kernel parameterized with the double precision number type. In applications where the intersection and distance execution times are crucial it is possible to use this kernel for the AABB tree in combination with a more robust kernel for the main data structure. \item Primitives: Although the number of input primitives plays an obvious role in the final performance, their distribution in space is at least equally important in order to obtain a well-balanced AABB tree. Ideally the primitives must be evenly distributed in space and the long primitives spanning the bounding box of the tree root node must be avoided as much as possible. It is often beneficial to split these long primitives into smaller ones before constructing the tree, e.g., through recursive longest edge bisection for triangle surface meshes. diff --git a/Algebraic_foundations/doc_tex/Algebraic_foundations/history.tex b/Algebraic_foundations/doc_tex/Algebraic_foundations/history.tex index 58791662fb3..45047da4c93 100644 --- a/Algebraic_foundations/doc_tex/Algebraic_foundations/history.tex +++ b/Algebraic_foundations/doc_tex/Algebraic_foundations/history.tex @@ -1,6 +1,6 @@ \section{Design and Implementation History} -The package is part of CGAL since release 3.3. Of course the package is based +The package is part of \cgal\ since release 3.3. Of course the package is based on the former Number type support of CGAL. This goes back to Stefan Schirra and Andreas Fabri. But on the other hand the package is to a large extend influenced by the experience with the number type support in \exacus~\cite{beh+-eeeafcs-05}, which in the main goes back to diff --git a/Algebraic_foundations/doc_tex/Algebraic_foundations/real_number_types.tex b/Algebraic_foundations/doc_tex/Algebraic_foundations/real_number_types.tex index 0b8fcb0b6d1..ccbcf368511 100644 --- a/Algebraic_foundations/doc_tex/Algebraic_foundations/real_number_types.tex +++ b/Algebraic_foundations/doc_tex/Algebraic_foundations/real_number_types.tex @@ -1,5 +1,5 @@ \section{Real Number Types} -Every CGAL \ccc{Kernel} comes with two \emph{real number types} +Every \cgal\ \ccc{Kernel} comes with two \emph{real number types} (number types embeddable into the real numbers). One of them is a \ccc{FieldNumberType}, and the other a \ccc{RingNumberType}. The coordinates of the basic kernel objects (points, vectors, etc.) come diff --git a/Algebraic_foundations/test/Algebraic_foundations/Chinese_remainder_traits.cpp b/Algebraic_foundations/test/Algebraic_foundations/Chinese_remainder_traits.cpp index 11c967f563c..b3f30e815f4 100644 --- a/Algebraic_foundations/test/Algebraic_foundations/Chinese_remainder_traits.cpp +++ b/Algebraic_foundations/test/Algebraic_foundations/Chinese_remainder_traits.cpp @@ -47,12 +47,12 @@ struct Get_max_coefficient{ } }; -template -struct Get_max_coefficient >{ +template +struct Get_max_coefficient >{ typedef Get_max_coefficient GMC; typedef typename GMC::result_type result_type; - result_type operator () (const CGAL::Sqrt_extension& a) { + result_type operator () (const CGAL::Sqrt_extension& a) { GMC gmc; return std::max(std::max(gmc(a.a0()), gmc(a.a1())), gmc(NT(a.root()))); } diff --git a/Algebraic_kernel_d/doc_tex/Algebraic_kernel_d/models.tex b/Algebraic_kernel_d/doc_tex/Algebraic_kernel_d/models.tex index 3cea3d4e7ce..d93791c04ce 100644 --- a/Algebraic_kernel_d/doc_tex/Algebraic_kernel_d/models.tex +++ b/Algebraic_kernel_d/doc_tex/Algebraic_kernel_d/models.tex @@ -79,7 +79,7 @@ interfaces between layers. Specifically, working with only one number type allows to optimize some polynomial operations as well as memory handling. The implementation of these kernels make heavy use of the \mpfr~\cite{cgal:mt-mpfr} and \mpfi~\cite{cgal:r-mpfi} -libraries, and of their CGAL interfaces, \ccc{Gmpfr} and \ccc{Gmpfi}. +libraries, and of their \cgal\ interfaces, \ccc{Gmpfr} and \ccc{Gmpfi}. The algebraic numbers (roots of the polynomials) are represented in the two \rs~kernels by a \ccc{Gmpfi} interval and a pointer to the polynomial of which they are roots. See \cite{cgal:lpt-wea-09} diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_rep_bfi.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_rep_bfi.h index 27b65524111..c02109011da 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_rep_bfi.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_rep_bfi.h @@ -39,16 +39,15 @@ #include #include #include - +#include +#include namespace CGAL { -template struct Get_arithmetic_kernel; - // it would be nice to remove the explicit use of Sqrt_extension // in this file. However, it is much more efficient to convert the root // only once. see convert_to_bfi -template class Sqrt_extension; +//template class Sqrt_extension; //use forward declaration instead namespace internal { @@ -98,11 +97,11 @@ private: } } - template + template inline void convert_coeffs( - const CGAL::Polynomial< CGAL::Sqrt_extension >& poly, + const CGAL::Polynomial< CGAL::Sqrt_extension >& poly, OI it ) const { BFI root(0); diff --git a/Algebraic_kernel_d/include/CGAL/RS/isole_1.h b/Algebraic_kernel_d/include/CGAL/RS/isole_1.h index f40c5a99da2..407a80f5694 100644 --- a/Algebraic_kernel_d/include/CGAL/RS/isole_1.h +++ b/Algebraic_kernel_d/include/CGAL/RS/isole_1.h @@ -45,7 +45,7 @@ isolator::operator()(const Polynomial_ &p,unsigned int prec){ CGAL_error_msg( "isolator not implemented for this type of polynomials"); return std::vector(); -}; +} template <> inline std::vector @@ -56,7 +56,7 @@ isolator >::operator()(const Polynomial &p, mpz_t *coeffs=(mpz_t*)malloc((degree+1)*sizeof(mpz_t)); mpfi_ptr *intervals_mpfi=(mpfi_ptr*)malloc(degree*sizeof(mpfi_ptr)); std::vector intervals; - for(int i=0;i<=degree;++i) + for(unsigned int i=0;i<=degree;++i) coeffs[i][0]=*(p[i].mpz()); init_solver(); create_rs_upoly(coeffs,degree,rs_get_default_up()); @@ -69,7 +69,7 @@ isolator >::operator()(const Polynomial &p, intervals.push_back(Gmpfi(intervals_mpfi[j])); free(intervals_mpfi); return intervals; -}; +} } // namespace RS diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/CMakeLists.txt b/Algebraic_kernel_d/test/Algebraic_kernel_d/CMakeLists.txt index 99c568e337f..866e4fdf4ba 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/CMakeLists.txt +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/CMakeLists.txt @@ -41,15 +41,19 @@ if ( CGAL_FOUND ) create_single_source_cgal_program( "Algebraic_kernel_d_1_CORE.cpp" ) create_single_source_cgal_program( "Algebraic_kernel_d_1_GMP.cpp" ) create_single_source_cgal_program( "Algebraic_kernel_d_2.cpp" ) - create_single_source_cgal_program( "Algebraic_kernel_rs_gmpq_d_1.cpp" ) - create_single_source_cgal_program( "Algebraic_kernel_rs_gmpz_d_1.cpp" ) create_single_source_cgal_program( "Algebraic_real_d_1.cpp" ) create_single_source_cgal_program( "Bitstream_descartes.cpp" ) create_single_source_cgal_program( "Curve_analysis_2.cpp" ) create_single_source_cgal_program( "Curve_pair_analysis_2.cpp" ) create_single_source_cgal_program( "Descartes.cpp" ) create_single_source_cgal_program( "Real_embeddable_traits_extension.cpp" ) - create_single_source_cgal_program( "rs_isolator.cpp" ) + if(RS_FOUND) + create_single_source_cgal_program( "Algebraic_kernel_rs_gmpq_d_1.cpp" ) + create_single_source_cgal_program( "Algebraic_kernel_rs_gmpz_d_1.cpp" ) + create_single_source_cgal_program( "rs_isolator.cpp" ) + else() + message(STATUS "NOTICE: Some tests require the RS library, and will not be compiled.") + endif() else() diff --git a/Algebraic_kernel_for_circles/doc_tex/Algebraic_kernel_for_circles_ref/intro.tex b/Algebraic_kernel_for_circles/doc_tex/Algebraic_kernel_for_circles_ref/intro.tex index 1cc73da4619..9dfa385f7fd 100644 --- a/Algebraic_kernel_for_circles/doc_tex/Algebraic_kernel_for_circles_ref/intro.tex +++ b/Algebraic_kernel_for_circles/doc_tex/Algebraic_kernel_for_circles_ref/intro.tex @@ -4,7 +4,7 @@ \begin{ccAdvanced} As in Curved-kernel, I use the ``Advanced'' environment in this -document to distinguish between my current submission to the CGAL +document to distinguish between my current submission to the \cgal\ editorial board and plans for the future, related to ACS. The ``Advanced'' parts will disappear if/when this is released. \end{ccAdvanced} @@ -33,10 +33,10 @@ Polynomial-2-2's gives Root-of-4's...) General remark about the suffix \ccc{_d_v}: \ccc{_d} stands for the degree of the polynomials and the algebraic numbers, and \ccc{_v} stands for the number of variables, which is analogous to the -dimension for CGAL geometric objects. I had already mentioned this in an -earlier version of this document (presented at the CGAL meeting at +dimension for \cgal\ geometric objects. I had already mentioned this in an +earlier version of this document (presented at the \cgal\ meeting at INRIA in march 05), and it is consistent with what Menelaos proposed -later (CGAL meeting in Pisa in june 05) for a hierarchy of algebraic kernels. +later (\cgal\ meeting in Pisa in june 05) for a hierarchy of algebraic kernels. \end{ccAdvanced} \subsubsection*{Functors} diff --git a/Algebraic_kernel_for_circles/include/CGAL/Algebraic_kernel_for_circles_2_2.h b/Algebraic_kernel_for_circles/include/CGAL/Algebraic_kernel_for_circles_2_2.h index 4101a6b896c..b12a0267ae9 100644 --- a/Algebraic_kernel_for_circles/include/CGAL/Algebraic_kernel_for_circles_2_2.h +++ b/Algebraic_kernel_for_circles/include/CGAL/Algebraic_kernel_for_circles_2_2.h @@ -26,7 +26,7 @@ #define CGAL_ALGEBRAIC_KERNEL_FOR_CIRCLES_2_2_H #include -#include +#include #include #include #include diff --git a/Algebraic_kernel_for_spheres/include/CGAL/Algebraic_kernel_for_spheres_2_3.h b/Algebraic_kernel_for_spheres/include/CGAL/Algebraic_kernel_for_spheres_2_3.h index c65b389bfc1..2ea9e8f720e 100644 --- a/Algebraic_kernel_for_spheres/include/CGAL/Algebraic_kernel_for_spheres_2_3.h +++ b/Algebraic_kernel_for_spheres/include/CGAL/Algebraic_kernel_for_spheres_2_3.h @@ -29,7 +29,7 @@ #ifndef CGAL_ALGEBRAIC_KERNEL_FOR_SPHERES_2_3_H #define CGAL_ALGEBRAIC_KERNEL_FOR_SPHERES_2_3_H -#include +#include #include #include #include diff --git a/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h b/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h index c7b3bf80f02..3f591c79e32 100644 --- a/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h +++ b/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h @@ -1406,6 +1406,8 @@ Alpha_shape_2
::find_alpha_solid() const // starting point for searching // takes O(#alpha_shape) time Coord_type alpha_solid = 0; + + if (number_of_vertices()<3) return alpha_solid; Finite_vertices_iterator vertex_it; // only finite vertices diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2.h index bfaaf1f1976..6fa25e9b896 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_2_impl.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_2_impl.h index f6306c31f92..e50f3777832 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_2_impl.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_2_impl.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas #ifndef CGAL_APOLLONIUS_GRAPH_2_IMPL_H diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_hierarchy_2_impl.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_hierarchy_2_impl.h index 18c70f27d17..bcee91c165f 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_hierarchy_2_impl.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_hierarchy_2_impl.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas #ifndef CGAL_APOLLONIUS_GRAPH_HIERARCHY_2_IMPL_H #define CGAL_APOLLONIUS_GRAPH_HIERARCHY_2_IMPL_H diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Bounded_side_of_ccw_circle_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Bounded_side_of_ccw_circle_C2.h index 4f91fe57643..53ce876175c 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Bounded_side_of_ccw_circle_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Bounded_side_of_ccw_circle_C2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Compare_weight_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Compare_weight_2.h index a3ed45a77a6..6c73d29c505 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Compare_weight_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Compare_weight_2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Compare_x_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Compare_x_2.h index ebe2429f03d..b7278070951 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Compare_x_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Compare_x_2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Compare_y_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Compare_y_2.h index 26965d5eb14..3ffd57d4c3a 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Compare_y_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Compare_y_2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Constructions_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Constructions_C2.h index e1700376ced..fda0b0b99ab 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Constructions_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Constructions_C2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Constructions_ftC2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Constructions_ftC2.h index 0791248fd85..d15feb7849b 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Constructions_ftC2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Constructions_ftC2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Constructions_rtH2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Constructions_rtH2.h index 32a8ba782b1..cad16f60c20 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Constructions_rtH2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Constructions_rtH2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Apollonius_graph_mixed_filtered_traits_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Apollonius_graph_mixed_filtered_traits_2.h index e0e2fb12336..78052a34d2b 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Apollonius_graph_mixed_filtered_traits_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Apollonius_graph_mixed_filtered_traits_2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Apollonius_graph_mixed_traits_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Apollonius_graph_mixed_traits_2.h index de63dcab68b..8246e457105 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Apollonius_graph_mixed_traits_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Apollonius_graph_mixed_traits_2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas // Christophe Delage // David Millman diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Apollonius_graph_new_filtered_traits_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Apollonius_graph_new_filtered_traits_2.h index 9e204547b4a..af7fc9f8b53 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Apollonius_graph_new_filtered_traits_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Apollonius_graph_new_filtered_traits_2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Apollonius_graph_new_traits_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Apollonius_graph_new_traits_2.h index 4de67913414..b9bf3b4d65e 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Apollonius_graph_new_traits_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Apollonius_graph_new_traits_2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas // Christophe Delage // David Millman diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Conflict_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Conflict_2.h index d96eca823c8..09af8cabb03 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Conflict_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Conflict_2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas // Christophe Delage // David Millman diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Edge_conflict_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Edge_conflict_2.h index 60bbe4c25d3..6963698ef43 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Edge_conflict_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Edge_conflict_2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas // Christophe Delage // David Millman diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Finite_edge_conflict_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Finite_edge_conflict_2.h index a8b445f35f0..6e15eb48843 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Finite_edge_conflict_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Finite_edge_conflict_2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas // Christophe Delage // David Millman diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Infinite_edge_conflict_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Infinite_edge_conflict_2.h index 639dd51cd84..53a6f816f3e 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Infinite_edge_conflict_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Infinite_edge_conflict_2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas // Christophe Delage // David Millman diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/New_predicates_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/New_predicates_C2.h index 7b4c5191ff4..68a554f6eb1 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/New_predicates_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/New_predicates_C2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Orientation_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Orientation_2.h index 6445c6aebcc..dc90290b563 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Orientation_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Orientation_2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas // Christophe Delage // David Millman diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Vertex_conflict_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Vertex_conflict_2.h index db7dfb0d80b..59771d75284 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Vertex_conflict_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Delage_traits/Vertex_conflict_2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas // Christophe Delage // David Millman diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Finite_edge_test8_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Finite_edge_test8_C2.h index e91542ce247..092e29e2044 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Finite_edge_test8_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Finite_edge_test8_C2.h @@ -1,4 +1,4 @@ -// Copyright (c) 2007 Foundation for Research and Technology-Hellas (Greece). +// Copyright (c) 2007 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org); you may redistribute it under diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Finite_edge_test_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Finite_edge_test_C2.h index c5736ac4e8c..1752789e19e 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Finite_edge_test_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Finite_edge_test_C2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Incircle8_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Incircle8_C2.h index f7d57da1457..fbfeb7b119f 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Incircle8_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Incircle8_C2.h @@ -1,4 +1,4 @@ -// Copyright (c) 2007 Foundation for Research and Technology-Hellas (Greece). +// Copyright (c) 2007 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org); you may redistribute it under diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Incircle_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Incircle_C2.h index 4e44b631967..f9e2a7d1741 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Incircle_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Incircle_C2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Infinite_edge_test_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Infinite_edge_test_C2.h index 38700409fc5..ca9302b9ec2 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Infinite_edge_test_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Infinite_edge_test_C2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Is_degenerate_edge_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Is_degenerate_edge_C2.h index 37fbd5e78a7..6965d6b24d2 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Is_degenerate_edge_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Is_degenerate_edge_C2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Is_hidden_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Is_hidden_C2.h index 57350931520..66020be1445 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Is_hidden_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Is_hidden_C2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Kernel_wrapper_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Kernel_wrapper_2.h index bbf5d0875ab..1aaf0eb5bc9 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Kernel_wrapper_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Kernel_wrapper_2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Orientation8_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Orientation8_C2.h index 21f1b99ccb6..e7b4599b1bb 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Orientation8_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Orientation8_C2.h @@ -1,4 +1,4 @@ -// Copyright (c) 2007 Foundation for Research and Technology-Hellas (Greece). +// Copyright (c) 2007 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org); you may redistribute it under diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Orientation_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Orientation_2.h index 35f257cd661..b0f3d5f33a3 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Orientation_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Orientation_2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Oriented_side_of_bisector_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Oriented_side_of_bisector_C2.h index e54eb05b5e1..3059d74993c 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Oriented_side_of_bisector_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Oriented_side_of_bisector_C2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Predicate_constructions_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Predicate_constructions_C2.h index b3e087255cd..9c9e908c77b 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Predicate_constructions_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Predicate_constructions_C2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Predicates_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Predicates_C2.h index 08f926de950..67190999f8e 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Predicates_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Predicates_C2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Traits_wrapper_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Traits_wrapper_2.h index d0d946cbe77..651829c32ba 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Traits_wrapper_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Traits_wrapper_2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/basic.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/basic.h index b4a6ff0471d..c577ad90e6c 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/basic.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/basic.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas #ifndef CGAL_APOLLONIUS_GRAPH_2_BASIC_H #define CGAL_APOLLONIUS_GRAPH_2_BASIC_H 1 diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/check_filter.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/check_filter.h index a52a74dab36..3654fddd46a 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/check_filter.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/check_filter.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/comparator_profiler.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/comparator_profiler.h index 898961721cc..4246e802383 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/comparator_profiler.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/comparator_profiler.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/compare_quadratic.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/compare_quadratic.h index 81325a3011a..a8561b60f62 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/compare_quadratic.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/compare_quadratic.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/predicate_profiler.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/predicate_profiler.h index 057db54b6b7..fcb966f1119 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/predicate_profiler.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/predicate_profiler.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/Apollonius_graph_uncertain_filtered_traits_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/Apollonius_graph_uncertain_filtered_traits_2.h index d5e0ce69217..7b531258f69 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/Apollonius_graph_uncertain_filtered_traits_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/Apollonius_graph_uncertain_filtered_traits_2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/Uncertain_is_hidden_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/Uncertain_is_hidden_C2.h index ea0c36704d6..1278be7d648 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/Uncertain_is_hidden_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/Uncertain_is_hidden_C2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/Uncertain_oriented_side_of_bisector_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/Uncertain_oriented_side_of_bisector_C2.h index 4c6f26d0df7..1ffef81e6bd 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/Uncertain_oriented_side_of_bisector_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/Uncertain_oriented_side_of_bisector_C2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/Uncertain_vertex_conflict_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/Uncertain_vertex_conflict_2.h index 58c0b38b928..34a26a2096a 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/Uncertain_vertex_conflict_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/Uncertain_vertex_conflict_2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas // Christophe Delage // David Millman diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/uncertain_functions_on_signs.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/uncertain_functions_on_signs.h index 23bce6de9f7..d25747340e8 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/uncertain_functions_on_signs.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/uncertain/uncertain_functions_on_signs.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_data_structure_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_data_structure_2.h index 88f3647ca5c..5f6175447b3 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_data_structure_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_data_structure_2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_filtered_traits_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_filtered_traits_2.h index a29f7a73402..a922ab4c441 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_filtered_traits_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_filtered_traits_2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_hierarchy_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_hierarchy_2.h index 4d06ce76313..5cf75a75ab4 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_hierarchy_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_hierarchy_2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas #ifndef CGAL_APOLLONIUS_GRAPH_HIERARCHY_2_H #define CGAL_APOLLONIUS_GRAPH_HIERARCHY_2_H diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_hierarchy_vertex_base_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_hierarchy_vertex_base_2.h index d8de07c78a4..c4858867c44 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_hierarchy_vertex_base_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_hierarchy_vertex_base_2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas #ifndef CGAL_APOLLONIUS_GRAPH_HIERARCHY_VERTEX_BASE_2_H #define CGAL_APOLLONIUS_GRAPH_HIERARCHY_VERTEX_BASE_2_H diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_traits_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_traits_2.h index 53876508623..664f4a2f18b 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_traits_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_traits_2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas #ifndef CGAL_APOLLONIUS_GRAPH_TRAITS_2_H #define CGAL_APOLLONIUS_GRAPH_TRAITS_2_H diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_vertex_base_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_vertex_base_2.h index 683d6c2091a..56e17c900ce 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_vertex_base_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_vertex_base_2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas #ifndef CGAL_APOLLONIUS_GRAPH_VERTEX_BASE_2_H #define CGAL_APOLLONIUS_GRAPH_VERTEX_BASE_2_H diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_site_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_site_2.h index 0042607dcc4..fbae0de359a 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_site_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_site_2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas #ifndef CGAL_APOLLONIUS_SITE_2_H #define CGAL_APOLLONIUS_SITE_2_H diff --git a/Apollonius_graph_2/include/CGAL/Hyperbola_2.h b/Apollonius_graph_2/include/CGAL/Hyperbola_2.h index 3fa69cb8b0f..7749e5f75b0 100644 --- a/Apollonius_graph_2/include/CGAL/Hyperbola_2.h +++ b/Apollonius_graph_2/include/CGAL/Hyperbola_2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Hyperbola_ray_2.h b/Apollonius_graph_2/include/CGAL/Hyperbola_ray_2.h index 2b72ea40e47..b6ddb559483 100644 --- a/Apollonius_graph_2/include/CGAL/Hyperbola_ray_2.h +++ b/Apollonius_graph_2/include/CGAL/Hyperbola_ray_2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Hyperbola_segment_2.h b/Apollonius_graph_2/include/CGAL/Hyperbola_segment_2.h index 79cf1dc8a4f..410f0b39f6e 100644 --- a/Apollonius_graph_2/include/CGAL/Hyperbola_segment_2.h +++ b/Apollonius_graph_2/include/CGAL/Hyperbola_segment_2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/IO/Qt_widget_Apollonius_site_2.h b/Apollonius_graph_2/include/CGAL/IO/Qt_widget_Apollonius_site_2.h index c3640af1e20..b460963d34a 100644 --- a/Apollonius_graph_2/include/CGAL/IO/Qt_widget_Apollonius_site_2.h +++ b/Apollonius_graph_2/include/CGAL/IO/Qt_widget_Apollonius_site_2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas #ifndef CGAL_QT_WIDGET_APOLLONIUS_SITE_2_H diff --git a/Apollonius_graph_2/include/CGAL/IO/Qt_widget_Hyperbola_2.h b/Apollonius_graph_2/include/CGAL/IO/Qt_widget_Hyperbola_2.h index d842c96050d..fba6df4eee6 100644 --- a/Apollonius_graph_2/include/CGAL/IO/Qt_widget_Hyperbola_2.h +++ b/Apollonius_graph_2/include/CGAL/IO/Qt_widget_Hyperbola_2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas #ifndef CGAL_QT_WIDGET_HYPERBOLA_2_H #define CGAL_QT_WIDGET_HYPERBOLA_2_H diff --git a/Apollonius_graph_2/include/CGAL/Parabola_2.h b/Apollonius_graph_2/include/CGAL/Parabola_2.h index c89cf16a410..6e06222fc27 100644 --- a/Apollonius_graph_2/include/CGAL/Parabola_2.h +++ b/Apollonius_graph_2/include/CGAL/Parabola_2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/Parabola_segment_2.h b/Apollonius_graph_2/include/CGAL/Parabola_segment_2.h index 38f4a10320f..9ee8a94e1f2 100644 --- a/Apollonius_graph_2/include/CGAL/Parabola_segment_2.h +++ b/Apollonius_graph_2/include/CGAL/Parabola_segment_2.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/functions_on_signs.h b/Apollonius_graph_2/include/CGAL/functions_on_signs.h index 34214bccafb..517a6a11cc4 100644 --- a/Apollonius_graph_2/include/CGAL/functions_on_signs.h +++ b/Apollonius_graph_2/include/CGAL/functions_on_signs.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/in_place_edge_list.h b/Apollonius_graph_2/include/CGAL/in_place_edge_list.h index 38af54a0d03..1ac3a6095f3 100644 --- a/Apollonius_graph_2/include/CGAL/in_place_edge_list.h +++ b/Apollonius_graph_2/include/CGAL/in_place_edge_list.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Apollonius_graph_2/include/CGAL/more_functions_on_signs.h b/Apollonius_graph_2/include/CGAL/more_functions_on_signs.h index 97eb4fd9cdb..ab14c193590 100644 --- a/Apollonius_graph_2/include/CGAL/more_functions_on_signs.h +++ b/Apollonius_graph_2/include/CGAL/more_functions_on_signs.h @@ -15,7 +15,7 @@ // $Id$ // // -// Author(s) : Menelaos Karavelas +// Author(s) : Menelaos Karavelas diff --git a/Arithmetic_kernel/include/CGAL/GMP_arithmetic_kernel.h b/Arithmetic_kernel/include/CGAL/GMP_arithmetic_kernel.h index d6fa5452edf..bc0f55af663 100644 --- a/Arithmetic_kernel/include/CGAL/GMP_arithmetic_kernel.h +++ b/Arithmetic_kernel/include/CGAL/GMP_arithmetic_kernel.h @@ -29,20 +29,22 @@ #ifndef CGAL_GMP_ARITHMETIC_KERNEL_H #define CGAL_GMP_ARITHMETIC_KERNEL_H +#ifdef CGAL_USE_GMP + #include #include #include -#ifdef CGAL_USE_GMP -#ifdef CGAL_USE_MPFI - -#define CGAL_HAS_GMP_ARITHMETIC_KERNEL #include #include + +#ifdef CGAL_USE_MPFI +#define CGAL_HAS_GMP_ARITHMETIC_KERNEL #include #include +#endif //CGAL_USE_MPFI namespace CGAL { @@ -53,8 +55,10 @@ class GMP_arithmetic_kernel : public internal::Arithmetic_kernel_base { public: typedef CGAL::Gmpz Integer; typedef CGAL::Gmpq Rational; + #ifdef CGAL_USE_MPFI typedef CGAL::Gmpfr Bigfloat; typedef CGAL::Gmpfi Bigfloat_interval; + #endif //CGAL_USE_MPFI }; template <> @@ -65,6 +69,8 @@ template <> struct Get_arithmetic_kernel{ typedef GMP_arithmetic_kernel Arithmetic_kernel; }; + +#ifdef CGAL_USE_MPFI template <> struct Get_arithmetic_kernel{ typedef GMP_arithmetic_kernel Arithmetic_kernel; @@ -73,10 +79,11 @@ template <> struct Get_arithmetic_kernel{ typedef GMP_arithmetic_kernel Arithmetic_kernel; }; +#endif //CGAL_USE_MPFI } //namespace CGAL -#endif //CGAL_USE_MPFI -#endif //CGAL_USE_GMP +#endif //CGAL_USE_GMP + #endif // CGAL_ARITHMETIC_KERNEL_H // EOF diff --git a/Arithmetic_kernel/include/CGAL/Get_arithmetic_kernel.h b/Arithmetic_kernel/include/CGAL/Get_arithmetic_kernel.h index 699339aa237..275a1c70d9a 100644 --- a/Arithmetic_kernel/include/CGAL/Get_arithmetic_kernel.h +++ b/Arithmetic_kernel/include/CGAL/Get_arithmetic_kernel.h @@ -28,7 +28,7 @@ #include namespace CGAL { -template< class NT > struct Get_arithmetic_kernel; +template< class NT > struct Get_arithmetic_kernel{}; } //namespace CGAL #endif // CGAL_GET_ARITHMETIC_KERNEL_H diff --git a/Arithmetic_kernel/include/CGAL/MP_Float_arithmetic_kernel.h b/Arithmetic_kernel/include/CGAL/MP_Float_arithmetic_kernel.h new file mode 100644 index 00000000000..b8746582e54 --- /dev/null +++ b/Arithmetic_kernel/include/CGAL/MP_Float_arithmetic_kernel.h @@ -0,0 +1,61 @@ +// Copyright (c) 2010 GeometryFactory (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; version 2.1 of the License. +// See the file LICENSE.LGPL distributed with CGAL. +// +// 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) : Sebastien Loriot +// +// ============================================================================ +// +// \brief provide class Arithmetic_kernel, a collection of number types. +// + +/*! \file CGAL/Arithmetic_kernel.h + * \brief Declarations pertaining to CGAL::Arithmetic_kernel + */ + +#ifndef CGAL_MP_FLOAT_ARITHMETIC_KERNEL_H +#define CGAL_MP_FLOAT_ARITHMETIC_KERNEL_H + +#include +#include +#include + +#define CGAL_HAS_MP_FLOAT_ARITHMETIC_KERNEL + +#include + +namespace CGAL { + +/*! \ingroup CGAL_Arithmetic_kernel + * \brief The MP_Float set of exact number types + */ +class MP_Float_arithmetic_kernel : public internal::Arithmetic_kernel_base { +public: + typedef MP_Float Integer; + typedef CGAL::Quotient Rational; + typedef MP_Float Bigfloat; + struct Not_implemented{} Bigfloat_interval; +}; + +template <> +struct Get_arithmetic_kernel { + typedef MP_Float_arithmetic_kernel Arithmetic_kernel; +}; + +} //namespace CGAL + +#endif // CGAL_ARITHMETIC_KERNEL_H +// EOF diff --git a/Arithmetic_kernel/include/CGAL/OLD/GMP/Gmpfr_interval_type.h b/Arithmetic_kernel/include/CGAL/OLD/GMP/Gmpfr_interval_type.h deleted file mode 100644 index 83260480752..00000000000 --- a/Arithmetic_kernel/include/CGAL/OLD/GMP/Gmpfr_interval_type.h +++ /dev/null @@ -1,166 +0,0 @@ -// TODO: add sign to RET - - -#ifndef CGAL_GMPFR_INTERVAL_TYPE_H -#define CGAL_GMPFR_INTERVAL_TYPE_H - -#include -#include -#include - -#define OP(o,d) Gmpfr r; \ - mpfr_ ## o (r.fr(), a.fr(), b.fr(), GMP_RND ## d); \ - return r; - -namespace CGAL { - -namespace internal { - -struct Rounding_for_gmpfr { -private: typedef CGAL::Gmpfr T; -public: - Rounding_for_gmpfr(){}; - ~Rounding_for_gmpfr(){}; - - T conv_down(const T& a){ // TODO: fix this - return add_down(T(0),a); - }; - T conv_up (const T& a){ // TODO: fix this - return add_up(T(0),a); - }; - // mathematical operations - T add_down(const T& a, const T& b) { - OP(add,D); - }; - T add_up (const T& a, const T& b){ - OP(add,U); - }; - T sub_down(const T& a, const T& b){ - OP(sub,D); - }; - T sub_up (const T& a, const T& b){ - OP(sub,U); - }; - T mul_down(const T& a, const T& b){ - OP(mul,D); - }; - T mul_up (const T& a, const T& b){ - OP(mul,U); - }; - T div_down(const T& a, const T& b){ - OP(div,D); - }; - T div_up (const T& a, const T& b){ - OP(div,U); - }; - - T sqrt_down(const T& a){ - T b; - mpfr_sqrt(b.fr(), a.fr(), GMP_RNDD); - return b; - }; - T sqrt_up (const T& a){ - T b; - mpfr_sqrt(b.fr(), a.fr(), GMP_RNDU); - return b; - }; - - T median(const T& a, const T& b) { - T result(a + (b-a)/2); - CGAL_postcondition(a <= result); - CGAL_postcondition(result <= b); - return result; - }; - T int_down(const T& a) { - T r; - mpfr_floor(r.fr(), a.fr()); - return r; - }; - T int_up (const T& a) { - T r; - mpfr_ceil(r.fr(), a.fr()); - return r; - }; -}; - -class Checking_for_gmpfr { - - typedef CGAL::Gmpfr T; - -public: - - static T pos_inf() { - T b; - mpfr_set_inf(b.fr(), 1); - return b; - } - - static T neg_inf() { - T b; - mpfr_set_inf(b.fr(), -1); - return b; - } - - static T nan() { - T b; - mpfr_set_nan(b.fr()); - return b; - } - - static bool is_nan(const T& b) { - return mpfr_nan_p(b.fr()); - } - - static T empty_lower() { - return T(1); - } - - static T empty_upper() { - return T(0); - } - - static bool is_empty(const T& a, const T& b) { -// return a==T(1) && b == T(0); -// return false; - return a > b; // TODO: optimize this - } -}; - -} // namespace internal -} //namespace CGAL - -namespace boost { -namespace numeric { -inline -std::ostream& operator << - (std::ostream& os, const boost::numeric::interval& x) -{ - os << "[" - << x.lower() << ", " << x.upper() << "]"; - return os; -} - - -}//namespace numeric -}//namespace boost - -namespace CGAL { - -typedef boost::numeric::interval< - Gmpfr, - boost::numeric::interval_lib::policies - < internal::Rounding_for_gmpfr, internal::Checking_for_gmpfr > > -Gmpfr_interval; - -// I have to redfine these operators, since the test reports an -// ambiguity with operators in CGAL::Polynomial -// However, it seems that this is due to the use of struct interval_holder -// in the definition of the operators in boost. - -inline bool operator == (const Gmpfr_interval& x , const Gmpfr_interval& y) -{return x.operator==(y) ;} - -} //namespace CGAL -//#endif // CGAL_USE_LEDA -#undef OP -#endif // CGAL_GMPFR_INTERVAL_TYPE_H diff --git a/Arithmetic_kernel/include/CGAL/OLD/Gmpfr_interval.h b/Arithmetic_kernel/include/CGAL/OLD/Gmpfr_interval.h deleted file mode 100644 index 403e94ac5a7..00000000000 --- a/Arithmetic_kernel/include/CGAL/OLD/Gmpfr_interval.h +++ /dev/null @@ -1,336 +0,0 @@ -// Copyright (c) 2008 Max-Planck-Institute Saarbruecken (Germany), -// National University of Athens (Greece). -// Copyright (c) 2009 Max-Planck-Institute Saarbruecken (Germany). -// 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; version 2.1 of the License. -// See the file LICENSE.LGPL distributed with CGAL. -// -// 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) : George Tzoumas , -// Michael Hemmer -// -// ============================================================================ -// -// \brief provide CGAL support for class CGAL::Gmpfr_interval. -// - -#ifndef CGAL_GMPFR_INTERVAL_H -#define CGAL_GMPFR_INTERVAL_H - -#include -#include -#include -#include -#include -#include -#include - -namespace CGAL { - -template <> class Algebraic_structure_traits< Gmpfr_interval > - : public Algebraic_structure_traits_base < Gmpfr_interval, - Field_with_sqrt_tag >{ - -public: - typedef Tag_false Is_exact; - typedef Tag_true Is_numerical_sensitive; - - class Sqrt - : public std::unary_function< Type, Type > { - public: - Type operator()( const Type& x ) const { - return ::boost::numeric::sqrt(x); - } - }; -}; - -template <> class Real_embeddable_traits< Gmpfr_interval > - : public INTERN_RET::Real_embeddable_traits_base { -public: - - class Abs - : public std::unary_function< Type, Type > { - public: - Type operator()( const Type& x ) const { - return ::boost::numeric::abs(x); - } - }; - - class To_double - : public std::unary_function< Type, double > { - public: - double operator()( const Type& x ) const { - return ::boost::numeric::median(x).to_double(); - } - }; - - class To_interval - : public std::unary_function< Type, std::pair< double, double > > { - public: - std::pair operator()( const Type& x ) const { - std::pair lower_I(x.lower().to_interval()); - std::pair upper_I(x.upper().to_interval()); - return std::pair< double, double >( - (CGAL::min)(lower_I.first , upper_I.first ), - (CGAL::max)(lower_I.second, upper_I.second)); - } - }; -}; - -template<> -class Interval_traits -{ -public: - typedef Interval_traits Self; - typedef Gmpfr_interval Interval; - typedef CGAL::Gmpfr Bound; - typedef CGAL::Tag_true With_empty_interval; - typedef CGAL::Tag_true Is_interval; - - struct Construct :public std::binary_function{ - Interval operator()( const Bound& l,const Bound& r) const { - CGAL_precondition( l < r ); - return Interval(l,r); - } - }; - - struct Lower :public std::unary_function{ - Bound operator()( const Interval& a ) const { - return a.lower(); - } - }; - - struct Upper :public std::unary_function{ - Bound operator()( const Interval& a ) const { - return a.upper(); - } - }; - - struct Width :public std::unary_function{ - Bound operator()( const Interval& a ) const { - return ::boost::numeric::width(a); - } - }; - - struct Median :public std::unary_function{ - Bound operator()( const Interval& a ) const { - return ::boost::numeric::median(a); - } - }; - - struct Norm :public std::unary_function{ - Bound operator()( const Interval& a ) const { - return ::boost::numeric::norm(a); - } - }; - - struct Empty :public std::unary_function{ - bool operator()( const Interval& a ) const { - return ::boost::numeric::empty(a); - } - }; - - struct Singleton :public std::unary_function{ - bool operator()( const Interval& a ) const { - return ::boost::numeric::singleton(a); - } - }; - - struct Zero_in :public std::unary_function{ - bool operator()( const Interval& a ) const { - return ::boost::numeric::in_zero(a); - } - }; - - struct In :public std::binary_function{ - bool operator()( Bound x, const Interval& a ) const { - return ::boost::numeric::in(x,a); - } - }; - - struct Equal :public std::binary_function{ - bool operator()( const Interval& a, const Interval& b ) const { - return ::boost::numeric::equal(a,b); - } - }; - - struct Overlap :public std::binary_function{ - bool operator()( const Interval& a, const Interval& b ) const { - return ::boost::numeric::overlap(a,b); - } - }; - - struct Subset :public std::binary_function{ - bool operator()( const Interval& a, const Interval& b ) const { - return ::boost::numeric::subset(a,b); - } - }; - - struct Proper_subset :public std::binary_function{ - bool operator()( const Interval& a, const Interval& b ) const { - return ::boost::numeric::proper_subset(a,b); - } - }; - - struct Hull :public std::binary_function{ - Interval operator()( const Interval& a, const Interval& b ) const { - return ::boost::numeric::hull(a,b); - } - }; - - struct Intersection :public std::binary_function{ - Interval operator()( const Interval& a, const Interval& b ) const { - Interval r = ::boost::numeric::intersect(a,b); - return r; - } - }; -}; - -template<> -class Bigfloat_interval_traits: - public Interval_traits -{ -public: - typedef Gmpfr_interval NT; - - typedef CGAL::Gmpfr BF; - - struct Get_significant_bits: public std::unary_function{ - - long operator()( NT x) const { - if(CGAL::zero_in(x)) return -1; - BF labs = CGAL::lower(CGAL::abs(x)) ; - BF w = CGAL::width(x); - BF err; - mpfr_div(err.fr(), w.fr(), labs.fr(), GMP_RNDU); - mpfr_log2(err.fr(), err.fr(), GMP_RNDD); - return -mpfr_get_si(err.fr(), GMP_RNDU); - } - }; - - struct Set_precision { - // type for the \c AdaptableUnaryFunction concept. - typedef long argument_type; - // type for the \c AdaptableUnaryFunction concept. - typedef long result_type; - - long operator()( long prec ) const { - long old_prec = mpfr_get_default_prec(); -// std::cerr << "precision set to " << prec << " from " << old_prec << std::endl; - mpfr_set_default_prec(prec); - return old_prec; - } - }; - - struct Get_precision { - // type for the \c AdaptableGenerator concept. - typedef long result_type; - long operator()() const { - return mpfr_get_default_prec(); - } - }; - -}; - -//Gmp internal coercions: -CGAL_DEFINE_COERCION_TRAITS_FOR_SELF(Gmpfr_interval) - -// The following definitions reflect the interaction of the Gmpfr - -// built in types : - CGAL_DEFINE_COERCION_TRAITS_FROM_TO(short ,Gmpfr_interval) - CGAL_DEFINE_COERCION_TRAITS_FROM_TO(int ,Gmpfr_interval) - CGAL_DEFINE_COERCION_TRAITS_FROM_TO(long ,Gmpfr_interval) - CGAL_DEFINE_COERCION_TRAITS_FROM_TO(float ,Gmpfr_interval) - CGAL_DEFINE_COERCION_TRAITS_FROM_TO(double ,Gmpfr_interval) - - -template <> -struct Coercion_traits{ - typedef Tag_true Are_explicit_interoperable; - typedef Tag_false Are_implicit_interoperable; - typedef CGAL::Gmpfr_interval Type; - - struct Cast{ - typedef Type result_type; - Type operator()(const CGAL::Gmpfr_interval& x) const { return x;} - Type operator()(const CGAL::Gmpz x) const { - CGAL::Gmpfr lower, upper; - mpfr_set_z (lower.fr(), x.mpz(), GMP_RNDD); - mpfr_set_z (upper.fr(), x.mpz(), GMP_RNDU); - Type bfi(lower, upper); - CGAL_postcondition( bfi.lower() <= x ); - CGAL_postcondition( bfi.upper() >= x ); - return bfi; - } - }; -}; - -template <> // mirror -struct Coercion_traits - :public Coercion_traits{}; - -template <> -struct Coercion_traits{ - typedef Tag_true Are_explicit_interoperable; - typedef Tag_false Are_implicit_interoperable; - typedef CGAL::Gmpfr_interval Type; - typedef Coercion_traits CTZ; - - struct Cast{ - typedef Type result_type; - Type operator()(const CGAL::Gmpfr_interval& x) const { return x;} - Type operator()(const CGAL::Gmpq x) const { - // early exits - if (CGAL::is_zero(x)) return Type(0,0); - if (CGAL::is_one(x.denominator())){ - return CTZ::Cast()(x.numerator()); - } - // TODO: ensure that prec is reached for resulting interval ? - Gmpfr lower, upper, nf, df; - CGAL::Gmpz num = x.numerator(); - CGAL::Gmpz den = x.denominator(); - mp_prec_t prec = mpfr_get_default_prec(); - CGAL_assertion( mpfr_get_prec(lower.fr()) == prec); - CGAL_assertion( mpfr_get_prec(upper.fr()) == prec ); - - mpfr_set_z (nf.fr(), num.mpz(), GMP_RNDD); - mpfr_set_z (df.fr(), den.mpz(), - (CGAL::sign(num) == CGAL::NEGATIVE)? GMP_RNDD: GMP_RNDU); - mpfr_div(lower.fr(), nf.fr(), df.fr(), GMP_RNDD); - - mpfr_set_z (nf.fr(), num.mpz(), GMP_RNDU); - mpfr_set_z (df.fr(), den.mpz(), - (CGAL::sign(num) == CGAL::NEGATIVE)? GMP_RNDU: GMP_RNDD); - mpfr_div(upper.fr(), nf.fr(), df.fr(), GMP_RNDU); - - Type bfi(lower, upper); - - CGAL_postcondition( bfi.lower() <= x ); - CGAL_postcondition( bfi.upper() >= x ); - return bfi; - } - }; -}; - -template <> // mirror -struct Coercion_traits - :public Coercion_traits{}; - - -// lower GMP types: -CGAL_DEFINE_COERCION_TRAITS_FROM_TO(Gmpfr,Gmpfr_interval) - -} //namespace CGAL -#endif // CGAL_GMPFR_INTERVAL_H diff --git a/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/Arr_circle_segment_traits.tex b/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/Arr_circle_segment_traits.tex index 95697e33b4d..5039dc482c0 100644 --- a/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/Arr_circle_segment_traits.tex +++ b/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/Arr_circle_segment_traits.tex @@ -29,81 +29,20 @@ and segments to have rational coordinates. The nested \ccc{Point_2} type defined by the traits class is therefore {\em different} than the \ccc{Kernel::Point_2} type. Its coordinates are -of type \ccc{CoordNT}, and represent real numbers obtained from solving -quadratic equations with rational coordinates. A number of type -\ccc{CoordNT} can therefore be expressed as $\alpha + \beta\sqrt{\gamma}$, -where $\alpha$, $\beta$ and $\gamma$ are all rational numbers. -The definition of the curve and $x$-monotone curve types nested in the -traits class are detailed below. +of type \ccc{CoordNT}, which an instantiation of +\ccc{CGAL::Sqrt_extension} where \ccc{NT = ROOT = Kernel::FT}. +Moreover, the third and fourth (hidden) template parameters of +\ccc{CGAL::Sqrt_extension} are set to \ccc{CGAL::Tag_true}, which +enables efficient comparison among different extensions. + +For more details see the documentation of \ccRefIdfierPage{CGAL::Sqrt_extension}\\ + \ccInclude{CGAL/Arr_circle_segment_traits_2.h} \ccIsModel \ccc{ArrangementTraits_2} -\subsection*{Class -Arr\_circle\_segment\_traits\_2$<$Kernel$>$::CoordNT} -%============================================================================== - -The \ccc{CoordNT} number-type nested within the traits class represents -an algebraic number of degree 2; it can be represented as -$\alpha + \beta\sqrt{\gamma}$, where $\alpha$, $\beta$ and $\gamma$ are -all rational numbers of type \ccc{Kernel::FT}. - -\begin{ccClass}{Arr_circle_segment_traits_2::CoordNT} - -\ccTypes -%------- - -\ccNestedType{Rational}{the \ccc{Kernel::FT} type.} - -\ccCreation -\ccCreationVariable{x} -%--------------------- - -\ccConstructor{CoordNT ();} - {creates a variable whose value is $0$.} - -\ccConstructor{CoordNT (const Rational& alpha);} - {creates a variable whose value is the rational number $\alpha$.} - -\ccConstructor{CoordNT (const Rational& alpha, - const Rational& beta, - const Rational& gamma);} - {creates a variable whose value is the algebraic number - $\alpha + \beta\sqrt{\gamma}$.} - -\ccAccessFunctions -%----------------- - -\ccMethod{bool is_rational () const;} - {determines whether \ccVar\ is rational.} - -\ccMethod{Rational alpha () const;} - {returns $\alpha$.} -\ccGlue -\ccMethod{Rational beta () const;} - {returns $\beta$ (0 if \ccVar\ is rational).} -\ccGlue -\ccMethod{Rational gamma () const;} - {returns $\gamma$ (0 if \ccVar\ is rational).} - -\ccHeading{Operators} -%-------------------- - -The \ccc{CoordNT} number-type supports all arithmetic operations with -rational numbers of type \ccc{Kernel::FT}. For example, it is possible to -compute \ccc{x + q}, \ccc{q - x}, \ccc{x += q}, etc. where \ccc{q} is rational. - -The global functions \ccc{CGAL::sign(x)}, \ccc{CGAL::square(x)}, -\ccc{CGAL::to_double(x)} and \ccc{CGAL::compare(x,y)}, where \ccc{x} and -\ccc{y} are of type \ccc{CoordNT}, are also supported. - -It is also possible to call \ccc{CGAL::to_double(x)} to convert \ccc{x} to -a rational number, with the precondition that it is indeed rational. - -\end{ccClass} - \subsection*{Class Arr\_circle\_segment\_traits\_2$<$Kernel$>$::Point\_2} %============================================================================== diff --git a/Arrangement_on_surface_2/dont_submit b/Arrangement_on_surface_2/dont_submit index ec50ad06712..0f4735f3625 100644 --- a/Arrangement_on_surface_2/dont_submit +++ b/Arrangement_on_surface_2/dont_submit @@ -4,3 +4,4 @@ include/CGAL/Arr_great_circular_arc_on_cylinder_traits_2.h include/CGAL/Arr_polycurve_traits_2.h include/CGAL/Arr_geometry_traits/Polycurve_2.h demo/Arr_algebraic_segment_traits_2 +include/CGAL/Arr_geometry_traits/One_root_number.h diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/circular_arcs.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/circular_arcs.cpp index a14bead73a0..05de4715004 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/circular_arcs.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/circular_arcs.cpp @@ -63,7 +63,7 @@ int main () // (-1/2, sqrt(3)/2) to (1/2, sqrt(3)/2). Note that we orient the // supporting circle accordingly. Kernel::Point_2 c6 = Kernel::Point_2 (0, 0); - CoordNT sqrt_3_div_2 = CoordNT (0, Number_type(1,2), 3); + CoordNT sqrt_3_div_2 = CoordNT (Number_type(0), Number_type(1,2), Number_type(3)); Point_2 s6 = Point_2 (Number_type (-1, 2), sqrt_3_div_2); Point_2 t6 = Point_2 (Number_type (1, 2), sqrt_3_div_2); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Circle_segment_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Circle_segment_2.h index 1aa563e8d45..70f84fa62f4 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Circle_segment_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Circle_segment_2.h @@ -24,7 +24,7 @@ /*! \file * Header file for the _Circle_segment_2 class. */ -#include +#include #include #include #include @@ -46,9 +46,9 @@ class _One_root_point_2_rep //: public Ref_counted public: - typedef NumberType_ NT; - typedef _One_root_point_2_rep Self; - typedef _One_root_number CoordNT; + typedef NumberType_ NT; + typedef _One_root_point_2_rep Self; + typedef Sqrt_extension > CoordNT; private: @@ -63,13 +63,9 @@ public: _y (0) {} - /*! Constructor of a point with rational coefficients. */ - _One_root_point_2_rep (const NT& x, const NT& y) : - _x (x), - _y (y) - {} - - /*! Constructor of a point with one-root coefficients. */ + /*! Constructor of a point with one-root coefficients. + This constructor of a point can also be used with rational coefficients + thanks to convertor of CoordNT. */ _One_root_point_2_rep (const CoordNT& x, const CoordNT& y) : _x (x), _y (y) @@ -107,12 +103,9 @@ public: Point_handle (p) {} - /*! Constructor of a point with rational coefficients. */ - _One_root_point_2 (const NT& x, const NT& y) : - Point_handle (Point_rep (x, y)) - {} - - /*! Constructor of a point with one-root coefficients. */ + /*! Constructor of a point with one-root coefficients. + This constructor of a point can also be used with rational coefficients + thanks to convertor of CoordNT. */ _One_root_point_2 (const CoordNT& x, const CoordNT& y) : Point_handle (Point_rep (x, y)) {} @@ -556,8 +549,8 @@ public: else { // In case only the squared root is given: - xv_left = CoordNT (x0, -1, _circ.squared_radius()); - xv_right = CoordNT (x0, 1, _circ.squared_radius()); + xv_left = CoordNT (x0, NT(-1), _circ.squared_radius()); + xv_right = CoordNT (x0, NT(1), _circ.squared_radius()); } vpts[0] = Point_2 (xv_left, y0); @@ -634,7 +627,7 @@ private: if (_has_radius) vpts[n_vpts] = Point_2 (CoordNT (x0 - _radius), y0); else - vpts[n_vpts] = Point_2 (CoordNT (x0, -1, _circ.squared_radius()), + vpts[n_vpts] = Point_2 (CoordNT (x0, NT(-1), _circ.squared_radius()), y0); n_vpts++; @@ -649,7 +642,7 @@ private: if (_has_radius) vpts[n_vpts] = Point_2 (CoordNT (x0 + _radius), y0); else - vpts[n_vpts] = Point_2 (CoordNT (x0, 1, _circ.squared_radius()), + vpts[n_vpts] = Point_2 (CoordNT (x0, NT(1), _circ.squared_radius()), y0); n_vpts++; } @@ -2071,11 +2064,11 @@ protected: mult = 1; p = Point_2 (CoordNT (vx), - CoordNT (y0(), -1, vdisc)); + CoordNT (y0(), NT(-1), vdisc)); inter_list.push_back (Intersection_point_2 (p, mult)); p = Point_2 (CoordNT (vx), - CoordNT (y0(), 1, vdisc)); + CoordNT (y0(), NT(1), vdisc)); inter_list.push_back (Intersection_point_2 (p, mult)); return; @@ -2108,11 +2101,11 @@ protected: // Compute the two intersection points: mult = 1; - p = Point_2 (CoordNT (x0(), -1, hdisc), + p = Point_2 (CoordNT (x0(), NT(-1), hdisc), CoordNT (hy)); inter_list.push_back (Intersection_point_2 (p, mult)); - p = Point_2 (CoordNT (x0(), 1, hdisc), + p = Point_2 (CoordNT (x0(), NT(1), hdisc), CoordNT (hy)); inter_list.push_back (Intersection_point_2 (p, mult)); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Hyperbolic_arc_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Hyperbolic_arc_2.h index 9c9afa1a8cd..4608b74e206 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Hyperbolic_arc_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Hyperbolic_arc_2.h @@ -23,7 +23,6 @@ /*! \file * Header file for the _Hyperbolic_arc_2 class. */ -#include #include #include #include diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h index 01edf0a0c3e..2503d229e9b 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h @@ -153,9 +153,9 @@ struct Curve_renderer_traits_base struct Rat_to_float { typedef Float result_type; - template - Float operator()(const Sqrt_extension& x) const { - typename CGAL::Coercion_traits, Float>::Cast + template + Float operator()(const Sqrt_extension& x) const { + typename CGAL::Coercion_traits, Float>::Cast cast; return cast(x); } @@ -502,9 +502,9 @@ struct Curve_renderer_traits struct Rat_to_float { typedef Float result_type; - template - Float operator()(const Sqrt_extension& x) const { - typename CGAL::Coercion_traits, Float>::Cast + template + Float operator()(const Sqrt_extension& x) const { + typename CGAL::Coercion_traits, Float>::Cast cast; return cast(x); } diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_arcs/constructor.xcv b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_arcs/constructor.xcv index 034da1d0e4b..8f60e3d0012 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_arcs/constructor.xcv +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_arcs/constructor.xcv @@ -1,8 +1,8 @@ # x^2+y^2=1 -c 0 0 1 1 1 1 1 0 1 0 1 1 -c 0 0 1 1 1 0 1 1 1 -1 1 0 -c 0 0 1 1 1 -1 1 0 1 0 1 -1 -c 0 0 1 1 1 0 1 -1 1 1 1 0 +c 0 0 1 1 EXT[1,0,0] EXT[0,0,0] EXT[0,0,0] EXT[1,0,0] +c 0 0 1 1 EXT[0,0,0] EXT[1,0,0] EXT[-1,0,0] EXT[0,0,0] +c 0 0 1 1 EXT[-1,0,0] EXT[0,0,0] EXT[0,0,0] EXT[-1,0,0] +c 0 0 1 1 EXT[0,0,0] EXT[-1,0,0] EXT[1,0,0] EXT[0,0,0] b 0 0 1 1 1/2 0 1/4 1 0 0 1/2 1/4 1 0 b 0 0 1 1 0 1/2 1/4 1 0 -1/2 0 1/4 1 0 b 0 0 1 1 -1/2 0 1/4 1 0 0 -1/2 1/4 1 0 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_arcs/intersect.xcv b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_arcs/intersect.xcv index 6e2cd334993..5f40385ed8e 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_arcs/intersect.xcv +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_arcs/intersect.xcv @@ -1,15 +1,15 @@ # x^2+y^2=1 -c 0 0 1 1 1 1 1 0 1 -1 1 0 -c 0 0 1 1 1 -1 1 0 1 1 1 0 +c 0 0 1 1 EXT[1,0,0] EXT[0,0,0] EXT[-1,0,0] EXT[0,0,0] +c 0 0 1 1 EXT[-1,0,0] EXT[0,0,0] EXT[1,0,0] EXT[0,0,0] # (x-1/2)^2+y^2=1/4 -c 1/2 0 1/4 1 1 1 1 0 1 0 1 0 -c 1/2 0 1/4 1 1 0 1 0 1 1 1 0 +c 1/2 0 1/4 1 EXT[1,0,0] EXT[0,0,0] EXT[0,0,0] EXT[0,0,0] +c 1/2 0 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[1,0,0] EXT[0,0,0] # (x+1/2)^2+y^2=1/4 -c -1/2 0 1/4 1 1 -1 1 0 1 0 1 0 -c -1/2 0 1/4 1 1 0 1 0 1 -1 1 0 +c -1/2 0 1/4 1 EXT[-1,0,0] EXT[0,0,0] EXT[0,0,0] EXT[0,0,0] +c -1/2 0 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[-1,0,0] EXT[0,0,0] # (y-1/2)^2+x^2=1/4 -c 0 1/2 1/4 1 1 1/2 1 1/2 1 -1/2 1 1/2 -c 0 1/2 1/4 1 1 -1/2 1 1/2 1 1/2 1 1/2 +c 0 1/2 1/4 1 EXT[1/2,0,0] EXT[1/2,0,0] EXT[-1/2,0,0] EXT[1/2,0,0] +c 0 1/2 1/4 1 EXT[-1/2,0,0] EXT[1/2,0,0] EXT[1/2,0,0] EXT[1/2,0,0] # (y+1/2)^2+x^2=1/4 -c 0 -1/2 1/4 1 1 1/2 1 -1/2 1 -1/2 1 -1/2 -c 0 -1/2 1/4 1 1 -1/2 1 -1/2 1 1/2 1 -1/2 +c 0 -1/2 1/4 1 EXT[1/2,0,0] EXT[-1/2,0,0] EXT[-1/2,0,0] EXT[-1/2,0,0] +c 0 -1/2 1/4 1 EXT[-1/2,0,0] EXT[-1/2,0,0] EXT[1/2,0,0] EXT[-1/2,0,0] diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_arcs/make_x_monotone.cv b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_arcs/make_x_monotone.cv index 7b0a1327383..8f28fd5bdfc 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_arcs/make_x_monotone.cv +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_arcs/make_x_monotone.cv @@ -1,28 +1,28 @@ # x^2+y^2=1 -c 0 0 1 1 1 1 1 0 1 0 1 1 -c 0 0 1 1 1 0 1 1 1 -1 1 0 -c 0 0 1 1 1 -1 1 0 1 0 1 -1 -c 0 0 1 1 1 0 1 -1 1 1 1 0 +c 0 0 1 1 EXT[1,0,0] EXT[0,0,0] EXT[0,0,0] EXT[1,0,0] +c 0 0 1 1 EXT[0,0,0] EXT[1,0,0] EXT[-1,0,0] EXT[0,0,0] +c 0 0 1 1 EXT[-1,0,0] EXT[0,0,0] EXT[0,0,0] EXT[-1,0,0] +c 0 0 1 1 EXT[0,0,0] EXT[-1,0,0] EXT[1,0,0] EXT[0,0,0] # (x-1/2)^2+y^2=1/4 -c 1/2 0 1/4 1 1 1 1 0 1 1/2 1 1/2 -c 1/2 0 1/4 1 1 1/2 1 1/2 1 0 1 0 -c 1/2 0 1/4 1 1 0 1 0 1 1/2 1 -1/2 -c 1/2 0 1/4 1 1 1/2 1 -1/2 1 1 1 0 +c 1/2 0 1/4 1 EXT[1,0,0] EXT[0,0,0] EXT[1/2,0,0] EXT[1/2,0,0] +c 1/2 0 1/4 1 EXT[1/2,0,0] EXT[1/2,0,0] EXT[0,0,0] EXT[0,0,0] +c 1/2 0 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[1/2,0,0] EXT[-1/2,0,0] +c 1/2 0 1/4 1 EXT[1/2,0,0] EXT[-1/2,0,0] EXT[1,0,0] EXT[0,0,0] # (x+1/2)^2+y^2=1/4 -c -1/2 0 1/4 1 1 -1 1 0 1 -1/2 1 -1/2 -c -1/2 0 1/4 1 1 -1/2 1 -1/2 1 0 1 0 -c -1/2 0 1/4 1 1 0 1 0 1 -1/2 1 1/2 -c -1/2 0 1/4 1 1 -1/2 1 1/2 1 -1 1 0 +c -1/2 0 1/4 1 EXT[-1,0,0] EXT[0,0,0] EXT[-1/2,0,0] EXT[-1/2,0,0] +c -1/2 0 1/4 1 EXT[-1/2,0,0] EXT[-1/2,0,0] EXT[0,0,0] EXT[0,0,0] +c -1/2 0 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[-1/2,0,0] EXT[1/2,0,0] +c -1/2 0 1/4 1 EXT[-1/2,0,0] EXT[1/2,0,0] EXT[-1,0,0] EXT[0,0,0] # (y-1/2)^2+x^2=1/4 -c 0 1/2 1/4 1 1 0 1 1 1 -1/2 1 1/2 -c 0 1/2 1/4 1 1 -1/2 1 1/2 1 0 1 0 -c 0 1/2 1/4 1 1 0 1 0 1 1/2 1 1/2 -c 0 1/2 1/4 1 1 1/2 1 1/2 1 0 1 1 +c 0 1/2 1/4 1 EXT[0,0,0] EXT[1,0,0] EXT[-1/2,0,0] EXT[1/2,0,0] +c 0 1/2 1/4 1 EXT[-1/2,0,0] EXT[1/2,0,0] EXT[0,0,0] EXT[0,0,0] +c 0 1/2 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[1/2,0,0] EXT[1/2,0,0] +c 0 1/2 1/4 1 EXT[1/2,0,0] EXT[1/2,0,0] EXT[0,0,0] EXT[1,0,0] # (y+1/2)^2+x^2=1/4 -c 0 -1/2 1/4 1 1 0 1 -1 1 1/2 1 -1/2 -c 0 -1/2 1/4 1 1 1/2 1 -1/2 1 0 1 0 -c 0 -1/2 1/4 1 1 0 1 0 1 -1/2 1 -1/2 -c 0 -1/2 1/4 1 1 -1/2 1 -1/2 1 0 1 -1 +c 0 -1/2 1/4 1 EXT[0,0,0] EXT[-1,0,0] EXT[1/2,0,0] EXT[-1/2,0,0] +c 0 -1/2 1/4 1 EXT[1/2,0,0] EXT[-1/2,0,0] EXT[0,0,0] EXT[0,0,0] +c 0 -1/2 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[-1/2,0,0] EXT[-1/2,0,0] +c 0 -1/2 1/4 1 EXT[-1/2,0,0] EXT[-1/2,0,0] EXT[0,0,0] EXT[-1,0,0] # x^2+y^2=1 a 0 0 1 1 # (x-1/2)^2+y^2=1/4 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_arcs/make_x_monotone.xcv b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_arcs/make_x_monotone.xcv index a47e31b510b..4f0db884c85 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_arcs/make_x_monotone.xcv +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_arcs/make_x_monotone.xcv @@ -1,40 +1,40 @@ # x^2+y^2=1 -c 0 0 1 1 1 1 1 0 1 0 1 1 -c 0 0 1 1 1 0 1 1 1 -1 1 0 -c 0 0 1 1 1 -1 1 0 1 0 1 -1 -c 0 0 1 1 1 0 1 -1 1 1 1 0 +c 0 0 1 1 EXT[1,0,0] EXT[0,0,0] EXT[0,0,0] EXT[1,0,0] +c 0 0 1 1 EXT[0,0,0] EXT[1,0,0] EXT[-1,0,0] EXT[0,0,0] +c 0 0 1 1 EXT[-1,0,0] EXT[0,0,0] EXT[0,0,0] EXT[-1,0,0] +c 0 0 1 1 EXT[0,0,0] EXT[-1,0,0] EXT[1,0,0] EXT[0,0,0] # (x-1/2)^2+y^2=1/4 -c 1/2 0 1/4 1 1 1 1 0 1 1/2 1 1/2 -c 1/2 0 1/4 1 1 1/2 1 1/2 1 0 1 0 -c 1/2 0 1/4 1 1 0 1 0 1 1/2 1 -1/2 -c 1/2 0 1/4 1 1 1/2 1 -1/2 1 1 1 0 +c 1/2 0 1/4 1 EXT[1,0,0] EXT[0,0,0] EXT[1/2,0,0] EXT[1/2,0,0] +c 1/2 0 1/4 1 EXT[1/2,0,0] EXT[1/2,0,0] EXT[0,0,0] EXT[0,0,0] +c 1/2 0 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[1/2,0,0] EXT[-1/2,0,0] +c 1/2 0 1/4 1 EXT[1/2,0,0] EXT[-1/2,0,0] EXT[1,0,0] EXT[0,0,0] # (x+1/2)^2+y^2=1/4 -c -1/2 0 1/4 1 1 -1 1 0 1 -1/2 1 -1/2 -c -1/2 0 1/4 1 1 -1/2 1 -1/2 1 0 1 0 -c -1/2 0 1/4 1 1 0 1 0 1 -1/2 1 1/2 -c -1/2 0 1/4 1 1 -1/2 1 1/2 1 -1 1 0 +c -1/2 0 1/4 1 EXT[-1,0,0] EXT[0,0,0] EXT[-1/2,0,0] EXT[-1/2,0,0] +c -1/2 0 1/4 1 EXT[-1/2,0,0] EXT[-1/2,0,0] EXT[0,0,0] EXT[0,0,0] +c -1/2 0 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[-1/2,0,0] EXT[1/2,0,0] +c -1/2 0 1/4 1 EXT[-1/2,0,0] EXT[1/2,0,0] EXT[-1,0,0] EXT[0,0,0] # (y-1/2)^2+x^2=1/4 -c 0 1/2 1/4 1 1 0 1 1 1 -1/2 1 1/2 -c 0 1/2 1/4 1 1 -1/2 1 1/2 1 0 1 0 -c 0 1/2 1/4 1 1 0 1 0 1 1/2 1 1/2 -c 0 1/2 1/4 1 1 1/2 1 1/2 1 0 1 1 +c 0 1/2 1/4 1 EXT[0,0,0] EXT[1,0,0] EXT[-1/2,0,0] EXT[1/2,0,0] +c 0 1/2 1/4 1 EXT[-1/2,0,0] EXT[1/2,0,0] EXT[0,0,0] EXT[0,0,0] +c 0 1/2 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[1/2,0,0] EXT[1/2,0,0] +c 0 1/2 1/4 1 EXT[1/2,0,0] EXT[1/2,0,0] EXT[0,0,0] EXT[1,0,0] # (y+1/2)^2+x^2=1/4 -c 0 -1/2 1/4 1 1 0 1 -1 1 1/2 1 -1/2 -c 0 -1/2 1/4 1 1 1/2 1 -1/2 1 0 1 0 -c 0 -1/2 1/4 1 1 0 1 0 1 -1/2 1 -1/2 -c 0 -1/2 1/4 1 1 -1/2 1 -1/2 1 0 1 -1 +c 0 -1/2 1/4 1 EXT[0,0,0] EXT[-1,0,0] EXT[1/2,0,0] EXT[-1/2,0,0] +c 0 -1/2 1/4 1 EXT[1/2,0,0] EXT[-1/2,0,0] EXT[0,0,0] EXT[0,0,0] +c 0 -1/2 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[-1/2,0,0] EXT[-1/2,0,0] +c 0 -1/2 1/4 1 EXT[-1/2,0,0] EXT[-1/2,0,0] EXT[0,0,0] EXT[-1,0,0] # x^2+y^2=1 -c 0 0 1 1 1 -1 1 0 1 1 1 0 -c 0 0 1 1 1 1 1 0 1 -1 1 0 +c 0 0 1 1 EXT[-1,0,0] EXT[0,0,0] EXT[1,0,0] EXT[0,0,0] +c 0 0 1 1 EXT[1,0,0] EXT[0,0,0] EXT[-1,0,0] EXT[0,0,0] # (x-1/2)^2+y^2=1/4 -c 1/2 0 1/4 1 1 0 1 0 1 1 1 0 -c 1/2 0 1/4 1 1 1 1 0 1 0 1 0 +c 1/2 0 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[1,0,0] EXT[0,0,0] +c 1/2 0 1/4 1 EXT[1,0,0] EXT[0,0,0] EXT[0,0,0] EXT[0,0,0] # (x+1/2)^2+y^2=1/4 -c -1/2 0 1/4 1 1 -1 1 0 1 0 1 0 -c -1/2 0 1/4 1 1 0 1 0 1 -1 1 0 +c -1/2 0 1/4 1 EXT[-1,0,0] EXT[0,0,0] EXT[0,0,0] EXT[0,0,0] +c -1/2 0 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[-1,0,0] EXT[0,0,0] # (y-1/2)^2+x^2=1/4 -c 0 1/2 1/4 1 1 -1/2 1 1/2 1 1/2 1 1/2 -c 0 1/2 1/4 1 1 1/2 1 1/2 1 -1/2 1 1/2 +c 0 1/2 1/4 1 EXT[-1/2,0,0] EXT[1/2,0,0] EXT[1/2,0,0] EXT[1/2,0,0] +c 0 1/2 1/4 1 EXT[1/2,0,0] EXT[1/2,0,0] EXT[-1/2,0,0] EXT[1/2,0,0] # (y+1/2)^2+x^2=1/4 -c 0 -1/2 1/4 1 1 -1/2 1 -1/2 1 1/2 1 -1/2 -c 0 -1/2 1/4 1 1 1/2 1 -1/2 1 -1/2 1 -1/2 +c 0 -1/2 1/4 1 EXT[-1/2,0,0] EXT[-1/2,0,0] EXT[1/2,0,0] EXT[-1/2,0,0] +c 0 -1/2 1/4 1 EXT[1/2,0,0] EXT[-1/2,0,0] EXT[-1/2,0,0] EXT[-1/2,0,0] diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_arcs/split.xcv b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_arcs/split.xcv index f045a5a7da1..a7057267a63 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_arcs/split.xcv +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_arcs/split.xcv @@ -1,40 +1,40 @@ # x^2+y^2=1 -c 0 0 1 1 1 1 1 0 1 0 1 1 -c 0 0 1 1 1 0 1 1 1 -1 1 0 -c 0 0 1 1 1 -1 1 0 1 0 1 -1 -c 0 0 1 1 1 0 1 -1 1 1 1 0 +c 0 0 1 1 EXT[1,0,0] EXT[0,0,0] EXT[0,0,0] EXT[1,0,0] +c 0 0 1 1 EXT[0,0,0] EXT[1,0,0] EXT[-1,0,0] EXT[0,0,0] +c 0 0 1 1 EXT[-1,0,0] EXT[0,0,0] EXT[0,0,0] EXT[-1,0,0] +c 0 0 1 1 EXT[0,0,0] EXT[-1,0,0] EXT[1,0,0] EXT[0,0,0] # (x-1/2)^2+y^2=1/4 -c 1/2 0 1/4 1 1 1 1 0 1 1/2 1 1/2 -c 1/2 0 1/4 1 1 1/2 1 1/2 1 0 1 0 -c 1/2 0 1/4 1 1 0 1 0 1 1/2 1 -1/2 -c 1/2 0 1/4 1 1 1/2 1 -1/2 1 1 1 0 +c 1/2 0 1/4 1 EXT[1,0,0] EXT[0,0,0] EXT[1/2,0,0] EXT[1/2,0,0] +c 1/2 0 1/4 1 EXT[1/2,0,0] EXT[1/2,0,0] EXT[0,0,0] EXT[0,0,0] +c 1/2 0 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[1/2,0,0] EXT[-1/2,0,0] +c 1/2 0 1/4 1 EXT[1/2,0,0] EXT[-1/2,0,0] EXT[1,0,0] EXT[0,0,0] # (x+1/2)^2+y^2=1/4 -c -1/2 0 1/4 1 1 -1 1 0 1 -1/2 1 -1/2 -c -1/2 0 1/4 1 1 -1/2 1 -1/2 1 0 1 0 -c -1/2 0 1/4 1 1 0 1 0 1 -1/2 1 1/2 -c -1/2 0 1/4 1 1 -1/2 1 1/2 1 -1 1 0 +c -1/2 0 1/4 1 EXT[-1,0,0] EXT[0,0,0] EXT[-1/2,0,0] EXT[-1/2,0,0] +c -1/2 0 1/4 1 EXT[-1/2,0,0] EXT[-1/2,0,0] EXT[0,0,0] EXT[0,0,0] +c -1/2 0 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[-1/2,0,0] EXT[1/2,0,0] +c -1/2 0 1/4 1 EXT[-1/2,0,0] EXT[1/2,0,0] EXT[-1,0,0] EXT[0,0,0] # (y-1/2)^2+x^2=1/4 -c 0 1/2 1/4 1 1 0 1 1 1 -1/2 1 1/2 -c 0 1/2 1/4 1 1 -1/2 1 1/2 1 0 1 0 -c 0 1/2 1/4 1 1 0 1 0 1 1/2 1 1/2 -c 0 1/2 1/4 1 1 1/2 1 1/2 1 0 1 1 +c 0 1/2 1/4 1 EXT[0,0,0] EXT[1,0,0] EXT[-1/2,0,0] EXT[1/2,0,0] +c 0 1/2 1/4 1 EXT[-1/2,0,0] EXT[1/2,0,0] EXT[0,0,0] EXT[0,0,0] +c 0 1/2 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[1/2,0,0] EXT[1/2,0,0] +c 0 1/2 1/4 1 EXT[1/2,0,0] EXT[1/2,0,0] EXT[0,0,0] EXT[1,0,0] # (y+1/2)^2+x^2=1/4 -c 0 -1/2 1/4 1 1 0 1 -1 1 1/2 1 -1/2 -c 0 -1/2 1/4 1 1 1/2 1 -1/2 1 0 1 0 -c 0 -1/2 1/4 1 1 0 1 0 1 -1/2 1 -1/2 -c 0 -1/2 1/4 1 1 -1/2 1 -1/2 1 0 1 -1 +c 0 -1/2 1/4 1 EXT[0,0,0] EXT[-1,0,0] EXT[1/2,0,0] EXT[-1/2,0,0] +c 0 -1/2 1/4 1 EXT[1/2,0,0] EXT[-1/2,0,0] EXT[0,0,0] EXT[0,0,0] +c 0 -1/2 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[-1/2,0,0] EXT[-1/2,0,0] +c 0 -1/2 1/4 1 EXT[-1/2,0,0] EXT[-1/2,0,0] EXT[0,0,0] EXT[-1,0,0] # x^2+y^2=1 -c 0 0 1 1 1 1 1 0 1 -1 1 0 -c 0 0 1 1 1 -1 1 0 1 1 1 0 +c 0 0 1 1 EXT[1,0,0] EXT[0,0,0] EXT[-1,0,0] EXT[0,0,0] +c 0 0 1 1 EXT[-1,0,0] EXT[0,0,0] EXT[1,0,0] EXT[0,0,0] # (x-1/2)^2+y^2=1/4 -c 1/2 0 1/4 1 1 1 1 0 1 0 1 0 -c 1/2 0 1/4 1 1 0 1 0 1 1 1 0 +c 1/2 0 1/4 1 EXT[1,0,0] EXT[0,0,0] EXT[0,0,0] EXT[0,0,0] +c 1/2 0 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[1,0,0] EXT[0,0,0] # (x+1/2)^2+y^2=1/4 -c -1/2 0 1/4 1 1 -1 1 0 1 0 1 0 -c -1/2 0 1/4 1 1 0 1 0 1 -1 1 0 +c -1/2 0 1/4 1 EXT[-1,0,0] EXT[0,0,0] EXT[0,0,0] EXT[0,0,0] +c -1/2 0 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[-1,0,0] EXT[0,0,0] # (y-1/2)^2+x^2=1/4 -c 0 1/2 1/4 1 1 1/2 1 1/2 1 -1/2 1 1/2 -c 0 1/2 1/4 1 1 -1/2 1 1/2 1 1/2 1 1/2 +c 0 1/2 1/4 1 EXT[1/2,0,0] EXT[1/2,0,0] EXT[-1/2,0,0] EXT[1/2,0,0] +c 0 1/2 1/4 1 EXT[-1/2,0,0] EXT[1/2,0,0] EXT[1/2,0,0] EXT[1/2,0,0] # (y+1/2)^2+x^2=1/4 -c 0 -1/2 1/4 1 1 1/2 1 -1/2 1 -1/2 1 -1/2 -c 0 -1/2 1/4 1 1 -1/2 1 -1/2 1 1/2 1 -1/2 +c 0 -1/2 1/4 1 EXT[1/2,0,0] EXT[-1/2,0,0] EXT[-1/2,0,0] EXT[-1/2,0,0] +c 0 -1/2 1/4 1 EXT[-1/2,0,0] EXT[-1/2,0,0] EXT[1/2,0,0] EXT[-1/2,0,0] diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_arcs/xcurves b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_arcs/xcurves index 30af05a0b9f..7d9bce4fd21 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_arcs/xcurves +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_arcs/xcurves @@ -1,25 +1,25 @@ # x^2+y^2=1 -c 0 0 1 1 1 1 1 0 1 0 1 1 -c 0 0 1 1 1 0 1 1 1 -1 1 0 -c 0 0 1 1 1 -1 1 0 1 0 1 -1 -c 0 0 1 1 1 0 1 -1 1 1 1 0 +c 0 0 1 1 EXT[1,0,0] EXT[0,0,0] EXT[0,0,0] EXT[1,0,0] +c 0 0 1 1 EXT[0,0,0] EXT[1,0,0] EXT[-1,0,0] EXT[0,0,0] +c 0 0 1 1 EXT[-1,0,0] EXT[0,0,0] EXT[0,0,0] EXT[-1,0,0] +c 0 0 1 1 EXT[0,0,0] EXT[-1,0,0] EXT[1,0,0] EXT[0,0,0] # (x-1/2)^2+y^2=1/4 -c 1/2 0 1/4 1 1 1 1 0 1 1/2 1 1/2 -c 1/2 0 1/4 1 1 1/2 1 1/2 1 0 1 0 -c 1/2 0 1/4 1 1 0 1 0 1 1/2 1 -1/2 -c 1/2 0 1/4 1 1 1/2 1 -1/2 1 1 1 0 +c 1/2 0 1/4 1 EXT[1,0,0] EXT[0,0,0] EXT[1/2,0,0] EXT[1/2,0,0] +c 1/2 0 1/4 1 EXT[1/2,0,0] EXT[1/2,0,0] EXT[0,0,0] EXT[0,0,0] +c 1/2 0 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[1/2,0,0] EXT[-1/2,0,0] +c 1/2 0 1/4 1 EXT[1/2,0,0] EXT[-1/2,0,0] EXT[1,0,0] EXT[0,0,0] # (x+1/2)^2+y^2=1/4 -c -1/2 0 1/4 1 1 -1 1 0 1 -1/2 1 -1/2 -c -1/2 0 1/4 1 1 -1/2 1 -1/2 1 0 1 0 -c -1/2 0 1/4 1 1 0 1 0 1 -1/2 1 1/2 -c -1/2 0 1/4 1 1 -1/2 1 1/2 1 -1 1 0 +c -1/2 0 1/4 1 EXT[-1,0,0] EXT[0,0,0] EXT[-1/2,0,0] EXT[-1/2,0,0] +c -1/2 0 1/4 1 EXT[-1/2,0,0] EXT[-1/2,0,0] EXT[0,0,0] EXT[0,0,0] +c -1/2 0 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[-1/2,0,0] EXT[1/2,0,0] +c -1/2 0 1/4 1 EXT[-1/2,0,0] EXT[1/2,0,0] EXT[-1,0,0] EXT[0,0,0] # (y-1/2)^2+x^2=1/4 -c 0 1/2 1/4 1 1 0 1 1 1 -1/2 1 1/2 -c 0 1/2 1/4 1 1 -1/2 1 1/2 1 0 1 0 -c 0 1/2 1/4 1 1 0 1 0 1 1/2 1 1/2 -c 0 1/2 1/4 1 1 1/2 1 1/2 1 0 1 1 +c 0 1/2 1/4 1 EXT[0,0,0] EXT[1,0,0] EXT[-1/2,0,0] EXT[1/2,0,0] +c 0 1/2 1/4 1 EXT[-1/2,0,0] EXT[1/2,0,0] EXT[0,0,0] EXT[0,0,0] +c 0 1/2 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[1/2,0,0] EXT[1/2,0,0] +c 0 1/2 1/4 1 EXT[1/2,0,0] EXT[1/2,0,0] EXT[0,0,0] EXT[1,0,0] # (y+1/2)^2+x^2=1/4 -c 0 -1/2 1/4 1 1 0 1 -1 1 1/2 1 -1/2 -c 0 -1/2 1/4 1 1 1/2 1 -1/2 1 0 1 0 -c 0 -1/2 1/4 1 1 0 1 0 1 -1/2 1 -1/2 -c 0 -1/2 1/4 1 1 -1/2 1 -1/2 1 0 1 -1 +c 0 -1/2 1/4 1 EXT[0,0,0] EXT[-1,0,0] EXT[1/2,0,0] EXT[-1/2,0,0] +c 0 -1/2 1/4 1 EXT[1/2,0,0] EXT[-1/2,0,0] EXT[0,0,0] EXT[0,0,0] +c 0 -1/2 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[-1/2,0,0] EXT[-1/2,0,0] +c 0 -1/2 1/4 1 EXT[-1/2,0,0] EXT[-1/2,0,0] EXT[0,0,0] EXT[-1,0,0] diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_line_arcs/intersect.xcv b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_line_arcs/intersect.xcv index 8c81ec39042..efdaa443634 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_line_arcs/intersect.xcv +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_line_arcs/intersect.xcv @@ -1,18 +1,18 @@ # x^2+y^2=1 -c 0 0 1 1 1 1 1 0 1 -1 1 0 -c 0 0 1 1 1 -1 1 0 1 1 1 0 +c 0 0 1 1 EXT[1,0,0] EXT[0,0,0] EXT[-1,0,0] EXT[0,0,0] +c 0 0 1 1 EXT[-1,0,0] EXT[0,0,0] EXT[1,0,0] EXT[0,0,0] # (x-1/2)^2+y^2=1/4 -c 1/2 0 1/4 1 1 1 1 0 1 0 1 0 -c 1/2 0 1/4 1 1 0 1 0 1 1 1 0 +c 1/2 0 1/4 1 EXT[1,0,0] EXT[0,0,0] EXT[0,0,0] EXT[0,0,0] +c 1/2 0 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[1,0,0] EXT[0,0,0] # (x+1/2)^2+y^2=1/4 -c -1/2 0 1/4 1 1 -1 1 0 1 0 1 0 -c -1/2 0 1/4 1 1 0 1 0 1 -1 1 0 +c -1/2 0 1/4 1 EXT[-1,0,0] EXT[0,0,0] EXT[0,0,0] EXT[0,0,0] +c -1/2 0 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[-1,0,0] EXT[0,0,0] # (y-1/2)^2+x^2=1/4 -c 0 1/2 1/4 1 1 1/2 1 1/2 1 -1/2 1 1/2 -c 0 1/2 1/4 1 1 -1/2 1 1/2 1 1/2 1 1/2 +c 0 1/2 1/4 1 EXT[1/2,0,0] EXT[1/2,0,0] EXT[-1/2,0,0] EXT[1/2,0,0] +c 0 1/2 1/4 1 EXT[-1/2,0,0] EXT[1/2,0,0] EXT[1/2,0,0] EXT[1/2,0,0] # (y+1/2)^2+x^2=1/4 -c 0 -1/2 1/4 1 1 1/2 1 -1/2 1 -1/2 1 -1/2 -c 0 -1/2 1/4 1 1 -1/2 1 -1/2 1 1/2 1 -1/2 +c 0 -1/2 1/4 1 EXT[1/2,0,0] EXT[-1/2,0,0] EXT[-1/2,0,0] EXT[-1/2,0,0] +c 0 -1/2 1/4 1 EXT[-1/2,0,0] EXT[-1/2,0,0] EXT[1/2,0,0] EXT[-1/2,0,0] l 0 0 2 2 l 2 0 0 2 l 0 0 2 0 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_line_arcs/make_x_monotone.cv b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_line_arcs/make_x_monotone.cv index e8be720763d..72089f0072b 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_line_arcs/make_x_monotone.cv +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_line_arcs/make_x_monotone.cv @@ -1,36 +1,36 @@ # x^2+y^2=1 -c 0 0 1 1 1 1 1 0 1 0 1 1 -c 0 0 1 1 1 0 1 1 1 -1 1 0 -c 0 0 1 1 1 -1 1 0 1 0 1 -1 -c 0 0 1 1 1 0 1 -1 1 1 1 0 +c 0 0 1 1 EXT[1,0,0] EXT[0,0,0] EXT[0,0,0] EXT[1,0,0] +c 0 0 1 1 EXT[0,0,0] EXT[1,0,0] EXT[-1,0,0] EXT[0,0,0] +c 0 0 1 1 EXT[-1,0,0] EXT[0,0,0] EXT[0,0,0] EXT[-1,0,0] +c 0 0 1 1 EXT[0,0,0] EXT[-1,0,0] EXT[1,0,0] EXT[0,0,0] # (x-1/2)^2+y^2=1/4 -c 1/2 0 1/4 1 1 1 1 0 1 1/2 1 1/2 -c 1/2 0 1/4 1 1 1/2 1 1/2 1 0 1 0 -c 1/2 0 1/4 1 1 0 1 0 1 1/2 1 -1/2 -c 1/2 0 1/4 1 1 1/2 1 -1/2 1 1 1 0 +c 1/2 0 1/4 1 EXT[1,0,0] EXT[0,0,0] EXT[1/2,0,0] EXT[1/2,0,0] +c 1/2 0 1/4 1 EXT[1/2,0,0] EXT[1/2,0,0] EXT[0,0,0] EXT[0,0,0] +c 1/2 0 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[1/2,0,0] EXT[-1/2,0,0] +c 1/2 0 1/4 1 EXT[1/2,0,0] EXT[-1/2,0,0] EXT[1,0,0] EXT[0,0,0] # (x+1/2)^2+y^2=1/4 -c -1/2 0 1/4 1 1 -1 1 0 1 -1/2 1 -1/2 -c -1/2 0 1/4 1 1 -1/2 1 -1/2 1 0 1 0 -c -1/2 0 1/4 1 1 0 1 0 1 -1/2 1 1/2 -c -1/2 0 1/4 1 1 -1/2 1 1/2 1 -1 1 0 +c -1/2 0 1/4 1 EXT[-1,0,0] EXT[0,0,0] EXT[-1/2,0,0] EXT[-1/2,0,0] +c -1/2 0 1/4 1 EXT[-1/2,0,0] EXT[-1/2,0,0] EXT[0,0,0] EXT[0,0,0] +c -1/2 0 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[-1/2,0,0] EXT[1/2,0,0] +c -1/2 0 1/4 1 EXT[-1/2,0,0] EXT[1/2,0,0] EXT[-1,0,0] EXT[0,0,0] # (y-1/2)^2+x^2=1/4 -c 0 1/2 1/4 1 1 0 1 1 1 -1/2 1 1/2 -c 0 1/2 1/4 1 1 -1/2 1 1/2 1 0 1 0 -c 0 1/2 1/4 1 1 0 1 0 1 1/2 1 1/2 -c 0 1/2 1/4 1 1 1/2 1 1/2 1 0 1 1 +c 0 1/2 1/4 1 EXT[0,0,0] EXT[1,0,0] EXT[-1/2,0,0] EXT[1/2,0,0] +c 0 1/2 1/4 1 EXT[-1/2,0,0] EXT[1/2,0,0] EXT[0,0,0] EXT[0,0,0] +c 0 1/2 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[1/2,0,0] EXT[1/2,0,0] +c 0 1/2 1/4 1 EXT[1/2,0,0] EXT[1/2,0,0] EXT[0,0,0] EXT[1,0,0] # (y+1/2)^2+x^2=1/4 -c 0 -1/2 1/4 1 1 0 1 -1 1 1/2 1 -1/2 -c 0 -1/2 1/4 1 1 1/2 1 -1/2 1 0 1 0 -c 0 -1/2 1/4 1 1 0 1 0 1 -1/2 1 -1/2 -c 0 -1/2 1/4 1 1 -1/2 1 -1/2 1 0 1 -1 +c 0 -1/2 1/4 1 EXT[0,0,0] EXT[-1,0,0] EXT[1/2,0,0] EXT[-1/2,0,0] +c 0 -1/2 1/4 1 EXT[1/2,0,0] EXT[-1/2,0,0] EXT[0,0,0] EXT[0,0,0] +c 0 -1/2 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[-1/2,0,0] EXT[-1/2,0,0] +c 0 -1/2 1/4 1 EXT[-1/2,0,0] EXT[-1/2,0,0] EXT[0,0,0] EXT[-1,0,0] # x^2+y^2=1 -c 0 0 1 1 1 1 1 0 1 1 1 0 +c 0 0 1 1 EXT[1,0,0] EXT[0,0,0] EXT[1,0,0] EXT[0,0,0] # (x-1/2)^2+y^2=1/4 -c 1/2 0 1/4 1 1 1 1 0 1 1 1 0 +c 1/2 0 1/4 1 EXT[1,0,0] EXT[0,0,0] EXT[1,0,0] EXT[0,0,0] # (x+1/2)^2+y^2=1/4 -c -1/2 0 1/4 1 1 -1 1 0 1 -1 1 0 +c -1/2 0 1/4 1 EXT[-1,0,0] EXT[0,0,0] EXT[-1,0,0] EXT[0,0,0] # (y-1/2)^2+x^2=1/4 -c 0 1/2 1/4 1 1 1/2 1 1/2 1 1/2 1 1/2 +c 0 1/2 1/4 1 EXT[1/2,0,0] EXT[1/2,0,0] EXT[1/2,0,0] EXT[1/2,0,0] # (y+1/2)^2+x^2=1/4 -c 0 -1/2 1/4 1 1 1/2 1 -1/2 1 1/2 1 -1/2 +c 0 -1/2 1/4 1 EXT[1/2,0,0] EXT[-1/2,0,0] EXT[1/2,0,0] EXT[-1/2,0,0] l 0 0 1 1 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_line_arcs/make_x_monotone.xcv b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_line_arcs/make_x_monotone.xcv index e4d6be04c3a..d7a9d358539 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_line_arcs/make_x_monotone.xcv +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_line_arcs/make_x_monotone.xcv @@ -1,41 +1,41 @@ # x^2+y^2=1 -c 0 0 1 1 1 1 1 0 1 0 1 1 -c 0 0 1 1 1 0 1 1 1 -1 1 0 -c 0 0 1 1 1 -1 1 0 1 0 1 -1 -c 0 0 1 1 1 0 1 -1 1 1 1 0 +c 0 0 1 1 EXT[1,0,0] EXT[0,0,0] EXT[0,0,0] EXT[1,0,0] +c 0 0 1 1 EXT[0,0,0] EXT[1,0,0] EXT[-1,0,0] EXT[0,0,0] +c 0 0 1 1 EXT[-1,0,0] EXT[0,0,0] EXT[0,0,0] EXT[-1,0,0] +c 0 0 1 1 EXT[0,0,0] EXT[-1,0,0] EXT[1,0,0] EXT[0,0,0] # (x-1/2)^2+y^2=1/4 -c 1/2 0 1/4 1 1 1 1 0 1 1/2 1 1/2 -c 1/2 0 1/4 1 1 1/2 1 1/2 1 0 1 0 -c 1/2 0 1/4 1 1 0 1 0 1 1/2 1 -1/2 -c 1/2 0 1/4 1 1 1/2 1 -1/2 1 1 1 0 +c 1/2 0 1/4 1 EXT[1,0,0] EXT[0,0,0] EXT[1/2,0,0] EXT[1/2,0,0] +c 1/2 0 1/4 1 EXT[1/2,0,0] EXT[1/2,0,0] EXT[0,0,0] EXT[0,0,0] +c 1/2 0 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[1/2,0,0] EXT[-1/2,0,0] +c 1/2 0 1/4 1 EXT[1/2,0,0] EXT[-1/2,0,0] EXT[1,0,0] EXT[0,0,0] # (x+1/2)^2+y^2=1/4 -c -1/2 0 1/4 1 1 -1 1 0 1 -1/2 1 -1/2 -c -1/2 0 1/4 1 1 -1/2 1 -1/2 1 0 1 0 -c -1/2 0 1/4 1 1 0 1 0 1 -1/2 1 1/2 -c -1/2 0 1/4 1 1 -1/2 1 1/2 1 -1 1 0 +c -1/2 0 1/4 1 EXT[-1,0,0] EXT[0,0,0] EXT[-1/2,0,0] EXT[-1/2,0,0] +c -1/2 0 1/4 1 EXT[-1/2,0,0] EXT[-1/2,0,0] EXT[0,0,0] EXT[0,0,0] +c -1/2 0 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[-1/2,0,0] EXT[1/2,0,0] +c -1/2 0 1/4 1 EXT[-1/2,0,0] EXT[1/2,0,0] EXT[-1,0,0] EXT[0,0,0] # (y-1/2)^2+x^2=1/4 -c 0 1/2 1/4 1 1 0 1 1 1 -1/2 1 1/2 -c 0 1/2 1/4 1 1 -1/2 1 1/2 1 0 1 0 -c 0 1/2 1/4 1 1 0 1 0 1 1/2 1 1/2 -c 0 1/2 1/4 1 1 1/2 1 1/2 1 0 1 1 +c 0 1/2 1/4 1 EXT[0,0,0] EXT[1,0,0] EXT[-1/2,0,0] EXT[1/2,0,0] +c 0 1/2 1/4 1 EXT[-1/2,0,0] EXT[1/2,0,0] EXT[0,0,0] EXT[0,0,0] +c 0 1/2 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[1/2,0,0] EXT[1/2,0,0] +c 0 1/2 1/4 1 EXT[1/2,0,0] EXT[1/2,0,0] EXT[0,0,0] EXT[1,0,0] # (y+1/2)^2+x^2=1/4 -c 0 -1/2 1/4 1 1 0 1 -1 1 1/2 1 -1/2 -c 0 -1/2 1/4 1 1 1/2 1 -1/2 1 0 1 0 -c 0 -1/2 1/4 1 1 0 1 0 1 -1/2 1 -1/2 -c 0 -1/2 1/4 1 1 -1/2 1 -1/2 1 0 1 -1 +c 0 -1/2 1/4 1 EXT[0,0,0] EXT[-1,0,0] EXT[1/2,0,0] EXT[-1/2,0,0] +c 0 -1/2 1/4 1 EXT[1/2,0,0] EXT[-1/2,0,0] EXT[0,0,0] EXT[0,0,0] +c 0 -1/2 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[-1/2,0,0] EXT[-1/2,0,0] +c 0 -1/2 1/4 1 EXT[-1/2,0,0] EXT[-1/2,0,0] EXT[0,0,0] EXT[-1,0,0] # x^2+y^2=1 -c 0 0 1 1 1 1 1 0 1 -1 1 0 -c 0 0 1 1 1 -1 1 0 1 1 1 0 +c 0 0 1 1 EXT[1,0,0] EXT[0,0,0] EXT[-1,0,0] EXT[0,0,0] +c 0 0 1 1 EXT[-1,0,0] EXT[0,0,0] EXT[1,0,0] EXT[0,0,0] # (x-1/2)^2+y^2=1/4 -c 1/2 0 1/4 1 1 1 1 0 1 0 1 0 -c 1/2 0 1/4 1 1 0 1 0 1 1 1 0 +c 1/2 0 1/4 1 EXT[1,0,0] EXT[0,0,0] EXT[0,0,0] EXT[0,0,0] +c 1/2 0 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[1,0,0] EXT[0,0,0] # (x+1/2)^2+y^2=1/4 -c -1/2 0 1/4 1 1 -1 1 0 1 0 1 0 -c -1/2 0 1/4 1 1 0 1 0 1 -1 1 0 +c -1/2 0 1/4 1 EXT[-1,0,0] EXT[0,0,0] EXT[0,0,0] EXT[0,0,0] +c -1/2 0 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[-1,0,0] EXT[0,0,0] # (y-1/2)^2+x^2=1/4 -c 0 1/2 1/4 1 1 1/2 1 1/2 1 -1/2 1 1/2 -c 0 1/2 1/4 1 1 -1/2 1 1/2 1 1/2 1 1/2 +c 0 1/2 1/4 1 EXT[1/2,0,0] EXT[1/2,0,0] EXT[-1/2,0,0] EXT[1/2,0,0] +c 0 1/2 1/4 1 EXT[-1/2,0,0] EXT[1/2,0,0] EXT[1/2,0,0] EXT[1/2,0,0] # (y+1/2)^2+x^2=1/4 -c 0 -1/2 1/4 1 1 1/2 1 -1/2 1 -1/2 1 -1/2 -c 0 -1/2 1/4 1 1 -1/2 1 -1/2 1 1/2 1 -1/2 +c 0 -1/2 1/4 1 EXT[1/2,0,0] EXT[-1/2,0,0] EXT[-1/2,0,0] EXT[-1/2,0,0] +c 0 -1/2 1/4 1 EXT[-1/2,0,0] EXT[-1/2,0,0] EXT[1/2,0,0] EXT[-1/2,0,0] l 0 0 1 1 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_line_arcs/split.xcv b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_line_arcs/split.xcv index bbe47534159..9ed989fc871 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_line_arcs/split.xcv +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_line_arcs/split.xcv @@ -1,43 +1,43 @@ # x^2+y^2=1 -c 0 0 1 1 1 1 1 0 1 0 1 1 -c 0 0 1 1 1 0 1 1 1 -1 1 0 -c 0 0 1 1 1 -1 1 0 1 0 1 -1 -c 0 0 1 1 1 0 1 -1 1 1 1 0 +c 0 0 1 1 EXT[1,0,0] EXT[0,0,0] EXT[0,0,0] EXT[1,0,0] +c 0 0 1 1 EXT[0,0,0] EXT[1,0,0] EXT[-1,0,0] EXT[0,0,0] +c 0 0 1 1 EXT[-1,0,0] EXT[0,0,0] EXT[0,0,0] EXT[-1,0,0] +c 0 0 1 1 EXT[0,0,0] EXT[-1,0,0] EXT[1,0,0] EXT[0,0,0] # (x-1/2)^2+y^2=1/4 -c 1/2 0 1/4 1 1 1 1 0 1 1/2 1 1/2 -c 1/2 0 1/4 1 1 1/2 1 1/2 1 0 1 0 -c 1/2 0 1/4 1 1 0 1 0 1 1/2 1 -1/2 -c 1/2 0 1/4 1 1 1/2 1 -1/2 1 1 1 0 +c 1/2 0 1/4 1 EXT[1,0,0] EXT[0,0,0] EXT[1/2,0,0] EXT[1/2,0,0] +c 1/2 0 1/4 1 EXT[1/2,0,0] EXT[1/2,0,0] EXT[0,0,0] EXT[0,0,0] +c 1/2 0 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[1/2,0,0] EXT[-1/2,0,0] +c 1/2 0 1/4 1 EXT[1/2,0,0] EXT[-1/2,0,0] EXT[1,0,0] EXT[0,0,0] # (x+1/2)^2+y^2=1/4 -c -1/2 0 1/4 1 1 -1 1 0 1 -1/2 1 -1/2 -c -1/2 0 1/4 1 1 -1/2 1 -1/2 1 0 1 0 -c -1/2 0 1/4 1 1 0 1 0 1 -1/2 1 1/2 -c -1/2 0 1/4 1 1 -1/2 1 1/2 1 -1 1 0 +c -1/2 0 1/4 1 EXT[-1,0,0] EXT[0,0,0] EXT[-1/2,0,0] EXT[-1/2,0,0] +c -1/2 0 1/4 1 EXT[-1/2,0,0] EXT[-1/2,0,0] EXT[0,0,0] EXT[0,0,0] +c -1/2 0 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[-1/2,0,0] EXT[1/2,0,0] +c -1/2 0 1/4 1 EXT[-1/2,0,0] EXT[1/2,0,0] EXT[-1,0,0] EXT[0,0,0] # (y-1/2)^2+x^2=1/4 -c 0 1/2 1/4 1 1 0 1 1 1 -1/2 1 1/2 -c 0 1/2 1/4 1 1 -1/2 1 1/2 1 0 1 0 -c 0 1/2 1/4 1 1 0 1 0 1 1/2 1 1/2 -c 0 1/2 1/4 1 1 1/2 1 1/2 1 0 1 1 +c 0 1/2 1/4 1 EXT[0,0,0] EXT[1,0,0] EXT[-1/2,0,0] EXT[1/2,0,0] +c 0 1/2 1/4 1 EXT[-1/2,0,0] EXT[1/2,0,0] EXT[0,0,0] EXT[0,0,0] +c 0 1/2 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[1/2,0,0] EXT[1/2,0,0] +c 0 1/2 1/4 1 EXT[1/2,0,0] EXT[1/2,0,0] EXT[0,0,0] EXT[1,0,0] # (y+1/2)^2+x^2=1/4 -c 0 -1/2 1/4 1 1 0 1 -1 1 1/2 1 -1/2 -c 0 -1/2 1/4 1 1 1/2 1 -1/2 1 0 1 0 -c 0 -1/2 1/4 1 1 0 1 0 1 -1/2 1 -1/2 -c 0 -1/2 1/4 1 1 -1/2 1 -1/2 1 0 1 -1 +c 0 -1/2 1/4 1 EXT[0,0,0] EXT[-1,0,0] EXT[1/2,0,0] EXT[-1/2,0,0] +c 0 -1/2 1/4 1 EXT[1/2,0,0] EXT[-1/2,0,0] EXT[0,0,0] EXT[0,0,0] +c 0 -1/2 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[-1/2,0,0] EXT[-1/2,0,0] +c 0 -1/2 1/4 1 EXT[-1/2,0,0] EXT[-1/2,0,0] EXT[0,0,0] EXT[-1,0,0] # x^2+y^2=1 -c 0 0 1 1 1 1 1 0 1 -1 1 0 -c 0 0 1 1 1 -1 1 0 1 1 1 0 +c 0 0 1 1 EXT[1,0,0] EXT[0,0,0] EXT[-1,0,0] EXT[0,0,0] +c 0 0 1 1 EXT[-1,0,0] EXT[0,0,0] EXT[1,0,0] EXT[0,0,0] # (x-1/2)^2+y^2=1/4 -c 1/2 0 1/4 1 1 1 1 0 1 0 1 0 -c 1/2 0 1/4 1 1 0 1 0 1 1 1 0 +c 1/2 0 1/4 1 EXT[1,0,0] EXT[0,0,0] EXT[0,0,0] EXT[0,0,0] +c 1/2 0 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[1,0,0] EXT[0,0,0] # (x+1/2)^2+y^2=1/4 -c -1/2 0 1/4 1 1 -1 1 0 1 0 1 0 -c -1/2 0 1/4 1 1 0 1 0 1 -1 1 0 +c -1/2 0 1/4 1 EXT[-1,0,0] EXT[0,0,0] EXT[0,0,0] EXT[0,0,0] +c -1/2 0 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[-1,0,0] EXT[0,0,0] # (y-1/2)^2+x^2=1/4 -c 0 1/2 1/4 1 1 1/2 1 1/2 1 -1/2 1 1/2 -c 0 1/2 1/4 1 1 -1/2 1 1/2 1 1/2 1 1/2 +c 0 1/2 1/4 1 EXT[1/2,0,0] EXT[1/2,0,0] EXT[-1/2,0,0] EXT[1/2,0,0] +c 0 1/2 1/4 1 EXT[-1/2,0,0] EXT[1/2,0,0] EXT[1/2,0,0] EXT[1/2,0,0] # (y+1/2)^2+x^2=1/4 -c 0 -1/2 1/4 1 1 1/2 1 -1/2 1 -1/2 1 -1/2 -c 0 -1/2 1/4 1 1 -1/2 1 -1/2 1 1/2 1 -1/2 +c 0 -1/2 1/4 1 EXT[1/2,0,0] EXT[-1/2,0,0] EXT[-1/2,0,0] EXT[-1/2,0,0] +c 0 -1/2 1/4 1 EXT[-1/2,0,0] EXT[-1/2,0,0] EXT[1/2,0,0] EXT[-1/2,0,0] l 0 0 2 0 l 0 0 1 0 l 1 0 2 0 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_line_arcs/xcurves b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_line_arcs/xcurves index 107ad7db4c4..48a7f8e7bd4 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_line_arcs/xcurves +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_line_arcs/xcurves @@ -92,27 +92,27 @@ l 1 1 1 0 # circles # # x^2+y^2=1 -c 0 0 1 1 1 1 1 0 1 0 1 1 -c 0 0 1 1 1 0 1 1 1 -1 1 0 -c 0 0 1 1 1 -1 1 0 1 0 1 -1 -c 0 0 1 1 1 0 1 -1 1 1 1 0 +c 0 0 1 1 EXT[1,0,0] EXT[0,0,0] EXT[0,0,0] EXT[1,0,0] +c 0 0 1 1 EXT[0,0,0] EXT[1,0,0] EXT[-1,0,0] EXT[0,0,0] +c 0 0 1 1 EXT[-1,0,0] EXT[0,0,0] EXT[0,0,0] EXT[-1,0,0] +c 0 0 1 1 EXT[0,0,0] EXT[-1,0,0] EXT[1,0,0] EXT[0,0,0] # (x-1/2)^2+y^2=1/4 -c 1/2 0 1/4 1 1 1 1 0 1 1/2 1 1/2 -c 1/2 0 1/4 1 1 1/2 1 1/2 1 0 1 0 -c 1/2 0 1/4 1 1 0 1 0 1 1/2 1 -1/2 -c 1/2 0 1/4 1 1 1/2 1 -1/2 1 1 1 0 +c 1/2 0 1/4 1 EXT[1,0,0] EXT[0,0,0] EXT[1/2,0,0] EXT[1/2,0,0] +c 1/2 0 1/4 1 EXT[1/2,0,0] EXT[1/2,0,0] EXT[0,0,0] EXT[0,0,0] +c 1/2 0 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[1/2,0,0] EXT[-1/2,0,0] +c 1/2 0 1/4 1 EXT[1/2,0,0] EXT[-1/2,0,0] EXT[1,0,0] EXT[0,0,0] # (x+1/2)^2+y^2=1/4 -c -1/2 0 1/4 1 1 -1 1 0 1 -1/2 1 -1/2 -c -1/2 0 1/4 1 1 -1/2 1 -1/2 1 0 1 0 -c -1/2 0 1/4 1 1 0 1 0 1 -1/2 1 1/2 -c -1/2 0 1/4 1 1 -1/2 1 1/2 1 -1 1 0 +c -1/2 0 1/4 1 EXT[-1,0,0] EXT[0,0,0] EXT[-1/2,0,0] EXT[-1/2,0,0] +c -1/2 0 1/4 1 EXT[-1/2,0,0] EXT[-1/2,0,0] EXT[0,0,0] EXT[0,0,0] +c -1/2 0 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[-1/2,0,0] EXT[1/2,0,0] +c -1/2 0 1/4 1 EXT[-1/2,0,0] EXT[1/2,0,0] EXT[-1,0,0] EXT[0,0,0] # (y-1/2)^2+x^2=1/4 -c 0 1/2 1/4 1 1 0 1 1 1 -1/2 1 1/2 -c 0 1/2 1/4 1 1 -1/2 1 1/2 1 0 1 0 -c 0 1/2 1/4 1 1 0 1 0 1 1/2 1 1/2 -c 0 1/2 1/4 1 1 1/2 1 1/2 1 0 1 1 +c 0 1/2 1/4 1 EXT[0,0,0] EXT[1,0,0] EXT[-1/2,0,0] EXT[1/2,0,0] +c 0 1/2 1/4 1 EXT[-1/2,0,0] EXT[1/2,0,0] EXT[0,0,0] EXT[0,0,0] +c 0 1/2 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[1/2,0,0] EXT[1/2,0,0] +c 0 1/2 1/4 1 EXT[1/2,0,0] EXT[1/2,0,0] EXT[0,0,0] EXT[1,0,0] # (y+1/2)^2+x^2=1/4 -c 0 -1/2 1/4 1 1 0 1 -1 1 1/2 1 -1/2 -c 0 -1/2 1/4 1 1 1/2 1 -1/2 1 0 1 0 -c 0 -1/2 1/4 1 1 0 1 0 1 -1/2 1 -1/2 -c 0 -1/2 1/4 1 1 -1/2 1 -1/2 1 0 1 -1 +c 0 -1/2 1/4 1 EXT[0,0,0] EXT[-1,0,0] EXT[1/2,0,0] EXT[-1/2,0,0] +c 0 -1/2 1/4 1 EXT[1/2,0,0] EXT[-1/2,0,0] EXT[0,0,0] EXT[0,0,0] +c 0 -1/2 1/4 1 EXT[0,0,0] EXT[0,0,0] EXT[-1/2,0,0] EXT[-1/2,0,0] +c 0 -1/2 1/4 1 EXT[-1/2,0,0] EXT[-1/2,0,0] EXT[0,0,0] EXT[-1,0,0] diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_lines/constructor.xcv b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_lines/constructor.xcv index 05ced9f3538..f5a933bedcc 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_lines/constructor.xcv +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_lines/constructor.xcv @@ -3,10 +3,10 @@ w 1 0 0 1 w 0 1 -1 0 w -1 0 0 -1 w 0 -1 1 0 -x 1 1 -1 1 1 1 0 1 0 1 1 -x -1 1 -1 1 0 1 1 1 -1 1 0 -x 1 1 1 1 -1 1 0 1 0 1 -1 -x -1 1 1 1 0 1 -1 1 1 1 0 +x 1 1 -1 EXT[1,0,0] EXT[0,0,0] EXT[0,0,0] EXT[1,0,0] +x -1 1 -1 EXT[0,0,0] EXT[1,0,0] EXT[-1,0,0] EXT[0,0,0] +x 1 1 1 EXT[-1,0,0] EXT[0,0,0] EXT[0,0,0] EXT[-1,0,0] +x -1 1 1 EXT[0,0,0] EXT[-1,0,0] EXT[1,0,0] EXT[0,0,0] y 1 1 -1 1 0 -1 0 1 -1 y -1 1 -1 0 1 -1 1 0 1 y 1 1 1 1 0 1 0 1 1 diff --git a/Boolean_set_operations_2/demo/Boolean_set_operations_2/Qt_widget_get_circ_polygon.h b/Boolean_set_operations_2/demo/Boolean_set_operations_2/Qt_widget_get_circ_polygon.h index 12898bf3ab6..cb5de3f2613 100644 --- a/Boolean_set_operations_2/demo/Boolean_set_operations_2/Qt_widget_get_circ_polygon.h +++ b/Boolean_set_operations_2/demo/Boolean_set_operations_2/Qt_widget_get_circ_polygon.h @@ -220,7 +220,7 @@ namespace CGAL if(m_pgn.is_empty()) return; const Arc_point_2& first_point = m_pgn.curves_begin()->source(); - CGAL_assertion(first_point.x().is_rational() && first_point.y().is_rational()); + CGAL_assertion(!first_point.x().is_extended() && !first_point.y().is_extended()); FT xs = first_point.x().alpha(); FT ys = first_point.y().alpha(); m_pgn.push_back(X_monotone_curve_2(m_last_of_poly, Point_2(xs, ys))); @@ -284,7 +284,7 @@ namespace CGAL *widget << Segment_2(m_rubber, m_last_of_poly); const Arc_point_2& last_point = last->source(); - CGAL_assertion(last_point.x().is_rational() && last_point.y().is_rational()); + CGAL_assertion(!last_point.x().is_extended() && !last_point.y().is_extended()); FT xs = last_point.x().alpha(); FT ys = last_point.y().alpha(); @@ -338,7 +338,7 @@ namespace CGAL *widget << Segment_2(m_rubber, m_last_of_poly); const Arc_point_2& last_point = first->source(); - CGAL_assertion(last_point.x().is_rational() && last_point.y().is_rational()); + CGAL_assertion(!last_point.x().is_extended() && !last_point.y().is_extended()); FT xs = last_point.x().alpha(); FT ys = last_point.y().alpha(); @@ -509,7 +509,7 @@ namespace CGAL if(is_last_curve) { const Arc_point_2& first_point = m_pgn.curves_begin()->source(); - CGAL_assertion(first_point.x().is_rational() && first_point.y().is_rational()); + CGAL_assertion(!first_point.x().is_extended() && !first_point.y().is_extended()); FT xs = first_point.x().alpha(); FT ys = first_point.y().alpha(); rubber_curve = X_monotone_curve_2(m_last_of_poly, Point_2(xs, ys)); diff --git a/Boolean_set_operations_2/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/GraphicsViewCircularPolygonInput.h b/Boolean_set_operations_2/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/GraphicsViewCircularPolygonInput.h index 1b1f5fa794d..32741314db6 100644 --- a/Boolean_set_operations_2/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/GraphicsViewCircularPolygonInput.h +++ b/Boolean_set_operations_2/demo/Boolean_set_operations_2_GraphicsView/include/CGAL/Qt/GraphicsViewCircularPolygonInput.h @@ -380,8 +380,8 @@ namespace Qt { { Arc_point const& first_point = xcvs.front().source(); Arc_point const& last_point = xcvs.back ().target(); - CGAL_assertion(first_point.x().is_rational() && first_point.y().is_rational()); - CGAL_assertion(last_point. x().is_rational() && last_point .y().is_rational()); + CGAL_assertion(!first_point.x().is_extended() && !first_point.y().is_extended()); + CGAL_assertion(!last_point. x().is_extended() && !last_point .y().is_extended()); FT fxs = first_point.x().alpha(); FT fys = first_point.y().alpha(); FT lxs = last_point .x().alpha(); diff --git a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2/bso_def.tex b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2/bso_def.tex index 6a369b421d2..55fdc39adbe 100644 --- a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2/bso_def.tex +++ b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2/bso_def.tex @@ -55,7 +55,7 @@ polygon vertices is referred to as the polygon \textbf{(outer) boundary}. \item A \textbf{Relatively simple} polygon allows vertices with a degree$>$2, but all of its edges are disjoint in their interior. Furthermore, it must be an orientable polygon. Namely when it is inserted into an arrangement and its outer boundary is traversed, the same face is adjacent to all of the halfedges (no crossing over any curve during the traversal). %\textbf{insert relativelySimplePolygon.tex}\\ -Note that while polygon C has the same curves as polygon B, traversal of the curves leads to crossing over a previouly traversed curve, and is therefore neither simple nor relatively simple. +Note that while polygon C has the same curves as polygon B, traversal of the curves leads to crossing over a previously traversed curve, and is therefore neither simple nor relatively simple. %\textbf{insert NotRelativelySimplePolygon.tex}\\ \\ \item A polygon in our context must be relatively simple and its outer boundary vertices must be ordered in a counterclockwise direction around the interior of the polygon. @@ -98,7 +98,7 @@ In our context, a polygon must uphold the following conditions:\\ \begin{enumerate} \item\textit{Closed Boundary} - the polygon's outer boundary must be a connected sequence of curves, that start and end at the same vertex. \item \textit{Simplicity} - the polygon must be simple. -\item \textit{Orientaion} - the polygon's outer boundary must be \textit{counter-clockwise oriented}. +\item \textit{Orientation} - the polygon's outer boundary must be \textit{counter-clockwise oriented}. \end{enumerate} diff --git a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2/bso_general.tex b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2/bso_general.tex index 3462d813172..cd00bd8c977 100644 --- a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2/bso_general.tex +++ b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2/bso_general.tex @@ -250,10 +250,10 @@ The class-template \ccc{Gps_traits_2} models the concept \ccc{GeneralPolygonSetTraits_2}, and can be used to instantiate the class template \ccc{General_polygon_set_2}. -It serves as an adapter for a geoemtric traits class, which models the +It serves as an adapter for a geometric traits class, which models the concept \ccc{ArrangementDirectionalXMonotoneTraits_2}. It can be used for performing set-operations on general polygons. -The implementation of the adapetr is rather simple, as it is derived +The implementation of the adapter is rather simple, as it is derived from the instantiated template-parameter \ccc{ArrXMonotoneTraits_2} inheriting its necessary types and methods. It further exploits the methods provided by the instantiated parameter diff --git a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2/bso_intro.tex b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2/bso_intro.tex index fc05d91e843..5b084d07246 100644 --- a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2/bso_intro.tex +++ b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2/bso_intro.tex @@ -61,6 +61,6 @@ in more depth. In Section~\ref{bso_sec:bso_lin} we focus on Boolean set-operations on linear polygons, introducing the notion of polygons with holes and of a general polygon set. Section~\ref{bso_sec:bso_gen} introduces general polygons. -We first discuss polygons whose edges are either line segements or circular +We first discuss polygons whose edges are either line segments or circular arcs and then explain how to construct and use general polygons whose edges can be arbitrary weakly $x$-monotone curves. diff --git a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2/bso_linear.tex b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2/bso_linear.tex index e17d8e2d5c3..d33437a3927 100644 --- a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2/bso_linear.tex +++ b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2/bso_linear.tex @@ -5,7 +5,7 @@ The basic library of \cgal\ includes the \ccc{Polygon_2} class-template that represents a linear polygon in the plane. The polygon is represented by its vertices stored in a container of objects of type \ccc{Kernel::Point_2}. The polygon edges are line -segments (\ccc{Kenrel::Segment_2} objects) between adjacent points in +segments (\ccc{Kernel::Segment_2} objects) between adjacent points in the container. By default, the \ccc{Container} is a vector of \ccc{Kernel::Point_2} objects. @@ -37,7 +37,7 @@ computes the union of two polygons is called \ccc{join()}, since the word \ccc{union} is reserved in \CC.} \ccc{difference()}, \ccc{symmetric_difference()} and the predicate \ccc{do_intersect()} that accept two \ccc{Polygon_2} objects as their input. We explain how -these functions should be used throught several examples in the +these functions should be used through several examples in the following sections. % ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -151,7 +151,7 @@ upside-down triangle. In general, there are many ways to arrive at a particular point set. However, the set of polygons with holes obtained through the application of any sequence of operations is unique. The set depicted on the right is represented as a single -polygon having a triangular outer boundary with a single triangluar +polygon having a triangular outer boundary with a single triangular hole in its interior --- and not as three triangles that have no holes at all. As a general rule, if two point sets are connected, then they belong to the same polygon with holes. @@ -233,7 +233,7 @@ output polygons to its associated container. \subsubsection{Example --- Joining and Intersecting Simple Polygons\label{bso_sssec:ex_simple_bops}} % ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The following example demonstartes the usage of the free functions +The following example demonstrates the usage of the free functions \ccc{join()} and \ccc{intersect()} for computing the union and the intersection of the two simple polygons depicted in Figure~\ref{fig:simple}~(b). The example uses the auxiliary function @@ -245,7 +245,7 @@ the header file \ccc{print_utils.h} under the examples folder. % ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \subsubsection{Operations on Polygons with Holes\label{bso_sssec:pwh_bops}} % ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -We have demonstrated that free functions that perform boolean set operations on simple polygons may output polygons with holes. In addition to these functions, the Boolean set-operations package provides the following overriden free functions that accept +We have demonstrated that free functions that perform boolean set operations on simple polygons may output polygons with holes. In addition to these functions, the Boolean set-operations package provides the following overridden free functions that accept \ccc{General_polygon_with_holes_2} objects as their input - %Having introduced polygons with holes and explained how the free functions %output such objects, it is only natural to perform operations on sets that @@ -284,7 +284,7 @@ contains of five holes: \ccIncludeExampleCode{Boolean_set_operations_2/symmetric_difference.cpp} -In some cases it is convinient to connect the outer boundary of a +In some cases it is convenient to connect the outer boundary of a polygon with holes with the holes inside it. The function \ccc{connect_holes()} accepts a polygon with holes, and connects the topmost vertex in each hole with the polygon @@ -331,7 +331,7 @@ into the set using the \ccc{insert()} method, as long as the inserted polygons and the existing polygons in the set are disjoint. The \ccc{Polygon_set_2} class also provides access functions for accessing the polygons with holes it contains, and a few queries. The -most improtant query is \ccc{S.oriented_side(q)}, which determined +most important query is \ccc{S.oriented_side(q)}, which determined whether the query point $q$ is contained in the interior of the set $S$, lies on the boundary of the set, or neither. @@ -347,8 +347,8 @@ functions. Member functions of the \ccc{General_polygon_set_2} that perform Boolean set-operations come in two flavors: for example, \ccc{S.join(P, Q)} -computes the union of $P$ and $Q$ and assigned the reuslt to $S$, while -\ccc{S.join(P)} preformes the operation $S \longleftarrow S \cup P$. +computes the union of $P$ and $Q$ and assigned the result to $S$, while +\ccc{S.join(P)} performs the operation $S \longleftarrow S \cup P$. Similarly, \ccc{S.complement(P)} sets $S$ to be the complement of $P$, while $S.complement()$ simply negates the set $S$. @@ -358,7 +358,7 @@ while $S.complement()$ simply negates the set $S$. The free functions reviewed in Section~\ref{bso_ssec:polygons_with_holes} serve as a wrapper for the polygon-set class, and are only provided for -convinience. A typical such function constructs a pair of +convenience. A typical such function constructs a pair of \ccc{General_polygon_set_2} objects, invokes the appropriate method to apply the desired Boolean operation, and transforms the resulting polygon set to the required output format. Thus, when several diff --git a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/Boolean_set_operations_2.tex b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/Boolean_set_operations_2.tex index 07124850d78..dcd4a312407 100644 --- a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/Boolean_set_operations_2.tex +++ b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/Boolean_set_operations_2.tex @@ -6,7 +6,7 @@ %============ An instance of the \ccClassTemplateName\ class-template represents a point set in the plane. An \ccc{Arrangement_2} data structure is used -internaly to represent the point set. The class template provides +internally to represent the point set. The class template provides methods to apply Boolean-set operations on pairs of instances of \ccc{Boolean_set_operations_2} and a few other utility methods. At this point only regularized Boolean-set operations are implemented. @@ -122,8 +122,8 @@ with holes type.} \ccMethod{void difference(const Boolean_set_operations_2& bops);} {computes the difference between this and \ccc{bops}.} -\ccMethod{void symetric_difference(const Boolean_set_operations_2& bops);} - {computes the symetric difference between this and \ccc{bops}.} +\ccMethod{void symmetric_difference(const Boolean_set_operations_2& bops);} + {computes the symmetric difference between this and \ccc{bops}.} \ccPredicates % =========== diff --git a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/Bso_difference.tex b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/Bso_difference.tex index dfa4d9f9766..021e158b31f 100644 --- a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/Bso_difference.tex +++ b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/Bso_difference.tex @@ -112,7 +112,7 @@ OutputIterator difference(const General_polygon_with_holes_2 & p1, % polygons (or general polygons with holes) given in the first range, and % another set given in the second range. (The value type of the input iterator % is used to distinguish between the two types.) The result, represented -% by a set of general poygon with holes, is inserted into an output container +% by a set of general polygon with holes, is inserted into an output container % through a given output iterator \ccc{oi}. The output iterator is % returned. The value type of the \ccc{OutputIterator} is % \ccc{General_polygon_with_holes_2}.} diff --git a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/Bso_intersection.tex b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/Bso_intersection.tex index 41cb8d8d516..2f10fa88932 100644 --- a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/Bso_intersection.tex +++ b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/Bso_intersection.tex @@ -111,7 +111,7 @@ OutputIterator intersection(InputIterator begin, InputIterator end, {Computes the intersection of the general polygons (or general polygons with holes) in the given range. (The value type of the input iterator is used to distinguish between the two.) The result, represented by a set -of general poygon with holes, is inserted into an output container +of general polygon with holes, is inserted into an output container through a given output iterator \ccc{oi}. The output iterator is returned. The value type of the \ccc{OutputIterator} is \ccc{Traits::Polygon_with_holes_2}.} @@ -125,7 +125,7 @@ OutputIterator intersection(InputIterator1 pgn_begin1, OutputIterator oi);} {Computes the intersection of the general polygons and general polygons with holes in the given two ranges. The result, represented by a set -of general poygon with holes, is inserted into an output container +of general polygon with holes, is inserted into an output container through a given output iterator \ccc{oi}. The output iterator is returned. The value type of the \ccc{OutputIterator} is \ccc{Traits::Polygon_with_holes_2}.} diff --git a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/Bso_join.tex b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/Bso_join.tex index a7401e57c61..057cef5daad 100644 --- a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/Bso_join.tex +++ b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/Bso_join.tex @@ -109,7 +109,7 @@ OutputIterator join(InputIterator begin, InputIterator end, {Computes the union of the general polygons (or general polygons with holes) in the given range. (The value type of the input iterator is used to distinguish between the two.) The result, represented by a set -of general poygon with holes, is inserted into an output container +of general polygon with holes, is inserted into an output container through a given output iterator \ccc{oi}. The output iterator is returned. The value type of the \ccc{OutputIterator} is \ccc{Traits::Polygon_with_holes_2}.} @@ -121,7 +121,7 @@ OutputIterator join(InputIterator1 pgn_begin1, InputIterator1 pgn_end1, OutputIterator oi);} {Computes the union of the general polygons and general polygons with holes in the given two ranges. The result, represented by a set -of general poygon with holes, is inserted into an output container +of general polygon with holes, is inserted into an output container through a given output iterator \ccc{oi}. The output iterator is returned. The value type of the \ccc{OutputIterator} is \ccc{Traits::Polygon_with_holes_2}.} diff --git a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/Bso_symmetric_difference.tex b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/Bso_symmetric_difference.tex index a218fd0bdc9..334452d353f 100644 --- a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/Bso_symmetric_difference.tex +++ b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/Bso_symmetric_difference.tex @@ -119,7 +119,7 @@ polygons with holes) in the given range. A point is contained in the symmetric difference, if and only if it is contained in odd number of input polygons. (The value type of the input iterator is used to distinguish between the two.) The result, represented by a set -of general poygon with holes, is inserted into an output container +of general polygon with holes, is inserted into an output container through a given output iterator \ccc{oi}. The output iterator is returned. The value type of the \ccc{OutputIterator} is \ccc{Traits::Polygon_with_holes_2}.} @@ -134,7 +134,7 @@ OutputIterator symmetric_difference(InputIterator1 pgn_begin1, {Computes the union of the general polygons and general polygons with holes in the given two ranges. A point is contained in the symmetric difference, if and only if it is contained in odd number of -input polygons. The result, represented by a set of general poygon with +input polygons. The result, represented by a set of general polygon with holes, is inserted into an output container through a given output iterator \ccc{oi}. The output iterator is returned. The value type of the \ccc{OutputIterator} is \ccc{Traits::Polygon_with_holes_2}.} diff --git a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/GeneralPolygonSetDcel.tex b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/GeneralPolygonSetDcel.tex index 76b0cdcfd38..c79d1a46dc0 100644 --- a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/GeneralPolygonSetDcel.tex +++ b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/GeneralPolygonSetDcel.tex @@ -57,7 +57,7 @@ defined. \ccCreationVariable{dcel} % ======================= \ccConstructor{Arr_dcel();} - {constructs an empty \dcel\ with one unbouned face.} + {constructs an empty \dcel\ with one unbounded face.} \ccMethod{Face* assign (const Self& other, const Face *uf);}{% assigns the contents of the \ccc{other} \dcel\, whose unbounded face diff --git a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/GeneralPolygonSetTraits_2.tex b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/GeneralPolygonSetTraits_2.tex index bbb405b8a37..b06d5c9d7b0 100644 --- a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/GeneralPolygonSetTraits_2.tex +++ b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/GeneralPolygonSetTraits_2.tex @@ -86,7 +86,7 @@ $x$-monotone curves. It uses the operator\\ \ccMethod{Construct_holes construct_holes_object() const;} {returns a functor that obtains begin/end iterators over a container of holes.} -\ccMethod{Is_unbounded construct_is_unbounded_object();} {returns a functor that detemines if the polygon with holes is unbounded} +\ccMethod{Is_unbounded construct_is_unbounded_object();} {returns a functor that determines if the polygon with holes is unbounded} \ccHasModels diff --git a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/General_polygon_2.tex b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/General_polygon_2.tex index 8e00a60fe4f..da67a1b5b31 100644 --- a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/General_polygon_2.tex +++ b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/General_polygon_2.tex @@ -10,14 +10,14 @@ The class \ccRefName\ models the concept \ccc{GeneralPolygon_2}. It represents a simple general-polygon. It is parameterized with the type \ccc{ArrTraits} that models the concept -\ccc{ArrangementDirectionalXMonotoneTraits}. The latter is a refinment +\ccc{ArrangementDirectionalXMonotoneTraits}. The latter is a refinement of the concept \ccc{ArrangementXMonotoneTraits_2}. In addition to the requirements of the concept \ccc{ArrangementXMonotoneTraits_2}, a model of the concept \ccc{ArrangementDirectionalXMonotoneTraits} must support the following functions: \begin{itemize} \item Given an $x$-monotone curve, construct its opposite curve. -\item Given an $x$-monotone curve, compare its two endpoints lexigroaphically. +\item Given an $x$-monotone curve, compare its two endpoints lexicographically. \end{itemize} This class supports a few convenient operations in addition to the diff --git a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/General_polygon_set_2.tex b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/General_polygon_set_2.tex index f32fc6b2a2d..27a46170d73 100644 --- a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/General_polygon_set_2.tex +++ b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/General_polygon_set_2.tex @@ -188,7 +188,7 @@ void insert(InputIterator1 pgn_begin, InputIterator1 pgn_end, \ccMethod{void complement(const Polygon_set_2 & other);} {computes the complement of \ccc{other}. - \ccVar\ is overriden by the result.} + \ccVar\ is overridden by the result.} % \ccMethod{void complement(const Polygon_2 & pgn);} % {computes the complement of \ccc{pgn}.} @@ -346,7 +346,7 @@ void do_intersect(InputIterator1 pgn_begin, InputIterator1 pgn_end, \ccMethod{bool locate(const Point_2 & p, Polygon_with_holes_2 & pgn);} {obtains a polygon with holes that contains the query point \ccc{p}, if exists, through \ccc{pgn}, and returns \ccc{true}. - Otherwise, returns \ccc{flase}.} + Otherwise, returns \ccc{false}.} \ccMethod{Oriented_side oriented_side(const Point_2 & q);} {returns either the constant \ccc{ON_ORIENTED_BOUNDARY}, diff --git a/CGALimageIO/demo/CGALimageIO/CMakeLists.txt b/CGALimageIO/demo/CGALimageIO/CMakeLists.txt index bae0cdad183..0dbff9bf359 100644 --- a/CGALimageIO/demo/CGALimageIO/CMakeLists.txt +++ b/CGALimageIO/demo/CGALimageIO/CMakeLists.txt @@ -30,13 +30,17 @@ endforeach() find_package(CGAL REQUIRED ImageIO) include( ${CGAL_USE_FILE} ) find_package(VTK QUIET) +find_package(Qt3-patched QUIET) -if(VTK_FOUND) +if(QT3_FOUND AND VTK_FOUND) add_definitions(-DCGAL_USE_VTK) include(${VTK_USE_FILE}) + add_definitions(${QT3_DEFINITIONS}) + if(VTK_USE_QVTK) include_directories( ${VTK_QT_INCLUDE_DIR} ) + include_directories( ${QT3_INCLUDE_DIR} ) add_executable( image_to_vtk_viewer image_to_vtk_viewer.cpp ) add_to_cached_list( CGAL_EXECUTABLE_TARGETS image_to_vtk_viewer ) @@ -48,12 +52,16 @@ if(VTK_FOUND) vtkCommon ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ${VTK_QT_QT_LIBRARY} + ${QT3_LIBRARIES} ) else(VTK_USE_QVTK) message(STATUS "NOTICE: This demo needs QVTK, and will not be compiled.") endif(VTK_USE_QVTK) -else(VTK_FOUND) - - message(STATUS "NOTICE: This demo needs VTK, and will not be compiled.") - -endif(VTK_FOUND) +else() + if(NOT VTK_FOUND) + message(STATUS "NOTICE: This demo needs VTK, and will not be compiled.") + endif() + if(NOT QT3_FOUND) + message(STATUS "NOTICE: This demo needs Qt3, and will not be compiled.") + endif() +endif() diff --git a/CGALimageIO/include/CGAL/ImageIO.h b/CGALimageIO/include/CGAL/ImageIO.h index a6a1538650b..78e08fbca59 100644 --- a/CGALimageIO/include/CGAL/ImageIO.h +++ b/CGALimageIO/include/CGAL/ImageIO.h @@ -21,7 +21,7 @@ #ifndef IMAGEIO_H #define IMAGEIO_H -#include +#include #include diff --git a/Circular_kernel_2/doc_tex/Circular_kernel_2_ref/Polynomial_for_circles_2_2.tex b/Circular_kernel_2/doc_tex/Circular_kernel_2_ref/Polynomial_for_circles_2_2.tex index 56263c1916f..19c48c36aef 100644 --- a/Circular_kernel_2/doc_tex/Circular_kernel_2_ref/Polynomial_for_circles_2_2.tex +++ b/Circular_kernel_2/doc_tex/Circular_kernel_2_ref/Polynomial_for_circles_2_2.tex @@ -8,7 +8,7 @@ \ccSeeAlso -\ccRefIdfierPage{CGAL::Root_of_2}\\ +\ccRefIdfierPage{CGAL::Sqrt_extension}\\ \ccRefIdfierPage{AlgebraicKernelForCircles} \end{ccRefClass} diff --git a/Circular_kernel_2/doc_tex/Circular_kernel_2_ref/intro.tex b/Circular_kernel_2/doc_tex/Circular_kernel_2_ref/intro.tex index 9cdbb1ed4fa..2ebb8a6f757 100644 --- a/Circular_kernel_2/doc_tex/Circular_kernel_2_ref/intro.tex +++ b/Circular_kernel_2/doc_tex/Circular_kernel_2_ref/intro.tex @@ -158,7 +158,7 @@ \subsubsection*{Roots of Polynomials} -\ccRefIdfierPage{CGAL::Root_of_2}\\ +\ccRefIdfierPage{CGAL::Sqrt_extension}\\ \ccRefIdfierPage{CGAL::Root_for_circles_2_2} \ccRefIdfierPage{CGAL::Root_of_traits_2} diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_type_equality_wrapper.h b/Circular_kernel_2/include/CGAL/Circular_kernel_type_equality_wrapper.h index dd236732e46..7fe1ce6c06b 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_type_equality_wrapper.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_type_equality_wrapper.h @@ -31,7 +31,7 @@ #include #include #include -#include +#include namespace CGAL { @@ -49,13 +49,10 @@ struct Circular_kernel_type_equality_wrapper typedef CGAL::Line_arc_2 Line_arc_2; typedef CGAL::Circular_arc_point_2 Circular_arc_point_2; - //typedef CGAL::Root_of_2 Root_of_2; - - //Something has to be done with these 3, maybe a lazy Algebraic kernel? + //Something has to be done with these 3, maybe a lazy Algebraic kernel? //typedef Polynomial_for_circles_2_2 Polynomial_for_circles_2_2; //typedef Polynomial_1_2 Polynomial_1_2; - //typedef Root_of_2 Root_of_2; }; } //namespace CGAL diff --git a/Circular_kernel_2/include/CGAL/Lazy_circular_kernel_2.h b/Circular_kernel_2/include/CGAL/Lazy_circular_kernel_2.h index f4129f036c0..42bc808ba36 100644 --- a/Circular_kernel_2/include/CGAL/Lazy_circular_kernel_2.h +++ b/Circular_kernel_2/include/CGAL/Lazy_circular_kernel_2.h @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include diff --git a/Circular_kernel_3/doc_tex/Circular_kernel_3_ref/intro.tex b/Circular_kernel_3/doc_tex/Circular_kernel_3_ref/intro.tex index 84ff7f3877e..bd54d642e29 100644 --- a/Circular_kernel_3/doc_tex/Circular_kernel_3_ref/intro.tex +++ b/Circular_kernel_3/doc_tex/Circular_kernel_3_ref/intro.tex @@ -159,7 +159,7 @@ \subsubsection*{Roots of Polynomials} -\ccRefIdfierPage{CGAL::Root_of_2}\\ +\ccRefIdfierPage{CGAL::Sqrt_extension}\\ \ccRefIdfierPage{CGAL::Root_for_spheres_2_3} \ccRefIdfierPage{CGAL::Root_of_traits_2} diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_circle_3.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_circle_3.h index ccbf8b2f265..8920b764d01 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_circle_3.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_circle_3.h @@ -71,7 +71,7 @@ namespace CGAL { return CGAL::THREADED; } - typename SK::Root_of_2 radius=CGAL::make_root_of_2(typename SK::FT(1),typename SK::FT(0),-sphere.squared_radius(),false); + typename SK::Root_of_2 radius=CGAL::make_sqrt(sphere.squared_radius()); Circular_arc_point_3 north_pole( Root_for_spheres_2_3(sphere.center().x(),sphere.center().y(),sphere.center().z()+radius) ); Circular_arc_point_3 south_pole( Root_for_spheres_2_3(sphere.center().x(),sphere.center().y(),sphere.center().z()-radius) ); @@ -163,7 +163,7 @@ namespace CGAL { typename SK::Vector_3 ortho=circle.center()-sphere.center(); CGAL_kernel_precondition(ortho.z()!=0); bool is_north_pole=ortho.z()>0; - typename SK::Root_of_2 radius = make_root_of_2(typename SK::FT(1),typename SK::FT(0),-sphere.squared_radius(),!is_north_pole); + typename SK::Root_of_2 radius = (is_north_pole?1:-1)* make_sqrt(sphere.squared_radius()); typename SK::Circular_arc_point_3 source_target( typename SK::Algebraic_kernel::Root_for_spheres_2_3( sphere.center().x(), diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_circular_arc_3.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_circular_arc_3.h index b01b7719658..92e6b8a0d89 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_circular_arc_3.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_circular_arc_3.h @@ -364,7 +364,7 @@ namespace CGAL { return true; if (type==POLAR){ bool circle_contains_north = arc.supporting_circle().center().z() > sphere.center().z(); - typename SK::Root_of_2 radius=make_root_of_2(typename SK::FT(0),typename SK::FT(1),sphere.squared_radius()); + typename SK::Root_of_2 radius=make_sqrt(sphere.squared_radius()); typename SK::Circular_arc_point_3 pole ( typename SK::Algebraic_kernel::Root_for_spheres_2_3( sphere.center().x(), sphere.center().y(), @@ -410,7 +410,7 @@ namespace CGAL { case THREADED: case POLAR:{ bool circle_contains_north = arc.supporting_circle().center().z() > sphere.center().z(); - typename SK::Root_of_2 radius=make_root_of_2(typename SK::FT(0),typename SK::FT(1),sphere.squared_radius()); + typename SK::Root_of_2 radius=make_sqrt(sphere.squared_radius()); typename SK::Circular_arc_point_3 pole ( typename SK::Algebraic_kernel::Root_for_spheres_2_3( sphere.center().x(), sphere.center().y(), diff --git a/Circular_kernel_3/include/CGAL/Spherical_kernel_type_equality_wrapper.h b/Circular_kernel_3/include/CGAL/Spherical_kernel_type_equality_wrapper.h index 0f5decb9c06..bf6de766ccf 100644 --- a/Circular_kernel_3/include/CGAL/Spherical_kernel_type_equality_wrapper.h +++ b/Circular_kernel_3/include/CGAL/Spherical_kernel_type_equality_wrapper.h @@ -43,7 +43,6 @@ struct Spherical_kernel_type_equality_wrapper typedef CGAL::Circular_arc_point_3 Circular_arc_point_3; typedef CGAL::Circular_arc_3 Circular_arc_3; typedef CGAL::Line_arc_3 Line_arc_3; - //~ typedef CGAL::Root_of_2 Root_of_2; }; } diff --git a/Circular_kernel_3/test/Circular_kernel_3/include/CGAL/_test_sphere_predicates.h b/Circular_kernel_3/test/Circular_kernel_3/include/CGAL/_test_sphere_predicates.h index ef7401bbbde..2f1e72edc96 100644 --- a/Circular_kernel_3/test/Circular_kernel_3/include/CGAL/_test_sphere_predicates.h +++ b/Circular_kernel_3/test/Circular_kernel_3/include/CGAL/_test_sphere_predicates.h @@ -325,7 +325,7 @@ void _test_has_on_predicate(SK sk) { std::make_pair(Polynomial_for_spheres_2_3(0,0,0,1), Polynomial_1_3(1,1,1,0)); Circle_3 c_2 = theConstruct_circle_3(pc2); - Root_of_2 r_1_1_c_2 = CGAL::make_root_of_2(FT(FT(1) / FT(2)),FT(0),FT(0)); + Root_of_2 r_1_1_c_2 = FT(FT(1) / FT(2)); Root_of_2 r_1_2_c_2 = CGAL::make_root_of_2(-FT(FT(1) / FT(4)),-FT(FT(1) / FT(4)),FT(5)); Root_of_2 r_1_3_c_2 = CGAL::make_root_of_2(-FT(FT(1) / FT(4)),FT(FT(1) / FT(4)),FT(5)); Root_for_spheres_2_3 r_1_c_2 = Root_for_spheres_2_3(r_1_1_c_2,r_1_2_c_2,r_1_3_c_2); diff --git a/Convex_hull_2/doc_tex/Convex_hull_2_ref/Convex_hull_projective_xy_traits_2.tex b/Convex_hull_2/doc_tex/Convex_hull_2_ref/Convex_hull_projective_xy_traits_2.tex index a510892a702..5449d6d4733 100644 --- a/Convex_hull_2/doc_tex/Convex_hull_2_ref/Convex_hull_projective_xy_traits_2.tex +++ b/Convex_hull_2/doc_tex/Convex_hull_2_ref/Convex_hull_projective_xy_traits_2.tex @@ -12,12 +12,13 @@ \ccIndexTraitsClassBegin{Convex_hull_projective_xy_traits_2}{}{convex hull, 2D} -\begin{ccDeprecated} + The functionality of this class has been generalized to other packages than 2D convex hulls. The more general class \ccc{Projection_traits_xy_3} can be found in the 2D and 3D Linear Geometric Kernel. Note that the deprecated class was templated by a point class, whereas the new class is templated by a geometric kernel. -\end{ccDeprecated} + +\begin{ccDeprecated} \ccDefinition @@ -85,6 +86,7 @@ $xy$ plane (\textit{i.e.}, by ignoring the $z$ coordinate). \ccIndexTraitsClassEnd \ccAutoIndexingOff +\end{ccDeprecated} \end{ccRefClass} \ccAutoIndexingOn diff --git a/Convex_hull_2/doc_tex/Convex_hull_2_ref/Convex_hull_projective_xz_traits_2.tex b/Convex_hull_2/doc_tex/Convex_hull_2_ref/Convex_hull_projective_xz_traits_2.tex index 342f6f2f675..0455b2c3605 100644 --- a/Convex_hull_2/doc_tex/Convex_hull_2_ref/Convex_hull_projective_xz_traits_2.tex +++ b/Convex_hull_2/doc_tex/Convex_hull_2_ref/Convex_hull_projective_xz_traits_2.tex @@ -12,13 +12,12 @@ \ccIndexTraitsClassBegin{Convex_hull_projective_xz_traits_2}{}{convex hull, 2D} -\begin{ccDeprecated} The functionality of this class has been generalized to other packages than 2D convex hulls. The more general class \ccc{Projection_traits_xy_3} can be found in the 2D and 3D Linear Geometric Kernel. Note that the deprecated class was templated by a point class, whereas the new class is templated by a geometric kernel. -\end{ccDeprecated} +\begin{ccDeprecated} \ccDefinition The class \ccRefName\ serves as a traits class for all the two-dimensional @@ -83,6 +82,7 @@ _distance_to_line_2}{} \ccIndexTraitsClassEnd \ccAutoIndexingOff +\end{ccDeprecated} \end{ccRefClass} \ccAutoIndexingOn diff --git a/Convex_hull_2/doc_tex/Convex_hull_2_ref/Convex_hull_projective_yz_traits_2.tex b/Convex_hull_2/doc_tex/Convex_hull_2_ref/Convex_hull_projective_yz_traits_2.tex index a230ba16f4b..ce5ec5cecfb 100644 --- a/Convex_hull_2/doc_tex/Convex_hull_2_ref/Convex_hull_projective_yz_traits_2.tex +++ b/Convex_hull_2/doc_tex/Convex_hull_2_ref/Convex_hull_projective_yz_traits_2.tex @@ -12,13 +12,12 @@ \ccIndexTraitsClassBegin{Convex_hull_projective_yz_traits_2}{}{convex hull, 2D} -\begin{ccDeprecated} The functionality of this class has been generalized to other packages than 2D convex hulls. The more general class \ccc{Projection_traits_xy_3} can be found in the 2D and 3D Linear Geometric Kernel. Note that the deprecated class was templated by a point class, whereas the new class is templated by a geometric kernel. -\end{ccDeprecated} +\begin{ccDeprecated} \ccDefinition The class \ccRefName\ serves as a traits class for all the two-dimensional @@ -85,6 +84,7 @@ _distance_to_line_2}{} \ccIndexTraitsClassEnd \ccAutoIndexingOff +\end{ccDeprecated} \end{ccRefClass} \ccAutoIndexingOn diff --git a/Convex_hull_2/include/CGAL/Convex_hull_2/ch_akl_toussaint_impl.h b/Convex_hull_2/include/CGAL/Convex_hull_2/ch_akl_toussaint_impl.h index 7e75eee7c84..76f7556f02e 100644 --- a/Convex_hull_2/include/CGAL/Convex_hull_2/ch_akl_toussaint_impl.h +++ b/Convex_hull_2/include/CGAL/Convex_hull_2/ch_akl_toussaint_impl.h @@ -98,9 +98,9 @@ ch_akl_toussaint(ForwardIterator first, ForwardIterator last, std::sort( successor(region2.begin() ), region2.end(), ch_traits.less_xy_2_object() ); std::sort( successor(region3.begin() ), region3.end(), - bind(ch_traits.less_xy_2_object(), _2, _1) ); + boost::bind(ch_traits.less_xy_2_object(), _2, _1) ); std::sort( successor(region4.begin() ), region4.end(), - bind(ch_traits.less_xy_2_object(), _2, _1) ); + boost::bind(ch_traits.less_xy_2_object(), _2, _1) ); if (! equal_points(*w,*s) ) { diff --git a/Convex_hull_d/doc_tex/Convex_hull_d_ref/Delaunay_d.tex b/Convex_hull_d/doc_tex/Convex_hull_d_ref/Delaunay_d.tex index da2ec05c72b..87afeef28e5 100644 --- a/Convex_hull_d/doc_tex/Convex_hull_d_ref/Delaunay_d.tex +++ b/Convex_hull_d/doc_tex/Convex_hull_d_ref/Delaunay_d.tex @@ -246,7 +246,7 @@ point set $S$ and the convex hull of \ccc{lift(S)}: The nearest site Delaunay triangulation is the projection of the lower hull and the furthest site Delaunay triangulation is the upper hull. For implementation details we refer the reader to the implementation -report available from the CGAL server. +report available from the \cgal\ server. The space requirement is the same as for convex hulls. The time requirement for an insert is the time to insert the lifted point diff --git a/Developers_manual/doc_tex/Developers_manual/directory_structure.tex b/Developers_manual/doc_tex/Developers_manual/directory_structure.tex index 39d92d47d65..b086f4c5961 100644 --- a/Developers_manual/doc_tex/Developers_manual/directory_structure.tex +++ b/Developers_manual/doc_tex/Developers_manual/directory_structure.tex @@ -110,10 +110,10 @@ The directory structure of a package named Package should be as follows: instance, GMP goes here when using the Windows installer. The average package won't have this directory. \item[{\tt scripts}]\index{scripts directory@{\tt scripts} - directory} contains scripts that are of interest to CGAL users. + directory} contains scripts that are of interest to \cgal\ users. \item[{\tt developer\_scripts}]\index{developers\_scripts directory@{\tt developers\_scripts} directory} contains - scripts that are of interest to CGAL developers. This directory + scripts that are of interest to \cgal\ developers. This directory is included in internal releases only, not in public releases. \item[{\tt dont\_submit}]% \ccIndexMainItem{\tt dont\_submit} specifies files and directories @@ -268,7 +268,7 @@ the basic library can have the following documentation. | |--- *.tex | - +--- *.((ps)|(eps)|(pdf)|(gif)|(jpg)|(png)) + +--- *.((pdf)|(gif)|(jpg)|(png)) doc_tex/Optimisation_ref/ |--- main.tex @@ -277,7 +277,7 @@ the basic library can have the following documentation. | |--- *.tex | - +--- *.((ps)|(eps)|(pdf)|(gif)|(jpg)|(png)) + +--- *.((pdf)|(gif)|(jpg)|(png)) \end{verbatim} @@ -300,9 +300,7 @@ the basic library can have the following documentation. contained in this package in a systematic way. \item[{\tt *.tex}] -- the source files for the Users' and Reference Manual that are input by {\tt main.tex} - \item[{\tt *.((ps)|(eps))}] -- the PostScript pictures included in - the PostScript documentation. - \item[{\tt *.pdf}] -- the PDF pictures included in + \item[{\tt *.pdf}] -- the PDF pictures included in the PDF documentation. \item[{\tt *.((gif)|(jpg)|(png))}] -- the raster images included in the HTML documentation. diff --git a/Developers_manual/doc_tex/Developers_manual/memory_management.tex b/Developers_manual/doc_tex/Developers_manual/memory_management.tex index 0ea5128f482..79da282c295 100644 --- a/Developers_manual/doc_tex/Developers_manual/memory_management.tex +++ b/Developers_manual/doc_tex/Developers_manual/memory_management.tex @@ -44,7 +44,7 @@ The macro \ccc{CGAL_ALLOCATOR}\ccIndexMainItem{\ccFont CGAL_ALLOCATOR} is defined in the file \ccc{} to be the standard allocator from \ccc{}. However, the user can redefine it, for example, if \leda\ is present, -he can define it (before including any CGAL header file) this way : +he can define it (before including any \cgal\ header file) this way : \begin{verbatim} #include diff --git a/Developers_manual/doc_tex/Developers_manual/namespaces.tex b/Developers_manual/doc_tex/Developers_manual/namespaces.tex index fa5ff42c67b..b6ee43aa8d8 100644 --- a/Developers_manual/doc_tex/Developers_manual/namespaces.tex +++ b/Developers_manual/doc_tex/Developers_manual/namespaces.tex @@ -105,7 +105,7 @@ Requirements: (including namespaces nested in namespace \ccc{CGAL}). \item explicitly prefix calls to template functions of CGAL (such as \ccc{square}, \ccc{sign}, \ccc{abs}, \dots) by \ccc{CGAL::} -to ensure the functions used are the one from CGAL and not one from another +to ensure the functions used are the one from \cgal\ and not one from another library. If you want to allow an optimized function from another library to be used, then you should not qualify the call and document it explicitly (if appropriate). diff --git a/Developers_manual/doc_tex/Developers_manual/testing.tex b/Developers_manual/doc_tex/Developers_manual/testing.tex index 8d838ab040f..92f5af20563 100644 --- a/Developers_manual/doc_tex/Developers_manual/testing.tex +++ b/Developers_manual/doc_tex/Developers_manual/testing.tex @@ -46,7 +46,7 @@ It is strongly recommended for a test suite of a package to should be called at least once. (See Section~\ref{sec:gcov} for a description of a tool you can use to test for code coverage.) \item Use more than one instantiation of templated functions or classes. -\item A lot of classes in CGAL can be parametrized by traits classes, so +\item A lot of classes in \cgal\ can be parametrized by traits classes, so that they are usable with different kernels. In such cases more than one kernel should be used for testing. \item Use pre- and postcondition checkers wherever it is possible in the diff --git a/Developers_manual/doc_tex/Developers_manual/tools.tex b/Developers_manual/doc_tex/Developers_manual/tools.tex index d36a2ca44ce..9664ec3efcc 100644 --- a/Developers_manual/doc_tex/Developers_manual/tools.tex +++ b/Developers_manual/doc_tex/Developers_manual/tools.tex @@ -37,7 +37,7 @@ Most of these scripts can be in at least two places. The script \ccAnchor{https://gforge.inria.fr/plugins/scmsvn/viewcvs.php/trunk/Scripts/developer_scripts/create_new_release?root=cgal&view=markup} -{{\tt create\_new\_release}} builds a tarball of CGAL from an SVN working +{{\tt create\_new\_release}} builds a tarball of \cgal\ from an SVN working copy of the trunk (or a branch). The command \begin{verse} diff --git a/Envelope_3/include/CGAL/Envelope_3/Envelope_element_visitor_3.h b/Envelope_3/include/CGAL/Envelope_3/Envelope_element_visitor_3.h index 73be7773928..c503e4e6955 100644 --- a/Envelope_3/include/CGAL/Envelope_3/Envelope_element_visitor_3.h +++ b/Envelope_3/include/CGAL/Envelope_3/Envelope_element_visitor_3.h @@ -632,8 +632,9 @@ public: original_src->point())) || (original_src->is_at_open_boundary() && is_min_end_at_inf)) { - overlaps++; source_is_special = true; + if (split_points.front().third == true) + overlaps++; } // check if target is a special vertex, by checking the last point in diff --git a/Envelope_3/test/Envelope_3/data/triangles/edge_bug.cin b/Envelope_3/test/Envelope_3/data/triangles/edge_bug.cin new file mode 100644 index 00000000000..5f08c2c4af4 --- /dev/null +++ b/Envelope_3/test/Envelope_3/data/triangles/edge_bug.cin @@ -0,0 +1,14 @@ +3 + +0 0 0 +3 0 3 +0 -3 3 + +1 -2 0 +-2 -2 3 +1 1 3 + +1 2 0 +4 2 3 +1 -1 3 + diff --git a/Envelope_3/test/Envelope_3/data/triangles/edge_bug_all.cin b/Envelope_3/test/Envelope_3/data/triangles/edge_bug_all.cin new file mode 100644 index 00000000000..9195c47588c --- /dev/null +++ b/Envelope_3/test/Envelope_3/data/triangles/edge_bug_all.cin @@ -0,0 +1,21 @@ +16 + +50 -100 0 1050 -100 1000 50 900 1000 +50 -100 0 1050 -100 1000 50 -1100 1000 +50 -100 0 -950 -100 1000 50 -1100 1000 +50 -100 0 -950 -100 1000 50 900 1000 + +0 0 0 1000 0 1000 0 1000 1000 +0 0 0 1000 0 1000 0 -1000 1000 +0 0 0 -1000 0 1000 0 -1000 1000 +0 0 0 -1000 0 1000 0 1000 1000 + +50 100 0 1050 100 1000 50 1100 1000 +50 100 0 1050 100 1000 50 -900 1000 +50 100 0 -950 100 1000 50 -900 1000 +50 100 0 -950 100 1000 50 1100 1000 + +-50 100 0 950 100 1000 -50 1100 1000 +-50 100 0 950 100 1000 -50 -900 1000 +-50 100 0 -1050 100 1000 -50 -900 1000 +-50 100 0 -1050 100 1000 -50 1100 1000 diff --git a/Envelope_3/test/Envelope_3/triangles_test.cmd b/Envelope_3/test/Envelope_3/triangles_test.cmd index 30999b107fd..dacc3853536 100644 --- a/Envelope_3/test/Envelope_3/triangles_test.cmd +++ b/Envelope_3/test/Envelope_3/triangles_test.cmd @@ -29,4 +29,7 @@ ./data/triangles/grid_inter_tri_const_envelope_40.cin ./data/triangles/random_50_small_0.5.in ./data/triangles/random_50_small_1.in +./data/triangles/edge_bug.cin +./data/triangles/edge_bug_all.cin + diff --git a/Filtered_kernel/include/CGAL/Lazy.h b/Filtered_kernel/include/CGAL/Lazy.h index 75a895c098e..f59b27d316c 100644 --- a/Filtered_kernel/include/CGAL/Lazy.h +++ b/Filtered_kernel/include/CGAL/Lazy.h @@ -1393,9 +1393,9 @@ public: template < typename L1> result_type - operator()(const L1& l1, int i) const + operator()(const L1& l1, int) const { - return result_type(&l1,i); + return result_type(&l1,2); } }; @@ -1422,9 +1422,9 @@ public: template < typename L1> result_type - operator()(const L1& l1, int i) const + operator()(const L1& l1, int) const { - return result_type(&l1,i); + return result_type(&l1,3); } }; diff --git a/GraphicsView/demo/Bounding_volumes/Bounding_volumes.cpp b/GraphicsView/demo/Bounding_volumes/Bounding_volumes.cpp index 0e676fecfca..0715544362d 100644 --- a/GraphicsView/demo/Bounding_volumes/Bounding_volumes.cpp +++ b/GraphicsView/demo/Bounding_volumes/Bounding_volumes.cpp @@ -243,7 +243,7 @@ MainWindow::update() CGAL::Qt::Converter convert; - if(this->actionShowPCenter->isChecked()){ + if(this->actionShowPCenter->isChecked() && convex_hull.size()>=3){ for(std::size_t i=0; i< P; i++){ p_center[i]->setRect(convert(p_center_iso_rectangle[i])); p_center[i]->show(); @@ -290,8 +290,8 @@ MainWindow::update() void MainWindow::update_from_points() { - convex_hull.clear(); - CGAL::convex_hull_2(points.begin(), points.end(), std::back_inserter(convex_hull)); + convex_hull.clear(); + CGAL::convex_hull_2(points.begin(), points.end(), std::back_inserter(convex_hull)); min_rectangle.clear(); CGAL::min_rectangle_2(convex_hull.vertices_begin(), convex_hull.vertices_end(), std::back_inserter(min_rectangle)); @@ -305,7 +305,6 @@ MainWindow::update_from_points() CGAL::rectangular_p_center_2 (points.begin(), points.end(), std::back_inserter(center), radius, P); Vector_2 rvec(radius, radius); - CGAL::Qt::Converter convert; for(std::size_t i = 0; i < center.size(); i++){ p_center_iso_rectangle[i] = Iso_rectangle_2(center[i]-rvec, center[i]+rvec); } @@ -336,12 +335,13 @@ MainWindow::processInput(CGAL::Object o) std::vector center; double radius; + if (points.size()>=P){ + CGAL::rectangular_p_center_2 (points.begin(), points.end(), std::back_inserter(center), radius, P); + Vector_2 rvec(radius, radius); - CGAL::rectangular_p_center_2 (points.begin(), points.end(), std::back_inserter(center), radius, P); - Vector_2 rvec(radius, radius); - - for(std::size_t i=0; i < center.size(); i++){ - p_center_iso_rectangle[i] = Iso_rectangle_2(center[i]-rvec, center[i]+rvec); + for(std::size_t i=0; i < center.size(); i++){ + p_center_iso_rectangle[i] = Iso_rectangle_2(center[i]-rvec, center[i]+rvec); + } } } emit(changed()); diff --git a/GraphicsView/demo/L1_Voronoi_diagram_2/L1_voronoi_diagram_2.cpp b/GraphicsView/demo/L1_Voronoi_diagram_2/L1_voronoi_diagram_2.cpp index e1c424896cf..ac209c4bf79 100644 --- a/GraphicsView/demo/L1_Voronoi_diagram_2/L1_voronoi_diagram_2.cpp +++ b/GraphicsView/demo/L1_Voronoi_diagram_2/L1_voronoi_diagram_2.cpp @@ -1,3 +1,23 @@ +// Copyright (c) 2008 GeometryFactory Sarl (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you may redistribute it under +// the terms of the Q Public License version 1.0. +// See the file LICENSE.QPL distributed with CGAL. +// +// 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) : Ophir Setter +// + // CGAL headers #include #include @@ -35,8 +55,6 @@ typedef CGAL::L1_voronoi_traits_2 Traits_3; typedef Traits_3::Surface_3 Surface_3; typedef CGAL::Envelope_diagram_2 Envelope_diagram_2; -// Ask Efi how to get rid of this. I was not successful in defining a new -// << operator that does not output a string for Arr_linear_object namespace CGAL { template Qt::PainterOstream& diff --git a/GraphicsView/demo/Segment_Delaunay_graph_2/Segment_voronoi_2.cpp b/GraphicsView/demo/Segment_Delaunay_graph_2/Segment_voronoi_2.cpp index ffbe06b2276..1cc529b4227 100644 --- a/GraphicsView/demo/Segment_Delaunay_graph_2/Segment_voronoi_2.cpp +++ b/GraphicsView/demo/Segment_Delaunay_graph_2/Segment_voronoi_2.cpp @@ -353,7 +353,7 @@ MainWindow::on_actionSaveConstraints_triggered() void -MainWindow::saveConstraints(QString fileName) +MainWindow::saveConstraints(QString /*fileName*/) { QMessageBox::warning(this, tr("saveConstraints"), diff --git a/GraphicsView/demo/Triangulation_2/Constrained_Delaunay_triangulation_2.cpp b/GraphicsView/demo/Triangulation_2/Constrained_Delaunay_triangulation_2.cpp index 967a04e542c..af3a4f973d6 100644 --- a/GraphicsView/demo/Triangulation_2/Constrained_Delaunay_triangulation_2.cpp +++ b/GraphicsView/demo/Triangulation_2/Constrained_Delaunay_triangulation_2.cpp @@ -155,6 +155,7 @@ discoverComponent(const CDT & ct, void discoverComponents(const CDT & ct) { + if (ct.dimension()!=2) return; int index = 0; std::list border; discoverComponent(ct, ct.infinite_face(), index++, border); diff --git a/GraphicsView/demo/Triangulation_2/include/CGAL/Lipschitz_sizing_field_criteria_2.h b/GraphicsView/demo/Triangulation_2/include/CGAL/Lipschitz_sizing_field_criteria_2.h index 8085c29c27b..ad4da9f21bf 100644 --- a/GraphicsView/demo/Triangulation_2/include/CGAL/Lipschitz_sizing_field_criteria_2.h +++ b/GraphicsView/demo/Triangulation_2/include/CGAL/Lipschitz_sizing_field_criteria_2.h @@ -24,21 +24,27 @@ public: protected: Sizing_field* sizing_field; + + typedef typename CDT::Geom_traits Geom_traits; + Geom_traits traits; public: typedef Delaunay_mesh_criteria_2 Base; Lipschitz_sizing_field_criteria_2(const double aspect_bound = 0.125, - Sizing_field* sf = 0) - : Base(aspect_bound), sizing_field(sf) + Sizing_field* sf = 0, + const Geom_traits& traits = Geom_traits()) + : Base(aspect_bound), sizing_field(sf), traits(traits) {} Lipschitz_sizing_field_criteria_2& operator =(const Lipschitz_sizing_field_criteria_2& c) { + if(&c == this) return *this; this->sizing_field = c.sizing_field; + this->traits = c.traits; return *this; - } + } inline const Sizing_field* sizing_field_object() { @@ -81,8 +87,9 @@ public: typedef typename Base::Is_bad::Point_2 Point_2; - Is_bad(const double aspect_bound, Sizing_field* sf) - : Base::Is_bad(aspect_bound), sizing_field(sf) + Is_bad(const double aspect_bound, Sizing_field* sf, + const Geom_traits& traits) + : Base::Is_bad(aspect_bound, traits), sizing_field(sf) { } @@ -189,7 +196,7 @@ public: Is_bad is_bad_object() const { - return Is_bad(this->bound(), sizing_field); + return Is_bad(this->bound(), sizing_field, traits); } }; diff --git a/GraphicsView/include/CGAL/Qt/AlphaShapeGraphicsItem.h b/GraphicsView/include/CGAL/Qt/AlphaShapeGraphicsItem.h index 170bf328b8e..7fad0319670 100644 --- a/GraphicsView/include/CGAL/Qt/AlphaShapeGraphicsItem.h +++ b/GraphicsView/include/CGAL/Qt/AlphaShapeGraphicsItem.h @@ -277,8 +277,8 @@ AlphaShapeGraphicsItem::paintVertex(typename T::Vertex_handle vh) template void AlphaShapeGraphicsItem::paint(QPainter *painter, - const QStyleOptionGraphicsItem *option, - QWidget * widget) + const QStyleOptionGraphicsItem */*option*/, + QWidget * /*widget*/) { painter->setPen(this->edgesPen()); // painter->drawRect(boundingRect()); diff --git a/GraphicsView/include/CGAL/Qt/ApolloniusGraphGraphicsItem.h b/GraphicsView/include/CGAL/Qt/ApolloniusGraphGraphicsItem.h index f51d89ae8cc..3d9d1ee534b 100644 --- a/GraphicsView/include/CGAL/Qt/ApolloniusGraphGraphicsItem.h +++ b/GraphicsView/include/CGAL/Qt/ApolloniusGraphGraphicsItem.h @@ -99,7 +99,7 @@ ApolloniusGraphGraphicsItem::boundingRect() const template void -ApolloniusGraphGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *w) +ApolloniusGraphGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget */*w*/) { painter->setPen(this->sitesPen()); diff --git a/GraphicsView/include/CGAL/Qt/CircularArcGraphicsItem.h b/GraphicsView/include/CGAL/Qt/CircularArcGraphicsItem.h index 19095e1af71..f6754ae8061 100644 --- a/GraphicsView/include/CGAL/Qt/CircularArcGraphicsItem.h +++ b/GraphicsView/include/CGAL/Qt/CircularArcGraphicsItem.h @@ -123,8 +123,8 @@ CircularArcGraphicsItem::boundingRect() const template void CircularArcGraphicsItem::paint(QPainter *painter, - const QStyleOptionGraphicsItem *option, - QWidget * widget) + const QStyleOptionGraphicsItem */*option*/, + QWidget * /*widget*/) { painter->setPen(this->edgesPen()); painterostream = PainterOstream(painter); diff --git a/GraphicsView/include/CGAL/Qt/GraphicsViewPolylineInput.h b/GraphicsView/include/CGAL/Qt/GraphicsViewPolylineInput.h index 5ec85826447..9d763cca956 100644 --- a/GraphicsView/include/CGAL/Qt/GraphicsViewPolylineInput.h +++ b/GraphicsView/include/CGAL/Qt/GraphicsViewPolylineInput.h @@ -95,7 +95,7 @@ protected: std::list points; Converter convert; convert(points, this->polygon); - if(closed_){ + if(closed_ && points.size()>2){ points.push_back(points.front()); } emit(generate(CGAL::make_object(points))); diff --git a/GraphicsView/include/CGAL/Qt/LineGraphicsItem.h b/GraphicsView/include/CGAL/Qt/LineGraphicsItem.h index 1ae20ad1cdb..e0aba5d7e7b 100644 --- a/GraphicsView/include/CGAL/Qt/LineGraphicsItem.h +++ b/GraphicsView/include/CGAL/Qt/LineGraphicsItem.h @@ -112,8 +112,8 @@ LineGraphicsItem::boundingRect() const template void LineGraphicsItem::paint(QPainter *painter, - const QStyleOptionGraphicsItem *option, - QWidget * widget) + const QStyleOptionGraphicsItem */*option*/, + QWidget * /*widget*/) { painter->setPen(this->Pen()); painterostream = PainterOstream(painter, boundingRect()); diff --git a/GraphicsView/include/CGAL/Qt/PointsGraphicsItem.h b/GraphicsView/include/CGAL/Qt/PointsGraphicsItem.h index 36191db4241..189591b1393 100644 --- a/GraphicsView/include/CGAL/Qt/PointsGraphicsItem.h +++ b/GraphicsView/include/CGAL/Qt/PointsGraphicsItem.h @@ -112,8 +112,8 @@ PointsGraphicsItem

::boundingRect() const template void PointsGraphicsItem

::paint(QPainter *painter, - const QStyleOptionGraphicsItem *option, - QWidget * widget) + const QStyleOptionGraphicsItem */*option*/, + QWidget * /*widget*/) { if(drawVertices()) { Converter convert; diff --git a/GraphicsView/include/CGAL/Qt/PointsInKdTreeGraphicsItem.h b/GraphicsView/include/CGAL/Qt/PointsInKdTreeGraphicsItem.h index a16c3ddee6b..2dc14773ccb 100644 --- a/GraphicsView/include/CGAL/Qt/PointsInKdTreeGraphicsItem.h +++ b/GraphicsView/include/CGAL/Qt/PointsInKdTreeGraphicsItem.h @@ -150,7 +150,7 @@ template void PointsInKdTreeGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, - QWidget * widget) + QWidget * /*widget*/) { Iso_rectangle_2 isor = convert(option->exposedRect); Fuzzy_iso_box range(isor.vertex(0), isor.vertex(2)); diff --git a/GraphicsView/include/CGAL/Qt/PolygonGraphicsItem.h b/GraphicsView/include/CGAL/Qt/PolygonGraphicsItem.h index d601de49f32..0b8c47a9dd6 100644 --- a/GraphicsView/include/CGAL/Qt/PolygonGraphicsItem.h +++ b/GraphicsView/include/CGAL/Qt/PolygonGraphicsItem.h @@ -131,8 +131,8 @@ PolygonGraphicsItem

::boundingRect() const template void PolygonGraphicsItem

::paint(QPainter *painter, - const QStyleOptionGraphicsItem *option, - QWidget * widget) + const QStyleOptionGraphicsItem */*option*/, + QWidget * /*widget*/) { painter->setPen(this->edgesPen()); painterostream = PainterOstream(painter); diff --git a/GraphicsView/include/CGAL/Qt/PolygonWithHolesGraphicsItem.h b/GraphicsView/include/CGAL/Qt/PolygonWithHolesGraphicsItem.h index cb43711ea33..e6806f5e9fc 100644 --- a/GraphicsView/include/CGAL/Qt/PolygonWithHolesGraphicsItem.h +++ b/GraphicsView/include/CGAL/Qt/PolygonWithHolesGraphicsItem.h @@ -135,8 +135,8 @@ PolygonWithHolesGraphicsItem

::boundingRect() const template void PolygonWithHolesGraphicsItem

::paint(QPainter *painter, - const QStyleOptionGraphicsItem *option, - QWidget * widget) + const QStyleOptionGraphicsItem */*option*/, + QWidget * /*widget*/) { Converter convert; QPainterPath border; diff --git a/GraphicsView/include/CGAL/Qt/PolylinesGraphicsItem.h b/GraphicsView/include/CGAL/Qt/PolylinesGraphicsItem.h index e066d258cc5..263df5e8738 100644 --- a/GraphicsView/include/CGAL/Qt/PolylinesGraphicsItem.h +++ b/GraphicsView/include/CGAL/Qt/PolylinesGraphicsItem.h @@ -124,8 +124,8 @@ PolylinesGraphicsItem

::boundingRect() const template void PolylinesGraphicsItem

::paint(QPainter *painter, - const QStyleOptionGraphicsItem *option, - QWidget * widget) + const QStyleOptionGraphicsItem */*option*/, + QWidget * /*widget*/) { painterostream = PainterOstream(painter); diff --git a/GraphicsView/include/CGAL/Qt/RegularGridGraphicsItem.h b/GraphicsView/include/CGAL/Qt/RegularGridGraphicsItem.h index eacf73066b6..a8f4ebf84b7 100644 --- a/GraphicsView/include/CGAL/Qt/RegularGridGraphicsItem.h +++ b/GraphicsView/include/CGAL/Qt/RegularGridGraphicsItem.h @@ -141,8 +141,8 @@ QRectF template void RegularGridGraphicsItem::paint(QPainter *painter, - const QStyleOptionGraphicsItem *option, - QWidget * widget) + const QStyleOptionGraphicsItem */*option*/, + QWidget * /*widget*/) { QRectF rect = boundingRect(); double b = rect.bottom(); diff --git a/GraphicsView/include/CGAL/Qt/RegularGridVectorFieldGraphicsItem.h b/GraphicsView/include/CGAL/Qt/RegularGridVectorFieldGraphicsItem.h index 02c4697264d..c064dd82f46 100644 --- a/GraphicsView/include/CGAL/Qt/RegularGridVectorFieldGraphicsItem.h +++ b/GraphicsView/include/CGAL/Qt/RegularGridVectorFieldGraphicsItem.h @@ -136,8 +136,8 @@ QRectF template void RegularGridVectorFieldGraphicsItem::paint(QPainter *painter, - const QStyleOptionGraphicsItem *option, - QWidget * widget) + const QStyleOptionGraphicsItem */*option*/, + QWidget * /*widget*/) { painterostream = PainterOstream(painter); diff --git a/GraphicsView/include/CGAL/Qt/SegmentDelaunayGraphGraphicsItem.h b/GraphicsView/include/CGAL/Qt/SegmentDelaunayGraphGraphicsItem.h index 7e45fc26cc0..e8ccc4395b8 100644 --- a/GraphicsView/include/CGAL/Qt/SegmentDelaunayGraphGraphicsItem.h +++ b/GraphicsView/include/CGAL/Qt/SegmentDelaunayGraphGraphicsItem.h @@ -113,7 +113,7 @@ protected: template void -SegmentDelaunayGraphGraphicsItem::drawDualEdge(QPainter *painter, typename T::Edge e) +SegmentDelaunayGraphGraphicsItem::drawDualEdge(QPainter */*painter*/, typename T::Edge e) { CGAL_precondition( ! t->is_infinite(e) ); @@ -262,7 +262,7 @@ template void SegmentDelaunayGraphGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, - QWidget * widget) + QWidget * /*widget*/) { // painter->drawRect(boundingRect()); diff --git a/GraphicsView/include/CGAL/Qt/SegmentsGraphicsItem.h b/GraphicsView/include/CGAL/Qt/SegmentsGraphicsItem.h index 8df339ea91a..53799fad451 100644 --- a/GraphicsView/include/CGAL/Qt/SegmentsGraphicsItem.h +++ b/GraphicsView/include/CGAL/Qt/SegmentsGraphicsItem.h @@ -112,8 +112,8 @@ SegmentsGraphicsItem

::boundingRect() const template void SegmentsGraphicsItem

::paint(QPainter *painter, - const QStyleOptionGraphicsItem *option, - QWidget * widget) + const QStyleOptionGraphicsItem */*option*/, + QWidget * /*widget*/) { painterostream = PainterOstream(painter); diff --git a/GraphicsView/include/CGAL/Qt/StreamLinesGraphicsItem.h b/GraphicsView/include/CGAL/Qt/StreamLinesGraphicsItem.h index bbc39ab8bf6..f754199416f 100644 --- a/GraphicsView/include/CGAL/Qt/StreamLinesGraphicsItem.h +++ b/GraphicsView/include/CGAL/Qt/StreamLinesGraphicsItem.h @@ -95,7 +95,7 @@ StreamLinesGraphicsItem::boundingRect() const template void -StreamLinesGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *w) +StreamLinesGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget */*w*/) { painter->setPen(this->edgesPen()); QRectF rect = option->exposedRect; diff --git a/GraphicsView/src/CGALQt4/DemosMainWindow.cpp b/GraphicsView/src/CGALQt4/DemosMainWindow.cpp index 1c9015dd9a0..3dcdc072e9b 100644 --- a/GraphicsView/src/CGALQt4/DemosMainWindow.cpp +++ b/GraphicsView/src/CGALQt4/DemosMainWindow.cpp @@ -386,7 +386,7 @@ void DemosMainWindow::writeState(QString groupname) settings.endGroup(); } -void DemosMainWindow::readState(QString groupname, Options what_to_save) +void DemosMainWindow::readState(QString groupname, Options /*what_to_save*/) { QSettings settings; diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index c3788f0c3aa..6064f6009ca 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -446,13 +446,15 @@ macro( add_config_flag flag ) endmacro() +cache_get(CONFIG_CXX_FLAGS) + foreach(config_test_cpp ${all_config_tests}) # Test's name is .cpp's base name get_filename_component(config_test_name ${config_test_cpp} NAME_WE) # Compile and run ${config_test_cpp}. Exit code is stored in ${config_test_name}. - if( RUNNING_CGAL_AUTO_TEST OR "${config_test_name}" MATCHES "^${config_test_name}$" ) + if( RUNNING_CGAL_AUTO_TEST OR "${config_test_name}" MATCHES "^${config_test_name}$" OR NOT ${CONFIG_CXX_FLAGS} STREQUAL ${CMAKE_CXX_FLAGS}) CHECK_CXX_FILE_RUNS(${config_test_cpp} ${config_test_name} ${config_test_name}) @@ -468,6 +470,8 @@ foreach(config_test_cpp ${all_config_tests}) endforeach() +cache_set(CONFIG_CXX_FLAGS ${CMAKE_CXX_FLAGS}) + add_config_flag( CGAL_USE_GMP ) add_config_flag( CGAL_USE_MPFR ) add_config_flag( CGAL_USE_GMPXX ) diff --git a/Installation/changes.html b/Installation/changes.html index be3031a0bc0..7a43e3ef474 100644 --- a/Installation/changes.html +++ b/Installation/changes.html @@ -59,7 +59,8 @@ - diff --git a/Kernel_d/doc_tex/Kernel_d/history.tex b/Kernel_d/doc_tex/Kernel_d/history.tex index b58196ac372..ca5e0360faf 100644 --- a/Kernel_d/doc_tex/Kernel_d/history.tex +++ b/Kernel_d/doc_tex/Kernel_d/history.tex @@ -7,7 +7,7 @@ original design was driven by the realization of a d-dimensional convex hull data type developed at the \ccHtmlNoLinksFrom{Max-Planck Institut f\"ur Informatik}. -The code base was discussed and reviewed within the CGAL kernel group +The code base was discussed and reviewed within the \cgal\ kernel group (of the low-dimensional kernel). This led to the identification of the concept interfaces and in parallel to adaptations according to the evolution of the low-dimensional kernel. The kernel was revised diff --git a/Kernel_d/doc_tex/Kernel_d/kernel_representation_d.tex b/Kernel_d/doc_tex/Kernel_d/kernel_representation_d.tex index 27606345321..bd0daf32851 100644 --- a/Kernel_d/doc_tex/Kernel_d/kernel_representation_d.tex +++ b/Kernel_d/doc_tex/Kernel_d/kernel_representation_d.tex @@ -41,7 +41,7 @@ class provides the actual implementations of the kernel objects. For all kernel objects \ccc{Kernel_object}, the types \ccc{CGAL::Kernel_object} and \ccc{R::Kernel_object} are identical. -CGAL offers two families of concrete models for the concept +\cgal\ offers two families of concrete models for the concept representation class, one based on the \ccHtmlNoLinksFrom{Cartesian} representation of points and one based on the homogeneous representation of points. The interface of the kernel objects is @@ -153,7 +153,7 @@ makes all \cgal\ classes very uniform. They {\bf always} consist of: \subsection{Kernel as a Traits Class} -Algorithms and data structures in the basic library of CGAL are +Algorithms and data structures in the basic library of \cgal\ are parameterized by a traits class that subsumes the objects on which the algorithm or data structure operates as well as the operations to do so. For most of the algorithms and data structures in the basic diff --git a/Kernel_d/doc_tex/Kernel_d_ref/Kernel.tex b/Kernel_d/doc_tex/Kernel_d_ref/Kernel.tex index ecdd47bdf6f..00116ee1002 100644 --- a/Kernel_d/doc_tex/Kernel_d_ref/Kernel.tex +++ b/Kernel_d/doc_tex/Kernel_d_ref/Kernel.tex @@ -108,6 +108,8 @@ replacing operators, especially for equality testing. \ccGlue \ccNestedType{Less_or_equal_lexicographically_d}{} \ccGlue +\ccNestedType{Less_coordinate_d}{} +\ccGlue \ccNestedType{Lift_to_paraboloid_d}{} \ccGlue \ccNestedType{Linear_base_d}{} @@ -124,6 +126,8 @@ replacing operators, especially for equality testing. \ccGlue \ccNestedType{Orthogonal_vector_d}{} \ccGlue +\ccNestedType{Point_dimension_d}{} +\ccGlue \ccNestedType{Point_of_sphere_d}{} \ccGlue \ccNestedType{Point_to_vector_d}{} diff --git a/Kernel_d/doc_tex/Kernel_d_ref/Kernel_Less_coordinate_d.tex b/Kernel_d/doc_tex/Kernel_d_ref/Kernel_Less_coordinate_d.tex new file mode 100755 index 00000000000..b47f0e2b256 --- /dev/null +++ b/Kernel_d/doc_tex/Kernel_d_ref/Kernel_Less_coordinate_d.tex @@ -0,0 +1,13 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Less_coordinate_d} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{ bool operator()(const Kernel::Point_d& + p,const Kernel::Point_d& + q, int i);} {returns \ccc{true} iff the $i$th cartesian coordinate + of \ccc{p} is + smaller than the $i$th cartesian coordinate of \ccc{q}. \ccPrecond \ccc{p} and \ccc{q} have + the same dimension.} + +\end{ccRefFunctionObjectConcept} diff --git a/Kernel_d/doc_tex/Kernel_d_ref/Kernel_Point_dimension_d.tex b/Kernel_d/doc_tex/Kernel_d_ref/Kernel_Point_dimension_d.tex new file mode 100644 index 00000000000..29b8b175a19 --- /dev/null +++ b/Kernel_d/doc_tex/Kernel_d_ref/Kernel_Point_dimension_d.tex @@ -0,0 +1,9 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Point_dimension_d} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{ int operator()(const Kernel::Point_d& + p);} {returns the dimension of $p$} + +\end{ccRefFunctionObjectConcept} diff --git a/Kernel_d/doc_tex/Kernel_d_ref/main.tex b/Kernel_d/doc_tex/Kernel_d_ref/main.tex index 8bd81972aa0..9ad0cc9a3d7 100644 --- a/Kernel_d/doc_tex/Kernel_d_ref/main.tex +++ b/Kernel_d/doc_tex/Kernel_d_ref/main.tex @@ -88,6 +88,7 @@ \input{Kernel_d_ref/Kernel_Intersect_d.tex} \input{Kernel_d_ref/Kernel_Less_lexicographically_d.tex} \input{Kernel_d_ref/Kernel_Less_or_equal_lexicographically_d.tex} +\input{Kernel_d_ref/Kernel_Less_coordinate_d.tex} \input{Kernel_d_ref/Kernel_Lift_to_paraboloid_d.tex} \input{Kernel_d_ref/Kernel_Linearly_independent_d.tex} \input{Kernel_d_ref/Kernel_Linear_base_d.tex} @@ -96,6 +97,7 @@ \input{Kernel_d_ref/Kernel_Orientation_d.tex} \input{Kernel_d_ref/Kernel_Oriented_side_d.tex} \input{Kernel_d_ref/Kernel_Orthogonal_vector_d.tex} +\input{Kernel_d_ref/Kernel_Point_dimension_d.tex} \input{Kernel_d_ref/Kernel_Point_of_sphere_d.tex} \input{Kernel_d_ref/Kernel_Point_to_vector_d.tex} \input{Kernel_d_ref/Kernel_Project_along_d_axis_d.tex} diff --git a/Kernel_d/include/CGAL/Cartesian_d.h b/Kernel_d/include/CGAL/Cartesian_d.h index 6d889e0116d..52097613d40 100644 --- a/Kernel_d/include/CGAL/Cartesian_d.h +++ b/Kernel_d/include/CGAL/Cartesian_d.h @@ -251,6 +251,8 @@ public: typedef Compare_lexicographicallyCd Compare_lexicographically_d; typedef Lt_from_compare Less_lexicographically_d; typedef Le_from_compare Less_or_equal_lexicographically_d; + typedef Less_coordinateCd Less_coordinate_d; + typedef Point_dimensionCd Point_dimension_d; typedef Eq_from_method Equal_d; typedef Center_of_sphereCd Center_of_sphere_d; typedef Contained_in_linear_hullCd Contained_in_linear_hull_d; @@ -260,6 +262,10 @@ public: Compute_coordinate_d compute_coordinate_d_object() const { return Compute_coordinate_d(); } + Point_dimension_d point_dimension_d_object() const + { return Point_dimension_d(); } + Less_coordinate_d less_coordinate_d_object() const + { return Less_coordinate_d(); } Lift_to_paraboloid_d lift_to_paraboloid_d_object() const { return Lift_to_paraboloid_d(); } Project_along_d_axis_d project_along_d_axis_d_object() const diff --git a/Kernel_d/include/CGAL/Homogeneous_d.h b/Kernel_d/include/CGAL/Homogeneous_d.h index 994abdfbc5d..d968a94c4f5 100644 --- a/Kernel_d/include/CGAL/Homogeneous_d.h +++ b/Kernel_d/include/CGAL/Homogeneous_d.h @@ -253,6 +253,8 @@ public: typedef Compare_lexicographicallyHd Compare_lexicographically_d; typedef Lt_from_compare Less_lexicographically_d; typedef Le_from_compare Less_or_equal_lexicographically_d; + typedef Less_coordinateHd Less_coordinate_d; + typedef Point_dimensionHd Point_dimension_d; typedef Eq_from_method Equal_d; typedef Center_of_sphereHd Center_of_sphere_d; typedef Contained_in_linear_hullHd Contained_in_linear_hull_d; @@ -262,6 +264,10 @@ public: Compute_coordinate_d compute_coordinate_d_object() const { return Compute_coordinate_d(); } + Point_dimension_d point_dimension_d_object() const + { return Point_dimension_d(); } + Less_coordinate_d less_coordinate_d_object() const + { return Less_coordinate_d(); } Lift_to_paraboloid_d lift_to_paraboloid_d_object() const { return Lift_to_paraboloid_d(); } Project_along_d_axis_d project_along_d_axis_d_object() const diff --git a/Kernel_d/include/CGAL/Kernel_d/function_objectsCd.h b/Kernel_d/include/CGAL/Kernel_d/function_objectsCd.h index 69edd4b09e0..ae5887d33f1 100644 --- a/Kernel_d/include/CGAL/Kernel_d/function_objectsCd.h +++ b/Kernel_d/include/CGAL/Kernel_d/function_objectsCd.h @@ -42,13 +42,39 @@ class Compute_coordinateCd { typedef typename K::Point_d Point_d; public: typedef FT result_type; - const result_type + result_type operator()(const Point_d& p, int i) const { return p.cartesian(i); } }; +template +class Point_dimensionCd { + typedef typename K::FT FT; + typedef typename K::Point_d Point_d; + public: + typedef int result_type; + result_type + operator()(const Point_d& p) const + { + return p.dimension(); + } +}; + +template +class Less_coordinateCd { + typedef typename K::FT FT; + typedef typename K::Point_d Point_d; + public: + typedef bool result_type; + result_type + operator()(const Point_d& p, const Point_d& q, int i) const + { + return p.cartesian(i) struct Lift_to_paraboloidCd { typedef typename R::Point_d Point_d; diff --git a/Kernel_d/include/CGAL/Kernel_d/function_objectsHd.h b/Kernel_d/include/CGAL/Kernel_d/function_objectsHd.h index eaedbc5ec1e..2e719d9b6b8 100644 --- a/Kernel_d/include/CGAL/Kernel_d/function_objectsHd.h +++ b/Kernel_d/include/CGAL/Kernel_d/function_objectsHd.h @@ -41,13 +41,41 @@ class Compute_coordinateHd { typedef typename K::Point_d Point_d; public: typedef FT result_type; - const result_type + result_type operator()(const Point_d& p, int i) const { return p.cartesian(i); } }; +template +class Point_dimensionHd { + typedef typename K::RT RT; + typedef typename K::Point_d Point_d; + public: + typedef int result_type; + result_type + operator()(const Point_d& p) const + { + return p.dimension(); + } +}; + +template +class Less_coordinateHd { + typedef typename K::RT RT; + typedef typename K::Point_d Point_d; + public: + typedef bool result_type; + result_type + operator()(const Point_d& p, const Point_d& q, int i) const + { + int d = p.dimension(); + return p.cartesian(i)*q.homogeneous(d) struct Lift_to_paraboloidHd { typedef typename R::Point_d Point_d; diff --git a/Kinetic_data_structures/doc_tex/Kinetic_framework/architecture.tex b/Kinetic_data_structures/doc_tex/Kinetic_framework/architecture.tex index 4c80101d1e0..d945d2883c3 100644 --- a/Kinetic_data_structures/doc_tex/Kinetic_framework/architecture.tex +++ b/Kinetic_data_structures/doc_tex/Kinetic_framework/architecture.tex @@ -211,7 +211,7 @@ structure. \subsection{The Kinetic::InstantaneousKernel\label{sec:kds_instantaneous_kernel}} -The \ccc{Kinetic::InstantaneousKernel} allows existing CGAL data structures +The \ccc{Kinetic::InstantaneousKernel} allows existing \cgal\ data structures to be used on moving data as it appears at some instant of time. Models of this concept are, by definition, models of a CGAL Kernel or a traits class, and, therefore, can then be used as @@ -227,7 +227,7 @@ initialization, as well as at times during the simulation when we want to insert a point to the kinetic Delaunay triangulation, a static version of the Delaunay triangulation is conceptually instantiated. More precisely, the time for the copy of the model of the -\ccc{Kinetic::InstantaneousKernel} stored in the CGAL triangulation is set +\ccc{Kinetic::InstantaneousKernel} stored in the \cgal\ triangulation is set to be the current time (or rather, as discussed in the introduction, a more convenient time determined by the \ccc{Kinetic::Simulator} combinatorially equivalent to the current time). The kinetic data diff --git a/Kinetic_data_structures/doc_tex/Kinetic_framework/overview.tex b/Kinetic_data_structures/doc_tex/Kinetic_framework/overview.tex index 6ee62f45f41..708c1c1f531 100644 --- a/Kinetic_data_structures/doc_tex/Kinetic_framework/overview.tex +++ b/Kinetic_data_structures/doc_tex/Kinetic_framework/overview.tex @@ -32,7 +32,7 @@ structure interacts with the various parts. The main concepts are the correct order and audit kinetic data structures. There should be one instance of a model of this concept per simulation. \item the \ccc{Kinetic::Kernel}. The structure of a - \ccc{Kinetic::Kernel} is analogous to the static CGAL (i.e., + \ccc{Kinetic::Kernel} is analogous to the static \cgal\ (i.e., non-kinetic) kernels in that it defines a set of primitives and functors which generate certificates from the primitives. \item the \ccc{Kinetic::ActiveObjectsTable}. Models of this concept hold a @@ -42,7 +42,7 @@ structure interacts with the various parts. The main concepts are primitives are added or primitives are deleted. There is generally one instance of a model of this concept per simulation. \item the \ccc{Kinetic::InstantaneousKernel}. Models of this concept allow - existing non-kinetic CGAL data structures to be used on a snapshot + existing non-kinetic \cgal\ data structures to be used on a snapshot of kinetic data. As a result, pre-existing static structures can be used to initialize and audit kinetic data structures. \item the \ccc{Kinetic::FunctionKernel}. This concept is the computational diff --git a/Kinetic_data_structures/doc_tex/Kinetic_framework_ref/Cartesian_kinetic_kernel.tex b/Kinetic_data_structures/doc_tex/Kinetic_framework_ref/Cartesian_kinetic_kernel.tex index 4058d8e5982..21224a35bbb 100644 --- a/Kinetic_data_structures/doc_tex/Kinetic_framework_ref/Cartesian_kinetic_kernel.tex +++ b/Kinetic_data_structures/doc_tex/Kinetic_framework_ref/Cartesian_kinetic_kernel.tex @@ -20,7 +20,7 @@ This class provides a model of \ccc{Kinetic::Kernel} for use with general Cartesian geometry. -The IO format for points is currently $p_0$, $p_1$, ... $w$. $p_i$ and $w$ are instances of Function. There IO format is typically $c_0+c_1t+c_2t^2+...$. Beware of issues with CGAL IO of the coeffients as exact number typles often require that the coefficents be expressed as $a/b$ even when $b$ is 1. +The IO format for points is currently $p_0$, $p_1$, ... $w$. $p_i$ and $w$ are instances of Function. There IO format is typically $c_0+c_1t+c_2t^2+...$. Beware of issues with \cgal\ IO of the coeffients as exact number typles often require that the coefficents be expressed as $a/b$ even when $b$ is 1. \ccInclude{CGAL/Kinetic/Cartesian.h} diff --git a/Kinetic_data_structures/doc_tex/Kinetic_framework_ref/KineticKernel.tex b/Kinetic_data_structures/doc_tex/Kinetic_framework_ref/KineticKernel.tex index 52ee2717745..091274ccc54 100644 --- a/Kinetic_data_structures/doc_tex/Kinetic_framework_ref/KineticKernel.tex +++ b/Kinetic_data_structures/doc_tex/Kinetic_framework_ref/KineticKernel.tex @@ -18,7 +18,7 @@ \ccDefinition -The concept \ccRefName\ acts as the kinetic analog of a CGAL kernel. +The concept \ccRefName\ acts as the kinetic analog of a \cgal\ kernel. It provides some set of primitives and predicats acting on them. The predicates are instances of \ccc{Kinetic::CertificateGenerator} and can be used to either create \ccc{Certificate}s or to evaluate diff --git a/Maintenance/git/authors-file.txt b/Maintenance/git/authors-file.txt index 2dfeb91625c..0dbf27301c5 100644 --- a/Maintenance/git/authors-file.txt +++ b/Maintenance/git/authors-file.txt @@ -1,5 +1,6 @@ abru = Antoine Bru afabri = Andreas Fabri +andreasfabri = Andreas Fabri akobel = Alexander Kobel amebarki = Abdelkrim Mebarki ameyer = Andreas Meyer diff --git a/Maintenance/infrastructure/matisse.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5.1_F14-m32/CMakeCache.txt b/Maintenance/infrastructure/matisse.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5.1_F14-m32/CMakeCache.txt index 10ae148aa81..a6de99a5a4e 100644 --- a/Maintenance/infrastructure/matisse.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5.1_F14-m32/CMakeCache.txt +++ b/Maintenance/infrastructure/matisse.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5.1_F14-m32/CMakeCache.txt @@ -39,7 +39,7 @@ CGAL_CORE_PACKAGE_DIR:PATH=/home/lrineau/CGAL/CGAL-I CGAL_CXX_FLAGS:STRING=-m32 -frounding-math //Value Computed by CMake -CGAL_Core_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/matisse.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5.1_F14-m32/src/Core +CGAL_Core_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/matisse.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5.1_F14-m32/src/CGALCore //The CGAL_Core library CGAL_Core_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/matisse.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5.1_F14-m32/lib/libCGAL_Core.so @@ -87,8 +87,11 @@ CGAL_INSTALL_MAN_DIR:STRING=share/man/man1 //Value Computed by CMake CGAL_ImageIO_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/matisse.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5.1_F14-m32/src/CGALimageIO +//The CGAL_ImageIO library +CGAL_ImageIO_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/matisse.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5.1_F14-m32/lib/libCGAL_ImageIO.so + //Dependencies for the target -CGAL_ImageIO_LIB_DEPENDS:STATIC=general;/home/lrineau/trunk/Maintenance/infrastructure/matisse.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5.1_F14-m32/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/usr/lib64/libboost_thread-mt.so;general;/home/lrineau/trunk/Maintenance/infrastructure/matisse.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5.1_F14-m32/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/usr/lib64/libboost_thread-mt.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;/usr/lib64/libz.so;general;/home/lrineau/trunk/Maintenance/infrastructure/matisse.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5.1_F14-m32/lib/libCGAL.so; +CGAL_ImageIO_LIB_DEPENDS:STATIC=general;/home/lrineau/trunk/Maintenance/infrastructure/matisse.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5.1_F14-m32/lib/libCGAL.so;general;/usr/lib/libgmpxx.so;general;/usr/lib/libmpfr.so;general;/usr/lib/libgmp.so;general;/usr/lib/libboost_thread-mt.so;general;/home/lrineau/trunk/Maintenance/infrastructure/matisse.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5.1_F14-m32/lib/libCGAL.so;general;/usr/lib/libgmpxx.so;general;/usr/lib/libmpfr.so;general;/usr/lib/libgmp.so;general;/usr/lib/libboost_thread-mt.so;general;/usr/lib/libGLU.so;general;/usr/lib/libGL.so;general;/home/lrineau/trunk/Maintenance/infrastructure/matisse.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5.1_F14-m32/lib/libCGAL.so; //Value Computed by CMake CGAL_ImageIO_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALimageIO @@ -102,8 +105,11 @@ CGAL_MAINTENANCE_PACKAGE_DIR:PATH=/home/lrineau/CGAL/CGAL-I //Value Computed by CMake CGAL_Qt3_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/matisse.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5.1_F14-m32/src/CGALQt +//The CGAL_Qt3 library +CGAL_Qt3_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/matisse.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5.1_F14-m32/lib/libCGAL_Qt3.so + //Dependencies for the target -CGAL_Qt3_LIB_DEPENDS:STATIC=general;/home/lrineau/trunk/Maintenance/infrastructure/matisse.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5.1_F14-m32/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/usr/lib64/libboost_thread-mt.so;general;/home/lrineau/trunk/Maintenance/infrastructure/matisse.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5.1_F14-m32/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/usr/lib64/libboost_thread-mt.so;general;/usr/lib64/qt-3.3/lib/libqassistantclient.a;general;/usr/lib64/qt-3.3/lib/libqt-mt.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;dl;general;-lpthread;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; +CGAL_Qt3_LIB_DEPENDS:STATIC=general;/home/lrineau/trunk/Maintenance/infrastructure/matisse.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5.1_F14-m32/lib/libCGAL.so;general;/usr/lib/libgmpxx.so;general;/usr/lib/libmpfr.so;general;/usr/lib/libgmp.so;general;/usr/lib/libboost_thread-mt.so;general;/home/lrineau/trunk/Maintenance/infrastructure/matisse.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5.1_F14-m32/lib/libCGAL.so;general;/usr/lib/libgmpxx.so;general;/usr/lib/libmpfr.so;general;/usr/lib/libgmp.so;general;/usr/lib/libboost_thread-mt.so;general;/usr/lib/qt-3.3/lib/libqassistantclient.a;general;/usr/lib/qt-3.3/lib/libqt-mt.so;general;dl;general;-lpthread;general;/usr/lib/libGLU.so;general;/usr/lib/libGL.so; //Value Computed by CMake CGAL_Qt3_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALQt @@ -111,8 +117,11 @@ CGAL_Qt3_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALQt //Value Computed by CMake CGAL_Qt4_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/matisse.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5.1_F14-m32/src/CGALQt4 +//The CGAL_Qt4 library +CGAL_Qt4_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/matisse.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5.1_F14-m32/lib/libCGAL_Qt4.so + //Dependencies for the target -CGAL_Qt4_LIB_DEPENDS:STATIC=general;/home/lrineau/trunk/Maintenance/infrastructure/matisse.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5.1_F14-m32/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/usr/lib64/libboost_thread-mt.so;general;/home/lrineau/trunk/Maintenance/infrastructure/matisse.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5.1_F14-m32/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/usr/lib64/libboost_thread-mt.so;optimized;/usr/lib64/libQtOpenGL.so;debug;/usr/lib64/libQtOpenGL_debug.so;general;-lGLU;general;-lGL;optimized;/usr/lib64/libQtGui.so;debug;/usr/lib64/libQtGui_debug.so;general;/usr/lib64/libpng.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libXi.so;general;/usr/lib64/libXrender.so;general;/usr/lib64/libXrandr.so;general;/usr/lib64/libXcursor.so;general;/usr/lib64/libXinerama.so;general;/usr/lib64/libXfixes.so;general;/usr/lib64/libfreetype.so;general;/usr/lib64/libfontconfig.so;optimized;/usr/lib64/libQtCore.so;debug;/usr/lib64/libQtCore_debug.so;general;/usr/lib64/libz.so;general;/usr/lib64/libgthread-2.0.so;general;/usr/lib64/libglib-2.0.so;general;/usr/lib64/libgobject-2.0.so;general;/usr/lib64/librt.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; +CGAL_Qt4_LIB_DEPENDS:STATIC=general;/home/lrineau/trunk/Maintenance/infrastructure/matisse.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5.1_F14-m32/lib/libCGAL.so;general;/usr/lib/libgmpxx.so;general;/usr/lib/libmpfr.so;general;/usr/lib/libgmp.so;general;/usr/lib/libboost_thread-mt.so;general;/home/lrineau/trunk/Maintenance/infrastructure/matisse.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5.1_F14-m32/lib/libCGAL.so;general;/usr/lib/libgmpxx.so;general;/usr/lib/libmpfr.so;general;/usr/lib/libgmp.so;general;/usr/lib/libboost_thread-mt.so;optimized;/usr/lib64/libQtOpenGL.so;debug;/usr/lib64/libQtOpenGL_debug.so;optimized;/usr/lib64/libQtGui.so;debug;/usr/lib64/libQtGui_debug.so;optimized;/usr/lib64/libQtCore.so;debug;/usr/lib64/libQtCore_debug.so;general;/usr/lib/libGLU.so;general;/usr/lib/libGL.so; //Value Computed by CMake CGAL_Qt4_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALQt4 @@ -287,17 +296,638 @@ MPFR_LIBRARIES:FILEPATH=/usr/lib/libmpfr.so //Missing description MPFR_LIBRARIES_DIR:FILEPATH=/usr/lib +//Path to a file. +OPENGL_INCLUDE_DIR:PATH=/usr/include + +//Path to a library. +OPENGL_gl_LIBRARY:FILEPATH=/usr/lib/libGL.so + +//Path to a library. +OPENGL_glu_LIBRARY:FILEPATH=/usr/lib/libGLU.so + +//Path to a file. +OPENGL_xmesa_INCLUDE_DIR:PATH=OPENGL_xmesa_INCLUDE_DIR-NOTFOUND + +//Path to a file. +QT3_INCLUDE_DIR:PATH=/usr/lib/qt-3.3/include + +//Path to a program. +QT3_MOC_EXECUTABLE:FILEPATH=/usr/lib/qt-3.3/bin/moc + +//Path to a library. +QT3_QASSISTANTCLIENT_LIBRARY:FILEPATH=/usr/lib/qt-3.3/lib/libqassistantclient.a + +//Path to a library. +QT3_QT_LIBRARY:FILEPATH=/usr/lib/qt-3.3/lib/libqt-mt.so + +//Path to a program. +QT3_UIC_EXECUTABLE:FILEPATH=/usr/lib/qt-3.3/bin/uic + +//Path to a library. +QT_ARTHURPLUGIN_PLUGIN_DEBUG:FILEPATH=QT_ARTHURPLUGIN_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_ARTHURPLUGIN_PLUGIN_RELEASE:FILEPATH=/usr/lib64/qt4/plugins/designer/libarthurplugin.so + +//Path to a library. +QT_CONTAINEREXTENSION_PLUGIN_DEBUG:FILEPATH=QT_CONTAINEREXTENSION_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_CONTAINEREXTENSION_PLUGIN_RELEASE:FILEPATH=/usr/lib64/qt4/plugins/designer/libcontainerextension.so + +//Path to a library. +QT_CUSTOMWIDGETPLUGIN_PLUGIN_DEBUG:FILEPATH=QT_CUSTOMWIDGETPLUGIN_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_CUSTOMWIDGETPLUGIN_PLUGIN_RELEASE:FILEPATH=/usr/lib64/qt4/plugins/designer/libcustomwidgetplugin.so + +//Path to a program. +QT_DBUSCPP2XML_EXECUTABLE:FILEPATH=/usr/lib64/qt4/bin/qdbuscpp2xml + +//Path to a program. +QT_DBUSXML2CPP_EXECUTABLE:FILEPATH=/usr/lib64/qt4/bin/qdbusxml2cpp + +//Path to a program. +QT_DESIGNER_EXECUTABLE:FILEPATH=/usr/lib64/qt4/bin/designer-qt4 + +//The location of the Qt docs +QT_DOC_DIR:PATH=/usr/share/doc/qt4 + +//The location of the Qt imports +QT_IMPORTS_DIR:PATH=/usr/lib64/qt4/imports + +//Path to a program. +QT_LINGUIST_EXECUTABLE:FILEPATH=/usr/lib64/qt4/bin/linguist-qt4 + +//Path to a program. +QT_LRELEASE_EXECUTABLE:FILEPATH=/usr/lib64/qt4/bin/lrelease-qt4 + +//Path to a program. +QT_LUPDATE_EXECUTABLE:FILEPATH=/usr/lib64/qt4/bin/lupdate-qt4 + +//The location of the Qt mkspecs containing qconfig.pri +QT_MKSPECS_DIR:PATH=/usr/lib64/qt4/mkspecs + +//Path to a program. +QT_MOC_EXECUTABLE:FILEPATH=/usr/lib64/qt4/bin/moc-qt4 + +//Path to a library. +QT_PHONONWIDGETS_PLUGIN_DEBUG:FILEPATH=QT_PHONONWIDGETS_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_PHONONWIDGETS_PLUGIN_RELEASE:FILEPATH=/usr/lib64/qt4/plugins/designer/libphononwidgets.so + +//Path to a file. +QT_PHONON_INCLUDE_DIR:PATH=/usr/include/phonon + +//The Qt PHONON library +QT_PHONON_LIBRARY:STRING=/usr/lib64/libphonon.so + +//Path to a library. +QT_PHONON_LIBRARY_DEBUG:FILEPATH=QT_PHONON_LIBRARY_DEBUG-NOTFOUND + +//Path to a library. +QT_PHONON_LIBRARY_RELEASE:FILEPATH=/usr/lib64/libphonon.so + +//Path to a library. +QT_PHONON_QT7_PLUGIN_DEBUG:FILEPATH=QT_PHONON_QT7_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_PHONON_QT7_PLUGIN_RELEASE:FILEPATH=QT_PHONON_QT7_PLUGIN_RELEASE-NOTFOUND + +//The location of the Qt plugins +QT_PLUGINS_DIR:PATH=/usr/lib64/qt4/plugins + +//Path to a library. +QT_QCNCODECS_PLUGIN_DEBUG:FILEPATH=QT_QCNCODECS_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_QCNCODECS_PLUGIN_RELEASE:FILEPATH=/usr/lib64/qt4/plugins/codecs/libqcncodecs.so + +//Path to a program. +QT_QCOLLECTIONGENERATOR_EXECUTABLE:FILEPATH=/usr/lib64/qt4/bin/qcollectiongenerator + +//Path to a library. +QT_QCOREWLANBEARER_PLUGIN_DEBUG:FILEPATH=QT_QCOREWLANBEARER_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_QCOREWLANBEARER_PLUGIN_RELEASE:FILEPATH=QT_QCOREWLANBEARER_PLUGIN_RELEASE-NOTFOUND + +//Path to a library. +QT_QDECLARATIVEVIEW_PLUGIN_DEBUG:FILEPATH=QT_QDECLARATIVEVIEW_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_QDECLARATIVEVIEW_PLUGIN_RELEASE:FILEPATH=/usr/lib64/qt4/plugins/designer/libqdeclarativeview.so + +//Path to a library. +QT_QDECORATIONDEFAULT_PLUGIN_DEBUG:FILEPATH=QT_QDECORATIONDEFAULT_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_QDECORATIONDEFAULT_PLUGIN_RELEASE:FILEPATH=QT_QDECORATIONDEFAULT_PLUGIN_RELEASE-NOTFOUND + +//Path to a library. +QT_QDECORATIONWINDOWS_PLUGIN_DEBUG:FILEPATH=QT_QDECORATIONWINDOWS_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_QDECORATIONWINDOWS_PLUGIN_RELEASE:FILEPATH=QT_QDECORATIONWINDOWS_PLUGIN_RELEASE-NOTFOUND + +//Path to a library. +QT_QGENERICBEARER_PLUGIN_DEBUG:FILEPATH=QT_QGENERICBEARER_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_QGENERICBEARER_PLUGIN_RELEASE:FILEPATH=/usr/lib64/qt4/plugins/bearer/libqgenericbearer.so + +//Path to a library. +QT_QGIF_PLUGIN_DEBUG:FILEPATH=QT_QGIF_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_QGIF_PLUGIN_RELEASE:FILEPATH=/usr/lib64/qt4/plugins/imageformats/libqgif.so + +//Path to a library. +QT_QGLGRAPHICSSYSTEM_PLUGIN_DEBUG:FILEPATH=QT_QGLGRAPHICSSYSTEM_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_QGLGRAPHICSSYSTEM_PLUGIN_RELEASE:FILEPATH=/usr/lib64/qt4/plugins/graphicssystems/libqglgraphicssystem.so + +//Path to a library. +QT_QICO_PLUGIN_DEBUG:FILEPATH=QT_QICO_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_QICO_PLUGIN_RELEASE:FILEPATH=/usr/lib64/qt4/plugins/imageformats/libqico.so + +//Path to a library. +QT_QIMSW_MULTI_PLUGIN_DEBUG:FILEPATH=QT_QIMSW_MULTI_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_QIMSW_MULTI_PLUGIN_RELEASE:FILEPATH=QT_QIMSW_MULTI_PLUGIN_RELEASE-NOTFOUND + +//Path to a library. +QT_QJPCODECS_PLUGIN_DEBUG:FILEPATH=QT_QJPCODECS_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_QJPCODECS_PLUGIN_RELEASE:FILEPATH=/usr/lib64/qt4/plugins/codecs/libqjpcodecs.so + +//Path to a library. +QT_QJPEG_PLUGIN_DEBUG:FILEPATH=QT_QJPEG_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_QJPEG_PLUGIN_RELEASE:FILEPATH=/usr/lib64/qt4/plugins/imageformats/libqjpeg.so + +//Path to a library. +QT_QKRCODECS_PLUGIN_DEBUG:FILEPATH=QT_QKRCODECS_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_QKRCODECS_PLUGIN_RELEASE:FILEPATH=/usr/lib64/qt4/plugins/codecs/libqkrcodecs.so + +//Where can one of the qmake4 or qmake-qt4 libraries be found +QT_QMAKE_EXECUTABLE:FILEPATH=/usr/bin/qmake-qt4 + +//Path to a library. +QT_QMNG_PLUGIN_DEBUG:FILEPATH=QT_QMNG_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_QMNG_PLUGIN_RELEASE:FILEPATH=/usr/lib64/qt4/plugins/imageformats/libqmng.so + +//Path to a library. +QT_QSQLDB2_PLUGIN_DEBUG:FILEPATH=QT_QSQLDB2_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_QSQLDB2_PLUGIN_RELEASE:FILEPATH=QT_QSQLDB2_PLUGIN_RELEASE-NOTFOUND + +//Path to a library. +QT_QSQLIBASE_PLUGIN_DEBUG:FILEPATH=QT_QSQLIBASE_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_QSQLIBASE_PLUGIN_RELEASE:FILEPATH=QT_QSQLIBASE_PLUGIN_RELEASE-NOTFOUND + +//Path to a library. +QT_QSQLITE2_PLUGIN_DEBUG:FILEPATH=QT_QSQLITE2_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_QSQLITE2_PLUGIN_RELEASE:FILEPATH=QT_QSQLITE2_PLUGIN_RELEASE-NOTFOUND + +//Path to a library. +QT_QSQLITE_PLUGIN_DEBUG:FILEPATH=QT_QSQLITE_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_QSQLITE_PLUGIN_RELEASE:FILEPATH=/usr/lib64/qt4/plugins/sqldrivers/libqsqlite.so + +//Path to a library. +QT_QSQLMYSQL_PLUGIN_DEBUG:FILEPATH=QT_QSQLMYSQL_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_QSQLMYSQL_PLUGIN_RELEASE:FILEPATH=/usr/lib64/qt4/plugins/sqldrivers/libqsqlmysql.so + +//Path to a library. +QT_QSQLOCI_PLUGIN_DEBUG:FILEPATH=QT_QSQLOCI_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_QSQLOCI_PLUGIN_RELEASE:FILEPATH=QT_QSQLOCI_PLUGIN_RELEASE-NOTFOUND + +//Path to a library. +QT_QSQLODBC_PLUGIN_DEBUG:FILEPATH=QT_QSQLODBC_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_QSQLODBC_PLUGIN_RELEASE:FILEPATH=QT_QSQLODBC_PLUGIN_RELEASE-NOTFOUND + +//Path to a library. +QT_QSQLPSQL_PLUGIN_DEBUG:FILEPATH=QT_QSQLPSQL_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_QSQLPSQL_PLUGIN_RELEASE:FILEPATH=QT_QSQLPSQL_PLUGIN_RELEASE-NOTFOUND + +//Path to a library. +QT_QSQLTDS_PLUGIN_DEBUG:FILEPATH=QT_QSQLTDS_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_QSQLTDS_PLUGIN_RELEASE:FILEPATH=QT_QSQLTDS_PLUGIN_RELEASE-NOTFOUND + +//Path to a library. +QT_QSVGICON_PLUGIN_DEBUG:FILEPATH=QT_QSVGICON_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_QSVGICON_PLUGIN_RELEASE:FILEPATH=/usr/lib64/qt4/plugins/iconengines/libqsvgicon.so + +//Path to a library. +QT_QSVG_PLUGIN_DEBUG:FILEPATH=QT_QSVG_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_QSVG_PLUGIN_RELEASE:FILEPATH=/usr/lib64/qt4/plugins/imageformats/libqsvg.so + +//Path to a library. +QT_QT3SUPPORTWIDGETS_PLUGIN_DEBUG:FILEPATH=QT_QT3SUPPORTWIDGETS_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_QT3SUPPORTWIDGETS_PLUGIN_RELEASE:FILEPATH=/usr/lib64/qt4/plugins/designer/libqt3supportwidgets.so + +//Path to a file. +QT_QT3SUPPORT_INCLUDE_DIR:PATH=/usr/include/Qt3Support + +//The Qt QT3SUPPORT library +QT_QT3SUPPORT_LIBRARY:STRING=optimized;/usr/lib64/libQt3Support.so;debug;/usr/lib64/libQt3Support_debug.so + +//Path to a library. +QT_QT3SUPPORT_LIBRARY_DEBUG:FILEPATH=/usr/lib64/libQt3Support_debug.so + +//Path to a library. +QT_QT3SUPPORT_LIBRARY_RELEASE:FILEPATH=/usr/lib64/libQt3Support.so + +//Path to a library. +QT_QTACCESSIBLECOMPATWIDGETS_PLUGIN_DEBUG:FILEPATH=QT_QTACCESSIBLECOMPATWIDGETS_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_QTACCESSIBLECOMPATWIDGETS_PLUGIN_RELEASE:FILEPATH=/usr/lib64/qt4/plugins/accessible/libqtaccessiblecompatwidgets.so + +//Path to a library. +QT_QTACCESSIBLEWIDGETS_PLUGIN_DEBUG:FILEPATH=QT_QTACCESSIBLEWIDGETS_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_QTACCESSIBLEWIDGETS_PLUGIN_RELEASE:FILEPATH=/usr/lib64/qt4/plugins/accessible/libqtaccessiblewidgets.so + +//Path to a file. +QT_QTASSISTANTCLIENT_INCLUDE_DIR:PATH=QT_QTASSISTANTCLIENT_INCLUDE_DIR-NOTFOUND + +//The Qt QTASSISTANTCLIENT library +QT_QTASSISTANTCLIENT_LIBRARY:STRING= + +//Path to a library. +QT_QTASSISTANTCLIENT_LIBRARY_DEBUG:FILEPATH=QT_QTASSISTANTCLIENT_LIBRARY_DEBUG-NOTFOUND + +//Path to a library. +QT_QTASSISTANTCLIENT_LIBRARY_RELEASE:FILEPATH=QT_QTASSISTANTCLIENT_LIBRARY_RELEASE-NOTFOUND + +//Path to a file. +QT_QTASSISTANT_INCLUDE_DIR:PATH=QT_QTASSISTANT_INCLUDE_DIR-NOTFOUND + +//The Qt QTASSISTANT library +QT_QTASSISTANT_LIBRARY:STRING= + +//Path to a library. +QT_QTASSISTANT_LIBRARY_DEBUG:FILEPATH=QT_QTASSISTANT_LIBRARY_DEBUG-NOTFOUND + +//Path to a library. +QT_QTASSISTANT_LIBRARY_RELEASE:FILEPATH=QT_QTASSISTANT_LIBRARY_RELEASE-NOTFOUND + +//The Qt QTCLUCENE library +QT_QTCLUCENE_LIBRARY:STRING=optimized;/usr/lib64/libQtCLucene.so;debug;/usr/lib64/libQtCLucene_debug.so + +//Path to a library. +QT_QTCLUCENE_LIBRARY_DEBUG:FILEPATH=/usr/lib64/libQtCLucene_debug.so + +//Path to a library. +QT_QTCLUCENE_LIBRARY_RELEASE:FILEPATH=/usr/lib64/libQtCLucene.so + +//(This variable does not exist and should not be used) +QT_QTCORE_INCLUDE_DIR:PATH=/usr/include/QtCore + +//The Qt QTCORE library +QT_QTCORE_LIBRARY:STRING=optimized;/usr/lib64/libQtCore.so;debug;/usr/lib64/libQtCore_debug.so + +//Path to a library. +QT_QTCORE_LIBRARY_DEBUG:FILEPATH=/usr/lib64/libQtCore_debug.so + +//Path to a library. +QT_QTCORE_LIBRARY_RELEASE:FILEPATH=/usr/lib64/libQtCore.so + +//Path to a file. +QT_QTDBUS_INCLUDE_DIR:PATH=/usr/include/QtDBus + +//The Qt QTDBUS library +QT_QTDBUS_LIBRARY:STRING=optimized;/usr/lib64/libQtDBus.so;debug;/usr/lib64/libQtDBus_debug.so + +//Path to a library. +QT_QTDBUS_LIBRARY_DEBUG:FILEPATH=/usr/lib64/libQtDBus_debug.so + +//Path to a library. +QT_QTDBUS_LIBRARY_RELEASE:FILEPATH=/usr/lib64/libQtDBus.so + +//Path to a file. +QT_QTDECLARATIVE_INCLUDE_DIR:PATH=/usr/include/QtDeclarative + +//The Qt QTDECLARATIVE library +QT_QTDECLARATIVE_LIBRARY:STRING=optimized;/usr/lib64/libQtDeclarative.so;debug;/usr/lib64/libQtDeclarative_debug.so + +//Path to a library. +QT_QTDECLARATIVE_LIBRARY_DEBUG:FILEPATH=/usr/lib64/libQtDeclarative_debug.so + +//Path to a library. +QT_QTDECLARATIVE_LIBRARY_RELEASE:FILEPATH=/usr/lib64/libQtDeclarative.so + +//Path to a file. +QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR:PATH=/usr/include/QtDesigner + +//The Qt QTDESIGNERCOMPONENTS library +QT_QTDESIGNERCOMPONENTS_LIBRARY:STRING=optimized;/usr/lib64/libQtDesignerComponents.so;debug;/usr/lib64/libQtDesignerComponents_debug.so + +//Path to a library. +QT_QTDESIGNERCOMPONENTS_LIBRARY_DEBUG:FILEPATH=/usr/lib64/libQtDesignerComponents_debug.so + +//Path to a library. +QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE:FILEPATH=/usr/lib64/libQtDesignerComponents.so + +//Path to a file. +QT_QTDESIGNER_INCLUDE_DIR:PATH=/usr/include/QtDesigner + +//The Qt QTDESIGNER library +QT_QTDESIGNER_LIBRARY:STRING=optimized;/usr/lib64/libQtDesigner.so;debug;/usr/lib64/libQtDesigner_debug.so + +//Path to a library. +QT_QTDESIGNER_LIBRARY_DEBUG:FILEPATH=/usr/lib64/libQtDesigner_debug.so + +//Path to a library. +QT_QTDESIGNER_LIBRARY_RELEASE:FILEPATH=/usr/lib64/libQtDesigner.so + +//Path to a file. +QT_QTGUI_INCLUDE_DIR:PATH=/usr/include/QtGui + +//The Qt QTGUI library +QT_QTGUI_LIBRARY:STRING=optimized;/usr/lib64/libQtGui.so;debug;/usr/lib64/libQtGui_debug.so + +//Path to a library. +QT_QTGUI_LIBRARY_DEBUG:FILEPATH=/usr/lib64/libQtGui_debug.so + +//Path to a library. +QT_QTGUI_LIBRARY_RELEASE:FILEPATH=/usr/lib64/libQtGui.so + +//Path to a file. +QT_QTHELP_INCLUDE_DIR:PATH=/usr/include/QtHelp + +//The Qt QTHELP library +QT_QTHELP_LIBRARY:STRING=optimized;/usr/lib64/libQtHelp.so;debug;/usr/lib64/libQtHelp_debug.so + +//Path to a library. +QT_QTHELP_LIBRARY_DEBUG:FILEPATH=/usr/lib64/libQtHelp_debug.so + +//Path to a library. +QT_QTHELP_LIBRARY_RELEASE:FILEPATH=/usr/lib64/libQtHelp.so + +//Path to a library. +QT_QTIFF_PLUGIN_DEBUG:FILEPATH=QT_QTIFF_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_QTIFF_PLUGIN_RELEASE:FILEPATH=/usr/lib64/qt4/plugins/imageformats/libqtiff.so + +//Path to a file. +QT_QTMULTIMEDIA_INCLUDE_DIR:PATH=/usr/include/QtMultimedia + +//The Qt QTMULTIMEDIA library +QT_QTMULTIMEDIA_LIBRARY:STRING=optimized;/usr/lib64/libQtMultimedia.so;debug;/usr/lib64/libQtMultimedia_debug.so + +//Path to a library. +QT_QTMULTIMEDIA_LIBRARY_DEBUG:FILEPATH=/usr/lib64/libQtMultimedia_debug.so + +//Path to a library. +QT_QTMULTIMEDIA_LIBRARY_RELEASE:FILEPATH=/usr/lib64/libQtMultimedia.so + +//Path to a file. +QT_QTNETWORK_INCLUDE_DIR:PATH=/usr/include/QtNetwork + +//The Qt QTNETWORK library +QT_QTNETWORK_LIBRARY:STRING=optimized;/usr/lib64/libQtNetwork.so;debug;/usr/lib64/libQtNetwork_debug.so + +//Path to a library. +QT_QTNETWORK_LIBRARY_DEBUG:FILEPATH=/usr/lib64/libQtNetwork_debug.so + +//Path to a library. +QT_QTNETWORK_LIBRARY_RELEASE:FILEPATH=/usr/lib64/libQtNetwork.so + +//Path to a file. +QT_QTNSPLUGIN_INCLUDE_DIR:PATH=QT_QTNSPLUGIN_INCLUDE_DIR-NOTFOUND + +//The Qt QTNSPLUGIN library +QT_QTNSPLUGIN_LIBRARY:STRING= + +//Path to a library. +QT_QTNSPLUGIN_LIBRARY_DEBUG:FILEPATH=QT_QTNSPLUGIN_LIBRARY_DEBUG-NOTFOUND + +//Path to a library. +QT_QTNSPLUGIN_LIBRARY_RELEASE:FILEPATH=QT_QTNSPLUGIN_LIBRARY_RELEASE-NOTFOUND + +//Path to a file. +QT_QTOPENGL_INCLUDE_DIR:PATH=/usr/include/QtOpenGL + +//The Qt QTOPENGL library +QT_QTOPENGL_LIBRARY:STRING=optimized;/usr/lib64/libQtOpenGL.so;debug;/usr/lib64/libQtOpenGL_debug.so + +//Path to a library. +QT_QTOPENGL_LIBRARY_DEBUG:FILEPATH=/usr/lib64/libQtOpenGL_debug.so + +//Path to a library. +QT_QTOPENGL_LIBRARY_RELEASE:FILEPATH=/usr/lib64/libQtOpenGL.so + +//Path to a library. +QT_QTRACEGRAPHICSSYSTEM_PLUGIN_DEBUG:FILEPATH=QT_QTRACEGRAPHICSSYSTEM_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_QTRACEGRAPHICSSYSTEM_PLUGIN_RELEASE:FILEPATH=/usr/lib64/qt4/plugins/graphicssystems/libqtracegraphicssystem.so + +//Path to a library. +QT_QTSCRIPTDBUS_PLUGIN_DEBUG:FILEPATH=QT_QTSCRIPTDBUS_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_QTSCRIPTDBUS_PLUGIN_RELEASE:FILEPATH=/usr/lib64/qt4/plugins/script/libqtscriptdbus.so + +//Path to a file. +QT_QTSCRIPTTOOLS_INCLUDE_DIR:PATH=/usr/include/QtScriptTools + +//The Qt QTSCRIPTTOOLS library +QT_QTSCRIPTTOOLS_LIBRARY:STRING=optimized;/usr/lib64/libQtScriptTools.so;debug;/usr/lib64/libQtScriptTools_debug.so + +//Path to a library. +QT_QTSCRIPTTOOLS_LIBRARY_DEBUG:FILEPATH=/usr/lib64/libQtScriptTools_debug.so + +//Path to a library. +QT_QTSCRIPTTOOLS_LIBRARY_RELEASE:FILEPATH=/usr/lib64/libQtScriptTools.so + +//Path to a file. +QT_QTSCRIPT_INCLUDE_DIR:PATH=/usr/include/QtScript + +//The Qt QTSCRIPT library +QT_QTSCRIPT_LIBRARY:STRING=optimized;/usr/lib64/libQtScript.so;debug;/usr/lib64/libQtScript_debug.so + +//Path to a library. +QT_QTSCRIPT_LIBRARY_DEBUG:FILEPATH=/usr/lib64/libQtScript_debug.so + +//Path to a library. +QT_QTSCRIPT_LIBRARY_RELEASE:FILEPATH=/usr/lib64/libQtScript.so + +//Path to a file. +QT_QTSQL_INCLUDE_DIR:PATH=/usr/include/QtSql + +//The Qt QTSQL library +QT_QTSQL_LIBRARY:STRING=optimized;/usr/lib64/libQtSql.so;debug;/usr/lib64/libQtSql_debug.so + +//Path to a library. +QT_QTSQL_LIBRARY_DEBUG:FILEPATH=/usr/lib64/libQtSql_debug.so + +//Path to a library. +QT_QTSQL_LIBRARY_RELEASE:FILEPATH=/usr/lib64/libQtSql.so + +//Path to a file. +QT_QTSVG_INCLUDE_DIR:PATH=/usr/include/QtSvg + +//The Qt QTSVG library +QT_QTSVG_LIBRARY:STRING=optimized;/usr/lib64/libQtSvg.so;debug;/usr/lib64/libQtSvg_debug.so + +//Path to a library. +QT_QTSVG_LIBRARY_DEBUG:FILEPATH=/usr/lib64/libQtSvg_debug.so + +//Path to a library. +QT_QTSVG_LIBRARY_RELEASE:FILEPATH=/usr/lib64/libQtSvg.so + +//Path to a file. +QT_QTTEST_INCLUDE_DIR:PATH=/usr/include/QtTest + +//The Qt QTTEST library +QT_QTTEST_LIBRARY:STRING=optimized;/usr/lib64/libQtTest.so;debug;/usr/lib64/libQtTest_debug.so + +//Path to a library. +QT_QTTEST_LIBRARY_DEBUG:FILEPATH=/usr/lib64/libQtTest_debug.so + +//Path to a library. +QT_QTTEST_LIBRARY_RELEASE:FILEPATH=/usr/lib64/libQtTest.so + +//Path to a file. +QT_QTUITOOLS_INCLUDE_DIR:PATH=/usr/include/QtUiTools + +//The Qt QTUITOOLS library +QT_QTUITOOLS_LIBRARY:STRING=optimized;/usr/lib64/libQtUiTools.a;debug;/usr/lib64/libQtUiTools_debug.a + +//Path to a library. +QT_QTUITOOLS_LIBRARY_DEBUG:FILEPATH=/usr/lib64/libQtUiTools_debug.a + +//Path to a library. +QT_QTUITOOLS_LIBRARY_RELEASE:FILEPATH=/usr/lib64/libQtUiTools.a + +//Path to a library. +QT_QTWCODECS_PLUGIN_DEBUG:FILEPATH=QT_QTWCODECS_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_QTWCODECS_PLUGIN_RELEASE:FILEPATH=/usr/lib64/qt4/plugins/codecs/libqtwcodecs.so + +//Path to a file. +QT_QTWEBKIT_INCLUDE_DIR:PATH=/usr/include/QtWebKit + +//The Qt QTWEBKIT library +QT_QTWEBKIT_LIBRARY:STRING=optimized;/usr/lib64/libQtWebKit.so;debug;/usr/lib64/libQtWebKit_debug.so + +//Path to a library. +QT_QTWEBKIT_LIBRARY_DEBUG:FILEPATH=/usr/lib64/libQtWebKit_debug.so + +//Path to a library. +QT_QTWEBKIT_LIBRARY_RELEASE:FILEPATH=/usr/lib64/libQtWebKit.so + +//Path to a file. +QT_QTXMLPATTERNS_INCLUDE_DIR:PATH=/usr/include/QtXmlPatterns + +//The Qt QTXMLPATTERNS library +QT_QTXMLPATTERNS_LIBRARY:STRING=optimized;/usr/lib64/libQtXmlPatterns.so;debug;/usr/lib64/libQtXmlPatterns_debug.so + +//Path to a library. +QT_QTXMLPATTERNS_LIBRARY_DEBUG:FILEPATH=/usr/lib64/libQtXmlPatterns_debug.so + +//Path to a library. +QT_QTXMLPATTERNS_LIBRARY_RELEASE:FILEPATH=/usr/lib64/libQtXmlPatterns.so + +//Path to a file. +QT_QTXML_INCLUDE_DIR:PATH=/usr/include/QtXml + +//The Qt QTXML library +QT_QTXML_LIBRARY:STRING=optimized;/usr/lib64/libQtXml.so;debug;/usr/lib64/libQtXml_debug.so + +//Path to a library. +QT_QTXML_LIBRARY_DEBUG:FILEPATH=/usr/lib64/libQtXml_debug.so + +//Path to a library. +QT_QTXML_LIBRARY_RELEASE:FILEPATH=/usr/lib64/libQtXml.so + +//Path to a library. +QT_QWEBVIEW_PLUGIN_DEBUG:FILEPATH=QT_QWEBVIEW_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_QWEBVIEW_PLUGIN_RELEASE:FILEPATH=/usr/lib64/qt4/plugins/designer/libqwebview.so + +//Path to a library. +QT_QWSTSLIBMOUSEHANDLER_PLUGIN_DEBUG:FILEPATH=QT_QWSTSLIBMOUSEHANDLER_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_QWSTSLIBMOUSEHANDLER_PLUGIN_RELEASE:FILEPATH=QT_QWSTSLIBMOUSEHANDLER_PLUGIN_RELEASE-NOTFOUND + +//Path to a program. +QT_RCC_EXECUTABLE:FILEPATH=/usr/lib64/qt4/bin/rcc + +//Path to a library. +QT_TASKMENUEXTENSION_PLUGIN_DEBUG:FILEPATH=QT_TASKMENUEXTENSION_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_TASKMENUEXTENSION_PLUGIN_RELEASE:FILEPATH=/usr/lib64/qt4/plugins/designer/libtaskmenuextension.so + +//The location of the Qt translations +QT_TRANSLATIONS_DIR:PATH=/usr/share/qt4/translations + +//Path to a program. +QT_UIC3_EXECUTABLE:FILEPATH=/usr/lib64/qt4/bin/uic3 + +//Path to a program. +QT_UIC_EXECUTABLE:FILEPATH=/usr/lib64/qt4/bin/uic-qt4 + +//Path to a library. +QT_WORLDTIMECLOCKPLUGIN_PLUGIN_DEBUG:FILEPATH=QT_WORLDTIMECLOCKPLUGIN_PLUGIN_DEBUG-NOTFOUND + +//Path to a library. +QT_WORLDTIMECLOCKPLUGIN_PLUGIN_RELEASE:FILEPATH=/usr/lib64/qt4/plugins/designer/libworldtimeclockplugin.so + //Enable CGAL component Core WITH_CGAL_Core:BOOL=ON //Enable CGAL component ImageIO -WITH_CGAL_ImageIO:BOOL=OFF +WITH_CGAL_ImageIO:BOOL=ON //Enable CGAL component Qt3 -WITH_CGAL_Qt3:BOOL=OFF +WITH_CGAL_Qt3:BOOL=ON //Enable CGAL component Qt4 -WITH_CGAL_Qt4:BOOL=OFF +WITH_CGAL_Qt4:BOOL=ON //Use the GMP number types if available. WITH_GMP:BOOL=ON @@ -323,6 +953,168 @@ WITH_demos:BOOL=OFF //Select examples WITH_examples:BOOL=OFF +//Path to a file. +X11_ICE_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_ICE_LIB:FILEPATH=X11_ICE_LIB-NOTFOUND + +//Path to a library. +X11_SM_LIB:FILEPATH=X11_SM_LIB-NOTFOUND + +//Path to a file. +X11_X11_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_X11_LIB:FILEPATH=X11_X11_LIB-NOTFOUND + +//Path to a file. +X11_XShm_INCLUDE_PATH:PATH=/usr/include + +//Path to a file. +X11_XTest_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_XTest_LIB:FILEPATH=X11_XTest_LIB-NOTFOUND + +//Path to a file. +X11_Xaccessrules_INCLUDE_PATH:PATH=/usr/include + +//Path to a file. +X11_Xaccessstr_INCLUDE_PATH:PATH=/usr/include + +//Path to a file. +X11_Xau_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xau_LIB:FILEPATH=X11_Xau_LIB-NOTFOUND + +//Path to a file. +X11_Xcomposite_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xcomposite_LIB:FILEPATH=X11_Xcomposite_LIB-NOTFOUND + +//Path to a file. +X11_Xcursor_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xcursor_LIB:FILEPATH=X11_Xcursor_LIB-NOTFOUND + +//Path to a file. +X11_Xdamage_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xdamage_LIB:FILEPATH=X11_Xdamage_LIB-NOTFOUND + +//Path to a file. +X11_Xdmcp_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xdmcp_LIB:FILEPATH=X11_Xdmcp_LIB-NOTFOUND + +//Path to a library. +X11_Xext_LIB:FILEPATH=X11_Xext_LIB-NOTFOUND + +//Path to a file. +X11_Xfixes_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xfixes_LIB:FILEPATH=X11_Xfixes_LIB-NOTFOUND + +//Path to a file. +X11_Xft_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xft_LIB:FILEPATH=X11_Xft_LIB-NOTFOUND + +//Path to a file. +X11_Xi_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xi_LIB:FILEPATH=X11_Xi_LIB-NOTFOUND + +//Path to a file. +X11_Xinerama_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xinerama_LIB:FILEPATH=X11_Xinerama_LIB-NOTFOUND + +//Path to a file. +X11_Xinput_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xinput_LIB:FILEPATH=X11_Xinput_LIB-NOTFOUND + +//Path to a file. +X11_Xkb_INCLUDE_PATH:PATH=/usr/include + +//Path to a file. +X11_Xkblib_INCLUDE_PATH:PATH=/usr/include + +//Path to a file. +X11_Xlib_INCLUDE_PATH:PATH=/usr/include + +//Path to a file. +X11_Xpm_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xpm_LIB:FILEPATH=X11_Xpm_LIB-NOTFOUND + +//Path to a file. +X11_Xrandr_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xrandr_LIB:FILEPATH=X11_Xrandr_LIB-NOTFOUND + +//Path to a file. +X11_Xrender_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xrender_LIB:FILEPATH=X11_Xrender_LIB-NOTFOUND + +//Path to a file. +X11_Xscreensaver_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xscreensaver_LIB:FILEPATH=X11_Xscreensaver_LIB-NOTFOUND + +//Path to a file. +X11_Xshape_INCLUDE_PATH:PATH=/usr/include + +//Path to a file. +X11_Xt_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xt_LIB:FILEPATH=X11_Xt_LIB-NOTFOUND + +//Path to a file. +X11_Xutil_INCLUDE_PATH:PATH=/usr/include + +//Path to a file. +X11_Xv_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xv_LIB:FILEPATH=X11_Xv_LIB-NOTFOUND + +//Path to a library. +X11_Xxf86misc_LIB:FILEPATH=X11_Xxf86misc_LIB-NOTFOUND + +//Path to a file. +X11_dpms_INCLUDE_PATH:PATH=/usr/include + +//Path to a file. +X11_xf86misc_INCLUDE_PATH:PATH=/usr/include + +//Path to a file. +X11_xf86vmode_INCLUDE_PATH:PATH=/usr/include + +//Path to a file. +ZLIB_INCLUDE_DIR:PATH=/usr/include + +//Path to a library. +ZLIB_LIBRARY:FILEPATH=ZLIB_LIBRARY-NOTFOUND + ######################## # INTERNAL cache entries @@ -480,12 +1272,11 @@ CGAL_Core_LIBRARY-ADVANCED:INTERNAL=1 CGAL_Core_LIBRARY_NAME:INTERNAL=libCGAL_Core.so CGAL_EXECUTABLE_TARGETS:INTERNAL= CGAL_ImageIO_3RD_PARTY_DEFINITIONS:INTERNAL= -CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS:INTERNAL= -CGAL_ImageIO_3RD_PARTY_LIBRARIES:INTERNAL= +CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS:INTERNAL=/usr/include +CGAL_ImageIO_3RD_PARTY_LIBRARIES:INTERNAL=/usr/lib/libGLU.so;/usr/lib/libGL.so CGAL_ImageIO_3RD_PARTY_LIBRARIES_DIRS:INTERNAL= //ADVANCED property for variable: CGAL_ImageIO_LIBRARY CGAL_ImageIO_LIBRARY-ADVANCED:INTERNAL=1 -CGAL_ImageIO_LIBRARY:INTERNAL= //Variable hidden from user CGAL_ImageIO_LIBRARY_NAME:INTERNAL=libCGAL_ImageIO.so CGAL_ImageIO_USE_ZLIB:INTERNAL=ON @@ -493,22 +1284,20 @@ CGAL_ImageIO_USE_ZLIB:INTERNAL=ON CGAL_LIBRARY:INTERNAL=/home/lrineau/trunk/Maintenance/infrastructure/matisse.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5.1_F14-m32/lib/libCGAL.so //Variable hidden from user CGAL_LIBRARY_NAME:INTERNAL=libCGAL.so -CGAL_Qt3_3RD_PARTY_DEFINITIONS:INTERNAL= -CGAL_Qt3_3RD_PARTY_INCLUDE_DIRS:INTERNAL= -CGAL_Qt3_3RD_PARTY_LIBRARIES:INTERNAL= +CGAL_Qt3_3RD_PARTY_DEFINITIONS:INTERNAL=-DQT_SHARED;-DQT_NO_DEBUG;-DQT_THREAD_SUPPORT;-D_REENTRANT +CGAL_Qt3_3RD_PARTY_INCLUDE_DIRS:INTERNAL=/usr/lib/qt-3.3/include;/usr/include +CGAL_Qt3_3RD_PARTY_LIBRARIES:INTERNAL=/usr/lib/qt-3.3/lib/libqassistantclient.a;/usr/lib/qt-3.3/lib/libqt-mt.so;dl;-lpthread;/usr/lib/libGLU.so;/usr/lib/libGL.so CGAL_Qt3_3RD_PARTY_LIBRARIES_DIRS:INTERNAL= //ADVANCED property for variable: CGAL_Qt3_LIBRARY CGAL_Qt3_LIBRARY-ADVANCED:INTERNAL=1 -CGAL_Qt3_LIBRARY:INTERNAL= //Variable hidden from user CGAL_Qt3_LIBRARY_NAME:INTERNAL=libCGAL_Qt3.so CGAL_Qt4_3RD_PARTY_DEFINITIONS:INTERNAL= -CGAL_Qt4_3RD_PARTY_INCLUDE_DIRS:INTERNAL= -CGAL_Qt4_3RD_PARTY_LIBRARIES:INTERNAL= +CGAL_Qt4_3RD_PARTY_INCLUDE_DIRS:INTERNAL=/usr/include;/usr/include +CGAL_Qt4_3RD_PARTY_LIBRARIES:INTERNAL=optimized;/usr/lib64/libQtOpenGL.so;debug;/usr/lib64/libQtOpenGL_debug.so;optimized;/usr/lib64/libQtGui.so;debug;/usr/lib64/libQtGui_debug.so;optimized;/usr/lib64/libQtCore.so;debug;/usr/lib64/libQtCore_debug.so;/usr/lib/libGLU.so;/usr/lib/libGL.so CGAL_Qt4_3RD_PARTY_LIBRARIES_DIRS:INTERNAL= //ADVANCED property for variable: CGAL_Qt4_LIBRARY CGAL_Qt4_LIBRARY-ADVANCED:INTERNAL=1 -CGAL_Qt4_LIBRARY:INTERNAL= //Variable hidden from user CGAL_Qt4_LIBRARY_NAME:INTERNAL=libCGAL_Qt4.so //ADVANCED property for variable: CGAL_SONAME_VERSION @@ -572,7 +1361,7 @@ CMAKE_DETERMINE_CXX_ABI_COMPILED:INTERNAL=TRUE //Result of TRY_COMPILE CMAKE_DETERMINE_C_ABI_COMPILED:INTERNAL=TRUE //Path to cache edit program executable. -CMAKE_EDIT_COMMAND:INTERNAL=/usr/bin/cmake-gui +CMAKE_EDIT_COMMAND:INTERNAL=/usr/bin/ccmake //Executable file format CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS @@ -625,7 +1414,7 @@ CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_NM CMAKE_NM-ADVANCED:INTERNAL=1 //number of local generators -CMAKE_NUMBER_OF_LOCAL_GENERATORS:INTERNAL=4 +CMAKE_NUMBER_OF_LOCAL_GENERATORS:INTERNAL=7 //ADVANCED property for variable: CMAKE_OBJCOPY CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_OBJDUMP @@ -650,7 +1439,7 @@ CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 CMAKE_STRIP-ADVANCED:INTERNAL=1 //Suppress Warnings that are meant for the author of the CMakeLists.txt // files. -CMAKE_SUPPRESS_DEVELOPER_WARNINGS:INTERNAL=FALSE +CMAKE_SUPPRESS_DEVELOPER_WARNINGS:INTERNAL=TRUE //uname command CMAKE_UNAME:INTERNAL=/bin/uname //ADVANCED property for variable: CMAKE_USE_RELATIVE_PATHS @@ -659,8 +1448,10 @@ CMAKE_USE_RELATIVE_PATHS-ADVANCED:INTERNAL=1 CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 //Variable hidden from user EXECUTABLE_OUTPUT_PATH:INTERNAL= +//Details about finding OpenGL +FIND_PACKAGE_MESSAGE_DETAILS_OpenGL:INTERNAL=[/usr/lib/libGL.so][v()] //Details about finding Threads -FIND_PACKAGE_MESSAGE_DETAILS_Threads:INTERNAL=[TRUE] +FIND_PACKAGE_MESSAGE_DETAILS_Threads:INTERNAL=[TRUE][v()] //Details about finding X11 FIND_PACKAGE_MESSAGE_DETAILS_X11:INTERNAL=[/usr/lib64/libX11.so][/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include] //Details about finding ZLIB @@ -680,16 +1471,438 @@ MPFR_COMPILE_RES:INTERNAL=TRUE //Result of TRY_RUN MPFR_RUN_RES:INTERNAL=0 //Result of TRY_COMPILE -OPENGL_COMPILE_RES:INTERNAL=FALSE +OPENGL_COMPILE_RES:INTERNAL=TRUE +//ADVANCED property for variable: OPENGL_INCLUDE_DIR +OPENGL_INCLUDE_DIR-ADVANCED:INTERNAL=1 +//Result of TRY_RUN +OPENGL_RUN_RES:INTERNAL=0 +//ADVANCED property for variable: OPENGL_gl_LIBRARY +OPENGL_gl_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: OPENGL_glu_LIBRARY +OPENGL_glu_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: OPENGL_xmesa_INCLUDE_DIR +OPENGL_xmesa_INCLUDE_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT3_INCLUDE_DIR +QT3_INCLUDE_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT3_MOC_EXECUTABLE +QT3_MOC_EXECUTABLE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT3_QASSISTANTCLIENT_LIBRARY +QT3_QASSISTANTCLIENT_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT3_QT_LIBRARY +QT3_QT_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT3_UIC_EXECUTABLE +QT3_UIC_EXECUTABLE-ADVANCED:INTERNAL=1 //Result of TRY_COMPILE -QT4_COMPILE_RES:INTERNAL=FALSE +QT4_COMPILE_RES:INTERNAL=TRUE +//Result of TRY_RUN +QT4_RUN_RES:INTERNAL=0 +//ADVANCED property for variable: QT_ARTHURPLUGIN_PLUGIN_DEBUG +QT_ARTHURPLUGIN_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_ARTHURPLUGIN_PLUGIN_RELEASE +QT_ARTHURPLUGIN_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 QT_BINARY_DIR:INTERNAL=/usr/lib64/qt4/bin //Result of TRY_COMPILE -QT_COMPILE_RES:INTERNAL=FALSE +QT_COMPILE_RES:INTERNAL=TRUE +//ADVANCED property for variable: QT_CONTAINEREXTENSION_PLUGIN_DEBUG +QT_CONTAINEREXTENSION_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_CONTAINEREXTENSION_PLUGIN_RELEASE +QT_CONTAINEREXTENSION_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_CUSTOMWIDGETPLUGIN_PLUGIN_DEBUG +QT_CUSTOMWIDGETPLUGIN_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_CUSTOMWIDGETPLUGIN_PLUGIN_RELEASE +QT_CUSTOMWIDGETPLUGIN_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_DBUSCPP2XML_EXECUTABLE +QT_DBUSCPP2XML_EXECUTABLE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_DBUSXML2CPP_EXECUTABLE +QT_DBUSXML2CPP_EXECUTABLE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_DESIGNER_EXECUTABLE +QT_DESIGNER_EXECUTABLE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_DOC_DIR +QT_DOC_DIR-ADVANCED:INTERNAL=1 QT_HEADERS_DIR:INTERNAL=/usr/include +//ADVANCED property for variable: QT_IMPORTS_DIR +QT_IMPORTS_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_LIBRARY_DIR +QT_LIBRARY_DIR-ADVANCED:INTERNAL=1 +//Qt library dir +QT_LIBRARY_DIR:INTERNAL=/usr/lib64 +//ADVANCED property for variable: QT_LINGUIST_EXECUTABLE +QT_LINGUIST_EXECUTABLE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_LRELEASE_EXECUTABLE +QT_LRELEASE_EXECUTABLE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_LUPDATE_EXECUTABLE +QT_LUPDATE_EXECUTABLE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_MKSPECS_DIR +QT_MKSPECS_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_MOC_EXECUTABLE +QT_MOC_EXECUTABLE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_PHONONWIDGETS_PLUGIN_DEBUG +QT_PHONONWIDGETS_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_PHONONWIDGETS_PLUGIN_RELEASE +QT_PHONONWIDGETS_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_PHONON_INCLUDE_DIR +QT_PHONON_INCLUDE_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_PHONON_LIBRARY +QT_PHONON_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_PHONON_LIBRARY_DEBUG +QT_PHONON_LIBRARY_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_PHONON_LIBRARY_RELEASE +QT_PHONON_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_PHONON_QT7_PLUGIN_DEBUG +QT_PHONON_QT7_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_PHONON_QT7_PLUGIN_RELEASE +QT_PHONON_QT7_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_PLUGINS_DIR +QT_PLUGINS_DIR-ADVANCED:INTERNAL=1 //Have symbol _POSIX_TIMERS QT_POSIX_TIMERS:INTERNAL=1 -QT_QMAKE_EXECUTABLE_LAST:INTERNAL=/usr/lib64/qt-3.3/bin/qmake +//ADVANCED property for variable: QT_QCNCODECS_PLUGIN_DEBUG +QT_QCNCODECS_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QCNCODECS_PLUGIN_RELEASE +QT_QCNCODECS_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QCOLLECTIONGENERATOR_EXECUTABLE +QT_QCOLLECTIONGENERATOR_EXECUTABLE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QCOREWLANBEARER_PLUGIN_DEBUG +QT_QCOREWLANBEARER_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QCOREWLANBEARER_PLUGIN_RELEASE +QT_QCOREWLANBEARER_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QDECLARATIVEVIEW_PLUGIN_DEBUG +QT_QDECLARATIVEVIEW_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QDECLARATIVEVIEW_PLUGIN_RELEASE +QT_QDECLARATIVEVIEW_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QDECORATIONDEFAULT_PLUGIN_DEBUG +QT_QDECORATIONDEFAULT_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QDECORATIONDEFAULT_PLUGIN_RELEASE +QT_QDECORATIONDEFAULT_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QDECORATIONWINDOWS_PLUGIN_DEBUG +QT_QDECORATIONWINDOWS_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QDECORATIONWINDOWS_PLUGIN_RELEASE +QT_QDECORATIONWINDOWS_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QGENERICBEARER_PLUGIN_DEBUG +QT_QGENERICBEARER_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QGENERICBEARER_PLUGIN_RELEASE +QT_QGENERICBEARER_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QGIF_PLUGIN_DEBUG +QT_QGIF_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QGIF_PLUGIN_RELEASE +QT_QGIF_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QGLGRAPHICSSYSTEM_PLUGIN_DEBUG +QT_QGLGRAPHICSSYSTEM_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QGLGRAPHICSSYSTEM_PLUGIN_RELEASE +QT_QGLGRAPHICSSYSTEM_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QICO_PLUGIN_DEBUG +QT_QICO_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QICO_PLUGIN_RELEASE +QT_QICO_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QIMSW_MULTI_PLUGIN_DEBUG +QT_QIMSW_MULTI_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QIMSW_MULTI_PLUGIN_RELEASE +QT_QIMSW_MULTI_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QJPCODECS_PLUGIN_DEBUG +QT_QJPCODECS_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QJPCODECS_PLUGIN_RELEASE +QT_QJPCODECS_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QJPEG_PLUGIN_DEBUG +QT_QJPEG_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QJPEG_PLUGIN_RELEASE +QT_QJPEG_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QKRCODECS_PLUGIN_DEBUG +QT_QKRCODECS_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QKRCODECS_PLUGIN_RELEASE +QT_QKRCODECS_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +QT_QMAKE_EXECUTABLE_LAST:INTERNAL=/usr/bin/qmake-qt4 +//ADVANCED property for variable: QT_QMNG_PLUGIN_DEBUG +QT_QMNG_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QMNG_PLUGIN_RELEASE +QT_QMNG_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QSQLDB2_PLUGIN_DEBUG +QT_QSQLDB2_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QSQLDB2_PLUGIN_RELEASE +QT_QSQLDB2_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QSQLIBASE_PLUGIN_DEBUG +QT_QSQLIBASE_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QSQLIBASE_PLUGIN_RELEASE +QT_QSQLIBASE_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QSQLITE2_PLUGIN_DEBUG +QT_QSQLITE2_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QSQLITE2_PLUGIN_RELEASE +QT_QSQLITE2_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QSQLITE_PLUGIN_DEBUG +QT_QSQLITE_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QSQLITE_PLUGIN_RELEASE +QT_QSQLITE_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QSQLMYSQL_PLUGIN_DEBUG +QT_QSQLMYSQL_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QSQLMYSQL_PLUGIN_RELEASE +QT_QSQLMYSQL_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QSQLOCI_PLUGIN_DEBUG +QT_QSQLOCI_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QSQLOCI_PLUGIN_RELEASE +QT_QSQLOCI_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QSQLODBC_PLUGIN_DEBUG +QT_QSQLODBC_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QSQLODBC_PLUGIN_RELEASE +QT_QSQLODBC_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QSQLPSQL_PLUGIN_DEBUG +QT_QSQLPSQL_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QSQLPSQL_PLUGIN_RELEASE +QT_QSQLPSQL_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QSQLTDS_PLUGIN_DEBUG +QT_QSQLTDS_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QSQLTDS_PLUGIN_RELEASE +QT_QSQLTDS_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QSVGICON_PLUGIN_DEBUG +QT_QSVGICON_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QSVGICON_PLUGIN_RELEASE +QT_QSVGICON_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QSVG_PLUGIN_DEBUG +QT_QSVG_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QSVG_PLUGIN_RELEASE +QT_QSVG_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QT3SUPPORTWIDGETS_PLUGIN_DEBUG +QT_QT3SUPPORTWIDGETS_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QT3SUPPORTWIDGETS_PLUGIN_RELEASE +QT_QT3SUPPORTWIDGETS_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QT3SUPPORT_INCLUDE_DIR +QT_QT3SUPPORT_INCLUDE_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QT3SUPPORT_LIBRARY +QT_QT3SUPPORT_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QT3SUPPORT_LIBRARY_DEBUG +QT_QT3SUPPORT_LIBRARY_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QT3SUPPORT_LIBRARY_RELEASE +QT_QT3SUPPORT_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTACCESSIBLECOMPATWIDGETS_PLUGIN_DEBUG +QT_QTACCESSIBLECOMPATWIDGETS_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTACCESSIBLECOMPATWIDGETS_PLUGIN_RELEASE +QT_QTACCESSIBLECOMPATWIDGETS_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTACCESSIBLEWIDGETS_PLUGIN_DEBUG +QT_QTACCESSIBLEWIDGETS_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTACCESSIBLEWIDGETS_PLUGIN_RELEASE +QT_QTACCESSIBLEWIDGETS_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTASSISTANTCLIENT_INCLUDE_DIR +QT_QTASSISTANTCLIENT_INCLUDE_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTASSISTANTCLIENT_LIBRARY +QT_QTASSISTANTCLIENT_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTASSISTANTCLIENT_LIBRARY_DEBUG +QT_QTASSISTANTCLIENT_LIBRARY_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTASSISTANTCLIENT_LIBRARY_RELEASE +QT_QTASSISTANTCLIENT_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTASSISTANT_INCLUDE_DIR +QT_QTASSISTANT_INCLUDE_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTASSISTANT_LIBRARY +QT_QTASSISTANT_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTASSISTANT_LIBRARY_DEBUG +QT_QTASSISTANT_LIBRARY_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTASSISTANT_LIBRARY_RELEASE +QT_QTASSISTANT_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTCLUCENE_LIBRARY +QT_QTCLUCENE_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTCLUCENE_LIBRARY_DEBUG +QT_QTCLUCENE_LIBRARY_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTCLUCENE_LIBRARY_RELEASE +QT_QTCLUCENE_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTCORE_INCLUDE_DIR +QT_QTCORE_INCLUDE_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTCORE_LIBRARY +QT_QTCORE_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTCORE_LIBRARY_DEBUG +QT_QTCORE_LIBRARY_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTCORE_LIBRARY_RELEASE +QT_QTCORE_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTDBUS_INCLUDE_DIR +QT_QTDBUS_INCLUDE_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTDBUS_LIBRARY +QT_QTDBUS_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTDBUS_LIBRARY_DEBUG +QT_QTDBUS_LIBRARY_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTDBUS_LIBRARY_RELEASE +QT_QTDBUS_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTDECLARATIVE_INCLUDE_DIR +QT_QTDECLARATIVE_INCLUDE_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTDECLARATIVE_LIBRARY +QT_QTDECLARATIVE_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTDECLARATIVE_LIBRARY_DEBUG +QT_QTDECLARATIVE_LIBRARY_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTDECLARATIVE_LIBRARY_RELEASE +QT_QTDECLARATIVE_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR +QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTDESIGNERCOMPONENTS_LIBRARY +QT_QTDESIGNERCOMPONENTS_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTDESIGNERCOMPONENTS_LIBRARY_DEBUG +QT_QTDESIGNERCOMPONENTS_LIBRARY_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE +QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTDESIGNER_INCLUDE_DIR +QT_QTDESIGNER_INCLUDE_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTDESIGNER_LIBRARY +QT_QTDESIGNER_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTDESIGNER_LIBRARY_DEBUG +QT_QTDESIGNER_LIBRARY_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTDESIGNER_LIBRARY_RELEASE +QT_QTDESIGNER_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTGUI_INCLUDE_DIR +QT_QTGUI_INCLUDE_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTGUI_LIBRARY +QT_QTGUI_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTGUI_LIBRARY_DEBUG +QT_QTGUI_LIBRARY_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTGUI_LIBRARY_RELEASE +QT_QTGUI_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTHELP_INCLUDE_DIR +QT_QTHELP_INCLUDE_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTHELP_LIBRARY +QT_QTHELP_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTHELP_LIBRARY_DEBUG +QT_QTHELP_LIBRARY_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTHELP_LIBRARY_RELEASE +QT_QTHELP_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTIFF_PLUGIN_DEBUG +QT_QTIFF_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTIFF_PLUGIN_RELEASE +QT_QTIFF_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTMULTIMEDIA_INCLUDE_DIR +QT_QTMULTIMEDIA_INCLUDE_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTMULTIMEDIA_LIBRARY +QT_QTMULTIMEDIA_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTMULTIMEDIA_LIBRARY_DEBUG +QT_QTMULTIMEDIA_LIBRARY_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTMULTIMEDIA_LIBRARY_RELEASE +QT_QTMULTIMEDIA_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTNETWORK_INCLUDE_DIR +QT_QTNETWORK_INCLUDE_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTNETWORK_LIBRARY +QT_QTNETWORK_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTNETWORK_LIBRARY_DEBUG +QT_QTNETWORK_LIBRARY_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTNETWORK_LIBRARY_RELEASE +QT_QTNETWORK_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTNSPLUGIN_INCLUDE_DIR +QT_QTNSPLUGIN_INCLUDE_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTNSPLUGIN_LIBRARY +QT_QTNSPLUGIN_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTNSPLUGIN_LIBRARY_DEBUG +QT_QTNSPLUGIN_LIBRARY_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTNSPLUGIN_LIBRARY_RELEASE +QT_QTNSPLUGIN_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTOPENGL_INCLUDE_DIR +QT_QTOPENGL_INCLUDE_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTOPENGL_LIBRARY +QT_QTOPENGL_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTOPENGL_LIBRARY_DEBUG +QT_QTOPENGL_LIBRARY_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTOPENGL_LIBRARY_RELEASE +QT_QTOPENGL_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTRACEGRAPHICSSYSTEM_PLUGIN_DEBUG +QT_QTRACEGRAPHICSSYSTEM_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTRACEGRAPHICSSYSTEM_PLUGIN_RELEASE +QT_QTRACEGRAPHICSSYSTEM_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTSCRIPTDBUS_PLUGIN_DEBUG +QT_QTSCRIPTDBUS_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTSCRIPTDBUS_PLUGIN_RELEASE +QT_QTSCRIPTDBUS_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTSCRIPTTOOLS_INCLUDE_DIR +QT_QTSCRIPTTOOLS_INCLUDE_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTSCRIPTTOOLS_LIBRARY +QT_QTSCRIPTTOOLS_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTSCRIPTTOOLS_LIBRARY_DEBUG +QT_QTSCRIPTTOOLS_LIBRARY_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTSCRIPTTOOLS_LIBRARY_RELEASE +QT_QTSCRIPTTOOLS_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTSCRIPT_INCLUDE_DIR +QT_QTSCRIPT_INCLUDE_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTSCRIPT_LIBRARY +QT_QTSCRIPT_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTSCRIPT_LIBRARY_DEBUG +QT_QTSCRIPT_LIBRARY_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTSCRIPT_LIBRARY_RELEASE +QT_QTSCRIPT_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTSQL_INCLUDE_DIR +QT_QTSQL_INCLUDE_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTSQL_LIBRARY +QT_QTSQL_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTSQL_LIBRARY_DEBUG +QT_QTSQL_LIBRARY_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTSQL_LIBRARY_RELEASE +QT_QTSQL_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTSVG_INCLUDE_DIR +QT_QTSVG_INCLUDE_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTSVG_LIBRARY +QT_QTSVG_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTSVG_LIBRARY_DEBUG +QT_QTSVG_LIBRARY_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTSVG_LIBRARY_RELEASE +QT_QTSVG_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTTEST_INCLUDE_DIR +QT_QTTEST_INCLUDE_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTTEST_LIBRARY +QT_QTTEST_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTTEST_LIBRARY_DEBUG +QT_QTTEST_LIBRARY_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTTEST_LIBRARY_RELEASE +QT_QTTEST_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTUITOOLS_INCLUDE_DIR +QT_QTUITOOLS_INCLUDE_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTUITOOLS_LIBRARY +QT_QTUITOOLS_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTUITOOLS_LIBRARY_DEBUG +QT_QTUITOOLS_LIBRARY_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTUITOOLS_LIBRARY_RELEASE +QT_QTUITOOLS_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTWCODECS_PLUGIN_DEBUG +QT_QTWCODECS_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTWCODECS_PLUGIN_RELEASE +QT_QTWCODECS_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTWEBKIT_INCLUDE_DIR +QT_QTWEBKIT_INCLUDE_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTWEBKIT_LIBRARY +QT_QTWEBKIT_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTWEBKIT_LIBRARY_DEBUG +QT_QTWEBKIT_LIBRARY_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTWEBKIT_LIBRARY_RELEASE +QT_QTWEBKIT_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTXMLPATTERNS_INCLUDE_DIR +QT_QTXMLPATTERNS_INCLUDE_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTXMLPATTERNS_LIBRARY +QT_QTXMLPATTERNS_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTXMLPATTERNS_LIBRARY_DEBUG +QT_QTXMLPATTERNS_LIBRARY_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTXMLPATTERNS_LIBRARY_RELEASE +QT_QTXMLPATTERNS_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTXML_INCLUDE_DIR +QT_QTXML_INCLUDE_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTXML_LIBRARY +QT_QTXML_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTXML_LIBRARY_DEBUG +QT_QTXML_LIBRARY_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QTXML_LIBRARY_RELEASE +QT_QTXML_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QWEBVIEW_PLUGIN_DEBUG +QT_QWEBVIEW_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QWEBVIEW_PLUGIN_RELEASE +QT_QWEBVIEW_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QWSTSLIBMOUSEHANDLER_PLUGIN_DEBUG +QT_QWSTSLIBMOUSEHANDLER_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_QWSTSLIBMOUSEHANDLER_PLUGIN_RELEASE +QT_QWSTSLIBMOUSEHANDLER_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_RCC_EXECUTABLE +QT_RCC_EXECUTABLE-ADVANCED:INTERNAL=1 +//Result of TRY_RUN +QT_RUN_RES:INTERNAL=0 +//ADVANCED property for variable: QT_TASKMENUEXTENSION_PLUGIN_DEBUG +QT_TASKMENUEXTENSION_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_TASKMENUEXTENSION_PLUGIN_RELEASE +QT_TASKMENUEXTENSION_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_TRANSLATIONS_DIR +QT_TRANSLATIONS_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_UIC3_EXECUTABLE +QT_UIC3_EXECUTABLE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_UIC_EXECUTABLE +QT_UIC_EXECUTABLE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_WORLDTIMECLOCKPLUGIN_PLUGIN_DEBUG +QT_WORLDTIMECLOCKPLUGIN_PLUGIN_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: QT_WORLDTIMECLOCKPLUGIN_PLUGIN_RELEASE +QT_WORLDTIMECLOCKPLUGIN_PLUGIN_RELEASE-ADVANCED:INTERNAL=1 //Have symbol Q_WS_MAC Q_WS_MAC:INTERNAL= //Have symbol Q_WS_QWS @@ -710,12 +1923,126 @@ Qt_widget_history_h:INTERNAL=/home/lrineau/CGAL/CGAL-I/include/CGAL/IO/Qt_widget Qt_widget_layer_h:INTERNAL=/home/lrineau/CGAL/CGAL-I/include/CGAL/IO/Qt_widget_layer.h //hide this Qt_widget_standard_toolbar_h:INTERNAL=/home/lrineau/CGAL/CGAL-I/include/CGAL/IO/Qt_widget_standard_toolbar.h +//MODIFIED property for variable: WITH_CGAL_ImageIO +WITH_CGAL_ImageIO-MODIFIED:INTERNAL=ON +//MODIFIED property for variable: WITH_CGAL_Qt3 +WITH_CGAL_Qt3-MODIFIED:INTERNAL=ON +//MODIFIED property for variable: WITH_CGAL_Qt4 +WITH_CGAL_Qt4-MODIFIED:INTERNAL=ON +//ADVANCED property for variable: X11_ICE_INCLUDE_PATH +X11_ICE_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_ICE_LIB +X11_ICE_LIB-ADVANCED:INTERNAL=1 //Have library dnet X11_LIB_DNET_HAS_DNET_NTOA:INTERNAL= //Have library dnet_stub X11_LIB_DNET_STUB_HAS_DNET_NTOA:INTERNAL= //Have library /usr/lib64/libX11.so;/usr/lib64/libXext.so X11_LIB_X11_SOLO:INTERNAL= +//ADVANCED property for variable: X11_SM_LIB +X11_SM_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_X11_INCLUDE_PATH +X11_X11_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_X11_LIB +X11_X11_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XShm_INCLUDE_PATH +X11_XShm_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XTest_INCLUDE_PATH +X11_XTest_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XTest_LIB +X11_XTest_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xaccessrules_INCLUDE_PATH +X11_Xaccessrules_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xaccessstr_INCLUDE_PATH +X11_Xaccessstr_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xau_INCLUDE_PATH +X11_Xau_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xau_LIB +X11_Xau_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xcomposite_INCLUDE_PATH +X11_Xcomposite_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xcomposite_LIB +X11_Xcomposite_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xcursor_INCLUDE_PATH +X11_Xcursor_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xcursor_LIB +X11_Xcursor_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xdamage_INCLUDE_PATH +X11_Xdamage_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xdamage_LIB +X11_Xdamage_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xdmcp_INCLUDE_PATH +X11_Xdmcp_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xdmcp_LIB +X11_Xdmcp_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xext_LIB +X11_Xext_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xfixes_INCLUDE_PATH +X11_Xfixes_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xfixes_LIB +X11_Xfixes_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xft_INCLUDE_PATH +X11_Xft_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xft_LIB +X11_Xft_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xi_INCLUDE_PATH +X11_Xi_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xi_LIB +X11_Xi_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xinerama_INCLUDE_PATH +X11_Xinerama_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xinerama_LIB +X11_Xinerama_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xinput_INCLUDE_PATH +X11_Xinput_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xinput_LIB +X11_Xinput_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xkb_INCLUDE_PATH +X11_Xkb_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xkblib_INCLUDE_PATH +X11_Xkblib_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xlib_INCLUDE_PATH +X11_Xlib_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xpm_INCLUDE_PATH +X11_Xpm_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xpm_LIB +X11_Xpm_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xrandr_INCLUDE_PATH +X11_Xrandr_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xrandr_LIB +X11_Xrandr_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xrender_INCLUDE_PATH +X11_Xrender_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xrender_LIB +X11_Xrender_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xscreensaver_INCLUDE_PATH +X11_Xscreensaver_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xscreensaver_LIB +X11_Xscreensaver_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xshape_INCLUDE_PATH +X11_Xshape_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xt_INCLUDE_PATH +X11_Xt_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xt_LIB +X11_Xt_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xutil_INCLUDE_PATH +X11_Xutil_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xv_INCLUDE_PATH +X11_Xv_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xv_LIB +X11_Xv_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xxf86misc_LIB +X11_Xxf86misc_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_dpms_INCLUDE_PATH +X11_dpms_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_xf86misc_INCLUDE_PATH +X11_xf86misc_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_xf86vmode_INCLUDE_PATH +X11_xf86vmode_INCLUDE_PATH-ADVANCED:INTERNAL=1 //Result of TRY_COMPILE ZLIB_COMPILE_RES:INTERNAL=FALSE +//ADVANCED property for variable: ZLIB_INCLUDE_DIR +ZLIB_INCLUDE_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: ZLIB_LIBRARY +ZLIB_LIBRARY-ADVANCED:INTERNAL=1 diff --git a/Maintenance/infrastructure/matisse.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5.1_F14-m32/setup b/Maintenance/infrastructure/matisse.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5.1_F14-m32/setup index f485590893d..9f47f45add3 100644 --- a/Maintenance/infrastructure/matisse.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5.1_F14-m32/setup +++ b/Maintenance/infrastructure/matisse.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5.1_F14-m32/setup @@ -1,2 +1,6 @@ export QTDIR=/usr/lib/qt-3.3 + CXXFLAGS=-m32 +CFLAGS=-m32 +export CXXFLAGS +export CFLAGS diff --git a/Manual/doc_tex/Manual/geom.bib b/Manual/doc_tex/Manual/geom.bib index 1410057becd..aa71e56cfe3 100644 --- a/Manual/doc_tex/Manual/geom.bib +++ b/Manual/doc_tex/Manual/geom.bib @@ -1755,7 +1755,7 @@ cell neighborhood in $O(m)$ time." @inproceedings{acr-icb-03 , author = "Nina Amenta and Sunghee Choi and G{\"u}nter Rote" -, title = "Incremental constructions con BRIO" +, title = "Incremental constructions con {BRIO}" , booktitle = "Proc. 19th Annu. Sympos. Comput. Geom." , year = 2003 , pages = "211-219" @@ -20469,6 +20469,15 @@ $O(n^2)$ in the plane." , update = "98.11 bibrelex" } +@article{bg-sfche-89 +, title = "On the space-filling curve heuristic for the euclidean traveling salesman problem" +, author = "D. Bertsimas and M. Grigni" +, journal = "Operations Research Letters" +, year = 1989 +, volume = 8 +, pages = "241-244" +} + @techreport{bcdtt-hdspd-92t , author = "P. Bertolazzi and R. F. Cohen and G. {Di Battista} and R. Tamassia and I. G. Tollis" , title = "How to Draw a Series-Parallel Digraph" @@ -29187,6 +29196,14 @@ determinants." , update = "96.09 kreveld" } +@article{b-aahsf-71 +, title = "Alternative Algorithm for {H}ilbert's Space-Filling curve" +, author = "Arthur Butz" +, journal = "IEEE Transactions on computers" +, year = 1971 +, pages = "424-425" +} + @article{b-agtg1-76 , author = "A. Bykat" , title = "Automatic generation of triangular grid: {I} --- subdivision of a general polygon into convex subregions; {II} --- triangulation of convex polygons" diff --git a/Manual_tools/doc_tex/cc_manual.tex b/Manual_tools/doc_tex/cc_manual.tex index 824c200b042..3c448390afe 100644 --- a/Manual_tools/doc_tex/cc_manual.tex +++ b/Manual_tools/doc_tex/cc_manual.tex @@ -1440,8 +1440,8 @@ Notably still missing are \verb+\left|+ and similar constructs for arrays. \section{CGAL Related Macros} \subsection{Package Description} -The HTML version of the CGAL Manual allows to give short descriptions for -each CGAL package. It is considered good practice to put the package +The HTML version of the \cgal\ Manual allows to give short descriptions for +each \cgal\ package. It is considered good practice to put the package description in a file called \verb+PkgDescription.tex+. This file has to be included explicitly from the main tex file. @@ -1455,7 +1455,7 @@ enclosed in At least there has to be a summary text given by \verb+\ccPkgSummary{+{\em text}\verb+}+. For the hurried user, small illustrations provide a nice graphical overview of -CGAL packages. It is strongly encouraged to provide such illustrations. +\cgal\ packages. It is strongly encouraged to provide such illustrations. Thumbnails are rendered to the left of the summary and can be clicked to reveal a larger, more detailled image: @@ -1484,7 +1484,7 @@ Packages may have individual licenses. To indicate which one, use \item \verb+\ccLicenseCommercial+ \end{itemize} -Finally, you have the opportunity to let other researchers cite your CGAL package using +Finally, you have the opportunity to let other researchers cite your \cgal\ package using \verb+\ccPkgHowToCiteCgal{+{\em bibkey}\verb+}+. A typical package description may look like this: diff --git a/Matrix_search/doc_tex/Bounding_volumes_ref/spec_rectangular_p_centers.tex b/Matrix_search/doc_tex/Bounding_volumes_ref/spec_rectangular_p_centers.tex index 4021b35fce8..27ade097832 100644 --- a/Matrix_search/doc_tex/Bounding_volumes_ref/spec_rectangular_p_centers.tex +++ b/Matrix_search/doc_tex/Bounding_volumes_ref/spec_rectangular_p_centers.tex @@ -46,11 +46,7 @@ $p$-radius, writes the at most \ccc{p} center points to \ccc{o} and returns the past-the-end iterator of this sequence. - \ccPrecond - \begin{enumerate} - \item The range [\ccc{f}, \ccc{l}) is not empty. - \item 2 $\le$ \ccc{p} $\le$ 4. - \end{enumerate} + \ccPrecond{2 $\le$ \ccc{p} $\le$ 4.} The geometric types and operations to be used for the computation are specified by the traits class parameter \ccc{t}. This parameter diff --git a/Matrix_search/include/CGAL/rectangular_p_center_2.h b/Matrix_search/include/CGAL/rectangular_p_center_2.h index 84321fa62a9..2c9eee477ec 100644 --- a/Matrix_search/include/CGAL/rectangular_p_center_2.h +++ b/Matrix_search/include/CGAL/rectangular_p_center_2.h @@ -356,6 +356,45 @@ rectangular_p_center_matrix_search_2( f, l, o, r, Four_covering_algorithm(), t); } // rectangular_p_center_matrix_search_2(f, l, o, r, p) + +namespace internal{ +template +bool is_distance_greater_than_p + ( Iterator begin,Iterator end, + typename std::iterator_traits::difference_type p, + std::random_access_iterator_tag) +{ + return std::distance(begin,end) > p; +} + +template +bool is_distance_greater_than_p + ( Iterator begin,Iterator end, + typename std::iterator_traits::difference_type p, + std::forward_iterator_tag) +{ + Iterator it=begin; + while(p!=0){ + if (it==end) return false; + ++it; + --p; + } + if (it!=end) return true; + return false; +} + +template +bool is_distance_greater_than_p + (Iterator begin,Iterator end, + typename std::iterator_traits::difference_type p) +{ + return + is_distance_greater_than_p(begin,end,p, + typename std::iterator_traits::iterator_category()); +} + +} //namespace internal + template < class ForwardIterator, class OutputIterator, class Traits > inline OutputIterator rectangular_p_center_2(ForwardIterator f, @@ -366,7 +405,9 @@ rectangular_p_center_2(ForwardIterator f, Traits& t) { CGAL_optimisation_precondition(p >= 2 && p < 5); - + r=0; + if ( !internal::is_distance_greater_than_p(f,l,p) ) return std::copy(f,l,o); + if (p == 2) return rectangular_2_center_2(f, l, o, r, t); else if (p == 3) diff --git a/Mesh_2/doc_tex/Mesh_2_ref/ConformingDelaunayTriangulationTraits_2.tex b/Mesh_2/doc_tex/Mesh_2_ref/ConformingDelaunayTriangulationTraits_2.tex index dd9600803fe..3c885c9b2d5 100644 --- a/Mesh_2/doc_tex/Mesh_2_ref/ConformingDelaunayTriangulationTraits_2.tex +++ b/Mesh_2/doc_tex/Mesh_2_ref/ConformingDelaunayTriangulationTraits_2.tex @@ -61,7 +61,7 @@ points on constrained edges. \ccMethod{Angle_2 angle_2_object();}{} \ccHasModels -Any model of \ccc{Kernel} concept. In particular, all CGAL kernels. +Any model of \ccc{Kernel} concept. In particular, all \cgal\ kernels. \end{ccRefConcept} diff --git a/Mesh_2/doc_tex/Mesh_2_ref/DelaunayMeshTraits_2.tex b/Mesh_2/doc_tex/Mesh_2_ref/DelaunayMeshTraits_2.tex index 9d0f753fde1..538356c76da 100644 --- a/Mesh_2/doc_tex/Mesh_2_ref/DelaunayMeshTraits_2.tex +++ b/Mesh_2/doc_tex/Mesh_2_ref/DelaunayMeshTraits_2.tex @@ -36,7 +36,7 @@ object \ccc{Construct_circumcenter_2}. \ccMethod{Compute_area_2 compute_area_2_object();}{} \ccHasModels -Any model of the \ccc{Kernel} concept. In particular, all CGAL kernels. +Any model of the \ccc{Kernel} concept. In particular, all \cgal\ kernels. \end{ccRefConcept} diff --git a/Mesh_2/include/CGAL/Delaunay_mesh_area_criteria_2.h b/Mesh_2/include/CGAL/Delaunay_mesh_area_criteria_2.h index 4dadb89309f..1d99ea90c93 100644 --- a/Mesh_2/include/CGAL/Delaunay_mesh_area_criteria_2.h +++ b/Mesh_2/include/CGAL/Delaunay_mesh_area_criteria_2.h @@ -32,6 +32,10 @@ class Delaunay_mesh_area_criteria_2 Delaunay_mesh_size_criteria_2. Delaunay_mesh_criteria_2 is a virtual base class of Delaunay_mesh_size_criteria_2. */ { + typedef typename Tr::Geom_traits Geom_traits; + +protected: + Geom_traits traits; public: typedef Delaunay_mesh_criteria_2 Base; typedef Delaunay_mesh_size_criteria_2 Private_base; @@ -39,8 +43,9 @@ public: typedef typename Delaunay_mesh_size_criteria_2::Quality Quality; Delaunay_mesh_area_criteria_2(const double aspect_bound = 0.125, - const double area_bound = 0) - : Private_base(aspect_bound, area_bound) {} + const double area_bound = 0, + const Geom_traits& traits = Geom_traits()) + : Private_base(aspect_bound, area_bound, traits), traits(traits) {} inline double area_bound() const { return this->sizebound; } @@ -58,8 +63,9 @@ public: typedef typename Tr::Face_handle Face_handle; Is_bad(const double aspect_bound, - const double area_bound) - : Is_bad_base(aspect_bound, area_bound) {} + const double area_bound, + const Geom_traits& traits) + : Is_bad_base(aspect_bound, area_bound, traits) {} Mesh_2::Face_badness operator()(Quality q) { @@ -126,7 +132,7 @@ public: }; // end class Is_bad Is_bad is_bad_object() const - { return Is_bad(this->bound(), area_bound()); } + { return Is_bad(this->bound(), area_bound(), traits); } }; } //end namespace diff --git a/Mesh_2/include/CGAL/Delaunay_mesh_criteria_2.h b/Mesh_2/include/CGAL/Delaunay_mesh_criteria_2.h index 7a29d19c50c..c67a13fed72 100644 --- a/Mesh_2/include/CGAL/Delaunay_mesh_criteria_2.h +++ b/Mesh_2/include/CGAL/Delaunay_mesh_criteria_2.h @@ -31,7 +31,7 @@ class Delaunay_mesh_criteria_2 protected: typedef typename Tr::Geom_traits Geom_traits; - const Geom_traits& traits; + Geom_traits traits; public: typedef typename Tr::Face_handle Face_handle; diff --git a/Mesh_2/include/CGAL/Delaunay_mesh_local_size_criteria_2.h b/Mesh_2/include/CGAL/Delaunay_mesh_local_size_criteria_2.h index 1fde2bbbf27..a8ae1d36fc7 100644 --- a/Mesh_2/include/CGAL/Delaunay_mesh_local_size_criteria_2.h +++ b/Mesh_2/include/CGAL/Delaunay_mesh_local_size_criteria_2.h @@ -41,13 +41,16 @@ public: private: bool local; Segment _s; + Geom_traits traits; public: Delaunay_mesh_local_size_criteria_2(const double aspect_bound = 0.125, const double size_bound = 0, const bool is_local_size = false, - const Segment s = Segment()) - : Base(aspect_bound, size_bound), local(is_local_size), _s(s) {} + const Segment s = Segment(), + const Geom_traits& traits = Geom_traits()) + : Base(aspect_bound, size_bound), local(is_local_size), _s(s) + , traits(traits) {} inline Segment segment() const { return _s; } @@ -82,8 +85,9 @@ public: Is_bad(const double aspect_bound, const double size_bound, const bool l, - const Segment_2 _s) - : Base::Is_bad(aspect_bound, size_bound), local(l), s(_s) {} + const Segment_2 _s, + const Geom_traits& traits) + : Base::Is_bad(aspect_bound, size_bound, traits), local(l), s(_s) {} Mesh_2::Face_badness operator()(Quality q) const { @@ -119,7 +123,7 @@ public: }; Is_bad is_bad_object() const - { return Is_bad(this->bound(), this->size_bound(), local, segment()); } + { return Is_bad(this->bound(), this->size_bound(), local, segment(), traits); } }; } //end namespace diff --git a/Mesh_3/demo/Mesh_3/CMakeLists.txt b/Mesh_3/demo/Mesh_3/CMakeLists.txt index 13e544eab66..545ad51d313 100644 --- a/Mesh_3/demo/Mesh_3/CMakeLists.txt +++ b/Mesh_3/demo/Mesh_3/CMakeLists.txt @@ -11,6 +11,9 @@ if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6) endif() endif() +# Let plugins be compiled in the same directory as the executable. +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") + #option(MESH_3_DEMO_ENABLE_FORWARD_DECL "In the Mesh_3 demo, enable " OFF) #mark_as_advanced(MESH_3_DEMO_ENABLE_FORWARD_DECL) diff --git a/Mesh_3/demo/Mesh_3/Io_implicit_function_plugin.cpp b/Mesh_3/demo/Mesh_3/Io_implicit_function_plugin.cpp index 2651d825754..7f4d381e142 100644 --- a/Mesh_3/demo/Mesh_3/Io_implicit_function_plugin.cpp +++ b/Mesh_3/demo/Mesh_3/Io_implicit_function_plugin.cpp @@ -164,7 +164,14 @@ Io_implicit_function_plugin:: load_function_plugins() { QDir pluginsDir(qApp->applicationDirPath()); - if ( !pluginsDir.cd("implicit_functions") ) { return; } + QString dirname = pluginsDir.dirName(); + if ( !pluginsDir.cd("implicit_functions") ) { + // In that case, dirname may be "Debug" or "Release" and one has to + // search in ../implicit_functions/Debug or + // ../implicit_functions/Release + QString newDir = QString("../implicit_functions/") + dirname; + if( !pluginsDir.cd(newDir) ) return; + } Q_FOREACH (QString fileName, pluginsDir.entryList(QDir::Files)) { diff --git a/Mesh_3/demo/Mesh_3/MainWindow.cpp b/Mesh_3/demo/Mesh_3/MainWindow.cpp index e89b340687a..e275bc4122e 100644 --- a/Mesh_3/demo/Mesh_3/MainWindow.cpp +++ b/Mesh_3/demo/Mesh_3/MainWindow.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -550,3 +551,27 @@ void MainWindow::setAddKeyFrameKeyboardModifiers(::Qt::KeyboardModifiers m) { viewer->setAddKeyFrameKeyboardModifiers(m); } + +void MainWindow::on_actionCopy_snapshot_triggered() +{ + // copy snapshot to clipboard + QApplication::setOverrideCursor(Qt::WaitCursor); + QClipboard *qb = QApplication::clipboard(); + viewer->makeCurrent(); + viewer->raise(); + QImage snapshot = viewer->grabFrameBuffer(true); + qb->setImage(snapshot); + QApplication::restoreOverrideCursor(); +} + +void MainWindow::on_actionSave_snapshot_triggered() +{ + // save snapshot to file + QApplication::setOverrideCursor(Qt::WaitCursor); + QString filename = QFileDialog::getSaveFileName(this,tr("Save snapshot to file..."),"snapshot00.png","*.png"); + viewer->saveSnapshot(filename); + QApplication::restoreOverrideCursor(); +} + + + diff --git a/Mesh_3/demo/Mesh_3/MainWindow.h b/Mesh_3/demo/Mesh_3/MainWindow.h index a345ae1eb21..48d9612fc84 100644 --- a/Mesh_3/demo/Mesh_3/MainWindow.h +++ b/Mesh_3/demo/Mesh_3/MainWindow.h @@ -62,6 +62,10 @@ protected slots: void readSettings(); void writeSettings(); + // snapshot + void on_actionCopy_snapshot_triggered(); + void on_actionSave_snapshot_triggered(); + // load, erase, duplicate void on_actionEraseAll_triggered(); void on_actionLoad_triggered(); diff --git a/Mesh_3/demo/Mesh_3/implicit_functions/CMakeLists.txt b/Mesh_3/demo/Mesh_3/implicit_functions/CMakeLists.txt index 4f9b7ebcfb1..3a08b852110 100644 --- a/Mesh_3/demo/Mesh_3/implicit_functions/CMakeLists.txt +++ b/Mesh_3/demo/Mesh_3/implicit_functions/CMakeLists.txt @@ -11,6 +11,9 @@ if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6) endif() endif() +# Let plugins be compiled in the same directory as the executable. +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") + # Include directory of demo includes include_directories( BEFORE ${Mesh_3_implicit_functions_BINARY_DIR} ../include ) diff --git a/Mesh_3/demo/Mesh_3/ui_files/MainWindow.ui b/Mesh_3/demo/Mesh_3/ui_files/MainWindow.ui index 551a8eee278..b6d6dcc1aed 100644 --- a/Mesh_3/demo/Mesh_3/ui_files/MainWindow.ui +++ b/Mesh_3/demo/Mesh_3/ui_files/MainWindow.ui @@ -14,7 +14,7 @@ CGAL 3D mesh generator demo - + :/cgal/icons/resources/cgal_logo.xpm:/cgal/icons/resources/cgal_logo.xpm @@ -37,7 +37,7 @@ 0 0 978 - 22 + 21 @@ -59,6 +59,9 @@ + + + @@ -125,7 +128,7 @@ + - + :/cgal/icons/plus:/cgal/icons/plus @@ -136,7 +139,7 @@ - - + :/cgal/icons/minus:/cgal/icons/minus @@ -147,7 +150,7 @@ ... - + :/cgal/icons/duplicate:/cgal/icons/duplicate @@ -312,7 +315,7 @@ - + :/cgal/icons/plus:/cgal/icons/plus @@ -324,7 +327,7 @@ - + :/cgal/icons/minus:/cgal/icons/minus @@ -336,7 +339,7 @@ - + :/cgal/icons/duplicate:/cgal/icons/duplicate @@ -498,7 +501,7 @@ - Odt-smoothing + ODT-smoothing @@ -521,12 +524,22 @@ toto + + + Copy snapshot + + + + + Save snapshot + + Viewer QWidget -
CGAL_demo/Viewer.h
+
CGAL_demo/Viewer.h
diff --git a/Mesh_3/doc_tex/Mesh_3/mesh_3_user.tex b/Mesh_3/doc_tex/Mesh_3/mesh_3_user.tex index 65a4bc687dc..c4c49e136d2 100644 --- a/Mesh_3/doc_tex/Mesh_3/mesh_3_user.tex +++ b/Mesh_3/doc_tex/Mesh_3/mesh_3_user.tex @@ -865,7 +865,7 @@ with 32GB of RAM. The program has been compiled with g++ v4.3.2 with the -O3 opt Note that our implementation does not take advantage of multi-core architectures. -Those benchmarks have been done using CGAL v3.8. +Those benchmarks have been done using \cgal\ v3.8. \subsection{Delaunay refinement} @@ -969,7 +969,7 @@ shows the mesh obtained for size set to 4. \subsubsection{Theoretical foundations} -The CGAL mesh generation package implements a meshing engine based +The \cgal\ mesh generation package implements a meshing engine based on the method of Delaunay refinement introduced by Chew~\cite{c-gqmgc-93} and Ruppert~\cite{r-draq2d-95} and pioneered in 3D by Shewchuk~\cite{s-tmgdr-98}. It uses the notion of restricted Delaunay triangulation diff --git a/Mesh_3/include/CGAL/Mesh_3/Mesh_complex_3_in_triangulation_3_base.h b/Mesh_3/include/CGAL/Mesh_3/Mesh_complex_3_in_triangulation_3_base.h index c43f3db6768..5cdc8062033 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Mesh_complex_3_in_triangulation_3_base.h +++ b/Mesh_3/include/CGAL/Mesh_3/Mesh_complex_3_in_triangulation_3_base.h @@ -112,6 +112,11 @@ public: /// Removes facet \c facet from 2D complex void remove_from_complex(const Facet& facet); + /// Removes facet(\c cell, \c i) from 2D complex + void remove_from_complex(const Cell_handle& c, const int i) { + remove_from_complex(Facet(c, i)); + } + /// Sets surface index of facet \c facet to \c index void set_surface_patch_index(const Facet& f, const Surface_patch_index& index) { @@ -294,19 +299,20 @@ private: class Facet_iterator_not_in_complex { - const Self& c3t3_; - const Surface_patch_index index_; + const Self* c3t3_; + Surface_patch_index index_; //need by SWIG: should be const Surface_patch_index public: + Facet_iterator_not_in_complex(){} //need by SWIG Facet_iterator_not_in_complex(const Self& c3t3, const Surface_patch_index& index = Surface_patch_index()) - : c3t3_(c3t3) + : c3t3_(&c3t3) , index_(index) { } template bool operator()(Iterator it) const { - if ( index_ == Surface_patch_index() ) { return ! c3t3_.is_in_complex(*it); } - else { return c3t3_.surface_patch_index(*it) != index_; } + if ( index_ == Surface_patch_index() ) { return ! c3t3_->is_in_complex(*it); } + else { return c3t3_->surface_patch_index(*it) != index_; } } }; @@ -317,8 +323,9 @@ private: class Cell_not_in_complex { const Self* r_self_; - Subdomain_index index_; + Subdomain_index index_;//needed by SWIG, should be const Subdomain_index public: + Cell_not_in_complex(){}//needed by SWIG Cell_not_in_complex(const Self& self, const Subdomain_index& index = Subdomain_index()) : r_self_(&self) @@ -388,7 +395,7 @@ public: Self operator++(int) { Self tmp(*this); ++(*this); return tmp; } Self operator--(int) { Self tmp(*this); --(*this); return tmp; } - operator Cell_handle() { return Cell_handle(this->base()); } + operator Cell_handle() const { return Cell_handle(this->base()); } }; // end class Cells_in_complex_iterator @@ -423,7 +430,7 @@ public: typedef Surface_patch_index Surface_index; void set_surface_index(const Facet& f, const Surface_index& index) - { set_surface_patch_index(f.first, index); } + { set_surface_patch_index(f, index); } void set_surface_index(const Cell_handle& c, const int i, const Surface_index& index) { set_surface_patch_index(c,i,index); } diff --git a/Mesh_3/test/Mesh_3/test_c3t3.cpp b/Mesh_3/test/Mesh_3/test_c3t3.cpp index cec0c72e963..c2f37f463c9 100644 --- a/Mesh_3/test/Mesh_3/test_c3t3.cpp +++ b/Mesh_3/test/Mesh_3/test_c3t3.cpp @@ -301,11 +301,19 @@ struct Tester c3t3.set_subdomain_index(ch, subdomain_index_bis); c3t3.set_surface_patch_index(f2, surface_patch_index_bis); +#ifndef CGAL_MESH_3_NO_DEPRECATED_SURFACE_INDEX + c3t3.set_surface_index(f2, surface_patch_index_bis); + c3t3.set_surface_index(f2.first, f2.second, surface_patch_index_bis); +#endif c3t3.set_dimension(vh, 1); c3t3.set_index(vh, vertex_index); assert(c3t3.subdomain_index(ch) == subdomain_index_bis); assert(c3t3.surface_patch_index(f2) == surface_patch_index_bis); +#ifndef CGAL_MESH_3_NO_DEPRECATED_SURFACE_INDEX + assert(c3t3.surface_index(f2) == surface_patch_index_bis); + assert(c3t3.surface_index(f2.first, f2.second) == surface_patch_index_bis); +#endif assert(c3t3.in_dimension(vh) == 1); assert(c3t3.index(vh) == vertex_index); diff --git a/Minkowski_sum_3/doc_tex/Minkowski_sum_3/main.tex b/Minkowski_sum_3/doc_tex/Minkowski_sum_3/main.tex index 9dd0524bbae..fd2b6c50427 100644 --- a/Minkowski_sum_3/doc_tex/Minkowski_sum_3/main.tex +++ b/Minkowski_sum_3/doc_tex/Minkowski_sum_3/main.tex @@ -128,7 +128,7 @@ $O(n^3m^3)$ time. Since the computation of the Minkowski sum takes quite some time, we give the running times of some Minkowski sum computations. They were -computed with CGAL 3.3 on a machine with a 2.4 GHz AMD Opteron +computed with \cgal\ 3.3 on a machine with a 2.4 GHz AMD Opteron processor and 4 GB RAM. The code was compiled with g++ 3.2 and compiler options -O2. The \ccc{Nef\_polyhedron\_3} class was instantiated with the geometric @@ -234,7 +234,7 @@ selection mark without spoiling the correctness of the Minkowski sum. \section{Usage} The function \ccc{minkowski_sum_3} should be used with the -\ccc{Extact_predicates_exact_constructions_kernel}, which often is +\ccc{Exact_predicates_exact_constructions_kernel}, which often is the most efficient choice and allows floating-point input. Consult Section~\label{sectionNef_3IO} for more details. diff --git a/Nef_2/doc_tex/Nef_2/user.tex b/Nef_2/doc_tex/Nef_2/user.tex index 4a7499c0d5b..2fa423bfe87 100644 --- a/Nef_2/doc_tex/Nef_2/user.tex +++ b/Nef_2/doc_tex/Nef_2/user.tex @@ -62,7 +62,7 @@ operations. In the following examples skip the typedefs at the beginning at first and take the types \ccc{Point} and \ccc{Line} to be models of the -standard two-dimensional CGAL kernel (\ccc{CGAL::Point_2} +standard two-dimensional \cgal\ kernel (\ccc{CGAL::Point_2} and \ccc{CGAL::Line_2}). Their user interface is thus defined in the corresponding reference pages. diff --git a/Nef_2/doc_tex/Nef_2_ref/Nef_polyhedron_2.tex b/Nef_2/doc_tex/Nef_2_ref/Nef_polyhedron_2.tex index ce16f0c8a3d..95329faa7e1 100644 --- a/Nef_2/doc_tex/Nef_2_ref/Nef_polyhedron_2.tex +++ b/Nef_2/doc_tex/Nef_2_ref/Nef_polyhedron_2.tex @@ -264,7 +264,7 @@ construct the intersection of two halfspaces. After line (*) \ccc{N3} is the intersection of \ccc{N1} and \ccc{N2}. The member types of \ccc{Nef_polyhedron_2< Extended_homogeneous >} -map to corresponding types of the standard CGAL geometry kernel +map to corresponding types of the standard \cgal\ geometry kernel (type equality in pseudo-code notation): \begin{ccExampleCode} CGAL::Nef_polyhedron_2< CGAL::Extended_cartesian >::Point diff --git a/Nef_3/doc_tex/Nef_3_ref/Nef_polyhedron_3.tex b/Nef_3/doc_tex/Nef_3_ref/Nef_polyhedron_3.tex index 662a3a2a9d3..9e2822b0909 100644 --- a/Nef_3/doc_tex/Nef_3_ref/Nef_polyhedron_3.tex +++ b/Nef_3/doc_tex/Nef_3_ref/Nef_polyhedron_3.tex @@ -105,7 +105,7 @@ template parameters. \ccGlue \ccNestedType{SHalfedge_around_sface_const_circulator}{non-mutable circulator of shalfedges around a sface (ccw).} \ccGlue -\ccNestedType{SHalfedge_aroud_facet_const_circulator}{non-mutable circulator of shalfedges around a halffacet (ccw).} +\ccNestedType{SHalfedge_around_facet_const_circulator}{non-mutable circulator of shalfedges around a halffacet (ccw).} \ccGlue \ccNestedType{SFace_cycle_const_iterator}{non-mutable iterator over the cylces of a sface.} \ccGlue diff --git a/Nef_3/doc_tex/Nef_3_ref/Nef_polyhedron_3_Halfedge.tex b/Nef_3/doc_tex/Nef_3_ref/Nef_polyhedron_3_Halfedge.tex index d79b00da4a9..b4ecd69a550 100644 --- a/Nef_3/doc_tex/Nef_3_ref/Nef_polyhedron_3_Halfedge.tex +++ b/Nef_3/doc_tex/Nef_3_ref/Nef_polyhedron_3_Halfedge.tex @@ -91,7 +91,7 @@ class \ccc{Nef_polyhedron_3} manages the needed halfedges internally. \ccMethod{Halfedge_const_handle twin() const;}{the twin of \ccVar\ .} \ccMethod{SHalfedge_const_handle out_sedge() const;} -{the first out sedege of \ccVar\ .} +{the first out sedge of \ccVar\ .} \ccMethod{SFace_const_handle incident_sface() const;} {the incident sface of \ccVar\ .} diff --git a/Nef_3/include/CGAL/Nef_3/SNC_simplify.h b/Nef_3/include/CGAL/Nef_3/SNC_simplify.h index 9cfbf8ae5f2..b764dfacf03 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_simplify.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_simplify.h @@ -590,7 +590,22 @@ class SNC_simplify_base : public SNC_decorator { SHalfloop_handle sl; CGAL_forall_shalfloops(sl, *this->sncp()) { SM_decorator SD(&*sl->incident_sface()->center_vertex()); - SD.store_sm_boundary_object( sl, sl->incident_sface()); + //I added the following 'if' because even if the map has been cleared, when merging edges + //if one sloop is created and the vertex not simplified, then the map is updated. + //In the example below, the edge e is removed and a sloop is create on the sphere map + //of a vertex v. But since three edges are still incident to v, v is not simplified. + //There is one point where the distance between two non-edge-adjacent facets is 0. + // + // | | + // | | \ | / | | + // | / \ | / | / + // | / \|/ | / + // | / / | / + // | / / e | / + // |/______/_______|/ + // + if (!SD.map()->is_sm_boundary_object(sl)) + SD.store_sm_boundary_object( sl, sl->incident_sface()); } } diff --git a/Nef_S2/doc_tex/Nef_S2_ref/Nef_polyhedron_S2_SVertex.tex b/Nef_S2/doc_tex/Nef_S2_ref/Nef_polyhedron_S2_SVertex.tex index e93bec58c52..075a5376472 100644 --- a/Nef_S2/doc_tex/Nef_S2_ref/Nef_polyhedron_S2_SVertex.tex +++ b/Nef_S2/doc_tex/Nef_S2_ref/Nef_polyhedron_S2_SVertex.tex @@ -60,7 +60,7 @@ class \ccc{Nef_polyhedron_S2} manages the needed svertices internally. \ccMethod{SVertex_const_handle twin() const;}{the twin of \ccVar\ .} \ccMethod{SHalfedge_const_handle out_sedge() const;} -{the first out sedege of \ccVar\ .} +{the first out sedge of \ccVar\ .} \ccMethod{SFace_const_handle incident_sface() const;} {the incident sface of \ccVar\ .} diff --git a/Nef_S2/include/CGAL/Nef_S2/SM_point_locator.h b/Nef_S2/include/CGAL/Nef_S2/SM_point_locator.h index 69f54b2ebe1..494cd701075 100644 --- a/Nef_S2/include/CGAL/Nef_S2/SM_point_locator.h +++ b/Nef_S2/include/CGAL/Nef_S2/SM_point_locator.h @@ -92,9 +92,8 @@ public: typedef typename Decorator_traits::SVertex_handle SVertex_handle; typedef typename Decorator_traits::SHalfedge_handle SHalfedge_handle; typedef typename Decorator_traits::SHalfloop_handle SHalfloop_handle; - typedef typename Decorator_traits::SHalfloop_const_handle SHalfloop_const_handle; typedef typename Decorator_traits::SFace_handle SFace_handle; - typedef typename Decorator_traits::SFace_const_handle SFace_const_handle; + typedef typename Decorator_traits::SVertex_iterator SVertex_iterator; typedef typename Decorator_traits::SHalfedge_iterator SHalfedge_iterator; @@ -182,7 +181,7 @@ public: enum SOLUTION { is_vertex_, is_edge_, is_loop_ }; // enumeration for internal use - Object_handle locate(const Sphere_point& p, bool skipVEL = false) const + Object_handle locate(const Sphere_point& p, bool skipVEL = false) /*{\Mop returns a generic handle |h| to an object (vertex, halfedge, face) of the underlying plane map |P| which contains the point |p = s.source()| in its relative interior. |s.target()| must be a point @@ -209,7 +208,7 @@ public: if ( this->has_shalfloop() && this->shalfloop()->circle().has_on(p)) { CGAL_NEF_TRACEN( " on loop"); - return make_object(SHalfloop_const_handle(this->shalfloop())); + return make_object(SHalfloop_handle(this->shalfloop())); } } @@ -224,7 +223,7 @@ public: SVertex_handle v_res; SHalfedge_handle e_res; - SHalfloop_const_handle l_res(this->shalfloop()); + SHalfloop_handle l_res(this->shalfloop()); SOLUTION solution; CGAL_NEF_TRACEN(" on face..."); @@ -312,7 +311,7 @@ public: case is_edge_: return make_object(SFace_handle(e_res->incident_sface())); case is_loop_: - return make_object(SFace_const_handle(l_res->incident_sface())); + return make_object(SFace_handle(l_res->incident_sface())); case is_vertex_: return make_object(SFace_handle(v_res->incident_sface())); default: CGAL_error_msg("missing solution."); @@ -320,6 +319,7 @@ public: return Object_handle(); // never reached! } +#if 0 //THIS CODE DOES NOT SEEM TO BE USED template Object_handle ray_shoot(const Sphere_point& p, const Sphere_direction& d, @@ -336,7 +336,7 @@ public: { Sphere_circle c(d.circle()); Sphere_segment s; - Object_handle h = this->locate(p); + Object_handle h = locate(p); SVertex_handle v; SHalfedge_handle e; SHalfloop_handle l; @@ -404,7 +404,8 @@ public: CGAL_error_msg("not yet correct"); return h; } - +#endif + Object_handle ray_shoot(const Sphere_point& p, const Sphere_circle& c, Sphere_point& ip, diff --git a/Number_types/doc_tex/NumberTypeSupport/Numbertype.tex b/Number_types/doc_tex/NumberTypeSupport/Numbertype.tex index 3965dae40e8..a5bf297bf8f 100644 --- a/Number_types/doc_tex/NumberTypeSupport/Numbertype.tex +++ b/Number_types/doc_tex/NumberTypeSupport/Numbertype.tex @@ -67,9 +67,9 @@ A number type for doing interval arithmetic, \ccc{Interval_nt}, is provided. This number type helps in doing arithmetic filtering in many places such as \ccc{Filtered_predicate}. -%CGAL::Root_of_2 -\ccc{CGAL::Root_of_2} is a number type that allows to represent algebraic -numbers of degree up to~2 over a \ccc{RingNumberType}. A generic function +%CGAL::Sqrt_extension +\ccc{CGAL::Sqrt_extension} is a number type that allows to represent algebraic +numbers of degree 2 as well as nested forms. A generic function \ccc{CGAL::make_root_of_2} allows to build this type generically. %CGAL::Number_type_checker @@ -101,7 +101,7 @@ a fixed-precision floating-point number type. Since the precision for each object, the result of each operation is rounded when necessary. Though not necessary at first, the user will take full advantage of this number type by understanding the ideas behind floating-point arithmetic, -such as precision and rounding, and understandig the flags set by this +such as precision and rounding, and understanding the flags set by this library after each operation. For more details, the reader should refer to \cite{cgal:mt-mpfr} and the \ccc{Gmpfr} reference manual. @@ -229,16 +229,17 @@ the \ccc{mpz_class} and \ccc{mpq_class} types from \gmp. Number type concepts were then refined, notably by Lutz Kettner and Susan Hert, who also contributed utility algorithms. -The \ccc{Root_of_2} class was contributed by Sylvain Pion and Monique Teillaud -around 2005, and was later improved with the help of Pedro Machado Manh\~aes -de Castro. The class \ccc{Sqrt_extension} was then contributed by Michael -Hemmer and Ron Wein. - The work on concepts was further extended within the \exacus\ project, and was finally contributed to \cgal\ by Michael Hemmer in 2006, as what is now the separate Algebraic Foundations package~\ref{ChapterAlgebraicFoundations}, together with a rewritten interface to operations on number types. +The class \ccc{Sqrt_extension} was contributed by Michael Hemmer and Ron Wein around 2006. In 2010 it went through a considerable reinvestigation by S\'ebastien Loriot, Michael Hemmer, and Monique Teillaud. As a result it got further improved and now replaces several similar types such as \ccc{Root_of_2}, which had been contributed by Pedro M. M. de Castro, Sylvain Pion and Monique Teillaud, and is deprecated since CGAL-3.8. + +%The \ccc{Root_of_2} class was contributed by Sylvain Pion and Monique Teillaud +%around 2005, and was later improved with the help of Pedro Machado Manh\~aes +%de Castro. + In 2008-2010, Bernd G\"artner added the \ccc{Gmpzf} class, while Luis Pe\~naranda and Sylvain Lazard contributed the \ccc{Gmpfi} and \ccc{Gmpfr} classes. diff --git a/Number_types/doc_tex/NumberTypeSupport_ref/Gmpfi.tex b/Number_types/doc_tex/NumberTypeSupport_ref/Gmpfi.tex index 9576eae36ab..99d476f309a 100644 --- a/Number_types/doc_tex/NumberTypeSupport_ref/Gmpfi.tex +++ b/Number_types/doc_tex/NumberTypeSupport_ref/Gmpfi.tex @@ -3,7 +3,7 @@ \ccDefinition -An object of the class \ccc{Gmpfi} is a closed interval, whith endpoints +An object of the class \ccc{Gmpfi} is a closed interval, with endpoints represented as \ccc{Gmpfr} floating-point numbers. An interval can have finite or infinite endpoints and its meaning is straightforward. It can also have one (or both) \ccc{NaN} endpoint(s): this indicates that an @@ -167,7 +167,7 @@ Other arithmetic functions provided by the class are: \ccMethod{std::pair to_interval()const;} {Returns an interval of doubles which contains \ccVar. If a - rounded enpoint does not fit in a double, sets its value to plus + rounded endpoint does not fit in a double, sets its value to plus or minus infinity and the \ccc{overflow} or \ccc{underflow} flag.} \ccMethod{std::pair to_double_exp()const;} diff --git a/Number_types/doc_tex/NumberTypeSupport_ref/Gmpfr.tex b/Number_types/doc_tex/NumberTypeSupport_ref/Gmpfr.tex index 3a1481f75db..a1fa9cca5ad 100644 --- a/Number_types/doc_tex/NumberTypeSupport_ref/Gmpfr.tex +++ b/Number_types/doc_tex/NumberTypeSupport_ref/Gmpfr.tex @@ -264,7 +264,7 @@ Other arithmetic functions provided by the class are: \ccMethod{std::pair to_interval();} {Returns an interval of doubles which contains \ccVar. If a - rounded enpoint does not fit in a double, the double is set to plus + rounded endpoint does not fit in a double, the double is set to plus or minus infinity and the \ccc{overflow} or \ccc{underflow} flag.} \ccMethod{std::pair to_double_exp diff --git a/Number_types/doc_tex/NumberTypeSupport_ref/Interval_nt.tex b/Number_types/doc_tex/NumberTypeSupport_ref/Interval_nt.tex index 46ada328b55..12295eed022 100644 --- a/Number_types/doc_tex/NumberTypeSupport_ref/Interval_nt.tex +++ b/Number_types/doc_tex/NumberTypeSupport_ref/Interval_nt.tex @@ -29,7 +29,7 @@ So each variable is an interval representing any value inside the interval. All arithmetic operations (+, -, $*$, $/$, $\sqrt{}$, \ccc{square()}, \ccc{min()}, \ccc{max()} and \ccc{abs()}) on intervals preserve the inclusion. This property can be expressed by the following formula ($x$ and $y$ are -reals, $X$ and $Y$ are intervals, $\mathcal{OP}$ is an arithmetic operation): +real, $X$ and $Y$ are intervals, $\mathcal{OP}$ is an arithmetic operation): $$ \forall\ x \in X, \forall\ y \in Y, (x\ \mathcal{OP}\ y) @@ -118,7 +118,7 @@ The comparison operators ($<$, $>$, $<=$, $>=$, $==$, $!=$, \ccc{sign()} and \ccc{compare()}) have the following semantic: it is the intuitive one when for all couples of values in both intervals, the comparison is identical (case of non-overlapping intervals). This can be expressed -by the following formula ($x$ and $y$ are reals, $X$ and $Y$ are +by the following formula ($x$ and $y$ are real, $X$ and $Y$ are intervals, $\mathcal{OP}$ is a comparison operator): $$ @@ -134,7 +134,7 @@ $$ Otherwise, the comparison is not safe, and we specify this by returning a type encoding this uncertainty, namely using \ccc{Uncertain} or \ccc{Uncertain}, which -can be probed for uncertainty explicitely, and which has a conversion to +can be probed for uncertainty explicitly, and which has a conversion to the normal type (e.g. \ccc{bool}) which throws an exception when the conversion is not certain. Note that each failed conversion increments a profiling counter (see \ccc{CGAL_PROFILE}), and then throws the exception of @@ -159,7 +159,7 @@ type \ccc{unsafe_comparison}. \ccFunction{Uncertain sign(Interval_nt i);}{} \ccTypedef{typedef Interval_nt Interval_nt_advanced;} -{This typedef (at namespace CGAL scope) exists for backward compatibility, +{This typedef (at namespace \cgal\ scope) exists for backward compatibility, as well as removing the need to remember the Boolean value for the template parameter.} diff --git a/Number_types/doc_tex/NumberTypeSupport_ref/RootOf_2.tex b/Number_types/doc_tex/NumberTypeSupport_ref/RootOf_2.tex index 7fe4d29e14e..fa5bd4a4aad 100644 --- a/Number_types/doc_tex/NumberTypeSupport_ref/RootOf_2.tex +++ b/Number_types/doc_tex/NumberTypeSupport_ref/RootOf_2.tex @@ -2,71 +2,73 @@ \ccDefinition -Concept to represent algebraic numbers of -degree up to~2 over a \ccc{RingNumberType} denoted as \ccc{RT}. +Concept to represent algebraic numbers of degree up to~2 over a \ccc{RealEmbeddable} \ccc{IntegralDomain} \ccc{RT}. -%\ccc{FT} denotes the \ccc{FieldNumberType} constructed from \ccc{RT}. -%\footnote{see \ccc{make_rational}, we need something to get FT from RT in a clean way.} +A model of this concept is associated to this \ccc{RT} via \ccc{CGAL::Root_of_traits}, which +provides \ccc{Root_of_2} as a public type. Moreover, \ccc{CGAL::Root_of_traits} provides +the public type \ccc{Root_of_1}, which is the quotient field of \ccc{RT}. +We refer to \ccc{Root_of_1} as {FT} (for field type). -\ccCreation +The model of \ccc{RootOf_2 } is a \ccc{RealEmbeddable} \ccc{IntegralDomain}, + which is \ccc{ImplicitInteroperable} with \ccc{RT}, \ccc{FT}. +In particular, it provides the comparison operators \ccc{==, !=, <, >, <=, >=} as well as the \ccc{sign} +and \ccc{compare} functions needed to compare elements of types \ccc{RootOf_2, RT} and \ccc{FT}. +It also provides all arithmetic operators \ccc{+,-,*,/} among elements of type \ccc{RootOf_2} as well as mixed forms with \ccc{RT} and \ccc{FT}. -%\footnote{How to get RT...?} +However, it is important to note that arithmetic operations among elements of \ccc{RootOf_2} +are only allowed in the special case when they have been constructed from equations having the +same discriminant, that is, if they are defined in the same algebraic extension of degree~2. -\ccFunction{RootOf_2 make_root_of_2(RT a, RT b, RT c, bool s);}{Returns the -smaller or larger root of the equation $aX^2+bX+c=0$, if \ccc{s} -is \ccc{true} or \ccc{false}, respectively. \ccPrecond{$b^2-4ac\geq 0$}} -%\footnote{numbering of roots from 0 or 1? to be checked} -\ccGlue -\ccFunction{RootOf_2 make_root_of_2(FT a, FT b, FT c, bool s);}{Returns the -smaller or larger root of the equation $aX^2+bX+c=0$, if \ccc{s} -is \ccc{true} or \ccc{false}, respectively. \ccPrecond{$b^2-4ac\geq 0$}} -\ccGlue -\ccFunction{RootOf_2 make_root_of_2(FT alpha, FT beta, FT gamma);}{Constructs -the number $\alpha + \beta \sqrt{\gamma}$. \ccPrecond{$\gamma\geq 0$}} +Besides construction from \ccc{int, RT} and \ccc{FT} the following functions provide +special construction for extensions of degree 2:\\ +- \ccc{make_root_of_2} \\ +- \ccc{make_sqrt} +%\def\ccTagRmEigenClassName{\ccTrue} +\ccRefines +\ccc{DefaultConstructible}\\ +\ccc{CopyConstructible}\\ +\ccc{FromIntConstructible}\\ +\ccc{ImplicitInteroperable with RT}\\ +\ccc{ImplicitInteroperable with FT} \ccOperations +\ccMethod{RootOf_2 & operator+=(const RootOf_2& a);} +{\ccPrecond \ccc{*this} and \ccc{a} are defined in the same extension.}\ccGlue +%\ccMethod{RootOf_2 & operator-=(const RootOf_2& a);} +%{\ccPrecond \ccc{*this} and \ccc{a} are defined in the same extension.}\ccGlue +%\ccMethod{RootOf_2 & operator*=(const RootOf_2& a);} +%{\ccPrecond \ccc{*this} and \ccc{a} are defined in the same extension.}\ccGlue +%\ccMethod{RootOf_2 & operator/=(const RootOf_2& a);} +%{\ccPrecond \ccc{*this} and \ccc{a} are defined in the same extension.} +\ccFunction{RootOf_2 operator+(const RootOf_2&a,const RootOf_2& b);} +{\ccPrecond \ccc{a} and \ccc{b} are defined in the same extension. } +%\ccFunction{RootOf_2 operator-(const RootOf_2&a,const RootOf_2& b);} +%{\ccPrecond \ccc{a} and \ccc{b} are defined in the same extension. }\ccGlue +%\ccFunction{RootOf_2 operator*(const RootOf_2&a,const RootOf_2& b);} +%{\ccPrecond \ccc{a} and \ccc{b} are defined in the same extension. }\ccGlue +%\ccFunction{RootOf_2 operator/(const RootOf_2&a,const RootOf_2& b);} +%{\ccPrecond \ccc{a} and \ccc{b} are defined in the same extension. } -The comparison operators \ccc{==, !=, <, >, <=, >=} as well as the \ccc{sign} -and \ccc{compare} functions need to be -provided to compare elements of types \ccc{RootOf_2, RT} and \ccc{FT}. +\ccFunction{bool operator==(const RootOf_2&a,const RootOf_2& b);}{}\ccGlue +%\ccFunction{bool operator!=(const RootOf_2&a,const RootOf_2& b);}{}\ccGlue +\ccFunction{bool operator< (const RootOf_2&a,const RootOf_2& b);}{} +%\ccFunction{bool operator<=(const RootOf_2&a,const RootOf_2& b);}{}\ccGlue +%\ccFunction{bool operator> (const RootOf_2&a,const RootOf_2& b);}{}\ccGlue +%\ccFunction{bool operator>=(const RootOf_2&a,const RootOf_2& b);}{} -In addition, the following operations must be provided: - -\def\ccTagRmEigenClassName{\ccFalse} - -\ccFunction{RootOf_2 operator+(const RT &a, const RootOf_2 &r);}{} -\ccGlue -\ccFunction{RootOf_2 operator+(const FT &a, const RootOf_2 &r);}{} -\ccGlue -\ccFunction{RootOf_2 operator+(const RootOf_2 &r, const RT &a);}{} -\ccGlue -\ccFunction{RootOf_2 operator+(const RootOf_2 &r, const FT &a);}{} - -as well as -\ccFunction{RootOf_2 operator+(const RootOf_2 &r, const RootOf_2 &r);} -{Addition of two algebraic numbers, in the special case when they have -been constructed from equations having the same discriminant.} - -and similarly for operators -, * and /. - -\ccFunction{RootOf_2 square(const RootOf_2 & r);}{} -\ccFunction{RootOf_2 inverse(const RootOf_2 & r);}{} -\ccFunction{RootOf_2 make_sqrt(const RT & r);}{} -\ccFunction{RootOf_2 make_sqrt(const FT & f);}{} - -\def\ccTagRmEigenClassName{\ccTrue} +Same for operator {\tt -,*,/,!=,<=,>,>=} as well as mixed forms with \ccc{RT} and \ccc{FT}. \ccHasModels -\ccc{double} (non exact)\\ -\ccc{CGAL::Root_of_2}, etc %\footnote{to be precised} +\ccc{double} (not exact)\\ +\ccc{CGAL::Sqrt_extension} \ccSeeAlso -\ccRefIdfierPage{CGAL::make_root_of_2}\\ -\ccRefIdfierPage{CGAL::Root_of_2}\\ -\ccRefIdfierPage{CGAL::Root_of_traits_2}\\ +\ccRefIdfierPage{CGAL::make_root_of_2}\\ +\ccRefIdfierPage{CGAL::make_sqrt}\\ +\ccRefIdfierPage{CGAL::Root_of_traits}\\ \ccRefIdfierPage{AlgebraicKernelForCircles::PolynomialForCircles_2_2}\\ \ccRefIdfierPage{AlgebraicKernelForCircles} diff --git a/Number_types/doc_tex/NumberTypeSupport_ref/Root_of_2.tex b/Number_types/doc_tex/NumberTypeSupport_ref/Root_of_2.tex index 7d2646b83cd..cfc1f66b6f0 100644 --- a/Number_types/doc_tex/NumberTypeSupport_ref/Root_of_2.tex +++ b/Number_types/doc_tex/NumberTypeSupport_ref/Root_of_2.tex @@ -1,13 +1,7 @@ \begin{ccRefClass}{Root_of_2} +\begin{ccDeprecated} +This class is deprecated since CGAL-3.8. It is replaced by \ccc{Sqrt_extension}. +\end{ccDeprecated} -\ccInclude{CGAL/Root_of_2.h} - -\ccIsModel - -\ccc{RootOf_2} - -\ccSeeAlso -\ccRefIdfierPage{CGAL::Root_of_traits_2}\\ -\ccRefIdfierPage{CGAL::make_root_of_2} - +\ccRefIdfierPage{CGAL::Sqrt_extension}\\ \end{ccRefClass} diff --git a/Number_types/doc_tex/NumberTypeSupport_ref/Root_of_traits.tex b/Number_types/doc_tex/NumberTypeSupport_ref/Root_of_traits.tex new file mode 100644 index 00000000000..cb8e870b5cf --- /dev/null +++ b/Number_types/doc_tex/NumberTypeSupport_ref/Root_of_traits.tex @@ -0,0 +1,25 @@ +\begin{ccRefClass}{Root_of_traits} + +%\footnote{name should be changed because it is used ''the other way +%round'' here, compared with usual use. Find a name with +%\textit{associative} inside, or/and \textit{extended/extension}...} + +\ccDefinition + +For a \ccc{RealEmbeddable} \ccc{IntegralDomain} \ccc{RT}, the class template +\ccc{Root_of_traits} associates a type \ccc{Root_of_2}, which represents +algebraic numbers of degree 2 over \ccc{RT}. Moreover, the class provides +\ccc{Root_of_1}, which represents the quotient field of \ccc{RT}. + +\ccInclude{CGAL/Root_of_traits.h} + +\ccTypes + +\ccNestedType{Root_of_1}{A \ccc{RealEmbeddable} \ccc{Field} representing the quotient field of \ccc{RT}.} +\ccNestedType{Root_of_2}{Model of \ccc{RootOf_2}.} + +\ccSeeAlso + +\ccRefIdfierPage{RootOf_2}\\ +\ccRefIdfierPage{CGAL::make_root_of_2}\\ +\end{ccRefClass} diff --git a/Number_types/doc_tex/NumberTypeSupport_ref/Root_of_traits_2.tex b/Number_types/doc_tex/NumberTypeSupport_ref/Root_of_traits_2.tex deleted file mode 100644 index 3ecd8771842..00000000000 --- a/Number_types/doc_tex/NumberTypeSupport_ref/Root_of_traits_2.tex +++ /dev/null @@ -1,23 +0,0 @@ -\begin{ccRefClass}{Root_of_traits_2} - -%\footnote{name should be changed because it is used ''the other way -%round'' here, compared with usual use. Find a name with -%\textit{associative} inside, or/and \textit{extended/extension}...} - -\ccDefinition - -Associates types for algebraic numbers to \ccc{RT}, supposed to be a -\ccc{RingNumberType}. - -\ccInclude{CGAL/Root_of_traits.h} - -\ccTypes - -\ccNestedType{Root_of_2}{Model of \ccc{RootOf_2}.} - -\ccSeeAlso - -\ccRefIdfierPage{RootOf_2}\\ -\ccRefIdfierPage{CGAL::Root_of_2}\\ -\ccRefIdfierPage{CGAL::make_root_of_2} -\end{ccRefClass} diff --git a/Number_types/doc_tex/NumberTypeSupport_ref/Sqrt_extension.tex b/Number_types/doc_tex/NumberTypeSupport_ref/Sqrt_extension.tex index e52d10e37ba..58ab6bb87fb 100644 --- a/Number_types/doc_tex/NumberTypeSupport_ref/Sqrt_extension.tex +++ b/Number_types/doc_tex/NumberTypeSupport_ref/Sqrt_extension.tex @@ -4,6 +4,11 @@ \begin{ccRefClass}{Sqrt_extension} \def\ccTagOperatorLayout{\ccFalse} +In addition, \ccc{Sqrt_extension} has another two default template arguments:\\ +$\cdot$ \ccc{DifferentExtensionComparable} = \ccc{::CGAL::Tag_false}\\ +$\cdot$ \ccc{FilterPredicates} = \ccc{::CGAL::Tag_false}\\ +See below for more details. + \ccDefinition An instance of this class represents an extension of the type \ccc{NT} by @@ -12,34 +17,44 @@ An instance of this class represents an extension of the type \ccc{NT} by \ccc{NT} is required to be an \ccc{IntegralDomainWithoutDivision}. \\ \ccRefName\ is \ccc{RealEmbeddable} if NT is \ccc{RealEmbeddable}. -For example: Let \ccc{Integer} be some type representing $\Z$, then + + +For example, let \ccc{Integer} be some type representing $\Z$, then \ccc{Sqrt_extension} is able to represent $\Z[\sqrt{root}]$ -for some arbitrary value $root$. The value of $root$ is set at -construction time, or left open if $root$ is not specified. +for some arbitrary Integer $root$.\footnote{$R[a]$ denotes the +extension of a ring $R$ by an element $a$. +See also: \url{http://mathworld.wolfram.com/ExtensionRing.html}} +The value of $root$ is set at +construction time, or set to zero if it is not specified. -Note that the given $root$ is stored as it is given to the constructor. In particular, an extension by a square root of a square is considered as an extension. +Arithmetic operations among different extensions, say $\Z[\sqrt{a}]$ +and $\Z[\sqrt{b}]$, are not supported. +The result would be in $\Z[\sqrt{a},\sqrt{b}]$, which is not +representable by \ccc{Sqrt_extension}. +\textbf{The user is responsible to check that arithmetic operations +are carried out for elements from the same extensions only.} +This is not tested by \ccRefName\ for efficiency reasons. +A violation of the precondition leads to undefined behavior. +Be aware that for efficiency reasons the given $root$ is stored as it is given to +the constructor. In particular, an extension by a square root of a square is +considered as an extension. -\textbf {It is not possible to interoperate two values from two different -extensions $\Z[\sqrt{a}]$ and $\Z[\sqrt{b}]$, since the result is in -$\Z[\sqrt{a},\sqrt{b}]$, which is not representable by -\ccc{Sqrt_extension}. } - %However, both \ccc{NT} and \ccc{ROOT} can themselves be an instance of %\ccc{Sqrt_extension}, yielding a nested extension, e.g., %\ccc{Sqrt_extension,Integer>} is able to represent %$\Z[\sqrt{a}][\sqrt{b}]$ for some integers $a$ and $b$. -\begin{ccAdvanced} - Since elements of \ccRefName\ that lie in different extensions -are not interoperable with respect to any arithmetic operations, the full - value range of \ccRefName\ does not represent an algebraic structure. - However, each subset of the value range that represents the extension of - NT by a particular square root is a valid algebraic structure, since -this subset is closed under all provided arithmetic operations. -From there, \ccRefName\ can be used as if it were a model of an algebraic structure concept, with the following correspondence: +Since elements of \ccRefName\ that lie in different extensions +are not interoperable with respect to any arithmetic operations, the full +value range of \ccRefName\ does not represent an algebraic structure. +However, each subset of the value range that represents the extension of +NT by a particular square root is a valid algebraic structure, since +this subset is closed under all provided arithmetic operations. +From there, \ccRefName\ can be used as if it were a model of an algebraic structure +concept, with the following correspondence: \begin{tabular}{ll} NT & \ccRefName\ \\ @@ -52,9 +67,8 @@ From there, \ccRefName\ can be used as if it were a model of an algebraic struct \hline \end{tabular} -The extension of an \ccc{UniqueFactorizationDomain} or -\ccc{EuclideanRing} is just an \ccc{IntegralDomain}, since the extension in general destroys the unique factorization property, e.g., -\[10 = \sqrt{10} \cdot \sqrt{10} = 2 \cdot 5 \mbox{ over} \Z[\sqrt{10}]\] +The extension of a \ccc{UniqueFactorizationDomain} or +\ccc{EuclideanRing} is just an \ccc{IntegralDomain}, since the extension in general destroys the unique factorization property. For instance consider $\Z[\sqrt{10}]$, the extension of $\Z$ by $\sqrt{10}$: in $\Z[\sqrt{10}]$ the element 10 has two different factorizations $\sqrt{10} \cdot \sqrt{10}$ and $2 \cdot 5$. In particular, the factorization is not unique. %For example take $\Z[\sqrt{10}]$: \\ %as indicated by \cite{e-eacfcc-03} referring to \cite{hardy-wright,hasse}: @@ -64,10 +78,6 @@ The extension of an \ccc{UniqueFactorizationDomain} or %because \[10 = \sqrt{10} \cdot \sqrt{10} = 2 \cdot 5\]$ factors in two essentially %different ways. \\ -\textbf{ Note that the user is responsible for checking that the elements of -\ccRefName\ that are manipulated are actually in a same extension field. -If different extension fields are mixed together, -the code may crash at runtime!} \\ %However, \ccRefName\ is useful for lengthy computations %over one quadratic extension, e.g. it can be used as coefficient type for @@ -75,9 +85,14 @@ the code may crash at runtime!} \\ %\ccc{Sqrt_extension} in place of \ccc{leda_real} or \ccc{CORE::Expr}, %since it does not suffer from growing expression trees. -In the same way \ccc{Sqrt_extension} can be used as if it were a model of \ccc{RealEmbeddable} if \ccc{NT} is model of \ccc{RealEmbeddable}. \textbf{Comparisons of two values from different extension via operators is not allowed.} However, the -member function compare provides this comparison. -\end{ccAdvanced} + +If \ccc{NT} is a model of \ccc{RealEmbeddable} the type \ccc{Sqrt_extension} is also considered as \ccc{RealEmbeddable}. However, by default it is not allowed to compare values from different extensions for efficiency reasons. In case such a comparison becomes necessary, use the member function compare with the according Boolean flag. +If such a comparison is a very frequent case, override the default of \ccc{DifferentExtensionComparable} by giving \ccc{::CGAL::Tag_true} as third template parameter. This effects the behavior of compare functions as well as the compare operators. + + +The fourth template argument, \ccc{FilterPredicates}, triggers an internal filter that may speed up comparisons and sign computations. In case \ccc{FilterPredicates} is set to \ccc{CGAL::Tag_true} the type first computes a double interval containing the represented number and tries to perform the comparison or sign computation using this interval. Once computed, this interval is stored by the corresponding \ccc{Sqrt_extension} object for further usage. Note that this internal filter is switched off by default, since it may conflict with other filtering methods, such as \ccc{CGAL::Lazy_exact_nt}. + +In case \ccc{NT} is not \ccc{RealEmbeddable}, \ccc{DifferentExtensionComparable} as well as \ccc{FilterPredicates} have no effect. \ccIsModel \begin{tabular}{ll} @@ -88,26 +103,28 @@ member function compare provides this comparison. \ccc{ImplicitInteroperable} & with int\\ \ccc{ImplicitInteroperable} & with NT\\ \ccc{Fraction} & if NT is a \ccc{Fraction}\\ +\ccc{RootOf_2}&\\ \end{tabular} + %\begin{ccAdvanced} %\ccc{Sqrt_extension} is \ccc{Modularizable} in case \ccc{NT} is %\ccc{Modularizable}. %\end{ccAdvanced} \ccCreation - +\ccTwo{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}{} \ccCreationVariable{ext} \ccConstructor{Sqrt_extension ();} - {Introduces an variable initialized with 0.} + {Introduces an variable initialized with 0.} \ccGlue \ccConstructor{Sqrt_extension (const Sqrt_extension& x);} - {copy constructor.} + {Copy constructor.}\ccGlue \ccConstructor{Sqrt_extension (const int &i);} - {Constructor from int.} + {Introduces an variable initialized with $i$.}\ccGlue \ccConstructor{Sqrt_extension (const NT &x);} - {Constructor from type NT.} + {Introduces an variable initialized with $x$.} \ccConstructor{Sqrt_extension (int a0, int a1, int r);} - {Constructor from int: \ccVar $= a0 +a1 \cdot sqrt(r)$. \ccPrecond{$r \neq 0$}} + {Constructor from int: \ccVar $= a0 +a1 \cdot sqrt(r)$. \ccPrecond{$r \neq 0$}}\ccGlue \ccConstructor{Sqrt_extension (NT a0, NT a1, ROOT r);} {General constructor: \ccVar $= a0 + a1 \cdot sqrt(r)$. \ccPrecond{$r \neq 0$}} @@ -116,34 +133,39 @@ member function compare provides this comparison. An object of type \ccc{Sqrt_extension} represent an expression of the form: $a0 + a1 * sqrt(root)$. +\ccMethod{const NT & a0 () const ; }{Const access operator for a0} \ccGlue +\ccMethod{const NT & a1 () const ; }{Const access operator for a1}\ccGlue +\ccMethod{const ROOT & root () const;}{Const access operator for root}\ccGlue + +%\ccMethod{void number (NT& a0, NT& a1, ROOT& root) const;} +%{Simultaneous access to all relevant members.} + \ccMethod{bool is_extended () const;} {Returns true in case root of \ccVar\ is not zero. \\ Note that $a1 == 0 $ does not imply $root == 0$. } -\ccMethod{const NT & a0 () const ; }{Const access operator for a0} \ccGlue -%\ccMethod{NT & a0 () ; }{Access operator for a0.}\ccGlue -\ccMethod{const NT & a1 () const ; }{Const access operator for a1}\ccGlue -%\ccMethod{NT & a1 () ; }{Access operator for a1.}\ccGlue -\ccMethod{const ROOT & root () const;}{Const access operator for root}\ccGlue -%\ccMethod{ROOT & root () ; }{Access operator for root.} - %Member functions:\\ \ccMethod{void simplify ();} - { Propagates the simplify command to members of \ccVar. \\ - see also: \ccc{AlgebraicStructureTraits::Simplify}.} + { Simplifies the representation, in particular $root$ is set to + zero if $a1$ is zero, that is, \ccVar\ becomes not extended.\\ + Moreover, it propagates the simplify command to members + %, that is $a0$, $a1$ and $root$, + of \ccVar. see also: \ccc{AlgebraicStructureTraits::Simplify}. + } \ccMethod{bool is_zero () const;} {returns true if \ccVar\ represents the value zero.} \ccMethod{CGAL::Sign sign () const;} - {Determines sign of \ccVar\ by (repeated) squaring. + {Determines the sign of \ccVar\ by (repeated) squaring. \ccPrecond \ccc{Sqrt_extension} is \ccc{RealEmbeddable}.} + \ccMethod{Sqrt_extension abs () const;} {returns the absolute value of \ccVar. \ccPrecond \ccc{Sqrt_extension} is \ccc{RealEmbeddable}.} \ccMethod{ CGAL::Comparison_result compare -(const Sqrt_extension& y, bool in_same_extension = true) const;}{ +(const Sqrt_extension& y, bool in_same_extension = !DifferentExtensionComparable::value) const;}{ Compares \ccVar\ with y. \\ The optional bool \ccc{in_same_extension} indicates whether \ccVar\ and $y$ are in the same extension of NT. @@ -167,8 +189,8 @@ CGAL::Comparison_result compare \ccMethod{Sqrt_extension & operator*=(const Sqrt_extension& a);} {\ccPrecond \ccc{(this->root()==0 or a.root()==0 or this->root() == a.root())} }\ccGlue -In case \ccc{NT} is an \ccc{IntegralDomain} operator/ implements integral division. -%In case \ccc{NT} is a \ccc{Field} operator/ implements the field division. +In case \ccc{NT} is only an \ccc{IntegralDomain} operator/ implements integral division. +In case \ccc{NT} is a \ccc{Field} operator/ implements the field division. \ccFunction{Sqrt_extension operator/(const Sqrt_extension&a,const Sqrt_extension& b);} {\ccPrecond \ccc{(a.root()==0 or b.root()==0 or a.root() == b.root())} }\ccGlue @@ -238,4 +260,18 @@ They assume that corresponding stream operators for type \ccc{NT} and \ccc{ROOT} % write Sqrt_extension to os in LiS::IO::PRETTY format %void output_ascii (std::ostream &os) const % write Sqrt_extension to os in a format readable by input_ascii() +\ccSeeAlso + + +\ccRefIdfierPage{IntegralDomainWithoutDivision}\\ +\ccRefIdfierPage{IntegralDomain}\\ +\ccRefIdfierPage{Field}\\ +\ccRefIdfierPage{RealEmbeddable}\\ +\ccRefIdfierPage{ImplicitInteroperable}\\ +\ccRefIdfierPage{Fraction}\\ +\ccRefIdfierPage{RootOf_2}\\ + +\ccRefIdfierPage{CGAL::Tag_true}\\ +\ccRefIdfierPage{CGAL::Tag_false}\\ + \end{ccRefClass} diff --git a/Number_types/doc_tex/NumberTypeSupport_ref/intro.tex b/Number_types/doc_tex/NumberTypeSupport_ref/intro.tex index 83bab8c1bcc..b3161034e55 100644 --- a/Number_types/doc_tex/NumberTypeSupport_ref/intro.tex +++ b/Number_types/doc_tex/NumberTypeSupport_ref/intro.tex @@ -40,11 +40,6 @@ \ccRefConceptPage{CGAL::Quotient}\\ %\ccRefConceptPage{CGAL::Counted_number}\\ \ccRefConceptPage{CGAL::Number_type_checker}\\ -\ccRefIdfierPage{CGAL::Sqrt_extension}\\ -\ccRefIdfierPage{RootOf_2}\\ -\ccRefIdfierPage{CGAL::Root_of_2}\\ -\ccRefIdfierPage{CGAL::Root_of_traits_2}\\ -\ccRefIdfierPage{CGAL::make_root_of_2}\\ \subsection*{Relates Rational} @@ -53,6 +48,13 @@ \ccRefIdfierPage{CGAL::simplest_rational_in_interval} \\ \ccRefIdfierPage{CGAL::to_rational} \\ +\subsection*{Relates Algebraic Extensions} +\ccRefIdfierPage{RootOf_2}\\ +\ccRefIdfierPage{CGAL::Root_of_traits}\\ +\ccRefIdfierPage{CGAL::make_root_of_2}\\ +\ccRefIdfierPage{CGAL::make_sqrt}\\ +\ccRefIdfierPage{CGAL::Sqrt_extension}\\ + \subsection*{Utilities} \ccRefIdfierPage{CGAL::Min}\\ \ccRefIdfierPage{CGAL::Max}\\ diff --git a/Number_types/doc_tex/NumberTypeSupport_ref/main.tex b/Number_types/doc_tex/NumberTypeSupport_ref/main.tex index db62919f9d0..7f7d84a2476 100644 --- a/Number_types/doc_tex/NumberTypeSupport_ref/main.tex +++ b/Number_types/doc_tex/NumberTypeSupport_ref/main.tex @@ -32,7 +32,6 @@ \input{NumberTypeSupport_ref/Quotient.tex} %\input{NumberTypeSupport_ref/Counted_number.tex} \input{NumberTypeSupport_ref/Number_type_checker.tex} -\input{NumberTypeSupport_ref/Sqrt_extension.tex} %functors \input{NumberTypeSupport_ref/Max_functor.tex} @@ -48,9 +47,11 @@ \input{NumberTypeSupport_ref/to_rational.tex} \input{NumberTypeSupport_ref/RootOf_2.tex} -\input{NumberTypeSupport_ref/Root_of_2.tex} -\input{NumberTypeSupport_ref/Root_of_traits_2.tex} +\input{NumberTypeSupport_ref/Root_of_traits.tex} \input{NumberTypeSupport_ref/make_root_of_2.tex} +\input{NumberTypeSupport_ref/make_sqrt.tex} +\input{NumberTypeSupport_ref/Sqrt_extension.tex} +\input{NumberTypeSupport_ref/Root_of_2.tex} \input{NumberTypeSupport_ref/Set_ieee_double_precision.tex} \input{NumberTypeSupport_ref/Protect_FPU_rounding.tex} diff --git a/Number_types/doc_tex/NumberTypeSupport_ref/make_root_of_2.tex b/Number_types/doc_tex/NumberTypeSupport_ref/make_root_of_2.tex index 785ffadd365..2e6964a62d3 100644 --- a/Number_types/doc_tex/NumberTypeSupport_ref/make_root_of_2.tex +++ b/Number_types/doc_tex/NumberTypeSupport_ref/make_root_of_2.tex @@ -1,4 +1,4 @@ -\begin{ccRefFunction}{make_root_of_2} +\begin{ccRefFunction}{make_root_of_2} \ccDefinition @@ -8,24 +8,24 @@ ring number type. \ccInclude{CGAL/Root_of_traits.h} \ccFunction{template - Root_of_traits::RootOf_2 + Root_of_traits::Root_of_2 make_root_of_2(const RT& a, const RT& b, const RT& c, bool s);} -{Returns the real root of the polynomial $aX^2+bX+c$ which is the smallest -if $s$ is true, or the largest if $s$ is false. +{Returns the smallest real root of the polynomial $aX^2+bX+c$ if $s$ is true, and the largest root is $s$ is false. %If \ccc{NT} supports a \ccc{sqrt} operation, then the usual formula is used. -%Otherwise the \ccc{Root_of_2} class is used. -\ccPrecond{\ccc{RT} is a \ccc{RingNumberType}.} +%Otherwise the \ccc{Sqrt_extension} class is used. +\ccPrecond{\ccc{RT} is an \ccc{IntegralDomainWithoutDivision}.} \ccPrecond{The polynomial has at least one real root.}} \ccFunction{template - Root_of_traits::RootOf_2 + Root_of_traits::Root_of_2 make_root_of_2(RT alpha, RT beta, RT gamma);} {Constructs the number $\alpha + \beta \sqrt{\gamma}$. -\ccPrecond{\ccc{RT} is a \ccc{RingNumberType}.} +\ccPrecond{\ccc{RT} is an \ccc{IntegralDomainWithoutDivision}.} \ccPrecond{$\gamma\geq 0$}} \ccSeeAlso \ccRefIdfierPage{RootOf_2}\\ -\ccRefIdfierPage{CGAL::Root_of_2}\\ -\ccRefIdfierPage{CGAL::Root_of_traits_2} +\ccRefIdfierPage{CGAL::Root_of_traits}\\ +\ccRefIdfierPage{CGAL::make_sqrt}\\ +\ccRefIdfierPage{CGAL::Sqrt_extension}\\ \end{ccRefFunction} diff --git a/Number_types/doc_tex/NumberTypeSupport_ref/make_sqrt.tex b/Number_types/doc_tex/NumberTypeSupport_ref/make_sqrt.tex new file mode 100644 index 00000000000..16eee3afdbe --- /dev/null +++ b/Number_types/doc_tex/NumberTypeSupport_ref/make_sqrt.tex @@ -0,0 +1,22 @@ +\begin{ccRefFunction}{make_sqrt} + +\ccDefinition + +The function \ccRefName\ constructs a square root of a given value of type $RT$. +Depending on the type $RT$ the square root may be returned in a new type that +can represent algebraic extensions of degree $2$. + +\ccInclude{CGAL/Root_of_traits.h} + +\ccFunction{template Root_of_traits::Root_of_2 make_sqrt(const RT& x);}{ + Returns $\sqrt{x}.$ +\ccPrecond{\ccc{RT} is a \ccc{RealEmbeddable} \ccc{IntegralDomain}.} +\ccPrecond{ $x \leq 0 $} +} + +\ccSeeAlso +\ccRefIdfierPage{RootOf_2}\\ +\ccRefIdfierPage{CGAL::make_root_of_2}\\ +\ccRefIdfierPage{CGAL::Root_of_traits}\\ + +\end{ccRefFunction} diff --git a/Number_types/doc_tex/NumberTypeSupport_ref/open.tex b/Number_types/doc_tex/NumberTypeSupport_ref/open.tex index 2d8e1abc26c..e3c57742f0a 100644 --- a/Number_types/doc_tex/NumberTypeSupport_ref/open.tex +++ b/Number_types/doc_tex/NumberTypeSupport_ref/open.tex @@ -7,7 +7,6 @@ OPEN: \begin{itemize} \item there is a problem with io stream operators for CORE types in case gmpxx.h is included too. -\item extra review of \ccc{Root_of_2} ? \end{itemize} @@ -53,7 +52,7 @@ Keep in mind: \item \ccc{mpz_class}:\\ Implementation supports expression templates, - up to the same level as the old CGAL implementation. + up to the same level as the old \cgal\ implementation. i.e. it is possible to call CGAL::square(x+x) but the result is \ccc{mpz_class } and not the according expression template. diff --git a/Number_types/dont_submit b/Number_types/dont_submit index f3d94f0052c..ae9e487fb45 100644 --- a/Number_types/dont_submit +++ b/Number_types/dont_submit @@ -1,2 +1,3 @@ makefile KNOWN_PROBLEMS_WITH_FLOATING_POINT +include/CGAL/Root_of_2.h diff --git a/Number_types/include/CGAL/CORE_BigInt.h b/Number_types/include/CGAL/CORE_BigInt.h index c593035b481..b84dbf16d31 100644 --- a/Number_types/include/CGAL/CORE_BigInt.h +++ b/Number_types/include/CGAL/CORE_BigInt.h @@ -30,13 +30,6 @@ namespace CGAL { -template<> -struct Root_of_traits: public internal::Root_of_traits_helper{ - typedef CORE::BigRat RootOf_1; - typedef CORE::BigRat Root_of_1; -}; - // // Algebraic structure traits // diff --git a/Number_types/include/CGAL/Gmpz.h b/Number_types/include/CGAL/Gmpz.h index 6d3a7c7fd05..562cd01d135 100644 --- a/Number_types/include/CGAL/Gmpz.h +++ b/Number_types/include/CGAL/Gmpz.h @@ -36,21 +36,10 @@ #include #include -#include #include namespace CGAL { -class Gmpq; - -template<> -struct Root_of_traits: public internal::Root_of_traits_helper{ - typedef Gmpq RootOf_1; - typedef Gmpq Root_of_1; -}; - - // Algebraic structure traits template <> class Algebraic_structure_traits< Gmpz > : public Algebraic_structure_traits_base< Gmpz, diff --git a/Number_types/include/CGAL/Lazy_exact_nt.h b/Number_types/include/CGAL/Lazy_exact_nt.h index cb6a753fcfd..9f3f90064fe 100644 --- a/Number_types/include/CGAL/Lazy_exact_nt.h +++ b/Number_types/include/CGAL/Lazy_exact_nt.h @@ -39,7 +39,7 @@ #include #include -// #include // TODO +#include /* * This file contains the definition of the number type Lazy_exact_nt, @@ -358,6 +358,11 @@ public : typename boost::enable_if,int>::type=0) : Base(new Lazy_lazy_exact_Cst(x)){} + template + explicit Lazy_exact_nt (const Lazy_exact_nt &x, + typename boost::disable_if,int>::type=0) + : Base(new Lazy_lazy_exact_Cst(x)){} + Self operator+ () const { return *this; } @@ -1121,6 +1126,7 @@ public: CGAL_DEFINE_COERCION_TRAITS_FOR_SELF_TEM(Lazy_exact_nt, class ET) +CGAL_DEFINE_COERCION_TRAITS_FROM_TO_TEM(ET,Lazy_exact_nt,class ET) template struct Coercion_traits< Lazy_exact_nt, Lazy_exact_nt > @@ -1225,8 +1231,15 @@ struct Min > Lazy_exact_nt operator()( const Lazy_exact_nt& x, const Lazy_exact_nt& y) const { - CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); - return new Lazy_exact_Min(x, y); + if (x.identical(y)){ + return x; + } + Uncertain res = x.approx() < y.approx(); + if(is_certain(res)){ + return res.make_certain() ? x : y; + } + CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); + return new Lazy_exact_Min(x, y); } }; @@ -1236,6 +1249,13 @@ struct Max > Lazy_exact_nt operator()( const Lazy_exact_nt& x, const Lazy_exact_nt& y) const { + if (x.identical(y)){ + return x; + } + Uncertain res = x.approx() > y.approx(); + if(is_certain(res)){ + return res.make_certain() ? x : y; + } CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); return new Lazy_exact_Max(x, y); } @@ -1297,94 +1317,9 @@ fit_in_double(const Lazy_exact_nt& l, double& r) } // namespace internal -// We create a type of new node in Lazy_exact_nt's DAG -// for the make_root_of_2() operation. - -template -struct Lazy_exact_ro2 - : public Lazy_exact_nt_rep< typename Root_of_traits::RootOf_2 > -{ - typedef typename Root_of_traits::RootOf_2 RO2; - typedef Lazy_exact_nt_rep Base; - typedef typename Base::AT::Protector P; - - - mutable Lazy_exact_nt op1, op2, op3; - bool smaller; - bool old_rep;//if the rep=true then representation with polynomial coeff, else alpha, beta, gamma - - - Lazy_exact_ro2 (const Lazy_exact_nt &a, - const Lazy_exact_nt &b, - const Lazy_exact_nt &c, bool s) - : Base((P(), make_root_of_2(a.approx(), b.approx(), c.approx(), s))), - op1(a), op2(b), op3(c), smaller(s), old_rep(true) {} - - Lazy_exact_ro2 (const Lazy_exact_nt &a, - const Lazy_exact_nt &b, - const Lazy_exact_nt &c) - : Base((P(), make_root_of_2(a.approx(), b.approx(), c.approx()))), - op1(a), op2(b), op3(c), smaller(true), old_rep(false) {} - - void update_exact() const - { - if (old_rep) - this->et = new RO2(make_root_of_2(op1.exact(), op2.exact(), - op3.exact(), smaller)); - else - this->et = new RO2(make_root_of_2(op1.exact(), op2.exact(), - op3.exact())); - if (!this->approx().is_point()) - this->at = to_interval(*(this->et)); - this->prune_dag(); - - } - - void prune_dag() const - { - op1 = op2 = op3 = Lazy_exact_nt(); - } -}; - -template -struct Root_of_traits< Lazy_exact_nt < NT > > -{ -private: - typedef Root_of_traits T; -public: - typedef Root_of_traits< Lazy_exact_nt < NT > > Base; - typedef Lazy_exact_nt< typename T::RootOf_1 > RootOf_1; - typedef Lazy_exact_nt< typename T::RootOf_2 > RootOf_2; - typedef RootOf_2 Root_of_2; - typedef RootOf_1 Root_of_1; - struct Make_root_of_2{ - typedef RootOf_2 result_type; - Root_of_2 - operator()(const Lazy_exact_nt& a, const Lazy_exact_nt& b, const Lazy_exact_nt& c) const{ - return new Lazy_exact_ro2(a, b, c); - }; - RootOf_2 - operator()(const Lazy_exact_nt& a, const Lazy_exact_nt& b, const Lazy_exact_nt& c, bool smaller) const{ - return new Lazy_exact_ro2(a, b, c, smaller); - }; - }; - -}; - - -//these two functions for test suite requirement -template < typename RT > -typename CGAL::Root_of_traits >::RootOf_2 make_sqrt(const CGAL::Lazy_exact_nt< RT> & r) -{ - typedef Lazy_exact_nt< RT> TT; - CGAL_assertion(r >= 0); - if(CGAL_NTS is_zero(r)) return make_root_of_2((TT) 1,(TT) 0,(TT) 0); - return make_root_of_2((TT) 1,(TT) 0,-r,false); -} - -template < typename RT > +template void -print(std::ostream &os, const CGAL::Lazy_exact_nt< Root_of_2 > &r) +print(std::ostream &os, const CGAL::Lazy_exact_nt< Sqrt_extension > &r) { print(os,r.exact()); } diff --git a/Number_types/include/CGAL/MP_Float.h b/Number_types/include/CGAL/MP_Float.h index 2e820c14e94..1ed2ceb7ce3 100644 --- a/Number_types/include/CGAL/MP_Float.h +++ b/Number_types/include/CGAL/MP_Float.h @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include @@ -71,14 +71,13 @@ MP_Float square(const MP_Float&); // to_double() returns, not the closest double, but a one bit error is allowed. // We guarantee : to_double(MP_Float(double d)) == d. double to_double(const MP_Float&); -double to_double(const Root_of_2 &x); double to_double(const Quotient&); std::pair to_interval(const MP_Float &); -// std::pair to_interval(const Root_of_2&); // TODO ? std::pair to_interval(const Quotient&); MP_Float div(const MP_Float& n1, const MP_Float& n2); MP_Float gcd(const MP_Float& a, const MP_Float& b); -} + +} //namespace INTERN_MP_FLOAT std::pair to_double_exp(const MP_Float &b); @@ -392,7 +391,9 @@ approximate_sqrt(const MP_Float &d); MP_Float approximate_division(const MP_Float &n, const MP_Float &d); -// Algebraic structure traits + + +// Algebraic structure traits specialization template <> class Algebraic_structure_traits< MP_Float > : public Algebraic_structure_traits_base< MP_Float, Unique_factorization_domain_tag @@ -475,8 +476,6 @@ template <> class Algebraic_structure_traits< MP_Float > }; }; - - // Real embeddable traits template <> class Real_embeddable_traits< MP_Float > : public INTERN_RET::Real_embeddable_traits_base< MP_Float , CGAL::Tag_true > { @@ -518,6 +517,53 @@ template <> class Real_embeddable_traits< MP_Float > }; + +namespace INTERN_MP_FLOAT{ + +//Sqrt_extension internally uses Algebraic_structure_traits +template +double +to_double(const Sqrt_extension &x) +{ + typedef MP_Float RT; + typedef Quotient FT; + typedef CGAL::Rational_traits< FT > Rational; + Rational r; + const RT r1 = r.numerator(x.a0()); + const RT d1 = r.denominator(x.a0()); + + if(x.is_rational()) { + std::pair n = to_double_exp(r1); + std::pair d = to_double_exp(d1); + double scale = std::ldexp(1.0, n.second - d.second); + return (n.first / d.first) * scale; + } + + const RT r2 = r.numerator(x.a1()); + const RT d2 = r.denominator(x.a1()); + const RT r3 = r.numerator(x.root()); + const RT d3 = r.denominator(x.root()); + + std::pair n1 = to_double_exp(r1); + std::pair v1 = to_double_exp(d1); + double scale1 = std::ldexp(1.0, n1.second - v1.second); + + std::pair n2 = to_double_exp(r2); + std::pair v2 = to_double_exp(d2); + double scale2 = std::ldexp(1.0, n2.second - v2.second); + + std::pair n3 = to_double_exp(r3); + std::pair v3 = to_double_exp(d3); + double scale3 = std::ldexp(1.0, n3.second - v3.second); + + return ((n1.first / v1.first) * scale1) + + ((n2.first / v2.first) * scale2) * + std::sqrt((n3.first / v3.first) * scale3); +} + +} //namespace INTERN_MP_FLOAT + + namespace internal { // This compares the absolute values of the odd-mantissa. // (take the mantissas, get rid of all powers of 2, compare @@ -817,28 +863,6 @@ inline MP_Float max BOOST_PREVENT_MACRO_SUBSTITUTION(const MP_Float& x,const MP_ } -// TODO: -// // specialization of to double functor -// template<> -// class Real_embeddable_traits< Root_of_2 > -// : public INTERN_ROOT_OF_2::Real_embeddable_traits_quotient_root_of_2_base< -// Root_of_2 >{ -// public: -// struct To_double: public std::unary_function, double>{ -// inline -// double operator()(const Root_of_2& q) const { -// return INTERN_MP_FLOAT::to_double(q); -// } -// }; -// struct To_interval -// : public std::unary_function, std::pair > { -// inline -// std::pair operator()(const Root_of_2& q) const { -// return INTERN_MP_FLOAT::to_interval(q); -// } -// }; -// }; - // Coercion_traits CGAL_DEFINE_COERCION_TRAITS_FOR_SELF(MP_Float) CGAL_DEFINE_COERCION_TRAITS_FROM_TO(int, MP_Float) @@ -846,4 +870,7 @@ CGAL_DEFINE_COERCION_TRAITS_FROM_TO(int, MP_Float) } //namespace CGAL +//specialization for Get_arithmetic_kernel +#include + #endif // CGAL_MP_FLOAT_H diff --git a/Number_types/include/CGAL/Root_of_traits.h b/Number_types/include/CGAL/Root_of_traits.h index 9b17ce5848f..cffb0341412 100644 --- a/Number_types/include/CGAL/Root_of_traits.h +++ b/Number_types/include/CGAL/Root_of_traits.h @@ -22,37 +22,102 @@ #define CGAL_ROOT_OF_TRAITS_H #include -#include +#include +#include #include +#include namespace CGAL { +template < typename NT > +struct Root_of_traits; + +template < class NT > +inline +typename Root_of_traits< NT >::Root_of_2 +make_root_of_2(const NT &a, const NT &b, const NT &c) +{ + typename Root_of_traits::Make_root_of_2 make_root_of_2; + return make_root_of_2(a,b,c); +} + + +template < class NT > +inline +typename Root_of_traits< NT >::Root_of_2 +make_root_of_2(const NT &a, const NT &b, const NT &c,const bool smaller) +{ + typename Root_of_traits::Make_root_of_2 make_root_of_2; + return make_root_of_2(a,b,c,smaller); +} + +template < class NT > +inline +typename Root_of_traits< NT >::Root_of_2 +make_sqrt(const NT &a) +{ + typename Root_of_traits::Make_sqrt make_sqrt; + return make_sqrt(a); +} + namespace internal { +BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(Has_typedef_Arithmetic_kernel,Arithmetic_kernel,false) + +template >::value> +struct Get_rational_type{ + typedef Quotient type; +}; + +template +struct Get_rational_type{ + typedef typename Get_arithmetic_kernel::Arithmetic_kernel::Rational type; +}; + + +//Default or not a field. +//If no specialization of Get_arithmetic_kernel is available, a field type compatible with NT +//is made using CGAL::Quotient template < typename NT, class Algebraic_category> struct Root_of_traits_helper{ - typedef Quotient Root_of_1; - typedef CGAL::Root_of_2 Root_of_2; +// typedef Quotient Root_of_1; + typedef typename Get_rational_type::type Root_of_1; + typedef CGAL::Sqrt_extension Root_of_2; +// typedef CGAL::Root_of_2 Root_of_2; struct Make_root_of_2{ typedef Root_of_2 result_type; - Root_of_2 operator()(const NT& a, const NT& b, const NT& c){ + Root_of_2 operator()(const NT& a, const NT& b, const NT& c) const { return Root_of_2(a,b,c); } - Root_of_2 operator()(const NT& a, const NT& b, const NT& c, bool s){ + Root_of_2 operator()(const NT& a, const NT& b, const NT& c, bool s) const { return Root_of_2(a,b,c,s); } Root_of_2 operator()(const Root_of_1& a, const Root_of_1& b, - const Root_of_1& c){ + const Root_of_1& c) const { return Root_of_2(a,b,c); } Root_of_2 operator()(const Root_of_1& a, const Root_of_1& b, const Root_of_1& c, - bool s){ + bool s) const { return Root_of_2(a,b,c,s); } }; + + +private: + typedef CGAL::Algebraic_structure_traits AST; +public: + typedef typename AST::Square Square; + typedef typename AST::Inverse Inverse; + + struct Make_sqrt { + typedef Root_of_2 result_type; + Root_of_2 operator()(const NT& x) const { + return Root_of_2(x,true); + } + }; }; template < typename FT> @@ -71,16 +136,16 @@ private: typedef typename FrT::Numerator_type RT; typedef typename FrT::Decompose Decompose; public: - typedef CGAL::Root_of_2< RT > Root_of_2; + typedef CGAL::Sqrt_extension Root_of_2; struct Make_root_of_2{ typedef Root_of_2 result_type; Root_of_2 - operator()(const FT& a, const FT& b, const FT& c){ + operator()(const FT& a, const FT& b, const FT& c) const { return Root_of_2(a,b,c); } Root_of_2 - operator()(const FT& a, const FT& b, const FT& c, bool smaller){ + operator()(const FT& a, const FT& b, const FT& c, bool smaller) const { Decompose decompose; RT a_num,b_num,c_num; RT a_den,b_den,c_den; // Denomiantor same as RT @@ -96,6 +161,19 @@ public: return make_root_of_2(a_,b_,c_,smaller); } }; + +private: + typedef CGAL::Algebraic_structure_traits AST; +public: + typedef typename AST::Square Square; + typedef typename AST::Inverse Inverse; + + struct Make_sqrt{ + typedef Root_of_2 result_type; + Root_of_2 operator()(const FT& x) const { + return Root_of_2( FT(0),FT(1),x); + } + }; }; template < typename NT > @@ -107,7 +185,7 @@ struct Root_of_traits_helper < NT, Field_with_sqrt_tag > struct Make_root_of_2{ typedef NT result_type; // just a copy, not sure about the semantic of smaller - NT operator()(const NT& a, const NT& b, const NT& c, bool smaller){ + NT operator()(const NT& a, const NT& b, const NT& c, bool smaller) const { // former make_root_of_2_sqrt() CGAL_assertion( a != 0 ); NT discriminant = CGAL_NTS square(b) - a*c*4; @@ -118,10 +196,23 @@ struct Root_of_traits_helper < NT, Field_with_sqrt_tag > return (d-b)/(a*2); } // it's so easy - NT operator()(const NT& a, const NT& b, const NT& c){ + NT operator()(const NT& a, const NT& b, const NT& c) const { return a + b * CGAL_NTS sqrt(c) ; } }; + +private: + typedef CGAL::Algebraic_structure_traits AST; +public: + typedef typename AST::Square Square; + typedef typename AST::Inverse Inverse; + + struct Make_sqrt{ + typedef Root_of_2 result_type; + Root_of_2 operator()(const NT& x) const { + return CGAL::sqrt(x); + } + }; }; template < typename NT > @@ -157,7 +248,7 @@ struct Root_of_traits >{ struct Make_root_of_2{ typedef Interval_nt result_type; // just a copy, not sure about the semantic of smaller - Interval_nt operator()(const Interval_nt& a, const Interval_nt& b, const Interval_nt& c, bool smaller){ + Interval_nt operator()(const Interval_nt& a, const Interval_nt& b, const Interval_nt& c, bool smaller) const { // former make_root_of_2_sqrt() if (CGAL::possibly(a==0)) return Interval_nt::largest(); @@ -169,31 +260,15 @@ struct Root_of_traits >{ return (d-b)/(a*2); } // it's so easy - Interval_nt operator()(const Interval_nt& a, const Interval_nt& b, const Interval_nt& c){ + Interval_nt operator()(const Interval_nt& a, const Interval_nt& b, const Interval_nt& c) const { return a + b * CGAL_NTS sqrt(c) ; } }; }; -template < class NT > -inline -typename Root_of_traits< NT >::Root_of_2 -make_root_of_2(const NT &a, const NT &b, const NT &c) -{ - typename Root_of_traits::Make_root_of_2 make_root_of_2; - return make_root_of_2(a,b,c); -} - - -template < class NT > -inline -typename Root_of_traits< NT >::Root_of_2 -make_root_of_2(const NT &a, const NT &b, const NT &c,const bool smaller) -{ - typename Root_of_traits::Make_root_of_2 make_root_of_2; - return make_root_of_2(a,b,c,smaller); -} } //namespace CGAL +#include + #endif // CGAL_ROOT_OF_TRAITS_H diff --git a/Number_types/include/CGAL/Root_of_traits_specializations.h b/Number_types/include/CGAL/Root_of_traits_specializations.h new file mode 100644 index 00000000000..15463fbd4e7 --- /dev/null +++ b/Number_types/include/CGAL/Root_of_traits_specializations.h @@ -0,0 +1,139 @@ +// Copyright (c) 2010 GeometryFactory +// Copyright (c) 1999-2007 INRIA Sophia-Antipolis (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; version 2.1 of the License. +// See the file LICENSE.LGPL distributed with CGAL. +// +// 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) : Michael Hemmer +// Sebastien Loriot +// Sylvain Pion + +#ifndef CGAL_ROOT_OF_TRAITS_SPECIALIZATIONS_H +#define CGAL_ROOT_OF_TRAITS_SPECIALIZATIONS_H + +#include + +namespace CGAL { + +// We create a type of new node in Lazy_exact_nt's DAG +// for the make_root_of_2() operation. + +template +struct Lazy_exact_ro2 + : public Lazy_exact_nt_rep< typename Root_of_traits::Root_of_2 > +{ + typedef typename Root_of_traits::Root_of_2 RO2; + typedef Lazy_exact_nt_rep Base; + typedef typename Base::AT::Protector P; + + + mutable Lazy_exact_nt op1, op2, op3; + bool smaller; + bool old_rep;//if the rep=true then representation with polynomial coeff, else alpha, beta, gamma + + + Lazy_exact_ro2 (const Lazy_exact_nt &a, + const Lazy_exact_nt &b, + const Lazy_exact_nt &c, bool s) + : Base((P(), make_root_of_2(a.approx(), b.approx(), c.approx(), s))), + op1(a), op2(b), op3(c), smaller(s), old_rep(true) {} + + Lazy_exact_ro2 (const Lazy_exact_nt &a, + const Lazy_exact_nt &b, + const Lazy_exact_nt &c) + : Base((P(), make_root_of_2(a.approx(), b.approx(), c.approx()))), + op1(a), op2(b), op3(c), smaller(true), old_rep(false) {} + + void update_exact() const + { + if (old_rep) + this->et = new RO2(make_root_of_2(op1.exact(), op2.exact(), + op3.exact(), smaller)); + else + this->et = new RO2(make_root_of_2(op1.exact(), op2.exact(), + op3.exact())); + if (!this->approx().is_point()) + this->at = to_interval(*(this->et)); + this->prune_dag(); + + } + + void prune_dag() const + { + op1 = op2 = op3 = Lazy_exact_nt(); + } +}; + +template +struct Root_of_traits< Lazy_exact_nt < NT > > +{ +private: + typedef Root_of_traits T; +public: + typedef Root_of_traits< Lazy_exact_nt < NT > > Base; + typedef Lazy_exact_nt< typename T::Root_of_1 > Root_of_1; + typedef Lazy_exact_nt< typename T::Root_of_2 > Root_of_2; + typedef Root_of_2 RootOf_2; + typedef Root_of_1 RootOf_1; + + struct Make_root_of_2{ + typedef Root_of_2 result_type; + Root_of_2 + operator()(const Lazy_exact_nt& a, const Lazy_exact_nt& b, const Lazy_exact_nt& c) const { + return new Lazy_exact_ro2(a, b, c); + }; + Root_of_2 + operator()(const Lazy_exact_nt& a, const Lazy_exact_nt& b, const Lazy_exact_nt& c, bool smaller) const{ + return new Lazy_exact_ro2(a, b, c, smaller); + }; + }; + +private: + typedef CGAL::Algebraic_structure_traits AST; +public: + typedef typename AST::Square Square; + typedef typename AST::Inverse Inverse; + + struct Make_sqrt{ + typedef Root_of_2 result_type; + Root_of_2 operator()(const Lazy_exact_nt& x) const { + return new Lazy_exact_ro2( Lazy_exact_nt(0), Lazy_exact_nt(1) , x); + } + }; +}; + + +//these two functions for test suite requirement +template < typename RT > +typename CGAL::Root_of_traits >::Root_of_2 make_sqrt(const CGAL::Lazy_exact_nt< RT> & r) +{ + typedef Lazy_exact_nt< RT> TT; + CGAL_assertion(r >= 0); + if(CGAL_NTS is_zero(r)) return make_root_of_2((TT) 1,(TT) 0,(TT) 0); + return make_root_of_2((TT) 1,(TT) 0,-r,false); +} + +#ifdef CGAL_USE_CORE +template<> +struct Root_of_traits: public internal::Root_of_traits_helper{ + typedef CORE::BigRat Root_of_1; +}; +#endif + +} //namespace CGAL + +#endif // CGAL_ROOT_OF_TRAITS_SPECIALIZATIONS_H diff --git a/Number_types/include/CGAL/Sqrt_extension/Algebraic_extension_traits.h b/Number_types/include/CGAL/Sqrt_extension/Algebraic_extension_traits.h index 8c7d11d3c90..f77a951ad8f 100644 --- a/Number_types/include/CGAL/Sqrt_extension/Algebraic_extension_traits.h +++ b/Number_types/include/CGAL/Sqrt_extension/Algebraic_extension_traits.h @@ -26,8 +26,8 @@ namespace CGAL { -template -class Algebraic_extension_traits > { +template +class Algebraic_extension_traits > { /* needed to 'add up' sqrt_extensions in iterator range such that all roots are collected in order to keep operation time minimal all scalar coeffs are set to 1 by standardise. @@ -43,11 +43,11 @@ class Algebraic_extension_traits > { } }; - template - class Standardise > { + template + class Standardise > { Standardise standardise; public: - typedef CGAL::Sqrt_extension Type_; + typedef CGAL::Sqrt_extension Type_; typedef Type_ argument_type; typedef Type_ result_type; Type_ operator () (const Type_& a) const { @@ -62,7 +62,7 @@ class Algebraic_extension_traits > { public: //! \name Typedefs //! the number type for which this instance has been instantiated - typedef CGAL::Sqrt_extension Type; + typedef CGAL::Sqrt_extension Type; //! Sqrt_extension as a number type is extended typedef ::CGAL::Tag_true Is_extended; diff --git a/Number_types/include/CGAL/Sqrt_extension/Algebraic_structure_traits.h b/Number_types/include/CGAL/Sqrt_extension/Algebraic_structure_traits.h index 948298f8a18..d9de8633893 100644 --- a/Number_types/include/CGAL/Sqrt_extension/Algebraic_structure_traits.h +++ b/Number_types/include/CGAL/Sqrt_extension/Algebraic_structure_traits.h @@ -172,8 +172,6 @@ class Sqrt_extension_algebraic_structure_traits_base< Type, return Type(1)/x ; } }; - - }; template< class Type > @@ -205,13 +203,13 @@ class Sqrt_extension_algebraic_structure_traits_base< Type, } // namespace internal -template< class COEFF_, class ROOT_> -class Algebraic_structure_traits< Sqrt_extension< COEFF_, ROOT_ > > +template< class COEFF_, class ROOT_, class ACDE_TAG,class FP_TAG> +class Algebraic_structure_traits< Sqrt_extension< COEFF_, ROOT_, ACDE_TAG,FP_TAG > > : public internal::Sqrt_extension_algebraic_structure_traits_base< - Sqrt_extension< COEFF_, ROOT_ >, + Sqrt_extension< COEFF_, ROOT_, ACDE_TAG,FP_TAG >, typename Algebraic_structure_traits< COEFF_ >::Algebraic_category > { public: - typedef Sqrt_extension< COEFF_, ROOT_ > Type; + typedef Sqrt_extension< COEFF_, ROOT_, ACDE_TAG,FP_TAG > Type; // Tag_true if COEFF and ROOT are exact typedef typename ::boost::mpl::if_c< diff --git a/Number_types/include/CGAL/Sqrt_extension/Chinese_remainder_traits.h b/Number_types/include/CGAL/Sqrt_extension/Chinese_remainder_traits.h index c9d9632d50a..9c21ca52f46 100644 --- a/Number_types/include/CGAL/Sqrt_extension/Chinese_remainder_traits.h +++ b/Number_types/include/CGAL/Sqrt_extension/Chinese_remainder_traits.h @@ -27,10 +27,10 @@ namespace CGAL { -template -class Chinese_remainder_traits >{ +template +class Chinese_remainder_traits >{ private: - typedef CGAL::Sqrt_extension EXT; + typedef CGAL::Sqrt_extension EXT; typedef Chinese_remainder_traits CRT_NT; typedef Chinese_remainder_traits CRT_ROOT; diff --git a/Number_types/include/CGAL/Sqrt_extension/Coercion_traits.h b/Number_types/include/CGAL/Sqrt_extension/Coercion_traits.h index 1860898ef3d..f381c676ec5 100644 --- a/Number_types/include/CGAL/Sqrt_extension/Coercion_traits.h +++ b/Number_types/include/CGAL/Sqrt_extension/Coercion_traits.h @@ -31,10 +31,10 @@ namespace CGAL { /////////// COERCION_TRAITS BEGIN // and vice versa -template -struct Coercion_traits_for_level,CGAL_int(Coeff),CTL_SQRT_EXT>{ +template +struct Coercion_traits_for_level,CGAL_int(COEFF),CTL_SQRT_EXT>{ public: - typedef Sqrt_extension Type; + typedef Sqrt_extension Type; typedef CGAL::Tag_true Are_explicit_interoperable; typedef CGAL::Tag_true Are_implicit_interoperable; struct Cast{ @@ -44,45 +44,45 @@ public: }; }; -template -struct Coercion_traits_for_level,CTL_SQRT_EXT> - : public Coercion_traits_for_level,CGAL_int(Coeff),CTL_SQRT_EXT>{}; +template +struct Coercion_traits_for_level,CTL_SQRT_EXT> + : public Coercion_traits_for_level,CGAL_int(COEFF),CTL_SQRT_EXT>{}; -template -struct Coercion_traits_for_level,Coeff,CTL_SQRT_EXT>{ +template +struct Coercion_traits_for_level,COEFF,CTL_SQRT_EXT>{ public: - typedef Sqrt_extension Type; + typedef Sqrt_extension Type; typedef CGAL::Tag_true Are_explicit_interoperable; typedef CGAL::Tag_true Are_implicit_interoperable; struct Cast{ typedef Type result_type; Type operator()(const Type& x) const { return x;} - Type operator()(Coeff x) const { return Type(x);} + Type operator()(COEFF x) const { return Type(x);} }; }; -template -struct Coercion_traits_for_level,CTL_SQRT_EXT> - : public Coercion_traits_for_level,Coeff,CTL_SQRT_EXT>{}; +template +struct Coercion_traits_for_level,CTL_SQRT_EXT> + : public Coercion_traits_for_level,COEFF,CTL_SQRT_EXT>{}; // -template -struct Coercion_traits_for_level, - Sqrt_extension, +template +struct Coercion_traits_for_level, + Sqrt_extension, CTL_SQRT_EXT>{ private: typedef Coercion_traits CT; - typedef Sqrt_extension A; - typedef Sqrt_extension B; + typedef Sqrt_extension A; + typedef Sqrt_extension B; public: typedef CGAL::Tag_true Are_explicit_interoperable; typedef CGAL::Tag_false Are_implicit_interoperable; - typedef Sqrt_extension Type; + typedef Sqrt_extension Type; struct Cast{ private: @@ -106,19 +106,19 @@ public: }; -template -struct Coercion_traits_for_level,Root_2>, - Sqrt_extension, +template +struct Coercion_traits_for_level,ROOT_2,ACDE_TAG,FP_TAG>, + Sqrt_extension, CTL_SQRT_EXT>{ private: - typedef Sqrt_extension, Root_2> A; - typedef Sqrt_extension B; + typedef Sqrt_extension, ROOT_2,ACDE_TAG,FP_TAG> A; + typedef Sqrt_extension B; public: typedef CGAL::Tag_true Are_explicit_interoperable; typedef CGAL::Tag_true Are_implicit_interoperable; // Type = A - typedef Sqrt_extension, Root_2> Type; + typedef Sqrt_extension, ROOT_2,ACDE_TAG,FP_TAG> Type; struct Cast{ typedef Type result_type; Type operator()(const A& x) const { return x;} @@ -126,34 +126,34 @@ public: }; }; -template +template struct Coercion_traits_for_level < - Sqrt_extension, - Sqrt_extension, Root_2> + Sqrt_extension, + Sqrt_extension, ROOT_2, ACDE_TAG,FP_TAG> ,CTL_SQRT_EXT> :public Coercion_traits_for_level < - Sqrt_extension, Root_2>, - Sqrt_extension + Sqrt_extension, ROOT_2, ACDE_TAG,FP_TAG>, + Sqrt_extension ,CTL_SQRT_EXT> {}; -template +template struct Coercion_traits_for_level < - Sqrt_extension, Root_1>, - Sqrt_extension + Sqrt_extension, ROOT_1, ACDE_TAG,FP_TAG>, + Sqrt_extension ,CTL_SQRT_EXT>{ private: - typedef Sqrt_extension, Root_1> A; - typedef Sqrt_extension B; + typedef Sqrt_extension, ROOT_1,ACDE_TAG,FP_TAG> A; + typedef Sqrt_extension B; public: typedef CGAL::Tag_true Are_explicit_interoperable; typedef CGAL::Tag_true Are_implicit_interoperable; - typedef Sqrt_extension, Root_1> Type; + typedef Sqrt_extension, ROOT_1, ACDE_TAG,FP_TAG> Type; struct Cast{ typedef Type result_type; Type operator()(const A& x) const { return x;} @@ -161,16 +161,16 @@ public: }; }; -template +template struct Coercion_traits_for_level < - Sqrt_extension, - Sqrt_extension, Root_1> + Sqrt_extension, + Sqrt_extension, ROOT_1,ACDE_TAG,FP_TAG> ,CTL_SQRT_EXT> :public Coercion_traits_for_level < - Sqrt_extension, Root_1>, - Sqrt_extension + Sqrt_extension, ROOT_1,ACDE_TAG,FP_TAG>, + Sqrt_extension ,CTL_SQRT_EXT> {}; @@ -184,8 +184,8 @@ template struct CT_ext_not_to_fwsqrt; // -template -struct Coercion_traits_for_level, B , CTL_SQRT_EXT> +template +struct Coercion_traits_for_level, B , CTL_SQRT_EXT> :public ::boost::mpl::if_c< // if B is fwsqrt ::boost::is_base_and_derived< @@ -196,27 +196,27 @@ typename Algebraic_structure_traits::Algebraic_category >::value || typename Algebraic_structure_traits::Algebraic_category >::value , //then take Intern::Coercion_traits for fwsqrt - INTERN_CT::CT_ext_to_fwsqrt, B> + INTERN_CT::CT_ext_to_fwsqrt, B> , //else take Intern::Coercion_traits not for fwsqrt - INTERN_CT::CT_ext_not_to_fwsqrt< Sqrt_extension ,B> + INTERN_CT::CT_ext_not_to_fwsqrt< Sqrt_extension ,B> >::type {}; // -template +template struct Coercion_traits_for_level -,CTL_SQRT_EXT > - :public Coercion_traits_for_level,B,CTL_SQRT_EXT> +,CTL_SQRT_EXT > + :public Coercion_traits_for_level,B,CTL_SQRT_EXT> {}; namespace INTERN_CT{ // EXT coercion with FieldWithSqrt -template -struct CT_ext_to_fwsqrt, +template +struct CT_ext_to_fwsqrt, FieldWithSqrt>{ private: - typedef Sqrt_extension A; + typedef Sqrt_extension A; typedef FieldWithSqrt B; public: typedef CGAL::Tag_true Are_explicit_interoperable; @@ -226,8 +226,8 @@ public: struct Cast{ typedef Type result_type; Type operator()(const A& x) const { - typedef Coercion_traits CT_coeff; - typedef Coercion_traits CT_root; + typedef Coercion_traits CT_coeff; + typedef Coercion_traits CT_root; typename CT_coeff::Cast coeff_cast; typename CT_root::Cast root_cast; if (x.is_extended()) { @@ -246,16 +246,16 @@ public: }; // EXT coercion not with FieldWithSqrt -template -struct CT_ext_not_to_fwsqrt, B_>{ +template +struct CT_ext_not_to_fwsqrt, B_>{ private: - typedef Sqrt_extension A; + typedef Sqrt_extension A; typedef B_ B; - typedef Coercion_traits CT; + typedef Coercion_traits CT; public: typedef CGAL::Tag_true Are_explicit_interoperable; typedef CGAL::Tag_false Are_implicit_interoperable; - typedef Sqrt_extension Type; + typedef Sqrt_extension Type; struct Cast{ typedef Type result_type; Type operator()(const A& x) const { diff --git a/Number_types/include/CGAL/Sqrt_extension/Fraction_traits.h b/Number_types/include/CGAL/Sqrt_extension/Fraction_traits.h index 9195bbbba00..b525aa2471a 100644 --- a/Number_types/include/CGAL/Sqrt_extension/Fraction_traits.h +++ b/Number_types/include/CGAL/Sqrt_extension/Fraction_traits.h @@ -57,10 +57,10 @@ namespace Intern{ * This works for nested Sqrt_extensions, too. */ -template -class Fraction_traits< Sqrt_extension > +template +class Fraction_traits< Sqrt_extension > : public Intern::Sqrt_ext_Ftr_base_1< - Sqrt_extension, + Sqrt_extension, typename CGAL::Fraction_traits::Is_fraction > { // nothing new @@ -82,14 +82,14 @@ public: typedef ::CGAL::Null_tag Compose; }; -template -class Sqrt_ext_Ftr_base_2< Sqrt_extension, true > { +template +class Sqrt_ext_Ftr_base_2< Sqrt_extension, true > { private: typedef Fraction_traits CFT; public: - typedef Sqrt_extension NT; + typedef Sqrt_extension NT; typedef CGAL::Tag_true Is_fraction; - typedef Sqrt_extension Numerator_type; + typedef Sqrt_extension Numerator_type; typedef typename CFT::Denominator_type Denominator_type; typedef typename Algebraic_structure_traits::Gcd Common_factor; @@ -151,19 +151,19 @@ public: template class Sqrt_ext_Ftr_base_1; -template -class Sqrt_ext_Ftr_base_1< Sqrt_extension, CGAL::Tag_true > +template +class Sqrt_ext_Ftr_base_1< Sqrt_extension, CGAL::Tag_true > : public Sqrt_ext_Ftr_base_2< - Sqrt_extension, - ::boost::is_same< typename CGAL::Coercion_traits::Numerator_type>::Type, + Sqrt_extension, + ::boost::is_same< typename CGAL::Coercion_traits::Numerator_type>::Type, typename CGAL::Fraction_traits::Numerator_type>::value > { //nothing new }; - template - class Sqrt_ext_Ftr_base_1< Sqrt_extension, CGAL::Tag_false > - : public Sqrt_ext_Ftr_base_2< Sqrt_extension, false> + template + class Sqrt_ext_Ftr_base_1< Sqrt_extension, CGAL::Tag_false > + : public Sqrt_ext_Ftr_base_2< Sqrt_extension, false> { //nothing new }; @@ -193,7 +193,7 @@ namespace Intern{ typedef SqrtExt Numerator_type; typedef ::CGAL::Tag_true Is_composable; typedef typename CFT::Denominator_type Denominator; - typedef CGAL::Sqrt_extension Type; + typedef CGAL::Sqrt_extension Type; class Compose { public: @@ -220,10 +220,10 @@ namespace Intern{ }; } -template -class Cofraction_traits > +template +class Cofraction_traits > :public Intern::Sqrt_ext_Coftr_base_1< - Sqrt_extension, + Sqrt_extension, typename CGAL::Cofraction_traits::Is_composable>{ //nothing new; }; diff --git a/Number_types/include/CGAL/Sqrt_extension/Get_arithmetic_kernel.h b/Number_types/include/CGAL/Sqrt_extension/Get_arithmetic_kernel.h index 5cdf47405ff..478d1a8a4f3 100644 --- a/Number_types/include/CGAL/Sqrt_extension/Get_arithmetic_kernel.h +++ b/Number_types/include/CGAL/Sqrt_extension/Get_arithmetic_kernel.h @@ -27,8 +27,8 @@ namespace CGAL { -template -struct Get_arithmetic_kernel >{ +template +struct Get_arithmetic_kernel >{ typedef Get_arithmetic_kernel GET; typedef typename GET::Arithmetic_kernel Arithmetic_kernel; }; diff --git a/Number_types/include/CGAL/Sqrt_extension/Modular_traits.h b/Number_types/include/CGAL/Sqrt_extension/Modular_traits.h index 412255da5cc..8f45a9987f2 100644 --- a/Number_types/include/CGAL/Sqrt_extension/Modular_traits.h +++ b/Number_types/include/CGAL/Sqrt_extension/Modular_traits.h @@ -30,19 +30,19 @@ namespace CGAL { /////////// MODULAR_TRAITS BEGIN -template< class COEFF, class ROOT> -class Modular_traits< Sqrt_extension > { +template< class COEFF, class ROOT, class ACDE_TAG, class FP_TAG> +class Modular_traits< Sqrt_extension > { private: - typedef Sqrt_extension EXT; + typedef Sqrt_extension EXT; typedef Modular_traits MT_COEFF; typedef Modular_traits MT_ROOT; typedef typename MT_COEFF::Residue_type Residue_type_coeff; typedef typename MT_ROOT::Residue_type Residue_type_root; public: - typedef Sqrt_extension NT; + typedef EXT NT; typedef typename MT_COEFF::Is_modularizable Is_modularizable; - typedef Sqrt_extension Residue_type; + typedef Sqrt_extension Residue_type; struct Modular_image{ Residue_type operator()(const EXT& a){ diff --git a/Number_types/include/CGAL/Sqrt_extension/Real_embeddable_traits.h b/Number_types/include/CGAL/Sqrt_extension/Real_embeddable_traits.h index b03b8f97634..29ab55396b0 100644 --- a/Number_types/include/CGAL/Sqrt_extension/Real_embeddable_traits.h +++ b/Number_types/include/CGAL/Sqrt_extension/Real_embeddable_traits.h @@ -26,13 +26,13 @@ namespace CGAL { -template< class COEFF, class ROOT > -class Real_embeddable_traits< Sqrt_extension > +template< class COEFF, class ROOT, class ACDE_TAG, class FP_TAG > +class Real_embeddable_traits< Sqrt_extension > : public INTERN_RET::Real_embeddable_traits_base< - Sqrt_extension, + Sqrt_extension, typename Real_embeddable_traits::Is_real_embeddable > { public: - typedef Sqrt_extension Type; + typedef Sqrt_extension Type; class Sgn : public std::unary_function< Type, ::CGAL::Sign >{ @@ -78,10 +78,8 @@ class Real_embeddable_traits< Sqrt_extension > // or the root may not. ?? ! double operator()(const Type& x) const { if(x.is_extended()){ - return CGAL_NTS to_double(x.a0()) - + int(CGAL_NTS sign(x.a1())) - * CGAL_NTS sqrt(CGAL_NTS to_double(x.a1()*x.a1() * - Type(x.root()))); + return to_double(x.a0()) + to_double(x.a1()) + * (std::sqrt) (to_double(x.root())); }else{ return CGAL_NTS to_double(x.a0()); } diff --git a/Number_types/include/CGAL/Sqrt_extension/Scalar_factor_traits.h b/Number_types/include/CGAL/Sqrt_extension/Scalar_factor_traits.h index 3f67ebaea26..519e83fdd01 100644 --- a/Number_types/include/CGAL/Sqrt_extension/Scalar_factor_traits.h +++ b/Number_types/include/CGAL/Sqrt_extension/Scalar_factor_traits.h @@ -27,12 +27,12 @@ namespace CGAL { // This is the specialization for Sqrt_extension -template -class Scalar_factor_traits< Sqrt_extension > { +template +class Scalar_factor_traits< Sqrt_extension > { public: //! the number type for which this instance has been instantiated - typedef Sqrt_extension NT; + typedef Sqrt_extension NT; //! the number type of scalars that can be extracted from NT typedef typename Scalar_factor_traits::Scalar Scalar; diff --git a/Number_types/include/CGAL/Sqrt_extension/Sqrt_extension_type.h b/Number_types/include/CGAL/Sqrt_extension/Sqrt_extension_type.h index 967ccae199c..240814145ea 100644 --- a/Number_types/include/CGAL/Sqrt_extension/Sqrt_extension_type.h +++ b/Number_types/include/CGAL/Sqrt_extension/Sqrt_extension_type.h @@ -36,20 +36,18 @@ #include #include - -//#define CGAL_SQRT_EXT_USE_FILTER 1 -#ifdef CGAL_SQRT_EXT_USE_FILTER - #include -#endif - +#include +#include +#include +#include #define CGAL_int(T) typename First_if_different::Type namespace CGAL { -template class Sqrt_extension; -template -void output_maple(std::ostream&, const Sqrt_extension&); + +template +void output_maple(std::ostream&, const Sqrt_extension&); /*! \ingroup CGAL_Sqrt_extension \brief represents an extension of a number type by one square root. @@ -77,16 +75,48 @@ Note that the extension of an UFDomain or EuclideanRing is just an IntegralDomain, since the extension in general destroys the unique factorization property. */ -template -class Sqrt_extension : - boost::ordered_field_operators1< Sqrt_extension, - boost::ordered_field_operators2< Sqrt_extension, NT_ , - boost::ordered_field_operators2< Sqrt_extension, CGAL_int(NT_) + +namespace internal { +template +class Interval_optional_caching; + +//empty class +template <> +class Interval_optional_caching< ::CGAL::Tag_false > +{ +protected: + void invalidate_interval() {} + bool is_cached() const {return false;} + std::pair cached_value() const {return std::pair();} + void update_cached_value(const std::pair&) const {} +}; + + +template <> +class Interval_optional_caching< ::CGAL::Tag_true > +{ +protected: + typedef boost::optional< std::pair > Cached_interval; + mutable Cached_interval interval_; + void invalidate_interval() {interval_=Cached_interval();} + bool is_cached() const {return (interval_?true:false);} + std::pair cached_value() const {return *interval_;} + void update_cached_value(const std::pair& i) const {interval_=i;} +}; + +} //namespace internal + +template +class Sqrt_extension : public internal::Interval_optional_caching, + boost::ordered_field_operators1< Sqrt_extension, + boost::ordered_field_operators2< Sqrt_extension, NT_ , + boost::ordered_field_operators2< Sqrt_extension, CGAL_int(NT_) > > >{ public: typedef NT_ NT; typedef ROOT_ ROOT; - typedef Sqrt_extension Self; + typedef ACDE_TAG_ ACDE_TAG; + typedef Sqrt_extension Self; private: NT a0_; NT a1_; @@ -109,6 +139,10 @@ public: Sqrt_extension(const NT& i) : a0_(NT(i)), a1_(NT(0)), root_(ROOT(0)), is_extended_(false) {} + //non-documented: used for Make_sqrt + Sqrt_extension(const ROOT& root,bool) + :a0_(NT(0)), a1_(NT(1)), root_(root), is_extended_(true) {} + /*!\brief Explicit constructor of Sqrt_extension, from any type NTX. * \pre NT must constructible from NTX */ template @@ -116,7 +150,7 @@ public: : a0_(NT(i)), a1_(NT(0)), root_(ROOT(0)), is_extended_(false) {} /*! \brief copy constructor */ - Sqrt_extension(const Sqrt_extension& x) + Sqrt_extension(const Self& x) : a0_(x.a0()), a1_(x.a1()), root_(x.root()), @@ -143,33 +177,84 @@ public: : a0_(a0), a1_(a1), root_(root), - is_extended_(true){ - CGAL_precondition( !CGAL_NTS is_zero(root)); + is_extended_( true ){ + CGAL_precondition( ACDE_TAG_::value || !CGAL_NTS is_zero(root) ); //if ACDE_TAG_ is Tag_true, we allow root to be 0 } + /*! \brief Constructor of Sqrt_extension, from + * \c polynomial. The bool + * \pre NT must constructible from (NTX,NTX) + * \pre ROOT must constructible from (NTX,NTX) + */ + template + explicit Sqrt_extension(const NTX& a, const NTX& b, const NTX& c, const bool is_smaller, + typename boost::enable_if< boost::mpl::and_< + boost::is_same< typename Fraction_traits::Numerator_type,NTX >, + boost::is_same< typename Fraction_traits::Numerator_type,NTX > + > >::type* = 0 ) + { + typename Fraction_traits::Compose compose_nt; + if ( a != 0 ) { + a0_ = compose_nt(-b,2*a); + root_ = CGAL_NTS square(a0_) - ROOT(c,a); + if(CGAL_NTS is_zero(root_)) { + is_extended_ = false; + } else { + a1_ = (is_smaller ? -1 : 1); + is_extended_ = true; + } + } + else { + CGAL_assertion( b != 0 ); + is_extended_ = false; + a0_ = compose_nt(-c,b); + a1_ = 0; + root_ = 0; + } + } + + + Self conjugate() const + { + if(!is_extended_) return *this; + return Self(a0_,-a1_,root_); + } + //! Access operator for a0_, \c const inline const NT& a0() const { return a0_; } + inline const NT& alpha() const { return a0_; } //for backward compatibility //! Access operator for a0_ NT& a0() { return a0_; } + NT& alpha() { return a0_; } //for backward compatibility //! Access operator for a1_, \c const inline const NT& a1() const { return a1_; } + inline const NT& beta() const { return a1_; } //for backward compatibility //! Access operator for a1_ NT& a1() { return a1_; } + NT& beta() { return a1_; } //for backward compatibility //! Access operator for root_, \c const - inline const ROOT& root() const { return root_; } + inline const ROOT& root() const { return root_; } + inline const ROOT& gamma() const { return root_; } //for backward compatibility //! Access operator for is_extended_, \c const inline const bool& is_extended() const { return is_extended_; } + inline bool is_rational() const { + CGAL_precondition( (boost::is_same::value) || !"NT and ROOT should be identical and rational"); + return !is_extended_;} //for backward compatibility + + //!check if the number is an extension (test the values) and update the internal flag + inline bool check_if_is_extended() { + if(CGAL_NTS is_zero(a1_) || CGAL_NTS is_zero(root)) + is_extended_ = false; + return is_extended_; + } + //! Access operator for root_ //ROOT& root() { return root_; } // TODO: add to documentation - static void check_roots(const Self& a, const Self b ) { - if(a.is_extended() && b.is_extended()){ - if (a.root() != b.root()){ - //CGAL_error_msg("Interoperation of incompatible algebraic extensions"); - throw std::range_error("Interoperation of incompatible algebraic extensions"); - } - } + static void check_roots(const Self& a, const Self& b ) { + if(a.is_extended() && b.is_extended()) + CGAL_precondition (a.root() == b.root()); } // output_maple function for EXACUS compatibility @@ -178,19 +263,27 @@ public: CGAL::output_maple( os, *this ); } - std::pair to_interval() const{ - - if (! is_extended_) - return CGAL_NTS to_interval(a0_); - - const CGAL::Interval_nt& a0_int = CGAL_NTS to_interval(a0_); - const CGAL::Interval_nt& a1_int = CGAL_NTS to_interval(a1_); - const CGAL::Interval_nt& root_int = CGAL_NTS to_interval(root_); - const CGAL::Interval_nt& x_int = - a0_int + (a1_int * CGAL::sqrt(root_int)); + std::pair compute_to_interval() const + { + if (! is_extended_) + return CGAL_NTS to_interval(a0_); + CGAL::Interval_nt::Protector p; + const CGAL::Interval_nt& a0_int = CGAL_NTS to_interval(a0_); + const CGAL::Interval_nt& a1_int = CGAL_NTS to_interval(a1_); + const CGAL::Interval_nt& root_int = CGAL_NTS to_interval(root_); + const CGAL::Interval_nt& x_int = + a0_int + (a1_int * CGAL::sqrt(root_int)); - return (std::make_pair (x_int.inf(), x_int.sup())); -} + std::pair res(x_int.inf(), x_int.sup()); + this->update_cached_value(res); + return res; + } + + std::pair to_interval() const + { + std::pair ret=this->is_cached()?this->cached_value():compute_to_interval(); + return ret; + } //! propagates the simplify command to the members of xx void simplify(){ @@ -231,14 +324,14 @@ public: if (! is_extended_) return CGAL_NTS sign(a0()); -#ifdef CGAL_SQRT_EXT_USE_FILTER - const std::pair& x_in = this->to_interval(); + if (FP_TAG::value){ + const std::pair& x_in = this->to_interval(); - if (x_in.first > 0) - return (CGAL::POSITIVE); - else if (x_in.second < 0) - return (CGAL::NEGATIVE); -#endif + if (x_in.first > 0) + return (CGAL::POSITIVE); + else if (x_in.second < 0) + return (CGAL::NEGATIVE); + } return (this->sign_()); } @@ -278,9 +371,12 @@ public: } Self& operator += (const Self& p) { + this->invalidate_interval(); if(is_extended_){ if (p.is_extended_){ + #ifndef NDEBUG Self::check_roots(*this, p); + #endif return *this = Self (a0_+p.a0_, a1_+p.a1_, root_); }else{ return *this = Self (a0_+p.a0_, a1_, root_); @@ -294,10 +390,12 @@ public: } Self& operator -= (const Self& p) { - + this->invalidate_interval(); if(is_extended_){ if (p.is_extended_){ + #ifndef NDEBUG Self::check_roots(*this, p); + #endif return *this = Self (a0_-p.a0_, a1_-p.a1_, root_); }else{ return *this = Self (a0_-p.a0_, a1_, root_); @@ -310,10 +408,13 @@ public: } } - Self& operator *= (const Self& p){ + Self& operator *= (const Self& p){ + this->invalidate_interval(); if(is_extended_){ if (p.is_extended_){ + #ifndef NDEBUG Self::check_roots(*this, p); + #endif return *this = Self ( a0_*p.a0_+a1_*p.a1_*Root_nt_cast()(root_), a0_*p.a1_+a1_*p.a0_, @@ -329,6 +430,7 @@ public: } } Self& operator /= (const Self& p) { + this->invalidate_interval(); CGAL_assertion( ! CGAL_NTS is_zero(p) ); typename CGAL::Algebraic_structure_traits::Integral_division idiv; @@ -357,19 +459,23 @@ public: // SPECIALIZE_MEMBERS NT Self& operator += (const NT& num) { + this->invalidate_interval(); a0() += NT(num); return *this; } Self& operator -= (const NT& num) { + this->invalidate_interval(); a0() -= NT(num); return *this; } Self& operator *= (const NT& num) { + this->invalidate_interval(); a0() *= NT(num); a1() *= NT(num); return *this; } Self& operator /= (const NT& num) { + this->invalidate_interval(); CGAL_assertion(! CGAL_NTS is_zero(num)); a0() /= NT(num); a1() /= NT(num); @@ -377,19 +483,23 @@ public: } Self& operator += (CGAL_int(NT) num) { + this->invalidate_interval(); a0() += NT(num); return *this; } Self& operator -= (CGAL_int(NT) num) { + this->invalidate_interval(); a0() -= NT(num); return *this; } Self& operator *= (CGAL_int(NT) num) { + this->invalidate_interval(); a0() *= NT(num); a1() *= NT(num); return *this; } Self& operator /= (CGAL_int(NT) num) { + this->invalidate_interval(); CGAL_assertion(! CGAL_NTS is_zero(num)); a0() /= NT(num); a1() /= NT(num); @@ -409,15 +519,15 @@ compare (const NT& num) const { if (! is_extended_) return (CGAL::compare (a0_, num)); -#ifdef CGAL_SQRT_EXT_USE_FILTER - const std::pair& x_in = this->to_interval(); - const std::pair& y_in = CGAL::to_interval (num); - - if (x_in.second < y_in.first) - return (SMALLER); - else if (x_in.first > y_in.second) - return (LARGER); -#endif + if (FP_TAG::value){ + const std::pair& x_in = this->to_interval(); + const std::pair& y_in = CGAL::to_interval (num); + + if (x_in.second < y_in.first) + return (SMALLER); + else if (x_in.first > y_in.second) + return (LARGER); + } return ((Self(a0_ - num, a1_, root_)).sign_()); } @@ -426,7 +536,7 @@ compare (const NT& num) const { // However, the default is, that the the numbers are defined over the same // extension. CGAL::Comparison_result -compare(const Self& y, bool in_same_extension = true ) const + compare(const Self& y, bool in_same_extension = !ACDE_TAG::value ) const { if (! is_extended_) return (CGAL::opposite (y.compare (a0_))); @@ -436,15 +546,16 @@ compare(const Self& y, bool in_same_extension = true ) const if (in_same_extension) return ((*this) - y).sign(); -#ifdef CGAL_SQRT_EXT_USE_FILTER - const std::pair& x_in = this->to_interval(); - const std::pair& y_in = y.to_interval(); - - if (x_in.second < y_in.first) - return (SMALLER); - else if (x_in.first > y_in.second) - return (LARGER); -#endif + if (FP_TAG::value) + { + const std::pair& x_in = this->to_interval(); + const std::pair& y_in = y.to_interval(); + + if (x_in.second < y_in.first) + return (SMALLER); + else if (x_in.first > y_in.second) + return (LARGER); + } // Perform the exact comparison: // Note that the comparison of (a1 + b1*sqrt(c1)) and (a2 + b2*sqrt(c2)) @@ -541,94 +652,129 @@ compare(const Self& y, bool in_same_extension = true ) const } }; -// UNARY -template Sqrt_extension -operator + (const Sqrt_extension& p) { return p; } +/*! + * Compute the square of a one-root number. + */ +template +Sqrt_extension square (const Sqrt_extension& x) +{ + if (!x.is_extended()) + return Sqrt_extension (x.alpha() * x.alpha()); -template Sqrt_extension -operator - (const Sqrt_extension& p){ + // Use the equation: + // + // (a + b*sqrt(c))^2 = (a^2 + b^2*c) + 2ab*sqrt(c) + // + return (Sqrt_extension (x.alpha()*x.alpha() + x.beta()*x.beta() * NT(x.gamma()), + 2 * x.alpha() * x.beta(), + x.gamma())); +} + +// UNARY +template Sqrt_extension + operator + (const Sqrt_extension& p) { return p; } + +template Sqrt_extension +operator - (const Sqrt_extension& p){ if(p.is_extended()) - return Sqrt_extension(-p.a0(),-p.a1(),p.root()); + return Sqrt_extension(-p.a0(),-p.a1(),p.root()); else - return Sqrt_extension(-p.a0()); + return Sqrt_extension(-p.a0()); } // BINARY -template bool -operator == (const Sqrt_extension& p1, const Sqrt_extension& p2) -{ return (p1-p2).is_zero() ; } -template bool -operator < (const Sqrt_extension& p1, const Sqrt_extension& p2) +template bool +operator == (const Sqrt_extension& p1, const Sqrt_extension& p2) +{ return (p1-p2).is_zero(); } +template bool +operator == (const Sqrt_extension& p1, const Sqrt_extension& p2) +{ return ( p1.compare(p2) == CGAL::ZERO ); } +template bool +operator < (const Sqrt_extension& p1, const Sqrt_extension& p2) { return ( p1.compare(p2) == CGAL::SMALLER ); } // NT // righthand side -template bool operator == -(const Sqrt_extension& p, const NT& num) +template bool operator == +(const Sqrt_extension& p, const NT& num) { return (p-num).is_zero();} -template bool operator < -(const Sqrt_extension& p, const NT& num) +template bool operator < +(const Sqrt_extension& p, const NT& num) { return ( p.compare(num) == CGAL::SMALLER ); } -template bool operator > -(const Sqrt_extension& p, const NT& num) +template bool operator > +(const Sqrt_extension& p, const NT& num) { return ( p.compare(num) == CGAL::LARGER ); } // lefthand side -template bool operator == -(const NT& num, const Sqrt_extension& p) +template bool operator == +(const NT& num, const Sqrt_extension& p) { return ( p == num );} -template bool operator < -(const NT& num, const Sqrt_extension& p) +template bool operator < +(const NT& num, const Sqrt_extension& p) { return ( p.compare(num) == CGAL::LARGER ); } -template bool operator > -(const NT& num, const Sqrt_extension& p) +template bool operator > +(const NT& num, const Sqrt_extension& p) { return ( p.compare(num) == CGAL::SMALLER ); } //CGAL_int(NT) -template bool operator == -(const Sqrt_extension& p, CGAL_int(NT) num) +template bool operator == +(const Sqrt_extension& p, CGAL_int(NT) num) { return (p-num).is_zero();} -template bool operator < -(const Sqrt_extension& p, CGAL_int(NT) num) +template bool operator < +(const Sqrt_extension& p, CGAL_int(NT) num) { return ( p.compare(num) == CGAL::SMALLER ); } -template bool operator > -(const Sqrt_extension& p, CGAL_int(NT) num) +template bool operator > +(const Sqrt_extension& p, CGAL_int(NT) num) { return ( p.compare(num) == CGAL::LARGER ); } -template bool operator == -(CGAL_int(NT) num, const Sqrt_extension& p) +template bool operator == +(CGAL_int(NT) num, const Sqrt_extension& p) { return ( p == num );} -template bool operator < -(CGAL_int(NT) num, const Sqrt_extension& p) +template bool operator < +(CGAL_int(NT) num, const Sqrt_extension& p) { return ( p.compare(num) == CGAL::LARGER ); } -template bool operator > -(CGAL_int(NT) num, const Sqrt_extension& p) +template bool operator > +(CGAL_int(NT) num, const Sqrt_extension& p) { return ( p.compare(num) == CGAL::SMALLER ); } -template inline -Sqrt_extension min BOOST_PREVENT_MACRO_SUBSTITUTION( -const Sqrt_extension & x, -const Sqrt_extension & y){ +template inline +Sqrt_extension min BOOST_PREVENT_MACRO_SUBSTITUTION( +const Sqrt_extension & x, +const Sqrt_extension & y){ return (std::min)(x,y); } -template inline -Sqrt_extension max BOOST_PREVENT_MACRO_SUBSTITUTION( -const Sqrt_extension & x, -const Sqrt_extension & y){ +template inline +Sqrt_extension max BOOST_PREVENT_MACRO_SUBSTITUTION( +const Sqrt_extension & x, +const Sqrt_extension & y){ return (std::max)(x,y); } -template inline +template inline CGAL::Comparison_result compare ( - const Sqrt_extension& x, - const Sqrt_extension& y, - bool in_same_extension = true ){ + const Sqrt_extension& x, + const Sqrt_extension& y, + bool in_same_extension = !ACDE_TAG::value ){ return x.compare(y,in_same_extension); } + +template +void +print(std::ostream &os, const Sqrt_extension &r) +{ + if(!r.is_extended()) { + os << "(" << r.a0() << ")"; + } else { + os << "(" << r.a0() << " + " << r.a1() << + "*sqrt(" << r.root() << ")"<< ")"; + } +} + + } //namespace CGAL #undef CGAL_int diff --git a/Number_types/include/CGAL/Sqrt_extension/Wang_traits.h b/Number_types/include/CGAL/Sqrt_extension/Wang_traits.h index c2bbab9bb3a..85f8df971bf 100644 --- a/Number_types/include/CGAL/Sqrt_extension/Wang_traits.h +++ b/Number_types/include/CGAL/Sqrt_extension/Wang_traits.h @@ -31,12 +31,12 @@ namespace internal{ template class Wang_traits; -template -class Wang_traits< CGAL::Sqrt_extension >{ +template +class Wang_traits< CGAL::Sqrt_extension >{ typedef Wang_traits WT; public: // the supported number type - typedef CGAL::Sqrt_extension NT; + typedef CGAL::Sqrt_extension NT; // the scalar type (same as Scalar factor traits ?) typedef typename WT::Scalar Scalar; diff --git a/Number_types/include/CGAL/Sqrt_extension/convert_to_bfi.h b/Number_types/include/CGAL/Sqrt_extension/convert_to_bfi.h index 2bc55379740..7321a96e35e 100644 --- a/Number_types/include/CGAL/Sqrt_extension/convert_to_bfi.h +++ b/Number_types/include/CGAL/Sqrt_extension/convert_to_bfi.h @@ -18,7 +18,7 @@ // // Author(s) : Michael Hemmer -// This files addes an optional static cache to convert_to_bfi for Sqrt_extensions +// This files adds an optional static cache to convert_to_bfi for Sqrt_extension #ifndef CGAL_SQRT_EXTENSION_CONVERT_TO_BFI_H #define CGAL_SQRT_EXTENSION_CONVERT_TO_BFI_H @@ -26,6 +26,8 @@ #include #include #include +#include + // Disbale SQRT_EXTENSION_TO_BFI_CACHE by default #ifndef CGAL_USE_SQRT_EXTENSION_TO_BFI_CACHE @@ -37,7 +39,7 @@ namespace CGAL { namespace INTERN_SQRT_EXTENSION { -template +template class Sqrt_extension_bfi_cache { typedef std::pair Input; typedef BFI Output; @@ -54,17 +56,15 @@ public: typedef Cache Cache_type; static Cache_type cache; }; -template -typename Sqrt_extension_bfi_cache::Cache_type -Sqrt_extension_bfi_cache::cache; +template +typename Sqrt_extension_bfi_cache::Cache_type +Sqrt_extension_bfi_cache::cache; } // namespace INTERN_SQRT_EXTENSION -// TODO: move this to sqrt_extension ? -template class Sqrt_extension; -template +template typename Get_arithmetic_kernel::Arithmetic_kernel::Bigfloat_interval -convert_to_bfi(const CGAL::Sqrt_extension& x) { +convert_to_bfi(const CGAL::Sqrt_extension& x) { typedef typename Get_arithmetic_kernel::Arithmetic_kernel AK; typedef typename AK::Bigfloat_interval BFI; typedef Bigfloat_interval_traits BFIT; @@ -72,7 +72,7 @@ convert_to_bfi(const CGAL::Sqrt_extension& x) { BFI result; if(x.is_extended()){ - typedef INTERN_SQRT_EXTENSION::Sqrt_extension_bfi_cache Get_cache; + typedef INTERN_SQRT_EXTENSION::Sqrt_extension_bfi_cache Get_cache; BFI a0(convert_to_bfi(x.a0())); BFI a1(convert_to_bfi(x.a1())); BFI root(Get_cache::cache(std::make_pair(precision,x.root()))); diff --git a/Number_types/include/CGAL/Sqrt_extension/io.h b/Number_types/include/CGAL/Sqrt_extension/io.h index 838ec020b02..8745a1f6de1 100644 --- a/Number_types/include/CGAL/Sqrt_extension/io.h +++ b/Number_types/include/CGAL/Sqrt_extension/io.h @@ -31,11 +31,11 @@ namespace CGAL { -template +template void -input_ascii(std::istream& is , Sqrt_extension& result){ +input_ascii(std::istream& is , Sqrt_extension& result){ - typedef Sqrt_extension EXT; + typedef Sqrt_extension EXT; char c; NT a0; @@ -66,9 +66,9 @@ input_ascii(std::istream& is , Sqrt_extension& result){ result = EXT(a0,a1,root); } -template +template void -output_maple(std::ostream& os, const Sqrt_extension& x){ +output_maple(std::ostream& os, const Sqrt_extension& x){ CGAL::IO::Mode o_mode=::CGAL::get_mode(os); ::CGAL::set_mode(os,CGAL::IO::PRETTY); @@ -93,20 +93,20 @@ output_maple(std::ostream& os, const Sqrt_extension& x){ return; } -template< class NT, class ROOT > +template< class NT, class ROOT, class ACDE_TAG, class FP_TAG > void -output_benchmark( std::ostream& os, const Sqrt_extension& x ) { +output_benchmark( std::ostream& os, const Sqrt_extension& x ) { os << "Sqrt_extension( " << bmformat( x.a0() ) << ", " << bmformat( x.a1() ) << ", " << bmformat( x.root()) << " )"; } // Benchmark_rep specialization -template < class NT, class ROOT > -class Benchmark_rep< CGAL::Sqrt_extension< NT, ROOT > > { - const CGAL::Sqrt_extension< NT, ROOT >& t; +template < class NT, class ROOT, class ACDE_TAG, class FP_TAG > +class Benchmark_rep< CGAL::Sqrt_extension< NT,ROOT, ACDE_TAG, FP_TAG> > { + const CGAL::Sqrt_extension< NT,ROOT,ACDE_TAG,FP_TAG>& t; public: //! initialize with a const reference to \a t. - Benchmark_rep( const CGAL::Sqrt_extension< NT, ROOT >& tt) : t(tt) {} + Benchmark_rep( const CGAL::Sqrt_extension< NT,ROOT,ACDE_TAG,FP_TAG>& tt) : t(tt) {} //! perform the output, calls \c operator\<\< by default. std::ostream& operator()( std::ostream& out) const { output_benchmark( out, t ); @@ -116,16 +116,16 @@ public: static std::string get_benchmark_name() { std::stringstream ss; ss << "Sqrt_extension< " << Benchmark_rep< NT >::get_benchmark_name() - << ", " << Benchmark_rep< ROOT >::get_benchmark_name() << " >"; + << ", " << Benchmark_rep< ROOT>::get_benchmark_name() << " >"; return ss.str(); } }; -template -struct Needs_parens_as_product< Sqrt_extension >{ +template +struct Needs_parens_as_product< Sqrt_extension >{ public: - typedef Sqrt_extension NT; + typedef Sqrt_extension NT; bool operator()(const NT& t){ if( t.a0() != NT(0) && t.a1() != NT(0)){ return true; @@ -138,9 +138,9 @@ public: } }; -template +template std::ostream& operator << (std::ostream& os, - const Sqrt_extension& ext){ + const Sqrt_extension& ext){ switch(CGAL::get_mode(os)) { case CGAL::IO::PRETTY: output_maple(os,ext); break; @@ -157,8 +157,8 @@ std::ostream& operator << (std::ostream& os, * (\c LiS::IO::ASCII or \c LiS::IO::BINARY) and the input from * \c is must have the format of output to a stream of the same mode. */ -template -std::istream& operator >> (std::istream& is, Sqrt_extension& ext) { +template +std::istream& operator >> (std::istream& is, Sqrt_extension& ext) { CGAL_precondition(!CGAL::is_pretty(is)); input_ascii(is,ext); return is; diff --git a/Number_types/include/CGAL/Sqrt_extension_fwd.h b/Number_types/include/CGAL/Sqrt_extension_fwd.h new file mode 100644 index 00000000000..c13fadb7428 --- /dev/null +++ b/Number_types/include/CGAL/Sqrt_extension_fwd.h @@ -0,0 +1,34 @@ +// Copyright (c) 2011 GeoemtryFactory +// 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; version 2.1 of the License. +// See the file LICENSE.LGPL distributed with CGAL. +// +// 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) : Sebastien Loriot +// + + + +#ifndef CGAL_SQRT_EXTENSION_FWD_H +#define CGAL_SQRT_EXTENSION_FWD_H + +namespace CGAL{ + +template +class Sqrt_extension; + +} //namespace CGAL + +#endif // CGAL_SQRT_EXTENSION_FWD_H diff --git a/Number_types/include/CGAL/Test/test_root_of_traits.h b/Number_types/include/CGAL/Test/test_root_of_traits.h new file mode 100644 index 00000000000..7dc7e43eb3a --- /dev/null +++ b/Number_types/include/CGAL/Test/test_root_of_traits.h @@ -0,0 +1,86 @@ +#include + +namespace CGAL{ +namespace Test{ + +template +void test_root_of_traits(){ + // pure type checking + typedef CGAL::Root_of_traits RoT; + typedef typename RoT::Root_of_1 Root_of_1; + typedef typename RoT::Root_of_2 Root_of_2; + + BOOST_STATIC_ASSERT((::boost::is_same::value)); + BOOST_STATIC_ASSERT((::boost::is_same::value)); + + typedef typename RoT::Make_root_of_2 Make_root_of_2; + typedef typename RoT::Make_sqrt Make_sqrt; + typedef typename RoT::Inverse Inverse; + typedef typename RoT::Square Square; + + const Make_root_of_2& make_root_of_2 = Make_root_of_2(); + const Make_sqrt& make_sqrt = Make_sqrt(); + const Inverse& inverse = Inverse(); + const Square& square = Square(); + + BOOST_STATIC_ASSERT((::boost::is_same::value)); + BOOST_STATIC_ASSERT((::boost::is_same::value)); + BOOST_STATIC_ASSERT((::boost::is_same::value)); + BOOST_STATIC_ASSERT((::boost::is_same::value)); + + + { + Root_of_2 r = make_root_of_2(T(0),T(-1),T(2)); //-sqrt(2) + Root_of_2 rl = make_root_of_2(T(1),T(0),T(-2),true); //-sqrt(2); + Root_of_2 rr = make_root_of_2(T(1),T(0),T(-2),false); //+sqrt(2) + assert(r == rl); + assert(rl != rr); + + assert( r * Root_of_1(2) == make_root_of_2(T(0),T(-2),T(2))); + assert( r * T(2) == make_root_of_2(T(0),T(-2),T(2))); + }{ + Root_of_2 r = CGAL::make_root_of_2(T(0),T(-1),T(2)); //-sqrt(2) + Root_of_2 rl = CGAL::make_root_of_2(T(1),T(0),T(-2),true); //-sqrt(2); + Root_of_2 rr = CGAL::make_root_of_2(T(1),T(0),T(-2),false); //+sqrt(2) + assert(r == rl); + assert(rl != rr); + + assert( r * Root_of_1(2) == CGAL::make_root_of_2(T(0),T(-2),T(2))); + assert( r * T(2) == CGAL::make_root_of_2(T(0),T(-2),T(2))); + } + + + { + Root_of_2 r = make_sqrt(T(2)); //sqrt(2) + Root_of_2 rr = make_root_of_2(T(1),T(0),T(-2),false); //+sqrt(2) + assert(r == rr); + }{ + Root_of_2 r = CGAL::make_sqrt(T(2)); //sqrt(2) + Root_of_2 rr = CGAL::make_root_of_2(T(1),T(0),T(-2),false); //+sqrt(2) + assert(r == rr); + } + + { + Root_of_2 r = inverse(CGAL::make_sqrt(T(2))); + Root_of_2 rr = 1/CGAL::make_sqrt(T(2)); + assert(r == rr); + }{ + Root_of_2 r = CGAL::inverse(CGAL::make_sqrt(T(2))); + Root_of_2 rr = 1/CGAL::make_sqrt(T(2)); + assert(r == rr); + } + + { + Root_of_2 r = square(CGAL::make_sqrt(T(2))); + Root_of_2 rr = CGAL::make_sqrt(T(2))*CGAL::make_sqrt(T(2)); + assert(r == rr); + }{ + Root_of_2 r = CGAL::square(CGAL::make_sqrt(T(2))); + Root_of_2 rr = CGAL::make_sqrt(T(2))*CGAL::make_sqrt(T(2)); + assert(r == rr); + } + +} + +} // namespace Test +} // namespace CGAL diff --git a/Number_types/include/CGAL/leda_integer.h b/Number_types/include/CGAL/leda_integer.h index 18a76bea50e..98379d905f9 100644 --- a/Number_types/include/CGAL/leda_integer.h +++ b/Number_types/include/CGAL/leda_integer.h @@ -48,17 +48,6 @@ namespace CGAL { -template<> -struct Root_of_traits: public -internal::Root_of_traits_helper{ - typedef leda::rational RootOf_1; - typedef leda::rational Root_of_1; -}; - - - - template <> class Algebraic_structure_traits< leda_integer > : public Algebraic_structure_traits_base< leda_integer, Euclidean_ring_tag > { diff --git a/Number_types/include/CGAL/number_type_basic.h b/Number_types/include/CGAL/number_type_basic.h index 1dd8d879e12..61d9815af8c 100644 --- a/Number_types/include/CGAL/number_type_basic.h +++ b/Number_types/include/CGAL/number_type_basic.h @@ -86,7 +86,6 @@ #include #endif -#include #ifdef CGAL_USE_GMP diff --git a/Number_types/src/CGAL/MP_Float.cpp b/Number_types/src/CGAL/MP_Float.cpp index 919ee2aad52..a27c55e661e 100644 --- a/Number_types/src/CGAL/MP_Float.cpp +++ b/Number_types/src/CGAL/MP_Float.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include #include @@ -417,47 +416,6 @@ INTERN_MP_FLOAT::to_double(const Quotient &q) return (n.first / d.first) * scale; } - -double -INTERN_MP_FLOAT::to_double(const Root_of_2 &x) -{ - typedef MP_Float RT; - typedef Quotient FT; - typedef CGAL::Rational_traits< FT > Rational; - Rational r; - const RT r1 = r.numerator(x.alpha()); - const RT d1 = r.denominator(x.alpha()); - - if(x.is_rational()) { - std::pair n = to_double_exp(r1); - std::pair d = to_double_exp(d1); - double scale = std::ldexp(1.0, n.second - d.second); - return (n.first / d.first) * scale; - } - - const RT r2 = r.numerator(x.beta()); - const RT d2 = r.denominator(x.beta()); - const RT r3 = r.numerator(x.gamma()); - const RT d3 = r.denominator(x.gamma()); - - std::pair n1 = to_double_exp(r1); - std::pair v1 = to_double_exp(d1); - double scale1 = std::ldexp(1.0, n1.second - v1.second); - - std::pair n2 = to_double_exp(r2); - std::pair v2 = to_double_exp(d2); - double scale2 = std::ldexp(1.0, n2.second - v2.second); - - std::pair n3 = to_double_exp(r3); - std::pair v3 = to_double_exp(d3); - double scale3 = std::ldexp(1.0, n3.second - v3.second); - - return ((n1.first / v1.first) * scale1) + - ((n2.first / v2.first) * scale2) * - std::sqrt((n3.first / v3.first) * scale3); -} - - // FIXME : This function deserves proper testing... pair INTERN_MP_FLOAT::to_interval(const MP_Float &b) diff --git a/Number_types/test/Number_types/Root_of_traits.cpp b/Number_types/test/Number_types/Root_of_traits.cpp index 2349f7f5d6d..85a32c1610c 100644 --- a/Number_types/test/Number_types/Root_of_traits.cpp +++ b/Number_types/test/Number_types/Root_of_traits.cpp @@ -10,60 +10,80 @@ #include -#include -#include #include +#include -#include -#include -#include +#include #include +#include -template -void test_root_of_traits(){ - // pure type checking - typedef CGAL::Root_of_traits RoT; - typedef typename RoT::Root_of_1 Root_of_1; - typedef typename RoT::Root_of_2 Root_of_2; + +template +void test_root_of_traits_for_set(Integer, Rational, CGAL::Null_tag){ + { + typedef Integer RT; + typedef Rational FT; + typedef CGAL::Sqrt_extension Root_of_2; - BOOST_STATIC_ASSERT((::boost::is_same::value)); - BOOST_STATIC_ASSERT((::boost::is_same::value)); - - typedef typename RoT::Make_root_of_2 Make_root_of_2; - typedef typename Make_root_of_2::result_type result_type; - BOOST_STATIC_ASSERT((::boost::is_same::value)); + CGAL::Test::test_root_of_traits(); + CGAL::Test::test_root_of_traits(); + }{ + typedef CGAL::Lazy_exact_nt RT; + typedef CGAL::Lazy_exact_nt FT; + typedef CGAL::Lazy_exact_nt > Root_of_2; + CGAL::Test::test_root_of_traits(); + CGAL::Test::test_root_of_traits(); + } +} - Root_of_2 r = CGAL::make_root_of_2(T(0),T(-1),T(2)); //-sqrt(2) - Root_of_2 rl = CGAL::make_root_of_2(T(1),T(0),T(-2),true); //-sqrt(2); - Root_of_2 rr = CGAL::make_root_of_2(T(1),T(0),T(-2),false); //+sqrt(2) - assert(r == rl); - assert(rl != rr); - - assert( r * Root_of_1(2) == CGAL::make_root_of_2(T(0),T(-2),T(2))); - assert( r * T(2) == CGAL::make_root_of_2(T(0),T(-2),T(2))); +template +void test_root_of_traits_for_set(Integer, Rational, FWS){ + CGAL::Test::test_root_of_traits(); + test_root_of_traits_for_set(Integer(), Rational(), CGAL::Null_tag()); } int main(){ - test_root_of_traits< double , double , double >(); + CGAL::Test::test_root_of_traits< double , double , double >(); #ifdef CGAL_USE_GMP //TODO: switch to Gmpq { - typedef CGAL::Gmpz RT; - typedef CGAL::Gmpq Root_of_1; - typedef CGAL::Root_of_2 Root_of_2; - - test_root_of_traits(); - test_root_of_traits(); - }{ - typedef CGAL::Lazy_exact_nt RT; - typedef CGAL::Lazy_exact_nt Root_of_1; - typedef CGAL::Lazy_exact_nt > Root_of_2; - test_root_of_traits(); - test_root_of_traits(); + typedef CGAL::GMP_arithmetic_kernel AK; + typedef AK::Integer Integer; + typedef AK::Rational Rational; + typedef AK::Field_with_sqrt FWS; + test_root_of_traits_for_set(Integer(),Rational(),FWS()); } #endif +#ifdef CGAL_USE_LEDA + //TODO: switch to Gmpq + { + typedef CGAL::LEDA_arithmetic_kernel AK; + typedef AK::Integer Integer; + typedef AK::Rational Rational; + typedef AK::Field_with_sqrt FWS; + test_root_of_traits_for_set(Integer(),Rational(),FWS()); + } +#endif +#ifdef CGAL_USE_CORE + //TODO: switch to Gmpq + { + typedef CGAL::CORE_arithmetic_kernel AK; + typedef AK::Integer Integer; + typedef AK::Rational Rational; + typedef AK::Field_with_sqrt FWS; + test_root_of_traits_for_set(Integer(),Rational(),FWS()); + } +#endif + { + typedef CGAL::MP_Float_arithmetic_kernel AK; + typedef AK::Integer Integer; + typedef AK::Rational Rational; + typedef AK::Field_with_sqrt FWS; + test_root_of_traits_for_set(Integer(),Rational(),FWS()); + } + return 0; } diff --git a/Number_types/test/Number_types/Sqrt_extension.cpp b/Number_types/test/Number_types/Sqrt_extension.cpp index 2451a01714a..3e7d01c7911 100644 --- a/Number_types/test/Number_types/Sqrt_extension.cpp +++ b/Number_types/test/Number_types/Sqrt_extension.cpp @@ -131,9 +131,9 @@ void io_test(){ EXT(0).output_maple(os); // no real test just to instantiate code } -template +template void convert_to_real(){ - typedef CGAL::Sqrt_extension EXT1; + typedef CGAL::Sqrt_extension EXT1; { EXT1 ext((NT)3 ,(NT)5 ,(ROOT)17); @@ -150,9 +150,9 @@ void convert_to_real(){ } } -template +template void convert_to_bfi(){ - typedef CGAL::Sqrt_extension EXT1; + typedef CGAL::Sqrt_extension EXT1; typename CGAL::Bigfloat_interval_traits::Get_precision get_precision; typename CGAL::Bigfloat_interval_traits::Set_precision set_precision; long old_precision = get_precision(); @@ -179,7 +179,7 @@ void convert_to_bfi(){ } -template < class AT> +template < class AT, class ACDE_TAG> void sqrt_ext_pretty_output_test(){ typedef typename AT::Integer Integer; typedef CGAL::Sqrt_extension EXT1; @@ -314,11 +314,25 @@ template void test_compare(){ typedef typename EXT::NT NT; typedef typename EXT::ROOT ROOT; + typedef typename EXT::ACDE_TAG ACDE_TAG; EXT a(NT(1),NT(-5),ROOT(7)); EXT b(NT(2),NT(8),ROOT(5)); EXT c(NT(3),NT(0),ROOT(3)); + if(ACDE_TAG::value){ + assert(a.compare(b)==CGAL::SMALLER); + assert(a.compare(c)==CGAL::SMALLER); + assert(b.compare(c)==CGAL::LARGER ); + assert(a.compare(a)==CGAL::EQUAL); + assert(b.compare(b)==CGAL::EQUAL); + assert(c.compare(c)==CGAL::EQUAL); + } + assert(a.compare(a)==CGAL::EQUAL); + assert(b.compare(b)==CGAL::EQUAL); + assert(c.compare(c)==CGAL::EQUAL); + + assert(a.compare(b,false)==CGAL::SMALLER); assert(a.compare(c,false)==CGAL::SMALLER); assert(b.compare(c,false)==CGAL::LARGER ); @@ -340,11 +354,11 @@ void test_compare(){ assert(CGAL::compare(c,c,true)==CGAL::EQUAL); } -template +template void general_test(){ typedef typename CGAL::Algebraic_structure_traits::Is_exact Is_exact; - typedef CGAL::Sqrt_extension EXT1; + typedef CGAL::Sqrt_extension EXT1; EXT1 a1((NT)3 ,(NT)5 ,(ROOT)17); EXT1 b1((NT)-2,(NT)3 ,(ROOT)17); EXT1 c1((NT)7 ,(NT)-11,(ROOT)17); @@ -388,7 +402,7 @@ void general_test(){ -template +template void fraction_traits_test(){ //TEST Type traits ROOT of type INT typedef typename AT::Integer INT; @@ -492,7 +506,7 @@ void fraction_traits_test(){ // this includes Scalar_factor_traits // this includes Algebraic_extension_traits -template +template void scalar_factor_traits_test(){ { typedef typename AT::Integer Integer; @@ -548,15 +562,15 @@ void scalar_factor_traits_test(){ } } -template +template void test_algebraic_extension_traits(){ typedef typename AT::Integer INT; typedef typename AT::Rational RAT; - typedef CGAL::Sqrt_extension RAT1_EXT; - typedef CGAL::Sqrt_extension INT1_EXT; - typedef CGAL::Sqrt_extension RAT2_EXT; - typedef CGAL::Sqrt_extension INT2_EXT; + typedef CGAL::Sqrt_extension RAT1_EXT; + typedef CGAL::Sqrt_extension INT1_EXT; + typedef CGAL::Sqrt_extension RAT2_EXT; + typedef CGAL::Sqrt_extension INT2_EXT; // normalisation factor typedef CGAL::Algebraic_extension_traits RAT1_EXT_ANT; @@ -609,15 +623,15 @@ void test_algebraic_extension_traits(){ // denomiantor for algebraic integers { typedef typename AT::Integer Integer; - typedef CGAL::Sqrt_extension Extn_1; + typedef CGAL::Sqrt_extension Extn_1; typedef CGAL::Algebraic_extension_traits ANT; typename ANT::Denominator_for_algebraic_integers dfai; Extn_1 ext(1,2,5); assert(dfai(ext)==Extn_1(20)); }{ typedef typename AT::Integer Integer; - typedef CGAL::Sqrt_extension Extn_1; - typedef CGAL::Sqrt_extension Extn_2; + typedef CGAL::Sqrt_extension Extn_1; + typedef CGAL::Sqrt_extension Extn_2; typedef CGAL::Algebraic_extension_traits ANT; typename ANT::Denominator_for_algebraic_integers dfai; { @@ -636,8 +650,8 @@ void test_algebraic_extension_traits(){ } }{ typedef typename AT::Integer Integer; - typedef CGAL::Sqrt_extension Extn_1; - typedef CGAL::Sqrt_extension Extn_2; + typedef CGAL::Sqrt_extension Extn_1; + typedef CGAL::Sqrt_extension Extn_2; typedef CGAL::Algebraic_extension_traits ANT; typename ANT::Denominator_for_algebraic_integers dfai; { @@ -675,53 +689,55 @@ void test_algebraic_extension_traits(){ } } -template +template void test_get_arithmetic_kernel(){ typedef typename AT::Integer Integer; typedef typename AT::Rational Rational; { - typedef CGAL::Sqrt_extension EXT; + typedef CGAL::Sqrt_extension EXT; typedef typename CGAL::Get_arithmetic_kernel::Arithmetic_kernel AT_; BOOST_STATIC_ASSERT((boost::is_same::value)); } { - typedef CGAL::Sqrt_extension EXT; + typedef CGAL::Sqrt_extension EXT; typedef typename CGAL::Get_arithmetic_kernel::Arithmetic_kernel AT_; BOOST_STATIC_ASSERT((boost::is_same::value)); } { - typedef CGAL::Sqrt_extension EXT; + typedef CGAL::Sqrt_extension EXT; typedef typename CGAL::Get_arithmetic_kernel::Arithmetic_kernel AT_; BOOST_STATIC_ASSERT((boost::is_same::value)); } } -template +template void sqrt_extension_test(){ CGAL_SNAP_ARITHMETIC_KERNEL_TYPEDEFS(AT); - general_test(); - general_test(); + general_test(); + general_test(); - convert_to_real(); + convert_to_real(); - convert_to_bfi(); + convert_to_bfi(); - sqrt_ext_pretty_output_test(); - fraction_traits_test(); + sqrt_ext_pretty_output_test(); + fraction_traits_test(); - scalar_factor_traits_test(); - test_algebraic_extension_traits(); + scalar_factor_traits_test(); + test_algebraic_extension_traits(); - test_get_arithmetic_kernel(); + test_get_arithmetic_kernel(); } int main(){ #ifdef CGAL_HAS_LEDA_ARITHMETIC_KERNEL - sqrt_extension_test(); + sqrt_extension_test(); + sqrt_extension_test(); #endif // CGAL_HAS_LEDA_ARITHMETIC_KERNEL #ifdef CGAL_HAS_CORE_ARITHMETIC_KERNEL - sqrt_extension_test(); + sqrt_extension_test(); + sqrt_extension_test(); #endif // CGAL_HAS_CORE_ARITHMETIC_KERNEL return 0; } diff --git a/Number_types/test/Number_types/include/CGAL/Test/test_root_of_2_traits.h b/Number_types/test/Number_types/include/CGAL/Test/test_root_of_2_traits.h new file mode 100644 index 00000000000..66186d7199c --- /dev/null +++ b/Number_types/test/Number_types/include/CGAL/Test/test_root_of_2_traits.h @@ -0,0 +1,26 @@ +#include + +template +void test_root_of_traits(){ + // pure type checking + typedef CGAL::Root_of_traits RoT; + typedef typename RoT::Root_of_1 Root_of_1; + typedef typename RoT::Root_of_2 Root_of_2; + + BOOST_STATIC_ASSERT((::boost::is_same::value)); + BOOST_STATIC_ASSERT((::boost::is_same::value)); + + typedef typename RoT::Make_root_of_2 Make_root_of_2; + typedef typename Make_root_of_2::result_type result_type; + BOOST_STATIC_ASSERT((::boost::is_same::value)); + + const Make_root_of_2& make_root_of_2 = Make_root_of_2(); + Root_of_2 r = make_root_of_2(T(0),T(-1),T(2)); //-sqrt(2) + Root_of_2 rl = make_root_of_2(T(1),T(0),T(-2),true); //-sqrt(2); + Root_of_2 rr = make_root_of_2(T(1),T(0),T(-2),false); //+sqrt(2) + assert(r == rl); + assert(rl != rr); + + assert( r * Root_of_1(2) == CGAL::make_root_of_2(T(0),T(-2),T(2))); + assert( r * T(2) == CGAL::make_root_of_2(T(0),T(-2),T(2))); +} diff --git a/Number_types/test/Number_types/root_of_2.cpp b/Number_types/test/Number_types/root_of_2.cpp index 67de95b51c2..1cfcd342fed 100644 --- a/Number_types/test/Number_types/root_of_2.cpp +++ b/Number_types/test/Number_types/root_of_2.cpp @@ -19,7 +19,8 @@ #include #include #include -#include +#include +#include #include #include @@ -59,13 +60,13 @@ NT my_rand() //---------------------- -template -bool is_RO2_class(const CGAL::Root_of_2& ){ return true;} +template +bool is_RO2_class(const CGAL::Sqrt_extension& ){ return true;} template bool is_RO2_class(const T& ){ return false;} -template -CGAL::Root_of_2 conjugate(const CGAL::Root_of_2& R){ +template +CGAL::Sqrt_extension conjugate(const CGAL::Sqrt_extension& R){ return R.conjugate(); } @@ -77,21 +78,36 @@ template T inverse_helper(const T& R){ return (T) 1/R; } template -CGAL::Root_of_2 inverse_helper(const CGAL::Root_of_2& R){ - return inverse(R); -} +bool is_smaller_helper(const T& R){ return R.exact().a1() <= 0; } -template -bool is_smaller_helper(const T& R){ return R.exact().is_smaller(); } - -template -bool is_smaller_helper(const CGAL::Root_of_2& R){ return R.is_smaller();} +template +bool is_smaller_helper(const CGAL::Sqrt_extension& R){ return R.a1()<= 0;} template < typename RT > struct bracket { template < typename T > - RT operator()(const T& R, int i) const { return R.exact()[i]; } - RT operator()(const CGAL::Root_of_2& R, int i) const { return R[i]; } + RT operator()(const T& R, int i) const { return bracket().operator()(R.exact(),i); } + template + RT operator()(const CGAL::Sqrt_extension& R, int i) const { + typedef CGAL::Rational_traits< FT > Rational; + CGAL_assertion((i>=0) & (i<3)); + Rational r; + const RT r1 = r.numerator(R.a0()); + const RT d1 = r.denominator(R.a0()); + const RT r2 = r.numerator(R.a1()); + const RT d2 = r.denominator(R.a1()); + const RT r3 = r.numerator(R.root()); + const RT d3 = r.denominator(R.root()); + if(i == 0) { + return (CGAL_NTS square(d2)) * d3; + } + if(i == 1) { + return -2 * (CGAL_NTS square(d2)) * d3 * r1; + } + // i == 2 + return ((CGAL_NTS square(d2)) * d3 * (CGAL_NTS square(r1))) - + ((CGAL_NTS square(d1)) * r3 * (CGAL_NTS square(r2))); + } }; @@ -102,10 +118,17 @@ Root create_root_helper(RT a, RT b, Root *) return Root(a)/b; } -template < class T, class RT > -CGAL::Root_of_2 create_root_helper(RT a, RT b, CGAL::Root_of_2 *) +template +CGAL::Sqrt_extension create_root_helper(RT a, RT b,CGAL::Sqrt_extension *) { - return CGAL::Root_of_2(a, b); + return CGAL::Sqrt_extension(a)/b; +} + +template < class T, class RT,class Tag1, class Tag2 > +CGAL::Sqrt_extension create_root_helper(RT a, RT b, CGAL::Sqrt_extension *) +{ + T t(a,b); + return CGAL::Sqrt_extension( t ); } template < class Root, class RT > @@ -410,7 +433,7 @@ test_root_of_g() // assert(CGAL_NTS compare(r1_sqr, r2_sqr) == compare(dr1*dr1, dr2*dr2)); } - std::cout << " Testing addition/subtraction of Root_of_2 with NT" + std::cout << " Testing addition/subtraction of Sqrt_extension with NT" << std::endl; for (int i = 0; i < test_loops; ++i) { RT r = my_rand(); @@ -439,7 +462,7 @@ test_root_of_g() // assert(CGAL_NTS compare(r, r4) == (int) CGAL_NTS sign(r1)); } - std::cout << " Testing multiplication of Root_of_2 with NT" << std::endl; + std::cout << " Testing multiplication of Sqrt_extension with NT" << std::endl; for (int i = 0; i < test_loops; ++i) { RT r = my_rand(); Root r1 = my_rand_root(); @@ -515,7 +538,7 @@ test_root_of_g() // assert(CGAL_NTS compare(sqr_r1, sqr_r2) == compare(std::sqrt(dr1), std::sqrt(dr2))); } - std::cout << " Testing Root_of_2" << std::endl; + std::cout << " Testing Sqrt_extension" << std::endl; for (int i = 0; i < test_loops; ++i) { int n = rnd.get_int(0, 63); typedef CGAL::Rational_traits Rat_traits; @@ -536,8 +559,8 @@ test_root_of_g() template bool test_root_of(){ - typedef typename Root::RT RT; - typedef typename Root::FT FT; + typedef typename Root::NT FT; + typedef typename CGAL::Fraction_traits::Numerator_type RT; return test_root_of_g(); } @@ -547,58 +570,37 @@ test_root_of(){ int main(int argc, char **argv) { - using CGAL::Root_of_2; - test_loops = argc == 2 ? atoi(argv[1]) : 1000; bool result = true; -// std::cout << "Testing Root_of_2" << std::endl; - //~ result = result && test_root_of >(); + // Sqrt_extension requires a FT as template parameter + //std::cout << "Testing Sqrt_extension" << std::endl; + //result = result && test_root_of_g,double,double>(); - std::cout << "Testing Root_of_2" << std::endl; - result = result && test_root_of >(); - /* - // Root_of_2 can only be instantiated with RT for now - std::cout << "Testing Root_of_2 >" << std::endl; - result = result && - test_root_of > >(); - */ - + std::cout << "Testing Sqrt_extension with Quotient" << std::endl; + result = result && test_root_of,CGAL::Quotient,CGAL::Tag_true,CGAL::Tag_true> >(); std::cout << "Testing Lazy_exact_nt's RootOf_2 " << std::endl; result = result && test_root_of_g > - ::RootOf_2,CGAL::Lazy_exact_nt,CGAL::Lazy_exact_nt >(); - - + ::RootOf_2,CGAL::Lazy_exact_nt,CGAL::Lazy_exact_nt > >(); + #ifdef CGAL_USE_GMP - std::cout << "Testing Root_of_2" << std::endl; - result = result && test_root_of >(); - /* - // Root_of_2 can only be instantiated with RT for now - std::cout << "Testing Root_of_2" << std::endl; - result = result && test_root_of >(); - */ + std::cout << "Testing Sqrt_extension with Gmpq" << std::endl; + result = result && test_root_of >(); + + std::cout << "Testing Lazy_exact_nt's RootOf_2 " << std::endl; + result = result && + test_root_of_g > + ::RootOf_2,CGAL::Lazy_exact_nt,CGAL::Lazy_exact_nt >(); #endif #ifdef CGAL_USE_GMPXX - - // Root_of_2 can only be instantiated with RT for now - // It currently fails on Windows - //std::cout << "Testing Root_of_2" << std::endl; - //result = result && test_root_of >(); - - //std::cout << "Testing Root_of_2 >" << std::endl; - //result = result && test_root_of > >(); - - std::cout << "Testing Root_of_2" << std::endl; - result = result && test_root_of >(); -#endif - -#ifdef CGAL_USE_LEDA - //std::cout << "Testing Root_of_2" << std::endl; - //result = result && test_root_of >(); + std::cout << "Testing Sqrt_extension with Quotient mpz_class" << std::endl; + //no specialization of Get_arithmetic_kernel of mpz_class is available, the default is to suppose it is + //a ring type and make a field type using CGAL::Quotient. + result = result && test_root_of_g,CGAL::Quotient,CGAL::Tag_true,CGAL::Tag_true >,mpz_class,CGAL::Quotient >(); #endif if (result) { diff --git a/Point_set_processing_3/doc_tex/Point_set_processing_3/introduction.tex b/Point_set_processing_3/doc_tex/Point_set_processing_3/introduction.tex index 4a8913f7e37..312d9edbb78 100644 --- a/Point_set_processing_3/doc_tex/Point_set_processing_3/introduction.tex +++ b/Point_set_processing_3/doc_tex/Point_set_processing_3/introduction.tex @@ -37,7 +37,7 @@ In the context of surface reconstruction we can position the elements of this co \begin{figure}[h] \caption{Point set processing pipeline for surface reconstruction. The algorithms listed in gray are available from other - CGAL components (bounding volumes and principal + \cgal\ components (bounding volumes and principal component analysis).} \label{Point_set_processing_3-fig-pipeline} \end{figure} diff --git a/Point_set_processing_3/include/CGAL/compute_average_spacing.h b/Point_set_processing_3/include/CGAL/compute_average_spacing.h index a364e0decef..02808557dfd 100644 --- a/Point_set_processing_3/include/CGAL/compute_average_spacing.h +++ b/Point_set_processing_3/include/CGAL/compute_average_spacing.h @@ -136,12 +136,10 @@ compute_average_spacing( // precondition: at least 2 nearest neighbors CGAL_point_set_processing_precondition(k >= 2); - InputIterator it; - // Instanciate a KD-tree search. // Note: We have to convert each input iterator to Point_3. std::vector kd_tree_points; - for(it = first; it != beyond; it++) + for(InputIterator it = first; it != beyond; it++) { Point point = get(point_pmap, it); kd_tree_points.push_back(point); @@ -152,7 +150,7 @@ compute_average_spacing( // vectors (already normalized) FT sum_spacings = (FT)0.0; unsigned int nb_points = 0; - for(it = first; it != beyond; it++) + for(InputIterator it = first; it != beyond; it++) { sum_spacings += internal::compute_average_spacing(get(point_pmap,it),tree,k); nb_points++; diff --git a/Polyhedron/demo/Polyhedron/CMakeLists.txt b/Polyhedron/demo/Polyhedron/CMakeLists.txt index 517ae78daef..bd145cf1a44 100644 --- a/Polyhedron/demo/Polyhedron/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/CMakeLists.txt @@ -36,11 +36,17 @@ include_directories( BEFORE ./ ./include ../../include ) find_package(CGAL COMPONENTS Qt4) include( ${CGAL_USE_FILE} ) +option( POLYHEDRON_QTSCRIPT_DEBUGGER + "Activate the use of Qt Script Debugger in Polyhedron_3 demo" OFF) + # Find Qt4 itself set( QT_USE_QTXML TRUE ) set( QT_USE_QTMAIN TRUE ) set( QT_USE_QTSCRIPT TRUE ) set( QT_USE_QTOPENGL TRUE ) +if( POLYHEDRON_QTSCRIPT_DEBUGGER) + set( QT_USE_QTSCRIPTTOOLS TRUE ) +endif() find_package(Qt4) # Find OpenGL @@ -49,6 +55,7 @@ find_package(OpenGL) # Find QGLViewer if(QT4_FOUND) include(${QT_USE_FILE}) + include_directories( ${QT_INCLUDE_DIR}/QtScriptTools ) find_package(QGLViewer ) endif(QT4_FOUND) @@ -80,9 +87,10 @@ if(CGAL_Qt4_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND) message(STATUS "NOTICE: LAPACK is not found. curvatures estimation will not be available.") endif(LAPACK_FOUND) - qt4_wrap_ui( UI_FILES MainWindow.ui ) - + qt4_wrap_ui( MainWindowUI_files MainWindow.ui ) + qt4_wrap_ui( Show_point_dialogUI_FILES Show_point_dialog.ui ) qt4_wrap_ui( remeshingUI_FILES Remeshing_dialog.ui) + qt4_wrap_ui( meshingUI_FILES Meshing_dialog.ui Meshing_pause_widget.ui ) include(AddFileDependencies) @@ -92,62 +100,85 @@ if(CGAL_Qt4_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND) qt4_generate_moc( "Viewer.h" "${CMAKE_CURRENT_BINARY_DIR}/Viewer_moc.cpp" ) add_file_dependencies( Viewer_moc.cpp "${CMAKE_CURRENT_SOURCE_DIR}/Viewer.h" ) - qt4_generate_moc( "Scene.h" "${CMAKE_CURRENT_BINARY_DIR}/Scene_moc.cpp" ) - add_file_dependencies( Scene_moc.cpp "${CMAKE_CURRENT_SOURCE_DIR}/Scene.h" ) - - qt4_generate_moc( "Polyhedron_demo_remeshing_plugin_cgal_code.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Polyhedron_demo_remeshing_plugin_cgal_code.moc" ) qt4_add_resources ( RESOURCE_FILES Polyhedron_3.qrc ) - qt4_automoc(Scene_item.cpp + qt4_automoc(Scene.cpp + Scene_item.cpp Scene_plane_item.cpp Scene_polygon_soup.cpp Scene_polyhedron_item.cpp + Scene_edit_polyhedron_item.cpp Scene_textured_polyhedron_item.cpp Scene_c2t3_item.cpp - Scene_nef_polyhedron_item.cpp) + Scene_nef_polyhedron_item.cpp + Show_point_dialog.cpp + ) # AUXILIARY LIBRARIES # put plugins (which are shared libraries) at the same location as # executable files - set(LIBRARY_OUTPUT_PATH ${RUNTIME_OUTPUT_PATH}) - add_library(scene_item SHARED + add_library(demo_framework SHARED + Scene.cpp + Viewer.cpp Viewer_moc.cpp Scene_item.cpp Scene_item.moc Scene_item_with_display_list.cpp Polyhedron_demo_plugin_helper.cpp) + target_link_libraries(demo_framework + ${QGLVIEWER_LIBRARIES} + ${OPENGL_gl_LIBRARY} + ${OPENGL_glu_LIBRARY} + ) + add_library(scene_basic_objects SHARED Scene_plane_item.cpp Scene_plane_item.moc) - target_link_libraries(scene_basic_objects scene_item ${QGLVIEWER_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}) + target_link_libraries(scene_basic_objects + demo_framework + ${QGLVIEWER_LIBRARIES} + ${OPENGL_gl_LIBRARY} + ${OPENGL_glu_LIBRARY} + ) + + add_library(point_dialog SHARED Show_point_dialog.cpp Show_point_dialog.ui ${Show_point_dialogUI_FILES} ) add_library(scene_c2t3_item SHARED Scene_c2t3_item.cpp Scene_c2t3_item.moc) - target_link_libraries(scene_c2t3_item scene_item) + target_link_libraries(scene_c2t3_item demo_framework) add_library(scene_polyhedron_item SHARED Scene_polyhedron_item.cpp Scene_polyhedron_item.moc) - target_link_libraries(scene_polyhedron_item scene_item) + target_link_libraries(scene_polyhedron_item demo_framework) + + add_library(scene_edit_polyhedron_item SHARED + Scene_edit_polyhedron_item.cpp Scene_edit_polyhedron_item.moc) + target_link_libraries(scene_edit_polyhedron_item demo_framework) if(TAUCS_FOUND) add_library(scene_textured_polyhedron_item SHARED Scene_textured_polyhedron_item.cpp texture.cpp Scene_textured_polyhedron_item.moc) - target_link_libraries(scene_textured_polyhedron_item scene_item) + target_link_libraries(scene_textured_polyhedron_item demo_framework) endif(TAUCS_FOUND) - add_library(polygon_soup SHARED + add_library(scene_polygon_soup_item SHARED Scene_polygon_soup.cpp Scene_polygon_soup.moc) - target_link_libraries(polygon_soup scene_item) + target_link_libraries(scene_polygon_soup_item demo_framework scene_polyhedron_item) add_library(scene_nef_polyhedron_item SHARED Scene_nef_polyhedron_item.cpp Scene_nef_polyhedron_item.moc Scene_nef_rendering.cpp) - target_link_libraries(scene_nef_polyhedron_item scene_polyhedron_item) + target_link_libraries(scene_nef_polyhedron_item demo_framework scene_polyhedron_item) - foreach( lib scene_item scene_basic_objects scene_polyhedron_item polygon_soup scene_nef_polyhedron_item ) + foreach( lib + demo_framework + scene_basic_objects + scene_polyhedron_item + scene_polygon_soup_item + scene_nef_polyhedron_item ) add_to_cached_list( CGAL_EXECUTABLE_TARGETS ${lib} ) endforeach() @@ -156,13 +187,12 @@ if(CGAL_Qt4_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND) add_definitions(-DUSE_FORWARD_DECL) add_executable ( Polyhedron_3 MainWindow.cpp Polyhedron_3.cpp - Viewer.cpp - Scene.cpp +# Viewer.cpp +# Scene.cpp # MainWindow_curvature_estimation.cpp MainWindow_moc.cpp - Scene_moc.cpp - Viewer_moc.cpp - ${UI_FILES} ${RESOURCE_FILES} ) +# Viewer_moc.cpp + ${MainWindowUI_files} ${RESOURCE_FILES} ) add_to_cached_list( CGAL_EXECUTABLE_TARGETS Polyhedron_3 ) if(TAUCS_FOUND) # add_executable( Polyhedron_3 Scene_tex_rendering.cpp Scene_tex_polyhedron_operations.cpp ) @@ -176,7 +206,13 @@ if(CGAL_Qt4_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND) # Link with Qt libraries + if( POLYHEDRON_QTSCRIPT_DEBUGGER ) + add_definitions( -DQT_SCRIPTTOOLS_LIB ) + target_link_libraries( Polyhedron_3 QtScriptTools ) + endif() target_link_libraries( Polyhedron_3 ${QT_LIBRARIES} ) + target_link_libraries( Polyhedron_3 demo_framework ) + target_link_libraries( Polyhedron_3 point_dialog ) # Link with CGAL target_link_libraries( Polyhedron_3 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ) @@ -184,9 +220,6 @@ if(CGAL_Qt4_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND) # Link with libQGLViewer, OpenGL target_link_libraries( Polyhedron_3 ${QGLVIEWER_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ) - # Link with the scene_item library. -# target_link_libraries( Polyhedron_3 scene_item ) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS Polyhedron_3 ) @@ -198,26 +231,37 @@ if(CGAL_Qt4_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND) macro(polyhedron_demo_plugin plugin_name plugin_implementation_base_name) list_split(option ARGN_TAIL ${ARGN} ) if(NOT ${option} STREQUAL "EXCLUDE_FROM_ALL") - set(other_sources ${ARGN}) - set(option "") + if(NOT ${option} STREQUAL "NO_MOC") + set(other_sources ${ARGN}) + set(option "") + else() + set(other_sources ${ARGN_TAIL}) + endif() else() set(other_sources ${ARGN_TAIL}) endif() - qt4_generate_moc( "${CMAKE_CURRENT_SOURCE_DIR}/${plugin_implementation_base_name}.cpp" ${plugin_implementation_base_name}.moc ) - add_file_dependencies( ${plugin_implementation_base_name}.moc "${CMAKE_CURRENT_SOURCE_DIR}/${plugin_implementation_base_name}.cpp" ) + if("${option}" STREQUAL "NO_MOC") + set(option "") + set(moc_file_name "") + else() + set(moc_file_name ${plugin_implementation_base_name}.moc ) + qt4_generate_moc( ${plugin_implementation_base_name}.cpp "${CMAKE_CURRENT_BINARY_DIR}/${moc_file_name}" ) + add_file_dependencies( ${moc_file_name} "${CMAKE_CURRENT_SOURCE_DIR}/${plugin_implementation_base_name}.cpp" ) + endif() - add_library(${plugin_name} MODULE ${option} ${plugin_implementation_base_name}.moc ${plugin_implementation_base_name}.cpp ${other_sources}) + add_library(${plugin_name} MODULE ${option} ${moc_file_name} ${plugin_implementation_base_name}.cpp ${other_sources}) add_to_cached_list( CGAL_EXECUTABLE_TARGETS ${plugin_name} ) # Link with Qt target_link_libraries( ${plugin_name} ${QT_LIBRARIES} ) - # Link with scene_item - target_link_libraries( ${plugin_name} scene_item) + # Link with the demo_framework + target_link_libraries( ${plugin_name} demo_framework) # Link with CGAL target_link_libraries( ${plugin_name} ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ) + add_dependencies( ${plugin_name} Polyhedron_3 ) endmacro(polyhedron_demo_plugin) polyhedron_demo_plugin(remeshing_plugin Polyhedron_demo_remeshing_plugin Polyhedron_demo_remeshing_plugin_cgal_code.cpp Polyhedron_demo_remeshing_plugin_cgal_code.moc ${remeshingUI_FILES}) - target_link_libraries(remeshing_plugin scene_polyhedron_item polygon_soup scene_c2t3_item) + target_link_libraries(remeshing_plugin scene_polyhedron_item scene_polygon_soup_item scene_c2t3_item) if ( Boost_VERSION GREATER 103400 ) qt4_generate_moc( "Polyhedron_demo_mesh_3_plugin_cgal_code.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Scene_c3t3_item.moc" ) @@ -230,13 +274,13 @@ if(CGAL_Qt4_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND) endif( Boost_VERSION GREATER 103400 ) polyhedron_demo_plugin(inside_out_plugin Polyhedron_demo_inside_out_plugin) - target_link_libraries(inside_out_plugin scene_polyhedron_item polygon_soup) + target_link_libraries(inside_out_plugin scene_polyhedron_item scene_polygon_soup_item) polyhedron_demo_plugin(off_plugin Polyhedron_demo_off_plugin) - target_link_libraries(off_plugin scene_polyhedron_item polygon_soup) + target_link_libraries(off_plugin scene_polyhedron_item scene_polygon_soup_item) polyhedron_demo_plugin(orient_soup_plugin Polyhedron_demo_orient_soup_plugin) - target_link_libraries(orient_soup_plugin polygon_soup) + target_link_libraries(orient_soup_plugin scene_polygon_soup_item scene_polyhedron_item) polyhedron_demo_plugin(triangulate_facets_plugin Polyhedron_demo_triangulate_facets_plugin) target_link_libraries(triangulate_facets_plugin scene_polyhedron_item) @@ -272,6 +316,9 @@ if(CGAL_Qt4_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND) polyhedron_demo_plugin(trivial_plugin Polyhedron_demo_trivial_plugin) + polyhedron_demo_plugin(edit_polyhedron_plugin Polyhedron_demo_edit_polyhedron_plugin) + target_link_libraries(edit_polyhedron_plugin scene_polyhedron_item scene_edit_polyhedron_item) + polyhedron_demo_plugin(cut_plugin Polyhedron_demo_cut_plugin) target_link_libraries(cut_plugin scene_polyhedron_item scene_basic_objects) diff --git a/Polyhedron/demo/Polyhedron/Color_map.h b/Polyhedron/demo/Polyhedron/Color_map.h new file mode 100644 index 00000000000..fb89f4d2c3f --- /dev/null +++ b/Polyhedron/demo/Polyhedron/Color_map.h @@ -0,0 +1,26 @@ +#ifndef _COLOR_MAP_H +#define _COLOR_MAP_H + +#include + +template +Output_color_iterator +compute_color_map(QColor base_color, + unsigned nb_of_colors, + Output_color_iterator out) +{ + qreal hue = base_color.hueF(); + const qreal step = ((qreal)1) / nb_of_colors; + + qreal h = hue; + for(unsigned i = 0; i < nb_of_colors; ++i) { + h += step; + if ( h > 1 ) { h -= 1; } + *out++ = QColor::fromHsvF(h, + base_color.saturationF(), + base_color.valueF()); + } + return out; +} + +#endif diff --git a/Polyhedron/demo/Polyhedron/Kernel_type.h b/Polyhedron/demo/Polyhedron/Kernel_type.h new file mode 100644 index 00000000000..6da8cc541a5 --- /dev/null +++ b/Polyhedron/demo/Polyhedron/Kernel_type.h @@ -0,0 +1,13 @@ +#ifndef KERNEL_TYPE_H +#define KERNEL_TYPE_H + +#include +#include + +namespace kernel_type_h { + typedef CGAL::Exact_predicates_inexact_constructions_kernel K1; +} + +typedef CGAL::Mesh_3::Robust_intersection_traits_3 Kernel; + +#endif // KERNEL_TYPE_H diff --git a/Polyhedron/demo/Polyhedron/MainWindow.cpp b/Polyhedron/demo/Polyhedron/MainWindow.cpp index 6dee0b44be5..45c2ddf3c31 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.cpp +++ b/Polyhedron/demo/Polyhedron/MainWindow.cpp @@ -10,17 +10,94 @@ #include #include #include +#include +#include #include #include #include #include #include +#include +#include +#include +#include + +#ifdef QT_SCRIPT_LIB +# include +# ifdef QT_SCRIPTTOOLS_LIB +# include +# endif +#endif #include "Polyhedron_demo_plugin_interface.h" #include "Polyhedron_demo_io_plugin_interface.h" #include "ui_MainWindow.h" +#include "Show_point_dialog.h" + +#ifdef QT_SCRIPT_LIB +# include +# include + +QScriptValue +myScene_itemToScriptValue(QScriptEngine *engine, + Scene_item* const &in) +{ + return engine->newQObject(in); +} + +void myScene_itemFromScriptValue(const QScriptValue &object, + Scene_item* &out) +{ + out = qobject_cast(object.toQObject()); +} +#endif // QT_SCRIPT_LIB + +#ifdef QT_SCRIPT_LIB +# ifdef QT_SCRIPTTOOLS_LIB + +const QScriptEngineDebugger::DebuggerWidget debug_widgets[9] = { + QScriptEngineDebugger::ConsoleWidget, + QScriptEngineDebugger::StackWidget, + QScriptEngineDebugger::ScriptsWidget, + QScriptEngineDebugger::LocalsWidget, + QScriptEngineDebugger::CodeWidget, + QScriptEngineDebugger::CodeFinderWidget, + QScriptEngineDebugger::BreakpointsWidget, + QScriptEngineDebugger::DebugOutputWidget, + QScriptEngineDebugger::ErrorLogWidget +}; +const QString debug_widgets_names[9] = { + "Script console", + "Stack", + "Scripts", + "Locals", + "Code", + "CodeFinder", + "Breakpoints", + "DebugOutput", + "ErrorLog" +}; + +# endif +#endif + +QScriptValue myPrintFunction(QScriptContext *context, QScriptEngine *engine) +{ + MainWindow* mw = qobject_cast(engine->parent()); + QString result; + for (int i = 0; i < context->argumentCount(); ++i) { + if (i > 0) + result.append(" "); + result.append(context->argument(i).toString()); + } + + if(mw) mw->message(QString("QtScript: ") + result, ""); + + return engine->undefinedValue(); +} + MainWindow::~MainWindow() { delete ui; @@ -70,12 +147,19 @@ MainWindow::MainWindow(QWidget* parent) connect(scene, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex & )), this, SLOT(updateInfo())); + + connect(scene, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex & )), + this, SLOT(updateDisplayInfo())); + connect(scene, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex & )), viewer, SLOT(updateGL())); connect(scene, SIGNAL(updated()), viewer, SLOT(update())); + connect(scene, SIGNAL(updated()), + this, SLOT(selectionChanged())); + connect(scene, SIGNAL(itemAboutToBeDestroyed(Scene_item*)), this, SLOT(removeManipulatedFrame(Scene_item*))); @@ -86,12 +170,37 @@ MainWindow::MainWindow(QWidget* parent) SIGNAL(selectionChanged ( const QItemSelection & , const QItemSelection & ) ), this, SLOT(updateInfo())); + connect(treeView->selectionModel(), + SIGNAL(selectionChanged ( const QItemSelection & , const QItemSelection & ) ), + this, SLOT(updateDisplayInfo())); + connect(treeView->selectionModel(), SIGNAL(selectionChanged ( const QItemSelection & , const QItemSelection & ) ), this, SLOT(selectionChanged())); + treeView->setContextMenuPolicy(Qt::CustomContextMenu); + connect(treeView, SIGNAL(customContextMenuRequested(const QPoint & )), + this, SLOT(showSceneContextMenu(const QPoint &))); + connect(viewer, SIGNAL(selected(int)), this, SLOT(selectSceneItem(int))); + connect(viewer, SIGNAL(selectedPoint(double, double, double)), + this, SLOT(showSelectedPoint(double, double, double))); + + connect(viewer, SIGNAL(selectionRay(double, double, double, + double, double, double)), + scene, SIGNAL(selectionRay(double, double, double, + double, double, double))); + + connect(viewer, SIGNAL(requestContextMenu(QPoint)), + this, SLOT(contextMenuRequested(QPoint))); + connect(ui->infoLabel, SIGNAL(customContextMenuRequested(const QPoint & )), + this, SLOT(showSceneContextMenu(const QPoint &))); + + connect(ui->actionRecenterScene, SIGNAL(triggered()), + viewer->camera(), SLOT(interpolateToFitScene())); + connect(ui->actionRecenterScene, SIGNAL(triggered()), + viewer, SLOT(update())); connect(ui->actionAntiAliasing, SIGNAL(toggled(bool)), viewer, SLOT(setAntiAliasing(bool))); @@ -100,7 +209,7 @@ MainWindow::MainWindow(QWidget* parent) viewer, SLOT(setTwoSides(bool))); // enable anti-aliasing by default - ui->actionAntiAliasing->setChecked(true); + // ui->actionAntiAliasing->setChecked(true); // add the "About CGAL..." and "About demo..." entries this->addAboutCGAL(); @@ -116,6 +225,10 @@ MainWindow::MainWindow(QWidget* parent) connect(ui->actionQuit, SIGNAL(triggered()), this, SLOT(quit())); + // Connect "Select all items" + connect(ui->actionSelect_all_items, SIGNAL(triggered()), + this, SLOT(selectAll())); + // Recent files menu this->addRecentFiles(ui->menuFile, ui->actionQuit); connect(this, SIGNAL(openRecentFile(QString)), @@ -124,10 +237,118 @@ MainWindow::MainWindow(QWidget* parent) // Reset the "Operation menu" clearMenu(ui->menuOperations); +#ifdef QT_SCRIPT_LIB + std::cerr << "Enable scripts.\n"; + script_engine = new QScriptEngine(this); + qScriptRegisterMetaType(script_engine, + myScene_itemToScriptValue, + myScene_itemFromScriptValue); +# ifdef QT_SCRIPTTOOLS_LIB + QScriptEngineDebugger* debugger = new QScriptEngineDebugger(this); + debugger->setObjectName("qt script debugger"); + QAction* debuggerMenuAction = + menuBar()->addMenu(debugger->createStandardMenu()); + debuggerMenuAction->setText(tr("Qt Script &debug")); + for(unsigned int i = 0; i < 9; ++i) + { + QDockWidget* dock = new QDockWidget(debug_widgets_names[i], this); + dock->setObjectName(debug_widgets_names[i]); + dock->setWidget(debugger->widget(debug_widgets[i])); + this->addDockWidget(Qt::BottomDockWidgetArea, dock); + dock->hide(); + } + debugger->setAutoShowStandardWindow(false); + debugger->attachTo(script_engine); +# endif // QT_SCRIPTTOOLS_LIB + QScriptValue fun = script_engine->newFunction(myPrintFunction); + script_engine->globalObject().setProperty("print", fun); + + evaluate_script("print('hello', 'world', 'from QtScript!')"); + QScriptValue mainWindowObjectValue = script_engine->newQObject(this); + script_engine->globalObject().setProperty("main_window", mainWindowObjectValue); + + QScriptValue sceneObjectValue = script_engine->newQObject(scene); + mainWindowObjectValue.setProperty("scene", sceneObjectValue); + script_engine->globalObject().setProperty("scene", sceneObjectValue); + + QScriptValue viewerObjectValue = script_engine->newQObject(viewer); + mainWindowObjectValue.setProperty("viewer", viewerObjectValue); + script_engine->globalObject().setProperty("viewer", viewerObjectValue); + + QScriptValue cameraObjectValue = script_engine->newQObject(viewer->camera()); + viewerObjectValue.setProperty("camera", cameraObjectValue); + script_engine->globalObject().setProperty("camera", cameraObjectValue); + + evaluate_script("var plugins = new Array();"); +# ifdef QT_SCRIPTTOOLS_LIB + QScriptValue debuggerObjectValue = script_engine->newQObject(debugger); + script_engine->globalObject().setProperty("debugger", debuggerObjectValue); +# endif +#endif + // Load plugins, and re-enable actions that need it. loadPlugins(); readSettings(); // Among other things, the column widths are stored. + +#ifdef QT_SCRIPT_LIB + // evaluate_script("print(plugins);"); + Q_FOREACH(QAction* action, findChildren()) { + if(action->objectName() != "") { + QScriptValue objectValue = script_engine->newQObject(action); + script_engine->globalObject().setProperty(action->objectName(), + objectValue); + } + } + // debugger->action(QScriptEngineDebugger::InterruptAction)->trigger(); +#endif +} + +#ifdef QT_SCRIPT_LIB +void MainWindow::evaluate_script(QString script, + const QString& filename, + const bool quiet) { + QScriptValue value = script_engine->evaluate(script); + if(script_engine->hasUncaughtException()) { + QTextStream err(stderr); + err << "Qt Script exception:\n" + << script_engine->uncaughtException().toString() + << "\nBacktrace:\n"; + Q_FOREACH(QString line, script_engine->uncaughtExceptionBacktrace()) { + err << " " << line << "\n"; + } + } + else if(!quiet && !value.isNull() && !value.isUndefined()) { + QTextStream(stderr) << "Qt Script evaluated to \"" + << value.toString() << "\"\n"; + } +} + +void MainWindow::evaluate_script_quiet(QString script, + const QString& filename) +{ + evaluate_script(script, filename, true); +} +#endif + +void MainWindow::enableScriptDebugger(bool b /* = true */) +{ + Q_UNUSED(b); +#ifdef QT_SCRIPT_LIB +# ifdef QT_SCRIPTTOOLS_LIB + QScriptEngineDebugger* debugger = + findChild("qt script debugger"); + if(debugger) { + if(b) { + debugger->action(QScriptEngineDebugger::InterruptAction)->trigger(); + } + } + return; +# endif +#endif + // If we are here, then the debugger is not available + this->error(tr("Your version of Qt is too old, and for that reason" + "the Qt Script Debugger is not available.")); } void MainWindow::loadPlugins() @@ -140,7 +361,7 @@ void MainWindow::loadPlugins() QList plugins_directories; plugins_directories << qApp->applicationDirPath(); - QString env_path = ::getenv("POLYHEDRON_DEMO_PLUGINS_PATH"); + QString env_path = qgetenv("POLYHEDRON_DEMO_PLUGINS_PATH"); if(!env_path.isEmpty()) { Q_FOREACH (QString pluginsDir, env_path.split(":", QString::SkipEmptyParts)) { @@ -154,11 +375,15 @@ void MainWindow::loadPlugins() qPrintable(pluginsDir.absolutePath())); Q_FOREACH (QString fileName, pluginsDir.entryList(QDir::Files)) { if(fileName.contains("plugin") && QLibrary::isLibrary(fileName)) { - qDebug("### Loading \"%s\"...", fileName.toUtf8().data()); + qDebug("### Loading \"%s\"...", qPrintable(fileName)); QPluginLoader loader; loader.setFileName(pluginsDir.absoluteFilePath(fileName)); QObject *obj = loader.instance(); if(obj) { + QString name = fileName; + name.remove(QRegExp("^lib")); + name.remove(QRegExp("\\..*")); + obj->setObjectName(name); initPlugin(obj); initIOPlugin(obj); } @@ -172,6 +397,11 @@ void MainWindow::loadPlugins() } } +bool MainWindow::hasPlugin(QString pluginName) +{ + return plugins.contains(pluginName); +} + bool MainWindow::initPlugin(QObject* obj) { QObjectList childs = this->children(); @@ -180,6 +410,13 @@ bool MainWindow::initPlugin(QObject* obj) if(plugin) { // Call plugin's init() method plugin->init(this, this->scene, this); + plugins << obj->objectName(); +#ifdef QT_SCRIPT_LIB + QScriptValue objectValue = + script_engine->newQObject(obj); + script_engine->globalObject().setProperty(obj->objectName(), objectValue); + evaluate_script_quiet(QString("plugins.push(%1);").arg(obj->objectName())); +#endif Q_FOREACH(QAction* action, plugin->actions()) { // If action does not belong to the menus, add it to "Operations" menu @@ -201,6 +438,7 @@ bool MainWindow::initIOPlugin(QObject* obj) qobject_cast(obj); if(plugin) { // std::cerr << "I/O plugin\n"; + plugins << obj->objectName(); io_plugins << plugin; return true; } @@ -240,12 +478,51 @@ void MainWindow::addAction(QAction* action) } } +void MainWindow::addAction(QString actionName, + QString actionText, + QString menuName) { + QMenu* menu = 0; + Q_FOREACH(QAction* action, findChildren()) { + if(!action->menu()) continue; + QString menuText = action->menu()->title(); + if(menuText != menuName) continue; + menu = action->menu(); + } + if(menu == 0) { + menu = new QMenu(menuName, this); + menuBar()->insertMenu(ui->menuView->menuAction(), menu); + } + QAction* action = new QAction(actionText, this); + action->setObjectName(actionName); + menu->addAction(action); +#ifdef QT_SCRIPT_LIB + QScriptValue objectValue = script_engine->newQObject(action); + script_engine->globalObject().setProperty(action->objectName(), + objectValue); +#endif +} + +void MainWindow::viewerShow(float x, float y, float z) { + viewer->camera()->setRevolveAroundPoint(qglviewer::Vec(x, y, z)); + // viewer->camera()->lookAt(qglviewer::Vec(x, y, z)); + + qglviewer::ManipulatedCameraFrame backup_frame(*viewer->camera()->frame()); + viewer->camera()->fitSphere(qglviewer::Vec(x, y, z), + viewer->camera()->sceneRadius()/100); + qglviewer::ManipulatedCameraFrame new_frame(*viewer->camera()->frame()); + *viewer->camera()->frame() = backup_frame; + viewer->camera()->interpolateTo(new_frame, 1.f); + viewer->setVisualHintsMask(1); +} + void MainWindow::message(QString message, QString colorName, QString font) { if (message.endsWith('\n')) { message.remove(message.length()-1, 1); } + std::cerr << qPrintable(message) << std::endl; statusBar()->showMessage(message, 5000); - message = "" + message + "
"; + message = "" + + message + "
"; message = "[" + QTime::currentTime().toString() + "] " + message; ui->consoleTextEdit->insertHtml(message); ui->consoleTextEdit->verticalScrollBar()->setValue(ui->consoleTextEdit->verticalScrollBar()->maximum()); @@ -282,21 +559,101 @@ void MainWindow::updateViewerBBox() viewer->camera()->showEntireScene(); } -void MainWindow::open(QString filename) +void MainWindow::reload_item() { + QAction* sender_action = qobject_cast(sender()); + if(!sender_action) return; + + bool ok; + int item_index = sender_action->data().toInt(&ok); + QObject* item_object = scene->item(item_index); + if(!ok || !item_object || sender_action->data().type() != QVariant::Int) { + std::cerr << "Cannot reload item: " + << "the reload action has not item attached\n"; + return; + } + Scene_item* item = qobject_cast(item_object); + if(!item) { + std::cerr << "Cannot reload item: " + << "the reload action has a QObject* pointer attached\n" + << "that is not a Scene_item*\n"; + return; + } + QString filename = item->property("source filename").toString(); + if(filename.isEmpty()) { + std::cerr << "Cannot reload item: " + << "the item has not filename attached\n"; + return; + } + QFileInfo fileinfo(filename); + if(! (fileinfo.isFile() && fileinfo.isReadable()) ) { + std::cerr << "Cannot reload item: " + << "cannot read file " << qPrintable(filename) << " \n"; + return; + } + Scene_item* new_item = load_item(fileinfo); + if(!new_item) { + std::cerr << "Cannot reload item: " + << "file " << qPrintable(filename) << " is not an item\n"; + return; + } + new_item->setName(item->name()); + new_item->setColor(item->color()); + new_item->setRenderingMode(item->renderingMode()); + new_item->setVisible(item->visible()); + new_item->setProperty("source filename", item->property("source filename")); + new_item->changed(); + scene->replaceItem(item_index, new_item); + delete item; +} + +Scene_item* MainWindow::load_item(QFileInfo fileinfo) const { + Scene_item* item = 0; + Q_FOREACH(Polyhedron_demo_io_plugin_interface* plugin, + io_plugins) + { + if(plugin->canLoad()) { + item = plugin->load(fileinfo); + if(item) break; // go out of the loop + } + } + return item; +} + +void MainWindow::open(QString filename, bool no_popup) { +#ifdef QT_SCRIPT_LIB + QString program; + if(filename.startsWith("javascript:")) { + program=filename.right(filename.size() - 11); + } + if(filename.startsWith("qtscript:")) { + program=filename.right(filename.size() - 9); + } + if(filename.endsWith(".js")) { + QFile script_file(filename); + script_file.open(QIODevice::ReadOnly); + program = script_file.readAll(); + } + if(!program.isEmpty()) + { + { + QTextStream(stderr) << "Execution of script \"" + << filename << "\"\n"; + // << filename << "\", with following content:\n" + // << program; + } + evaluate_script(program, filename); + return; + } +#endif + QFileInfo fileinfo(filename); Scene_item* item = 0; if(fileinfo.isFile() && fileinfo.isReadable()) { - Q_FOREACH(Polyhedron_demo_io_plugin_interface* plugin, - io_plugins) - { - if(plugin->canLoad()) { - item = plugin->load(fileinfo); - if(item) break; // go out of the loop - } - } + item = load_item(fileinfo); if(item) { Scene::Item_id index = scene->addItem(item); + item->setProperty("source filename", fileinfo.absoluteFilePath()); QSettings settings; settings.setValue("OFF open directory", fileinfo.absoluteDir().absolutePath()); @@ -304,6 +661,7 @@ void MainWindow::open(QString filename) selectSceneItem(index); } else { + if(no_popup) return; QMessageBox::critical(this, tr("Cannot open file"), tr("File %1 has not a known file format.") @@ -311,6 +669,7 @@ void MainWindow::open(QString filename) } } else { + if(no_popup) return; QMessageBox::critical(this, tr("Cannot open file"), tr("File %1 is not a readable file.") @@ -321,34 +680,141 @@ void MainWindow::open(QString filename) void MainWindow::selectSceneItem(int i) { if(i < 0) return; - if((unsigned int)i >= scene->numberOfEntries()) return; + if(i >= scene->numberOfEntries()) return; treeView->selectionModel()->select(scene->createSelection(i), QItemSelectionModel::ClearAndSelect); } +void MainWindow::showSelectedPoint(double x, double y, double z) +{ + information(QString("Selected point: (%1, %2, %3)"). + arg(x, 0, 'g', 10). + arg(y, 0, 'g', 10). + arg(z, 0, 'g', 10)); +} + +void MainWindow::unSelectSceneItem(int i) +{ + removeSceneItemFromSelection(i); +} + +void MainWindow::addSceneItemInSelection(int i) +{ + treeView->selectionModel()->select(scene->createSelection(i), + QItemSelectionModel::Select); + scene->itemChanged(i); +} + +void MainWindow::removeSceneItemFromSelection(int i) +{ + treeView->selectionModel()->select(scene->createSelection(i), + QItemSelectionModel::Deselect); + scene->itemChanged(i); +} + +void MainWindow::selectAll() +{ + treeView->selectionModel()->select(scene->createSelectionAll(), + QItemSelectionModel::ClearAndSelect); +} + int MainWindow::getSelectedSceneItemIndex() const { QModelIndexList selectedRows = treeView->selectionModel()->selectedRows(); - if(selectedRows.empty()) + if(selectedRows.size() != 1) return -1; else return selectedRows.first().row(); } +QList MainWindow::getSelectedSceneItemIndices() const +{ + QModelIndexList selectedRows = treeView->selectionModel()->selectedRows(); + QList result; + Q_FOREACH(QModelIndex index, selectedRows) { + result << index.row(); + } + return result; +} + void MainWindow::selectionChanged() { scene->setSelectedItem(getSelectedSceneItemIndex()); + scene->setSelectedItemsList(getSelectedSceneItemIndices()); Scene_item* item = scene->item(getSelectedSceneItemIndex()); if(item != NULL && item->manipulatable()) { viewer->setManipulatedFrame(item->manipulatedFrame()); + } else { + viewer->setManipulatedFrame(0); + } + if(viewer->manipulatedFrame() == 0) { + Q_FOREACH(Scene_item* item, scene->entries()) { + if(item->manipulatable() && item->manipulatedFrame() != 0) { + if(viewer->manipulatedFrame() != 0) { + // there are at least two possible frames + viewer->setManipulatedFrame(0); + break; + } else { + viewer->setManipulatedFrame(item->manipulatedFrame()); + } + } + } + } + if(viewer->manipulatedFrame() != 0) { connect(viewer->manipulatedFrame(), SIGNAL(modified()), this, SLOT(updateInfo())); } - viewer->updateGL(); } +void MainWindow::contextMenuRequested(const QPoint& global_pos) { + int index = scene->mainSelectionIndex(); + showSceneContextMenu(index, global_pos); +} + +void MainWindow::showSceneContextMenu(int selectedItemIndex, + const QPoint& global_pos) +{ + Scene_item* item = scene->item(selectedItemIndex); + if(!item) return; + + const char* prop_name = "Menu modified by MainWindow."; + + QMenu* menu = item->contextMenu(); + if(menu && !item->property("source filename").toString().isEmpty()) { + bool menuChanged = menu->property(prop_name).toBool(); + if(!menuChanged) { + menu->addSeparator(); + QAction* reload = menu->addAction(tr("Reload item from file")); + reload->setData(qVariantFromValue(selectedItemIndex)); + connect(reload, SIGNAL(triggered()), + this, SLOT(reload_item())); + menu->setProperty(prop_name, true); + } + } + if(menu) + menu->exec(global_pos); +} + +void MainWindow::showSceneContextMenu(const QPoint& p) { + QWidget* sender = qobject_cast(this->sender()); + if(!sender) return; + + int index = -1; + if(sender == treeView) { + QModelIndex modelIndex = treeView->indexAt(p); + if(!modelIndex.isValid()) return; + + index = modelIndex.row(); + } + else { + index = scene->mainSelectionIndex(); + } + + showSceneContextMenu(index, sender->mapToGlobal(p)); +} + void MainWindow::removeManipulatedFrame(Scene_item* item) { if(item->manipulatable() && @@ -359,12 +825,26 @@ void MainWindow::removeManipulatedFrame(Scene_item* item) void MainWindow::updateInfo() { Scene_item* item = scene->item(getSelectedSceneItemIndex()); - if(item) - ui->infoLabel->setText(item->toolTip()); + if(item) { + QString item_text = item->toolTip(); + QString item_filename = item->property("source filename").toString(); + if(!item_filename.isEmpty()) { + item_text += QString("
File: %1").arg(item_filename); + } + ui->infoLabel->setText(item_text); + } else ui->infoLabel->clear(); } +void MainWindow::updateDisplayInfo() { + Scene_item* item = scene->item(getSelectedSceneItemIndex()); + if(item) + ui->displayLabel->setPixmap(item->graphicalToolTip()); + else + ui->displayLabel->clear(); +} + void MainWindow::readSettings() { this->readState("MainWindow", Size|State); @@ -390,12 +870,25 @@ void MainWindow::closeEvent(QCloseEvent *event) void MainWindow::on_actionLoad_triggered() { QStringList filters; + QStringList extensions; Q_FOREACH(Polyhedron_demo_io_plugin_interface* plugin, io_plugins) { if(plugin->canLoad()) { - filters += plugin->nameFilters(); + Q_FOREACH(QString filter, plugin->nameFilters()) { + if(!filter.isEmpty()) { + QRegExp re1("\\((.+)\\)"); + if(re1.indexIn(filter) != -1) { + QString filter_extensions = re1.cap(1); + extensions += filter_extensions.simplified().split(" "); + } + filters << filter; + } + } } } + QStringList sorted_extensions = extensions.toSet().toList(); filters << tr("All files (*)"); + filters.push_front(QString("All know files (%1)") + .arg(sorted_extensions.join(" "))); QSettings settings; QString directory = settings.value("OFF open directory", @@ -444,19 +937,15 @@ void MainWindow::on_actionSaveAs_triggered() QFileDialog::getSaveFileName(this, tr("Save to File..."), QString(), - tr("OFF files (*.off)\n" - "All files (*)")); - QFileInfo fileinfo(filename); - if(!fileinfo.isFile() || - QMessageBox::warning(this, - tr("File exists"), - tr("The file %1 already exists! Continue?") - .arg(filename), - QMessageBox::Yes|QMessageBox::No) == - QMessageBox::Yes) - { + filters.join(";;")); + save(filename, item); +} - Q_FOREACH(Polyhedron_demo_io_plugin_interface* plugin, canSavePlugins) { +void MainWindow::save(QString filename, Scene_item* item) { + QFileInfo fileinfo(filename); + + Q_FOREACH(Polyhedron_demo_io_plugin_interface* plugin, io_plugins) { + if(plugin->canSave(item)) { if(plugin->save(item, fileinfo)) break; } @@ -465,9 +954,9 @@ void MainWindow::on_actionSaveAs_triggered() bool MainWindow::on_actionErase_triggered() { - int index = scene->erase(getSelectedSceneItemIndex()); - selectSceneItem(index); - return index >= 0; + int next_index = scene->erase(scene->selectionIndices()); + selectSceneItem(next_index); + return next_index >= 0; } void MainWindow::on_actionEraseAll_triggered() @@ -505,6 +994,49 @@ void MainWindow::on_actionSetPolyhedronB_triggered() scene->setItemB(i); } +void MainWindow::on_actionSetBackgroundColor_triggered() +{ + QColor c = QColorDialog::getColor(); + if(c.isValid()) { + viewer->setBackgroundColor(c); + } +} + +void MainWindow::on_action_Look_at_triggered() +{ + Show_point_dialog dialog(this); + int i = dialog.exec(); + if( i == QDialog::Accepted && + dialog.has_correct_coordinates() ) + { + viewerShow((float)dialog.get_x(), + (float)dialog.get_y(), + (float)dialog.get_z()); + } +} + +QString MainWindow::camera_string() const +{ + return viewer->dumpCameraCoordinates(); +} + +void MainWindow::on_actionDumpCamera_triggered() +{ + information(QString("Camera: %1") + .arg(camera_string())); +} + +void MainWindow::on_action_Copy_camera_triggered() +{ + qApp->clipboard()->setText(this->camera_string()); +} + +void MainWindow::on_action_Paste_camera_triggered() +{ + QString s = qApp->clipboard()->text(); + viewer->moveCameraToCoordinates(s, 0.5f); +} + void MainWindow::setAddKeyFrameKeyboardModifiers(::Qt::KeyboardModifiers m) { viewer->setAddKeyFrameKeyboardModifiers(m); diff --git a/Polyhedron/demo/Polyhedron/MainWindow.h b/Polyhedron/demo/Polyhedron/MainWindow.h index d6d13bfe50e..e030162fa8f 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.h +++ b/Polyhedron/demo/Polyhedron/MainWindow.h @@ -4,8 +4,14 @@ #include #include +#ifdef QT_SCRIPT_LIB +# include +#endif #include +#include +#include +#include class Scene; class Viewer; @@ -35,22 +41,44 @@ public: public slots: void updateViewerBBox(); - void open(QString filename); + void open(QString filename, bool no_popup = false); + Scene_item* load_item(QFileInfo) const; + void reload_item(); void selectSceneItem(int i); + void showSelectedPoint(double, double, double); + void unSelectSceneItem(int i); + void selectAll(); + void addSceneItemInSelection(int i); + void removeSceneItemFromSelection(int i); // same as unSelectSceneItem void setAddKeyFrameKeyboardModifiers(Qt::KeyboardModifiers); void clearMenu(QMenu*); void addAction(QAction*); + void addAction(QString actionName, + QString actionText, + QString menuName); + void viewerShow(float, float, float); void information(QString); void warning(QString); void error(QString); + void message(QString, QString, QString = QString("normal")); + + bool hasPlugin(QString); + void enableScriptDebugger(bool = true); protected slots: void selectionChanged(); + + void contextMenuRequested(const QPoint& global_pos); + void showSceneContextMenu(int selectedItemIndex, + const QPoint& global_pos); + void showSceneContextMenu(const QPoint& local_pos_of_treeview); + void updateInfo(); + void updateDisplayInfo(); void removeManipulatedFrame(Scene_item*); // settings @@ -73,9 +101,18 @@ protected slots: // save as... void on_actionSaveAs_triggered(); + void save(QString filename, Scene_item* item); + + void on_actionSetBackgroundColor_triggered(); + + void on_action_Look_at_triggered(); + + QString camera_string() const; + void on_actionDumpCamera_triggered(); + void on_action_Copy_camera_triggered(); + void on_action_Paste_camera_triggered(); protected: - void message(QString, QString, QString = QString("normal")); void loadPlugins(); bool initPlugin(QObject*); bool initIOPlugin(QObject*); @@ -84,6 +121,7 @@ protected: bool onePolygonIsSelected() const; int getSelectedSceneItemIndex() const; + QList getSelectedSceneItemIndices() const; private: QString strippedName(const QString &fullFileName); @@ -93,6 +131,16 @@ private: QTreeView* treeView; Ui::MainWindow* ui; QVector io_plugins; + QStringList plugins; +#ifdef QT_SCRIPT_LIB + QScriptEngine* script_engine; +public: + void evaluate_script(QString script, + const QString & fileName = QString(), + const bool quiet = false); + void evaluate_script_quiet(QString script, + const QString & fileName = QString()); +#endif }; #endif // ifndef MAINWINDOW_H diff --git a/Polyhedron/demo/Polyhedron/MainWindow.ui b/Polyhedron/demo/Polyhedron/MainWindow.ui index f48127f67a7..85fe822068d 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.ui +++ b/Polyhedron/demo/Polyhedron/MainWindow.ui @@ -1,4 +1,3 @@ - MainWindow @@ -29,9 +28,6 @@ - - - @@ -40,7 +36,7 @@ 0 0 978 - 26 + 23 @@ -62,6 +58,7 @@ + @@ -124,9 +121,21 @@ + + + Ca&mera + + + + + + + + + @@ -139,7 +148,7 @@ - Polyhedra + Geometric Objects 1 @@ -206,6 +215,9 @@ true + + QAbstractItemView::ExtendedSelection + 0 @@ -238,6 +250,45 @@ + + + Infos + + + 1 + + + + + + + 0 + + + + + Qt::CustomContextMenu + + + 0 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + + + + + + + + + &Quit @@ -431,17 +482,11 @@ Set polyhedron A - - Ctrl+A - Set polyhedron B - - Ctrl+B - @@ -453,6 +498,11 @@ &Remeshing + + + Convex Decomposition + + Mean &value coordinates @@ -489,6 +539,19 @@ Ctrl+T + + + Re&center scene + + + Ctrl+C + + + + + Change &background color... + + &Minkowski sum @@ -497,9 +560,32 @@ Ctrl+O, M - + - Convex Decomposition + &Look at... + + + + + &Dump camera coordinates + + + + + &Copy camera + + + + + &Paste camera + + + + + Select all items + + + Ctrl+A diff --git a/Polyhedron/demo/Polyhedron/Point_dialog_config.h b/Polyhedron/demo/Polyhedron/Point_dialog_config.h new file mode 100644 index 00000000000..4133f9776b6 --- /dev/null +++ b/Polyhedron/demo/Polyhedron/Point_dialog_config.h @@ -0,0 +1,12 @@ +#ifndef POINT_DIALOG_CONFIG_H +#define POINT_DIALOG_CONFIG_H + +#include + +#ifdef point_dialog_EXPORTS +# define POINT_DIALOG_EXPORT Q_DECL_EXPORT +#else +# define POINT_DIALOG_EXPORT Q_DECL_IMPORT +#endif + +#endif // POINT_DIALOG_CONFIG_H diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_3.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_3.cpp index c03c4b22ffc..ba0eb98f23e 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_3.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_3.cpp @@ -25,11 +25,26 @@ int main(int argc, char **argv) mainWindow.setAddKeyFrameKeyboardModifiers(::Qt::MetaModifier); args.removeAt(0); } - +#ifdef QT_SCRIPT_LIB + if(!args.empty() && args[0] == "--debug-scripts") + { + mainWindow.enableScriptDebugger(); + args.removeAt(0); + } + mainWindow.open("autostart.js", true); +#endif Q_FOREACH(QString filename, args) { mainWindow.open(filename); } - return app.exec(); + + // A Qt Script may have closed the main window + // The following loop launch app.exec() only if there is a visible + // window. + Q_FOREACH (QWidget *widget, QApplication::topLevelWidgets()) { + if(widget->isVisible()) + return app.exec(); + } + return 0; } #ifndef USE_FORWARD_DECL diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_edit_polyhedron_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_edit_polyhedron_plugin.cpp new file mode 100644 index 00000000000..9d3421bf7ee --- /dev/null +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_edit_polyhedron_plugin.cpp @@ -0,0 +1,118 @@ +#include "Scene_polyhedron_item.h" +#include "Scene_edit_polyhedron_item.h" +#include +#include +#include +#include + +#include "Polyhedron_demo_plugin_helper.h" + +class Polyhedron_demo_edit_polyhedron_plugin : + public QObject, + public Polyhedron_demo_plugin_helper +{ + Q_OBJECT + Q_INTERFACES(Polyhedron_demo_plugin_interface) + +public: + Polyhedron_demo_edit_polyhedron_plugin() + : Polyhedron_demo_plugin_helper(), size(0) + {} + + void init(QMainWindow* mainWindow, Scene_interface* scene_interface); + QList actions() const { + return QList() << actionToggleEdit; + } + +public slots: + void on_actionToggleEdit_triggered(); + void edition(); + +private: + QAction* actionToggleEdit; + int size; +}; // end Polyhedron_demo_edit_polyhedron_plugin + +void Polyhedron_demo_edit_polyhedron_plugin::init(QMainWindow* mainWindow, + Scene_interface* scene_interface) +{ + actionToggleEdit = new QAction(tr("Toggle &edition of item(s)"), mainWindow); + actionToggleEdit->setObjectName("actionToggleEdit"); + Polyhedron_demo_plugin_helper::init(mainWindow, scene_interface); +} + +void Polyhedron_demo_edit_polyhedron_plugin::on_actionToggleEdit_triggered() { + bool found_polyhedron = false; + bool edit_needed = false; + QList changed_items; + Q_FOREACH(Scene_interface::Item_id i, scene->selectionIndices()) + { + if(Scene_polyhedron_item* poly_item = + qobject_cast(scene->item(i))) + { + found_polyhedron = true; + Scene_edit_polyhedron_item* edit_poly = + new Scene_edit_polyhedron_item(poly_item); + edit_poly->setColor(poly_item->color()); + edit_poly->setName(QString("%1 (edit)").arg(poly_item->name())); + scene->replaceItem(i, edit_poly); + changed_items.push_back(scene->item(i)); + edit_needed = true; + connect(edit_poly, SIGNAL(modified()), + this, SLOT(edition())); + } else if(Scene_edit_polyhedron_item* poly_item = + qobject_cast(scene->item(i))) + { + found_polyhedron = true; + scene->replaceItem(i, poly_item->to_polyhedron_item()); + delete poly_item; + } + } + if(found_polyhedron == false) { + QMessageBox::warning(mw, tr("Warning"), + tr("No polyhedron was selected")); + } + if(edit_needed) { + size = QInputDialog::getInt(mw, + tr("Polyhedron edition zone"), + tr("Size of edition zone:"), + size /* default value */ , + 0 /* min */ ); + std::cerr << "size = " << size << std::endl; + Q_FOREACH(Scene_item* item, changed_items) + { + Scene_edit_polyhedron_item* poly_edit_item = + qobject_cast(item); + if(poly_edit_item) poly_edit_item->setZoneSize(size); + } + } +} + +void Polyhedron_demo_edit_polyhedron_plugin::edition() { + QObject* obj = sender(); + Scene_edit_polyhedron_item* edit_item = + qobject_cast(obj); + if(!edit_item) { + std::cerr << "ERROR" << __FILE__ << ":" << __LINE__ + << " : " << "unknown object type" << std::endl; + return; + } + + typedef Kernel::Point_3 Point; + typedef Kernel::Vector_3 Vector; + typedef Polyhedron::Vertex_handle Vertex_handle; + + const Point& orig = edit_item->original_position(); + const Vector move_vector = edit_item->current_position() - orig; + + Q_FOREACH(Vertex_handle vh, edit_item->selected_vertices()) + { + vh->point() = vh->point() + move_vector; + } + edit_item->changed(); // that reset the original_position() + scene->itemChanged(edit_item); +} + +Q_EXPORT_PLUGIN2(Polyhedron_demo_edit_polyhedron_plugin, Polyhedron_demo_edit_polyhedron_plugin) + +#include "Polyhedron_demo_edit_polyhedron_plugin.moc" diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_kernel_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_kernel_plugin.cpp index 3e3d15629f7..d4403303f8b 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_kernel_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_kernel_plugin.cpp @@ -17,6 +17,13 @@ #include #include +#include "Kernel_type.h" +typedef Kernel::Triangle_3 Triangle; +typedef Kernel::Point_3 Point; +typedef Kernel::Vector_3 Vector; +typedef Kernel::Plane_3 Plane; +typedef Kernel::FT FT; + class Polyhedron_demo_kernel_plugin : public QObject, public Polyhedron_demo_plugin_helper diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_off_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_off_plugin.cpp index 5dc9fba218b..d21a51808e1 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_off_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_off_plugin.cpp @@ -32,7 +32,7 @@ bool Polyhedron_demo_off_plugin::canLoad() const { Scene_item* Polyhedron_demo_off_plugin::load(QFileInfo fileinfo) { - + if(fileinfo.suffix().toLower() != "off") return 0; // Open file std::ifstream in(fileinfo.filePath().toUtf8()); if(!in) { diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_off_to_nef_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_off_to_nef_plugin.cpp index 77874a6951e..4016bfffddd 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_off_to_nef_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_off_to_nef_plugin.cpp @@ -36,7 +36,7 @@ Polyhedron_demo_off_to_nef_plugin::load(QFileInfo fileinfo) { std::cerr << "Error!\n"; Scene_nef_polyhedron_item* item = new Scene_nef_polyhedron_item(); - if(!item->load(in)) + if(!item->load_from_off(in)) { delete item; return 0; diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_orient_soup_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_orient_soup_plugin.cpp index eab5c9d82d7..555917c4ddc 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_orient_soup_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_orient_soup_plugin.cpp @@ -6,6 +6,7 @@ #include #include "Scene_polygon_soup.h" +#include "Scene_polyhedron_item.h" #include "Polyhedron_demo_plugin_interface.h" #include "Messages_interface.h" @@ -46,6 +47,7 @@ void Polyhedron_demo_orient_soup_plugin::init(QMainWindow* mainWindow, mw = mainWindow; messages = m; actionOrient = new QAction(tr("Orient polygon soup"), mainWindow); + actionOrient->setObjectName("actionOrient"); connect(actionOrient, SIGNAL(triggered()), this, SLOT(orient())); @@ -67,26 +69,41 @@ QList Polyhedron_demo_orient_soup_plugin::actions() const { void Polyhedron_demo_orient_soup_plugin::orient() { - const Scene_interface::Item_id index = scene->mainSelectionIndex(); - - Scene_polygon_soup* item = - qobject_cast(scene->item(index)); - - if(item) + Q_FOREACH(Scene_interface::Item_id index, scene->selectionIndices()) { -// qDebug() << tr("I have the item %1\n").arg(item->name()); - QApplication::setOverrideCursor(Qt::WaitCursor); - if(!item->orient()) - messages->warning(tr("The polygon soup \"%1\" is not orientable.") - .arg(item->name())); - // QMessageBox::information(mw, tr("Not orientable"), -// tr("The polygon soup \"%1\" is not orientable.") -// .arg(item->name())); + Scene_polygon_soup* item = + qobject_cast(scene->item(index)); - scene->itemChanged(item); - - QApplication::restoreOverrideCursor(); + if(item) + { + // qDebug() << tr("I have the item %1\n").arg(item->name()); + QApplication::setOverrideCursor(Qt::WaitCursor); + if(!item->orient()) { + messages->warning(tr("The polygon soup \"%1\" is not orientable.") + .arg(item->name())); + // QMessageBox::information(mw, tr("Not orientable"), + // tr("The polygon soup \"%1\" is not orientable.") + // .arg(item->name())); + scene->itemChanged(item); + } else { + + Scene_polyhedron_item* poly_item = new Scene_polyhedron_item(); + if(item->exportAsPolyhedron(poly_item->polyhedron())) { + poly_item->setName(item->name()); + poly_item->setColor(item->color()); + poly_item->setRenderingMode(item->renderingMode()); + poly_item->setVisible(item->visible()); + poly_item->changed(); + poly_item->setProperty("source filename", item->property("source filename")); + scene->replaceItem(index, poly_item); + delete item; + } else { + scene->itemChanged(item); + } + } + } } + QApplication::restoreOverrideCursor(); } void Polyhedron_demo_orient_soup_plugin::shuffle() @@ -96,9 +113,26 @@ void Polyhedron_demo_orient_soup_plugin::shuffle() Scene_polygon_soup* item = qobject_cast(scene->item(index)); - if(item) + if(item) { item->shuffle_orientations(); - scene->itemChanged(item); + scene->itemChanged(item); + } + else { + Scene_polyhedron_item* poly_item = + qobject_cast(scene->item(index)); + if(poly_item) { + item = new Scene_polygon_soup(); + item->setName(poly_item->name()); + item->setColor(poly_item->color()); + item->setRenderingMode(poly_item->renderingMode()); + item->setVisible(poly_item->visible()); + item->setProperty("source filename", poly_item->property("source filename")); + item->load(poly_item); + item->shuffle_orientations(); + scene->replaceItem(index, item); + delete poly_item; + } + } } void Polyhedron_demo_orient_soup_plugin::displayNonManifoldEdges() diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_parameterization_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_parameterization_plugin.cpp index d1b0c5880b6..3291389b87f 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_parameterization_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_parameterization_plugin.cpp @@ -5,6 +5,7 @@ #include "Scene_polyhedron_item.h" #include "Scene_textured_polyhedron_item.h" #include "Textured_polyhedron_type.h" +#include "Polyhedron_type.h" #include diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_pca_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_pca_plugin.cpp index ae758e747d6..3560a5ea981 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_pca_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_pca_plugin.cpp @@ -14,6 +14,16 @@ #include // output for plane fitting #include // output for line fitting +#include "Kernel_type.h" +typedef Kernel::Plane_3 Plane; +typedef Kernel::Iso_cuboid_3 Iso_cuboid; +typedef Kernel::Triangle_3 Triangle; +typedef Kernel::Line_3 Line; +typedef Kernel::Vector_3 Vector; +typedef Kernel::Point_3 Point; +typedef Kernel::FT FT; + + class Polyhedron_demo_pca_plugin : public QObject, public Polyhedron_demo_plugin_helper diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_remeshing_plugin_cgal_code.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_remeshing_plugin_cgal_code.cpp index 3985513e9ea..a5aaa911898 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_remeshing_plugin_cgal_code.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_remeshing_plugin_cgal_code.cpp @@ -296,6 +296,8 @@ Scene_item* cgal_code_remesh(QWidget* parent, { // new scope for the initialization, so that the vector // polyhedron_points is destroyed as soon as the initialization is // finished + typedef Kernel::Point_3 Point; + std::vector polyhedron_points; polyhedron_points.reserve(pMesh->size_of_vertices()); std::copy(pMesh->points_begin(), pMesh->points_end(), diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_self_intersection_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_self_intersection_plugin.cpp index cd35942c854..5df1f10acd2 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_self_intersection_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_self_intersection_plugin.cpp @@ -1,6 +1,7 @@ #include #include #include +#include "Kernel_type.h" #include "Polyhedron_type.h" #include "Scene_polyhedron_item.h" @@ -14,6 +15,8 @@ #include #include +typedef Kernel::Triangle_3 Triangle; + class Polyhedron_demo_self_intersection_plugin : public QObject, public Polyhedron_demo_plugin_helper diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_triangulate_facets_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_triangulate_facets_plugin.cpp index f1198a7013b..ddf73011158 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_triangulate_facets_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_triangulate_facets_plugin.cpp @@ -6,125 +6,9 @@ #include "Polyhedron_demo_plugin_helper.h" #include "Scene_polyhedron_item.h" #include "Polyhedron_type.h" -#include - -#include -#include - -#include -#include -#include -#include -#include #include "CGAL/compute_normal.h" - -#include - -typedef Polyhedron::Halfedge_handle Halfedge_handle; - -typedef CGAL::Triangulation_2_filtered_projection_traits_3 Traits; - -typedef CGAL::Triangulation_vertex_base_with_info_2 Vb; - -struct Face_info { - Halfedge_handle e[3]; - bool is_external; -}; - -typedef CGAL::Triangulation_face_base_with_info_2 Fb1; - -typedef CGAL::Constrained_triangulation_face_base_2 Fb; -typedef CGAL::Triangulation_data_structure_2 TDS; -typedef CGAL::No_intersection_tag Itag; -typedef CGAL::Constrained_Delaunay_triangulation_2 CDTbase; -typedef CGAL::Constrained_triangulation_plus_2 CDT; - -typedef Polyhedron::HalfedgeDS HDS; - -class Triangulate_modifier : public CGAL::Modifier_base { - CDT* cdt; - Polyhedron::Facet_handle fh; - -public: - Triangulate_modifier(CDT* cdt, - Polyhedron::Facet_handle fh) - : cdt(cdt), fh(fh) - { - } - - bool is_external(CDT::Face_handle fh) const { - return fh->info().is_external; - } - - void operator()(HDS& hds) { - CGAL::HalfedgeDS_decorator decorator(hds); - typedef Polyhedron::Halfedge Halfedge; - - decorator.make_hole(fh->halfedge()); - for(CDT::Finite_edges_iterator - eit = cdt->finite_edges_begin(), - end = cdt->finite_edges_end(); - eit != end; ++eit) - { - CDT::Face_handle fh = eit->first; - const int index = eit->second; - CDT::Face_handle opposite_fh = fh->neighbor(eit->second); - const int opposite_index = opposite_fh->index(fh); - const CDT::Vertex_handle va = fh->vertex(cdt-> cw(index)); - const CDT::Vertex_handle vb = fh->vertex(cdt->ccw(index)); - - if( ! (is_external(fh) && is_external(opposite_fh)) && - ! cdt->is_constrained(*eit) ) - { - // strictly internal edge - Halfedge_handle h = hds.edges_push_back(Halfedge(), - Halfedge()); - fh->info().e[index] = h; - opposite_fh->info().e[opposite_index] = h->opposite(); - - decorator.set_vertex(h, va->info()->vertex()); - decorator.set_vertex(h->opposite(), vb->info()->vertex()); - } - if( cdt->is_constrained(*eit) ) - { - if(!is_external(fh)) { - fh->info().e[index] = va->info(); - } - if(!is_external(opposite_fh)) { - opposite_fh->info().e[opposite_index] = vb->info(); - } - } - } - for(CDT::Finite_faces_iterator - fit = cdt->finite_faces_begin(), - end = cdt->finite_faces_end(); - fit != end; ++fit) - { - if(!is_external(fit)) - { - Halfedge_handle h0 = fit->info().e[0]; - Halfedge_handle h1 = fit->info().e[1]; - Halfedge_handle h2 = fit->info().e[2]; - CGAL_assertion( h0 != Halfedge_handle() ); - CGAL_assertion( h1 != Halfedge_handle() ); - CGAL_assertion( h2 != Halfedge_handle() ); - - typedef Halfedge::Base HBase; - h0->HBase::set_next(h1); - decorator.set_prev(h1, h0); - h1->HBase::set_next(h2); - decorator.set_prev(h2, h1); - h2->HBase::set_next(h0); - decorator.set_prev(h0, h2); - - decorator.fill_hole(h0); - } - } - } -}; +#include "CGAL/triangulate_polyhedron.h" class Polyhedron_demo_triangulate_facets_plugin : public QObject, @@ -159,7 +43,6 @@ public: public slots: void untriangulate() { - CGAL::set_error_behaviour(CGAL::ABORT); const Scene_interface::Item_id index = scene->mainSelectionIndex(); Scene_polyhedron_item* item = @@ -187,7 +70,7 @@ public slots: !eit_copy->vertex()->is_bivalent() && !eit_copy->opposite()->vertex()->is_bivalent()) { - Kernel::Vector_3 v1 = compute_facet_normal(*fh1); + Kernel::Vector_3 v1 = compute_facet_normal(*fh1); Kernel::Vector_3 v2 = compute_facet_normal(*fh2); if(v1 * v2 > 0.99) { std::cerr << "join\n"; @@ -206,103 +89,35 @@ public slots: } void triangulate() { - CGAL::set_error_behaviour(CGAL::ABORT); - const Scene_interface::Item_id index = scene->mainSelectionIndex(); - + Q_FOREACH(Scene_interface::Item_id index, scene->selectionIndices()) { + Scene_polyhedron_item* item = qobject_cast(scene->item(index)); if(item) { Polyhedron* pMesh = item->polyhedron(); - if(!pMesh) return; + if(!pMesh) continue; if(pMesh->is_pure_triangle()) { messages->warning(tr("The polyhedron \"%1\" is already triangulated.") .arg(item->name())); - return; + continue; } QApplication::setOverrideCursor(Qt::WaitCursor); - typedef Polyhedron::Facet Facet; - typedef Polyhedron::Facet_iterator Facet_iterator; - typedef Polyhedron::Facet_handle Facet_handle; + CGAL::triangulate_polyhedron(*pMesh); - // One need to store facet handles into a vector, because the list of - // facets of the polyhedron will be modified during the loop, and - // that invalidates the range [facets_begin(), facets_end()[. - std::vector facets; - facets.reserve(pMesh->size_of_facets()); - for(Facet_iterator - fit = pMesh->facets_begin(), - end = pMesh->facets_end(); - fit != end; ++fit) { - facets.push_back(fit); - } - - // Iterates on the vector of facet handles - for(std::vector::iterator - fit_it = facets.begin(), - end = facets.end(); - fit_it != end; ++fit_it) - { - Facet_handle fit = *fit_it; - Kernel::Vector_3 normal = compute_facet_normal(*fit); - - Traits cdt_traits(normal); - CDT cdt(cdt_traits); - - Facet::Halfedge_around_facet_circulator - he_circ = fit->facet_begin(), - he_circ_end(he_circ); - CDT::Vertex_handle previous, first; - do { - CDT::Vertex_handle vh = cdt.insert(he_circ->vertex()->point()); - if(first == 0) { - first = vh; - } - vh->info() = he_circ; - if(previous != 0 && previous != vh) { - cdt.insert_constraint(previous, vh); - } - previous = vh; - } while( ++he_circ != he_circ_end ); - cdt.insert_constraint(previous, first); - - // sets mark is_external - for(CDT::Finite_faces_iterator - fit = cdt.finite_faces_begin(), - end = cdt.finite_faces_end(); - fit != end; ++fit) - { - fit->info().is_external = false; - } - std::queue face_queue; - face_queue.push(cdt.infinite_vertex()->face()); - while(! face_queue.empty() ) { - CDT::Face_handle fh = face_queue.front(); - face_queue.pop(); - CGAL_assertion(cdt.is_infinite(fh)); - if(fh->info().is_external) continue; - std::cerr << (void*)(&*fh) << std::endl; - fh->info().is_external = true; - for(int i = 0; i <3; ++i) { - if(!cdt.is_constrained(std::make_pair(fh, i))) - { - face_queue.push(fh->neighbor(i)); - } - } - } - // then modify the polyhedron - Triangulate_modifier modifier(&cdt, fit); - pMesh->delegate(modifier); - } CGAL_assertion_code(pMesh->normalize_border()); CGAL_assertion(pMesh->is_valid(false, 3)); + scene->itemChanged(item); - // default cursor - QApplication::restoreOverrideCursor(); - } + + } // end of if(item) + + } // end of the loop on the selected items + // default cursor + QApplication::restoreOverrideCursor(); } private: diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_trivial_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_trivial_plugin.cpp index 3f1912c073f..c81ca089e55 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_trivial_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_trivial_plugin.cpp @@ -125,7 +125,7 @@ QList Polyhedron_demo_trivial_plugin::actions() const { void Polyhedron_demo_trivial_plugin::bbox() { - for(size_t i = 0, end = scene->numberOfEntries(); + for(int i = 0, end = scene->numberOfEntries(); i < end; ++i) { if(qobject_cast(scene->item(i))) diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_type.h b/Polyhedron/demo/Polyhedron/Polyhedron_type.h index a1785386f9a..feaf36eda34 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_type.h +++ b/Polyhedron/demo/Polyhedron/Polyhedron_type.h @@ -3,27 +3,126 @@ // CGAL // kernel -#include - -typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; +#include "Kernel_type.h" // surface mesh #include +#include + +#include + +template +class Polyhedron_demo_vertex : + public CGAL::HalfedgeDS_vertex_base +{ +public: + typedef std::set Set_of_indices; + +private: + typedef CGAL::HalfedgeDS_vertex_base Pdv_base; + + Set_of_indices indices; +public: + int nb_of_feature_edges; + + bool is_corner() const { + return nb_of_feature_edges > 2; + } + + bool is_feature_vertex() const { + return nb_of_feature_edges != 0; + } + + void add_incident_patch(const Patch_id i) { + indices.insert(i); + } + + const Set_of_indices& + incident_patches_ids_set() const { + return indices; + } + + Polyhedron_demo_vertex() : Pdv_base(), nb_of_feature_edges(0) {} + Polyhedron_demo_vertex(const Point& p) : Pdv_base(p), nb_of_feature_edges(0) {} +}; + +template +class Polyhedron_demo_halfedge : + public CGAL::HalfedgeDS_halfedge_base +{ +private: + bool feature_edge; +public: + + Polyhedron_demo_halfedge() + : feature_edge(false) {}; + + bool is_feature_edge() const { + return feature_edge; + } + + void set_feature_edge(const bool b) { + feature_edge = b; + this->opposite()->feature_edge = b; + } +}; + +template +class Polyhedron_demo_face : + public CGAL::HalfedgeDS_face_base +{ +private: + Patch_id_ patch_id_; +public: + typedef Patch_id_ Patch_id; + + Polyhedron_demo_face() + : patch_id_(1) {} + + int patch_id() const { + return patch_id_; + } + + void set_patch_id(const int i) { + patch_id_ = i; + } +}; + +template +class Polyhedron_demo_items : public CGAL::Polyhedron_items_3 { +public: + // wrap vertex + template struct Vertex_wrapper + { + typedef typename Traits::Point_3 Point; + typedef Polyhedron_demo_vertex Vertex; + }; + + // wrap face + template struct Face_wrapper + { + typedef Polyhedron_demo_face Face; + }; + + // wrap halfedge + template struct Halfedge_wrapper + { + typedef Polyhedron_demo_halfedge Halfedge; + }; +}; #include "Polyhedron_type_fwd.h" -// simple geometric types -typedef Kernel::FT FT; -typedef Kernel::Line_3 Line; -typedef Kernel::Point_3 Point; -typedef Kernel::Plane_3 Plane; -typedef Kernel::Sphere_3 Sphere; -typedef Kernel::Vector_3 Vector; -typedef Kernel::Triangle_3 Triangle; -typedef Kernel::Iso_cuboid_3 Iso_cuboid; -typedef Kernel::Plane_3 Plane_3; - // surface mesh -typedef CGAL::Polyhedron_3 Polyhedron; +typedef CGAL::Polyhedron_3 > Polyhedron; #endif // POLYHEDRON_TYPE_H diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_type_fwd.h b/Polyhedron/demo/Polyhedron/Polyhedron_type_fwd.h index b950b1ed784..294e96bdf5b 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_type_fwd.h +++ b/Polyhedron/demo/Polyhedron/Polyhedron_type_fwd.h @@ -8,8 +8,16 @@ #include +template +class Polyhedron_demo_items; + namespace CGAL { + namespace Mesh_3 { + template + struct Robust_intersection_traits_3; + } + template < typename FT_ > struct Simple_cartesian; @@ -32,15 +40,27 @@ namespace CGAL { > class Polyhedron_3; +// changed since CGAL-3.8-Ic-8 +#if CGAL_VERSION_NR > 1030800008 + class Epick; +#endif } // end namespace CGAL // kernel - -typedef CGAL::Epick Kernel; +namespace polyhedron_type_fwd_h { +// changed since CGAL-3.8-Ic-8 +#if CGAL_VERSION_NR > 1030800008 + typedef CGAL::Epick K1; +#else + typedef CGAL::Filtered_kernel< CGAL::Simple_cartesian, true > K1; +#endif + typedef CGAL::Mesh_3::Robust_intersection_traits_3 Kernel; +} // surface mesh -typedef CGAL::Polyhedron_3, + // CGAL::Polyhedron_items_3, CGAL::HalfedgeDS_default, std::allocator > Polyhedron; diff --git a/Polyhedron/demo/Polyhedron/Scene.cpp b/Polyhedron/demo/Polyhedron/Scene.cpp index a53badda303..04a501d3f7d 100644 --- a/Polyhedron/demo/Polyhedron/Scene.cpp +++ b/Polyhedron/demo/Polyhedron/Scene.cpp @@ -2,6 +2,8 @@ #include "Scene.h" #include "Scene_item.h" +#include +#include #include #include #include @@ -10,11 +12,12 @@ #include #include #include +#include namespace { void CGALglcolor(QColor c) { - ::glColor4f(c.red()/255.0, c.green()/255.0, c.blue()/255.0, c.alpha()/255.0); + ::glColor4d(c.red()/255.0, c.green()/255.0, c.blue()/255.0, c.alpha()/255.0); } } @@ -24,29 +27,54 @@ Scene::Scene(QObject* parent) item_A(-1), item_B(-1) { + connect(this, SIGNAL(selectionRay(double, double, double, + double, double, double)), + this, SLOT(setSelectionRay(double, double, double, + double, double, double))); } Scene::Item_id Scene::addItem(Scene_item* item) { - entries.push_back(item); + m_entries.push_back(item); + connect(item, SIGNAL(itemChanged()), + this, SLOT(itemChanged())); emit updated_bbox(); emit updated(); QAbstractListModel::reset(); - return entries.size() - 1; + Item_id id = m_entries.size() - 1; + emit newItem(id); + return id; +} + +Scene_item* +Scene::replaceItem(Scene::Item_id index, Scene_item* item) +{ + if(index < 0 || index >= m_entries.size()) + return 0; + + connect(item, SIGNAL(itemChanged()), + this, SLOT(itemChanged())); + std::swap(m_entries[index], item); + + emit updated_bbox(); + emit updated(); + itemChanged(index); + QAbstractListModel::reset(); + return item; } int Scene::erase(int index) { - if(index < 0 || index >= entries.size()) + if(index < 0 || index >= m_entries.size()) return -1; - Scene_item* item = entries[index]; + Scene_item* item = m_entries[index]; emit itemAboutToBeDestroyed(item); delete item; - entries.removeAt(index); + m_entries.removeAt(index); selected_item = -1; emit updated(); @@ -54,30 +82,62 @@ Scene::erase(int index) if(--index >= 0) return index; - if(!entries.isEmpty()) + if(!m_entries.isEmpty()) + return 0; + return -1; +} + +int +Scene::erase(QList indices) +{ + QList to_be_removed; + + int max_index = -1; + Q_FOREACH(int index, indices) { + if(index < 0 || index >= m_entries.size()) + continue; + max_index = (std::max)(max_index, index); + Scene_item* item = m_entries[index]; + to_be_removed.push_back(item); + emit itemAboutToBeDestroyed(item); + delete item; + } + + Q_FOREACH(Scene_item* item, to_be_removed) { + m_entries.removeAll(item); + } + + selected_item = -1; + emit updated(); + QAbstractListModel::reset(); + + int index = max_index + 1 - indices.size(); + if(index >= 0) + return index; + if(!m_entries.isEmpty()) return 0; return -1; } Scene::~Scene() { - Q_FOREACH(Scene_item* item_ptr, entries) + Q_FOREACH(Scene_item* item_ptr, m_entries) { delete item_ptr; } - entries.clear(); + m_entries.clear(); } Scene_item* Scene::item(Item_id index) const { - return entries.value(index); // QList::value checks bounds + return m_entries.value(index); // QList::value checks bounds } -size_t +int Scene::numberOfEntries() const { - return entries.size(); + return m_entries.size(); } // Duplicate a scene item. @@ -85,17 +145,17 @@ Scene::numberOfEntries() const Scene::Item_id Scene::duplicate(Item_id index) { - if(index < 0 || index >= entries.size()) + if(index < 0 || index >= m_entries.size()) return -1; - const Scene_item* item = entries[index]; + const Scene_item* item = m_entries[index]; Scene_item* new_item = item->clone(); if(new_item) { new_item->setName(tr("%1 (copy)").arg(item->name())); new_item->setColor(item->color()); new_item->setVisible(item->visible()); addItem(new_item); - return entries.size() - 1; + return m_entries.size() - 1; } else return -1; @@ -125,12 +185,12 @@ void Scene::draw_aux(bool with_names) { // Flat/Gouraud OpenGL drawing - for(int index = 0; index < entries.size(); ++index) + for(int index = 0; index < m_entries.size(); ++index) { if(with_names) { ::glPushName(index); } - Scene_item& item = *entries[index]; + Scene_item& item = *m_entries[index]; if(item.visible()) { if(item.renderingMode() == Flat || item.renderingMode() == FlatPlusEdges || item.renderingMode() == Gouraud) @@ -157,12 +217,12 @@ Scene::draw_aux(bool with_names) } // Wireframe OpenGL drawing - for(int index = 0; index < entries.size(); ++index) + for(int index = 0; index < m_entries.size(); ++index) { if(with_names) { ::glPushName(index); } - Scene_item& item = *entries[index]; + Scene_item& item = *m_entries[index]; if(item.visible()) { if(item.renderingMode() == FlatPlusEdges || item.renderingMode() == Wireframe) @@ -185,12 +245,12 @@ Scene::draw_aux(bool with_names) } // Points OpenGL drawing - for(int index = 0; index < entries.size(); ++index) + for(int index = 0; index < m_entries.size(); ++index) { if(with_names) { ::glPushName(index); } - Scene_item& item = *entries[index]; + Scene_item& item = *m_entries[index]; if(item.visible()) { if(item.renderingMode() == Points) @@ -222,7 +282,7 @@ Scene::rowCount(const QModelIndex & parent) const if (parent.isValid()) return 0; else - return entries.size(); + return m_entries.size(); } int @@ -240,33 +300,33 @@ Scene::data(const QModelIndex &index, int role) const if (!index.isValid()) return QVariant(); - if(index.row() < 0 || index.row() >= entries.size()) + if(index.row() < 0 || index.row() >= m_entries.size()) return QVariant(); if(role == ::Qt::ToolTipRole) { - return entries[index.row()]->toolTip(); + return m_entries[index.row()]->toolTip(); } switch(index.column()) { case ColorColumn: if(role == ::Qt::DisplayRole || role == ::Qt::EditRole) - return entries.value(index.row())->color(); + return m_entries.value(index.row())->color(); else if(role == ::Qt::DecorationRole) - return entries.value(index.row())->color(); + return m_entries.value(index.row())->color(); break; case NameColumn: if(role == ::Qt::DisplayRole || role == ::Qt::EditRole) - return entries.value(index.row())->name(); + return m_entries.value(index.row())->name(); if(role == ::Qt::FontRole) - return entries.value(index.row())->font(); + return m_entries.value(index.row())->font(); break; case RenderingModeColumn: if(role == ::Qt::DisplayRole) { - return entries.value(index.row())->renderingModeName(); + return m_entries.value(index.row())->renderingModeName(); } else if(role == ::Qt::EditRole) { - return static_cast(entries.value(index.row())->renderingMode()); + return static_cast(m_entries.value(index.row())->renderingMode()); } else if(role == ::Qt::TextAlignmentRole) { return ::Qt::AlignCenter; @@ -285,7 +345,7 @@ Scene::data(const QModelIndex &index, int role) const break; case VisibleColumn: if(role == ::Qt::DisplayRole || role == ::Qt::EditRole) - return entries.value(index.row())->visible(); + return m_entries.value(index.row())->visible(); break; default: return QVariant(); @@ -350,10 +410,10 @@ Scene::setData(const QModelIndex &index, if( role != ::Qt::EditRole || !index.isValid() ) return false; - if(index.row() < 0 || index.row() >= entries.size()) + if(index.row() < 0 || index.row() >= m_entries.size()) return false; - Scene_item* item = entries[index.row()]; + Scene_item* item = m_entries[index.row()]; if(!item) return false; switch(index.column()) { @@ -397,6 +457,10 @@ Scene::Item_id Scene::mainSelectionIndex() const { return selected_item; } +QList Scene::selectionIndices() const { + return selected_items_list; +} + int Scene::selectionAindex() const { return item_A; } @@ -411,12 +475,25 @@ QItemSelection Scene::createSelection(int i) QAbstractItemModel::createIndex(i, LastColumn)); } +QItemSelection Scene::createSelectionAll() +{ + return QItemSelection(QAbstractItemModel::createIndex(0, 0), + QAbstractItemModel::createIndex(m_entries.size() - 1 , LastColumn)); +} + +void Scene::itemChanged() +{ + Scene_item* item = qobject_cast(sender()); + if(item) + itemChanged(item); +} + void Scene::itemChanged(Item_id i) { - if(i < 0 || i >= entries.size()) + if(i < 0 || i >= m_entries.size()) return; - entries[i]->changed(); + m_entries[i]->changed(); emit dataChanged(QAbstractItemModel::createIndex(i, 0), QAbstractItemModel::createIndex(i, LastColumn)); } @@ -425,7 +502,7 @@ void Scene::itemChanged(Scene_item* item) { item->changed(); emit dataChanged(QAbstractItemModel::createIndex(0, 0), - QAbstractItemModel::createIndex(entries.size() - 1, LastColumn)); + QAbstractItemModel::createIndex(m_entries.size() - 1, LastColumn)); } bool SceneDelegate::editorEvent(QEvent *event, QAbstractItemModel *model, @@ -451,13 +528,16 @@ bool SceneDelegate::editorEvent(QEvent *event, QAbstractItemModel *model, break; case Scene::ColorColumn: if (event->type() == QEvent::MouseButtonPress) { - QColor color = - QColorDialog::getColor(model->data(index).value(), - 0/*, - tr("Select color"), - QColorDialog::ShowAlphaChannel*/); - if (color.isValid()) { - model->setData(index, color ); + QMouseEvent *mouseEvent = static_cast(event); + if(mouseEvent->button() == ::Qt::LeftButton) { + QColor color = + QColorDialog::getColor(model->data(index).value(), + 0/*, + tr("Select color"), + QColorDialog::ShowAlphaChannel*/); + if (color.isValid()) { + model->setData(index, color ); + } } } else if(event->type() == QEvent::MouseButtonDblClick) { @@ -467,10 +547,13 @@ bool SceneDelegate::editorEvent(QEvent *event, QAbstractItemModel *model, break; case Scene::RenderingModeColumn: if (event->type() == QEvent::MouseButtonPress) { - // Switch rendering mode - /*RenderingMode*/int rendering_mode = model->data(index, ::Qt::EditRole).toInt(); - rendering_mode = (rendering_mode+1) % NumberOfRenderingMode; - model->setData(index, rendering_mode); + QMouseEvent *mouseEvent = static_cast(event); + if(mouseEvent->button() == ::Qt::LeftButton) { + // Switch rendering mode + /*RenderingMode*/int rendering_mode = model->data(index, ::Qt::EditRole).toInt(); + rendering_mode = (rendering_mode+1) % NumberOfRenderingMode; + model->setData(index, rendering_mode); + } } else if(event->type() == QEvent::MouseButtonDblClick) { return true; // block double-click @@ -538,13 +621,29 @@ void SceneDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, void Scene::setItemVisible(int index, bool b) { - if( index < 0 || index >= entries.size() ) + if( index < 0 || index >= m_entries.size() ) return; - entries[index]->setVisible(b); + m_entries[index]->setVisible(b); emit dataChanged(QAbstractItemModel::createIndex(index, VisibleColumn), QAbstractItemModel::createIndex(index, VisibleColumn)); } +void Scene::setSelectionRay(double orig_x, + double orig_y, + double orig_z, + double dir_x, + double dir_y, + double dir_z) +{ + Scene_item* item = this->item(selected_item); + if(item) item->select(orig_x, + orig_y, + orig_z, + dir_x, + dir_y, + dir_z); +} + void Scene::setItemA(int i) { item_A = i; @@ -553,7 +652,7 @@ void Scene::setItemA(int i) item_B = -1; } emit dataChanged(QAbstractItemModel::createIndex(0, ABColumn), - QAbstractItemModel::createIndex(entries.size()-1, ABColumn)); + QAbstractItemModel::createIndex(m_entries.size()-1, ABColumn)); } void Scene::setItemB(int i) @@ -565,17 +664,17 @@ void Scene::setItemB(int i) } emit updated(); emit dataChanged(QAbstractItemModel::createIndex(0, ABColumn), - QAbstractItemModel::createIndex(entries.size()-1, ABColumn)); + QAbstractItemModel::createIndex(m_entries.size()-1, ABColumn)); } Scene::Bbox Scene::bbox() const { - if(entries.empty()) + if(m_entries.empty()) return Bbox(); bool bbox_initialized = false; Bbox bbox; - Q_FOREACH(Scene_item* item, entries) + Q_FOREACH(Scene_item* item, m_entries) { if(item->isFinite() && !item->isEmpty()) { if(bbox_initialized) { @@ -589,3 +688,45 @@ Scene::Bbox Scene::bbox() const } return bbox; } + +#include "Scene_find_items.h" + +namespace scene { namespace details { + +Q_DECL_EXPORT +Scene_item* +findItem(const Scene_interface* scene_interface, + const QMetaObject& metaobj, + QString name, Scene_item_name_fn_ptr fn) { + const Scene* scene = dynamic_cast(scene_interface); + if(!scene) return 0; + Q_FOREACH(Scene_item* item, scene->entries()) { + Scene_item* ptr = qobject_cast(metaobj.cast(item)); + if(ptr && ((ptr->*fn)() == name)) return ptr; + } + return 0; +} + +Q_DECL_EXPORT +QList +findItems(const Scene_interface* scene_interface, + const QMetaObject&, + QString name, Scene_item_name_fn_ptr fn) +{ + const Scene* scene = dynamic_cast(scene_interface); + QList list; + if(!scene) return list; + + Q_FOREACH(Scene_item* item, scene->entries()) { + Scene_item* ptr = qobject_cast(item); + if(ptr && ((ptr->*fn)() == name)) { + list << ptr; + } + } + return list; +} + +} // end namespace details +} // end namespace scene + +#include "Scene.moc" diff --git a/Polyhedron/demo/Polyhedron/Scene.h b/Polyhedron/demo/Polyhedron/Scene.h index 3c08c03ccb5..a00a012eea1 100644 --- a/Polyhedron/demo/Polyhedron/Scene.h +++ b/Polyhedron/demo/Polyhedron/Scene.h @@ -1,6 +1,7 @@ #ifndef SCENE_H #define SCENE_H #include "config.h" +#include "Scene_config.h" #include "Scene_interface.h" #include "Scene_draw_interface.h" @@ -21,10 +22,11 @@ class QEvent; class QMouseEvent; -class Scene : +class SCENE_EXPORT Scene : public QAbstractListModel, public Scene_interface, public Scene_draw_interface { Q_OBJECT + Q_PROPERTY(int numberOfEntries READ numberOfEntries) friend class SceneDelegate; @@ -40,19 +42,24 @@ public: Scene(QObject* parent); ~Scene(); - Item_id addItem(Scene_item* item); + int addItem(Scene_item* item); + Scene_item* replaceItem(int index, Scene_item* item); - int erase(int); // Returns the index of the polyhedra just before the - // one that is erased, or just after. Returns -1 if - // the list is empty. + Q_INVOKABLE int erase(int); + int erase(QList); + // Returns the index of the polyhedra just before the + // one that is erased, or just after. Returns -1 if + // the list is empty. // Duplicate a scene item. Return the ID of the new item (-1 on error). - Item_id duplicate(Item_id index); + int duplicate(int index); // Accessors (getters) - size_t numberOfEntries() const; - Scene_item* item(Item_id) const ; - Item_id mainSelectionIndex() const; + int numberOfEntries() const; + const QList& entries() const { return m_entries; } + Q_INVOKABLE Scene_item* item(int) const ; + int mainSelectionIndex() const; + QList selectionIndices() const; int selectionAindex() const; int selectionBindex() const; @@ -83,38 +90,51 @@ public: // auxiliary public function for QMainWindow QItemSelection createSelection(int i); + QItemSelection createSelectionAll(); public slots: // Notify the scene that an item was modified - void itemChanged(Item_id i); + void itemChanged(); // slots called by items themself + void itemChanged(int i); void itemChanged(Scene_item*); - void setSelectedItem(Item_id i ) + void setSelectedItem(int i ) { selected_item = i; }; + void setSelectedItemsList(QList l ) + { + selected_items_list = l; + }; + // Accessors (setters) void setItemVisible(int, bool b); void setItemA(int i); void setItemB(int i); signals: + void newItem(int); void updated_bbox(); void updated(); void itemAboutToBeDestroyed(Scene_item*); + void selectionRay(double, double, double, double, double, double); + +private slots: + void setSelectionRay(double, double, double, double, double, double); private: void draw_aux(bool with_names); typedef QList Entries; - Entries entries; + Entries m_entries; int selected_item; + QList selected_items_list; int item_A; int item_B; }; // end class Scene -class SceneDelegate : public QItemDelegate +class SCENE_EXPORT SceneDelegate : public QItemDelegate { public: SceneDelegate(QObject * parent = 0) diff --git a/Polyhedron/demo/Polyhedron/Scene_config.h b/Polyhedron/demo/Polyhedron/Scene_config.h new file mode 100644 index 00000000000..6c532250add --- /dev/null +++ b/Polyhedron/demo/Polyhedron/Scene_config.h @@ -0,0 +1,16 @@ +#ifndef SCENE_CONFIG_H +#define SCENE_CONFIG_H + +#include + +#ifdef demo_framework_EXPORTS +# define scene_EXPORTS +#endif + +#ifdef scene_EXPORTS +# define SCENE_EXPORT Q_DECL_EXPORT +#else +# define SCENE_EXPORT Q_DECL_IMPORT +#endif + +#endif // SCENE_CONFIG_H diff --git a/Polyhedron/demo/Polyhedron/Scene_edit_polyhedron_item.cpp b/Polyhedron/demo/Polyhedron/Scene_edit_polyhedron_item.cpp new file mode 100644 index 00000000000..4fb6ec0deb5 --- /dev/null +++ b/Polyhedron/demo/Polyhedron/Scene_edit_polyhedron_item.cpp @@ -0,0 +1,239 @@ +#include "Scene_edit_polyhedron_item.h" +#include "Kernel_type.h" +#include "Polyhedron_type.h" + +#include + +#include +#include + +#include +#include +#include +#include + +#include + +typedef Polyhedron::Vertex_handle Vertex_handle; +typedef std::set Selected_vertices; +typedef Selected_vertices::iterator Selected_vertices_it; + +struct Scene_edit_polyhedron_item_priv { + Scene_polyhedron_item* poly_item; + int zone_size; + qglviewer::ManipulatedFrame* frame; + Selected_vertices selected_vertices; + Vertex_handle selected_vertex; + Kernel::Point_3 orig_pos; +}; // end struct Scene_edit_polyhedron_item_priv + +Scene_edit_polyhedron_item::Scene_edit_polyhedron_item(Scene_polyhedron_item* poly_item) + : d(new Scene_edit_polyhedron_item_priv) +{ + d->poly_item = poly_item; + d->zone_size = 0; + d->frame = new ManipulatedFrame(); + d->frame->setProperty("item", QVariant::fromValue(this)); + if(!connect(poly_item, SIGNAL(selected_vertex(void*)), + this, SLOT(vertex_has_been_selected(void*)))) + std::cerr << __FILE__ << ": connection failed!\n"; + poly_item->enable_facets_picking(true); +} + +Scene_edit_polyhedron_item::~Scene_edit_polyhedron_item() +{ + delete d->frame; + delete d; +} + +Scene_edit_polyhedron_item* +Scene_edit_polyhedron_item::clone() const { + return 0; +} + +QString +Scene_edit_polyhedron_item::toolTip() const +{ + if(!d->poly_item->polyhedron()) + return QString(); + + return QObject::tr("

Polyhedron %1 (mode: %5, color: %6)

" + "

Number of vertices: %2
" + "Number of edges: %3
" + "Number of facets: %4

") + .arg(this->name()) + .arg(d->poly_item->polyhedron()->size_of_vertices()) + .arg(d->poly_item->polyhedron()->size_of_halfedges()/2) + .arg(d->poly_item->polyhedron()->size_of_facets()) + .arg(this->renderingModeName()) + .arg(this->color().name()); +} + +#include "opengl_tools.h" + +void Scene_edit_polyhedron_item::draw() const { + d->poly_item->direct_draw(); + if(!d->selected_vertices.empty()) { + CGAL::GL::Point_size point_size; point_size.set_point_size(5); + CGAL::GL::Color color; color.set_rgb_color(0, 0, 0); + ::glBegin(GL_POINTS); + for(Selected_vertices_it + it = d->selected_vertices.begin(), + end = d->selected_vertices.end(); + it != end; ++it) + { + const Kernel::Point_3& p = (*it)->point(); + ::glVertex3d(p.x(), p.y(), p.z()); + } + ::glEnd(); + } +} + +Polyhedron* +Scene_edit_polyhedron_item::polyhedron() { return d->poly_item->polyhedron(); } +const Polyhedron* +Scene_edit_polyhedron_item::polyhedron() const { return d->poly_item->polyhedron(); } + +bool +Scene_edit_polyhedron_item::isEmpty() const { + return d->poly_item->isEmpty(); +} + +Scene_edit_polyhedron_item::Bbox +Scene_edit_polyhedron_item::bbox() const { + return d->poly_item->bbox(); +} + + +void +Scene_edit_polyhedron_item:: +changed() +{ + d->poly_item->changed(); + Scene_item::changed(); + d->orig_pos = current_position(); +} + +void +Scene_edit_polyhedron_item::select(double orig_x, + double orig_y, + double orig_z, + double dir_x, + double dir_y, + double dir_z) +{ + Scene_item::select(orig_x, + orig_y, + orig_z, + dir_x, + dir_y, + dir_z); + d->poly_item->select(orig_x, + orig_y, + orig_z, + dir_x, + dir_y, + dir_z); +} + +Scene_polyhedron_item* Scene_edit_polyhedron_item::to_polyhedron_item() const { + return d->poly_item; +} + +void +Scene_edit_polyhedron_item::setZoneSize(int i) { + if(i >= 0) { + std::cerr << "item \"" << qPrintable(name()) + << "\".setZoneSize(" << i << ")\n"; + d->zone_size = i; + } +} + +qglviewer::ManipulatedFrame* +Scene_edit_polyhedron_item::manipulatedFrame() { + return d->frame; +} + +struct Get_vertex_handle : public CGAL::Modifier_base +{ + Polyhedron::Vertex* vertex_ptr; + Vertex_handle vh; + void operator()(Polyhedron::HDS& hds) { + vh = hds.vertex_handle(vertex_ptr); + } +}; + +void Scene_edit_polyhedron_item::vertex_has_been_selected(void* void_ptr) { + Polyhedron* poly = d->poly_item->polyhedron(); + + // Need a modifier to get access to the HDS, to get the vertex handle + // from the vertex pointer. + + Get_vertex_handle get_vertex_handle; + get_vertex_handle.vertex_ptr = static_cast(void_ptr); + + poly->delegate(get_vertex_handle); + Vertex_handle vh = get_vertex_handle.vh; + + std::cerr << "Selected vertex: " << void_ptr << " = " << vh->point() + << std::endl; + d->selected_vertices.clear(); + + d->selected_vertices.insert(vh); + + std::cerr << "d->zone_size = " << d->zone_size << std::endl; + // Naive way to compute the k-neighborhood of vh, with k==d->zone_size. + for(int i = 0; i < d->zone_size; ++i) { + std::set selected_vertices; + for(Selected_vertices_it + it = d->selected_vertices.begin(), + end = d->selected_vertices.end(); + it != end; ++it) { + selected_vertices.insert(*it); + } + BOOST_FOREACH(Vertex_handle v, selected_vertices) { + Polyhedron::Halfedge_around_vertex_circulator + he_it = v->vertex_begin(), he_it_end(he_it); + if(he_it != 0) { + do { + const Vertex_handle other_v = he_it->opposite()->vertex(); + if( d->selected_vertices.find(other_v) == d->selected_vertices.end() ) + { + d->selected_vertices.insert(other_v); + } + } while(++he_it != he_it_end); + } + } + } + const Kernel::Point_3& p = vh->point(); + d->orig_pos = p; + d->frame->setPosition(qglviewer::Vec(p.x(), p.y(), p.z())); + connect(d->frame, SIGNAL(modified()), + this, SIGNAL(modified())); + emit begin_edit(); +} + +Vertex_handle +Scene_edit_polyhedron_item::selected_vertex() const { + return d->selected_vertex; +} + +QList +Scene_edit_polyhedron_item::selected_vertices() const { + QList result; + BOOST_FOREACH(Vertex_handle vh, d->selected_vertices) { + result << vh; + } + return result; +} + +Kernel::Point_3 Scene_edit_polyhedron_item::current_position() const { + const qglviewer::Vec vec = d->frame->position(); + return Kernel::Point_3(vec.x, vec.y, vec.z); +} + +Kernel::Point_3 Scene_edit_polyhedron_item::original_position() const { + return d->orig_pos; +} + +#include "Scene_edit_polyhedron_item.moc" diff --git a/Polyhedron/demo/Polyhedron/Scene_edit_polyhedron_item.h b/Polyhedron/demo/Polyhedron/Scene_edit_polyhedron_item.h new file mode 100644 index 00000000000..a7d342493db --- /dev/null +++ b/Polyhedron/demo/Polyhedron/Scene_edit_polyhedron_item.h @@ -0,0 +1,89 @@ +#ifndef SCENE_EDIT_POLYHEDRON_ITEM_H +#define SCENE_EDIT_POLYHEDRON_ITEM_H + +#include "Scene_edit_polyhedron_item_config.h" +#include "Scene_polyhedron_item.h" +#include "Polyhedron_type.h" +#include + +#include + +#include +#include + +class QMenu; +struct Scene_edit_polyhedron_item_priv; + +// This class represents a polyhedron in the OpenGL scene +class SCENE_EDIT_POLYHEDRON_ITEM_EXPORT Scene_edit_polyhedron_item + : public Scene_item { + Q_OBJECT +public: + /// Create an Scene_edit_polyhedron_item from a Scene_polyhedron_item. + /// The ownership of the polyhedron is moved to the new edit_polyhedron + /// item. + Scene_edit_polyhedron_item(Scene_polyhedron_item* poly_item); + ~Scene_edit_polyhedron_item(); + + /// Returns 0, so that one cannot clone an "edit polyhedron" item. + Scene_edit_polyhedron_item* clone() const; + + // // IO + // bool load(std::istream& in); + // bool save(std::ostream& out) const; + + // Function for displaying meta-data of the item + QString toolTip() const; + + // // Function to override the context menu + // QMenu* contextMenu(); + + // Indicate if rendering mode is supported + bool supportsRenderingMode(RenderingMode) const { return true; } + // Points/Wireframe/Flat/Gouraud OpenGL drawing in a display list + void draw() const; + + bool manipulatable() const { return true; } + qglviewer::ManipulatedFrame* manipulatedFrame(); + + // Get wrapped polyhedron + Polyhedron* polyhedron(); + const Polyhedron* polyhedron() const; + + // Functions related to the edition + Kernel::Point_3 original_position() const; + Kernel::Point_3 current_position() const; + Polyhedron::Vertex_handle selected_vertex() const; + QList selected_vertices() const; + + /// Returns a Scene_polyhedron_item from the edit polyhedron item, and + /// transfer the ownership of the polyhedron to it. + /// The item 'this' must be destroy just after a call to this function. + Scene_polyhedron_item* to_polyhedron_item() const; + + // Get dimensions + bool isFinite() const { return true; } + bool isEmpty() const; + Bbox bbox() const; + +public slots: + void changed(); + void select(double orig_x, + double orig_y, + double orig_z, + double dir_x, + double dir_y, + double dir_z); + void setZoneSize(int i); + void vertex_has_been_selected(void* vertex_handle); + +signals: + void begin_edit(); + void modified(); + +protected: + Scene_edit_polyhedron_item_priv* d; + +}; // end class Scene_edit_polyhedron_item + +#endif // SCENE_EDIT_POLYHEDRON_ITEM_H diff --git a/Polyhedron/demo/Polyhedron/Scene_edit_polyhedron_item_config.h b/Polyhedron/demo/Polyhedron/Scene_edit_polyhedron_item_config.h new file mode 100644 index 00000000000..a1fde07abcf --- /dev/null +++ b/Polyhedron/demo/Polyhedron/Scene_edit_polyhedron_item_config.h @@ -0,0 +1,10 @@ +#ifndef SCENE_EDIT_POLYHEDRON_ITEM_CONFIG_H +#define SCENE_EDIT_POLYHEDRON_ITEM_CONFIG_H + +#ifdef scene_edit_polyhedron_item_EXPORTS +# define SCENE_EDIT_POLYHEDRON_ITEM_EXPORT Q_DECL_EXPORT +#else +# define SCENE_EDIT_POLYHEDRON_ITEM_EXPORT Q_DECL_IMPORT +#endif + +#endif // SCENE_EDIT_POLYHEDRON_ITEM_CONFIG_H diff --git a/Polyhedron/demo/Polyhedron/Scene_find_items.h b/Polyhedron/demo/Polyhedron/Scene_find_items.h new file mode 100644 index 00000000000..00372aca9fb --- /dev/null +++ b/Polyhedron/demo/Polyhedron/Scene_find_items.h @@ -0,0 +1,121 @@ +#ifndef SCENE_FIND_ITEMS +#define SCENE_FIND_ITEMS + +#include +#include +#include "Scene_item.h" // required, to have &Scene_item::name +#include "Scene_config.h" + +class Scene_interface; + +namespace scene { +namespace details { + +typedef QString (Scene_item ::*Scene_item_name_fn_ptr)() const; + +// Declaration only (defined in Scene.cpp) +SCENE_EXPORT +Scene_item* +findItem(const Scene_interface* scene_interface, + const QMetaObject& metaobj, + QString name, Scene_item_name_fn_ptr fn); + +// Declaration only (defined in Scene.cpp) +SCENE_EXPORT +QList +findItems(const Scene_interface* scene_interface, + const QMetaObject& metaobj, + QString name, Scene_item_name_fn_ptr fn); // fwd declaration + +template +T findItem(const Scene_interface* scene, QString name, + Scene_item_name_fn_ptr fn) +{ + return + static_cast(findItem(scene, + reinterpret_cast(0)->staticMetaObject, + name, fn)); +} + +template +QList findItems(const Scene_interface* scene, QString name, + Scene_item_name_fn_ptr fn) +{ + QList void_list = + findItems(scene, reinterpret_cast(0)->staticMetaObject, + name, fn); + QList list; + Q_FOREACH(Scene_item* ptr, void_list) { + list << qobject_cast(ptr); + } + return list; +} + +} // end namespace details + +// Searches + +/** Search the first item that can be cast to T (T must be a pointer + type), and called "name". If "name" is omitted, all names are + accepted. +*/ +template +T findItem(const Scene_interface* scene, + QString item_name = QString()) +{ return details::findItem(scene, item_name, &Scene_item::name); } + +/** Returns all items that can be cast to T (T must be a pointer + type), and called "name". If "name" is omitted, all names are + accepted. +*/ +template +QList findItems(const Scene_interface* scene, + QString item_name = QString()) +{ return details::findItems(scene, item_name, &Scene_item::name); } + +/** Search the first item that can be cast to T (T must be a pointer + type), and that has objectName() equal to "name". If "name" is + omitted, all names are accepted. +*/ +template +T findItemByObjectName(const Scene_interface* scene, + QString obj_name = QString()) +{ return details::findItem(scene, obj_name, &QObject::objectName); } + +/** Returns all items that can be cast to T (T must be a pointer type), + and have objectName() equal to "name". If "name" is omitted, all + names are accepted. +*/ +template +QList findItemsByObjectName(const Scene_interface* scene, + QString obj_name = QString()) +{ return details::findItems(scene, obj_name, &QObject::objectName); } + + +// template +// T scene_findItem(const Scene* scene, QString name, Scene_item_name_fn_ptr fn) { +// return +// static_cast(scene_findItem(scene, name, fn, +// reinterpret_cast(0)->staticMetaObject())); +// } + +// template +// QList +// scene_findItems(const Scene* scene, QString name, Scene_item_name_fn_ptr fn) { +// QList void_list = +// scene_findItems(scene, name, fn, +// reinterpret_cast(0)->staticMetaObject()); +// QList list; +// Q_FOREACH(void* ptr, void_list) { +// list << static_cast(ptr); +// } +// return list; +// } + +// } // end scene namespace + +} // end namespace scene + + + +#endif diff --git a/Polyhedron/demo/Polyhedron/Scene_interface.h b/Polyhedron/demo/Polyhedron/Scene_interface.h index 6c3b85c26d2..52e8be1bb50 100644 --- a/Polyhedron/demo/Polyhedron/Scene_interface.h +++ b/Polyhedron/demo/Polyhedron/Scene_interface.h @@ -3,6 +3,7 @@ #include #include +#include #include class Scene_item; @@ -50,6 +51,7 @@ public: virtual ~Scene_interface() {}; virtual Item_id addItem(Scene_item* item) = 0; + virtual Scene_item* replaceItem(Item_id, Scene_item*) = 0; virtual Item_id erase(Item_id) = 0; // Returns the index of the item just before the one that is erased, @@ -61,9 +63,10 @@ public: // clonable), returns -1. // Accessors (getters) - virtual size_t numberOfEntries() const = 0; + virtual int numberOfEntries() const = 0; virtual Scene_item* item(Item_id) const = 0; virtual Item_id mainSelectionIndex() const = 0; + virtual QList selectionIndices() const = 0; virtual Item_id selectionAindex() const = 0; virtual Item_id selectionBindex() const = 0; @@ -75,6 +78,9 @@ public: // Notify the scene that an item was modified virtual void itemChanged(Item_id i) = 0; virtual void itemChanged(Scene_item*) = 0; + + // Select an item + virtual void setSelectedItem(Item_id) = 0; }; // end interface Scene_interface diff --git a/Polyhedron/demo/Polyhedron/Scene_item.cpp b/Polyhedron/demo/Polyhedron/Scene_item.cpp index 8e8e7b2a9ad..7a4aedde781 100644 --- a/Polyhedron/demo/Polyhedron/Scene_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_item.cpp @@ -1,34 +1,104 @@ #include "Scene_item.h" +#include "Scene_interface.h" +#include const QColor Scene_item::defaultColor = QColor(100, 100, 255); -Scene_item::~Scene_item() {} +Scene_item::~Scene_item() { + delete defaultContextMenu; +} void Scene_item::itemAboutToBeDestroyed(Scene_item* item) { if(this == item) emit aboutToBeDestroyed(); } + +QString modeName(RenderingMode mode) { + switch(mode) + { + case Points: + return QObject::tr("points"); + case Wireframe: + return QObject::tr("wire"); + case Flat: + return QObject::tr("flat"); + case FlatPlusEdges: + return QObject::tr("flat+edges"); + case Gouraud: + return QObject::tr("Gouraud"); + default: + Q_ASSERT(false); + return QObject::tr("unknown"); + } +} + +const char* slotName(RenderingMode mode) { + switch(mode) + { + case Points: + return SLOT(setPointsMode()); + case Wireframe: + return SLOT(setWireframeMode()); + case Flat: + return SLOT(setFlatMode()); + case FlatPlusEdges: + return SLOT(setFlatPlusEdgesMode()); + case Gouraud: + return SLOT(setGouraudMode()); + default: + Q_ASSERT(false); + return ""; + } +} + // Rendering mode as a human readable string QString Scene_item::renderingModeName() const { - switch(renderingMode()) - { - case Points: - return tr("points"); - case Wireframe: - return tr("wire"); - case Flat: - return tr("flat"); - case FlatPlusEdges: - return tr("flat+edges"); - case Gouraud: - return tr("Gouraud"); - default: - Q_ASSERT(false); - return tr("unknown"); - } + return modeName(renderingMode()); } +QMenu* Scene_item::contextMenu() +{ + if(defaultContextMenu) { + defaultContextMenu->setTitle(name()); + return defaultContextMenu; + } + + defaultContextMenu = new QMenu(name()); + // defaultContextMenu->addAction(name()); + // defaultContextMenu->addSeparator(); + // QMenu* modeMenu = new QMenu(QObject::tr("Rendering mode"), + // defaultContextMenu); + for(unsigned int mode = 0; mode < NumberOfRenderingMode; + ++mode) + { + if(!supportsRenderingMode(RenderingMode(mode))) continue; + QString mName = modeName(RenderingMode(mode)); + QAction* action = + defaultContextMenu->addAction(tr("Set %1 mode") + .arg(mName), + this, + slotName(RenderingMode(mode))); + QObject::connect(action, SIGNAL(triggered()), + this, SIGNAL(itemChanged())); + } + // defaultContextMenu->addAction(modeMenu->menuAction()); + return defaultContextMenu; +} + +void Scene_item::changed() { + // emit itemChanged(); +} + +void Scene_item::select(double /*orig_x*/, + double /*orig_y*/, + double /*orig_z*/, + double /*dir_x*/, + double /*dir_y*/, + double /*dir_z*/) +{ +} + #include "Scene_item.moc" diff --git a/Polyhedron/demo/Polyhedron/Scene_item.h b/Polyhedron/demo/Polyhedron/Scene_item.h index 63c9ded36d9..0463b4e3978 100644 --- a/Polyhedron/demo/Polyhedron/Scene_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_item.h @@ -4,12 +4,15 @@ #include "Scene_item_config.h" #include "Scene_interface.h" #include +#include #include namespace qglviewer { class ManipulatedFrame; } +class QMenu; + // This class represents an object in the OpenGL scene class SCENE_ITEM_EXPORT Scene_item : public QObject { Q_OBJECT @@ -28,7 +31,8 @@ public: : name_("unamed"), color_(defaultColor), visible_(true), - rendering_mode(FlatPlusEdges) + rendering_mode(FlatPlusEdges), + defaultContextMenu(0) {}; virtual ~Scene_item(); virtual Scene_item* clone() const = 0; @@ -44,6 +48,7 @@ public: // Functions for displaying meta-data of the item virtual QString toolTip() const = 0; + virtual QPixmap graphicalToolTip() const { return QPixmap(); } virtual QFont font() const { return QFont(); } // Functions that help the Scene to compute its bbox @@ -60,25 +65,63 @@ public: virtual QString name() const { return name_; } virtual bool visible() const { return visible_; } virtual RenderingMode renderingMode() const { return rendering_mode; } - virtual QString renderingModeName() const; // Rendering mode as a human readable string + virtual QString renderingModeName() const; // Rendering mode as a human + // readable string + + // Context menu + virtual QMenu* contextMenu(); public slots: // Call that once you have finished changing something in the item // (either the properties or internal data) - virtual void changed() {} + virtual void changed(); // Setters for the four basic properties virtual void setColor(QColor c) { color_ = c; } + void setRbgColor(int r, int g, int b) { setColor(QColor(r, g, b)); } virtual void setName(QString n) { name_ = n; } virtual void setVisible(bool b) { visible_ = b; } virtual void setRenderingMode(RenderingMode m) { if (supportsRenderingMode(m)) rendering_mode = m; } + void setPointsMode() { + setRenderingMode(Points); + } + + void setWireframeMode() { + setRenderingMode(Wireframe); + } + void setWireframe() { + setRenderingMode(Wireframe); + } + + void setFlat() { + setRenderingMode(Flat); + } + void setFlatMode() { + setRenderingMode(Flat); + } + + void setFlatPlusEdgesMode() { + setRenderingMode(FlatPlusEdges); + } + + void setGouraudMode() { + setRenderingMode(Gouraud); + } virtual void itemAboutToBeDestroyed(Scene_item*); + virtual void select(double orig_x, + double orig_y, + double orig_z, + double dir_x, + double dir_y, + double dir_z); + signals: + void itemChanged(); void aboutToBeDestroyed(); protected: @@ -87,7 +130,12 @@ protected: QColor color_; bool visible_; RenderingMode rendering_mode; + QMenu* defaultContextMenu; }; // end class Scene_item + +#include +Q_DECLARE_METATYPE(Scene_item*) + #endif // SCENE_ITEM_H diff --git a/Polyhedron/demo/Polyhedron/Scene_item_config.h b/Polyhedron/demo/Polyhedron/Scene_item_config.h index ac71781315e..08c864bdce5 100644 --- a/Polyhedron/demo/Polyhedron/Scene_item_config.h +++ b/Polyhedron/demo/Polyhedron/Scene_item_config.h @@ -3,6 +3,10 @@ #include +#ifdef demo_framework_EXPORTS +# define scene_item_EXPORTS +#endif + #ifdef scene_item_EXPORTS # define SCENE_ITEM_EXPORT Q_DECL_EXPORT #else diff --git a/Polyhedron/demo/Polyhedron/Scene_item_with_display_list.cpp b/Polyhedron/demo/Polyhedron/Scene_item_with_display_list.cpp index 07be9511902..f77c1574962 100644 --- a/Polyhedron/demo/Polyhedron/Scene_item_with_display_list.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_item_with_display_list.cpp @@ -69,4 +69,5 @@ void Scene_item_with_display_list::changed() for(int i = 0; i < NB_OF_DISPLAY_LISTS; ++i) { display_list_built[i] = false; } + Scene_item::changed(); } diff --git a/Polyhedron/demo/Polyhedron/Scene_nef_polyhedron_item.cpp b/Polyhedron/demo/Polyhedron/Scene_nef_polyhedron_item.cpp index 83fc94f3d77..16473326d78 100644 --- a/Polyhedron/demo/Polyhedron/Scene_nef_polyhedron_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_nef_polyhedron_item.cpp @@ -5,6 +5,7 @@ #include // #include #include +#include #include #include @@ -49,7 +50,7 @@ Scene_nef_polyhedron_item::clone() const { } bool -Scene_nef_polyhedron_item::load(std::istream& in) +Scene_nef_polyhedron_item::load_from_off(std::istream& in) { // const std::size_t discarded = CGAL::OFF_to_nef_3(in, *nef_poly); // return discarded != 0; @@ -71,6 +72,20 @@ Scene_nef_polyhedron_item::font() const { return font; } +bool +Scene_nef_polyhedron_item::load(std::istream& in) +{ + in >> *nef_poly; + return in; +} + +bool +Scene_nef_polyhedron_item::save(std::ostream& in) const +{ + in << *nef_poly; + return in; +} + QString Scene_nef_polyhedron_item::toolTip() const { diff --git a/Polyhedron/demo/Polyhedron/Scene_nef_polyhedron_item.h b/Polyhedron/demo/Polyhedron/Scene_nef_polyhedron_item.h index 974edfcf202..4e837aa9f8b 100644 --- a/Polyhedron/demo/Polyhedron/Scene_nef_polyhedron_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_nef_polyhedron_item.h @@ -20,7 +20,9 @@ public: ~Scene_nef_polyhedron_item(); Scene_nef_polyhedron_item* clone() const; + bool load_from_off(std::istream& in); bool load(std::istream& in); + bool save(std::ostream& in) const; QFont font() const; QString toolTip() const; diff --git a/Polyhedron/demo/Polyhedron/Scene_plane_item.h b/Polyhedron/demo/Polyhedron/Scene_plane_item.h index 3f94f9db5ac..7d80c1c7ad3 100644 --- a/Polyhedron/demo/Polyhedron/Scene_plane_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_plane_item.h @@ -12,8 +12,8 @@ #include #include -typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; -typedef Kernel::Plane_3 Plane_3; +typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel_epic; +typedef Kernel_epic::Plane_3 Plane_3; class SCENE_BASIC_OBJECTS_EXPORT Scene_plane_item : public Scene_item diff --git a/Polyhedron/demo/Polyhedron/Scene_polygon_soup.cpp b/Polyhedron/demo/Polyhedron/Scene_polygon_soup.cpp index 6f18f295557..f33e6dece1e 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polygon_soup.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_polygon_soup.cpp @@ -1,5 +1,8 @@ #include "Scene_polygon_soup.h" +#include "Scene_polyhedron_item.h" #include +#include "Polyhedron_type.h" +#include #include #include @@ -12,11 +15,13 @@ #include #include +#include -typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef Kernel::Point_3 Point_3; -struct Polygon_soup { +struct Polygon_soup : + public CGAL::Modifier_base +{ typedef std::vector Points; typedef std::vector Polygon_3; typedef std::map, std::set > Edges_map; @@ -86,8 +91,51 @@ struct Polygon_soup { void inverse_orientation(const std::size_t index) { std::reverse(polygons[index].begin(), polygons[index].end()); } + + void operator()(Polyhedron::HalfedgeDS& out_hds); }; +struct Polyhedron_to_polygon_soup_writer { + Polygon_soup* soup; + Polygon_soup::Polygon_3 polygon; + + Polyhedron_to_polygon_soup_writer(Polygon_soup* soup) : soup(soup), polygon() { + } + + void write_header( std::ostream&, + std::size_t vertices, + std::size_t halfedges, + std::size_t facets, + bool normals = false ) { + soup->clear(); + } + + void write_footer() { + } + + void write_vertex( const double& x, const double& y, const double& z) { + soup->points.push_back(Point_3(x, y, z)); + } + + void write_normal( const double& x, const double& y, const double& z) { + } + + void write_facet_header() { + } + + void write_facet_begin( std::size_t no) { + polygon.clear(); + polygon.reserve(no); + } + void write_facet_vertex_index( std::size_t index) { + polygon.push_back(index); + } + void write_facet_end() { + soup->polygons.push_back(polygon); + polygon.clear(); + } +}; // end struct Polyhedron_to_soup_writer + Scene_polygon_soup::Scene_polygon_soup() : Scene_item_with_display_list(), soup(0), @@ -111,13 +159,18 @@ Scene_polygon_soup::clone() const { bool Scene_polygon_soup::load(std::istream& in) { +#if CGAL_VERSION_NR >= 1030700091 + typedef std::size_t indices_t; +#else + typedef CGAL::Integer32 indices_t; +#endif if(!soup) soup = new Polygon_soup; CGAL::File_scanner_OFF scanner(in); soup->clear(); soup->points.resize(scanner.size_of_vertices()); soup->polygons.resize(scanner.size_of_facets()); - for (std::size_t i = 0; i < scanner.size_of_vertices(); ++i) { + for (indices_t i = 0; i < scanner.size_of_vertices(); ++i) { double x, y, z, w; scanner.scan_vertex( x, y, z, w); soup->points[i] = Point_3(x, y, z, w); @@ -126,12 +179,13 @@ Scene_polygon_soup::load(std::istream& in) if(!in) return false; - for (std::size_t i = 0; i < scanner.size_of_facets(); ++i) { - std::size_t no; + for (indices_t i = 0; i < scanner.size_of_facets(); ++i) { + indices_t no; + scanner.scan_facet( no, i); soup->polygons[i].resize(no); - for(std::size_t j = 0; j < no; ++j) { - std::size_t id; + for(indices_t j = 0; j < no; ++j) { + indices_t id; scanner.scan_facet_vertex_index(id, i); if(id < scanner.size_of_vertices()) { @@ -146,6 +200,24 @@ Scene_polygon_soup::load(std::istream& in) return in; } + +#include +#include + +void Scene_polygon_soup::load(Scene_polyhedron_item* poly_item) { + if(!poly_item) return; + if(!poly_item->polyhedron()) return; + + if(!soup) + soup = new Polygon_soup; + + Polyhedron_to_polygon_soup_writer writer(soup); + CGAL::generic_print_polyhedron(std::cerr, + *poly_item->polyhedron(), + writer); + emit changed(); +} + void Scene_polygon_soup::setDisplayNonManifoldEdges(const bool b) { @@ -321,6 +393,44 @@ Scene_polygon_soup::save(std::ostream& out) const return out; } +void +Polygon_soup::operator()(Polyhedron::HalfedgeDS& out_hds) +{ + typedef Polyhedron::HalfedgeDS Output_HDS; + + CGAL::Polyhedron_incremental_builder_3 builder(out_hds); + + typedef Polygon_soup::size_type size_type; + builder.begin_surface(points.size(), + polygons.size(), + edges.size() * 2); + for(size_type i = 0, end = points.size(); + i < end; ++i) + { + builder.add_vertex(points[i]); + } + for(size_type i = 0, end = polygons.size(); + i < end; ++i) + { + const Polygon_soup::Polygon_3& polygon = polygons[i]; + const size_type size = polygon.size(); + builder.begin_facet(); + for(size_type j = 0; j < size; ++j) { + builder.add_vertex_to_facet(polygon[j]); + } + builder.end_facet(); + } + builder.end_surface(); +} + +bool +Scene_polygon_soup::exportAsPolyhedron(Polyhedron* out_polyhedron) +{ + orient(); + out_polyhedron->delegate(*soup); + return out_polyhedron->size_of_vertices() > 0; +} + QString Scene_polygon_soup::toolTip() const { @@ -363,8 +473,11 @@ Scene_polygon_soup::direct_draw() const { } if(soup->display_non_manifold_edges) { double current_color[4]; + GLboolean lightning; ::glGetDoublev(GL_CURRENT_COLOR, current_color); ::glColor3d(1., 0., 0.); // red + ::glGetBooleanv(GL_LIGHTING, &lightning); + ::glDisable(GL_LIGHTING); for(Polygon_soup::size_type i = 0, @@ -379,10 +492,24 @@ Scene_polygon_soup::direct_draw() const { ::glVertex3d(b.x(), b.y(), b.z()); ::glEnd(); } + if(lightning) glEnable(GL_LIGHTING); ::glColor4dv(current_color); } } +void +Scene_polygon_soup::draw_points() const { + if(soup == 0) return; + ::glBegin(GL_POINTS); + for(Polygon_soup::Points::const_iterator pit = soup->points.begin(), + end = soup->points.end(); + pit != end; ++pit) + { + ::glVertex3d(pit->x(), pit->y(), pit->z()); + } + ::glEnd(); +} + bool Scene_polygon_soup::isEmpty() const { return (soup == 0 || soup->points.empty()); @@ -401,4 +528,24 @@ Scene_polygon_soup::bbox() const { bbox.xmax(),bbox.ymax(),bbox.zmax()); } +void +Scene_polygon_soup::new_vertex(const double& x, + const double& y, + const double& z) +{ + soup->points.push_back(Point_3(x, y, z)); +} + +void +Scene_polygon_soup::new_triangle(const std::size_t i, + const std::size_t j, + const std::size_t k) +{ + Polygon_soup::Polygon_3 new_polygon(3); + new_polygon[0] = i; + new_polygon[1] = j; + new_polygon[2] = k; + soup->polygons.push_back(new_polygon); +} + #include "Scene_polygon_soup.moc" diff --git a/Polyhedron/demo/Polyhedron/Scene_polygon_soup.h b/Polyhedron/demo/Polyhedron/Scene_polygon_soup.h index 154b09bc71f..016b327cfc5 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polygon_soup.h +++ b/Polyhedron/demo/Polyhedron/Scene_polygon_soup.h @@ -5,7 +5,10 @@ #include "Scene_item_with_display_list.h" #include +#include "Polyhedron_type_fwd.h" + struct Polygon_soup; +class Scene_polyhedron_item; class SCENE_POLYGON_SOUP_EXPORT Scene_polygon_soup : public Scene_item_with_display_list @@ -17,6 +20,7 @@ public: Scene_polygon_soup* clone() const; bool load(std::istream& in); + void load(Scene_polyhedron_item*); bool save(std::ostream& out) const; QString toolTip() const; @@ -25,17 +29,24 @@ public: virtual bool supportsRenderingMode(RenderingMode m) const { return m != Gouraud; } // CHECK THIS! // OpenGL drawing in a display list void direct_draw() const; + void draw_points() const; bool isFinite() const { return true; } bool isEmpty() const; Bbox bbox() const; + void new_vertex(const double&, const double&, const double&); + void new_triangle(const std::size_t, const std::size_t, const std::size_t); + +public slots: void shuffle_orientations(); bool orient(); + bool exportAsPolyhedron(Polyhedron*); void inside_out(); void setDisplayNonManifoldEdges(const bool); bool displayNonManifoldEdges() const; + private: Polygon_soup* soup; bool oriented; diff --git a/Polyhedron/demo/Polyhedron/Scene_polygon_soup_config.h b/Polyhedron/demo/Polyhedron/Scene_polygon_soup_config.h index 5a568ac4da0..47898403aaa 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polygon_soup_config.h +++ b/Polyhedron/demo/Polyhedron/Scene_polygon_soup_config.h @@ -1,7 +1,7 @@ #ifndef SCENE_POLYGON_SOUP_CONFIG_H #define SCENE_POLYGON_SOUP_CONFIG_H -#ifdef polygon_soup_EXPORTS +#ifdef scene_polygon_soup_item_EXPORTS # define SCENE_POLYGON_SOUP_EXPORT Q_DECL_EXPORT #else # define SCENE_POLYGON_SOUP_EXPORT Q_DECL_IMPORT diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item.cpp b/Polyhedron/demo/Polyhedron/Scene_polyhedron_item.cpp index 795e0ea5ca7..34bfb85fd94 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_polyhedron_item.cpp @@ -1,39 +1,127 @@ +#include #include "Scene_polyhedron_item.h" +#include "Kernel_type.h" #include "Polyhedron_type.h" #include +#include +#include +#include + +#include +#include + +typedef CGAL::AABB_polyhedron_triangle_primitive Primitive; +typedef CGAL::AABB_traits AABB_traits; +typedef CGAL::AABB_tree Input_facets_AABB_tree; + +const char* aabb_property_name = "Scene_polyhedron_item aabb tree"; + +Input_facets_AABB_tree* get_aabb_tree(Scene_polyhedron_item* item) +{ + QVariant aabb_tree_property = item->property(aabb_property_name); + if(aabb_tree_property.isValid()) { + void* ptr = aabb_tree_property.value(); + return static_cast(ptr); + } + else { + Polyhedron* poly = item->polyhedron(); + if(poly) { + Input_facets_AABB_tree* tree = + new Input_facets_AABB_tree(poly->facets_begin(), + poly->facets_end()); + item->setProperty(aabb_property_name, + QVariant::fromValue(tree)); + return tree; + } + else return 0; + } +} + +void delete_aabb_tree(Scene_polyhedron_item* item) +{ + QVariant aabb_tree_property = item->property(aabb_property_name); + if(aabb_tree_property.isValid()) { + void* ptr = aabb_tree_property.value(); + Input_facets_AABB_tree* tree = static_cast(ptr); + if(tree) { + delete tree; + tree = 0; + } + item->setProperty(aabb_property_name, QVariant()); + } +} + #include +#include +#include #include Scene_polyhedron_item::Scene_polyhedron_item() : Scene_item_with_display_list(), - poly(new Polyhedron) + poly(new Polyhedron), + show_only_feature_edges_m(false), + facet_picking_m(false), + erase_next_picked_facet_m(false) { + //init(); } Scene_polyhedron_item::Scene_polyhedron_item(Polyhedron* const p) : Scene_item_with_display_list(), - poly(p) + poly(p), + show_only_feature_edges_m(false), + facet_picking_m(false), + erase_next_picked_facet_m(false) { + init(); } Scene_polyhedron_item::Scene_polyhedron_item(const Polyhedron& p) : Scene_item_with_display_list(), - poly(new Polyhedron(p)) + poly(new Polyhedron(p)), + show_only_feature_edges_m(false), + facet_picking_m(false), + erase_next_picked_facet_m(false) { + init(); } // Scene_polyhedron_item::Scene_polyhedron_item(const Scene_polyhedron_item& item) // : Scene_item_with_display_list(item), -// poly(new Polyhedron(*item.poly)) +// poly(new Polyhedron(*item.poly)), +// show_only_feature_edges_m(false) // { // } Scene_polyhedron_item::~Scene_polyhedron_item() { + delete_aabb_tree(this); delete poly; } +#include "Color_map.h" + +void +Scene_polyhedron_item:: +init() +{ + typedef Polyhedron::Facet_iterator Facet_iterator; + + // Fill indices map and get max subdomain value + int max = 0; + for(Facet_iterator fit = poly->facets_begin(), end = poly->facets_end() ; + fit != end; ++fit) + { + max = (std::max)(max, fit->patch_id()); + } + + colors_.clear(); + compute_color_map(this->color(), max + 1, + std::back_inserter(colors_)); +} + + Scene_polyhedron_item* Scene_polyhedron_item::clone() const { return new Scene_polyhedron_item(*poly); @@ -44,13 +132,20 @@ bool Scene_polyhedron_item::load(std::istream& in) { in >> *poly; - return in && !isEmpty(); + + if ( in && !isEmpty() ) + { + changed(); + return true; + } + return false; } // Write polyhedron to .OFF file bool Scene_polyhedron_item::save(std::ostream& out) const { + out.precision(13); out << *poly; return out; } @@ -73,9 +168,100 @@ Scene_polyhedron_item::toolTip() const .arg(this->color().name()); } +QMenu* Scene_polyhedron_item::contextMenu() +{ + const char* prop_name = "Menu modified by Scene_polyhedron_item."; + + QMenu* menu = Scene_item::contextMenu(); + + // Use dynamic properties: + // http://doc.trolltech.com/lastest/qobject.html#property + bool menuChanged = menu->property(prop_name).toBool(); + + if(!menuChanged) { + + QAction* actionShowOnlyFeatureEdges = + menu->addAction(tr("Show only &feature edges")); + actionShowOnlyFeatureEdges->setCheckable(true); + actionShowOnlyFeatureEdges->setObjectName("actionShowOnlyFeatureEdges"); + connect(actionShowOnlyFeatureEdges, SIGNAL(toggled(bool)), + this, SLOT(show_only_feature_edges(bool))); + + QAction* actionPickFacets = + menu->addAction(tr("Facets picking")); + actionPickFacets->setCheckable(true); + actionPickFacets->setObjectName("actionPickFacets"); + connect(actionPickFacets, SIGNAL(toggled(bool)), + this, SLOT(enable_facets_picking(bool))); + + QAction* actionEraseNextFacet = + menu->addAction(tr("Erase next picked facet")); + actionEraseNextFacet->setCheckable(true); + actionEraseNextFacet->setObjectName("actionEraseNextFacet"); + connect(actionEraseNextFacet, SIGNAL(toggled(bool)), + this, SLOT(set_erase_next_picked_facet(bool))); + + menu->setProperty(prop_name, true); + } + QAction* action = menu->findChild("actionPickFacets"); + if(action) action->setChecked(facet_picking_m); + action = menu->findChild("actionEraseNextFacet"); + if(action) action->setChecked(erase_next_picked_facet_m); + return menu; +} + +void Scene_polyhedron_item::show_only_feature_edges(bool b) +{ + show_only_feature_edges_m = b; + emit itemChanged(); +} + +void Scene_polyhedron_item::enable_facets_picking(bool b) +{ + facet_picking_m = b; +} + +void Scene_polyhedron_item::set_erase_next_picked_facet(bool b) +{ + erase_next_picked_facet_m = b; +} + // Points/Wireframe/Flat/Gouraud OpenGL drawing in a display list void Scene_polyhedron_item::direct_draw() const { - gl_render_facets(*poly); + gl_render_facets(*poly,colors_); +} + +// Points/Wireframe/Flat/Gouraud OpenGL drawing in a display list +void Scene_polyhedron_item::direct_draw_edges() const { + typedef Kernel::Point_3 Point; + typedef Polyhedron::Edge_iterator Edge_iterator; + + ::glBegin(GL_LINES); + Edge_iterator he; + if(!show_only_feature_edges_m) { + for(he = poly->edges_begin(); + he != poly->edges_end(); + he++) + { + if(he->is_feature_edge()) continue; + const Point& a = he->vertex()->point(); + const Point& b = he->opposite()->vertex()->point(); + ::glVertex3d(a.x(),a.y(),a.z()); + ::glVertex3d(b.x(),b.y(),b.z()); + } + } + ::glColor3d(1.0, 0.0, 0.0); + for(he = poly->edges_begin(); + he != poly->edges_end(); + he++) + { + if(!he->is_feature_edge()) continue; + const Point& a = he->vertex()->point(); + const Point& b = he->opposite()->vertex()->point(); + ::glVertex3d(a.x(),a.y(),a.z()); + ::glVertex3d(b.x(),b.y(),b.z()); + } + ::glEnd(); } Polyhedron* @@ -90,7 +276,7 @@ Scene_polyhedron_item::isEmpty() const { Scene_polyhedron_item::Bbox Scene_polyhedron_item::bbox() const { - const Point& p = *(poly->points_begin()); + const Kernel::Point_3& p = *(poly->points_begin()); CGAL::Bbox_3 bbox(p.x(), p.y(), p.z(), p.x(), p.y(), p.z()); for(Polyhedron::Point_iterator it = poly->points_begin(); it != poly->points_end(); @@ -101,4 +287,110 @@ Scene_polyhedron_item::bbox() const { bbox.xmax(),bbox.ymax(),bbox.zmax()); } + +void +Scene_polyhedron_item:: +changed() +{ + delete_aabb_tree(this); + init(); + Base::changed(); +} + +void +Scene_polyhedron_item::select(double orig_x, + double orig_y, + double orig_z, + double dir_x, + double dir_y, + double dir_z) +{ + if(facet_picking_m) { + typedef Input_facets_AABB_tree Tree; + typedef Tree::Object_and_primitive_id Object_and_primitive_id; + typedef Tree::Primitive_id Primitive_id; + + Tree* aabb_tree = get_aabb_tree(this); + if(aabb_tree) { + const Kernel::Point_3 ray_origin(orig_x, orig_y, orig_z); + const Kernel::Vector_3 ray_dir(dir_x, dir_y, dir_z); + const Kernel::Ray_3 ray(ray_origin, ray_dir); + + typedef std::list Intersections; + Intersections intersections; + + aabb_tree->all_intersections(ray, std::back_inserter(intersections)); + + Intersections::iterator closest = intersections.begin(); + if(closest != intersections.end()) { + const Kernel::Point_3* closest_point = + CGAL::object_cast(&closest->first); + Kernel::Compare_squared_distance_3 comp_sq_dist = + Kernel().compare_squared_distance_3_object(); + + for(Intersections::iterator + it = boost::next(intersections.begin()), + end = intersections.end(); + it != end; ++it) + { + if(! closest_point) { + closest = it; + } + else { + const Kernel::Point_3* it_point = + CGAL::object_cast(&it->first); + if(it_point && + (ray_dir * (*it_point - *closest_point)) < 0) + { + closest = it; + closest_point = it_point; + } + } + } + if(closest_point) { + Polyhedron::Facet_handle selected_fh = closest->second; + + // The computation of the nearest vertex may be costly. Only + // do it if some objects are connected to the signal + // 'selected_vertex'. + if(QObject::receivers(SIGNAL(selected_vertex(void*))) > 0) + { + Polyhedron::Halfedge_around_facet_circulator + he_it = selected_fh->facet_begin(), + around_end = he_it; + + Polyhedron::Vertex_handle v = he_it->vertex(), nearest_v = v; + + Kernel::FT sq_dist = CGAL::squared_distance(*closest_point, + v->point()); + + while(++he_it != around_end) { + v = he_it->vertex(); + Kernel::FT new_sq_dist = CGAL::squared_distance(*closest_point, + v->point()); + if(new_sq_dist < sq_dist) { + sq_dist = new_sq_dist; + nearest_v = v; + } + } + emit selected_vertex((void*)(&*nearest_v)); + } + + emit selected_facet((void*)(&*selected_fh)); + if(erase_next_picked_facet_m) { + polyhedron()->erase_facet(selected_fh->halfedge()); + polyhedron()->normalize_border(); + set_erase_next_picked_facet(false); + changed(); + emit itemChanged(); + } + std::cerr << "Facet selected. patch_id=" + << selected_fh->patch_id() << std::endl; + } + } + } + } + Base::select(orig_x, orig_y, orig_z, dir_x, dir_y, dir_z); +} + #include "Scene_polyhedron_item.moc" diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item.h b/Polyhedron/demo/Polyhedron/Scene_polyhedron_item.h index 2b8981b25bd..722c38b3ca1 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_polyhedron_item.h @@ -6,6 +6,13 @@ #include "Polyhedron_type_fwd.h" #include +#include +#include + +#include + +class QMenu; + // This class represents a polyhedron in the OpenGL scene class SCENE_POLYHEDRON_ITEM_EXPORT Scene_polyhedron_item : public Scene_item_with_display_list { @@ -26,10 +33,14 @@ public: // Function for displaying meta-data of the item virtual QString toolTip() const; + // Function to override the context menu + QMenu* contextMenu(); + // Indicate if rendering mode is supported - virtual bool supportsRenderingMode(RenderingMode m) const { return true; } + virtual bool supportsRenderingMode(RenderingMode) const { return true; } // Points/Wireframe/Flat/Gouraud OpenGL drawing in a display list virtual void direct_draw() const; + virtual void direct_draw_edges() const; // Get wrapped polyhedron Polyhedron* polyhedron(); @@ -40,9 +51,39 @@ public: bool isEmpty() const; Bbox bbox() const; +public slots: + virtual void changed(); + void show_only_feature_edges(bool); + void enable_facets_picking(bool); + void set_erase_next_picked_facet(bool); + + void select(double orig_x, + double orig_y, + double orig_z, + double dir_x, + double dir_y, + double dir_z); + +signals: + void selected_vertex(void*); + void selected_facet(void*); + +private: + // Initialization + void init(); + private: Polyhedron* poly; +private: + typedef Scene_item_with_display_list Base; + typedef std::vector Color_vector; + + Color_vector colors_; + + bool show_only_feature_edges_m; + bool facet_picking_m; + bool erase_next_picked_facet_m; }; // end class Scene_polyhedron_item #endif // SCENE_POLYHEDRON_ITEM_H diff --git a/Polyhedron/demo/Polyhedron/Show_point_dialog.cpp b/Polyhedron/demo/Polyhedron/Show_point_dialog.cpp new file mode 100644 index 00000000000..c0802a85457 --- /dev/null +++ b/Polyhedron/demo/Polyhedron/Show_point_dialog.cpp @@ -0,0 +1,73 @@ +#include "Show_point_dialog.h" +#include "ui_Show_point_dialog.h" + +Show_point_dialog::Show_point_dialog(QWidget* parent) + : QDialog(parent) + , ui(new Ui::Show_point_dialog) + , m_has_correct_coordinates(false) +{ + ui->setupUi(this); + + connect(ui->lineEdit, SIGNAL(textChanged(const QString&)), + this, SLOT(interprete_string(const QString&))); +} + +Show_point_dialog::~Show_point_dialog() +{ + delete ui; +} + +void Show_point_dialog::interprete_string(const QString& string) +{ + QString double_re("([-+]?[0-9]*\\.?[0-9]+(?:[eE][-+]?[0-9]+)?)"); + QString not_double_char_re("[^0-9-+.eE]"); + QString full_re = QString("^") + + not_double_char_re + "*" + + double_re + + not_double_char_re + "+" + + double_re + + not_double_char_re + "+" + + double_re + + "(" + not_double_char_re + "*" + + "|" + not_double_char_re + "+" + double_re + + ")" + + "$"; + QRegExp re(full_re); + if(re.exactMatch(string)) { + // const double x = re.cap(1).toDouble(); + // const double y = re.cap(2).toDouble(); + // const double z = re.cap(3).toDouble(); + ui->coord_x->setText(QString(re.cap(1))); + ui->coord_y->setText(QString(re.cap(2))); + ui->coord_z->setText(QString(re.cap(3))); + m_has_correct_coordinates = true; + } + else { + ui->coord_x->setText(QString()); + ui->coord_y->setText(QString()); + ui->coord_z->setText(QString()); + m_has_correct_coordinates = false; + } +} + +double Show_point_dialog::get_x() const +{ + return ui->coord_x->text().toDouble(); +} + +double Show_point_dialog::get_y() const +{ + return ui->coord_y->text().toDouble(); +} + +double Show_point_dialog::get_z() const +{ + return ui->coord_z->text().toDouble(); +} + +bool Show_point_dialog::has_correct_coordinates() const +{ + return m_has_correct_coordinates; +} + +#include "Show_point_dialog.moc" diff --git a/Polyhedron/demo/Polyhedron/Show_point_dialog.h b/Polyhedron/demo/Polyhedron/Show_point_dialog.h new file mode 100644 index 00000000000..5a00b0485de --- /dev/null +++ b/Polyhedron/demo/Polyhedron/Show_point_dialog.h @@ -0,0 +1,35 @@ +#ifndef SHOW_POINT_DIALOG_H +#define SHOW_POINT_DIALOG_H +#include "config.h" + +#include "Point_dialog_config.h" + +#include + +namespace Ui { + class Show_point_dialog; +} + +class POINT_DIALOG_EXPORT Show_point_dialog : + public QDialog +{ + Q_OBJECT +public: + Show_point_dialog(QWidget* parent = 0); + ~Show_point_dialog(); + + bool has_correct_coordinates() const; + + double get_x() const; + double get_y() const; + double get_z() const; + +protected slots: + void interprete_string(const QString&); + +protected: + Ui::Show_point_dialog* ui; + bool m_has_correct_coordinates; +}; + +#endif diff --git a/Polyhedron/demo/Polyhedron/Show_point_dialog.ui b/Polyhedron/demo/Polyhedron/Show_point_dialog.ui new file mode 100644 index 00000000000..5543f27c91f --- /dev/null +++ b/Polyhedron/demo/Polyhedron/Show_point_dialog.ui @@ -0,0 +1,161 @@ + + + Show_point_dialog + + + + 0 + 0 + 575 + 151 + + + + Dialog + + + + + + + + QFormLayout::ExpandingFieldsGrow + + + + + Point &coordinates + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + lineEdit + + + + + + + + 1 + 0 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'DejaVu LGC Sans'; font-size:11pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Paste here the coordinates of a point. It can be for example:</p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&quot;(10., -2e-2, .4)&quot;</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">or:</p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&quot;-2 3 5&quot;</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">or even something with garbage around:</p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&quot;point (-2, 5, 0) and...&quot;</p></body></html> + + + + + + + x + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + + + + y + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + + + + z + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + + + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + lineEdit + + + + + buttonBox + accepted() + Show_point_dialog + accept() + + + 423 + 120 + + + 387 + 139 + + + + + buttonBox + rejected() + Show_point_dialog + reject() + + + 520 + 120 + + + 512 + 138 + + + + + diff --git a/Polyhedron/demo/Polyhedron/Viewer.cpp b/Polyhedron/demo/Polyhedron/Viewer.cpp index ffe0fc930ba..bd69a082f2c 100644 --- a/Polyhedron/demo/Polyhedron/Viewer.cpp +++ b/Polyhedron/demo/Polyhedron/Viewer.cpp @@ -1,46 +1,144 @@ #include "Viewer.h" #include "Scene_draw_interface.h" +#include +#include + +class Viewer_impl { +public: + Scene_draw_interface* scene; + bool antialiasing; + bool twosides; + bool macro_mode; + + void draw_aux(bool with_names); +}; Viewer::Viewer(QWidget* parent, bool antialiasing) - : QGLViewer(parent), - scene(0), - antialiasing(antialiasing), - twosides(false) + : QGLViewer(parent) { - setBackgroundColor(::Qt::white); + d = new Viewer_impl; + d->scene = 0; + d->antialiasing = antialiasing; + d->twosides = false; + d->macro_mode = false; + setShortcut(EXIT_VIEWER, 0); + setMouseBinding(Qt::SHIFT + Qt::LeftButton, SELECT); + setMouseBindingDescription(Qt::SHIFT + Qt::RightButton, + tr("Selects and display context " + "menu of the selected item")); + setKeyDescription(Qt::Key_T, + tr("Turn the camera by 180 degrees")); + setKeyDescription(Qt::Key_M, + tr("Toggle macro mode: useful to view details very near from the camera, " + "but decrease the z-buffer precision")); +} + +Viewer::~Viewer() +{ + delete d; } void Viewer::setScene(Scene_draw_interface* scene) { - this->scene = scene; + d->scene = scene; +} + +bool Viewer::antiAliasing() const +{ + return d->antialiasing; } void Viewer::setAntiAliasing(bool b) { - antialiasing = b; + d->antialiasing = b; updateGL(); } void Viewer::setTwoSides(bool b) { - twosides = b; + d->twosides = b; updateGL(); } void Viewer::draw() { - draw_aux(false); + // ::glFogf(GL_FOG_END, 2*sceneRadius()); + // ::glEnable(GL_FOG); + QGLViewer::draw(); + d->draw_aux(false); + // drawLight(GL_LIGHT0); } void Viewer::initializeGL() { QGLViewer::initializeGL(); - scene->initializeGL(); + setBackgroundColor(::Qt::white); + d->scene->initializeGL(); + + const GLfloat ambient_light[4] = { 0.6f, 0.6f, 0.6f, 1.0f }; + const GLfloat diffuse_light[4] = { 0.6f, 0.6f, 0.6f, 1.0f }; + + ::glLightfv(GL_LIGHT0, GL_AMBIENT, ambient_light); + ::glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse_light); + // ::glFogf(GL_FOG_DENSITY, 0.05f); + // ::glHint(GL_FOG_HINT, GL_NICEST); + // ::glFogi(GL_FOG_MODE, GL_LINEAR); + // static const GLfloat fogColor[] = {0.5f, 0.5f, 0.5f, 1}; + // ::glFogfv(GL_FOG_COLOR, fogColor); } -void Viewer::draw_aux(bool with_names) +#include + +void Viewer::mousePressEvent(QMouseEvent* event) +{ + if(event->button() == Qt::RightButton && + event->modifiers().testFlag(Qt::ShiftModifier)) + { + select(event->pos()); + requestContextMenu(event->globalPos()); + event->accept(); + } + else { + QGLViewer::mousePressEvent(event); + } +} + +void Viewer::keyPressEvent(QKeyEvent* e) +{ + if(!e->modifiers()) { + if(e->key() == Qt::Key_T) { + turnCameraBy180Degres(); + return; + } + else if(e->key() == Qt::Key_M) { + d->macro_mode = ! d->macro_mode; + if(d->macro_mode) { + camera()->setZNearCoefficient(0.0005f); + } else { + camera()->setZNearCoefficient(0.005f); + } + this->displayMessage(tr("Macro mode: %1"). + arg(d->macro_mode ? tr("on") : tr("off"))); + return; + } + } + QGLViewer::keyPressEvent(e); +} + +void Viewer::turnCameraBy180Degres() { + qglviewer::Camera* camera = this->camera(); + using qglviewer::ManipulatedCameraFrame; + + ManipulatedCameraFrame frame_from(*camera->frame()); + camera->setViewDirection(-camera->viewDirection()); + ManipulatedCameraFrame frame_to(*camera->frame()); + + camera->setOrientation(frame_from.orientation()); + camera->interpolateTo(frame_to, 0.5f); +} + +void Viewer_impl::draw_aux(bool with_names) { - QGLViewer::draw(); if(scene == 0) return; @@ -48,15 +146,16 @@ void Viewer::draw_aux(bool with_names) ::glPointSize(2.f); ::glEnable(GL_POLYGON_OFFSET_FILL); ::glPolygonOffset(1.0f,1.0f); - ::glClearColor(1.0f,1.0f,1.0f,0.0f); ::glPolygonMode(GL_FRONT_AND_BACK,GL_FILL); + ::glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE); + if(twosides) ::glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); else ::glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE); - if(antiAliasing()) + if(antialiasing) { ::glEnable(GL_BLEND); ::glEnable(GL_LINE_SMOOTH); @@ -79,10 +178,84 @@ void Viewer::draw_aux(bool with_names) void Viewer::drawWithNames() { - draw_aux(true); + QGLViewer::draw(); + d->draw_aux(true); } -void Viewer::postSelection(const QPoint&) +void Viewer::postSelection(const QPoint& pixel) { - emit selected(this->selectedName()); + bool found = false; + qglviewer::Vec point = camera()->pointUnderPixel(pixel, found); + if(found) { + emit selectedPoint(point.x, + point.y, + point.z); + emit selected(this->selectedName()); + const qglviewer::Vec orig = camera()->position(); + const qglviewer::Vec dir = point - orig; + emit selectionRay(orig.x, orig.y, orig.z, + dir.x, dir.y, dir.z); + } +} + +bool Viewer::readFrame(QString s, qglviewer::Frame& frame) +{ + QStringList list = s.split(" ", QString::SkipEmptyParts); + if(list.size() != 7) + return false; + float vec[3]; + for(int i = 0; i < 3; ++i) + { + bool ok; + vec[i] = list[i].toFloat(&ok); + if(!ok) return false; + } + double orient[4]; + for(int i = 0; i < 4; ++i) + { + bool ok; + orient[i] = list[i + 3].toDouble(&ok); + if(!ok) return false; + } + frame.setPosition(qglviewer::Vec(vec[0], + vec[1], + vec[2])); + frame.setOrientation(orient[0], + orient[1], + orient[2], + orient[3]); + return true; +} + +QString Viewer::dumpFrame(const qglviewer::Frame& frame) { + const qglviewer::Vec pos = frame.position(); + const qglviewer::Quaternion q = frame.orientation(); + + return QString("%1 %2 %3 %4 %5 %6 %7") + .arg(pos[0]) + .arg(pos[1]) + .arg(pos[2]) + .arg(q[0]) + .arg(q[1]) + .arg(q[2]) + .arg(q[3]); +} + +bool Viewer::moveCameraToCoordinates(QString s, float animation_duration) { + qglviewer::Frame new_frame; + if(readFrame(s, new_frame)) { + camera()->interpolateTo(new_frame, animation_duration); + return true; + } + else + return false; +} + +QString Viewer::dumpCameraCoordinates() +{ + if(camera()->frame()) { + return dumpFrame(*camera()->frame()); + } else { + return QString(); + } } diff --git a/Polyhedron/demo/Polyhedron/Viewer.h b/Polyhedron/demo/Polyhedron/Viewer.h index f2396af5ceb..c2ffa7c946e 100644 --- a/Polyhedron/demo/Polyhedron/Viewer.h +++ b/Polyhedron/demo/Polyhedron/Viewer.h @@ -1,18 +1,26 @@ #ifndef VIEWER_H #define VIEWER_H +#include "Viewer_config.h" + #include +#include // forward declarations class QWidget; class Scene_draw_interface; +class QMouseEvent; +class QKeyEvent; -class Viewer : public QGLViewer { +class Viewer_impl; + +class VIEWER_EXPORT Viewer : public QGLViewer { Q_OBJECT public: Viewer(QWidget * parent, bool antialiasing = false); + ~Viewer(); // overload several QGLViewer virtual functions void draw(); @@ -21,21 +29,33 @@ public: void postSelection(const QPoint&); void setScene(Scene_draw_interface* scene); - bool antiAliasing() const { return antialiasing; } + bool antiAliasing() const; + + static bool readFrame(QString, qglviewer::Frame&); + static QString dumpFrame(const qglviewer::Frame&); signals: void selected(int); + void requestContextMenu(QPoint global_pos); + void selectedPoint(double, double, double); + void selectionRay(double, double, double, double, double, double); public slots: void setAntiAliasing(bool b); void setTwoSides(bool b); -private: - void draw_aux(bool with_names); + void turnCameraBy180Degres(); - Scene_draw_interface* scene; - bool antialiasing; - bool twosides; + QString dumpCameraCoordinates(); + bool moveCameraToCoordinates(QString, + float animation_duration = 0.5f); + +protected: + void mousePressEvent(QMouseEvent*); + void keyPressEvent(QKeyEvent*); + +protected: + Viewer_impl* d; }; // end class Viewer #endif // VIEWER_H diff --git a/Polyhedron/demo/Polyhedron/Viewer_config.h b/Polyhedron/demo/Polyhedron/Viewer_config.h new file mode 100644 index 00000000000..2a79ddf681d --- /dev/null +++ b/Polyhedron/demo/Polyhedron/Viewer_config.h @@ -0,0 +1,16 @@ +#ifndef VIEWER_CONFIG_H +#define VIEWER_CONFIG_H + +#include + +#ifdef demo_framework_EXPORTS +# define viewer_EXPORTS +#endif + +#ifdef viewer_EXPORTS +# define VIEWER_EXPORT Q_DECL_EXPORT +#else +# define VIEWER_EXPORT Q_DECL_IMPORT +#endif + +#endif // VIEWER_CONFIG_H diff --git a/Polyhedron/demo/Polyhedron/cgal_test_with_cmake b/Polyhedron/demo/Polyhedron/cgal_test_with_cmake index bd8bf57d219..855f39543e4 100755 --- a/Polyhedron/demo/Polyhedron/cgal_test_with_cmake +++ b/Polyhedron/demo/Polyhedron/cgal_test_with_cmake @@ -144,8 +144,8 @@ if ${MAKE_CMD} -f Makefile help | grep "pca_plugin" > /dev/null; then compile_and_run pca_plugin NEED_CLEAN=y fi -if ${MAKE_CMD} -f Makefile help | grep "polygon_soup" > /dev/null; then - compile_and_run polygon_soup +if ${MAKE_CMD} -f Makefile help | grep "scene_polygon_soup" > /dev/null; then + compile_and_run scene_polygon_soup NEED_CLEAN=y fi if ${MAKE_CMD} -f Makefile help | grep "remeshing_plugin" > /dev/null; then diff --git a/Polyhedron/demo/Polyhedron/include/CGAL/Dualizer.h b/Polyhedron/demo/Polyhedron/include/CGAL/Dualizer.h index 5f9f1f96c8e..5b1eb889b01 100644 --- a/Polyhedron/demo/Polyhedron/include/CGAL/Dualizer.h +++ b/Polyhedron/demo/Polyhedron/include/CGAL/Dualizer.h @@ -19,6 +19,7 @@ private: typedef typename Kernel::Point_3 Point; typedef typename Kernel::Plane_3 Plane; typedef typename Kernel::Vector_3 Vector; + typedef typename Kernel::FT FT; typedef typename HDS::Vertex Vertex; typedef typename HDS::Face_handle Face_handle; diff --git a/Polyhedron/demo/Polyhedron/include/CGAL/Polyhedron_kernel.h b/Polyhedron/demo/Polyhedron/include/CGAL/Polyhedron_kernel.h index 7fe966c7906..c0f023fcb3c 100644 --- a/Polyhedron/demo/Polyhedron/include/CGAL/Polyhedron_kernel.h +++ b/Polyhedron/demo/Polyhedron/include/CGAL/Polyhedron_kernel.h @@ -37,6 +37,7 @@ private: typedef typename Kernel::FT FT; typedef typename Kernel::Point_3 Point; typedef typename Kernel::Plane_3 Plane; + typedef typename Kernel::Vector_3 Vector; typedef typename Kernel::Triangle_3 Triangle; // program and solution types @@ -162,6 +163,8 @@ void get_triangles(Polyhedron& polyhedron, { typedef typename Polyhedron::Facet_iterator Facet_iterator; typedef typename Polyhedron::Halfedge_handle Halfedge_handle; + typedef typename Polyhedron::Point_3 Point; + typedef typename Polyhedron::Traits::Triangle_3 Triangle; for(Facet_iterator f = polyhedron.facets_begin(); f != polyhedron.facets_end(); diff --git a/Polyhedron/demo/Polyhedron/include/CGAL/gl_render.h b/Polyhedron/demo/Polyhedron/include/CGAL/gl_render.h index fe76152afab..28613bc2a8c 100644 --- a/Polyhedron/demo/Polyhedron/include/CGAL/gl_render.h +++ b/Polyhedron/demo/Polyhedron/include/CGAL/gl_render.h @@ -4,8 +4,25 @@ #include #include + +namespace { + void CGALglcolor(QColor c, int dv = 0) + { + if ( 0 != dv ) + { +// workaround for Qt-4.2. +#if QT_VERSION < 0x040300 +# define darker dark +#endif + c = c.darker(dv); +#undef darker + } + ::glColor4f(c.red()/255.0, c.green()/255.0, c.blue()/255.0, c.alpha()/255.0); + } +} + template -void gl_render_facets(Polyhedron& polyhedron) +void gl_render_facets(Polyhedron& polyhedron, const std::vector& colors) { typedef typename Polyhedron::Traits Kernel; typedef typename Kernel::Point_3 Point; @@ -23,6 +40,7 @@ void gl_render_facets(Polyhedron& polyhedron) f != polyhedron.facets_end(); f++) { + CGALglcolor(colors[f->patch_id()]); ::glBegin(GL_POLYGON); // If Flat shading: 1 normal per polygon diff --git a/Polyhedron/demo/Polyhedron/include/CGAL/triangulate_polyhedron.h b/Polyhedron/demo/Polyhedron/include/CGAL/triangulate_polyhedron.h new file mode 100644 index 00000000000..4012c9fd57c --- /dev/null +++ b/Polyhedron/demo/Polyhedron/include/CGAL/triangulate_polyhedron.h @@ -0,0 +1,225 @@ +// Copyright (c) 2010-2011 GeometryFactory Sarl (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you may redistribute it under +// the terms of the Q Public License version 1.0. +// See the file LICENSE.QPL distributed with CGAL. +// +// 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) : Laurent Rineau + +#ifndef CGAL_TRIANGULATE_POLYHEDRON_H + +#include +#include + +#include +#include +#include +#include +#include + +// TODO: submit this file to CGAL too +#include "CGAL/compute_normal.h" + +#include +#include +#include + +namespace CGAL { + +template +class Triangulate_modifier + : public CGAL::Modifier_base +{ + typedef typename Polyhedron::HalfedgeDS HDS; + typedef typename Polyhedron::Traits Traits; + + typedef typename Polyhedron::Halfedge_handle Halfedge_handle; + typedef typename Polyhedron::Facet Facet; + typedef typename Polyhedron::Facet_iterator Facet_iterator; + typedef typename Polyhedron::Facet_handle Facet_handle; + + typedef CGAL::Triangulation_2_filtered_projection_traits_3 P_traits; + + typedef CGAL::Triangulation_vertex_base_with_info_2 Vb; + + struct Face_info { + typename Polyhedron::Halfedge_handle e[3]; + bool is_external; + }; + + typedef CGAL::Triangulation_face_base_with_info_2 Fb1; + + typedef CGAL::Constrained_triangulation_face_base_2 Fb; + typedef CGAL::Triangulation_data_structure_2 TDS; + typedef CGAL::No_intersection_tag Itag; + typedef CGAL::Constrained_Delaunay_triangulation_2 CDTbase; + typedef CGAL::Constrained_triangulation_plus_2 CDT; + +public: + Triangulate_modifier() + { + } + + bool is_external(typename CDT::Face_handle fh) const { + return fh->info().is_external; + } + + void operator()(HDS& hds) { + CGAL::HalfedgeDS_decorator decorator(hds); + typedef typename HDS::Halfedge Halfedge; + + // One need to store facet handles into a vector, because the list of + // facets of the polyhedron will be modified during the loop, and + // that invalidates the range [facets_begin(), facets_end()[. + std::vector facets; + facets.reserve(hds.size_of_faces()); + for(Facet_iterator + fit = hds.faces_begin(), + end = hds.faces_end(); + fit != end; ++fit) { + facets.push_back(fit); + } + + // Iterates on the vector of facet handles + for(typename std::vector::iterator + fit_it = facets.begin(), + end = facets.end(); + fit_it != end; ++fit_it) + { + Facet_handle fit = *fit_it; + typename Traits::Vector_3 normal = + compute_facet_normal(*fit); + + P_traits cdt_traits(normal); + CDT cdt(cdt_traits); + + typename Facet::Halfedge_around_facet_circulator + he_circ = fit->facet_begin(), + he_circ_end(he_circ); + typename CDT::Vertex_handle previous, first; + do { + typename CDT::Vertex_handle vh = cdt.insert(he_circ->vertex()->point()); + if(first == 0) { + first = vh; + } + vh->info() = he_circ; + if(previous != 0 && previous != vh) { + cdt.insert_constraint(previous, vh); + } + previous = vh; + } while( ++he_circ != he_circ_end ); + cdt.insert_constraint(previous, first); + + // sets mark is_external + for(typename CDT::All_faces_iterator + fit = cdt.all_faces_begin(), + end = cdt.all_faces_end(); + fit != end; ++fit) + { + fit->info().is_external = false; + } + std::queue face_queue; + face_queue.push(cdt.infinite_vertex()->face()); + while(! face_queue.empty() ) { + typename CDT::Face_handle fh = face_queue.front(); + face_queue.pop(); + if(fh->info().is_external) continue; + fh->info().is_external = true; + for(int i = 0; i <3; ++i) { + if(!cdt.is_constrained(std::make_pair(fh, i))) + { + face_queue.push(fh->neighbor(i)); + } + } + } + + // then modify the polyhedron + decorator.make_hole(fit->halfedge()); + for(typename CDT::Finite_edges_iterator + eit = cdt.finite_edges_begin(), + end = cdt.finite_edges_end(); + eit != end; ++eit) + { + typename CDT::Face_handle fh = eit->first; + const int index = eit->second; + typename CDT::Face_handle opposite_fh = fh->neighbor(eit->second); + const int opposite_index = opposite_fh->index(fh); + const typename CDT::Vertex_handle va = fh->vertex(cdt. cw(index)); + const typename CDT::Vertex_handle vb = fh->vertex(cdt.ccw(index)); + + if( ! (is_external(fh) && is_external(opposite_fh)) && + ! cdt.is_constrained(*eit) ) + { + // strictly internal edge + Halfedge_handle h = hds.edges_push_back(Halfedge(), + Halfedge()); + fh->info().e[index] = h; + opposite_fh->info().e[opposite_index] = h->opposite(); + + decorator.set_vertex(h, va->info()->vertex()); + decorator.set_vertex(h->opposite(), vb->info()->vertex()); + } + if( cdt.is_constrained(*eit) ) + { + if(!is_external(fh)) { + fh->info().e[index] = va->info(); + } + if(!is_external(opposite_fh)) { + opposite_fh->info().e[opposite_index] = vb->info(); + } + } + } + for(typename CDT::Finite_faces_iterator + fit = cdt.finite_faces_begin(), + end = cdt.finite_faces_end(); + fit != end; ++fit) + { + if(!is_external(fit)) + { + Halfedge_handle h0 = fit->info().e[0]; + Halfedge_handle h1 = fit->info().e[1]; + Halfedge_handle h2 = fit->info().e[2]; + CGAL_assertion( h0 != Halfedge_handle() ); + CGAL_assertion( h1 != Halfedge_handle() ); + CGAL_assertion( h2 != Halfedge_handle() ); + + typedef typename Halfedge::Base HBase; + h0->HBase::set_next(h1); + decorator.set_prev(h1, h0); + h1->HBase::set_next(h2); + decorator.set_prev(h2, h1); + h2->HBase::set_next(h0); + decorator.set_prev(h0, h2); + + decorator.fill_hole(h0); + } + } + } // end loop on facets of the input polyhedron + } +}; // end class Triangulate_modifier + +template +void triangulate_polyhedron(Polyhedron& p) +{ + CGAL::Triangulate_modifier modifier; + p.delegate(modifier); +} + +} // end namespace CGAL + +#endif // CGAL_TRIANGULATE_POLYHEDRON_H diff --git a/Polyhedron/demo/Polyhedron/opengl_tools.h b/Polyhedron/demo/Polyhedron/opengl_tools.h new file mode 100644 index 00000000000..2a5744f9262 --- /dev/null +++ b/Polyhedron/demo/Polyhedron/opengl_tools.h @@ -0,0 +1,63 @@ +// Copyright (c) 2003 Utrecht University (The Netherlands), +// ETH Zurich (Switzerland), Freie Universitaet Berlin (Germany), +// INRIA Sophia-Antipolis (France), Martin-Luther-University Halle-Wittenberg +// (Germany), Max-Planck-Institute Saarbruecken (Germany), RISC Linz (Austria), +// 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; version 2.1 of the License. +// See the file LICENSE.LGPL distributed with CGAL. +// +// 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) : Laurent Rineau + +#ifndef CGAL_OPENGL_TOOLS_H +#define CGAL_OPENGL_TOOLS_H + +#include + +namespace CGAL { +namespace GL { + +class Color { + GLfloat c[4]; +public: + Color() { + ::glGetFloatv(GL_COLOR, &c[0]); + } + ~Color() { + set_rgb_color(c[0], c[1], c[2], c[3]); + } + void set_rgb_color(GLfloat r, GLfloat g, GLfloat b, GLfloat a = 1.f) { + ::glColor4f(r, g, b, a); + } +}; // end class Color; + +class Point_size { + GLfloat ps; +public: + Point_size() { + ::glGetFloatv(GL_POINT_SIZE, &ps); + } + ~Point_size() { + set_point_size(ps); + } + void set_point_size(GLfloat v) { + ::glPointSize(v); + } +}; // end class Point_size + +} // end namespace GL +} // end namespace CGAL + +#endif // not CGAL_OPENGL_TOOLS_H diff --git a/Polyhedron/demo/Polyhedron/texture.cpp b/Polyhedron/demo/Polyhedron/texture.cpp index ff574ca5eb6..ae99232bbe7 100644 --- a/Polyhedron/demo/Polyhedron/texture.cpp +++ b/Polyhedron/demo/Polyhedron/texture.cpp @@ -972,7 +972,7 @@ void Texture::GenerateHStripes(unsigned int width, //*************************************** void Texture::GenerateGrid(unsigned int width, unsigned int height, - int size, + int /*size*/, unsigned int thickness, unsigned char r, unsigned char g, @@ -1016,7 +1016,7 @@ void Texture::GenerateGrid(unsigned int width, void Texture::GenerateGradientH(unsigned int width, unsigned int height, - int size) + int /*size*/) { Alloc(width,height,24); @@ -1034,7 +1034,7 @@ void Texture::GenerateGradientH(unsigned int width, } void Texture::GenerateGradientV(unsigned int width, unsigned int height, - int size) + int /*size*/) { Alloc(width,height,24); diff --git a/Principal_component_analysis/doc_tex/Principal_component_analysis/introduction.tex b/Principal_component_analysis/doc_tex/Principal_component_analysis/introduction.tex index 4965d29886d..3789c71156c 100644 --- a/Principal_component_analysis/doc_tex/Principal_component_analysis/introduction.tex +++ b/Principal_component_analysis/doc_tex/Principal_component_analysis/introduction.tex @@ -1,4 +1,4 @@ -This package provides functions to analyze sets of objects in 2D and 3D. It provides the computation of axis-aligned bounding boxes, centers of mass and principal component analysis for all bounded objects, as well as barycenters for sets of weighted points. Note that unlike most of the CGAL packages, this package uses approximation methods (in particular for linear least squares fitting) and is not intended to provide an exact canonical result in any sense. +This package provides functions to analyze sets of objects in 2D and 3D. It provides the computation of axis-aligned bounding boxes, centers of mass and principal component analysis for all bounded objects, as well as barycenters for sets of weighted points. Note that unlike most of the \cgal\ packages, this package uses approximation methods (in particular for linear least squares fitting) and is not intended to provide an exact canonical result in any sense. \section{Definitions} diff --git a/Profiling_tools/include/CGAL/Memory_sizer.h b/Profiling_tools/include/CGAL/Memory_sizer.h index ab667543f75..c18cdb6797e 100644 --- a/Profiling_tools/include/CGAL/Memory_sizer.h +++ b/Profiling_tools/include/CGAL/Memory_sizer.h @@ -43,6 +43,12 @@ struct Memory_sizer #if defined _MSC_VER # include # include "psapi.h" + +// auto-link with psapi.lib +# define CGAL_LIB_NAME psapi +# define CGAL_AUTO_LINK_NOMANGLE +# include + #elif defined __linux__ # include # include diff --git a/STL_Extension/doc_tex/STL_Extension_ref/Uncertain.tex b/STL_Extension/doc_tex/STL_Extension_ref/Uncertain.tex index 472242ad514..fdb6d0a686f 100644 --- a/STL_Extension/doc_tex/STL_Extension_ref/Uncertain.tex +++ b/STL_Extension/doc_tex/STL_Extension_ref/Uncertain.tex @@ -28,7 +28,7 @@ provides overloaded operators and functions to naturally extend the Boolean operations for \ccc{Uncertain} for example, or the operations on enumeration types. -\ccc{Uncertain} is used in CGAL as the return type of geometric predicates +\ccc{Uncertain} is used in \cgal\ as the return type of geometric predicates when the number type used is interval arithmetic like \ccc{Interval_nt}. End users typically do not see it, as it is hidden in the implementation of the filtered predicates provided by the various filtered kernels, but it is diff --git a/STL_Extension/doc_tex/STL_Extension_ref/stl_extension.tex b/STL_Extension/doc_tex/STL_Extension_ref/stl_extension.tex index f3183e2fa79..f085905948b 100644 --- a/STL_Extension/doc_tex/STL_Extension_ref/stl_extension.tex +++ b/STL_Extension/doc_tex/STL_Extension_ref/stl_extension.tex @@ -1434,16 +1434,16 @@ %% +--------------------------------------------------------+ \begin{ccRefClass}{Twotuple} - + This class is deprecated, and will be removed in some future \cgal\ release. + Please use \ccc{CGAL::cpp0x::array} instead. + + \begin{ccDeprecated} \ccDefinition The \ccRefName\ class stores a homogeneous (same type) pair of objects of type \ccc{T}. A \ccRefName\ is much like a container, in that it "owns" its elements. It is not actually a model of container, though, because it does not support the standard methods (such as iterators) for accessing the elements of a container. - This class is DEPRECATED, and will be removed in some future CGAL release. - Please use \ccc{CGAL::cpp0x::array} instead. - \ccInclude{CGAL/Twotuple.h} \ccRequirements \ccc{T} must be \ccc{Assignable}. @@ -1468,22 +1468,22 @@ \ccConstructor{Twotuple(T x, T y);}{constructs a \ccRefName\ such that \ccc{e0} is constructed from \ccc{x} and \ccc{e1} is constructed from \ccc{y}.} - + \end{ccDeprecated} \end{ccRefClass} %% +--------------------------------------------------------+ \begin{ccRefClass}{Threetuple} + This class is deprecated, and will be removed in some future \cgal\ release. + Please use \ccc{CGAL::cpp0x::array} instead. + \begin{ccDeprecated} \ccDefinition The \ccRefName\ class stores a homogeneous (same type) triple of objects of type \ccc{T}. A \ccRefName\ is much like a container, in that it "owns" its elements. It is not actually a model of container, though, because it does not support the standard methods (such as iterators) for accessing the elements of a container. - This class is DEPRECATED, and will be removed in some future CGAL release. - Please use \ccc{CGAL::cpp0x::array} instead. - \ccInclude{CGAL/Threetuple.h} \ccRequirements \ccc{T} must be \ccc{Assignable}. @@ -1510,22 +1510,22 @@ \ccConstructor{Threetuple(T x, T y, T z);}{constructs a \ccRefName\ such that \ccc{e0} is constructed from \ccc{x}, \ccc{e1} is constructed from \ccc{y} and \ccc{e2} is constructed from \ccc{z}.} - + \end{ccDeprecated} \end{ccRefClass} %% +--------------------------------------------------------+ \begin{ccRefClass}{Fourtuple} + This class is deprecated, and will be removed in some future \cgal\ release. + Please use \ccc{CGAL::cpp0x::array} instead. + \begin{ccDeprecated} \ccDefinition The \ccRefName\ class stores a homogeneous (same type) fourtuple of objects of type \ccc{T}. A \ccRefName\ is much like a container, in that it "owns" its elements. It is not actually a model of container, though, because it does not support the standard methods (such as iterators) for accessing the elements of a container. - This class is DEPRECATED, and will be removed in some future CGAL release. - Please use \ccc{CGAL::cpp0x::array} instead. - \ccInclude{CGAL/Fourtuple.h} \ccRequirements \ccc{T} must be \ccc{Assignable}. @@ -1554,22 +1554,22 @@ \ccConstructor{Fourtuple(T x, T y, T z, T t);}{constructs a \ccRefName\ such that \ccc{e0} is constructed from \ccc{x}, \ccc{e1} from \ccc{y}, \ccc{e2} from \ccc{z} and \ccc{e3} from \ccc{t}.} - + \end{ccDeprecated} \end{ccRefClass} %% +--------------------------------------------------------+ \begin{ccRefClass}{Sixtuple} - + This class is deprecated, and will be removed in some future \cgal\ release. + Please use \ccc{CGAL::cpp0x::array} instead. + + \begin{ccDeprecated} \ccDefinition The \ccRefName\ class stores a homogeneous (same type) sixtuple of objects of type \ccc{T}. A \ccRefName\ is much like a container, in that it "owns" its elements. It is not actually a model of container, though, because it does not support the standard methods (such as iterators) for accessing the elements of a container. - This class is DEPRECATED, and will be removed in some future CGAL release. - Please use \ccc{CGAL::cpp0x::array} instead. - \ccInclude{CGAL/Sixtuple.h} \ccRequirements \ccc{T} must be \ccc{Assignable}. @@ -1603,6 +1603,7 @@ \ccRefName\ such that \ccc{e0} is constructed from \ccc{x}, \ccc{e1} from \ccc{y}, \ccc{e2} from \ccc{z}, \ccc{e3} from \ccc{t}, \ccc{e4} from \ccc{u} and \ccc{e5} from \ccc{v}.} + \end{ccDeprecated} \end{ccRefClass} diff --git a/STL_Extension/doc_tex/STL_Extension_ref/tuple.tex b/STL_Extension/doc_tex/STL_Extension_ref/tuple.tex index 8774bc4963a..87c8cee049a 100644 --- a/STL_Extension/doc_tex/STL_Extension_ref/tuple.tex +++ b/STL_Extension/doc_tex/STL_Extension_ref/tuple.tex @@ -33,7 +33,7 @@ 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} and \ccc{tie}. +\ccc{get}, \ccc{tie}, \ccc{tuple_size} and \ccc{tuple_element}. \end{ccRefClass} diff --git a/STL_Extension/include/CGAL/Modifiable_priority_queue.h b/STL_Extension/include/CGAL/Modifiable_priority_queue.h index c0bd11df492..c11f695e4b7 100644 --- a/STL_Extension/include/CGAL/Modifiable_priority_queue.h +++ b/STL_Extension/include/CGAL/Modifiable_priority_queue.h @@ -1,8 +1,9 @@ -// Copyright (c) 2006 GeometryFactory (France). All rights reserved. +// Copyright (c) 2006-2011 GeometryFactory (France). All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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; version 2.1 of the License. +// See the file LICENSE.LGPL distributed with CGAL. // // Licensees holding a valid commercial license may use this file in // accordance with the commercial license agreement provided with the software. diff --git a/STL_Extension/include/CGAL/is_iterator.h b/STL_Extension/include/CGAL/is_iterator.h index 920805ee06e..f7da841103c 100644 --- a/STL_Extension/include/CGAL/is_iterator.h +++ b/STL_Extension/include/CGAL/is_iterator.h @@ -41,13 +41,15 @@ template struct is_iterator_type_ : //boost::is_base_of::iterator_category> boost::is_convertible::iterator_category,U> {}; + } +// NOTE: we don't want the real std::decay or functions are included template struct is_iterator : - internal::is_iterator_::type> {}; + internal::is_iterator_::type>::type> {}; template struct is_iterator_type : - internal::is_iterator_type_::type,Tag> {}; + internal::is_iterator_type_::type>::type,Tag> {}; } diff --git a/Segment_Delaunay_graph_2/dont_submit b/Segment_Delaunay_graph_2/dont_submit index 39e8f64ce49..06b0abff6ce 100644 --- a/Segment_Delaunay_graph_2/dont_submit +++ b/Segment_Delaunay_graph_2/dont_submit @@ -1,2 +1,3 @@ new_stuff demo +include/CGAL/Segment_Delaunay_graph_2/Sqrt_extension_1.h diff --git a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Basic_predicates_C2.h b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Basic_predicates_C2.h index bf6e10aa1cf..43d4d1e5fa8 100644 --- a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Basic_predicates_C2.h +++ b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Basic_predicates_C2.h @@ -26,7 +26,7 @@ #include #include -#include +#include #include @@ -55,9 +55,9 @@ public: typedef typename K::Compute_scalar_product_2 Compute_scalar_product_2; typedef typename K::Boolean Boolean; - typedef CGAL::Sqrt_extension_1 Sqrt_1; - typedef CGAL::Sqrt_extension_2 Sqrt_2; - typedef CGAL::Sqrt_extension_2 Sqrt_3; + typedef CGAL::Sqrt_extension Sqrt_1; + typedef CGAL::Sqrt_extension_2 Sqrt_2; + typedef CGAL::Sqrt_extension_2 Sqrt_3; private: typedef typename Algebraic_structure_traits::Algebraic_category RT_Category; typedef typename Algebraic_structure_traits::Algebraic_category FT_Category; @@ -144,8 +144,8 @@ public: static FT to_ft(const Sqrt_1& x) { - FT sqrt_c = compute_sqrt( x.c(), ft_has_sqrt() ); - return x.a() + x.b() * sqrt_c; + FT sqrt_c = compute_sqrt( x.root(), ft_has_sqrt() ); + return x.a0() + x.a1() * sqrt_c; } static diff --git a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Sqrt_extension_2.h b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Sqrt_extension_2.h index b8ce80dfabf..d5e1c109cf1 100644 --- a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Sqrt_extension_2.h +++ b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Sqrt_extension_2.h @@ -23,7 +23,7 @@ #ifndef CGAL_SEGMENT_DELAUNAY_GRAPH_2_SQRT_EXTENSION_2_H #define CGAL_SEGMENT_DELAUNAY_GRAPH_2_SQRT_EXTENSION_2_H -#include +#include @@ -36,7 +36,7 @@ class Sqrt_extension_2 { private: typedef Sqrt_extension_2 Self; - typedef Sqrt_extension_1 Sqrt_1; + typedef Sqrt_extension Sqrt_1; NT a0_, a1_, a2_, a3_; NT A_, B_; diff --git a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Voronoi_vertex_ring_C2.h b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Voronoi_vertex_ring_C2.h index efd669b42fd..1f24a67d78c 100644 --- a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Voronoi_vertex_ring_C2.h +++ b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Voronoi_vertex_ring_C2.h @@ -717,7 +717,7 @@ private: Orientation orientation(const Line_2& l, Type) const { - Sqrt_1 Zero(RT(0), RT(0), ux.a().c()); + Sqrt_1 Zero(RT(0), RT(0), ux.a().root()); Sqrt_1 a = l.a() + Zero; Sqrt_1 b = l.b() + Zero; @@ -837,7 +837,7 @@ private: CGAL_precondition( st.is_point() ); Point_2 t = st.point(); - Sqrt_1 Zero(RT(0), RT(0), ux.a().c()); + Sqrt_1 Zero(RT(0), RT(0), ux.a().root()); Point_2 pref = p_ref().point(); @@ -868,7 +868,7 @@ private: Point_2 t = st.point(); - Sqrt_1 Zero(RT(0), RT(0), ux.a().c()); + Sqrt_1 Zero(RT(0), RT(0), ux.a().root()); RT a1, b1, c1; compute_supporting_line(p_.supporting_site(), a1, b1, c1); @@ -977,7 +977,7 @@ private: Oriented_side oriented_side(const Line_2& l, const Point_2& p, Type) const { - Sqrt_1 Zero(RT(0), RT(0), ux.a().c()); + Sqrt_1 Zero(RT(0), RT(0), ux.a().root()); Sqrt_1 px = p.x() + Zero; Sqrt_1 py = p.y() + Zero; @@ -1036,7 +1036,7 @@ private: Sign incircle(const Line_2& l, PSS_Type) const { - Sqrt_1 Zero(RT(0), RT(0), ux.a().c()); + Sqrt_1 Zero(RT(0), RT(0), ux.a().root()); Point_2 pref = p_ref().point(); @@ -1062,7 +1062,7 @@ private: Sign incircle(const Line_2& l, SSS_Type) const { - Sqrt_1 Zero(RT(0), RT(0), ux.a().c()); + Sqrt_1 Zero(RT(0), RT(0), ux.a().root()); RT a1, b1, c1; compute_supporting_line(p_.supporting_site(), a1, b1, c1); diff --git a/Spatial_sorting/doc_tex/Spatial_sorting/PkgDescription.tex b/Spatial_sorting/doc_tex/Spatial_sorting/PkgDescription.tex index d35536380eb..959a556c9ca 100644 --- a/Spatial_sorting/doc_tex/Spatial_sorting/PkgDescription.tex +++ b/Spatial_sorting/doc_tex/Spatial_sorting/PkgDescription.tex @@ -1,8 +1,8 @@ \begin{ccPkgDescription}{Spatial Sorting \label{Pkg:SpatialSorting}} -\ccPkgHowToCiteCgal{cgal:d-ss-11} +\ccPkgHowToCiteCgal{cgal:d-ss-10} \ccPkgSummary{This package provides functions -for sorting geometric objects in two and three dimensions, in order to improve +for sorting geometric objects in two, three and higher dimensions, in order to improve efficiency of incremental geometric algorithms.} \ccPkgIntroducedInCGAL{3.3} diff --git a/Spatial_sorting/doc_tex/Spatial_sorting/fig/Hilbert-median.gif b/Spatial_sorting/doc_tex/Spatial_sorting/fig/Hilbert-median.gif new file mode 100644 index 00000000000..bcc1aa3052c Binary files /dev/null and b/Spatial_sorting/doc_tex/Spatial_sorting/fig/Hilbert-median.gif differ diff --git a/Spatial_sorting/doc_tex/Spatial_sorting/fig/Hilbert-median.pdf b/Spatial_sorting/doc_tex/Spatial_sorting/fig/Hilbert-median.pdf new file mode 100644 index 00000000000..ddd7002eed6 Binary files /dev/null and b/Spatial_sorting/doc_tex/Spatial_sorting/fig/Hilbert-median.pdf differ diff --git a/Spatial_sorting/doc_tex/Spatial_sorting/fig/Hilbert-middle.gif b/Spatial_sorting/doc_tex/Spatial_sorting/fig/Hilbert-middle.gif new file mode 100644 index 00000000000..96785584337 Binary files /dev/null and b/Spatial_sorting/doc_tex/Spatial_sorting/fig/Hilbert-middle.gif differ diff --git a/Spatial_sorting/doc_tex/Spatial_sorting/fig/Hilbert-middle.pdf b/Spatial_sorting/doc_tex/Spatial_sorting/fig/Hilbert-middle.pdf new file mode 100644 index 00000000000..a5a82746306 Binary files /dev/null and b/Spatial_sorting/doc_tex/Spatial_sorting/fig/Hilbert-middle.pdf differ diff --git a/Spatial_sorting/doc_tex/Spatial_sorting/fig/Hilbert8.gif b/Spatial_sorting/doc_tex/Spatial_sorting/fig/Hilbert8.gif new file mode 100644 index 00000000000..87301238d14 Binary files /dev/null and b/Spatial_sorting/doc_tex/Spatial_sorting/fig/Hilbert8.gif differ diff --git a/Spatial_sorting/doc_tex/Spatial_sorting/fig/Hilbert8.pdf b/Spatial_sorting/doc_tex/Spatial_sorting/fig/Hilbert8.pdf new file mode 100644 index 00000000000..9388fd644a6 Binary files /dev/null and b/Spatial_sorting/doc_tex/Spatial_sorting/fig/Hilbert8.pdf differ diff --git a/Spatial_sorting/doc_tex/Spatial_sorting/main.tex b/Spatial_sorting/doc_tex/Spatial_sorting/main.tex index 442b704f4ef..c184c024ddb 100644 --- a/Spatial_sorting/doc_tex/Spatial_sorting/main.tex +++ b/Spatial_sorting/doc_tex/Spatial_sorting/main.tex @@ -1,12 +1,11 @@ \ccUserChapter{Spatial Sorting \label{chap:spatial_sorting}} -\ccChapterAuthor{Christophe Delage} +\ccChapterAuthor{Christophe Delage \and Olivier Devillers} \input{Spatial_sorting/PkgDescription} \minitoc -\input{Spatial_sorting/spatial_sorting_def} \input{Spatial_sorting/spatial_sorting} diff --git a/Spatial_sorting/doc_tex/Spatial_sorting/spatial_sorting.tex b/Spatial_sorting/doc_tex/Spatial_sorting/spatial_sorting.tex index 7c0a371fba6..58bc26026b0 100644 --- a/Spatial_sorting/doc_tex/Spatial_sorting/spatial_sorting.tex +++ b/Spatial_sorting/doc_tex/Spatial_sorting/spatial_sorting.tex @@ -1,61 +1,218 @@ -%\begin{ccHtmlOnly} -%
-% -%
-%\end{ccHtmlOnly} -% -%\begin{ccTexOnly} -%\begin{center} -%\includegraphics[width=6.5cm]{Convex_hull_2/saarhull} -%%\leavevmode\epsfxsize8cm\epsffile{Convex_hull_2/saarhull.eps} -%\end{center} -%\end{ccTexOnly} + +\section{Introduction} + +Many geometric algorithms implemented in \cgal\ are incremental, and thus their +speed is dependent on the order of insertion. This package provides sorting +algorithms that may considerably improve running times of such +algorithms. + +The rationale is to sort objects along a space-filling curve +so that two +objects close geometrically will be close in the insertion order with high +probability. That way, parts of a data structure that will be looked at during +an insertion will probably have been looked at in a recent insertion, and thus +probably will be in cache memory instead of main memory. +As another side-effect, these sorting functions usually improve memory locality +of the data structures produced by incremental algorithms, sometimes leading to +speed ups in other algorithm using these data structures. + +Some algorithms have a good complexity under randomized hypotheses which +contradicts the idea of sorting the input using any sorting criterion. +In such a case, it is possible to introduce just a bit of randomness +to be able to combine the good randomized complexity and the +good effects of locality \cite{acr-icb-03}. + + +The predicates used by this package are comparisons between coordinates, +thus there is no robustness issue involved here, for example to choose the +arithmetic of the kernel. + + +\section{Hilbert Sorting\label{sec:hilbert_sorting}} + + +In 2D, one can construct a space filling curve, that is a mapping $f$ of $[0,1]$ +to the unit square $[0,1]^2$, such that $f(0)=(0,0)$ and $f(1)=(1,0)$ + in the following way: +the unit square is subdivided in four such that\\ +\begin{quote} +$f([0,\frac{1}{4}])=[0,\frac{1}{2}]^2$, +$f([\frac{1}{4},\frac{1}{2}])=[0,\frac{1}{2}]\times[\frac{1}{2},1]$, +$f([\frac{1}{2},\frac{3}{4}])=[\frac{1}{2},1]^2$, +and +$f([\frac{3}{4},1])=[\frac{1}{2},1]\times[0,\frac{1}{2}].$\\ +$f(\frac{1}{4})=(0,\frac{1}{2})$\\ +$f(\frac{1}{2})=(\frac{1}{2},\frac{1}{2})$, and +$f(\frac{3}{4})=(1,\frac{1}{2})$. +\end{quote} + +Then each square is subdivided in the same way recursively. +Figure~\ref{Spatial_sorting_fig_Hilbert8} illustrates this process. + +\begin{figure} +\begin{ccHtmlOnly} +
+ +
+\end{ccHtmlOnly} +\begin{ccTexOnly} +\begin{center} +\includegraphics[width=11.5cm]{Spatial_sorting/fig/Hilbert8} +\end{center} +\end{ccTexOnly} +\caption{Hilbert mapping +\label{Spatial_sorting_fig_Hilbert8}} +\end{figure} + +Now given a set of 2D points, they can be sorted in the order they have on such +a space filling curve as illustrated in Figure~\ref{Spatial_sorting_fig_Hilbert_middle} : + +\begin{figure}[h] +\begin{ccHtmlOnly} +
+ +
+\end{ccHtmlOnly} +\begin{ccTexOnly} +\begin{center} +\includegraphics[width=6.5cm]{Spatial_sorting/fig/Hilbert-middle} +\end{center} +\end{ccTexOnly} +\caption{Hilbert sort with middle policy +\label{Spatial_sorting_fig_Hilbert_middle}} +\end{figure} + +\begin{ccTexOnly} +\newpage +\end{ccTexOnly} + +\subsection{Examples} + +The code to use Hilbert sort is as simple as the following example: + +\ccIncludeExampleCode{Spatial_sorting/hilbert.cpp} + + +If instead of subdividing the square in a fixed way at its middle point, + as above, we subdivide it +by splitting at the median point (in $x$ or $y$ directions alternating), +we construct a 2-d tree adapted to the point set. This tree can be visited in a +similar manner and we get also a suitable ordering of the points +(see Figure~\ref{Spatial_sorting_fig_Hilbert_median}). + + +\begin{figure}[t] +\begin{ccHtmlOnly} +
+ +
+\end{ccHtmlOnly} +\begin{ccTexOnly} +\begin{center} +\includegraphics[width=6.5cm]{Spatial_sorting/fig/Hilbert-median} +\end{center} +\end{ccTexOnly} +\caption{Hilbert sort with median policy +\label{Spatial_sorting_fig_Hilbert_median}} +\end{figure} + + +\cgal\ provides Hilbert sorting for points in 2D, 3D and higher dimensions, +in the middle and the median policies. + +The middle policy is easier to analyze, and is interesting in practice +for well distributed set of points in small dimension (if the number +of points is really smaller than $2^d$). +The median policy should be prefered for high dimension or if +the point set distribution is not regular (or unknown). +Since the median policy cannot be much worse than the middle +policy, while the converse can happen, the median policy is the +default behavior. +Most theoretical results are using the middle policy +\cite{acr-icb-03,b-aahsf-71,bg-sfche-89,pb-scpts-89}. + + +This other example illustrates the use of the two different policies + + +\ccIncludeExampleCode{Spatial_sorting/hilbert_policies.cpp} + \section{Spatial Sorting\label{sec:spatial_sorting}} -\cgal\ provides a small set of sorting algorithms, currently implemented only for 2D and 3D points, although it is easy to extend them to other objects through a traits mechanism. +Hilbert sort cannot be used directly before feeding a randomized algorithm. +Thus, the trick is to organize the point set in random buckets of increasing +sizes, Hilbert sort being used only inside a bucket. -Given an iterator range of points, the function \ccc{hilbert_sort} sorts them -along the space-filling Hilbert curve. -Combined with a \ccc{std::random_shuffle}, the function \ccc{spatial_sort} will -sort points in a way keeping enough randomness to retain theoretical optimality -for some algorithms\footnote{in fact, this has only been proved for Delaunay triangulation}, -and close enough to a space-filling curve to speed-up algorithms. - -The 2D and 3D triangulation classes of \cgal\ internally sort points as described -above, when the points are passed as an iterator range to a constructor or the -\ccc{insert} method. +It has been proved, in the context of Delaunay triangulation, that +such an order provides enough randomness to combine the advantages of a random + order and a space filling curve order \cite{acr-icb-03}. -\section{Examples} +\cgal\ provides spatial sorting for points in 2D, 3D and higher dimensions, +with the middle and the median policies for Hilbert sort in the buckets. -In the following three examples you will see how to apply -spatial sort to \cgal\ points, or on the indices into -a container with points, or on a user defined point class. +\subsection{Basic Example} -\subsection{Sorting Points} +The following example shows that, on particular input, spatial sort +runs much faster than a bad order or than Hilbert sort (below results +with release mode compilation on a 1.8GHz processor). +\begin{verbatim} +$ ./small_example_delaunay_2 +10000 points on a parabola + Delaunay without spatial sort... done in 6.33443 seconds. + Delaunay with median hilbert sort... done in 0.822975 seconds. + Delaunay with median spatial sort... done in 0.022415 seconds. +\end{verbatim} -When you construct a triangulation from an iterator range of -points, the points get spatially sorted internally. +\ccIncludeExampleCode{Spatial_sorting/small_example_delaunay_2.cpp} -If you have a need for inserting the points one by one -you might sort them yourself. - -\ccIncludeExampleCode{Spatial_sorting/example_delaunay_2.cpp} - - -\subsection{Sorting Indices} - -If you do not want to reorder your input, you can -sort indices in your input instead. - -\ccIncludeExampleCode{Spatial_sorting/sort_indices.cpp} - - -\subsection{Sorting User Defined Points} +%Next example describes how a traits class different than CGAL Kernel can be +%used to sort a container of handle on points instead of points directly. +%\ccIncludeExampleCode{Spatial_sorting/sort_indices.cpp} +\subsection{Using Your Own Point Type} If you want to sort points of your own point type, you only have to provide functors that compare -the \ccc{x} and \ccc{y} coordinates of your points. +the \ccc{x} and \ccc{y} coordinates of your points. Note that in case you simply want +to associate an extra information to your point you might consider the example of Section +\ref{sec:sort_any_type_2} +as an alternative. \ccIncludeExampleCode{Spatial_sorting/myPoint.cpp} + +\subsection{Sorting Arbitrary Types} +\label{sec:sort_any_type} +The spatial sorting traits class provides a point type and +functors for comparing, for example, the \ccc{x}-coordinates +of two points. +% +If you want to sort something else than just points, for example +a sequence of tuples containing a point, or a sequence of indices +in a vector of points, you need another level of indirection. +% +We provide the spatial sorting traits class adapters which are templated by +another spatial sorting traits class, and a +\ccAnchor{http://www.boost.org/doc/libs/release/libs/property_map/index.html}{property map}. +which allows to obtain a point from whatever you want to sort. + +The following examples illustrate the usage of these traits class adapters. + +\subsubsection{Sorting Using Pairs of Points and Integers} +\label{sec:sort_any_type_2} +In this example program, the sorted sequence of points is retrieved +using a vector of pairs of points and integers. +\ccIncludeExampleCode{Spatial_sorting/sp_sort_using_property_map_2.cpp} + +\subsubsection{Sorting Using Indices of Points} +In this example program, the sorted sequence of points is retrieved +using the indices of the points in a vector of points. +\ccIncludeExampleCode{Spatial_sorting/sp_sort_using_property_map_3.cpp} + +\subsubsection{Sorting Using Indices of Pairs of Points and Integers} +In this example program, the sorted sequence of points is retrieved +using the indices of the points in a vector of pairs of points and integers. +\ccIncludeExampleCode{Spatial_sorting/sp_sort_using_property_map_d.cpp} + + + diff --git a/Spatial_sorting/doc_tex/Spatial_sorting/spatial_sorting_def.tex b/Spatial_sorting/doc_tex/Spatial_sorting/spatial_sorting_def.tex deleted file mode 100644 index 4de45ea4e99..00000000000 --- a/Spatial_sorting/doc_tex/Spatial_sorting/spatial_sorting_def.tex +++ /dev/null @@ -1,16 +0,0 @@ -\section{Introduction} - -Many geometric algorithms implemented in \cgal\ are incremental, and thus their -speed is dependent on the order of insertion. This package provides sorting -algorithms that may considerably improve running times of such -algorithms. - -The rationale is to sort objects along a space-filling curve so that two -objects close geometrically will be close in the insertion order with high -probability. That way, parts of a data structure that will be looked at during -an insertion will probably have been looked at in a recent insertion, and thus -probably will be in cache memory instead of main memory. - -As another side-effect, these sorting functions usually improve memory locality -of the data structures produced by incremental algorithms, sometimes leading to -speed ups in other algorithm using these data structures. diff --git a/Spatial_sorting/doc_tex/Spatial_sorting_ref/Hilbert_policy_tags.tex b/Spatial_sorting/doc_tex/Spatial_sorting_ref/Hilbert_policy_tags.tex new file mode 100644 index 00000000000..a9dd3231f55 --- /dev/null +++ b/Spatial_sorting/doc_tex/Spatial_sorting_ref/Hilbert_policy_tags.tex @@ -0,0 +1,112 @@ +\begin{ccRefClass}{Median} + +\ccDefinition +\ccRefName\ is a tag class. It can be used to parameterize a strategy policy +in order to specify the strategy for spatial sorting. +\ccc{Hilbert_policy} can be passed to +as parameter to +\ccc{hilbert_sort} to choose the sorting policy. + +\ccInclude{CGAL/Hilbert_policy_tags.h} + +\ccIsModel +\ccc{DefaultConstructible, CopyConstructible} + +\ccSeeAlso +\ccc{Middle} \\ +\ccc{Hilbert_policy} \\ +\ccc{Hilbert_sort__median_policy} \\ +\ccc{Hilbert_sort__middle_policy} + +\end{ccRefClass} + + +\begin{ccRefClass}{Middle} + +\ccDefinition +\ccRefName\ is a tag class. It can be used to parameterize a strategy policy +in order to specify the strategy for spatial sorting. +\ccc{Hilbert_policy} can be passed to +as parameter to +\ccc{hilbert_sort} to choose the sorting policy. + +\ccInclude{CGAL/Hilbert_policy_tags.h} + +\ccIsModel +\ccc{DefaultConstructible, CopyConstructible} + + +\ccSeeAlso +\ccc{Median} \\ +\ccc{Hilbert_policy} \\ +\ccc{Hilbert_sort__median_policy} \\ +\ccc{Hilbert_sort__middle_policy} + +\end{ccRefClass} + + +\begin{ccRefClass}{Hilbert_policy} + +\ccDefinition +\ccRefName\ is a policy class which can be used to parameterize a strategy policy +in order to specify the strategy for spatial sorting. +\ccc{Hilbert_policy} +or +\ccc{Hilbert_policy} +can be passed to +as parameter to +\ccc{hilbert_sort} to choose the sorting policy. + +\ccInclude{CGAL/Hilbert_policy_tags.h} + + + +\ccParameters + +\ccc{Tag} can only be either \ccc{Median} or \ccc{Middle} currently. + +\ccIsModel +\ccc{DefaultConstructible, CopyConstructible} + +\ccSeeAlso +\ccc{Median} \\ +\ccc{Middle} \\ +\ccc{Hilbert_sort__median_policy} \\ +\ccc{Hilbert_sort__middle_policy} + +\end{ccRefClass} + + +\begin{ccRefClass}{Hilbert_sort_median_policy} + +\ccDefinition +A typedef to \ccc{Hilbert_policy}. + +\ccInclude{CGAL/Hilbert_policy_tags.h} + + +\ccSeeAlso +\ccc{Median} \\ +\ccc{Middle} \\ +\ccc{Hilbert_policy} \\ +\ccc{Hilbert_sort__middle_policy} + + +\end{ccRefClass} + + +\begin{ccRefClass}{Hilbert_sort_middle_policy} + +\ccDefinition +A typedef to \ccc{Hilbert_policy}. + +\ccInclude{CGAL/Hilbert_policy_tags.h} + + +\ccSeeAlso +\ccc{Median} \\ +\ccc{Middle} \\ +\ccc{Hilbert_sort__median_policy} \\ +\ccc{Hilbert_policy} + +\end{ccRefClass} diff --git a/Spatial_sorting/doc_tex/Spatial_sorting_ref/Hilbert_sort_2.tex b/Spatial_sorting/doc_tex/Spatial_sorting_ref/Hilbert_sort_2.tex index 3d07eb3e062..26bb805c768 100644 --- a/Spatial_sorting/doc_tex/Spatial_sorting_ref/Hilbert_sort_2.tex +++ b/Spatial_sorting/doc_tex/Spatial_sorting_ref/Hilbert_sort_2.tex @@ -2,9 +2,11 @@ % | Reference manual page: Hilbert_sort_2.tex % +------------------------------------------------------------------------+ -\begin{ccRefFunctionObjectClass}{Hilbert_sort_2} +\begin{ccRefFunctionObjectClass}{Hilbert_sort_2} \ccDefinition The function object \ccRefName\ sorts iterator ranges of -\ccc{Traits::Point_2} along a Hilbert curve. +\ccc{Traits::Point_2} along a Hilbert curve by recursively subdividing +at the median +or the middle depending on the \ccc{PolicyTag}. \ccRequirements \ccc{Traits} is a model for \ccc{SpatialSortingTraits}. diff --git a/Spatial_sorting/doc_tex/Spatial_sorting_ref/Hilbert_sort_3.tex b/Spatial_sorting/doc_tex/Spatial_sorting_ref/Hilbert_sort_3.tex index 9f696e750bc..1b548776765 100644 --- a/Spatial_sorting/doc_tex/Spatial_sorting_ref/Hilbert_sort_3.tex +++ b/Spatial_sorting/doc_tex/Spatial_sorting_ref/Hilbert_sort_3.tex @@ -1,10 +1,11 @@ % +------------------------------------------------------------------------+ -% | Reference manual page: Hilbert_sort_2.tex +% | Reference manual page: Hilbert_sort_3.tex % +------------------------------------------------------------------------+ -\begin{ccRefFunctionObjectClass}{Hilbert_sort_3} +\begin{ccRefFunctionObjectClass}{Hilbert_sort_3} \ccDefinition The function object \ccRefName\ sorts iterator ranges of -\ccc{Traits::Point_3} along a Hilbert curve. +\ccc{Traits::Point_3} along a Hilbert curve by recursively subdividing at the median +or the middle depending on the \ccc{PolicyTag}. \ccRequirements \ccc{Traits} is a model for \ccc{SpatialSortingTraits_3}. diff --git a/Spatial_sorting/doc_tex/Spatial_sorting_ref/Hilbert_sort_d.tex b/Spatial_sorting/doc_tex/Spatial_sorting_ref/Hilbert_sort_d.tex new file mode 100644 index 00000000000..2eecab74e04 --- /dev/null +++ b/Spatial_sorting/doc_tex/Spatial_sorting_ref/Hilbert_sort_d.tex @@ -0,0 +1,29 @@ +% +------------------------------------------------------------------------+ +% | Reference manual page: Hilbert_sort_d.tex +% +------------------------------------------------------------------------+ + +\begin{ccRefFunctionObjectClass}{Hilbert_sort_d} +\ccDefinition The function object \ccRefName\ sorts iterator ranges of +\ccc{Traits::Point_d} along a Hilbert curve by recursively subdividing at the median +or the middle depending on the \ccc{PolicyTag}. + +\ccRequirements \ccc{Traits} is a model for \ccc{SpatialSortingTraits_d}. + +\ccTagFullDeclarations +\ccCreationVariable{o} +\ccCreation +\ccConstructor{Hilbert_sort_d(const Traits &traits = Traits())}{constructs an instance with \ccc{traits} as traits class instance.} +\ccOperations +\ccThree{void;;}{A}{} + +\ccMethod{template void operator() (RandomAccessIterator begin, RandomAccessIterator end) const;}{sorts the range [\ccc{begin}, \ccc{end}). + \ccRequire \ccc{RandomAccessIterator::value_type} equals to \ccc{Traits::Point_d}.} + + \ccTagDefaults + +\end{ccRefFunctionObjectClass} +% +------------------------------------------------------------------------+ +%%RefPage: end of main body, begin of footer +% EOF +% +------------------------------------------------------------------------+ + diff --git a/Spatial_sorting/doc_tex/Spatial_sorting_ref/SpatialSortingTraits_2.tex b/Spatial_sorting/doc_tex/Spatial_sorting_ref/SpatialSortingTraits_2.tex index ea4b1a1b82d..2808c04f27c 100644 --- a/Spatial_sorting/doc_tex/Spatial_sorting_ref/SpatialSortingTraits_2.tex +++ b/Spatial_sorting/doc_tex/Spatial_sorting_ref/SpatialSortingTraits_2.tex @@ -15,12 +15,26 @@ functions and functors. \ccTypes \ccAutoIndexingOff -\ccSetTwoColumns{SpatialSortingTraits_2::Less_x_2}{} +\ccSetTwoColumns{SpatialSortingTraits_2::Compute_x_2}{} \ccNestedType{Point_2}% {The point type on which the sorting algorithms operate.} +\ccNestedType{Compute_x_2}% + {Functor object type returning the $x$ coordinate of a \ccc{Point_2}. + Must provide + \ccc{FT operator()(Point_2 p)} where \ccc{FT} can be used as + argument of \ccc{CGAL::to_double}. + } + +\ccNestedType{Compute_y_2}% + {Functor object type returning the $y$ coordinate of a \ccc{Point_2}. + Must provide + \ccc{FT operator()(Point_2 p)} where \ccc{FT} can be used as + argument of \ccc{CGAL::to_double}. + } + \ccNestedType{Less_x_2}% {Binary predicate object type comparing \ccc{Point_2}s along the $x$ coordinate. @@ -55,6 +69,10 @@ The following member functions to create instances of the above predicate object types must exist. \setlength\parskip{0mm} +\ccMemberFunction{Compute_x_2 compute_x_2_object(); }{} +\ccGlue +\ccMemberFunction{Compute_y_2 compute_y_2_object(); }{} +\ccGlue \ccMemberFunction{Less_x_2 less_x_2_object(); }{} \ccGlue \ccMemberFunction{Less_y_2 less_y_2_object(); }{} @@ -62,7 +80,9 @@ object types must exist. \ccParDims \ccHasModels -Any \cgal{} kernel. +Any \cgal{} kernel.\\ +\ccc{CGAL::Spatial_sort_traits_adapter_2}. + \ccParDims \end{ccRefConcept} diff --git a/Spatial_sorting/doc_tex/Spatial_sorting_ref/SpatialSortingTraits_3.tex b/Spatial_sorting/doc_tex/Spatial_sorting_ref/SpatialSortingTraits_3.tex index 2741ee9ed3e..249a629e96e 100644 --- a/Spatial_sorting/doc_tex/Spatial_sorting_ref/SpatialSortingTraits_3.tex +++ b/Spatial_sorting/doc_tex/Spatial_sorting_ref/SpatialSortingTraits_3.tex @@ -15,12 +15,34 @@ functions and functors. \ccTypes \ccAutoIndexingOff -\ccSetTwoColumns{SpatialSortingTraits_3::Less_x_3}{} +\ccSetTwoColumns{SpatialSortingTraits_3::Compute_x_3}{} \ccNestedType{Point_3}% {The point type on which the sorting algorithms operate.} +\ccNestedType{Compute_x_3}% + {Functor object type returning the $x$ coordinate of a \ccc{Point_3}. + Must provide + \ccc{FT operator()(Point_3 p)} where \ccc{FT} can be used as + argument of \ccc{CGAL::to_double}. + } + +\ccNestedType{Compute_y_3}% + {Functor object type returning the $y$ coordinate of a \ccc{Point_3}. + Must provide + \ccc{FT operator()(Point_3 p)} where \ccc{FT} can be used as + argument of \ccc{CGAL::to_double}. + } + +\ccNestedType{Compute_z_3}% + {Functor object type returning the $z$ coordinate of a \ccc{Point_3}. + Must provide + \ccc{FT operator()(Point_3 p)} where \ccc{FT} can be used as + argument of \ccc{CGAL::to_double}. + } + + \ccNestedType{Less_x_3}% {Binary predicate object type comparing \ccc{Point_3}s along the $x$ coordinate. @@ -65,6 +87,12 @@ The following member functions to create instances of the above predicate object types must exist. \setlength\parskip{0mm} +\ccMemberFunction{Compute_x_3 compute_x_3_object(); }{} +\ccGlue +\ccMemberFunction{Compute_y_3 compute_y_3_object(); }{} +\ccGlue +\ccMemberFunction{Compute_z_3 compute_z_3_object(); }{} +\ccGlue \ccMemberFunction{Less_x_3 less_x_3_object(); }{} \ccGlue \ccMemberFunction{Less_y_3 less_y_3_object(); }{} @@ -74,7 +102,8 @@ object types must exist. \ccParDims \ccHasModels -Any \cgal{} kernel. +Any \cgal{} kernel.\\ +\ccc{CGAL::Spatial_sort_traits_adapter_3}. \ccParDims \end{ccRefConcept} diff --git a/Spatial_sorting/doc_tex/Spatial_sorting_ref/SpatialSortingTraits_d.tex b/Spatial_sorting/doc_tex/Spatial_sorting_ref/SpatialSortingTraits_d.tex new file mode 100644 index 00000000000..ec30e68a776 --- /dev/null +++ b/Spatial_sorting/doc_tex/Spatial_sorting_ref/SpatialSortingTraits_d.tex @@ -0,0 +1,80 @@ +% +------------------------------------------------------------------------+ +% | Reference manual page: SpatialSortingTraits_d.tex +% +------------------------------------------------------------------------+ + + +\begin{ccRefConcept}{SpatialSortingTraits_d} + +\ccDefinition + +All higher dimensional spatial sorting algorithms provided in \cgal{} are parameterized +by a traits class \ccStyle{Traits}, which defines the +primitives (objects and predicates) that the sorting algorithms use. +\ccRefName\ defines the complete set of primitives required in these +functions and functors. + +\ccTypes +\ccAutoIndexingOff +\ccSetTwoColumns{SpatialSortingTraits_3::Compute_coordinate_d}{} + +\ccNestedType{Point_d}% + {The point type on which the sorting algorithms operate. + } + + +\ccNestedType{Point_dimension_d}% + {Functor object type returning the dimension of a \ccc{Point_d}. + Must provide + \ccc{int operator()(Point_d p)} returning the dimension of $p$. + } + +\ccNestedType{Compute_coordinate_d}% + {Functor object type returning the coordinates of a \ccc{Point_d}. + Must provide + \ccc{FT operator()(Point_d p, int i)} returning the $i$th + coordinate of $p$. \ccc{FT} is a type that can be used as + argument of \ccc{CGAL::to_double}. + } + + +\ccNestedType{Less_coordinate_d}% + {Binary predicate object type comparing \ccc{Point_d}s + along some coordinate. + Must provide + \ccc{bool operator()(Point_d p, Point_d q, int i)} where \ccc{true} + is returned iff $p_i < q_i$, + where $p_i$ and $q_i$ denote $i$th coordinate of point $p$ and $q$, + respectively. + } + +\ccCreation +\ccCreationVariable{traits} %% choose variable name + +Only a copy constructor is required. + +\ccConstructor{SpatialSortingTraits_d(const SpatialSortingTraits_d& t);}{} + +\ccOperations + +The following member functions to create instances of the above predicate +object types must exist. + +\setlength\parskip{0mm} +\ccMemberFunction{Point_dimension_d point_dimension_d_object(); }{} +\ccMemberFunction{Compute_coordinate_d compute_coordinate_d_object(); }{} +\ccMemberFunction{Less_coordinate_d less_coordinate_d_object(); }{} + +\ccParDims +\ccHasModels + +Any \cgal{} $d$ dimensional kernel.\\ +\ccc{CGAL::Spatial_sort_traits_adapter_d}. + +\ccParDims +\end{ccRefConcept} + +% +------------------------------------------------------------------------+ +%%RefPage: end of main body, begin of footer +% EOF +% +------------------------------------------------------------------------+ + diff --git a/Spatial_sorting/doc_tex/Spatial_sorting_ref/Spatial_sort_traits_adapter_2.tex b/Spatial_sorting/doc_tex/Spatial_sorting_ref/Spatial_sort_traits_adapter_2.tex new file mode 100644 index 00000000000..1ff3e212beb --- /dev/null +++ b/Spatial_sorting/doc_tex/Spatial_sorting_ref/Spatial_sort_traits_adapter_2.tex @@ -0,0 +1,36 @@ +\begin{ccRefClass}{Spatial_sort_traits_adapter_2} + +\ccDefinition + +Given a property map associating a key to a point, the class \ccRefName\ induces a spatial +reorder of the keys instead of the points, the comparisons being done on the associated points. +In other words, the traits provides to a spatial sort algorithm a point type which is a key, +while the actual point type is \ccc{Base_traits::Point_2}. + +\ccRequirements \ccc{Base_traits} is a model for \ccc{SpatialSortingTraits_2}. +\ccc{PointPropertyMap} is a model of \ccAnchor{http://www.boost.org/doc/libs/release/libs/property_map/doc/ReadablePropertyMap.html}{boost::ReadablePropertyMap} +with \ccc{Base_traits::Point_2} as \ccc{value_type}. + + +\ccInheritsFrom +\ccc{Base_traits} + +\ccIsModel +\ccc{SpatialSortingTraits_2} + +\ccTypes +\ccTypedef{boost::property_traits::key_type Point_2;}{} + +\ccTagFullDeclarations +\ccCreationVariable{o} +\ccCreation +\ccConstructor{Spatial_sort_traits_adapter_2(Base_traits base=Base_traits());}{} +\ccConstructor{Spatial_sort_traits_adapter_2(const PointPropertyMap& ppmap,Base_traits base=Base_traits());}{} + +\ccOperations +\ccThree{void;;}{A}{} + +\ccMethod{const PointPropertyMap& point_property_map() const;}{Returns a const reference to the point property map.} + + +\end{ccRefClass} diff --git a/Spatial_sorting/doc_tex/Spatial_sorting_ref/Spatial_sort_traits_adapter_3.tex b/Spatial_sorting/doc_tex/Spatial_sorting_ref/Spatial_sort_traits_adapter_3.tex new file mode 100644 index 00000000000..c90c6e167e4 --- /dev/null +++ b/Spatial_sorting/doc_tex/Spatial_sorting_ref/Spatial_sort_traits_adapter_3.tex @@ -0,0 +1,35 @@ +\begin{ccRefClass}{Spatial_sort_traits_adapter_3} + +\ccDefinition + +Given a property map associating a key to a point, the class \ccRefName\ induces a spatial +reorder of the keys instead of the points, the comparisons being done on the associated points. +In other words, the traits provides to a spatial sort algorithm a point type which is a key, +while the actual point type is \ccc{Base_traits::Point_3}. + +\ccRequirements \ccc{Base_traits} is a model for \ccc{SpatialSortingTraits_3}. +\ccc{PointPropertyMap} is a model of \ccAnchor{http://www.boost.org/doc/libs/release/libs/property_map/doc/ReadablePropertyMap.html}{boost::ReadablePropertyMap} +with \ccc{Base_traits::Point_3} as \ccc{value_type}. + +\ccInheritsFrom +\ccc{Base_traits} + +\ccIsModel +\ccc{SpatialSortingTraits_3} + +\ccTypes +\ccTypedef{boost::property_traits::key_type Point_3;}{} + +\ccTagFullDeclarations +\ccCreationVariable{o} +\ccCreation +\ccConstructor{Spatial_sort_traits_adapter_3(Base_traits base=Base_traits());}{} +\ccConstructor{Spatial_sort_traits_adapter_3(const PointPropertyMap& ppmap,Base_traits base=Base_traits());}{} + +\ccOperations +\ccThree{void;;}{A}{} + +\ccMethod{const PointPropertyMap& point_property_map() const;}{Returns a const reference to the point property map.} + + +\end{ccRefClass} diff --git a/Spatial_sorting/doc_tex/Spatial_sorting_ref/Spatial_sort_traits_adapter_d.tex b/Spatial_sorting/doc_tex/Spatial_sorting_ref/Spatial_sort_traits_adapter_d.tex new file mode 100644 index 00000000000..f69cff26075 --- /dev/null +++ b/Spatial_sorting/doc_tex/Spatial_sorting_ref/Spatial_sort_traits_adapter_d.tex @@ -0,0 +1,36 @@ +\begin{ccRefClass}{Spatial_sort_traits_adapter_d} + +\ccDefinition + +Given a property map associating a key to a point, the class \ccRefName\ induces a spatial +reorder of the keys instead of the points, the comparisons being done on the associated points. +In other words, the traits provides to a spatial sort algorithm a point type which is a key, +while the actual point type is \ccc{Base_traits::Point_d}. + +\ccRequirements \ccc{Base_traits} is a model for \ccc{SpatialSortingTraits_d}. +\ccc{PointPropertyMap} is a model of \ccAnchor{http://www.boost.org/doc/libs/release/libs/property_map/doc/ReadablePropertyMap.html}{boost::ReadablePropertyMap} +with \ccc{Base_traits::Point_d} as \ccc{value_type}. + + +\ccInheritsFrom +\ccc{Base_traits} + +\ccIsModel +\ccc{SpatialSortingTraits_d} + +\ccTypes +\ccTypedef{boost::property_traits::key_type Point_d;}{} + +\ccTagFullDeclarations +\ccCreationVariable{o} +\ccCreation +\ccConstructor{Spatial_sort_traits_adapter_d(Base_traits base=Base_traits());}{} +\ccConstructor{Spatial_sort_traits_adapter_d(const PointPropertyMap& ppmap,Base_traits base=Base_traits());}{} + +\ccOperations +\ccThree{void;;}{A}{} + +\ccMethod{const PointPropertyMap& point_property_map() const;}{Returns a const reference to the point property map.} + + +\end{ccRefClass} diff --git a/Spatial_sorting/doc_tex/Spatial_sorting_ref/hilbert_sort.tex b/Spatial_sorting/doc_tex/Spatial_sorting_ref/hilbert_sort.tex index 7980faf7ff7..1cdfa31e3f4 100644 --- a/Spatial_sorting/doc_tex/Spatial_sorting_ref/hilbert_sort.tex +++ b/Spatial_sorting/doc_tex/Spatial_sorting_ref/hilbert_sort.tex @@ -21,27 +21,34 @@ along a Hilbert curve. \ccInclude{CGAL/hilbert_sort.h} -\ccGlobalFunction{template +\ccGlobalFunction{template void hilbert_sort( RandomAccessIterator begin, RandomAccessIterator end, - const Traits& traits = Default_traits);}% + const Traits& traits = Default_traits, + PolicyTag policy = Default_policy);} {sorts the range [\ccc{begin},\ccc{end}) in place.} The default traits class \ccc{Default_traits} is the kernel in which the type \ccc{RandomAccessIterator::value_type} is defined. +The default policy is \ccc{Hilbert_sort_median_policy()} and the +other option is \ccc{Hilbert_sort_middle_policy()}. \ccHeading{Requirements} \begin{enumerate} \item \ccc{RandomAccessIterator::value_type} is convertible to -\ccc{Traits::Point_2} or \ccc{Traits::Point_3}. -\item \ccc{Traits} is a model for concept \ccc{SpatialSortingTraits_2} or \ccc{SpatialSortingTraits_3}. +\ccc{Traits::Point_2}, \ccc{Traits::Point_3}, or \ccc{Traits::Point_d}. +\item \ccc{Traits} is a model for concept \ccc{SpatialSortingTraits_2}, + \ccc{SpatialSortingTraits_3}, or \ccc{SpatialSortingTraits_d}. \end{enumerate} \ccImplementation -Creates an instance of \ccc{Hilbert_sort_2} or -\ccc{Hilbert_sort_3} and calls its \ccc{operator()}. +Creates an instance of +\ccc{Hilbert_sort_2}, +\ccc{Hilbert_sort_3}, or +\ccc{Hilbert_sort_d} +and calls its \ccc{operator()}. %\ccc{Some_other_class}, %\ccc{some_other_function}. diff --git a/Spatial_sorting/doc_tex/Spatial_sorting_ref/intro.tex b/Spatial_sorting/doc_tex/Spatial_sorting_ref/intro.tex index 932eb8ad57c..f06bd424fa3 100644 --- a/Spatial_sorting/doc_tex/Spatial_sorting_ref/intro.tex +++ b/Spatial_sorting/doc_tex/Spatial_sorting_ref/intro.tex @@ -7,7 +7,7 @@ \ccRefChapter{Spatial Sorting\label{chap:spatialsortingref}} -\ccChapterAuthor{Christophe Delage} +\ccChapterAuthor{Christophe Delage \and Olivier Devillers} \ccHeading{Functions} @@ -17,11 +17,27 @@ \ccHeading{Function Objects} \ccRefIdfierPage{CGAL::Multiscale_sort} \\ -\ccRefIdfierPage{CGAL::Hilbert_sort_2} \\ -\ccRefIdfierPage{CGAL::Hilbert_sort_3} \\ +\ccRefIdfierPage{CGAL::Hilbert_sort_2} \\ +\ccRefIdfierPage{CGAL::Hilbert_sort_3} \\ +\ccRefIdfierPage{CGAL::Hilbert_sort_d} \\ + +\ccHeading{Traits classes} +\ccRefIdfierPage{CGAL::Spatial_sort_traits_adapter_2} \\ +\ccRefIdfierPage{CGAL::Spatial_sort_traits_adapter_3} \\ +\ccRefIdfierPage{CGAL::Spatial_sort_traits_adapter_d} \\ \ccHeading{Concepts} \ccRefIdfierPage{SpatialSortingTraits_2} \\ \ccRefIdfierPage{SpatialSortingTraits_3} \\ +\ccRefIdfierPage{SpatialSortingTraits_d} \\ + + +\ccHeading{Utilities} + +\ccRefIdfierPage{CGAL::Median}\\ +\ccRefIdfierPage{CGAL::Middle}\\ +\ccRefIdfierPage{CGAL::Hilbert_policy}\\ +\ccRefIdfierPage{CGAL::Hilbert_sort_median_policy}\\ +\ccRefIdfierPage{CGAL::Hilbert_sort_middle_policy} diff --git a/Spatial_sorting/doc_tex/Spatial_sorting_ref/main.tex b/Spatial_sorting/doc_tex/Spatial_sorting_ref/main.tex index 1b92cc657c0..dc005400549 100644 --- a/Spatial_sorting/doc_tex/Spatial_sorting_ref/main.tex +++ b/Spatial_sorting/doc_tex/Spatial_sorting_ref/main.tex @@ -13,6 +13,12 @@ \input{Spatial_sorting_ref/Hilbert_sort_2.tex} \input{Spatial_sorting_ref/SpatialSortingTraits_3.tex} \input{Spatial_sorting_ref/Hilbert_sort_3.tex} +\input{Spatial_sorting_ref/SpatialSortingTraits_d.tex} +\input{Spatial_sorting_ref/Hilbert_sort_d.tex} \input{Spatial_sorting_ref/Multiscale_sort.tex} +\input{Spatial_sorting_ref/Hilbert_policy_tags.tex} +\input{Spatial_sorting_ref/Spatial_sort_traits_adapter_2.tex} +\input{Spatial_sorting_ref/Spatial_sort_traits_adapter_3.tex} +\input{Spatial_sorting_ref/Spatial_sort_traits_adapter_d.tex} %% EOF diff --git a/Spatial_sorting/doc_tex/Spatial_sorting_ref/spatial_sort.tex b/Spatial_sorting/doc_tex/Spatial_sorting_ref/spatial_sort.tex index fe348ab6aa5..3a88692347a 100644 --- a/Spatial_sorting/doc_tex/Spatial_sorting_ref/spatial_sort.tex +++ b/Spatial_sorting/doc_tex/Spatial_sorting_ref/spatial_sort.tex @@ -23,28 +23,50 @@ of being close in the order. \ccInclude{CGAL/spatial_sort.h} -\ccGlobalFunction{template +\ccGlobalFunction{template void spatial_sort( RandomAccessIterator begin, RandomAccessIterator end, - const Traits& traits = Default_traits);}% + const Traits& traits = Default_traits, + PolicyTag policy = Default_policy, + std::ptrdiff_t threshold_hilbert=default, + std::ptrdiff_t threshold_multiscale=default, + double ratio=default);}% {sorts the range [\ccc{begin},\ccc{end}) in place.} The default traits class \ccc{Default_traits} is the kernel in which the type \ccc{RandomAccessIterator::value_type} is defined. +The default policy is \ccc{Hilbert_sort_median_policy()} and the +other option is \ccc{Hilbert_sort_middle_policy()}. + +The default values for the thresholds and the ratio depends on the dimension. + + \ccHeading{Requirements} \begin{enumerate} \item \ccc{RandomAccessIterator::value_type} is convertible to -\ccc{Traits::Point_2} or \ccc{Traits::Point_3}. -\item \ccc{Traits} is a model for concept \ccc{SpatialSortingTraits_2} or \ccc{SpatialSortingTraits_3}. +\ccc{Traits::Point_2}, \ccc{Traits::Point_3}, or \ccc{Traits::Point_d}. +\item \ccc{Traits} is a model for concept \ccc{SpatialSortingTraits_2}, + \ccc{SpatialSortingTraits_3}, or \ccc{SpatialSortingTraits_d}. \end{enumerate} \ccImplementation -Creates an instance of \ccc{Multiscale_sort>} -or \ccc{Multiscale_sort>} and calls its \ccc{operator()}. +Creates an instance of \ccc{Multiscale_sort} +where \ccStyle{Hilbert_sort} is an Hilbert sorting object, +and calls its \ccc{operator()}. + +The \ccStyle{threshold_hilbert} is the minimal size of a point set to be +subdivided recursively during Hilbert sorting, otherwise random order is used. + The \ccStyle{threshold_multiscale} value is the minimal size for a sample to +call Hilbert sort, otherwise random order is used. +The \ccStyle{ratio} value is used to split the original set in two subsets, +spatial sort is applied on the first subset of size +\ccStyle{ratio} +times the original size of the set, Hilbert sort is applied on the +second subset. %\ccc{Some_other_class}, %\ccc{some_other_function}. diff --git a/Spatial_sorting/dont_submit b/Spatial_sorting/dont_submit deleted file mode 100644 index 606782a434f..00000000000 --- a/Spatial_sorting/dont_submit +++ /dev/null @@ -1,3 +0,0 @@ -examples/Spatial_sorting/*.cmd -examples/Spatial_sorting/data/input.cin -examples/Spatial_sorting/data diff --git a/Spatial_sorting/examples/Spatial_sorting/data/input.cin b/Spatial_sorting/examples/Spatial_sorting/data/input.cin deleted file mode 100644 index 2299ded9baf..00000000000 --- a/Spatial_sorting/examples/Spatial_sorting/data/input.cin +++ /dev/null @@ -1,8 +0,0 @@ -1 0 -3 2 -4 5 -9 8 -7 4 -5 2 -6 3 -10 1 diff --git a/Spatial_sorting/examples/Spatial_sorting/example_delaunay_2.cmd b/Spatial_sorting/examples/Spatial_sorting/example_delaunay_2.cmd deleted file mode 100644 index d391bf0a1c3..00000000000 --- a/Spatial_sorting/examples/Spatial_sorting/example_delaunay_2.cmd +++ /dev/null @@ -1 +0,0 @@ -< data/input.cin \ No newline at end of file diff --git a/Spatial_sorting/examples/Spatial_sorting/example_delaunay_2.cpp b/Spatial_sorting/examples/Spatial_sorting/example_delaunay_2.cpp index 42994ea2baf..e421604778f 100644 --- a/Spatial_sorting/examples/Spatial_sorting/example_delaunay_2.cpp +++ b/Spatial_sorting/examples/Spatial_sorting/example_delaunay_2.cpp @@ -1,6 +1,9 @@ #include #include #include +#include +#include +#include #include #include @@ -9,31 +12,68 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef CGAL::Delaunay_triangulation_2 DT; +typedef K::Point_2 Point; +typedef CGAL::Creator_uniform_2 Creator_2; + +void compute_delaunay(std::vector::iterator it, + std::vector::iterator e){ + DT dt; + DT::Face_handle hint; + for( ;it!=e; ++it) hint = dt.insert(*it, hint)->face(); + return; +} + +void test_orders(std::vector::iterator b, + std::vector::iterator e){ + CGAL::Timer cost; + + cost.reset();cost.start(); + std::cout << " Delaunay without spatial sort... "<< std::flush; + compute_delaunay(b,e);cost.stop(); + std::cout << "done in "< v; +{ int size1 = 1000,size2=100000; + std::vector v,w; + v.reserve(size1);w.reserve(size2); - std::cout << "Reading..." << std::endl; - std::istream_iterator begin(std::cin), end; - std::copy(begin, end, std::back_inserter(v)); + std::cout <::const_iterator p = v.begin(); p != v.end(); ++p) - f = dt.insert(*p, f)->face(); - - std::cout << "Delaunay is_valid()..." << std::endl; - dt.is_valid(); - - std::cout << "Ok." << std::endl; - - return 0; + CGAL::Random random (42); + CGAL::Random_points_in_square_2 gen (1.0, random); + std::cout < +#include +#include +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef K::Point_2 Point; +typedef CGAL::Creator_uniform_2 Creator; + +int main () +{ + std::size_t size = 16; + std::vector v; v.reserve(size); + CGAL::points_on_square_grid_2(3.0, size, // generate points + std::back_inserter(v), Creator()); + + CGAL::hilbert_sort (v.begin(), v.end()); // sort + + for(std::size_t i=0; i +#include +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef K::Point_2 Point; + +int main () +{ + std::vector v; v.reserve(4); + v.push_back( Point(0.0,0.0)) ; + v.push_back( Point(1.0,1.0)) ; + v.push_back( Point(0.1,0.1)) ; + v.push_back( Point(0.2,0.8)) ; + + std::cout << "Hilbert sort (middle policy)." << std::endl; + CGAL::hilbert_sort (v.begin(), v.end(), CGAL::Hilbert_sort_middle_policy()); + std::cout< points; - points[0] = MyPoint(78,12); - points[1] = MyPoint(3,121); + points.push_back(MyPoint(14,12, 3)); + points.push_back(MyPoint(1,2 , 0)); + points.push_back(MyPoint(414,2, 5)); + points.push_back(MyPoint(4,21 , 1)); + points.push_back(MyPoint(7,74 , 2)); + points.push_back(MyPoint(74,4 , 4)); + MySpatialSortingTraits sst; - CGAL::spatial_sort(points, points+2, sst); + CGAL::spatial_sort(points.begin(), points.end(), sst); + + for (std::vector< MyPoint >::iterator it=points.begin();it!=points.end();++it) + std::cout << it->color << " "; + std::cout << "\n"; + std::cerr << "done" << std::endl; return 0; } diff --git a/Spatial_sorting/examples/Spatial_sorting/small_example_delaunay_2.cpp b/Spatial_sorting/examples/Spatial_sorting/small_example_delaunay_2.cpp new file mode 100644 index 00000000000..a38465e54ae --- /dev/null +++ b/Spatial_sorting/examples/Spatial_sorting/small_example_delaunay_2.cpp @@ -0,0 +1,40 @@ +#include +#include +#include +#include +#include +#include +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef CGAL::Delaunay_triangulation_2 DT; +void compute_delaunay(std::vector::iterator it, + std::vector::iterator e){ + DT dt; + DT::Face_handle hint; + for( ;it!=e; ++it) hint = dt.insert(*it, hint)->face(); +} +int main () +{ int size = 1000; + std::vector v; + v.reserve(size); + CGAL::Timer cost; + std::cout < +#include #include - - -typedef CGAL::Simple_cartesian K; -typedef K::Point_2 Point_2; -typedef std::vector::iterator Point_iterator; - - - +#include +// Below is a traits class that allow to dereference before comparing +// coordinates. Requirements are to define in the traits class : +// Point_2, Less_x_2, less_x_2_object, Less_y_2, and less_y_2_object template -struct Sort_traits_2 { - +struct Dereference_traits_2 { Kernel k; - - Sort_traits_2 (const Kernel &kernel = Kernel()) - : k (kernel) - {} - + Dereference_traits_2 (const Kernel &kernel = Kernel()) : k (kernel) {} typedef Iterator Point_2; - struct Less_x_2 { Kernel k; - Less_x_2 (const Kernel &kernel = Kernel()) - : k (kernel) - {} + Less_x_2 (const Kernel &kernel = Kernel()): k (kernel) {} bool operator() (const Point_2 &p, const Point_2 &q) const - { + { // dereference then compare return k.less_x_2_object() (*p, *q); } }; - - Less_x_2 - less_x_2_object() const - { - return Less_x_2(k); - } - - struct Less_y_2 { + Less_x_2 less_x_2_object() const { return Less_x_2(k); } + struct Less_y_2 { // Same stuff for y direction Kernel k; - Less_y_2 (const Kernel &kernel = Kernel()) - : k (kernel) - {} - bool operator() (const Point_2 &p, const Point_2 &q) const - { - return k.less_y_2_object() (*p, *q); - } + Less_y_2 (const Kernel &kernel = Kernel()): k (kernel) {} + bool operator() (const Point_2 &p, const Point_2 &q) const + { return k.less_y_2_object() (*p, *q); } }; - - - Less_y_2 - less_y_2_object() const - { - return Less_y_2(k); - } + Less_y_2 less_y_2_object() const { return Less_y_2(k); } }; - - -typedef CGAL::Hilbert_sort_2 > Hilbert_sort_2; -typedef CGAL::Multiscale_sort Spatial_sort_2; - - - - +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef K::Point_2 Point; +typedef std::vector::iterator Point_it; +typedef CGAL::Hilbert_sort_2, + CGAL::Hilbert_sort_median_policy > H_sort; +typedef CGAL::Multiscale_sort My_sort; int main () { - Spatial_sort_2 sort_2; + My_sort my_sort; + std::size_t size = 10; + std::vector points; points.reserve(size); + std::vector iterators; iterators.reserve(size); + CGAL::Random_points_in_square_2 gen (10.0); - std::vector points; - std::vector iterators; - - Point_2 p; - while(std::cin >> p){ - points.push_back(p); - } - - iterators.reserve(points.size()); - for(Point_iterator it = points.begin(); it != points.end(); ++it){ + for (std::size_t i = 0; i < size; ++i) points.push_back (*gen++); + for(Point_it it = points.begin(); it != points.end(); ++it) iterators.push_back(it); - } - - sort_2(iterators.begin(), iterators.end()); - - for(std::vector::iterator i = iterators.begin(); - i != iterators.end(); i++) - { - std::cout << **i << std::endl; - } - + my_sort(iterators.begin(), iterators.end()); + for(std::vector::iterator i = iterators.begin(); + i != iterators.end(); i++) std::cout << **i << std::endl; return 0; } diff --git a/Spatial_sorting/examples/Spatial_sorting/sp_sort_using_property_map_2.cpp b/Spatial_sorting/examples/Spatial_sorting/sp_sort_using_property_map_2.cpp new file mode 100644 index 00000000000..cffcfd2f980 --- /dev/null +++ b/Spatial_sorting/examples/Spatial_sorting/sp_sort_using_property_map_2.cpp @@ -0,0 +1,46 @@ +#include +#include +#include +#include + +typedef CGAL::Simple_cartesian Kernel; +typedef Kernel::Point_2 Point_2; +typedef std::pair Point_with_info; +typedef std::vector< Point_with_info > Data_vector; + +//property map +struct First_of_pair{ + //classical typedefs + typedef Point_with_info key_type; + typedef Point_2 value_type; + typedef const Point_2& reference; + typedef boost::readable_property_map_tag category; +}; +//get function for property map +First_of_pair::reference +get(const First_of_pair&, const First_of_pair::key_type& k) { + return k.first; +} + +typedef CGAL::Spatial_sort_traits_adapter_2 Search_traits_2; + +int main() +{ + Data_vector points; + points.push_back(std::make_pair(Point_2(14,12) , 3)); + points.push_back(std::make_pair(Point_2(1,2) , 0)); + points.push_back(std::make_pair(Point_2(414,2) , 5)); + points.push_back(std::make_pair(Point_2(4,21) , 1)); + points.push_back(std::make_pair(Point_2(7,74) , 2)); + points.push_back(std::make_pair(Point_2(74,4) , 4)); + + Search_traits_2 traits; + CGAL::spatial_sort(points.begin(), points.end(), traits); + for (Data_vector::iterator it=points.begin();it!=points.end();++it) + std::cout << it->second << " "; + std::cout << "\n"; + + std::cout << "done" << std::endl; + + return 0; +} diff --git a/Spatial_sorting/examples/Spatial_sorting/sp_sort_using_property_map_3.cpp b/Spatial_sorting/examples/Spatial_sorting/sp_sort_using_property_map_3.cpp new file mode 100644 index 00000000000..ab48feafc9f --- /dev/null +++ b/Spatial_sorting/examples/Spatial_sorting/sp_sort_using_property_map_3.cpp @@ -0,0 +1,38 @@ +#include +#include +#include +#include +#include + +typedef CGAL::Simple_cartesian Kernel; +typedef Kernel::Point_3 Point_3; +//using a pointer as a special property map type +typedef + CGAL::Spatial_sort_traits_adapter_3 Search_traits_3; + +int main() +{ + std::vector points; + points.push_back(Point_3(1,3,11)); + points.push_back(Point_3(14,34,46)); + points.push_back(Point_3(414,34,4)); + points.push_back(Point_3(4,2,56)); + points.push_back(Point_3(744,4154,43)); + points.push_back(Point_3(74,44,1)); + + std::vector indices; + indices.reserve(points.size()); + + std::copy(boost::counting_iterator(0), + boost::counting_iterator(points.size()), + std::back_inserter(indices)); + + CGAL::spatial_sort( indices.begin(),indices.end(),Search_traits_3(&(points[0])) ); + + for (std::vector::iterator it=indices.begin();it!=indices.end();++it) + std::cout << points[*it] << "\n"; + + std::cout << "done" << std::endl; + + return 0; +} diff --git a/Spatial_sorting/examples/Spatial_sorting/sp_sort_using_property_map_d.cpp b/Spatial_sorting/examples/Spatial_sorting/sp_sort_using_property_map_d.cpp new file mode 100644 index 00000000000..64aa5fdf48f --- /dev/null +++ b/Spatial_sorting/examples/Spatial_sorting/sp_sort_using_property_map_d.cpp @@ -0,0 +1,62 @@ +#include +#include +#include +#include +#include + +typedef CGAL::Cartesian_d Kernel; +typedef Kernel::Point_d Point_d; +typedef std::pair Point_with_info; +typedef std::vector< Point_with_info > Data_vector; + +//property map and get as friend +// to be allowed to use private member +class Vect_ppmap{ + const Data_vector& points; +public: + //classical typedefs + typedef Data_vector::size_type key_type; + typedef Point_d value_type; + typedef const value_type& reference; + typedef boost::readable_property_map_tag category; + + Vect_ppmap(const Data_vector& points_):points(points_){} + + friend reference get(const Vect_ppmap& vmap, key_type i) { + return vmap.points[i].first; + } +}; + +typedef CGAL::Spatial_sort_traits_adapter_d Search_traits_d; + +int main() +{ + double coords[] ={ 1.0, 1.0, 1.0, 1.0, + 2.0, 2.0, 2.0, 2.0 }; + + Data_vector points; + points.push_back(std::make_pair(Point_d(4,coords ,coords+4) , 1)); + points.push_back(std::make_pair(Point_d(4,coords+4,coords+8) , 2)); + + std::vector indices; + indices.reserve(points.size()); + + std::copy( + boost::counting_iterator(0), + boost::counting_iterator(points.size()), + std::back_inserter(indices) ); + + CGAL::spatial_sort( + indices.begin(), + indices.end(), + Search_traits_d(Vect_ppmap(points)) ); + + std::vector::iterator it=indices.begin(); + for (;it!=indices.end();++it) + std::cout << points[*it].second << " "; + std::cout << std::endl; + + std::cout << "done" << std::endl; + + return 0; +} diff --git a/Spatial_sorting/include/CGAL/Hilbert_policy_tags.h b/Spatial_sorting/include/CGAL/Hilbert_policy_tags.h new file mode 100644 index 00000000000..3297a507966 --- /dev/null +++ b/Spatial_sorting/include/CGAL/Hilbert_policy_tags.h @@ -0,0 +1,40 @@ +// Copyright (c) 2011 INRIA Sophia-Antipolis (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; version 2.1 of the License. +// See the file LICENSE.LGPL distributed with CGAL. +// +// 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) : Olivier Devillers + +#ifndef CGAL_HILBERT_POLICY_H +#define CGAL_HILBERT_POLICY_H + + +namespace CGAL { + +struct Middle {}; +struct Median {}; + + +// A policy to select the sorting strategy. + +template < typename Tag > +struct Hilbert_policy {}; + +typedef Hilbert_policy Hilbert_sort_middle_policy; +typedef Hilbert_policy Hilbert_sort_median_policy; + +} // namespace CGAL + +#endif // CGAL_HILBERT_POLICY_H diff --git a/Spatial_sorting/include/CGAL/Hilbert_sort_2.h b/Spatial_sorting/include/CGAL/Hilbert_sort_2.h index 2f1a8d8065d..021b105c7fd 100644 --- a/Spatial_sorting/include/CGAL/Hilbert_sort_2.h +++ b/Spatial_sorting/include/CGAL/Hilbert_sort_2.h @@ -1,4 +1,4 @@ -// Copyright (c) 2007 INRIA Sophia-Antipolis (France). +// Copyright (c) 2011 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org); you can redistribute it and/or @@ -15,108 +15,40 @@ // $URL$ // $Id$ // -// Author(s) : Christophe Delage +// Author(s) : Olivier Devillers #ifndef CGAL_HILBERT_SORT_2_H #define CGAL_HILBERT_SORT_2_H -#include -#include -#include -#include +#include +#include +#include namespace CGAL { -namespace internal { - template struct Hilbert_cmp_2; +template + class Hilbert_sort_2; - template - struct Hilbert_cmp_2 - : public std::binary_function - { - typedef typename K::Point_2 Point; - K k; - Hilbert_cmp_2 (const K &_k = K()) : k(_k) {} - bool operator() (const Point &p, const Point &q) const - { - return Hilbert_cmp_2 (k) (q, p); - } - }; - - template - struct Hilbert_cmp_2 - : public std::binary_function - { - typedef typename K::Point_2 Point; - K k; - Hilbert_cmp_2 (const K &_k = K()) : k(_k) {} - bool operator() (const Point &p, const Point &q) const - { - return k.less_x_2_object() (p, q); - } - }; - - template - struct Hilbert_cmp_2 - : public std::binary_function - { - typedef typename K::Point_2 Point; - K k; - Hilbert_cmp_2 (const K &_k = K()) : k(_k) {} - bool operator() (const Point &p, const Point &q) const - { - return k.less_y_2_object() (p, q); - } - }; -} - -template -class Hilbert_sort_2 +template + class Hilbert_sort_2 + : public Hilbert_sort_median_2 { -public: - typedef K Kernel; - typedef typename Kernel::Point_2 Point; - -private: - Kernel _k; - std::ptrdiff_t _limit; - - template struct Cmp : public internal::Hilbert_cmp_2 - { Cmp (const Kernel &k) : internal::Hilbert_cmp_2 (k) {} }; - -public: - Hilbert_sort_2 (const Kernel &k = Kernel(), std::ptrdiff_t limit = 1) - : _k(k), _limit (limit) + public: + Hilbert_sort_2 (const K &k=K() , std::ptrdiff_t limit=1 ) + : Hilbert_sort_median_2 (k,limit) {} - - template - void sort (RandomAccessIterator begin, RandomAccessIterator end) const - { - const int y = (x + 1) % 2; - if (end - begin <= _limit) return; - - RandomAccessIterator m0 = begin, m4 = end; - - RandomAccessIterator m2 = internal::hilbert_split (m0, m4, Cmp< x, upx> (_k)); - RandomAccessIterator m1 = internal::hilbert_split (m0, m2, Cmp< y, upy> (_k)); - RandomAccessIterator m3 = internal::hilbert_split (m2, m4, Cmp< y, !upy> (_k)); - - sort (m0, m1); - sort (m1, m2); - sort (m2, m3); - sort (m3, m4); - } - - template - void operator() (RandomAccessIterator begin, RandomAccessIterator end) const - { - sort <0, false, false> (begin, end); - } }; -} //namespace CGAL +template + class Hilbert_sort_2 + : public Hilbert_sort_middle_2 +{ + public: + Hilbert_sort_2 (const K &k=K() , std::ptrdiff_t limit=1 ) + : Hilbert_sort_middle_2 (k,limit) + {} +}; + +} // namespace CGAL #endif//CGAL_HILBERT_SORT_2_H diff --git a/Spatial_sorting/include/CGAL/Hilbert_sort_3.h b/Spatial_sorting/include/CGAL/Hilbert_sort_3.h index 68d606db2a9..76f100f1931 100644 --- a/Spatial_sorting/include/CGAL/Hilbert_sort_3.h +++ b/Spatial_sorting/include/CGAL/Hilbert_sort_3.h @@ -1,4 +1,4 @@ -// Copyright (c) 2007 INRIA Sophia-Antipolis (France). +// Copyright (c) 2011 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org); you can redistribute it and/or @@ -15,130 +15,40 @@ // $URL$ // $Id$ // -// Author(s) : Christophe Delage +// Author(s) : Olivier Devillers #ifndef CGAL_HILBERT_SORT_3_H #define CGAL_HILBERT_SORT_3_H -#include -#include -#include -#include +#include +#include +#include namespace CGAL { -namespace internal { - template struct Hilbert_cmp_3; +template + class Hilbert_sort_3; - template - struct Hilbert_cmp_3 - : public std::binary_function - { - typedef typename K::Point_3 Point; - K k; - Hilbert_cmp_3 (const K &_k = K()) : k(_k) {} - bool operator() (const Point &p, const Point &q) const - { - return Hilbert_cmp_3 (k) (q, p); - } - }; - - template - struct Hilbert_cmp_3 - : public std::binary_function - { - typedef typename K::Point_3 Point; - K k; - Hilbert_cmp_3 (const K &_k = K()) : k(_k) {} - bool operator() (const Point &p, const Point &q) const - { - return k.less_x_3_object() (p, q); - } - }; - - template - struct Hilbert_cmp_3 - : public std::binary_function - { - typedef typename K::Point_3 Point; - K k; - Hilbert_cmp_3 (const K &_k = K()) : k(_k) {} - bool operator() (const Point &p, const Point &q) const - { - return k.less_y_3_object() (p, q); - } - }; - - template - struct Hilbert_cmp_3 - : public std::binary_function - { - typedef typename K::Point_3 Point; - K k; - Hilbert_cmp_3 (const K &_k = K()) : k(_k) {} - bool operator() (const Point &p, const Point &q) const - { - return k.less_z_3_object() (p, q); - } - }; -} - -template -class Hilbert_sort_3 +template + class Hilbert_sort_3 + : public Hilbert_sort_median_3 { -public: - typedef K Kernel; - typedef typename Kernel::Point_3 Point; - -private: - Kernel _k; - std::ptrdiff_t _limit; - - template struct Cmp : public internal::Hilbert_cmp_3 - { Cmp (const Kernel &k) : internal::Hilbert_cmp_3 (k) {} }; - -public: - Hilbert_sort_3 (const Kernel &k = Kernel(), std::ptrdiff_t limit = 1) - : _k(k), _limit (limit) + public: + Hilbert_sort_3 (const K &k=K() , std::ptrdiff_t limit=1 ) + : Hilbert_sort_median_3 (k,limit) {} - - template - void sort (RandomAccessIterator begin, RandomAccessIterator end) const - { - const int y = (x + 1) % 3, z = (x + 2) % 3; - if (end - begin <= _limit) return; - - RandomAccessIterator m0 = begin, m8 = end; - - RandomAccessIterator m4 = internal::hilbert_split (m0, m8, Cmp< x, upx> (_k)); - RandomAccessIterator m2 = internal::hilbert_split (m0, m4, Cmp< y, upy> (_k)); - RandomAccessIterator m1 = internal::hilbert_split (m0, m2, Cmp< z, upz> (_k)); - RandomAccessIterator m3 = internal::hilbert_split (m2, m4, Cmp< z, !upz> (_k)); - RandomAccessIterator m6 = internal::hilbert_split (m4, m8, Cmp< y, !upy> (_k)); - RandomAccessIterator m5 = internal::hilbert_split (m4, m6, Cmp< z, upz> (_k)); - RandomAccessIterator m7 = internal::hilbert_split (m6, m8, Cmp< z, !upz> (_k)); - - sort (m0, m1); - sort (m1, m2); - sort (m2, m3); - sort (m3, m4); - sort (m4, m5); - sort (m5, m6); - sort (m6, m7); - sort (m7, m8); - } - - template - void operator() (RandomAccessIterator begin, RandomAccessIterator end) const - { - sort <0, false, false, false> (begin, end); - } }; -} //namespace CGAL +template + class Hilbert_sort_3 + : public Hilbert_sort_middle_3 +{ + public: + Hilbert_sort_3 (const K &k=K() , std::ptrdiff_t limit=1 ) + : Hilbert_sort_middle_3 (k,limit) + {} +}; + +} // namespace CGAL #endif//CGAL_HILBERT_SORT_3_H diff --git a/Spatial_sorting/include/CGAL/Hilbert_sort_base.h b/Spatial_sorting/include/CGAL/Hilbert_sort_base.h index 6924700098d..462e989730f 100644 --- a/Spatial_sorting/include/CGAL/Hilbert_sort_base.h +++ b/Spatial_sorting/include/CGAL/Hilbert_sort_base.h @@ -40,6 +40,6 @@ namespace internal { } } -} //namespace CGAL +} // namespace CGAL #endif//CGAL_HILBERT_SORT_BASE_H diff --git a/Spatial_sorting/include/CGAL/Hilbert_sort_d.h b/Spatial_sorting/include/CGAL/Hilbert_sort_d.h new file mode 100644 index 00000000000..aacfcdf8cf1 --- /dev/null +++ b/Spatial_sorting/include/CGAL/Hilbert_sort_d.h @@ -0,0 +1,54 @@ +// Copyright (c) 2011 INRIA Sophia-Antipolis (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; version 2.1 of the License. +// See the file LICENSE.LGPL distributed with CGAL. +// +// 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: svn+ssh://odevil@scm.gforge.inria.fr/svn/cgal/trunk/Spatial_sorting/include/CGAL/Hilbert_sort_d.h $ +// $Id: Hilbert_sort_d.h 51456 2009-08-24 17:10:04Z spion $ +// +// Author(s) : Olivier Devillers + +#ifndef CGAL_HILBERT_SORT_d_H +#define CGAL_HILBERT_SORT_d_H + +#include +#include +#include + +namespace CGAL { + +template + class Hilbert_sort_d; + +template + class Hilbert_sort_d + : public Hilbert_sort_median_d +{ + public: + Hilbert_sort_d (const K &k=K() , std::ptrdiff_t limit=1 ) + : Hilbert_sort_median_d (k,limit) + {} +}; + +template + class Hilbert_sort_d + : public Hilbert_sort_middle_d +{ + public: + Hilbert_sort_d (const K &k=K() , std::ptrdiff_t limit=1 ) + : Hilbert_sort_middle_d (k,limit) + {} +}; + +} // namespace CGAL + +#endif//CGAL_HILBERT_SORT_d_H diff --git a/Spatial_sorting/include/CGAL/Hilbert_sort_median_2.h b/Spatial_sorting/include/CGAL/Hilbert_sort_median_2.h new file mode 100644 index 00000000000..832a54f19e6 --- /dev/null +++ b/Spatial_sorting/include/CGAL/Hilbert_sort_median_2.h @@ -0,0 +1,122 @@ +// Copyright (c) 2007 INRIA Sophia-Antipolis (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; version 2.1 of the License. +// See the file LICENSE.LGPL distributed with CGAL. +// +// 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: svn+ssh://odevil@scm.gforge.inria.fr/svn/cgal/trunk/Spatial_sorting/include/CGAL/Hilbert_sort_2.h $ +// $Id: Hilbert_sort_2.h 51456 2009-08-24 17:10:04Z spion $ +// +// Author(s) : Christophe Delage + +#ifndef CGAL_HILBERT_SORT_MEDIAN_2_H +#define CGAL_HILBERT_SORT_MEDIAN_2_H + +#include +#include +#include +#include + +namespace CGAL { + +namespace internal { + template struct Hilbert_cmp_2; + + template + struct Hilbert_cmp_2 + : public std::binary_function + { + typedef typename K::Point_2 Point; + K k; + Hilbert_cmp_2 (const K &_k = K()) : k(_k) {} + bool operator() (const Point &p, const Point &q) const + { + return Hilbert_cmp_2 (k) (q, p); + } + }; + + template + struct Hilbert_cmp_2 + : public std::binary_function + { + typedef typename K::Point_2 Point; + K k; + Hilbert_cmp_2 (const K &_k = K()) : k(_k) {} + bool operator() (const Point &p, const Point &q) const + { + return k.less_x_2_object() (p, q); + } + }; + + template + struct Hilbert_cmp_2 + : public std::binary_function + { + typedef typename K::Point_2 Point; + K k; + Hilbert_cmp_2 (const K &_k = K()) : k(_k) {} + bool operator() (const Point &p, const Point &q) const + { + return k.less_y_2_object() (p, q); + } + }; +} + +template +class Hilbert_sort_median_2 +{ +public: + typedef K Kernel; + typedef typename Kernel::Point_2 Point; + +private: + Kernel _k; + std::ptrdiff_t _limit; + + template struct Cmp : public internal::Hilbert_cmp_2 + { Cmp (const Kernel &k) : internal::Hilbert_cmp_2 (k) {} }; + +public: + Hilbert_sort_median_2 (const Kernel &k = Kernel(), std::ptrdiff_t limit = 1) + : _k(k), _limit (limit) + {} + + template + void sort (RandomAccessIterator begin, RandomAccessIterator end) const + { + const int y = (x + 1) % 2; + if (end - begin <= _limit) return; + + RandomAccessIterator m0 = begin, m4 = end; + + RandomAccessIterator m2 = internal::hilbert_split (m0, m4, Cmp< x, upx> (_k)); + RandomAccessIterator m1 = internal::hilbert_split (m0, m2, Cmp< y, upy> (_k)); + RandomAccessIterator m3 = internal::hilbert_split (m2, m4, Cmp< y, !upy> (_k)); + + sort (m0, m1); + sort (m1, m2); + sort (m2, m3); + sort (m3, m4); + } + + template + void operator() (RandomAccessIterator begin, RandomAccessIterator end) const + { + sort <0, false, false> (begin, end); + } +}; + +} // namespace CGAL + +#endif//CGAL_HILBERT_SORT_MEDIAN_2_H diff --git a/Spatial_sorting/include/CGAL/Hilbert_sort_median_3.h b/Spatial_sorting/include/CGAL/Hilbert_sort_median_3.h new file mode 100644 index 00000000000..33b64a20eb8 --- /dev/null +++ b/Spatial_sorting/include/CGAL/Hilbert_sort_median_3.h @@ -0,0 +1,144 @@ +// Copyright (c) 2007 INRIA Sophia-Antipolis (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; version 2.1 of the License. +// See the file LICENSE.LGPL distributed with CGAL. +// +// 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: svn+ssh://odevil@scm.gforge.inria.fr/svn/cgal/trunk/Spatial_sorting/include/CGAL/Hilbert_sort_3.h $ +// $Id: Hilbert_sort_3.h 51456 2009-08-24 17:10:04Z spion $ +// +// Author(s) : Christophe Delage + +#ifndef CGAL_HILBERT_SORT_MEDIAN_3_H +#define CGAL_HILBERT_SORT_MEDIAN_3_H + +#include +#include +#include +#include + +namespace CGAL { + +namespace internal { + template struct Hilbert_cmp_3; + + template + struct Hilbert_cmp_3 + : public std::binary_function + { + typedef typename K::Point_3 Point; + K k; + Hilbert_cmp_3 (const K &_k = K()) : k(_k) {} + bool operator() (const Point &p, const Point &q) const + { + return Hilbert_cmp_3 (k) (q, p); + } + }; + + template + struct Hilbert_cmp_3 + : public std::binary_function + { + typedef typename K::Point_3 Point; + K k; + Hilbert_cmp_3 (const K &_k = K()) : k(_k) {} + bool operator() (const Point &p, const Point &q) const + { + return k.less_x_3_object() (p, q); + } + }; + + template + struct Hilbert_cmp_3 + : public std::binary_function + { + typedef typename K::Point_3 Point; + K k; + Hilbert_cmp_3 (const K &_k = K()) : k(_k) {} + bool operator() (const Point &p, const Point &q) const + { + return k.less_y_3_object() (p, q); + } + }; + + template + struct Hilbert_cmp_3 + : public std::binary_function + { + typedef typename K::Point_3 Point; + K k; + Hilbert_cmp_3 (const K &_k = K()) : k(_k) {} + bool operator() (const Point &p, const Point &q) const + { + return k.less_z_3_object() (p, q); + } + }; +} + +template +class Hilbert_sort_median_3 +{ +public: + typedef K Kernel; + typedef typename Kernel::Point_3 Point; + +private: + Kernel _k; + std::ptrdiff_t _limit; + + template struct Cmp : public internal::Hilbert_cmp_3 + { Cmp (const Kernel &k) : internal::Hilbert_cmp_3 (k) {} }; + +public: + Hilbert_sort_median_3 (const Kernel &k = Kernel(), std::ptrdiff_t limit = 1) + : _k(k), _limit (limit) + {} + + template + void sort (RandomAccessIterator begin, RandomAccessIterator end) const + { + const int y = (x + 1) % 3, z = (x + 2) % 3; + if (end - begin <= _limit) return; + + RandomAccessIterator m0 = begin, m8 = end; + + RandomAccessIterator m4 = internal::hilbert_split (m0, m8, Cmp< x, upx> (_k)); + RandomAccessIterator m2 = internal::hilbert_split (m0, m4, Cmp< y, upy> (_k)); + RandomAccessIterator m1 = internal::hilbert_split (m0, m2, Cmp< z, upz> (_k)); + RandomAccessIterator m3 = internal::hilbert_split (m2, m4, Cmp< z, !upz> (_k)); + RandomAccessIterator m6 = internal::hilbert_split (m4, m8, Cmp< y, !upy> (_k)); + RandomAccessIterator m5 = internal::hilbert_split (m4, m6, Cmp< z, upz> (_k)); + RandomAccessIterator m7 = internal::hilbert_split (m6, m8, Cmp< z, !upz> (_k)); + + sort (m0, m1); + sort (m1, m2); + sort (m2, m3); + sort (m3, m4); + sort (m4, m5); + sort (m5, m6); + sort (m6, m7); + sort (m7, m8); + } + + template + void operator() (RandomAccessIterator begin, RandomAccessIterator end) const + { + sort <0, false, false, false> (begin, end); + } +}; + +} // namespace CGAL + +#endif//CGAL_HILBERT_SORT_MEDIAN_3_H diff --git a/Spatial_sorting/include/CGAL/Hilbert_sort_median_d.h b/Spatial_sorting/include/CGAL/Hilbert_sort_median_d.h new file mode 100644 index 00000000000..ea597cc5049 --- /dev/null +++ b/Spatial_sorting/include/CGAL/Hilbert_sort_median_d.h @@ -0,0 +1,167 @@ +// Copyright (c) 2011 INRIA Sophia-Antipolis (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; version 2.1 of the License. +// See the file LICENSE.LGPL distributed with CGAL. +// +// 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) : Olivier Devillers + +#ifndef CGAL_HILBERT_SORT_MEDIAN_d_H +#define CGAL_HILBERT_SORT_MEDIAN_d_H + +#include +#include +#include +#include +#include + +namespace CGAL { + +namespace internal { + + template + struct Hilbert_cmp_d + : public std::binary_function + { + typedef typename K::Point_d Point; + K k; + int axe; + bool orient; + Hilbert_cmp_d (int a, bool o, const K &_k = K()) + : k(_k), axe(a), orient(o) {} + bool operator() (const Point &p, const Point &q) const + { + return (orient ? (k.less_coordinate_d_object() (q,p,axe) ) + : (k.less_coordinate_d_object() (p,q,axe) )); + } + }; + +} + +template +class Hilbert_sort_median_d +{ +public: + typedef K Kernel; + typedef typename Kernel::Point_d Point; + typedef std::vector< bool > Starting_position; + +private: + Kernel _k; + std::ptrdiff_t _limit; + mutable int _dimension; + mutable int two_to_dim; + + struct Cmp : public internal::Hilbert_cmp_d + { Cmp (int a, bool dir, const Kernel &k) + : internal::Hilbert_cmp_d (a,dir,k) {} }; + +public: + Hilbert_sort_median_d(const Kernel &k = Kernel(), std::ptrdiff_t limit = 1) + : _k(k), _limit (limit) + {} + + template + void sort (RandomAccessIterator begin, RandomAccessIterator end, + Starting_position start, int direction) const + { + if (end - begin <= _limit) return; + + int nb_directions = _dimension; + int nb_splits = two_to_dim; + + if ( (end-begin) < (two_to_dim/2) ) { // not many points + nb_splits = 1; + nb_directions = 0; + while ( (end-begin) > nb_splits) { + ++nb_directions; + nb_splits *= 2; // compute 2^nb_directions + } + } + + std::vector places(nb_splits +1); + std::vector dir (nb_splits +1); + places[0]=begin; + places[nb_splits]=end; + + int last_dir = (direction + nb_directions) % _dimension; + int current_dir = direction; + int current_level_step =nb_splits; + do{ + int half_step = current_level_step/2; + int left=0; + int middle = half_step; + int right=current_level_step; + bool orient = start[current_dir]; + do{ + dir[middle] = current_dir; + places[middle] = internal::hilbert_split + (places[left], places[right], Cmp (current_dir,orient,_k)); + left =right; + right+=current_level_step; + middle+=current_level_step; + orient = ! orient; + }while( left< nb_splits); + current_level_step = half_step; + current_dir = (current_dir +1) % _dimension; + }while (current_dir != last_dir); + + if ( end-begin < two_to_dim) return; // less than 2^dim points + + /////////////start recursive calls + last_dir = (direction + _dimension -1) % _dimension; + // first step is special + sort( places[0], places[1], start, last_dir); + + for(int i=1; i + void operator() (RandomAccessIterator begin, RandomAccessIterator end) const + { + _dimension = _k.point_dimension_d_object()(*begin); + two_to_dim = 1; + Starting_position start(_dimension); + + typename std::iterator_traits::difference_type N=end-begin; + N*=2; + for (int i=0; i<_dimension; ++i) start[i]=false; // we start below in all coordinates + for (int i=0; i<_dimension; ++i) { + two_to_dim *= 2; // compute 2^_dimension + N/=2; + if (N==0) break; // not many points, this number of dimension is enough + } + + + // we start with direction 0; + sort (begin, end, start, 0); + } +}; + + + + +} // namespace CGAL + +#endif//CGAL_HILBERT_SORT_MEDIAN_d_H diff --git a/Spatial_sorting/include/CGAL/Hilbert_sort_middle_2.h b/Spatial_sorting/include/CGAL/Hilbert_sort_middle_2.h new file mode 100644 index 00000000000..303b224432d --- /dev/null +++ b/Spatial_sorting/include/CGAL/Hilbert_sort_middle_2.h @@ -0,0 +1,137 @@ +// Copyright (c) 2011 INRIA Sophia-Antipolis (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; version 2.1 of the License. +// See the file LICENSE.LGPL distributed with CGAL. +// +// 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) : Olivier Devillers + +#ifndef CGAL_HILBERT_SORT_MIDDLE_2_H +#define CGAL_HILBERT_SORT_MIDDLE_2_H + +#include +#include +#include +#include +#include + +namespace CGAL { + +namespace internal { + template struct Fixed_hilbert_cmp_2; + + template + struct Fixed_hilbert_cmp_2 + : public std::binary_function + { + typedef typename K::Point_2 Point; + K k; + double value; + Fixed_hilbert_cmp_2 (double v, const K &_k = K()) : k(_k),value(v) {} + bool operator() (const Point &p) const + { + return ! Fixed_hilbert_cmp_2 (value, k) (p); + } + }; + + template + struct Fixed_hilbert_cmp_2 + : public std::binary_function + { + typedef typename K::Point_2 Point; + K k; + double value; + Fixed_hilbert_cmp_2 (double v, const K &_k = K()) : k(_k),value(v) {} + bool operator() (const Point &p) const + { + return to_double(k.compute_x_2_object()(p)) < value; + } + }; + + template + struct Fixed_hilbert_cmp_2 + : public std::binary_function + { + typedef typename K::Point_2 Point; + K k; + double value; + Fixed_hilbert_cmp_2 (double v, const K &_k = K()) : k(_k),value(v) {} + bool operator() (const Point &p) const + { + return to_double(k.compute_y_2_object()(p)) < value; + } + }; +} + + +template +class Hilbert_sort_middle_2 +{ +public: + typedef K Kernel; + typedef typename Kernel::Point_2 Point; + +private: + Kernel _k; + std::ptrdiff_t _limit; + + template struct Cmp : public internal::Fixed_hilbert_cmp_2 + { Cmp (double v, const Kernel &k) : internal::Fixed_hilbert_cmp_2 (v, k) {} }; + +public: + Hilbert_sort_middle_2 (const Kernel &k = Kernel(), std::ptrdiff_t limit = 1) + : _k(k), _limit (limit) + {} + + template + void sort (RandomAccessIterator begin, RandomAccessIterator end, + double xmin, double ymin, double xmax, double ymax) const + { + const int y = (x + 1) % 2; + if (end - begin <= _limit) return; + + double xmed= (xmin+xmax)/2; + double ymed= (ymin+ymax)/2; + + RandomAccessIterator m0 = begin, m4 = end; + + RandomAccessIterator m2 = + internal::fixed_hilbert_split (m0, m4, Cmp< x, upx> (xmed,_k)); + RandomAccessIterator m1 = + internal::fixed_hilbert_split (m0, m2, Cmp< y, upy> (ymed,_k)); + RandomAccessIterator m3 = + internal::fixed_hilbert_split (m2, m4, Cmp< y, !upy> (ymed,_k)); + + sort (m0, m1, ymin, xmin, ymed, xmed); + sort (m1, m2, xmin, ymed, xmed, ymax); + sort (m2, m3, xmed, ymed, xmax, ymax); + sort (m3, m4, ymed, xmax, ymin, xmed); + } + + template + void operator() (RandomAccessIterator begin, RandomAccessIterator end) const + { + Bbox_2 box=bbox_2(begin, end); + sort <0, false, false> (begin, end, + box.xmin(), box.ymin(), box.xmax(), box.ymax()); + } +}; + + +} // namespace CGAL + +#endif//CGAL_HILBERT_SORT_MIDDLE_2_H diff --git a/Spatial_sorting/include/CGAL/Hilbert_sort_middle_3.h b/Spatial_sorting/include/CGAL/Hilbert_sort_middle_3.h new file mode 100644 index 00000000000..5b5d6d2fd63 --- /dev/null +++ b/Spatial_sorting/include/CGAL/Hilbert_sort_middle_3.h @@ -0,0 +1,185 @@ +// Copyright (c) 2011 INRIA Sophia-Antipolis (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; version 2.1 of the License. +// See the file LICENSE.LGPL distributed with CGAL. +// +// 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) : Olivier Devillers + +#ifndef CGAL_HILBERT_SORT_MIDDLE_3_H +#define CGAL_HILBERT_SORT_MIDDLE_3_H + +#include +#include +#include +#include + +namespace CGAL { + +namespace internal { + template struct Fixed_hilbert_cmp_3; + + template + struct Fixed_hilbert_cmp_3 + : public std::binary_function + { + typedef typename K::Point_3 Point; + K k; + double value; + Fixed_hilbert_cmp_3 (double v, const K &_k = K()) : k(_k),value(v) {} + bool operator() (const Point &p) const + { + return ! Fixed_hilbert_cmp_3 (value,k) (p); + } + }; + + template + struct Fixed_hilbert_cmp_3 + : public std::binary_function + { + typedef typename K::Point_3 Point; + K k; + double value; + Fixed_hilbert_cmp_3 (double v, const K &_k = K()) : k(_k),value(v) {} + bool operator() (const Point &p) const + { + return to_double(k.compute_x_3_object()(p)) < value; + } + }; + + template + struct Fixed_hilbert_cmp_3 + : public std::binary_function + { + typedef typename K::Point_3 Point; + K k; + double value; + Fixed_hilbert_cmp_3 (double v, const K &_k = K()) : k(_k),value(v) {} + bool operator() (const Point &p) const + { + return to_double(k.compute_y_3_object()(p)) < value; + } + }; + + template + struct Fixed_hilbert_cmp_3 + : public std::binary_function + { + typedef typename K::Point_3 Point; + K k; + double value; + Fixed_hilbert_cmp_3 (double v, const K &_k = K()) : k(_k),value(v) {} + bool operator() (const Point &p) const + { + return to_double(k.compute_z_3_object()(p)) < value ; + } + }; +} + +template +class Hilbert_sort_middle_3 +{ +public: + typedef K Kernel; + typedef typename Kernel::Point_3 Point; + +private: + Kernel _k; + std::ptrdiff_t _limit; + + template struct Cmp : public internal::Fixed_hilbert_cmp_3 + { Cmp (double v,const Kernel &k) : internal::Fixed_hilbert_cmp_3 (v,k) {} }; + +public: + Hilbert_sort_middle_3 (const Kernel &k = Kernel(), std::ptrdiff_t limit = 1) + : _k(k), _limit (limit) + {} + + template + void sort (RandomAccessIterator begin, RandomAccessIterator end, + double xmin, double ymin, double zmin, + double xmax, double ymax, double zmax) const + { + const int y = (x + 1) % 3, z = (x + 2) % 3; + if (end - begin <= _limit) return; + + double xmed= (xmin+xmax)/2; + double ymed= (ymin+ymax)/2; + double zmed= (zmin+zmax)/2; + + + RandomAccessIterator m0 = begin, m8 = end; + + RandomAccessIterator m4 = + internal::fixed_hilbert_split (m0, m8, Cmp< x, upx> (xmed,_k)); + RandomAccessIterator m2 = + internal::fixed_hilbert_split (m0, m4, Cmp< y, upy> (ymed,_k)); + RandomAccessIterator m6 = + internal::fixed_hilbert_split (m4, m8, Cmp< y, !upy> (ymed,_k)); + RandomAccessIterator m1 = + internal::fixed_hilbert_split (m0, m2, Cmp< z, upz> (zmed,_k)); + RandomAccessIterator m3 = + internal::fixed_hilbert_split (m2, m4, Cmp< z, !upz> (zmed,_k)); + RandomAccessIterator m5 = + internal::fixed_hilbert_split (m4, m6, Cmp< z, upz> (zmed,_k)); + RandomAccessIterator m7 = + internal::fixed_hilbert_split (m6, m8, Cmp< z, !upz> (zmed,_k)); + + + sort (m0, m1, zmin, xmin, ymin, zmed, xmed, ymed); + sort (m1, m2, ymin, zmed, xmin, ymed, zmax, xmed); + sort (m2, m3, ymed, zmed, xmin, ymax, zmax, xmed); + sort (m3, m4, xmin, ymax, zmed, xmed, ymed, zmin); + sort (m4, m5, xmed, ymax, zmed, xmax, ymed, zmin); + sort (m5, m6, ymax, zmed, xmax, ymed, zmax, xmed); + sort (m6, m7, ymed, zmed, xmax, ymin, zmax, xmed); + sort (m7, m8, zmed, xmax, ymin, zmin, xmed, ymed); + } + + template + void operator() (RandomAccessIterator begin, RandomAccessIterator end) const + { + K k; + double xmin=to_double(k.compute_x_3_object()(*begin)), + ymin=to_double(k.compute_y_3_object()(*begin)), + zmin=to_double(k.compute_z_3_object()(*begin)), + xmax=xmin, + ymax=ymin, + zmax=zmin; + for(RandomAccessIterator it=begin+1; it xmax) + xmax = to_double(k.compute_x_3_object()(*it)); + if ( to_double(k.compute_y_3_object()(*it)) > ymax) + ymax = to_double(k.compute_y_3_object()(*it)); + if ( to_double(k.compute_z_3_object()(*it)) > zmax) + zmax = to_double(k.compute_z_3_object()(*it)); + } + + sort <0, false, false, false> (begin, end, xmin,ymin,zmin,xmax,ymax,zmax); + } +}; + +} // namespace CGAL + +#endif//CGAL_HILBERT_SORT_MIDDLE_3_H diff --git a/Spatial_sorting/include/CGAL/Hilbert_sort_middle_base.h b/Spatial_sorting/include/CGAL/Hilbert_sort_middle_base.h new file mode 100644 index 00000000000..fcda1b94b37 --- /dev/null +++ b/Spatial_sorting/include/CGAL/Hilbert_sort_middle_base.h @@ -0,0 +1,43 @@ +// Copyright (c) 2011 INRIA Sophia-Antipolis (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; version 2.1 of the License. +// See the file LICENSE.LGPL distributed with CGAL. +// +// 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) : Olivier Devillers + +#ifndef CGAL_HILBERT_SORT_MIDDLE_BASE_H +#define CGAL_HILBERT_SORT_MIDDLE_BASE_H + +#include +#include + +namespace CGAL { + +namespace internal { + + template + RandomAccessIterator + fixed_hilbert_split (RandomAccessIterator begin, RandomAccessIterator end, + Cmp cmp = Cmp ()) + { + if (begin >= end) return begin; + + return std::partition (begin, end, cmp); + } +} + +} // namespace CGAL + +#endif//CGAL_HILBERT_SORT_MIDDLE_BASE_H diff --git a/Spatial_sorting/include/CGAL/Hilbert_sort_middle_d.h b/Spatial_sorting/include/CGAL/Hilbert_sort_middle_d.h new file mode 100644 index 00000000000..cf1ae7f9085 --- /dev/null +++ b/Spatial_sorting/include/CGAL/Hilbert_sort_middle_d.h @@ -0,0 +1,186 @@ +// Copyright (c) 2011 INRIA Sophia-Antipolis (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; version 2.1 of the License. +// See the file LICENSE.LGPL distributed with CGAL. +// +// 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) : Olivier Devillers + +#ifndef CGAL_HILBERT_SORT_MIDDLE_d_H +#define CGAL_HILBERT_SORT_MIDDLE_d_H + +#include +#include +#include +#include + +namespace CGAL { + +namespace internal { + + template + struct Fixed_hilbert_cmp_d + : public std::binary_function + { + typedef typename K::Point_d Point; + K k; + int axe; + bool orient; + double value; + Fixed_hilbert_cmp_d (int a, bool o, double v, const K &_k = K()) + : k(_k), axe(a), orient(o), value(v) {} + bool operator() (const Point &p) const + { + return (orient + ? ( to_double( k.compute_coordinate_d_object() (p,axe) ) > value) + : ( to_double( k.compute_coordinate_d_object() (p,axe) ) <= value)); + } + }; + +} + +template +class Hilbert_sort_middle_d +{ +public: + typedef K Kernel; + typedef typename Kernel::Point_d Point; + typedef std::vector< bool > Starting_position; + typedef std::vector< double > Corner; + +private: + Kernel _k; + std::ptrdiff_t _limit; + mutable int _dimension; + mutable int two_to_dim; + + struct Cmp : public internal::Fixed_hilbert_cmp_d + { Cmp (int a, bool dir, double v, const Kernel &k) + : internal::Fixed_hilbert_cmp_d (a,dir,v,k) {} }; + +public: + Hilbert_sort_middle_d (const Kernel &k = Kernel(), std::ptrdiff_t limit = 1) + : _k(k), _limit (limit) + {} + + template + void sort (RandomAccessIterator begin, RandomAccessIterator end, + Starting_position start, int direction, + Corner min, Corner max) const + { + if (end - begin <= _limit) return; + + Corner med(_dimension); + for( int i=0; i<_dimension; ++i) med[i]=(min[i]+max[i])/2; + Corner cmin=min,cmax=med; + + std::vector places(two_to_dim +1); + std::vector dir (two_to_dim +1); + places[0]=begin; + places[two_to_dim]=end; + + int last_dir = (direction + _dimension) % _dimension; + int current_dir = direction; + int current_level_step =two_to_dim; + do{ + int half_step = current_level_step/2; + int left=0; + int middle = half_step; + int right=current_level_step; + bool orient = start[current_dir]; + do{ + dir[middle] = current_dir; + places[middle] = internal::fixed_hilbert_split + (places[left], places[right], + Cmp (current_dir,orient,med[current_dir],_k)); + left =right; + right+=current_level_step; + middle+=current_level_step; + orient = ! orient; + }while( left< two_to_dim); + current_level_step = half_step; + current_dir = (current_dir +1) % _dimension; + }while (current_dir != last_dir); + + /////////////start recursive calls + last_dir = (direction + _dimension -1) % _dimension; + // first step is special + sort( places[0], places[1], start, last_dir,cmin,cmax); + cmin[last_dir] = med[last_dir]; + cmax[last_dir] = max[last_dir]; + + + for(int i=1; i + void operator() (RandomAccessIterator begin, RandomAccessIterator end) const + { + _dimension = _k.point_dimension_d_object()(*begin); + two_to_dim = 1; + Starting_position start(_dimension); + Corner min(_dimension),max(_dimension); + + for (int i=0; i<_dimension; ++i) + min[i]=max[i]=to_double( _k.compute_coordinate_d_object() (*begin,i) ); + for(RandomAccessIterator it=begin+1; it max[i]) max[i] = d; + } + } + + + for (int i=0; i<_dimension; ++i) { + start[i]=false; // we start below in all coordinates + two_to_dim *= 2; // compute 2^_dimension + if (two_to_dim*2 <= 0) { + CGAL_assertion(end-begin < two_to_dim);//too many points in such dim + break; + } + } + + + + // we start with direction 0; + sort (begin, end, start, 0, min, max); + } +}; + + + + +} // namespace CGAL + +#endif//CGAL_HILBERT_SORT_MIDDLE_d_H diff --git a/Spatial_sorting/include/CGAL/Multiscale_sort.h b/Spatial_sorting/include/CGAL/Multiscale_sort.h index 1786858406e..51c5df33b5d 100644 --- a/Spatial_sorting/include/CGAL/Multiscale_sort.h +++ b/Spatial_sorting/include/CGAL/Multiscale_sort.h @@ -53,6 +53,6 @@ public: } }; -} //namespace CGAL +} // namespace CGAL #endif // CGAL_MULTISCALE_SORT_H diff --git a/Spatial_sorting/include/CGAL/Spatial_sort_traits_adapter_2.h b/Spatial_sorting/include/CGAL/Spatial_sort_traits_adapter_2.h new file mode 100644 index 00000000000..1bc0d0d642a --- /dev/null +++ b/Spatial_sorting/include/CGAL/Spatial_sort_traits_adapter_2.h @@ -0,0 +1,77 @@ +// Copyright (c) 2011 GeometryFactory (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; version 2.1 of the License. +// See the file LICENSE.LGPL distributed with CGAL. +// +// 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) : Sebastien Loriot + + +#ifndef CGAL_SPATIAL_SORT_TRAITS_ADAPTER_2_H +#define CGAL_SPATIAL_SORT_TRAITS_ADAPTER_2_H + +#include +#include +#if BOOST_VERSION >= 104000 + #include +#else + #include +#endif + + +namespace CGAL{ + +using ::get; + +template +class Spatial_sort_traits_adapter_2:public Base_traits{ + PointPropertyMap ppmap_; +public: + Spatial_sort_traits_adapter_2(Base_traits base=Base_traits()):Base_traits(base){} + + Spatial_sort_traits_adapter_2(const PointPropertyMap& ppmap,Base_traits base=Base_traits()) + :Base_traits(base),ppmap_(ppmap){} + + typedef Base_traits Gt; + typedef typename boost::property_traits::key_type Point_2; + typedef typename boost::call_traits::param_type Arg_type; + + struct Less_x_2 : public Base_traits::Less_x_2{ + Less_x_2(const PointPropertyMap& ppmap,const typename Base_traits::Less_x_2& base): + Base_traits::Less_x_2(base),ppmap_(ppmap){} + const PointPropertyMap& ppmap_; + bool operator()(Arg_type p,Arg_type q) const { + return static_cast(this)->operator()(get(ppmap_,p),get(ppmap_,q)); + } + }; + + struct Less_y_2 : public Base_traits::Less_y_2{ + Less_y_2(const PointPropertyMap& ppmap,const typename Base_traits::Less_y_2& base): + Base_traits::Less_y_2(base),ppmap_(ppmap){} + const PointPropertyMap& ppmap_; + bool operator()(Arg_type p,Arg_type q) const { + return static_cast(this)->operator()(get(ppmap_,p),get(ppmap_,q)); + } + }; + + Less_x_2 less_x_2_object () const {return Less_x_2(ppmap_,static_cast(this)->less_x_2_object() );} + Less_y_2 less_y_2_object () const {return Less_y_2(ppmap_,static_cast(this)->less_y_2_object() );} + + const PointPropertyMap& point_property_map() const {return ppmap_;} + +}; + +} //namespace CGAL + +#endif //CGAL_SPATIAL_SORT_TRAITS_ADAPTER_2_H diff --git a/Spatial_sorting/include/CGAL/Spatial_sort_traits_adapter_3.h b/Spatial_sorting/include/CGAL/Spatial_sort_traits_adapter_3.h new file mode 100644 index 00000000000..2a3f07d0af5 --- /dev/null +++ b/Spatial_sorting/include/CGAL/Spatial_sort_traits_adapter_3.h @@ -0,0 +1,87 @@ +// Copyright (c) 2011 GeometryFactory (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; version 2.1 of the License. +// See the file LICENSE.LGPL distributed with CGAL. +// +// 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) : Sebastien Loriot + + +#ifndef CGAL_SPATIAL_SORT_TRAITS_ADAPTER_3_H +#define CGAL_SPATIAL_SORT_TRAITS_ADAPTER_3_H + +#include +#include +#if BOOST_VERSION >= 104000 + #include +#else + #include +#endif + + +namespace CGAL{ + +using ::get; + +template +class Spatial_sort_traits_adapter_3:public Base_traits{ + PointPropertyMap ppmap_; +public: + Spatial_sort_traits_adapter_3(Base_traits base=Base_traits()):Base_traits(base){} + + Spatial_sort_traits_adapter_3(const PointPropertyMap& ppmap,Base_traits base=Base_traits()) + :Base_traits(base),ppmap_(ppmap){} + + typedef Base_traits Gt; + typedef typename boost::property_traits::key_type Point_3; + typedef typename boost::call_traits::param_type Arg_type; + + struct Less_x_3 : public Base_traits::Less_x_3{ + Less_x_3(const PointPropertyMap& ppmap,const typename Base_traits::Less_x_3& base): + Base_traits::Less_x_3(base),ppmap_(ppmap){} + const PointPropertyMap& ppmap_; + bool operator()(Arg_type p,Arg_type q) const { + return static_cast(this)->operator()(get(ppmap_,p),get(ppmap_,q)); + } + }; + + struct Less_y_3 : public Base_traits::Less_y_3{ + Less_y_3(const PointPropertyMap& ppmap,const typename Base_traits::Less_y_3& base): + Base_traits::Less_y_3(base),ppmap_(ppmap){} + const PointPropertyMap& ppmap_; + bool operator()(Arg_type p,Arg_type q) const { + return static_cast(this)->operator()(get(ppmap_,p),get(ppmap_,q)); + } + }; + + struct Less_z_3 : public Base_traits::Less_z_3{ + Less_z_3(const PointPropertyMap& ppmap,const typename Base_traits::Less_z_3& base): + Base_traits::Less_z_3(base),ppmap_(ppmap){} + const PointPropertyMap& ppmap_; + bool operator()(Arg_type p,Arg_type q) const { + return static_cast(this)->operator()(get(ppmap_,p),get(ppmap_,q)); + } + }; + + Less_x_3 less_x_3_object () const {return Less_x_3(ppmap_,static_cast(this)->less_x_3_object() );} + Less_y_3 less_y_3_object () const {return Less_y_3(ppmap_,static_cast(this)->less_y_3_object() );} + Less_z_3 less_z_3_object () const {return Less_z_3(ppmap_,static_cast(this)->less_z_3_object() );} + + const PointPropertyMap& point_property_map() const {return ppmap_;} + +}; + +} //namespace CGAL + +#endif //CGAL_SPATIAL_SORT_TRAITS_ADAPTER_3_H diff --git a/Spatial_sorting/include/CGAL/Spatial_sort_traits_adapter_d.h b/Spatial_sorting/include/CGAL/Spatial_sort_traits_adapter_d.h new file mode 100644 index 00000000000..3c0c11934d0 --- /dev/null +++ b/Spatial_sorting/include/CGAL/Spatial_sort_traits_adapter_d.h @@ -0,0 +1,92 @@ +// Copyright (c) 2011 GeometryFactory (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; version 2.1 of the License. +// See the file LICENSE.LGPL distributed with CGAL. +// +// 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) : Sebastien Loriot + + +#ifndef CGAL_SPATIAL_SORT_TRAITS_ADAPTER_D_H +#define CGAL_SPATIAL_SORT_TRAITS_ADAPTER_D_H + +#include +#include +#if BOOST_VERSION >= 104000 + #include +#else + #include +#endif + + +namespace CGAL{ + +using ::get; + +template +class Spatial_sort_traits_adapter_d:public Base_traits{ + PointPropertyMap ppmap_; +public: + Spatial_sort_traits_adapter_d(Base_traits base=Base_traits()):Base_traits(base){} + + Spatial_sort_traits_adapter_d(const PointPropertyMap& ppmap,Base_traits base=Base_traits()) + :Base_traits(base),ppmap_(ppmap){} + + typedef Base_traits Gt; + typedef typename boost::property_traits::key_type Point_d; + typedef typename boost::call_traits::param_type Arg_type; + + + + struct Point_dimension_d: public Base_traits::Point_dimension_d{ + Point_dimension_d(const PointPropertyMap& ppmap,const typename Base_traits::Point_dimension_d& base): + Base_traits::Point_dimension_d(base),ppmap_(ppmap){} + const PointPropertyMap& ppmap_; + int operator()(Arg_type p) const { + return static_cast(this)->operator()(get(ppmap_,p)); + } + }; + + struct Less_coordinate_d: public Base_traits::Less_coordinate_d{ + Less_coordinate_d(const PointPropertyMap& ppmap,const typename Base_traits::Less_coordinate_d& base): + Base_traits::Less_coordinate_d(base),ppmap_(ppmap){} + const PointPropertyMap& ppmap_; + bool operator()(Arg_type p,Arg_type q,int i) const { + return static_cast(this)->operator()(get(ppmap_,p),get(ppmap_,q),i); + } + }; + + + struct Compute_coordinate_d: public Base_traits::Compute_coordinate_d{ + Compute_coordinate_d(const PointPropertyMap& ppmap,const typename Base_traits::Compute_coordinate_d& base): + Base_traits::Compute_coordinate_d(base),ppmap_(ppmap){} + const PointPropertyMap& ppmap_; + bool operator()(Arg_type p,int i) const { + return static_cast(this)->operator()(get(ppmap_,p),i); + } + }; + + + + Point_dimension_d point_dimension_d_object () const {return Point_dimension_d(ppmap_,static_cast(this)->point_dimension_d_object() );} + Less_coordinate_d less_coordinate_d_object () const {return Less_coordinate_d(ppmap_,static_cast(this)->less_coordinate_d_object() );} + Compute_coordinate_d compute_coordinate_d_object () const {return Compute_coordinate_d(ppmap_,static_cast(this)->compute_coordinate_d_object() );} + + const PointPropertyMap& point_property_map() const {return ppmap_;} + +}; + +} //namespace CGAL + +#endif //CGAL_SPATIAL_SORT_TRAITS_ADAPTER_D_H diff --git a/Spatial_sorting/include/CGAL/hilbert_sort.h b/Spatial_sorting/include/CGAL/hilbert_sort.h index d7956c41699..0f28b74dca2 100644 --- a/Spatial_sorting/include/CGAL/hilbert_sort.h +++ b/Spatial_sorting/include/CGAL/hilbert_sort.h @@ -1,4 +1,4 @@ -// Copyright (c) 2007 INRIA Sophia-Antipolis (France). +// Copyright (c) 2007-2011 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org); you can redistribute it and/or @@ -16,14 +16,17 @@ // $Id$ // // Author(s) : Christophe Delage +// : Olivier Devillers #ifndef CGAL_HILBERT_SORT_H #define CGAL_HILBERT_SORT_H #include +#include #include #include +#include #include #include @@ -32,50 +35,81 @@ namespace CGAL { + namespace internal { - template - void hilbert_sort (RandomAccessIterator begin, RandomAccessIterator end, - const Kernel &k, typename Kernel::Point_2 *) + template + void hilbert_sort (RandomAccessIterator begin, + RandomAccessIterator end, + Policy /*policy*/, + const Kernel &k, typename Kernel::Point_2 *) { boost::rand48 random; boost::random_number_generator rng(random); std::random_shuffle(begin,end, rng); - (Hilbert_sort_2 (k)) (begin, end); + (Hilbert_sort_2 (k))(begin, end); } - - template - void hilbert_sort (RandomAccessIterator begin, RandomAccessIterator end, - const Kernel &k, typename Kernel::Point_3 *) + + template + void hilbert_sort (RandomAccessIterator begin, + RandomAccessIterator end, + Policy /*policy*/, + const Kernel &k, typename Kernel::Point_3 *) { boost::rand48 random; boost::random_number_generator rng(random); std::random_shuffle(begin,end, rng); - (Hilbert_sort_3 (k)) (begin, end); + (Hilbert_sort_3 (k))(begin, end); } -} -template -void hilbert_sort (RandomAccessIterator begin, RandomAccessIterator end, - const Kernel &k) -{ - typedef std::iterator_traits ITraits; - typedef typename ITraits::value_type value_type; + template + void hilbert_sort (RandomAccessIterator begin, + RandomAccessIterator end, + Policy /*policy*/, + const Kernel &k, typename Kernel::Point_d *) + { + boost::rand48 random; + boost::random_number_generator rng(random); + std::random_shuffle(begin,end, rng); + (Hilbert_sort_d (k))(begin, end); + } + + - internal::hilbert_sort (begin, end, k, static_cast (0)); } template void hilbert_sort (RandomAccessIterator begin, RandomAccessIterator end) +{ + hilbert_sort (begin, end, Hilbert_sort_median_policy()); +} + +template +void hilbert_sort (RandomAccessIterator begin, RandomAccessIterator end, + Policy policy) { typedef std::iterator_traits ITraits; typedef typename ITraits::value_type value_type; typedef CGAL::Kernel_traits KTraits; typedef typename KTraits::Kernel Kernel; - hilbert_sort (begin, end, Kernel()); + internal::hilbert_sort(begin, end, policy, Kernel(), + static_cast (0)); } -} //namespace CGAL + +template +void hilbert_sort (RandomAccessIterator begin, RandomAccessIterator end, + Policy policy, const Kernel &k ) +{ + typedef std::iterator_traits ITraits; + typedef typename ITraits::value_type value_type; + + internal::hilbert_sort(begin, end, + policy, k, static_cast (0)); +} + +} // namespace CGAL #endif//CGAL_HILBERT_SORT_H + diff --git a/Spatial_sorting/include/CGAL/spatial_sort.h b/Spatial_sorting/include/CGAL/spatial_sort.h index 3640c6492aa..6374f546ea7 100644 --- a/Spatial_sorting/include/CGAL/spatial_sort.h +++ b/Spatial_sorting/include/CGAL/spatial_sort.h @@ -1,4 +1,4 @@ -// Copyright (c) 2007 INRIA Sophia-Antipolis (France). +// Copyright (c) 2007-2011 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org); you can redistribute it and/or @@ -16,15 +16,14 @@ // $Id$ // // Author(s) : Christophe Delage +// : Olivier Devillers #ifndef CGAL_SPATIAL_SORT_H #define CGAL_SPATIAL_SORT_H #include -#include -#include - +#include #include #include @@ -34,54 +33,151 @@ namespace CGAL { + namespace internal { - template - void spatial_sort (RandomAccessIterator begin, RandomAccessIterator end, - const Kernel &k, typename Kernel::Point_2 *) + template + void spatial_sort ( + RandomAccessIterator begin, RandomAccessIterator end, + const Kernel &k, + Policy /*policy*/, + typename Kernel::Point_2 *, + std::ptrdiff_t threshold_hilbert, + std::ptrdiff_t threshold_multiscale, + double ratio) { - typedef Hilbert_sort_2 Sort; + typedef Hilbert_sort_2 Sort; boost::rand48 random; boost::random_number_generator rng(random); std::random_shuffle(begin,end,rng); - (Multiscale_sort (Sort (k, 4), 16, 0.25)) (begin, end); + if (threshold_hilbert==0) threshold_hilbert=4; + if (threshold_multiscale==0) threshold_multiscale=16; + if (ratio==0.0) ratio=0.25; + + (Multiscale_sort (Sort (k, threshold_hilbert), + threshold_multiscale, ratio)) (begin, end); } - template - void spatial_sort (RandomAccessIterator begin, RandomAccessIterator end, - const Kernel &k, typename Kernel::Point_3 *) + template + void spatial_sort ( + RandomAccessIterator begin, RandomAccessIterator end, + const Kernel &k, + Policy /*policy*/, + typename Kernel::Point_3 *, + std::ptrdiff_t threshold_hilbert, + std::ptrdiff_t threshold_multiscale, + double ratio) { - typedef Hilbert_sort_3 Sort; + typedef Hilbert_sort_3 Sort; boost::rand48 random; boost::random_number_generator rng(random); std::random_shuffle(begin,end, rng); - (Multiscale_sort (Sort (k, 8), 64, 0.125)) (begin, end); + if (threshold_hilbert==0) threshold_hilbert=8; + if (threshold_multiscale==0) threshold_multiscale=64; + if (ratio==0.0) ratio=0.125; + + (Multiscale_sort (Sort (k, threshold_hilbert), + threshold_multiscale, ratio)) (begin, end); } + + template + void spatial_sort ( + RandomAccessIterator begin, RandomAccessIterator end, + const Kernel &k, + Policy /*policy*/, + typename Kernel::Point_d *, + std::ptrdiff_t threshold_hilbert, + std::ptrdiff_t threshold_multiscale, + double ratio) + { + typedef Hilbert_sort_d Sort; + boost::rand48 random; + boost::random_number_generator rng(random); + std::random_shuffle(begin,end, rng); + + if (threshold_hilbert==0) threshold_hilbert=10; + if (threshold_multiscale==0) threshold_multiscale=500; + if (ratio==0.0) ratio=0.05; + + (Multiscale_sort (Sort (k, threshold_hilbert), + threshold_multiscale, ratio)) (begin, end); + } + } -template + +template void spatial_sort (RandomAccessIterator begin, RandomAccessIterator end, - const Kernel &k) + const Kernel &k, + Policy policy, + std::ptrdiff_t threshold_hilbert=0, + std::ptrdiff_t threshold_multiscale=0, + double ratio=0.0) { typedef std::iterator_traits ITraits; typedef typename ITraits::value_type value_type; - internal::spatial_sort (begin, end, k, static_cast (0)); + internal::spatial_sort(begin, end, k, policy, static_cast (0), + threshold_hilbert,threshold_multiscale,ratio); } template -void spatial_sort (RandomAccessIterator begin, RandomAccessIterator end) +void spatial_sort (RandomAccessIterator begin, RandomAccessIterator end, + Hilbert_sort_median_policy policy, + std::ptrdiff_t threshold_hilbert=0, + std::ptrdiff_t threshold_multiscale=0, + double ratio=0.0) { typedef std::iterator_traits ITraits; typedef typename ITraits::value_type value_type; typedef CGAL::Kernel_traits KTraits; typedef typename KTraits::Kernel Kernel; - spatial_sort (begin, end, Kernel()); + spatial_sort (begin, end, Kernel(), policy, + threshold_hilbert,threshold_multiscale,ratio); +} +template +void spatial_sort (RandomAccessIterator begin, RandomAccessIterator end, + Hilbert_sort_middle_policy policy, + std::ptrdiff_t threshold_hilbert=0, + std::ptrdiff_t threshold_multiscale=0, + double ratio=0.0) +{ + typedef std::iterator_traits ITraits; + typedef typename ITraits::value_type value_type; + typedef CGAL::Kernel_traits KTraits; + typedef typename KTraits::Kernel Kernel; + + spatial_sort (begin, end, Kernel(), policy, + threshold_hilbert,threshold_multiscale,ratio); } -} //namespace CGAL + +template +void spatial_sort (RandomAccessIterator begin, RandomAccessIterator end, + const Kernel &k, + std::ptrdiff_t threshold_hilbert=0, + std::ptrdiff_t threshold_multiscale=0, + double ratio=0.0) +{ + spatial_sort (begin, end, k, + Hilbert_sort_median_policy(), + threshold_hilbert,threshold_multiscale,ratio); +} + +template +void spatial_sort (RandomAccessIterator begin, RandomAccessIterator end, + std::ptrdiff_t threshold_hilbert=0, + std::ptrdiff_t threshold_multiscale=0, + double ratio=0.0) +{ + spatial_sort (begin, end, + Hilbert_sort_median_policy(), + threshold_hilbert,threshold_multiscale,ratio); +} + +} // namespace CGAL #endif//CGAL_SPATIAL_SORT_H diff --git a/Spatial_sorting/package_info/Spatial_sorting/maintainer b/Spatial_sorting/package_info/Spatial_sorting/maintainer index 7e028c78627..99303a0d3ce 100644 --- a/Spatial_sorting/package_info/Spatial_sorting/maintainer +++ b/Spatial_sorting/package_info/Spatial_sorting/maintainer @@ -1 +1 @@ -cgal-develop +odevil diff --git a/Spatial_sorting/test/Spatial_sorting/test_hilbert.cpp b/Spatial_sorting/test/Spatial_sorting/test_hilbert.cpp index 33b7511ce28..23ab7cbfb5d 100644 --- a/Spatial_sorting/test/Spatial_sorting/test_hilbert.cpp +++ b/Spatial_sorting/test/Spatial_sorting/test_hilbert.cpp @@ -4,37 +4,47 @@ #include #include +#include #include #include #include +#include +#include #include #include #include -typedef CGAL::Exact_predicates_inexact_constructions_kernel K; -typedef K::Point_2 Point_2; -typedef K::Point_3 Point_3; +#include -typedef CGAL::Creator_uniform_2 Creator_2; -typedef CGAL::Creator_uniform_3 Creator_3; +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef K::Point_2 Point_2; +typedef K::Point_3 Point_3; +typedef CGAL::Creator_uniform_2 Creator_2; +typedef CGAL::Creator_uniform_3 Creator_3; + +typedef CGAL::Cartesian_d Kd; +typedef Kd::Point_d Point; +typedef CGAL::Creator_uniform_d::iterator, Point>Creator_d; int main () { - const int nb_points_2 = 50000, nb_points_3 = 50000; - CGAL::Random random (42); + int nb_points_2 = 5000, nb_points_3 = 5000, + nb_points_d=10000, small_nb_points_d=3; + CGAL::Random random (42); + CGAL::Timer cost; std::cout << "Testing Hilbert sort." << std::endl; { - std::cout << "Testing 2D: Generating points... " << std::flush; + std::cout << "Testing 2D: Generating "< v; v.reserve (nb_points_2); - CGAL::Random_points_in_square_2 gen (1.0, random); + CGAL::Random_points_in_square_2 gen (1.0, random); for (int i = 0; i < nb_points_2; ++i) v.push_back (*gen++); @@ -45,9 +55,11 @@ int main () std::cout << " Sorting points... " << std::flush; + cost.reset();cost.start(); CGAL::hilbert_sort (v.begin(), v.end()); + cost.stop(); - std::cout << "done." << std::endl; + std::cout << "done in "< v; + v.reserve(size); + + CGAL::points_on_square_grid_2 (box_size, (std::size_t)size, + std::back_inserter(v), Creator_2() ); + + std::cout << "done." << std::endl; + + std::cout << " Sorting points... " << std::flush; + + cost.reset();cost.start(); + CGAL::hilbert_sort (v.begin(), v.end()); + cost.stop(); + + std::cout << "done in "< v; + v.reserve (nb_points_2); + + CGAL::Random_points_in_square_2 gen (1.0, random); + + for (int i = 0; i < nb_points_2; ++i) + v.push_back (*gen++); + + std::cout << "done." << std::endl; + + std::vector v2 (v); + + std::cout << " Sorting points... " << std::flush; + + cost.reset();cost.start(); + CGAL::hilbert_sort(v.begin(),v.end(),CGAL::Hilbert_sort_middle_policy()); + cost.stop(); + + std::cout << "done in "< v; + v.reserve(size); + + CGAL::points_on_square_grid_2 (box_size, (std::size_t)size, + std::back_inserter(v), Creator_2() ); + + std::cout << "done." << std::endl; + + std::cout << " Sorting points... " << std::flush; + + cost.reset();cost.start(); + CGAL::hilbert_sort(v.begin(),v.end(),CGAL::Hilbert_sort_middle_policy()); + cost.stop(); + + std::cout << "done in "< v; v.reserve (nb_points_3); - CGAL::Random_points_in_cube_3 gen (1.0, random); + CGAL::Random_points_in_cube_3 gen (1.0, random); for (int i = 0; i < nb_points_3; ++i) v.push_back (*gen++); @@ -75,9 +174,11 @@ int main () std::cout << " Sorting points... " << std::flush; + cost.reset();cost.start(); CGAL::hilbert_sort (v.begin(), v.end()); + cost.stop(); - std::cout << "done." << std::endl; + std::cout << "done in "< v; + v.reserve(size); + + CGAL::points_on_cube_grid_3 (box_size, (std::size_t)size, + std::back_inserter(v), Creator_3() ); + + std::cout << "done." << std::endl; + + std::cout << " Sorting points... " << std::flush; + + cost.reset();cost.start(); + CGAL::hilbert_sort (v.begin(), v.end()); + cost.stop(); + + std::cout << "done in "< v; + v.reserve (nb_points_3); + + CGAL::Random_points_in_cube_3 gen (1.0, random); + + for (int i = 0; i < nb_points_3; ++i) + v.push_back (*gen++); + + std::cout << "done." << std::endl; + + std::vector v2 (v); + + std::cout << " Sorting points... " << std::flush; + + cost.reset();cost.start(); + CGAL::hilbert_sort(v.begin(),v.end(),CGAL::Hilbert_sort_middle_policy()); + cost.stop(); + + std::cout << "done in "< v; + v.reserve(size); + + CGAL::points_on_cube_grid_3 (box_size, (std::size_t)size, + std::back_inserter(v), Creator_3() ); + + std::cout << "done." << std::endl; + + std::cout << " Sorting points... " << std::flush; + + cost.reset();cost.start(); + CGAL::hilbert_sort(v.begin(),v.end(),CGAL::Hilbert_sort_middle_policy()); + cost.stop(); + + std::cout << "done in "< v; + v.reserve (nb_points_d); + + CGAL::Random_points_in_cube_d gen (dim, 1.0, random); + + for (int i = 0; i < nb_points_d; ++i) + v.push_back (*gen++); + + std::cout << "done." << std::endl; + + std::vector v2 (v); + + std::cout << " Sorting points... " << std::flush; + + cost.reset();cost.start(); + CGAL::hilbert_sort (v.begin(), v.end(),CGAL::Hilbert_sort_median_policy()); + cost.stop(); + + std::cout << "done in "< v; + v.reserve (nb_points_d); + + CGAL::Random_points_in_cube_d gen (dim, 1.0, random); + + for (int i = 0; i < nb_points_d; ++i) + v.push_back (*gen++); + + std::cout << "done." << std::endl; + + std::vector v2 (v); + + std::cout << " Sorting points... " << std::flush; + + cost.reset();cost.start(); + CGAL::hilbert_sort (v.begin(), v.end()); + cost.stop(); + + std::cout << "done in "< v; + v.reserve (nb_points_d); + + CGAL::Random_points_in_cube_d gen (dim, 1.0, random); + + for (int i = 0; i < nb_points_d; ++i) + v.push_back (*gen++); + + std::cout << "done." << std::endl; + + std::vector v2 (v); + + std::cout << " Sorting points ... " << std::flush; + + cost.reset();cost.start(); + CGAL::hilbert_sort (v.begin(), v.end(), + CGAL::Hilbert_sort_middle_policy()); + cost.stop(); + + std::cout << "done in "< v; + v.reserve (nb_points_d); + + CGAL::Random_points_in_cube_d gen (dim, 1.0, random); + + for (int i = 0; i < nb_points_d; ++i) + v.push_back (*gen++); + + std::cout << "done." << std::endl; + + std::vector v2 (v); + + std::cout << " Sorting points... " << std::flush; + + cost.reset();cost.start(); + CGAL::hilbert_sort (v.begin(), v.end()); + cost.stop(); + + std::cout << "done in "< v(size); + + CGAL::points_on_cube_grid_d (dim, box_size, (std::size_t)size, + v.begin(), Creator_d(dim) ); + + std::cout << "done." << std::endl; + + std::cout << " Sorting points... " << std::flush; + + cost.reset();cost.start(); + CGAL::hilbert_sort (v.begin(), v.begin()+size); + cost.stop(); + + std::cout << "done in "< v(size); + + CGAL::points_on_cube_grid_d (dim, box_size, (std::size_t)size, + v.begin(), Creator_d(dim) ); + + std::cout << "done." << std::endl; + + std::cout << " Sorting points... " << std::flush; + + cost.reset();cost.start(); + CGAL::hilbert_sort (v.begin(), v.begin()+size, + CGAL::Hilbert_sort_middle_policy()); + cost.stop(); + + std::cout << "done in "< v(size); + + CGAL::points_on_cube_grid_d (dim, box_size, (std::size_t)size, + v.begin(), Creator_d(dim) ); + + std::cout << "done." << std::endl; + + std::cout << " Sorting points... " << std::flush; + + cost.reset();cost.start(); + CGAL::hilbert_sort (v.begin(), v.begin()+size, + CGAL::Hilbert_sort_middle_policy()); + cost.stop(); + + std::cout << "done in "< v; + v.reserve (nb_points_d); + + CGAL::Random_points_in_cube_d gen (dim, 1.0, random); + + for (int i = 0; i < nb_points_d; ++i) + v.push_back (*gen++); + + std::cout << "done." << std::endl; + + std::vector v2 (v); + + std::cout << " Sorting points... " << std::flush; + + cost.reset();cost.start(); + CGAL::hilbert_sort (v.begin(), v.end()); + cost.stop(); + + std::cout << "done in "< #include +#include #include #include #include +#include +#include #include #include @@ -21,9 +24,12 @@ typedef K::Point_3 Point_3; typedef CGAL::Creator_uniform_2 Creator_2; typedef CGAL::Creator_uniform_3 Creator_3; +typedef CGAL::Cartesian_d Kd; +typedef Kd::Point_d Point; + int main () { - const int nb_points_2 = 50000, nb_points_3 = 50000; + const int nb_points_2 = 50000, nb_points_3 = 50000, nb_points_d=50000; CGAL::Random random (42); std::cout << "Testing Multiscale sort." << std::endl; @@ -55,7 +61,7 @@ int main () std::sort (v2.begin(), v2.end(), K().less_xy_2_object()); assert(v == v2); - std::cout << "OK." << std::endl; + std::cout << "no points lost." << std::endl; } { @@ -85,7 +91,38 @@ int main () std::sort (v2.begin(), v2.end(), K().less_xyz_3_object()); assert(v == v2); - std::cout << "OK." << std::endl; + std::cout << "no points lost." << std::endl; + } + + { + int dim=5; + std::cout << "Testing "< v; + v.reserve (nb_points_d); + + CGAL::Random_points_in_cube_d gen (dim, 1.0, random); + + for (int i = 0; i < nb_points_d; ++i) + v.push_back (*gen++); + + std::cout << "done." << std::endl; + + std::vector v2 (v); + + std::cout << " Sorting points... " << std::flush; + + CGAL::spatial_sort (v.begin(), v.end()); + + std::cout << "done." << std::endl; + + std::cout << " Checking... " << std::flush; + + std::sort (v.begin(), v.end(), Kd().less_lexicographically_d_object()); + std::sort (v2.begin(), v2.end(),Kd().less_lexicographically_d_object()); + assert(v == v2); + + std::cout << "no points lost." << std::endl; } return 0; diff --git a/Straight_skeleton_2/doc_tex/Straight_skeleton_2_ref/Create_exterior_skeleton_and_offset_polygons_2.tex b/Straight_skeleton_2/doc_tex/Straight_skeleton_2_ref/Create_exterior_skeleton_and_offset_polygons_2.tex index 5f5b7581584..79912be07b8 100644 --- a/Straight_skeleton_2/doc_tex/Straight_skeleton_2_ref/Create_exterior_skeleton_and_offset_polygons_2.tex +++ b/Straight_skeleton_2/doc_tex/Straight_skeleton_2_ref/Create_exterior_skeleton_and_offset_polygons_2.tex @@ -59,10 +59,10 @@ This is equivalent to \ccc{arrange_offset_polygons_2(create_exterior_skeleton_an \ccRequirements \begin{enumerate} - \item \ccc{OffsettingK} is the CGAL kernel used to instantiate + \item \ccc{OffsettingK} is the \cgal\ kernel used to instantiate \ccc{Polygon_offset_builder_traits_2} for constructing the offset polygons. - \item \ccc{SkeletonK} is the CGAL kernel used to instantiate + \item \ccc{SkeletonK} is the \cgal\ kernel used to instantiate \ccc{Straight_skeleton_builder_traits_2} for constructing the straight skeleton. If \ccc{SkeletonK != OffsettingK} the constructed straight skeleton diff --git a/Straight_skeleton_2/doc_tex/Straight_skeleton_2_ref/Create_exterior_straight_skeleton_2.tex b/Straight_skeleton_2/doc_tex/Straight_skeleton_2_ref/Create_exterior_straight_skeleton_2.tex index 25954a13ab9..7c7e76e43d7 100644 --- a/Straight_skeleton_2/doc_tex/Straight_skeleton_2_ref/Create_exterior_straight_skeleton_2.tex +++ b/Straight_skeleton_2/doc_tex/Straight_skeleton_2_ref/Create_exterior_straight_skeleton_2.tex @@ -60,7 +60,7 @@ $d$ is a margin sufficiently large to allow an outer offset at dinstance \ccc{ma \ccHeading{Requirements} \begin{enumerate} - \item \ccc{K} is any CGAL kernel. + \item \ccc{K} is any \cgal\ kernel. \item \ccc{PointIterator::value_type} is equivalent to \ccc{K2::Point_2}. A cartesian converter is used to convert from \ccc{K2::Point_2} to \ccc{K::Point_2} \item \ccc{Polygon} is \ccc{Polygon_2} or a standard container of \ccc{K2::Point_2} elements diff --git a/Straight_skeleton_2/doc_tex/Straight_skeleton_2_ref/Create_interior_skeleton_and_offset_polygons_2.tex b/Straight_skeleton_2/doc_tex/Straight_skeleton_2_ref/Create_interior_skeleton_and_offset_polygons_2.tex index c999ddbcd35..7b56cdf530f 100644 --- a/Straight_skeleton_2/doc_tex/Straight_skeleton_2_ref/Create_interior_skeleton_and_offset_polygons_2.tex +++ b/Straight_skeleton_2/doc_tex/Straight_skeleton_2_ref/Create_interior_skeleton_and_offset_polygons_2.tex @@ -103,10 +103,10 @@ create_interior_skeleton_and_offset_polygons_with_holes_2 This is equivalent to \ccc{arrange_offset_polygons_2(create_interior_skeleton_and_offset_polygons_2(offset,poly_with_holes,okk,ssk))}.} \begin{enumerate} - \item \ccc{OffsettingK} is the CGAL kernel used to instantiate + \item \ccc{OffsettingK} is the \cgal\ kernel used to instantiate \ccc{Polygon_offset_builder_traits_2} for constructing the offset polygons. - \item \ccc{SkeletonK} is the CGAL kernel used to instantiate + \item \ccc{SkeletonK} is the \cgal\ kernel used to instantiate \ccc{Straight_skeleton_builder_traits_2} for constructing the straight skeleton. If \ccc{SkeletonK != OffsettingK} the constructed straight skeleton diff --git a/Straight_skeleton_2/doc_tex/Straight_skeleton_2_ref/Create_interior_straight_skeleton_2.tex b/Straight_skeleton_2/doc_tex/Straight_skeleton_2_ref/Create_interior_straight_skeleton_2.tex index 3a78b729025..a5590c305f5 100644 --- a/Straight_skeleton_2/doc_tex/Straight_skeleton_2_ref/Create_interior_straight_skeleton_2.tex +++ b/Straight_skeleton_2/doc_tex/Straight_skeleton_2_ref/Create_interior_straight_skeleton_2.tex @@ -63,7 +63,7 @@ create_interior_straight_skeleton_2 ( Polygon const& outer_contour \begin{enumerate} - \item \ccc{K} is any CGAL kernel. + \item \ccc{K} is any \cgal\ kernel. \item \ccc{PointIterator::value_type} is equivalent to \ccc{K2::Point_2}. A cartesian converter is used to convert from \ccc{K2::Point_2} to \ccc{K::Point_2} \item \ccc{HoleIterator::value_type} and \ccc{Polygon} are \ccc{Polygon_2} diff --git a/Straight_skeleton_2/doc_tex/Straight_skeleton_2_ref/Create_offset_polygons_2.tex b/Straight_skeleton_2/doc_tex/Straight_skeleton_2_ref/Create_offset_polygons_2.tex index f82a0c84fa7..02ecb48c6d7 100644 --- a/Straight_skeleton_2/doc_tex/Straight_skeleton_2_ref/Create_offset_polygons_2.tex +++ b/Straight_skeleton_2/doc_tex/Straight_skeleton_2_ref/Create_offset_polygons_2.tex @@ -41,7 +41,7 @@ the straight skeleton $s$. \begin{enumerate} - \item \ccc{K} is any CGAL kernel. + \item \ccc{K} is any \cgal\ kernel. \item \ccc{FT} is any number type implicitly convertible to \ccc{K::FT}. \item \ccc{Straight_skeleton} is \ccc{Straight_skeleton_2}. If $K != K2$ the straight skeleton is converted to \ccc{Straight_skeleton_2}. diff --git a/Straight_skeleton_2/doc_tex/Straight_skeleton_2_ref/Straight_skeleton_builder_traits_2.tex b/Straight_skeleton_2/doc_tex/Straight_skeleton_2_ref/Straight_skeleton_builder_traits_2.tex index 395006f1951..a05a7d13b6d 100644 --- a/Straight_skeleton_2/doc_tex/Straight_skeleton_2_ref/Straight_skeleton_builder_traits_2.tex +++ b/Straight_skeleton_2/doc_tex/Straight_skeleton_2_ref/Straight_skeleton_builder_traits_2.tex @@ -26,7 +26,7 @@ The class \ccRefName\ provides a model for the \ccc{StraightSkeletonBuilderTraits_2} concept which is the traits class required by the \ccc{Straight_skeleton_builder_2} algorithm class. The class -\ccRefName\ has one template argument: a 2D CGAL Kernel. This parameter must be a model for the \ccc{Kernel} concept, such as the \ccc{Exact_predicates_inexact_constructions_kernel}, which is the recommended one.\\ +\ccRefName\ has one template argument: a 2D \cgal\ Kernel. This parameter must be a model for the \ccc{Kernel} concept, such as the \ccc{Exact_predicates_inexact_constructions_kernel}, which is the recommended one.\\ It is unspecified which subset of the kernel is used into the output sequence and the returned iterator will be equal to \ccc{out}. For any given input polygon, it in this traits class (and by extension in the builder class). This is to avoid restricting the choices in the implementation. diff --git a/Stream_lines_2/doc_tex/Stream_lines_2_ref/StreamLinesTraits_2.tex b/Stream_lines_2/doc_tex/Stream_lines_2_ref/StreamLinesTraits_2.tex index 4e39ba2addb..391e5146fd4 100644 --- a/Stream_lines_2/doc_tex/Stream_lines_2_ref/StreamLinesTraits_2.tex +++ b/Stream_lines_2/doc_tex/Stream_lines_2_ref/StreamLinesTraits_2.tex @@ -34,7 +34,7 @@ This concept provides the types handled by the \ccHasModels -The kernels of CGAL are models for this traits class. \\ +The kernels of \cgal\ are models for this traits class. \\ diff --git a/Stream_support/src/CGAL/File_header_OFF.cpp b/Stream_support/src/CGAL/File_header_OFF.cpp index 2f66806a747..d6acf6298d9 100644 --- a/Stream_support/src/CGAL/File_header_OFF.cpp +++ b/Stream_support/src/CGAL/File_header_OFF.cpp @@ -322,6 +322,15 @@ std::istream& operator>>( std::istream& in, File_header_OFF& h) { else c = 0; h.set_vertices( a); + if (b<0){ + in.clear( std::ios::badbit ); + if ( h.verbose()) { + std::cerr << " " << std::endl; + std::cerr << "error: File_header_OFF(): File contains < 0 facets." + << std::endl; + } + return in; + } h.set_facets( b); n_h = c; } else { @@ -332,6 +341,15 @@ std::istream& operator>>( std::istream& in, File_header_OFF& h) { h.set_vertices(n); } in >> n; + if (n < 0){ + in.clear( std::ios::badbit ); + if ( h.verbose()) { + std::cerr << " " << std::endl; + std::cerr << "error: File_header_OFF(): File contains < 0 facets." + << std::endl; + } + return in; + } h.set_facets(n); if ( h.off()) in >> n_h; @@ -340,12 +358,11 @@ std::istream& operator>>( std::istream& in, File_header_OFF& h) { } if ( n_h == 0) h.set_index_offset( 0); - if ( ! in || h.size_of_vertices() <= 0 || h.size_of_facets() < 0) { + if ( ! in || h.size_of_vertices() <= 0 ) { in.clear( std::ios::badbit); if ( h.verbose()) { std::cerr << " " << std::endl; - std::cerr << "error: File_header_OFF(): " - "File contains <= 0 vertices or < 0 facets." + std::cerr << "error: File_header_OFF(): File contains <= 0 vertices." << std::endl; } return in; diff --git a/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/Parameterization_polyhedron_adaptor_3.tex b/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/Parameterization_polyhedron_adaptor_3.tex index 10b428627c4..970e1554acf 100644 --- a/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/Parameterization_polyhedron_adaptor_3.tex +++ b/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/Parameterization_polyhedron_adaptor_3.tex @@ -25,7 +25,7 @@ \ccc{Parameterization_polyhedron_adaptor_3} is an adaptor class to access to a Polyhedron 3D mesh using the \ccc{ParameterizationPatchableMesh_3} interface. Among other things, this concept defines the accessor to the (u, v) values computed by parameterizations methods. -Note that these interfaces are decorators that add {\em on the fly} the necessary fields to unmodified CGAL data structures (using STL maps). For performance reasons, it is recommended to use CGAL data structures enriched with the proper fields. +Note that these interfaces are decorators that add {\em on the fly} the necessary fields to unmodified \cgal\ data structures (using STL maps). For performance reasons, it is recommended to use \cgal\ data structures enriched with the proper fields. A \ccc{ParameterizationMesh_3} surface consists of vertices, facets and an incidence relation on them. No notion of edge is requested. diff --git a/Surface_mesher/doc_tex/Complex_2_in_triangulation_3_ref/Complex_2_in_triangulation_3.tex b/Surface_mesher/doc_tex/Complex_2_in_triangulation_3_ref/Complex_2_in_triangulation_3.tex index c985eb4e20a..5a8336156c6 100644 --- a/Surface_mesher/doc_tex/Complex_2_in_triangulation_3_ref/Complex_2_in_triangulation_3.tex +++ b/Surface_mesher/doc_tex/Complex_2_in_triangulation_3_ref/Complex_2_in_triangulation_3.tex @@ -45,7 +45,7 @@ facets of the 2D complex and to antenna edges or marked edges. \ccParameters The class \ccRefName\ is parametrized by the underlying 3D triangulation. -Any triangulation can of CGAL can be used to instantiate this parameter. +Any triangulation can of \cgal\ can be used to instantiate this parameter. The parameters \ccc{Facet_info} and \ccc{Edge_info} provide the types of the information the wishes to attached respectively to the facets of the 2D complex or to the marked diff --git a/Surface_mesher/doc_tex/Surface_mesher_ref/ImplicitSurfaceTraits_3.tex b/Surface_mesher/doc_tex/Surface_mesher_ref/ImplicitSurfaceTraits_3.tex index b22195bba69..bfb41fe8d39 100644 --- a/Surface_mesher/doc_tex/Surface_mesher_ref/ImplicitSurfaceTraits_3.tex +++ b/Surface_mesher/doc_tex/Surface_mesher_ref/ImplicitSurfaceTraits_3.tex @@ -139,7 +139,7 @@ objects: \ccHasModels -Any CGAL Kernel. +Any \cgal\ Kernel. \ccSeeAlso diff --git a/Surface_reconstruction_points_3/doc_tex/Surface_reconstruction_points_3/case_studies.tex b/Surface_reconstruction_points_3/doc_tex/Surface_reconstruction_points_3/case_studies.tex index a3ff1fbc7e0..9737793d9dc 100644 --- a/Surface_reconstruction_points_3/doc_tex/Surface_reconstruction_points_3/case_studies.tex +++ b/Surface_reconstruction_points_3/doc_tex/Surface_reconstruction_points_3/case_studies.tex @@ -81,7 +81,7 @@ The algorithm is in general not robust to outliers, although a few outliers do n \end{center} -The algorithm works well even when the inferred surface is composed of several connected components, provided that both all normals are properly estimated and oriented (the current CGAL normal orienter algorithm may fail in some cases, see \ccc{CGAL::mst_orient_normals()}), and that the final contouring algorithm is properly seeded for each component. When the inferred surface is composed of several nested connected components care should be taken to orient the normals of each component in alternation (inward/outward) so that the final contouring stage picks a proper contouring value. +The algorithm works well even when the inferred surface is composed of several connected components, provided that both all normals are properly estimated and oriented (the current \cgal\ normal orienter algorithm may fail in some cases, see \ccc{CGAL::mst_orient_normals()}), and that the final contouring algorithm is properly seeded for each component. When the inferred surface is composed of several nested connected components care should be taken to orient the normals of each component in alternation (inward/outward) so that the final contouring stage picks a proper contouring value. \subsubsection{Contouring Parameters} 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 c61e5420daf..251b7d09a80 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 @@ -4,8 +4,8 @@ % | 07.09.2007 Pierre Alliez, Laurent Saboret, Gael Guennebaud % | Package: Surface_reconstruction_points_3 % | -\RCSdef{\RCSPoissonreconstructionfunctionRev}{$Id$} -\RCSdefDate{\RCSPoissonreconstructionfunctionDate}{$Date$} +%\RCSdef{\RCSPoissonreconstructionfunctionRev}{$Id$} +%\RCSdefDate{\RCSPoissonreconstructionfunctionDate}{$Date$} % | \ccRefPageBegin %%RefPage: end of header, begin of main body @@ -143,7 +143,9 @@ The function \ccc{compute_implicit_function}() must be called after the insertio \ccGlue \ccMethod{FT operator()(const Point& p) const;} { -\ccc{ImplicitFunction} interface: evaluates the implicit function at a given 3D query point. +\ccc{ImplicitFunction} interface: evaluates the implicit function at a +given 3D query point. The function \ccc{compute_implicit_function} must be +called before the first call to \ccc{operator()}. } \ccGlue \ccMethod{Point get_inner_point() const;} @@ -156,7 +158,7 @@ Returns a point located inside the inferred surface. \ccExample -See \ccc{poisson_reconstruction_example.cpp}. +See \ccReferToExampleCode{Surface_reconstruction_points_3/poisson_reconstruction_example.cpp}. \end{ccRefClass} diff --git a/Triangulation_2/doc_tex/Triangulation_2/triangulation_user.tex b/Triangulation_2/doc_tex/Triangulation_2/triangulation_user.tex index fa2de8380ad..32f397f444b 100644 --- a/Triangulation_2/doc_tex/Triangulation_2/triangulation_user.tex +++ b/Triangulation_2/doc_tex/Triangulation_2/triangulation_user.tex @@ -832,7 +832,7 @@ instance of the \ccc{Filtered_kernel} template. The base vertex type of a regular triangulation includes a Boolean data member to mark the hidden state of the vertex. -Therefore CGAL defines the concept +Therefore \cgal\ defines the concept \ccc{RegularTriangulationVertexBase_2} which refine the concept \ccc{TriangulationVertexBase_2} and provides a default model @@ -919,7 +919,7 @@ constraints and its constrained triangulation"> \end{ccHtmlOnly} -A constrained triangulation is represented in the CGAL library as an +A constrained triangulation is represented in the \cgal\ library as an object of the class \ccc{Constrained_triangulation_2}. The third parameter \ccc{Itag} is the intersection tag which serves to choose how intersecting constraints diff --git a/Triangulation_2/doc_tex/Triangulation_2_ref/Constrained_triangulation_2.tex b/Triangulation_2/doc_tex/Triangulation_2_ref/Constrained_triangulation_2.tex index eb209a5b0a9..257163fd6f4 100644 --- a/Triangulation_2/doc_tex/Triangulation_2_ref/Constrained_triangulation_2.tex +++ b/Triangulation_2/doc_tex/Triangulation_2_ref/Constrained_triangulation_2.tex @@ -79,7 +79,7 @@ constraints and its constrained triangulation"> \end{ccHtmlOnly} -The class \ccRefName\ of the CGAL library +The class \ccRefName\ of the \cgal\ library implements constrained triangulations. The template parameter \ccc{Traits} stands for a geometric traits class. It has to be a model diff --git a/Triangulation_2/doc_tex/Triangulation_2_ref/TriangulationTraits_2.tex b/Triangulation_2/doc_tex/Triangulation_2_ref/TriangulationTraits_2.tex index 40d1165176c..f7495e86b42 100644 --- a/Triangulation_2/doc_tex/Triangulation_2_ref/TriangulationTraits_2.tex +++ b/Triangulation_2/doc_tex/Triangulation_2_ref/TriangulationTraits_2.tex @@ -141,7 +141,7 @@ called.} \ccHasModels -All the CGAL Kernels \\ +All the \cgal\ Kernels \\ \ccRefIdfierPage{CGAL::Triangulation_euclidean_traits_2} \\ \ccRefIdfierPage{CGAL::Projection_traits_xy_3}\\ \ccc{CGAL::Projection_traits_yz_3}\\ diff --git a/Triangulation_2/doc_tex/Triangulation_2_ref/TriangulationVertexBaseWithInfo_2.tex b/Triangulation_2/doc_tex/Triangulation_2_ref/TriangulationVertexBaseWithInfo_2.tex index de8810a3a2a..0899f90898a 100644 --- a/Triangulation_2/doc_tex/Triangulation_2_ref/TriangulationVertexBaseWithInfo_2.tex +++ b/Triangulation_2/doc_tex/Triangulation_2_ref/TriangulationVertexBaseWithInfo_2.tex @@ -22,8 +22,7 @@ and provides an additional information storage. \ccRefines{\ccc{TriangulationVertexBase_2}} \ccTypes -\ccNestedType{Info} -{.} +\ccNestedType{Info}{A type which is \ccc{DefaultConstructible} and \ccc{Assignable}.} \ccCreationVariable{v} %% choose variable name diff --git a/Triangulation_2/doc_tex/Triangulation_2_ref/Triangulation_euclidean_traits_xy_3.tex b/Triangulation_2/doc_tex/Triangulation_2_ref/Triangulation_euclidean_traits_xy_3.tex index 433ea547421..33064402f41 100644 --- a/Triangulation_2/doc_tex/Triangulation_2_ref/Triangulation_euclidean_traits_xy_3.tex +++ b/Triangulation_2/doc_tex/Triangulation_2_ref/Triangulation_euclidean_traits_xy_3.tex @@ -13,10 +13,10 @@ \begin{ccRefClass}{Triangulation_euclidean_traits_xy_3} %% add template arg's if necessary -\begin{ccDeprecated} The functionality of this class has been generalized to other packages than 2D triangulations. The more general class \ccc{Projection_traits_xy_3} can be found in the 2D and 3D Linear Geometric Kernel. -\end{ccDeprecated} + +\begin{ccDeprecated} %% \ccHtmlCrossLink{} %% add further rules for cross referencing links %% \ccHtmlIndexC[class]{} %% add further index entries @@ -198,7 +198,7 @@ respectively. \ccInclude{CGAL/Triangulation_euclidean_traits_xz_3.h}\\ \ccInclude{CGAL/Triangulation_euclidean_traits_yz_3.h} - +\end{ccDeprecated} \end{ccRefClass} % +------------------------------------------------------------------------+ diff --git a/Triangulation_2/include/CGAL/Delaunay_triangulation_2.h b/Triangulation_2/include/CGAL/Delaunay_triangulation_2.h index 20559f7a137..2b87d0c42fe 100644 --- a/Triangulation_2/include/CGAL/Delaunay_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Delaunay_triangulation_2.h @@ -28,7 +28,8 @@ #include #ifndef CGAL_TRIANGULATION_2_DONT_INSERT_RANGE_OF_POINTS_WITH_INFO -#include +#include +#include #include #include @@ -307,6 +308,7 @@ public: #ifndef CGAL_TRIANGULATION_2_DONT_INSERT_RANGE_OF_POINTS_WITH_INFO private: + //top stands for tuple-or-pair template const Point& top_get_first(const std::pair& pair) const { return pair.first; } template @@ -320,10 +322,10 @@ private: std::ptrdiff_t insert_with_info(InputIterator first,InputIterator last) { size_type n = this->number_of_vertices(); - std::vector indices; + std::vector indices; std::vector points; std::vector infos; - std::size_t index=0; + std::ptrdiff_t index=0; for (InputIterator it=first;it!=last;++it){ Tuple_or_pair value=*it; points.push_back( top_get_first(value) ); @@ -331,14 +333,13 @@ private: indices.push_back(index++); } - typedef internal::Vector_property_map Point_pmap; - typedef internal::Spatial_sort_traits_with_property_map_2 Search_traits; + typedef Spatial_sort_traits_adapter_2 Search_traits; - spatial_sort(indices.begin(),indices.end(),Search_traits(Point_pmap(points),geom_traits())); + spatial_sort(indices.begin(),indices.end(),Search_traits(&(points[0]),geom_traits())); Vertex_handle v_hint; Face_handle hint; - for (typename std::vector::const_iterator + for (typename std::vector::const_iterator it = indices.begin(), end = indices.end(); it != end; ++it){ v_hint = insert(points[*it], hint); diff --git a/Triangulation_2/include/CGAL/Regular_triangulation_2.h b/Triangulation_2/include/CGAL/Regular_triangulation_2.h index 4280f6fcec3..a364dba8697 100644 --- a/Triangulation_2/include/CGAL/Regular_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Regular_triangulation_2.h @@ -28,7 +28,8 @@ #include #ifndef CGAL_TRIANGULATION_2_DONT_INSERT_RANGE_OF_POINTS_WITH_INFO -#include +#include +#include #include #include @@ -383,6 +384,7 @@ public: #ifndef CGAL_TRIANGULATION_2_DONT_INSERT_RANGE_OF_POINTS_WITH_INFO private: + //top stands for tuple-or-pair template const Weighted_point& top_get_first(const std::pair& pair) const { return pair.first; } template @@ -396,10 +398,10 @@ private: std::ptrdiff_t insert_with_info(InputIterator first,InputIterator last) { int n = number_of_vertices(); - std::vector indices; + std::vector indices; std::vector points; std::vector infos; - std::size_t index=0; + std::ptrdiff_t index=0; for (InputIterator it=first;it!=last;++it){ Tuple_or_pair pair = *it; points.push_back( top_get_first(pair) ); @@ -407,14 +409,13 @@ private: indices.push_back(index++); } - typedef internal::Vector_property_map Point_pmap; - typedef internal::Spatial_sort_traits_with_property_map_2 Search_traits; + typedef Spatial_sort_traits_adapter_2 Search_traits; - spatial_sort(indices.begin(),indices.end(),Search_traits(Point_pmap(points),geom_traits())); + spatial_sort(indices.begin(),indices.end(),Search_traits(&(points[0]),geom_traits())); Face_handle hint; Vertex_handle v_hint; - for (typename std::vector::const_iterator + for (typename std::vector::const_iterator it = indices.begin(), end = indices.end(); it != end; ++it) { diff --git a/Triangulation_3/doc_tex/Triangulation_3/Triang3.tex b/Triangulation_3/doc_tex/Triangulation_3/Triang3.tex index 6f65dff391a..2433bc154e2 100644 --- a/Triangulation_3/doc_tex/Triangulation_3/Triang3.tex +++ b/Triangulation_3/doc_tex/Triangulation_3/Triang3.tex @@ -847,7 +847,7 @@ In 2011, Pedro de Castro and Olivier Devillers implemented in release 3.8 the structural filtering method, improving the efficiency of point location. -A new demo of this package was introduced in CGAL 3.8, coded by Fei +A new demo of this package was introduced in \cgal\ 3.8, coded by Fei (Sophie) Che, who was co-mentored by Manuel Caroli and Monique Teillaud in the framework of the Google Summer of Code, 2010. diff --git a/Triangulation_3/doc_tex/Triangulation_3_ref/TriangulationVertexBaseWithInfo_3.tex b/Triangulation_3/doc_tex/Triangulation_3_ref/TriangulationVertexBaseWithInfo_3.tex index 54d8ad10635..88b429d5247 100644 --- a/Triangulation_3/doc_tex/Triangulation_3_ref/TriangulationVertexBaseWithInfo_3.tex +++ b/Triangulation_3/doc_tex/Triangulation_3_ref/TriangulationVertexBaseWithInfo_3.tex @@ -22,8 +22,8 @@ and provides an additional information storage. \ccRefines{\ccc{TriangulationVertexBase_3}} \ccTypes -\ccNestedType{Info} -{.} +\ccNestedType{Info}{A type which is \ccc{DefaultConstructible} and \ccc{Assignable}.} + \ccCreationVariable{v} %% choose variable name diff --git a/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h b/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h index 0e52632eb40..62f59e96751 100644 --- a/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h +++ b/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h @@ -32,7 +32,8 @@ #include #ifndef CGAL_TRIANGULATION_3_DONT_INSERT_RANGE_OF_POINTS_WITH_INFO -#include +#include +#include #include #include @@ -243,6 +244,7 @@ public: #ifndef CGAL_TRIANGULATION_3_DONT_INSERT_RANGE_OF_POINTS_WITH_INFO private: + //top stands for tuple-or-pair template const Point& top_get_first(const std::pair& pair) const { return pair.first; } template @@ -256,10 +258,10 @@ private: std::ptrdiff_t insert_with_info(InputIterator first,InputIterator last) { size_type n = number_of_vertices(); - std::vector indices; + std::vector indices; std::vector points; std::vector infos; - std::size_t index=0; + std::ptrdiff_t index=0; for (InputIterator it=first;it!=last;++it){ Tuple_or_pair value=*it; points.push_back( top_get_first(value) ); @@ -267,13 +269,12 @@ private: indices.push_back(index++); } - typedef internal::Vector_property_map Point_pmap; - typedef internal::Spatial_sort_traits_with_property_map_3 Search_traits; + typedef Spatial_sort_traits_adapter_3 Search_traits; - spatial_sort(indices.begin(),indices.end(),Search_traits(Point_pmap(points),geom_traits())); + spatial_sort(indices.begin(),indices.end(),Search_traits(&(points[0]),geom_traits())); Vertex_handle hint; - for (typename std::vector::const_iterator + for (typename std::vector::const_iterator it = indices.begin(), end = indices.end(); it != end; ++it){ hint = insert(points[*it], hint); diff --git a/Triangulation_3/include/CGAL/Regular_triangulation_3.h b/Triangulation_3/include/CGAL/Regular_triangulation_3.h index 5583161da8c..203a905ea95 100644 --- a/Triangulation_3/include/CGAL/Regular_triangulation_3.h +++ b/Triangulation_3/include/CGAL/Regular_triangulation_3.h @@ -31,7 +31,8 @@ #include #ifndef CGAL_TRIANGULATION_3_DONT_INSERT_RANGE_OF_POINTS_WITH_INFO -#include +#include +#include #include #include @@ -200,6 +201,7 @@ public: #ifndef CGAL_TRIANGULATION_3_DONT_INSERT_RANGE_OF_POINTS_WITH_INFO private: + //top stands for tuple-or-pair template const Weighted_point& top_get_first(const std::pair& pair) const { return pair.first; } template @@ -213,10 +215,10 @@ private: std::ptrdiff_t insert_with_info(InputIterator first,InputIterator last) { size_type n = number_of_vertices(); - std::vector indices; + std::vector indices; std::vector points; std::vector infos; - std::size_t index=0; + std::ptrdiff_t index=0; for (InputIterator it=first;it!=last;++it){ Tuple_or_pair pair = *it; points.push_back( top_get_first(pair) ); @@ -224,13 +226,12 @@ private: indices.push_back(index++); } - typedef internal::Vector_property_map Point_pmap; - typedef internal::Spatial_sort_traits_with_property_map_3 Search_traits; + typedef Spatial_sort_traits_adapter_3 Search_traits; - spatial_sort(indices.begin(),indices.end(),Search_traits(Point_pmap(points),geom_traits())); + spatial_sort( indices.begin(),indices.end(),Search_traits(&(points[0]),geom_traits()) ); Cell_handle hint; - for (typename std::vector::const_iterator + for (typename std::vector::const_iterator it = indices.begin(), end = indices.end(); it != end; ++it) { diff --git a/Triangulation_3/include/CGAL/Triangulation_3.h b/Triangulation_3/include/CGAL/Triangulation_3.h index 9a7f67521f6..84a845970f0 100644 --- a/Triangulation_3/include/CGAL/Triangulation_3.h +++ b/Triangulation_3/include/CGAL/Triangulation_3.h @@ -5498,8 +5498,8 @@ operator==(const Triangulation_3 &t1, using namespace boost; std::vector V1 (t1.points_begin(), t1.points_end()); std::vector V2 (t2.points_begin(), t2.points_end()); - std::sort(V1.begin(), V1.end(), bind(cmp1, _1, _2) == NEGATIVE); - std::sort(V2.begin(), V2.end(), bind(cmp2, _1, _2) == NEGATIVE); + std::sort(V1.begin(), V1.end(), boost::bind(cmp1, _1, _2) == NEGATIVE); + std::sort(V2.begin(), V2.end(), boost::bind(cmp2, _1, _2) == NEGATIVE); return V1 == V2; } diff --git a/Triangulation_3/include/CGAL/internal/info_check.h b/Triangulation_3/include/CGAL/internal/info_check.h new file mode 100644 index 00000000000..31d86a738bf --- /dev/null +++ b/Triangulation_3/include/CGAL/internal/info_check.h @@ -0,0 +1,44 @@ +// Copyright (c) 2010 GeometryFactory (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you may redistribute it under +// the terms of the Q Public License version 1.0. +// See the file LICENSE.QPL distributed with CGAL. +// +// 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) : Sebastien Loriot +// + +#ifndef CGAL_INTERNAL_INFO_CHECK_H +#define CGAL_INTERNAL_INFO_CHECK_H + +#include + +namespace CGAL { + +namespace internal{ + +BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(Has_typedef_Info,Info,false) + +template ::value> + struct Info_check{ + struct type{}; +}; + +template +struct Info_check{ + typedef typename T::Info type; +}; + +} } //namespace CGAL::internal + +#endif //CGAL_INTERNAL_INFO_CHECK_H diff --git a/Triangulation_3/include/CGAL/internal/spatial_sorting_traits_with_indices.h b/Triangulation_3/include/CGAL/internal/spatial_sorting_traits_with_indices.h deleted file mode 100644 index b2da4a9f508..00000000000 --- a/Triangulation_3/include/CGAL/internal/spatial_sorting_traits_with_indices.h +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) 2010 GeometryFactory (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. -// -// 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) : Sebastien Loriot -// - -#ifndef CGAL_INTERNAL_SPATIAL_SORTING_TRAITS_WITH_INDICES -#define CGAL_INTERNAL_SPATIAL_SORTING_TRAITS_WITH_INDICES - -#include -#include - -namespace CGAL { - -namespace internal{ - -BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(Has_typedef_Info,Info,false) - -template ::value> - struct Info_check{ - struct type{}; -}; - -template -struct Info_check{ - typedef typename T::Info type; -}; - -template sizeof(int*))> -struct Arg_type_selection; - -template -struct Arg_type_selection{ - typedef T type; -}; - -template -struct Arg_type_selection{ - typedef const T& type; -}; - -template -class Vector_property_map{ - const std::vector& data; -public: - typedef std::size_t key_type; - Vector_property_map(const std::vector& input):data(input){} - - const T& operator[](key_type i) const{ - return data[i]; - } -}; - -template -class Spatial_sort_traits_with_property_map_3:public Base_traits{ - PointPropertyMap accessor_; -public: - Spatial_sort_traits_with_property_map_3(const PointPropertyMap& accessor,Base_traits base=Base_traits()) - :Base_traits(base),accessor_(accessor){} - - typedef Base_traits Gt; - typedef typename PointPropertyMap::key_type Point_3; - typedef typename Arg_type_selection::type Arg_type; - - struct Less_x_3 : public Base_traits::Less_x_3{ - Less_x_3(const PointPropertyMap& accessor,const typename Base_traits::Less_x_3& base): - Base_traits::Less_x_3(base),accessor_(accessor){} - const PointPropertyMap& accessor_; - bool operator()(Arg_type p,Arg_type q) const { - return static_cast(this)->operator()(accessor_[p],accessor_[q]); - } - }; - - struct Less_y_3 : public Base_traits::Less_y_3{ - Less_y_3(const PointPropertyMap& accessor,const typename Base_traits::Less_y_3& base): - Base_traits::Less_y_3(base),accessor_(accessor){} - const PointPropertyMap& accessor_; - bool operator()(Arg_type p,Arg_type q) const { - return static_cast(this)->operator()(accessor_[p],accessor_[q]); - } - }; - - struct Less_z_3 : public Base_traits::Less_z_3{ - Less_z_3(const PointPropertyMap& accessor,const typename Base_traits::Less_z_3& base): - Base_traits::Less_z_3(base),accessor_(accessor){} - const PointPropertyMap& accessor_; - bool operator()(Arg_type p,Arg_type q) const { - return static_cast(this)->operator()(accessor_[p],accessor_[q]); - } - }; - - Less_x_3 less_x_3_object () const {return Less_x_3(accessor_,static_cast(this)->less_x_3_object() );} - Less_y_3 less_y_3_object () const {return Less_y_3(accessor_,static_cast(this)->less_y_3_object() );} - Less_z_3 less_z_3_object () const {return Less_z_3(accessor_,static_cast(this)->less_z_3_object() );} -}; - -template -class Spatial_sort_traits_with_property_map_2:public Base_traits{ - PointPropertyMap accessor_; -public: - Spatial_sort_traits_with_property_map_2(const PointPropertyMap& accessor,Base_traits base=Base_traits()) - :Base_traits(base),accessor_(accessor){} - - typedef Base_traits Gt; - typedef typename PointPropertyMap::key_type Point_2; - typedef typename Arg_type_selection::type Arg_type; - - struct Less_x_2 : public Base_traits::Less_x_2{ - Less_x_2(const PointPropertyMap& accessor,const typename Base_traits::Less_x_2& base): - Base_traits::Less_x_2(base),accessor_(accessor){} - const PointPropertyMap& accessor_; - bool operator()(Arg_type p,Arg_type q) const { - return static_cast(this)->operator()(accessor_[p],accessor_[q]); - } - }; - - struct Less_y_2 : public Base_traits::Less_y_2{ - Less_y_2(const PointPropertyMap& accessor,const typename Base_traits::Less_y_2& base): - Base_traits::Less_y_2(base),accessor_(accessor){} - const PointPropertyMap& accessor_; - bool operator()(Arg_type p,Arg_type q) const { - return static_cast(this)->operator()(accessor_[p],accessor_[q]); - } - }; - - Less_x_2 less_x_2_object () const {return Less_x_2(accessor_,static_cast(this)->less_x_2_object() );} - Less_y_2 less_y_2_object () const {return Less_y_2(accessor_,static_cast(this)->less_y_2_object() );} - -}; -} } //namespace CGAL::internal - -#endif //CGAL_INTERNAL_SPATIAL_SORTING_TRAITS_WITH_INDICES diff --git a/iostream/include/CGAL/IO/io_tags.h b/iostream/include/CGAL/IO/io_tags.h index 6f7a59e5bcd..92d9a7e3da7 100644 --- a/iostream/include/CGAL/IO/io_tags.h +++ b/iostream/include/CGAL/IO/io_tags.h @@ -26,7 +26,7 @@ #define CGAL_IO_TAGS_H #include -#include +#include namespace CGAL {
3.8  (XXX 2011) +
3.9  (XXX 2011) +
3.8  (April 2011)
3.7  (October 2010)
3.6.1  (June 2010)
3.6  (March 2010) @@ -97,10 +98,37 @@ Number of lines of code of CGAL

-

Release 3.8

+

Release 3.9

Release date: XXX 2011

+

+CGAL 3.9 offers the following improvements and new functionality :

+ +

General

+
    +
  • The class Root_of_2 is now deprecated. It is recommended to use the class Sqrt_extension instead.
  • +
  • The class Sqrt_extension is now used everywhere in CGAL where an algebraic number of degree 2 is needed. + This change has been done in the Root_of_traits mechanism (indirectly packages 2D Circular kernel and 3D Spherical kernel) + and the packages 2D Segment Delaunay Graphs and 2D Arrangements.
  • +
  • Various fixes in the manual.
  • +
+ +

dD Kernel

+
  • The d-dimensional kernel concept and models have been modified + to additionally provide two new functors Less_coordinate_d and Point_dimension_d.
  • +

    Spatial_sorting (major new feature added)

    +
      +
    • General dimension is now supported.
    • +
    • Hilbert sorting admits now two policies: splitting at + median or at middle (see user manual).
    • +
    • Using a property map, sorting on keys instead of points is now easier
    • +
    + +

    Release 3.8

    +
    +

    Release date: April 2011

    +

    CGAL 3.8 offers the following improvements and new functionality :

    diff --git a/Installation/cmake/modules/CGALConfig_binary.cmake.in b/Installation/cmake/modules/CGALConfig_binary.cmake.in index ee2a7c4c1e3..ac6f6725760 100644 --- a/Installation/cmake/modules/CGALConfig_binary.cmake.in +++ b/Installation/cmake/modules/CGALConfig_binary.cmake.in @@ -8,6 +8,9 @@ set(CGAL_CONFIG_LOADED TRUE) +set(CGAL_INSTALLATION_PACKAGE_DIR "@CGAL_INSTALLATION_PACKAGE_DIR@") +set(CGAL_CORE_PACKAGE_DIR "@CGAL_CORE_PACKAGE_DIR@") + set(CGAL_MAJOR_VERSION "@CGAL_MAJOR_VERSION@" ) set(CGAL_MINOR_VERSION "@CGAL_MINOR_VERSION@" ) set(CGAL_BUILD_VERSION "@CGAL_BUILD_VERSION@" ) diff --git a/Installation/cmake/modules/CGAL_Common.cmake b/Installation/cmake/modules/CGAL_Common.cmake index 5b21a32ceba..7aacd7846cb 100644 --- a/Installation/cmake/modules/CGAL_Common.cmake +++ b/Installation/cmake/modules/CGAL_Common.cmake @@ -9,6 +9,10 @@ endif() include(CGAL_Macros) +if(RUNNING_CGAL_AUTO_TEST) +# Just to avoid a warning from CMake if that variable is set on the command line... +endif() + # Common settings for CGAL cmake scripts if( NOT CGAL_COMMON_FILE_INCLUDED ) set(CGAL_COMMON_FILE_INCLUDED 1 ) diff --git a/Installation/cmake/modules/CGAL_SetupDependencies.cmake b/Installation/cmake/modules/CGAL_SetupDependencies.cmake index ce5c31fa041..c40deb88b46 100644 --- a/Installation/cmake/modules/CGAL_SetupDependencies.cmake +++ b/Installation/cmake/modules/CGAL_SetupDependencies.cmake @@ -30,8 +30,3 @@ if ( WITH_NTL ) endif( WITH_NTL ) include(CGAL_SetupBoost) - -if ( MSVC ) - add_to_cached_list(CGAL_3RD_PARTY_LIBRARIES "psapi.lib" ) -endif( MSVC ) - diff --git a/Installation/config/testfiles/CGAL_CFG_NO_CPP0X_ISFINITE.cpp b/Installation/config/testfiles/CGAL_CFG_NO_CPP0X_ISFINITE.cpp index 871e7db876c..1f495cd0170 100644 --- a/Installation/config/testfiles/CGAL_CFG_NO_CPP0X_ISFINITE.cpp +++ b/Installation/config/testfiles/CGAL_CFG_NO_CPP0X_ISFINITE.cpp @@ -24,6 +24,11 @@ #include #include +#ifdef isfinite +# error isfinite cannot be a macro if one want to use C++0x std::isfinite +// On Intel Compiler 12, isfinite is a macro in :-( +#endif + template < typename T > void use(T) {} diff --git a/Installation/config/testfiles/CGAL_CFG_NO_CPP0X_STATIC_ASSERT.cpp b/Installation/config/testfiles/CGAL_CFG_NO_CPP0X_STATIC_ASSERT.cpp index 0a0e1d1a352..9fe6379dd13 100644 --- a/Installation/config/testfiles/CGAL_CFG_NO_CPP0X_STATIC_ASSERT.cpp +++ b/Installation/config/testfiles/CGAL_CFG_NO_CPP0X_STATIC_ASSERT.cpp @@ -18,7 +18,7 @@ // Author(s) : Marc Glisse //| If a compiler does not support static_assert (from C++0x) -//| CGAL_CFG_NO_STATIC_ASSERT is set. +//| CGAL_CFG_NO_CPP0X_STATIC_ASSERT is set. int main(){ static_assert(true,"Everything is fine"); diff --git a/Installation/doc_tex/Installation/appendix.tex b/Installation/doc_tex/Installation/appendix.tex index c1120726340..46f1dfc24b0 100644 --- a/Installation/doc_tex/Installation/appendix.tex +++ b/Installation/doc_tex/Installation/appendix.tex @@ -58,7 +58,7 @@ The Bourne-shell script \texttt{cgal\_create\_cmake\_script} is contained in the \texttt{cgal\_create\_cmake\_script} in an application directory creates a \texttt{CMakeLists.txt} containing rules for every \texttt{*.cpp} file there. Currently, that script only works for applications that only need -the CGAL and CGALCore libraries. +the \cgal\ and CGALCore libraries. %% diff --git a/Installation/doc_tex/Installation/installation.tex b/Installation/doc_tex/Installation/installation.tex index ba2e8fad975..c264ba396ef 100644 --- a/Installation/doc_tex/Installation/installation.tex +++ b/Installation/doc_tex/Installation/installation.tex @@ -140,6 +140,8 @@ installer from \boostprodownloadpage. Since \texttt{Boost.Thread} is required, make sure to either install the precompiled libraries for your compiler or to build \texttt{libboost-thread}. +As on Windows there is no canonical directory for where to find \boost\ we recommend that you define the environment variable \ccc{BOOST_ROOT} and set it +to where you have installed \boost, that is it should be something like \path|C:\boost\boost_1_41_0|. \subsection{GMP and MPFR \label{thirdparty:GMP} \label{thirdparty:MPFR}} @@ -803,9 +805,9 @@ cmake -DCGAL_DIR=CGAL-3.8 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS=-O2 -DCGAL_ For relatively simple programs the Bourne-shell script \texttt{cgal\_create\_cmake\_script} can be used (a short description of this file is provided in Appendix \ref{sec:create_cgal_cmake_script}). -More generally, within a cmake script, once CGAL has been found using \texttt{find\_package} +More generally, within a cmake script, once \cgal\ has been found using \texttt{find\_package} the variable \texttt{CGAL\_USE\_FILE} is set to a compilation environment CMake file. Including -this file within a cmake script sets up include paths and libraries to link with of CGAL and third party libraries. +this file within a cmake script sets up include paths and libraries to link with of \cgal\ and third party libraries. \section{Summary of Configuration Variables} @@ -984,7 +986,7 @@ Under Linux, the GMPXX is also searched for, and you may specify the following v \index{cgal!general-config-cmake-vars-dep-mpfi}\index{cgal configuration cmake variables - dependencies - mpfi} \subsubsection{MPFI library} -CGAL provides a number type based on this library, but the CGAL library +\cgal\ provides a number type based on this library, but the \cgal\ library itself does not depend on MPFI. This means that this library must be configured when compiling an application that uses the above number type. diff --git a/Installation/include/CGAL/internal/gcc_cpp0x.h b/Installation/include/CGAL/internal/gcc_cpp0x.h index 76db7a38313..5a5e0ccade6 100644 --- a/Installation/include/CGAL/internal/gcc_cpp0x.h +++ b/Installation/include/CGAL/internal/gcc_cpp0x.h @@ -35,6 +35,7 @@ #undef CGAL_CFG_NO_CPP0X_ISFINITE #undef CGAL_CFG_NO_CPP0X_LONG_LONG #undef CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE +#undef CGAL_CFG_NO_CPP0X_STATIC_ASSERT #undef CGAL_CFG_NO_CPP0X_TUPLE #undef CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES diff --git a/Intersections_3/include/CGAL/Intersections_3/intersection_3_1_impl.h b/Intersections_3/include/CGAL/Intersections_3/intersection_3_1_impl.h index 3eebdc99584..c44eb81f555 100644 --- a/Intersections_3/include/CGAL/Intersections_3/intersection_3_1_impl.h +++ b/Intersections_3/include/CGAL/Intersections_3/intersection_3_1_impl.h @@ -266,17 +266,21 @@ intersection_collinear_segments(const typename K::Segment_3 &s1, if ( cln_order(p,r,q) ){ if ( cln_order(p,s,q) ) return make_object(s2); - if ( cln_order(r,p,s) ) - return r!=p ? make_object( typename K::Segment_3(r,p) ) : make_object(p); - else - return r!=q ? make_object( typename K::Segment_3(r,q) ) : make_object(q); + if ( cln_order(r,p,s) ){ + if (r!=p) return make_object( typename K::Segment_3(r,p) ); + if ( cln_order(r,q,s) ) return make_object(s1); + return make_object(p); + } + return r!=q ? make_object( typename K::Segment_3(r,q) ) : make_object(q); } if ( cln_order(p,s,q) ){ - if ( cln_order(r,p,s) ) - return s!=p ? make_object( typename K::Segment_3(s,p) ) : make_object(p); - else - return s!=q ? make_object( typename K::Segment_3(s,q) ) : make_object(q); + if ( cln_order(r,p,s) ){ + if (s!=p) return make_object( typename K::Segment_3(s,p) ); + if (cln_order(r,q,s)) return make_object(s1); + return make_object(p); + } + return s!=q ? make_object( typename K::Segment_3(s,q) ) : make_object(q); } if ( cln_order(r,p,s) ) diff --git a/Intersections_3/include/CGAL/Triangle_3_Triangle_3_intersection.h b/Intersections_3/include/CGAL/Triangle_3_Triangle_3_intersection.h index cf05a7373a7..05958fca41e 100644 --- a/Intersections_3/include/CGAL/Triangle_3_Triangle_3_intersection.h +++ b/Intersections_3/include/CGAL/Triangle_3_Triangle_3_intersection.h @@ -138,8 +138,8 @@ intersection( } //The supporting planes of the triangles intersect along a line. - Object inter1=inter(t1,*line); - Object inter2=inter(t2,*line); + Object inter1=intersection_coplanar(t1,*line,k); + Object inter2=intersection_coplanar(t2,*line,k); const typename Kernel::Segment_3* sgt1=CGAL::object_cast(&inter1); diff --git a/Intersections_3/test/Intersections_3/segment_segment.cpp b/Intersections_3/test/Intersections_3/segment_segment.cpp index 4a42c464774..fecf2b873f1 100644 --- a/Intersections_3/test/Intersections_3/segment_segment.cpp +++ b/Intersections_3/test/Intersections_3/segment_segment.cpp @@ -9,6 +9,87 @@ typedef CGAL::Cartesian K; // The construction test has to be working // The equal test has to be working +#define TEST_CASE_SEGMENT_BASE(i,j,k,l,i1,i2) \ +{\ + typename K::Segment_3 s1(pts[i],pts[j]); \ + typename K::Segment_3 s2(pts[k],pts[l]); \ + CGAL::Object obj= CGAL::intersection(s1,s2); \ + typename K::Segment_3 s; \ + typename K::Segment_3 res(pts[i1],pts[i2]);\ + if (!CGAL::assign(s,obj) || ( s!=res && s!=res.opposite() ) ) {\ + std::cerr << "ERROR test-case "<< i << j << k < +void all_cases_collinear(typename K::Point_3 pts[4]){ + std::cout << "4 points cases\n"; + TEST_CASE_EMPTY(0,1,2,3) + TEST_CASE_SEGMENT(0,2,1,3,1,2) + TEST_CASE_SEGMENT(0,3,2,1,1,2) + std::cout << "3 points cases\n"; + TEST_CASE_SEGMENT(0,1,0,2,0,1) + TEST_CASE_SEGMENT(0,2,1,2,1,2) + TEST_CASE_POINT(1,2,0,1,1) + std::cout << "2 points cases\n"; + TEST_CASE_SEGMENT(1,2,1,2,1,2) +} + template void _test_intersection_construct(K) { @@ -68,5 +149,9 @@ int main() { K k; _test_intersection_construct(k); + + + K::Point_3 pts[4] = {K::Point_3(0,0,0),K::Point_3(1,0,0),K::Point_3(2,0,0),K::Point_3(3,0,0)}; + all_cases_collinear(pts); return 0; } diff --git a/Kernel_23/doc_tex/Kernel_23/kernel_representation.tex b/Kernel_23/doc_tex/Kernel_23/kernel_representation.tex index 9afef9fc85a..3ac71180ddc 100644 --- a/Kernel_23/doc_tex/Kernel_23/kernel_representation.tex +++ b/Kernel_23/doc_tex/Kernel_23/kernel_representation.tex @@ -44,7 +44,7 @@ kernel concept. For all kernel objects types, the types \ccHtmlNoLinksFrom{\ccc{CGAL::Type}} and \ccHtmlNoLinksFrom{\ccc{Kernel::Type}} are identical. -CGAL offers four families of concrete models for the concept Kernel, +\cgal\ offers four families of concrete models for the concept Kernel, two based on the \ccHtmlNoLinksFrom{Cartesian} representation of points and two based on the homogeneous representation of points. The interface of the kernel objects is designed such that it works well @@ -92,7 +92,7 @@ this case. With \ccc{Cartesian}, both \ccc{FieldNumberType}. \ccc{Cartesian} uses reference counting internally to -save copying costs. CGAL also provides +save copying costs. \cgal\ also provides \ccc{Simple_cartesian}, a kernel that uses \ccHtmlNoLinksFrom{Cartesian} representation but no reference counting. Debugging is easier with @@ -131,7 +131,7 @@ quotients, i.e., a numerator and a denominator. With \ccc{RingNumberType}. \ccc{Homogeneous} uses reference counting internally -to save copying costs. CGAL also provides +to save copying costs. \cgal\ also provides \ccc{Simple_homogeneous}, a kernel that uses \ccHtmlNoLinksFrom{homogeneous} representation but no reference counting. Debugging is easier with diff --git a/Kernel_23/doc_tex/Kernel_23_ref/Kernel.tex b/Kernel_23/doc_tex/Kernel_23_ref/Kernel.tex index 7a4dd81b9f8..0ce9097582a 100644 --- a/Kernel_23/doc_tex/Kernel_23_ref/Kernel.tex +++ b/Kernel_23/doc_tex/Kernel_23_ref/Kernel.tex @@ -35,7 +35,7 @@ especially for equality testing. \ccNestedType{RT}{a model of \ccc{RingNumberType}} The following types describe the return types of predicates. They typically -map to \ccc{bool} and CGAL kernel enum types, except when an interval arithmetic +map to \ccc{bool} and \cgal\ kernel enum types, except when an interval arithmetic number type is used such as within the filtering kernels, in which case it is \ccc{Uncertain} or similar. diff --git a/Kernel_23/doc_tex/Kernel_23_ref/intersection.tex b/Kernel_23/doc_tex/Kernel_23_ref/intersection.tex index d3ef3720711..3c31c52ac68 100644 --- a/Kernel_23/doc_tex/Kernel_23_ref/intersection.tex +++ b/Kernel_23/doc_tex/Kernel_23_ref/intersection.tex @@ -458,6 +458,7 @@ type A & type B & \parbox{4 cm}{\vspace{1 mm}{return type}} \\
    +
    Point_3
    Segment_3
    Triangle_3
    std::vector < Point_3 >