diff --git a/Apollonius_graph_2/include/CGAL/Parabola_segment_2.h b/Apollonius_graph_2/include/CGAL/Parabola_segment_2.h index 20883169ba7..63faa2d9c92 100644 --- a/Apollonius_graph_2/include/CGAL/Parabola_segment_2.h +++ b/Apollonius_graph_2/include/CGAL/Parabola_segment_2.h @@ -63,7 +63,7 @@ struct Parabola_segment_2 : public Parabola_2< Gt > } int compute_k(const FT tt, const FT STEP) const { - return int(CGAL::to_double(CGAL::sqrt(tt / STEP))); + return int(CGAL::to_double(CGAL::approximate_sqrt(tt / STEP))); } // s0 and s1 define a desired drawing "range" diff --git a/BGL/doc/BGL/PackageDescription.txt b/BGL/doc/BGL/PackageDescription.txt index 68a57a60d14..395584b1b30 100644 --- a/BGL/doc/BGL/PackageDescription.txt +++ b/BGL/doc/BGL/PackageDescription.txt @@ -509,8 +509,7 @@ the requirement for traversal of all faces in a graph. /// I/O Functions for the \ref IOStream3MF /// \ingroup PkgBGLIOFct -/// \defgroup PkgBGLIOFctDeprecated I/O Functions (Deprecated) -/// \ingroup PkgBGLIOFct + /*! \addtogroup PkgBGLPropertiesDynamic diff --git a/BGL/include/CGAL/boost/graph/IO/OFF.h b/BGL/include/CGAL/boost/graph/IO/OFF.h index 25f76b2b1d6..441b088597a 100644 --- a/BGL/include/CGAL/boost/graph/IO/OFF.h +++ b/BGL/include/CGAL/boost/graph/IO/OFF.h @@ -247,36 +247,7 @@ bool read_OFF(const std::string& fname, } // namespace IO -#ifndef CGAL_NO_DEPRECATED_CODE -/*! - \ingroup PkgBGLIOFctDeprecated - - \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_OFF()` should be used instead. -*/ -template -CGAL_DEPRECATED bool read_off(std::istream& is, Graph& g, const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::read_OFF(is, g, np); -} - -/*! -\ingroup PkgBGLIOFctDeprecated - -\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_OFF()` should be used instead. -*/ -template -CGAL_DEPRECATED bool read_off(const char* fname, Graph& g, const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::read_OFF(fname, g, np); -} -template -CGAL_DEPRECATED bool read_off(const std::string& fname, Graph& g) -{ - return read_off(fname.c_str(), g, parameters::default_values()); -} - -#endif // CGAL_NO_DEPRECATED_CODE //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -453,31 +424,6 @@ bool write_OFF(const std::string& fname, } // namespace IO -#ifndef CGAL_NO_DEPRECATED_CODE - -/*! - \ingroup PkgBGLIOFctDeprecated - - \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_OFF()` should be used instead. -*/ -template -CGAL_DEPRECATED bool write_off(std::ostream& os, const Graph& g, const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::write_OFF(os, g, np); -} - -/*! -\ingroup PkgBGLIOFctDeprecated - -\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_OFF()` should be used instead. -*/ -template -CGAL_DEPRECATED bool write_off(const char* fname, const Graph& g, const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::write_OFF(fname, g, np); -} - -#endif // CGAL_NO_DEPRECATED_CODE } // namespace CGAL diff --git a/BGL/include/CGAL/boost/graph/IO/VTK.h b/BGL/include/CGAL/boost/graph/IO/VTK.h index 931c744765e..cfc33c2b867 100644 --- a/BGL/include/CGAL/boost/graph/IO/VTK.h +++ b/BGL/include/CGAL/boost/graph/IO/VTK.h @@ -529,20 +529,7 @@ bool write_VTP(const std::string& fname, const Graph& g, const CGAL_NP_CLASS& np } // namespace IO -#ifndef CGAL_NO_DEPRECATED_CODE -/*! - \ingroup PkgBGLIOFctDeprecated - - \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_VTP()` should be used instead. -*/ -template -CGAL_DEPRECATED bool write_vtp(std::ostream& os, const Graph& g, const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::write_VTP(os, g, np); -} - -#endif // CGAL_NO_DEPRECATED_CODE } // namespace CGAL diff --git a/BGL/include/CGAL/boost/graph/IO/WRL.h b/BGL/include/CGAL/boost/graph/IO/WRL.h index b92429a193b..b2179a8907c 100644 --- a/BGL/include/CGAL/boost/graph/IO/WRL.h +++ b/BGL/include/CGAL/boost/graph/IO/WRL.h @@ -111,20 +111,7 @@ bool write_WRL(const std::string& fname, const Graph& g, const CGAL_NP_CLASS& np } // namespace IO -#ifndef CGAL_NO_DEPRECATED_CODE -/*! - \ingroup PkgBGLIOFctDeprecated - - \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_WRL()` should be used instead. -*/ -template -CGAL_DEPRECATED bool write_wrl(std::ostream& os, const Graph& g, const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::write_WRL(os, g, np); -} - -#endif // CGAL_NO_DEPRECATED_CODE } // namespace CGAL diff --git a/BGL/include/CGAL/boost/graph/iterator.h b/BGL/include/CGAL/boost/graph/iterator.h index cef4a913cad..e26d7892cbd 100644 --- a/BGL/include/CGAL/boost/graph/iterator.h +++ b/BGL/include/CGAL/boost/graph/iterator.h @@ -871,7 +871,54 @@ private: */ template class Face_around_face_circulator -{}; +#ifndef DOXYGEN_RUNNING + : public boost::iterator_adaptor< + Face_around_face_circulator // Derived + , Halfedge_around_face_circulator // Base + , typename boost::graph_traits::face_descriptor // Value + , Bidirectional_circulator_tag // CategoryOrTraversal + , typename boost::graph_traits::face_descriptor // Reference + > +#endif +{ + internal::Opposite_face fct; + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + +public: +#ifndef DOXYGEN_RUNNING + typedef std::size_t size_type; +#endif + + Face_around_face_circulator() + {} + + Face_around_face_circulator(halfedge_descriptor h, const Graph& g) + : Face_around_face_circulator::iterator_adaptor_(Halfedge_around_face_circulator(h,g)), fct(g) + {} + +#ifndef DOXYGEN_RUNNING + + explicit operator bool() const + { + return (! (this->base_reference() == nullptr)); + } + + bool operator== (void*) const + { + return this->base_reference()== nullptr; + } + + bool operator!= (void*) const + { + return this->base_reference()!= nullptr; + } + +private: + friend class boost::iterator_core_access; + typename boost::graph_traits::face_descriptor dereference() const { return fct(*this->base_reference()); } +#endif + +}; /** * \ingroup PkgBGLIterators diff --git a/BGL/test/BGL/CMakeLists.txt b/BGL/test/BGL/CMakeLists.txt index 016e0009d4f..6affc9511d8 100644 --- a/BGL/test/BGL/CMakeLists.txt +++ b/BGL/test/BGL/CMakeLists.txt @@ -38,7 +38,6 @@ create_single_source_cgal_program("test_graph_traits.cpp") create_single_source_cgal_program("test_Properties.cpp") create_single_source_cgal_program("bench_read_from_stream_vs_add_face_and_add_faces.cpp") create_single_source_cgal_program("graph_traits_inheritance.cpp" ) -create_single_source_cgal_program("test_deprecated_io.cpp") find_package(OpenMesh QUIET) if(OpenMesh_FOUND) @@ -69,8 +68,6 @@ if (VTK_FOUND AND VTK_LIBRARIES) message(STATUS "VTK ${VTK_VERSION} found ${VTK_LIBRARIES}") target_link_libraries(test_bgl_read_write PRIVATE ${VTK_LIBRARIES}) target_compile_definitions(test_bgl_read_write PRIVATE -DCGAL_USE_VTK -DNOMINMAX) - target_link_libraries(test_deprecated_io PRIVATE ${VTK_LIBRARIES}) - target_compile_definitions(test_deprecated_io PRIVATE -DCGAL_USE_VTK -DNOMINMAX) else() message(STATUS "Tests that use VTK will not be compiled.") endif() #VTK_FOUND diff --git a/BGL/test/BGL/test_circulator.cpp b/BGL/test/BGL/test_circulator.cpp index cd0a18cbbe4..58c56bbd6df 100644 --- a/BGL/test/BGL/test_circulator.cpp +++ b/BGL/test/BGL/test_circulator.cpp @@ -18,6 +18,7 @@ typedef GraphTraits::edge_descriptor edge_descriptor; typedef GraphTraits::out_edge_iterator out_edge_iterator; typedef GraphTraits::in_edge_iterator in_edge_iterator; +typedef CGAL::Face_around_face_circulator face_around_face_circulator; typedef CGAL::Halfedge_around_face_circulator halfedge_around_face_circulator; typedef CGAL::Halfedge_around_target_circulator halfedge_around_target_circulator; typedef CGAL::Vertex_around_target_circulator vertex_around_target_circulator; @@ -32,6 +33,7 @@ typedef CGAL::Vertex_around_target_iterator vertex_around_target_ite int main(int argc, char* argv[]) { + BOOST_CONCEPT_ASSERT((CGAL::Concepts::BidirectionalCirculator)); BOOST_CONCEPT_ASSERT((CGAL::Concepts::BidirectionalCirculator)); BOOST_CONCEPT_ASSERT((CGAL::Concepts::BidirectionalCirculator)); BOOST_CONCEPT_ASSERT((CGAL::Concepts::BidirectionalCirculator)); @@ -62,6 +64,14 @@ int main(int argc, char* argv[]) }while(hafc != done); } + { + face_around_face_circulator fafc(hd,P), done(fafc); + + do { + ++fafc; + }while(fafc != done); + } + { halfedge_around_target_circulator havc(hd,P), done(havc); vertex_descriptor vd = target(hd,P); diff --git a/BGL/test/BGL/test_deprecated_io.cpp b/BGL/test/BGL/test_deprecated_io.cpp deleted file mode 100644 index 8c22b9f17df..00000000000 --- a/BGL/test/BGL/test_deprecated_io.cpp +++ /dev/null @@ -1,59 +0,0 @@ -#include - -#include -#include -#include -#include -#include - -#include -#include -#include - - -typedef CGAL::Simple_cartesian Kernel; -typedef Kernel::Point_3 Point_3; -typedef CGAL::Surface_mesh SM; - -int main() -{ - // OFF - SM sm_in, sm_out; - Point_3 p0(0,0,0), p1(1,0,0), p2(0,1,0); - CGAL::make_triangle(p0, p1, p2, sm_out); - bool ok = CGAL::write_off("tmp_deprecated.off", sm_out); - assert(ok); - ok = CGAL::read_off("tmp_deprecated.off", sm_in); - assert(ok); - assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1); - sm_in.clear(); - - std::ofstream os("tmp_deprecated.off"); - ok = CGAL::write_off(os, sm_out); - assert(ok); - os.close(); - std::ifstream is("tmp_deprecated.off"); - ok = CGAL::read_off(is, sm_in); - assert(ok); - assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1); - is.close(); - sm_in.clear(); -#ifdef CGAL_USE_VTK - //vtk - os.open("tmp_deprecated.vtp"); - ok = CGAL::write_vtp(os, sm_out); - assert(ok); - os.close(); - - ok = CGAL::IO::read_VTP("tmp_deprecated.vtp", sm_in); - assert(ok); - assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1); - sm_in.clear(); -#endif - //wrl - os.open("tmp_deprecated.wrl"); - ok = CGAL::write_wrl(os, sm_out); - assert(ok); - os.close(); - return EXIT_SUCCESS; -} diff --git a/CGAL_Core/include/CGAL/CORE/Config.h b/CGAL_Core/include/CGAL/CORE/Config.h index 9f49a7f5986..36a342a5f73 100644 --- a/CGAL_Core/include/CGAL/CORE/Config.h +++ b/CGAL_Core/include/CGAL/CORE/Config.h @@ -29,12 +29,10 @@ #include -#ifdef CGAL_TEST_SUITE -// disabled for the testsuite to avoid `w` -#define CGAL_CORE_warning_msg(X ,Y) -// if (!(X)) CGAL_error_msg(Y) -#else +#ifdef CGAL_CORE_DEBUG #define CGAL_CORE_warning_msg(X ,Y) CGAL_warning_msg(X ,Y) +#else +#define CGAL_CORE_warning_msg(X ,Y) #endif diff --git a/Documentation/doc/resources/1.14.0/menu_version.js b/Documentation/doc/resources/1.14.0/menu_version.js index 0c2ca745205..5a33e8c8f23 100644 --- a/Documentation/doc/resources/1.14.0/menu_version.js +++ b/Documentation/doc/resources/1.14.0/menu_version.js @@ -6,10 +6,10 @@ var current_version_local = 'master' var all_versions = [ 'master', - '6.1-beta1', - '6.0.1', + '6.1-beta2', + '6.0.2', 'latest', - '5.6.2', + '5.6.3', '5.5.5', '5.4.5', '5.3.2', diff --git a/Documentation/doc/resources/1.8.13/menu_version.js b/Documentation/doc/resources/1.8.13/menu_version.js index 0c2ca745205..5a33e8c8f23 100644 --- a/Documentation/doc/resources/1.8.13/menu_version.js +++ b/Documentation/doc/resources/1.8.13/menu_version.js @@ -6,10 +6,10 @@ var current_version_local = 'master' var all_versions = [ 'master', - '6.1-beta1', - '6.0.1', + '6.1-beta2', + '6.0.2', 'latest', - '5.6.2', + '5.6.3', '5.5.5', '5.4.5', '5.3.2', diff --git a/Documentation/doc/resources/1.9.6/menu_version.js b/Documentation/doc/resources/1.9.6/menu_version.js index 0c2ca745205..5a33e8c8f23 100644 --- a/Documentation/doc/resources/1.9.6/menu_version.js +++ b/Documentation/doc/resources/1.9.6/menu_version.js @@ -6,10 +6,10 @@ var current_version_local = 'master' var all_versions = [ 'master', - '6.1-beta1', - '6.0.1', + '6.1-beta2', + '6.0.2', 'latest', - '5.6.2', + '5.6.3', '5.5.5', '5.4.5', '5.3.2', diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_4.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_4.h new file mode 100644 index 00000000000..ebd9f99e7f4 --- /dev/null +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_4.h @@ -0,0 +1,221 @@ +// Copyright (c) 2025 GeometryFactory (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org) +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// +// Author(s) : Andreas Fabri + +#ifndef CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_4_H +#define CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_4_H + +#include +#include +#include +#include + +namespace CGAL { namespace internal { namespace Static_filters_predicates { + + + +template < typename K_base > +class Orientation_4 + : public K_base::Orientation_4 +{ + typedef typename K_base::Orientation Orientation; + typedef typename K_base::Point_4 Point_4; + typedef typename K_base::Orientation_4 Base; + +public: + using Base::operator(); + + Orientation + operator()(const Point_4 &p, const Point_4 &q, + const Point_4 &r, const Point_4 &s, + const Point_4 &t) const + { + CGAL_BRANCH_PROFILER_3("semi-static failures/attempts/calls to : Orientation_4", tmp); + + double p0, p1, p2, p3, q0, q1, q2, q3, r0, r1, r2, r3, s0, s1, s2, s3, t0, t1, t2, t3; + + if (fit_in_double(p.c0(), p0) && fit_in_double(p.c1(), p1) && + fit_in_double(p.c2(), p2) && fit_in_double(p.c3(), p3) && + fit_in_double(q.c0(), q0) && fit_in_double(q.c1(), q1) && + fit_in_double(q.c2(), q2) && fit_in_double(q.c3(), q3) && + fit_in_double(r.c0(), r0) && fit_in_double(r.c1(), r1) && + fit_in_double(r.c2(), r2) && fit_in_double(r.c3(), r3) && + fit_in_double(s.c0(), s0) && fit_in_double(s.c1(), s1) && + fit_in_double(s.c2(), s2) && fit_in_double(s.c3(), s3) && + fit_in_double(t.c0(), t0) && fit_in_double(t.c1(), t1) && + fit_in_double(t.c2(), t2) && fit_in_double(t.c3(), t3) ) + { + CGAL_assertion_code(Orientation should_be = Base::operator()(p, q, r, s, t)); +double m01; + m01 = (q0 - p0); + double m02; + m02 = (r0 - p0); + double m03; + m03 = (s0 - p0); + double m04; + m04 = (t0 - p0); + double m11; + m11 = (q1 - p1); + double m12; + m12 = (r1 - p1); + double m13; + m13 = (s1 - p1); + double m14; + m14 = (t1 - p1); + double m21; + m21 = (q2 - p2); + double m22; + m22 = (r2 - p2); + double m23; + m23 = (s2 - p2); + double m24; + m24 = (t2 - p2); + double m31; + m31 = (q3 - p3); + double m32; + m32 = (r3 - p3); + double m33; + m33 = (s3 - p3); + double m34; + m34 = (t3 - p3); + double det; + det = ::CGAL::determinant( m01, m02, m03, m04, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34 ); + double eps; + double max1 = CGAL::abs(m01); + double am = CGAL::abs(m02); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m03); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m11); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m12); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m13); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m23); + if( (max1 < am) ) { max1 = am; } + + + double max2 = CGAL::abs(m01); + am = CGAL::abs(m02); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m11); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m12); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m21); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m22); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m23); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m33); + if( (max2 < am) ) { max2 = am; } + + + double max3 = CGAL::abs(m04); + am = CGAL::abs(m14); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m24); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m34); + if( (max3 < am) ) { max3 = am; } + + + double max4 = CGAL::abs(m11); + am = CGAL::abs(m12); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m21); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m22); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m31); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m32); + if( (max4 < am) ) { max4 = am; } + + + double lower_bound_1; + double upper_bound_1; + lower_bound_1 = max1; + upper_bound_1 = max1; + if( (max2 < lower_bound_1) ) + { + lower_bound_1 = max2; + } + else + { + if( (max2 > upper_bound_1) ) + { + upper_bound_1 = max2; + } + } + if( (max3 < lower_bound_1) ) + { + lower_bound_1 = max3; + } + else + { + if( (max3 > upper_bound_1) ) + { + upper_bound_1 = max3; + } + } + if( (max4 < lower_bound_1) ) + { + lower_bound_1 = max4; + } + else + { + if( (max4 > upper_bound_1) ) + { + upper_bound_1 = max4; + } + } + if( (lower_bound_1 < 2.89273249588395272840e-74) ) + { + return Base::operator()(p, q, r, s, t); + } + else + { + if( (upper_bound_1 > 7.23700557733225900010e+75) ) + { + return Base::operator()(p, q, r, s, t); + } + eps = (3.17768858673611327578e-14 * (((max4 * max2) * max1) * max3)); + if( (det > eps) ) + { + CGAL_assertion(should_be == POSITIVE); + return POSITIVE; + } + else + { + if( (det < -eps) ) + { + CGAL_assertion(should_be == NEGATIVE); + return NEGATIVE; + } + else + { + return Base::operator()(p, q, r, s, t); + } + } + } +} + return Base::operator()(p, q, r, s, t); + + } + +}; + +} } } // namespace CGAL::internal::Static_filters_predicates + +#endif // CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_4_H diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h new file mode 100644 index 00000000000..a57f445e885 --- /dev/null +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h @@ -0,0 +1,289 @@ +// Copyright (c) 2025 GeometryFactory (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org) +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// +// Author(s) : Andreas Fabri + +#ifndef CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_5_H +#define CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_5_H + +#include +#include +#include +#include + +namespace CGAL { namespace internal { namespace Static_filters_predicates { + + + +template < typename K_base > +class Orientation_5 + : public K_base::Orientation_5 +{ + typedef typename K_base::Orientation Orientation; + typedef typename K_base::Point_5 Point_5; + typedef typename K_base::Orientation_5 Base; + +public: + using Base::operator(); + + Orientation + operator()(const Point_5 &p, const Point_5 &q, + const Point_5 &r, const Point_5 &s, + const Point_5 &t, const Point_5 &u) const + { + CGAL_BRANCH_PROFILER_3("semi-static failures/attempts/calls to : Orientation_5", tmp); + + double p0, p1, p2, p3, p4, q0, q1, q2, q3, q4, r0, r1, r2, r3, r4, s0, s1, s2, s3, s4, t0, t1, t2, t3, t4, u0, u1, u2, u3, u4; + + if (fit_in_double(p.c0(), p0) && fit_in_double(p.c1(), p1) && + fit_in_double(p.c2(), p2) && fit_in_double(p.c3(), p3) && + fit_in_double(p.c4(), p4) && + fit_in_double(q.c0(), q0) && fit_in_double(q.c1(), q1) && + fit_in_double(q.c2(), q2) && fit_in_double(q.c3(), q3) && + fit_in_double(q.c4(), q4) && + fit_in_double(r.c0(), r0) && fit_in_double(r.c1(), r1) && + fit_in_double(r.c2(), r2) && fit_in_double(r.c3(), r3) && + fit_in_double(r.c4(), r4) && + fit_in_double(s.c0(), s0) && fit_in_double(s.c1(), s1) && + fit_in_double(s.c2(), s2) && fit_in_double(s.c3(), s3) && + fit_in_double(s.c4(), s4) && + fit_in_double(t.c0(), t0) && fit_in_double(t.c1(), t1) && + fit_in_double(t.c2(), t2) && fit_in_double(t.c3(), t3) && + fit_in_double(t.c4(), t4) && + fit_in_double(u.c0(), u0) && fit_in_double(u.c1(), u1) && + fit_in_double(u.c2(), u2) && fit_in_double(u.c3(), u3) && + fit_in_double(u.c4(), u4)) + + { + CGAL_assertion_code(Orientation should_be = Base::operator()(p, q, r, s, t, u)); + double m01; + m01 = (q0 - p0); + double m02; + m02 = (r0 - p0); + double m03; + m03 = (s0 - p0); + double m04; + m04 = (t0 - p0); + double m05; + m05 = (u0 - p0); + double m11; + m11 = (q1 - p1); + double m12; + m12 = (r1 - p1); + double m13; + m13 = (s1 - p1); + double m14; + m14 = (t1 - p1); + double m15; + m15 = (u1 - p1); + double m21; + m21 = (q2 - p2); + double m22; + m22 = (r2 - p2); + double m23; + m23 = (s2 - p2); + double m24; + m24 = (t2 - p2); + double m25; + m25 = (u2 - p2); + double m31; + m31 = (q3 - p3); + double m32; + m32 = (r3 - p3); + double m33; + m33 = (s3 - p3); + double m34; + m34 = (t3 - p3); + double m35; + m35 = (u3 - p3); + double m41; + m41 = (q4 - p4); + double m42; + m42 = (r4 - p4); + double m43; + m43 = (s4 - p4); + double m44; + m44 = (t4 - p4); + double m45; + m45 = (u4 - p4); + double det; + det = ::CGAL::determinant( m01, m02, m03, m04, m05, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25, m31, m32, m33, m34, m35, m41, m42, m43, m44, m45 ); + double eps; + double max1 = CGAL::abs(m01); + double am = CGAL::abs(m02); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m03); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m11); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m12); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m13); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m21); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m22); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m23); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m33); + if( (max1 < am) ) { max1 = am; } + + + double max2 = CGAL::abs(m01); + am = CGAL::abs(m02); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m11); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m12); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m21); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m22); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m23); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m31); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m32); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m33); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m43); + if( (max2 < am) ) { max2 = am; } + + + double max3 = CGAL::abs(m04); + am = CGAL::abs(m14); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m24); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m34); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m44); + if( (max3 < am) ) { max3 = am; } + + + double max4 = CGAL::abs(m05); + am = CGAL::abs(m15); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m25); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m35); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m45); + if( (max4 < am) ) { max4 = am; } + + + double max5 = CGAL::abs(m11); + am = CGAL::abs(m12); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m21); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m22); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m31); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m32); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m41); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m42); + if( (max5 < am) ) { max5 = am; } + + double lower_bound_1; + double upper_bound_1; + lower_bound_1 = max5; + upper_bound_1 = max5; + if( (max1 < lower_bound_1) ) + { + lower_bound_1 = max1; + } + else + { + if( (max1 > upper_bound_1) ) + { + upper_bound_1 = max1; + } + } + if( (max2 < lower_bound_1) ) + { + lower_bound_1 = max2; + } + else + { + if( (max2 > upper_bound_1) ) + { + upper_bound_1 = max2; + } + } + if( (max3 < lower_bound_1) ) + { + lower_bound_1 = max3; + } + else + { + if( (max3 > upper_bound_1) ) + { + upper_bound_1 = max3; + } + } + if( (max4 < lower_bound_1) ) + { + lower_bound_1 = max4; + } + else + { + if( (max4 > upper_bound_1) ) + { + upper_bound_1 = max4; + } + } + if( (lower_bound_1 < 9.99657131447050328602e-60) ) + { + return Base::operator()(p, q, r, s, t, u); + } + else + { + if( (upper_bound_1 > 3.21387608851797912384e+60) ) + { + return Base::operator()(p, q, r, s, t, u); + } + eps = (2.22889232457534740153e-13 * ((((max5 * max2) * max1) * max3) * max4)); + if( (det > eps) ) + { + CGAL_assertion(should_be == POSITIVE); + return POSITIVE; + } + else + { + if( (det < -eps) ) + { + CGAL_assertion(should_be == NEGATIVE); + return NEGATIVE; + } + else + { + return Base::operator()(p, q, r, s, t, u); + } + } + } + + } + + return Base::operator()(p, q, r, s, t, u); + } + + +}; + +} } } // namespace CGAL::internal::Static_filters_predicates + +#endif // CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_5_H diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h new file mode 100644 index 00000000000..f5f7fae103d --- /dev/null +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h @@ -0,0 +1,358 @@ +// Copyright (c) 2025 GeometryFactory (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org) +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// +// Author(s) : Andreas Fabri + +#ifndef CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_6_H +#define CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_6_H + +#include +#include +#include +#include + +namespace CGAL { namespace internal { namespace Static_filters_predicates { + + + +template < typename K_base > +class Orientation_6 + : public K_base::Orientation_6 +{ + typedef typename K_base::Orientation Orientation; + typedef typename K_base::Point_6 Point_6; + typedef typename K_base::Orientation_6 Base; + +public: + using Base::operator(); + + Orientation + operator()(const Point_6 &p, const Point_6 &q, + const Point_6 &r, const Point_6 &s, + const Point_6 &t, const Point_6 &u, const Point_6 &v) const + { + CGAL_BRANCH_PROFILER_3("semi-static failures/attempts/calls to : Orientation_6", tmp); + + double p0, p1, p2, p3, p4, p5, q0, q1, q2, q3, q4, q5, r0, r1, r2, r3, r4, r5, s0, s1, s2, s3, s4, s5, t0, t1, t2, t3, t4, t5, u0, u1, u2, u3, u4, u5, v0, v1, v2, v3, v4, v5; + if (fit_in_double(p.c0(), p0) && fit_in_double(p.c1(), p1) && + fit_in_double(p.c2(), p2) && fit_in_double(p.c3(), p3) && + fit_in_double(p.c4(), p4) && fit_in_double(p.c5(), p5) && + + fit_in_double(q.c0(), q0) && fit_in_double(q.c1(), q1) && + fit_in_double(q.c2(), q2) && fit_in_double(q.c3(), q3) && + fit_in_double(q.c4(), q4) && fit_in_double(q.c5(), q5) && + + fit_in_double(r.c0(), r0) && fit_in_double(r.c1(), r1) && + fit_in_double(r.c2(), r2) && fit_in_double(r.c3(), r3) && + fit_in_double(r.c4(), r4) && fit_in_double(r.c5(), r5) && + + fit_in_double(s.c0(), s0) && fit_in_double(s.c1(), s1) && + fit_in_double(s.c2(), s2) && fit_in_double(s.c3(), s3) && + fit_in_double(s.c4(), s4) && fit_in_double(s.c5(), s5) && + + fit_in_double(t.c0(), t0) && fit_in_double(t.c1(), t1) && + fit_in_double(t.c2(), t2) && fit_in_double(t.c3(), t3) && + fit_in_double(t.c4(), t4) && fit_in_double(t.c5(), t5) && + + fit_in_double(u.c0(), u0) && fit_in_double(u.c1(), u1) && + fit_in_double(u.c2(), u2) && fit_in_double(u.c3(), u3) && + fit_in_double(u.c4(), u4) && fit_in_double(u.c5(), u5) && + + fit_in_double(v.c0(), v0) && fit_in_double(v.c1(), v1) && + fit_in_double(v.c2(), v2) && fit_in_double(v.c3(), v3) && + fit_in_double(v.c4(), v4) && fit_in_double(v.c5(), v5)) + { + CGAL_assertion_code(Orientation should_be = Base::operator()(p, q, r, s, t, u, v)); + double m01; + m01 = (q0 - p0); + double m02; + m02 = (r0 - p0); + double m03; + m03 = (s0 - p0); + double m04; + m04 = (t0 - p0); + double m05; + m05 = (u0 - p0); + double m06; + m06 = (v0 - p0); + double m11; + m11 = (q1 - p1); + double m12; + m12 = (r1 - p1); + double m13; + m13 = (s1 - p1); + double m14; + m14 = (t1 - p1); + double m15; + m15 = (u1 - p1); + double m16; + m16 = (v1 - p1); + double m21; + m21 = (q2 - p2); + double m22; + m22 = (r2 - p2); + double m23; + m23 = (s2 - p2); + double m24; + m24 = (t2 - p2); + double m25; + m25 = (u2 - p2); + double m26; + m26 = (v2 - p2); + double m31; + m31 = (q3 - p3); + double m32; + m32 = (r3 - p3); + double m33; + m33 = (s3 - p3); + double m34; + m34 = (t3 - p3); + double m35; + m35 = (u3 - p3); + double m36; + m36 = (v3 - p3); + double m41; + m41 = (q4 - p4); + double m42; + m42 = (r4 - p4); + double m43; + m43 = (s4 - p4); + double m44; + m44 = (t4 - p4); + double m45; + m45 = (u4 - p4); + double m46; + m46 = (v4 - p4); + double m51; + m51 = (q5 - p5); + double m52; + m52 = (r5 - p5); + double m53; + m53 = (s5 - p5); + double m54; + m54 = (t5 - p5); + double m55; + m55 = (u5 - p5); + double m56; + m56 = (v5 - p5); + double det; + det = ::CGAL::determinant( m01, m02, m03, m04, m05, m06, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26, m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56 ); + double eps; + double max1 = CGAL::abs(m01); + double am = CGAL::abs(m02); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m11); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m12); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m21); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m22); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m31); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m32); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m41); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m42); + if( (max1 < am) ) { max1 = am; } + + + double max2 = CGAL::abs(m03); + am = CGAL::abs(m11); + + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m12); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m13); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m21); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m22); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m23); + + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m31); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m32); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m33); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m41); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m42); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m43); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m51); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m52); + if( (max2 < am) ) { max2 = am; } + + + double max3 = CGAL::abs(m04); + am = CGAL::abs(m14); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m24); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m34); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m44); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m54); + if( (max3 < am) ) { max3 = am; } + + double max4 = CGAL::abs(m05); + am = CGAL::abs(m15); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m25); + if( (max4 < am) ) { max3 = am; } + am = CGAL::abs(m35); + if( (max4 < am) ) { max4= am; } + am = CGAL::abs(m45); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m55); + if( (max4 < am) ) { max4 = am; } + + double max5 = CGAL::abs(m06); + am = CGAL::abs(m16); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m26); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m36); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m46); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m56); + if( (max5 < am) ) { max5 = am; } + + + double max6 = CGAL::abs(m13); + am = CGAL::abs(m21); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m22); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m23); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m31); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m32); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m33); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m41); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m42); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m43); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m51); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m52); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m53); + am = CGAL::abs(m53); + if( (max6 < am) ) { max6 = am; } + + + double lower_bound_1; + double upper_bound_1; + lower_bound_1 = max6; + upper_bound_1 = max6; + if( (max5 < lower_bound_1) ) + { + lower_bound_1 = max5; + } + else + { + if( (max5 > upper_bound_1) ) + { + upper_bound_1 = max5; + } + } + if( (max1 < lower_bound_1) ) + { + lower_bound_1 = max1; + } + else + { + if( (max1 > upper_bound_1) ) + { + upper_bound_1 = max1; + } + } + if( (max2 < lower_bound_1) ) + { + lower_bound_1 = max2; + } + else + { + if( (max2 > upper_bound_1) ) + { + upper_bound_1 = max2; + } + } + if( (max3 < lower_bound_1) ) + { + lower_bound_1 = max3; + } + else + { + if( (max3 > upper_bound_1) ) + { + upper_bound_1 = max3; + } + } + if( (max4 < lower_bound_1) ) + { + lower_bound_1 = max4; + } + else + { + if( (max4 > upper_bound_1) ) + { + upper_bound_1 = max4; + } + } + if( (lower_bound_1 < 4.82472686053427214432e-50) ) + { + return Base::operator()(p, q, r, s, t, u, v); + } + else + { + if( (upper_bound_1 > 1.87072209578355511223e+50) ) + { + return Base::operator()(p, q, r, s, t, u, v); + } + eps = (1.76403842114300859158e-12 * (((((max1 * max2) * max6) * max3) * max4) * max5)); + if( (det > eps) ) + { + CGAL_assertion(should_be == POSITIVE); + return POSITIVE; + } + else + { + if( (det < -eps) ) + { + CGAL_assertion(should_be == NEGATIVE); + return NEGATIVE; + } + } + } +} + return Base::operator()(p, q, r, s, t, u, v); + } +}; + +} } } // namespace CGAL::internal::Static_filters_predicates + +#endif // CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_6_H diff --git a/Filtered_kernel/include/CGAL/Lazy.h b/Filtered_kernel/include/CGAL/Lazy.h index fc6d8d4c60c..c578852a331 100644 --- a/Filtered_kernel/include/CGAL/Lazy.h +++ b/Filtered_kernel/include/CGAL/Lazy.h @@ -229,14 +229,14 @@ print_dag(const Return_base_tag&, std::ostream& os, int level) struct Depth_base { #ifdef CGAL_PROFILE - int depth_; + mutable int depth_; Depth_base() : depth_(0) {} int depth() const { return depth_; } - void set_depth(int i) + void set_depth(int i) const { depth_ = i; CGAL_HISTOGRAM_PROFILER(std::string("[Lazy_kernel DAG depths]"), i); @@ -244,7 +244,7 @@ struct Depth_base { } #else int depth() const { return 0; } - void set_depth(int) {} + void set_depth(int) const {} #endif }; @@ -656,6 +656,7 @@ class Lazy_rep_n final : auto* p = new typename Base::Indirect(ec()( CGAL::exact( std::get(l) ) ... ) ); this->set_at(p); this->set_ptr(p); + this->set_depth(0); if(!noprune || is_currently_single_threaded()) lazy_reset_member(l); } diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 160bd7bfbfa..dfe3da63430 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -1,8 +1,20 @@ # Release History +## [Release 6.2](https://github.com/CGAL/cgal/releases/tag/v6.2) + +Release date: July 2026 + +### [Linear Cell Complex](https://doc.cgal.org/6.2/Manual/packages.html#PkgLinearCellComplex) + +- **API Changes**: The following import functions have been deprecated and renamed for better naming clarity and consistency: + - `import_from_plane_graph()` → `read_plane_graph_in_lcc()` + - `import_from_polyhedron_3()` → `polyhedron_3_to_lcc()` + - `import_from_triangulation_3()` → `triangulation_3_to_lcc()` +- The old function names are still available but marked as deprecated for backward compatibility. + ## [Release 6.1](https://github.com/CGAL/cgal/releases/tag/v6.1) -Release date: July 2025 +Release date: Sept 2025 ### General Changes diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 2aba88233d3..5eb6bc64231 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -970,19 +970,6 @@ ${CGAL_3RD_PARTY_DEFINITIONS} ${CGAL_Qt6_3RD_PARTY_DEFINITIONS} \ ${CGAL_DEFINITIONS}" -std=c++17) message("COMPILATION OPTIONS ARE : ${compile_options}") - if(NOT RS_FOUND AND NOT RS3_FOUND) - set(compile_options - "${compile_options} \ --DCGAL_ALGEBRAIC_KERNEL_RS_GMPZ_D_1=1 \ --DCGAL_ALGEBRAIC_KERNEL_RS_GMPQ_D_1=1") - message(STATUS "Skip RS headers \"CGAL/Algebraic_kernel_rs_gmpq_d_1.h\" \ -and \"CGAL/Algebraic_kernel_rs_gmpz_d_1.h\" because RS_FOUND is false.") - else() - set(compile_options - "${compile_options} \ --DCGAL_USE_MPFI=1 \ --DCGAL_USE_RS=1") - endif() if(NOT OpenMesh_FOUND) set(compile_options "${compile_options} \ @@ -1163,16 +1150,12 @@ LEDA_FOUND is false.") CMD UNIX_COMMAND "${CMAKE_CXX_COMPILER} ${compile_options_str} ${include_options_str} -x c++ ${flag} -H \ ${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/${header}" - # The header Algebraic_kernel_rs_gmpz_d_1.h is skipped on purpose: it - # depends on RS. ) # CMD2 is CMD without the -H option separate_arguments( CMD2 UNIX_COMMAND "${CMAKE_CXX_COMPILER} ${compile_options_str} ${include_options_str} -x c++ ${flag} \ ${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/${header}" - # The header Algebraic_kernel_rs_gmpz_d_1.h is skipped on purpose: it - # depends on RS. ) set(chk_header_name ${CGAL_BINARY_DIR}/package_info/${package}/check_headers/check_${header2} diff --git a/Installation/cmake/modules/CGALHelpers.cmake b/Installation/cmake/modules/CGALHelpers.cmake index de42f8cf269..f29fd11111b 100644 --- a/Installation/cmake/modules/CGALHelpers.cmake +++ b/Installation/cmake/modules/CGALHelpers.cmake @@ -9,7 +9,7 @@ function(process_CGAL_subdirectory entry subdir type_name) make_directory("${CMAKE_BINARY_DIR}/${subdir}/${ENTRY_DIR_NAME}") endif() - message("\n-- Configuring ${subdir} in ${subdir}/${ENTRY_DIR_NAME}") + message("-- Configuring ${subdir} in ${subdir}/${ENTRY_DIR_NAME}") set(source_dir "") if(EXISTS ${entry}/CMakeLists.txt) diff --git a/Installation/demo/CMakeLists.txt b/Installation/demo/CMakeLists.txt index 92606a5b9d2..9bf4e2e9e0e 100644 --- a/Installation/demo/CMakeLists.txt +++ b/Installation/demo/CMakeLists.txt @@ -1,7 +1,15 @@ cmake_minimum_required(VERSION 3.12...3.31) +project(CGAL_Demos) -if(NOT CGAL_MODULES_DIR) - find_package(CGAL REQUIRED) -endif() -include(${CGAL_MODULES_DIR}/CGALHelpers.cmake) -CGAL_handle_subdirectories(demo demos) +file(GLOB pkgs RELATIVE ${CMAKE_SOURCE_DIR} "*") +list(SORT pkgs) + +message("== Generating build files for demos ==") +foreach(pkg ${pkgs}) + set(pkg_dir ${CMAKE_SOURCE_DIR}/${pkg}) + if(IS_DIRECTORY "${pkg_dir}" AND EXISTS "${pkg_dir}/CMakeLists.txt") + message("\n-- Configuring ${pkg}") + add_subdirectory(${pkg_dir} "${CMAKE_BINARY_DIR}/${pkg}") + endif() +endforeach() +message("== Generating build files for done (DONE) ==") diff --git a/Installation/examples/CMakeLists.txt b/Installation/examples/CMakeLists.txt index e0034b4727f..f96a030628d 100644 --- a/Installation/examples/CMakeLists.txt +++ b/Installation/examples/CMakeLists.txt @@ -1,6 +1,15 @@ cmake_minimum_required(VERSION 3.12...3.31) -if(NOT CGAL_MODULES_DIR) - find_package(CGAL REQUIRED) -endif() -include(${CGAL_MODULES_DIR}/CGALHelpers.cmake) -CGAL_handle_subdirectories(examples examples) +project(CGAL_Examples) + +file(GLOB pkgs RELATIVE ${CMAKE_SOURCE_DIR} "*") +list(SORT pkgs) + +message("== Generating build files for examples ==") +foreach(pkg ${pkgs}) + set(pkg_dir ${CMAKE_SOURCE_DIR}/${pkg}) + if(IS_DIRECTORY "${pkg_dir}" AND EXISTS "${pkg_dir}/CMakeLists.txt") + message("\n-- Configuring ${pkg}") + add_subdirectory(${pkg_dir} "${CMAKE_BINARY_DIR}/${pkg}") + endif() +endforeach() +message("== Generating build files for done (DONE) ==") diff --git a/Installation/include/CGAL/version.h b/Installation/include/CGAL/version.h index 1ec57af9015..02e637c7fad 100644 --- a/Installation/include/CGAL/version.h +++ b/Installation/include/CGAL/version.h @@ -17,12 +17,12 @@ #define CGAL_VERSION_H #ifndef SWIG -#define CGAL_VERSION 6.1-beta2 +#define CGAL_VERSION 6.2-dev #define CGAL_GIT_HASH abcdef #endif -#define CGAL_VERSION_NR 1060100920 +#define CGAL_VERSION_NR 1060200900 #define CGAL_SVN_REVISION 99999 -#define CGAL_RELEASE_DATE 20250701 +#define CGAL_RELEASE_DATE 20260401 #include diff --git a/Installation/lib/cmake/CGAL/CGALConfigVersion.cmake b/Installation/lib/cmake/CGAL/CGALConfigVersion.cmake index a5a71ac0458..bcc4c96fb78 100644 --- a/Installation/lib/cmake/CGAL/CGALConfigVersion.cmake +++ b/Installation/lib/cmake/CGAL/CGALConfigVersion.cmake @@ -1,8 +1,8 @@ set(CGAL_MAJOR_VERSION 6) -set(CGAL_MINOR_VERSION 1) +set(CGAL_MINOR_VERSION 2) set(CGAL_BUGFIX_VERSION 0) include(${CMAKE_CURRENT_LIST_DIR}/CGALConfigBuildVersion.cmake) -set(CGAL_VERSION_PUBLIC_RELEASE_VERSION "6.1-beta2") +set(CGAL_VERSION_PUBLIC_RELEASE_VERSION "6.2-dev") set(CGAL_VERSION_PUBLIC_RELEASE_NAME "CGAL-${CGAL_VERSION_PUBLIC_RELEASE_VERSION}") if (CGAL_BUGFIX_VERSION AND CGAL_BUGFIX_VERSION GREATER 0) diff --git a/Installation/test/CMakeLists.txt b/Installation/test/CMakeLists.txt index 64d616edd57..183796527e1 100644 --- a/Installation/test/CMakeLists.txt +++ b/Installation/test/CMakeLists.txt @@ -1,8 +1,15 @@ cmake_minimum_required(VERSION 3.12...3.31) +project(CGAL_Tests) +file(GLOB pkgs RELATIVE ${CMAKE_SOURCE_DIR} "*") +list(SORT pkgs) -if(NOT CGAL_MODULES_DIR) - find_package(CGAL REQUIRED) -endif() -include(${CGAL_MODULES_DIR}/CGALHelpers.cmake) -CGAL_handle_subdirectories(test tests) +message("== Generating build files for tests ==") +foreach(pkg ${pkgs}) + set(pkg_dir ${CMAKE_SOURCE_DIR}/${pkg}) + if(IS_DIRECTORY "${pkg_dir}" AND EXISTS "${pkg_dir}/CMakeLists.txt") + message("\n-- Configuring ${pkg}") + add_subdirectory(${pkg_dir} "${CMAKE_BINARY_DIR}/${pkg}") + endif() +endforeach() +message("== Generating build files for done (DONE) ==") diff --git a/Kernel_d/doc/Kernel_d/CGAL/Epeck_d.h b/Kernel_d/doc/Kernel_d/CGAL/Epeck_d.h index b59b2f8560d..af63a8781c6 100644 --- a/Kernel_d/doc/Kernel_d/CGAL/Epeck_d.h +++ b/Kernel_d/doc/Kernel_d/CGAL/Epeck_d.h @@ -89,6 +89,44 @@ double operator[](int i)const; Cartesian_const_iterator_d cartesian_begin()const; /*! returns an iterator pointing beyond the last %Cartesian coordinate. */ Cartesian_const_iterator_d cartesian_end()const; + +/*! returns whether the points coincide. */ +friend bool operator==(Point_d,Point_d); +/*! returns whether the points are distinct. */ +friend bool operator!=(Point_d,Point_d); +}; + +/*! +represents a vector in the Euclidean space +\cgalModels{DefaultConstructible,Assignable} +*/ +class Vector_d { +public: +/*! introduces a vector with coordinates (x0, x1, ...) where the number of + coordinates matches the dimension. + \pre `DimensionTag` is a fixed dimension, not `Dynamic_dimension_tag`. */ +Vector_d(double x0, double x1, ...); + +/*! introduces a vector with coordinate set `[first,end)`. + \pre If `DimensionTag` is a fixed dimension, it matches `distance(first,end)`. + \tparam ForwardIterator has its value type that is convertible to `double`. + */ +template +Vector_d(ForwardIterator first, ForwardIterator end); + +/*! returns the i-th coordinate of a vector. + \pre `i` is non-negative and less than the dimension. */ +double operator[](int i)const; + +/*! returns an iterator pointing to the zeroth %Cartesian coordinate. */ +Cartesian_const_iterator_d cartesian_begin()const; +/*! returns an iterator pointing beyond the last %Cartesian coordinate. */ +Cartesian_const_iterator_d cartesian_end()const; + +/*! returns whether the vectors coincide. */ +friend bool operator==(Vector_d,Vector_d); +/*! returns whether the vectors are distinct. */ +friend bool operator!=(Vector_d,Vector_d); }; /*! diff --git a/Kernel_d/doc/Kernel_d/CGAL/Epick_d.h b/Kernel_d/doc/Kernel_d/CGAL/Epick_d.h index deb7043c4fc..61cd6153cdf 100644 --- a/Kernel_d/doc/Kernel_d/CGAL/Epick_d.h +++ b/Kernel_d/doc/Kernel_d/CGAL/Epick_d.h @@ -77,6 +77,48 @@ double operator[](int i)const; Cartesian_const_iterator_d cartesian_begin()const; /*! returns an iterator pointing beyond the last Cartesian coordinate. */ Cartesian_const_iterator_d cartesian_end()const; + +/*! returns whether the points coincide. This may not be safe + if the points are the result of inexact constructions. */ +friend bool operator==(Point_d,Point_d); +/*! returns whether the points are distinct. This may not be safe + if the points are the result of inexact constructions. */ +friend bool operator!=(Point_d,Point_d); +}; + +/*! +represents a vector in the Euclidean space +\cgalModels{DefaultConstructible,Assignable} +*/ +class Vector_d { +public: +/*! introduces a vector with coordinates (x0, x1, ...) where the number of + coordinates matches the dimension. + \pre `DimensionTag` is a fixed dimension, not `Dynamic_dimension_tag`. */ +Vector_d(double x0, double x1, ...); + +/*! introduces a vector with coordinate set `[first,end)`. + \pre If `DimensionTag` is a fixed dimension, it matches `distance(first,end)`. + \tparam InputIterator has its value type that is convertible to `double`. + */ +template +Vector_d(InputIterator first, InputIterator end); + +/*! returns the i-th coordinate of a vector. + \pre `i` is non-negative and less than the dimension. */ +double operator[](int i)const; + +/*! returns an iterator pointing to the zeroth Cartesian coordinate. */ +Cartesian_const_iterator_d cartesian_begin()const; +/*! returns an iterator pointing beyond the last Cartesian coordinate. */ +Cartesian_const_iterator_d cartesian_end()const; + +/*! returns whether the vectors coincide. This may not be safe + if the vectors are the result of inexact constructions. */ +friend bool operator==(Vector_d,Vector_d); +/*! returns whether the vectors are distinct. This may not be safe + if the vectors are the result of inexact constructions. */ +friend bool operator!=(Vector_d,Vector_d); }; /*! diff --git a/Lab/demo/Lab/Plugins/AABB_tree/Cut_plugin.cpp b/Lab/demo/Lab/Plugins/AABB_tree/Cut_plugin.cpp index e3df0223e50..936d4fcd3f7 100644 --- a/Lab/demo/Lab/Plugins/AABB_tree/Cut_plugin.cpp +++ b/Lab/demo/Lab/Plugins/AABB_tree/Cut_plugin.cpp @@ -22,8 +22,8 @@ #include #include #include -//#include -#include +#include +#include #include @@ -60,7 +60,7 @@ typedef Edge_container Ec; typedef Triangle_container Tc; typedef Viewer_interface Vi; -typedef CGAL::Simple_cartesian Simple_kernel; +typedef CGAL::Exact_predicates_inexact_constructions_kernel Simple_kernel; typedef Simple_kernel::FT FT; typedef Simple_kernel::Point_3 Point; typedef std::pair Point_distance; @@ -81,24 +81,25 @@ Simple_kernel::Vector_3 random_vector() return Simple_kernel::Vector_3(x,y,z); } +template< typename Mesh> +struct PPMAP; //functor for tbb parallelization -template +template class FillGridSize { std::size_t grid_size; Point_distance (&distance_function)[100][100]; FT diag; FT& max_distance_function; std::vector&sm_trees; - bool is_signed; CGAL::qglviewer::ManipulatedFrame* frame; public: FillGridSize(std::size_t grid_size, FT diag, Point_distance (&distance_function)[100][100], FT& max_distance_function, std::vector& sm_trees, - bool is_signed, CGAL::qglviewer::ManipulatedFrame* frame) + CGAL::qglviewer::ManipulatedFrame* frame) : grid_size(grid_size), distance_function (distance_function), diag(diag), max_distance_function(max_distance_function), - sm_trees(sm_trees), is_signed(is_signed), frame(frame) + sm_trees(sm_trees), frame(frame) { } template @@ -137,7 +138,7 @@ public: max_distance_function = (std::max)(min, max_distance_function); - if(is_signed) + if constexpr (is_signed) { if(!min_sm_tree) { @@ -145,17 +146,12 @@ public: max_distance_function = DBL_MAX;//(std::max)(min, max_distance_function); continue; } - typedef typename SM_Tree::size_type size_type; - Simple_kernel::Vector_3 random_vec = random_vector(); + CGAL::Side_of_triangle_mesh, SM_Tree> side_of(*min_sm_tree); const Simple_kernel::Point_3& p = distance_function[i][j].first; const FT unsigned_distance = distance_function[i][j].second; - // get sign through ray casting (random vector) - Simple_kernel::Ray_3 ray(p, random_vec); - size_type nbi = min_sm_tree->number_of_intersected_primitives(ray); - - FT sign ( (nbi&1) == 0 ? 1 : -1); + FT sign ( side_of(p)==CGAL::ON_UNBOUNDED_SIDE ? 1 : -1); distance_function[i][j].second = sign * unsigned_distance; } } @@ -191,9 +187,7 @@ public: GLubyte* getData(){return data; } }; -typedef CGAL::Simple_cartesian Simple_kernel; -//typedef CGAL::Exact_predicates_inexact_constructions_kernel Simple_kernel; template< typename Mesh> struct PPMAP { @@ -390,8 +384,8 @@ private: mutable Simple_kernel::FT m_max_distance_function; mutable std::vector tex_map; mutable Cut_planes_types m_cut_plane; - template - void compute_distance_function(QMap *sm_trees, bool is_signed = false)const + template + void compute_distance_function(QMap *sm_trees)const { m_max_distance_function = FT(0); @@ -402,11 +396,11 @@ private: if(!(is_signed && !CGAL::is_closed(*qobject_cast(sm_trees->key(sm_tree))->polyhedron()))) closed_sm_trees.push_back(sm_tree); #ifndef CGAL_LINKED_WITH_TBB - FillGridSize f(m_grid_size, diag, m_distance_function, m_max_distance_function, closed_sm_trees, is_signed, frame); + FillGridSize f(m_grid_size, diag, m_distance_function, m_max_distance_function, closed_sm_trees, frame); HackRange range(0, static_cast(m_grid_size*m_grid_size)); f(range); #else - FillGridSize f(m_grid_size, diag, m_distance_function, m_max_distance_function, closed_sm_trees, is_signed, frame); + FillGridSize f(m_grid_size, diag, m_distance_function, m_max_distance_function, closed_sm_trees, frame); tbb::parallel_for(tbb::blocked_range(0, m_grid_size*m_grid_size), f); #endif } @@ -459,7 +453,7 @@ private: break; case SIGNED_FACETS: if (!facet_sm_trees || facet_sm_trees->empty() ) { return; } - compute_distance_function( facet_sm_trees, true); + compute_distance_function( facet_sm_trees); break; case UNSIGNED_EDGES: diff --git a/Lab/demo/Lab/Plugins/IO/CMakeLists.txt b/Lab/demo/Lab/Plugins/IO/CMakeLists.txt index dbdad76da22..1bb9cf3338b 100644 --- a/Lab/demo/Lab/Plugins/IO/CMakeLists.txt +++ b/Lab/demo/Lab/Plugins/IO/CMakeLists.txt @@ -35,6 +35,9 @@ target_link_libraries(off_to_nef_plugin PRIVATE scene_nef_polyhedron_item) cgal_lab_plugin(polylines_io_plugin Polylines_io_plugin KEYWORDS Viewer Mesh_3) target_link_libraries(polylines_io_plugin PRIVATE scene_polylines_item) +cgal_lab_plugin(spheres_io_plugin Spheres_io_plugin KEYWORDS Viewer Mesh_3) +target_link_libraries(spheres_io_plugin PRIVATE scene_basic_objects) + cgal_lab_plugin(wkt_plugin WKT_io_plugin KEYWORDS Viewer PointSetProcessing Mesh_3) target_link_libraries(wkt_plugin PRIVATE scene_polylines_item) diff --git a/Lab/demo/Lab/Plugins/IO/Spheres_io_plugin.cpp b/Lab/demo/Lab/Plugins/IO/Spheres_io_plugin.cpp new file mode 100644 index 00000000000..976e436d38e --- /dev/null +++ b/Lab/demo/Lab/Plugins/IO/Spheres_io_plugin.cpp @@ -0,0 +1,162 @@ +#include "Scene_spheres_item.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +using namespace CGAL::Three; + +class CGAL_Lab_spheres_io_plugin : + public QObject, + public CGAL_Lab_io_plugin_interface, + public CGAL_Lab_plugin_helper +{ + Q_OBJECT + Q_INTERFACES(CGAL::Three::CGAL_Lab_plugin_interface CGAL::Three::CGAL_Lab_io_plugin_interface) + Q_PLUGIN_METADATA(IID "com.geometryfactory.CGALLab.PluginInterface/1.0" FILE "spheres_io_plugin.json") + Q_PLUGIN_METADATA(IID "com.geometryfactory.CGALLab.IOPluginInterface/1.90") + +public: + // To silent a warning -Woverloaded-virtual + // See https://stackoverflow.com/questions/9995421/gcc-woverloaded-virtual-warnings + + using CGAL_Lab_io_plugin_interface::init; + //! Configures the widget + void init(QMainWindow* mainWindow, + CGAL::Three::Scene_interface* scene_interface, + Messages_interface*) override{ + //get the references + this->scene = scene_interface; + this->mw = mainWindow; + + } + QString name() const override{ return "spheres_io_plugin"; } + QString nameFilters() const override{ return "Spheres files (*.spheres.txt)"; } + bool canLoad(QFileInfo fileinfo) const override; + QList load(QFileInfo fileinfo, bool& ok, bool add_to_scene=true) override; + + bool canSave(const CGAL::Three::Scene_item*) override; + bool save(QFileInfo fileinfo,QList&) override; + bool applicable(QAction* ) const override { + return false; + } + QList actions() const override{ + + return QList(); + } + + bool isDefaultLoader(const Scene_item* item) const override{ + if(qobject_cast(item)) + return true; + return false; + } +}; + +bool CGAL_Lab_spheres_io_plugin::canLoad(QFileInfo fileinfo) const{ + if(!fileinfo.suffix().contains("cgal")) + return true; + std::ifstream in(fileinfo.filePath().toUtf8()); + if(!in) { + return false; + } + int first; + if(!(in >> first) + || first <= 0) + return false; + return true; +} + + +QList +CGAL_Lab_spheres_io_plugin:: +load(QFileInfo fileinfo, bool& ok, bool add_to_scene){ + + // Open file + std::ifstream ifs(fileinfo.filePath().toUtf8()); + if(!ifs) { + std::cerr << "Error! Cannot open file " << (const char*)fileinfo.filePath().toUtf8() << std::endl; + ok = false; + return QList(); + } + + if(fileinfo.size() == 0) + { + CGAL::Three::Three::warning( tr("The file you are trying to load is empty.")); + Scene_spheres_item* item = new Scene_spheres_item(nullptr, 0, false, false); + item->setName(fileinfo.completeBaseName()); + ok = true; + if(add_to_scene) + CGAL::Three::Three::scene()->addItem(item); + return QList()< > spheres; + while (ifs >> x && ifs >> y && ifs >> z && ifs >> r) + spheres.push_back({x, y, z, r}); + + std::vector colors; + if (true) { + colors.resize(spheres.size()); + for (QColor &c : colors) + c = generate_random_color(); + } + else { + colors.reserve(spheres.size()); + compute_deterministic_color_map(QColor(180, 120, 130, 255), spheres.size(), std::back_inserter(colors)); + } + + Scene_spheres_item* item = new Scene_spheres_item(nullptr, spheres.size(), false, true); + item->setName(fileinfo.completeBaseName()); + + for (std::size_t i = 0;i& s = spheres[i]; + item->add_sphere(CGAL::Epick::Sphere_3(CGAL::Epick::Point_3(s[0], s[1], s[2]), s[3] * s[3]), i, CGAL::IO::Color(colors[i].red(), colors[i].green(), colors[i].blue())); + } + + std::cerr << "Number of spheres loaded: " << spheres.size() << std::endl; + + item->invalidateOpenGLBuffers(); + + item->setRenderingMode(Gouraud); + CGAL::Three::Three::scene()->addItem(item); + item->computeElements(); + + return QList()<(item) != 0; +} + +bool CGAL_Lab_spheres_io_plugin:: +save(QFileInfo fileinfo,QList& items) +{ + Scene_item* item = items.front(); + const Scene_spheres_item* sphere_item = + qobject_cast(item); + + if(!sphere_item) + return false; + + std::ofstream out(fileinfo.filePath().toUtf8()); + + out.precision (std::numeric_limits::digits10 + 2); + + if(!out) { + std::cerr << "Error! Cannot open file " << (const char*)fileinfo.filePath().toUtf8() << std::endl; + return false; + } + + return false; +} + +#include "Spheres_io_plugin.moc" diff --git a/Lab/demo/Lab/Plugins/IO/lcc_io_plugin.cpp b/Lab/demo/Lab/Plugins/IO/lcc_io_plugin.cpp index 027b52fd69e..690f0f79de8 100644 --- a/Lab/demo/Lab/Plugins/IO/lcc_io_plugin.cpp +++ b/Lab/demo/Lab/Plugins/IO/lcc_io_plugin.cpp @@ -47,7 +47,7 @@ public: QString ext = fileinfo.suffix(); bool res = true; if(ext == "off") - CGAL::import_from_polyhedron_3_flux < Scene_lcc_item::LCC > (lcc, ifs); + CGAL::polyhedron_3_flux_to_lcc < Scene_lcc_item::LCC > (lcc, ifs); else { res = CGAL::load_combinatorial_map(ifs, lcc); diff --git a/Lab/demo/Lab/Scene_spheres_item.cpp b/Lab/demo/Lab/Scene_spheres_item.cpp index fac56fbda9b..d65da606030 100644 --- a/Lab/demo/Lab/Scene_spheres_item.cpp +++ b/Lab/demo/Lab/Scene_spheres_item.cpp @@ -2,7 +2,9 @@ #include #include #include +#include #include +#include using namespace CGAL::Three; @@ -43,9 +45,7 @@ struct Scene_spheres_item_priv model_sphere_is_up = false; } - ~Scene_spheres_item_priv() - { - } + ~Scene_spheres_item_priv() {} void pick(int &id)const; @@ -85,6 +85,15 @@ void Scene_spheres_item_priv::pick(int& id) const id = -1; } + if (id != -1 && spheres[id].size() == 1) { + const Sphere& sphere = spheres[id][0].first; + Three::information(QString("Selected sphere: center (%1, %2, %3) radius %4"). + arg(sphere.center().x(), 0, 'g', 10). + arg(sphere.center().y(), 0, 'g', 10). + arg(sphere.center().z(), 0, 'g', 10). + arg(CGAL::approximate_sqrt(sphere.squared_radius()), 0, 'g', 10)); + } + int offset = 0; float color[4]; for(std::size_t i=0; isetAlpha(alpha()); getTriangleContainer(0)->draw(viewer, false); } if(d->pickable && (d->spheres.size() > 1 && viewer->inDrawWithNames())) @@ -218,6 +233,9 @@ void Scene_spheres_item::draw(Viewer_interface *viewer) const void Scene_spheres_item::drawEdges(Viewer_interface *viewer) const { + if (renderingMode() != Wireframe || !visible()) + return; + if(!isInit(viewer)) initGL(viewer); if ( getBuffersFilled() && @@ -295,6 +313,18 @@ void Scene_spheres_item::invalidateOpenGLBuffers() getTriangleContainer(1)->reset_vbos(COLORS); } getEdgeContainer(0)->reset_vbos(NOT_INSTANCED); + compute_bbox(); +} + +QMenu* Scene_spheres_item::contextMenu() { + QMenu* menu = Scene_item_rendering_helper::contextMenu(); + + if (!connected_alpha_slider && alphaSlider() != nullptr) { + connect(alphaSlider(), &QSlider::valueChanged, [this]() {redraw(); }); + connected_alpha_slider = true; + } + + return menu; } QString diff --git a/Lab/demo/Lab/Scene_spheres_item.h b/Lab/demo/Lab/Scene_spheres_item.h index dd365a16ac2..23ae7fe541f 100644 --- a/Lab/demo/Lab/Scene_spheres_item.h +++ b/Lab/demo/Lab/Scene_spheres_item.h @@ -2,6 +2,7 @@ #define SCENE_SPHERES_ITEM_H #include "Scene_basic_objects_config.h" #include "create_sphere.h" +#include "Color_map.h" #include #include @@ -24,7 +25,7 @@ struct Scene_spheres_item_priv; * have a Scene_spheres_item child). */ class SCENE_BASIC_OBJECTS_EXPORT Scene_spheres_item - : public CGAL::Three::Scene_item_rendering_helper + : public CGAL::Three::Scene_group_item { Q_OBJECT public: @@ -37,6 +38,7 @@ public: ~Scene_spheres_item(); + Bbox bbox() const override { return _bbox; } bool isFinite() const override{ return true; } bool isEmpty() const override{ return false; } Scene_item* clone() const override{return nullptr;} @@ -57,10 +59,12 @@ public: void setColor(QColor c) override; bool save(const std::string &file_name) const; + QMenu *contextMenu() override; void initializeBuffers(Viewer_interface *) const override; void computeElements() const override; bool eventFilter(QObject *watched, QEvent *event)override; + Q_SIGNALS: void on_color_changed(); void picked(std::size_t id) const; @@ -68,6 +72,7 @@ Q_SIGNALS: protected: friend struct Scene_spheres_item_priv; Scene_spheres_item_priv* d; + bool connected_alpha_slider; }; #endif // SCENE_SPHERES_ITEM_H diff --git a/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.cpp b/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.cpp index 04d95629494..ea72b31a057 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.cpp +++ b/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.cpp @@ -375,7 +375,7 @@ void MainWindow::load_off (const QString & fileName, bool clear) std::ifstream ifs (qPrintable (fileName)); - CGAL::import_from_polyhedron_3_flux < LCC > (*scene.lcc, ifs); + CGAL::polyhedron_3_flux_to_lcc < LCC > (*scene.lcc, ifs); #ifdef CGAL_PROFILE_LCC_DEMO timer.stop(); @@ -415,7 +415,7 @@ void MainWindow::load_3DTDS (const QString & fileName, bool clear) T.insert (std::istream_iterator < Point_3 >(ifs), std::istream_iterator < Point_3 >() ); - CGAL::import_from_triangulation_3 < LCC, Triangulation >(*scene.lcc, T); + CGAL::triangulation_3_to_lcc < LCC, Triangulation >(*scene.lcc, T); #ifdef CGAL_PROFILE_LCC_DEMO timer.stop(); @@ -673,7 +673,7 @@ void MainWindow::on_actionCompute_Voronoi_3D_triggered () std::map vol_to_dart; - dh = CGAL::import_from_triangulation_3 < LCC, Triangulation > + dh = CGAL::triangulation_3_to_lcc < LCC, Triangulation > (delaunay_lcc, T, &vol_to_dart); Dart_descriptor ddh=delaunay_lcc.dual(*scene.lcc, dh); diff --git a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Linear_cell_complex_constructors.h b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Linear_cell_complex_constructors.h index 71796bd842b..0fefb1240b1 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Linear_cell_complex_constructors.h +++ b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Linear_cell_complex_constructors.h @@ -24,13 +24,20 @@ Here a small example: Middle: the 2D linear cell complex reconstructed if combinatorial maps are the combinatorial data-structure. Right: the 2D linear cell complex reconstructed if generalized maps are the combinatorial data-structure. -\sa `CGAL::import_from_triangulation_3` -\sa `CGAL::import_from_polyhedron_3` - +\sa `CGAL::triangulation_3_to_lcc` +\sa `CGAL::polyhedron_3_to_lcc` */ template -typename LCC::Dart_descriptor import_from_plane_graph(LCC& lcc, +typename LCC::Dart_descriptor read_plane_graph_in_lcc(LCC& lcc, std::istream& ais); +/*! +\ingroup PkgLinearCellComplexConstructions +\deprecated Use `read_plane_graph_in_lcc()` instead. +*/ +template +[[deprecated("Use read_plane_graph_in_lcc instead")]] +typename LCC::Dart_descriptor import_from_plane_graph(LCC& lcc, std::istream& ais); + } /* namespace CGAL */ diff --git a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Polyhedron_3_to_lcc.h b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Polyhedron_3_to_lcc.h index b6fbef4d30d..5983ebfc73e 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Polyhedron_3_to_lcc.h +++ b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Polyhedron_3_to_lcc.h @@ -5,10 +5,10 @@ namespace CGAL{ Imports `apoly` (a `Polyhedron_3`) into `lcc`, a model of the `LinearCellComplex` concept. Objects are added in `lcc`, existing darts are not modified. Returns a dart created during the import. \pre \link GenericMap::dimension `LCC::dimension`\endlink \f$ \geq\f$ 2 and \link LinearCellComplex::ambient_dimension `LCC::ambient_dimension`\endlink==3. -\sa `CGAL::import_from_plane_graph` -\sa `CGAL::import_from_triangulation_3` +\sa `CGAL::read_plane_graph_in_lcc` +\sa `CGAL::triangulation_3_to_lcc` */ template -typename LCC::Dart_descriptor import_from_polyhedron_3(LCC& lcc, +typename LCC::Dart_descriptor polyhedron_3_to_lcc(LCC& lcc, const Polyhedron &apoly); } diff --git a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Triangulation_3_to_lcc.h b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Triangulation_3_to_lcc.h index 1532b70469b..c1ab3172a09 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Triangulation_3_to_lcc.h +++ b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Triangulation_3_to_lcc.h @@ -3,13 +3,23 @@ namespace CGAL{ /*! \ingroup PkgLinearCellComplexConstructions -Imports `atr` (a `Triangulation_3`) into `lcc`, a model of the `LinearCellComplex` concept. Objects are added in `lcc`, existing darts are not modified. Returns a dart created during the import. -\pre \link GenericMap::dimension `LCC::dimension`\endlink \f$ \geq\f$ 3 and \link LinearCellComplex::ambient_dimension `LCC::ambient_dimension`\endlink==3. +Imports `atr` (a `Triangulation_3`) into `lcc`, a model of the `LinearCellComplex` concept. +Objects are added in `lcc`, existing darts are not modified. Returns a dart created during the import. +\pre \link GenericMap::dimension `LCC::dimension`\endlink \f$ \geq\f$ 3 and + \link LinearCellComplex::ambient_dimension `LCC::ambient_dimension`\endlink==3. -\sa `CGAL::import_from_plane_graph` -\sa `CGAL::import_from_polyhedron_3` +\sa `CGAL::read_plane_graph_in_lcc` +\sa `CGAL::polyhedron_3_to_lcc` */ + template -typename LCC::Dart_descriptor import_from_triangulation_3(LCC& lcc, -const Triangulation_&atr); +typename LCC::Dart_descriptor triangulation_3_to_lcc(LCC& lcc, const Triangulation_&atr); + +template +[[deprecated("Use triangulation_3_to_lcc instead")]] +typename LCC::Dart_descriptor import_from_triangulation_3(LCC& lcc, const Triangulation_& atr) +{ + return triangulation_3_to_lcc(lcc, atr); } + +} \ No newline at end of file diff --git a/Linear_cell_complex/doc/Linear_cell_complex/Concepts/LinearCellComplexTraits.h b/Linear_cell_complex/doc/Linear_cell_complex/Concepts/LinearCellComplexTraits.h index e701f011493..50aac41da1e 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/Concepts/LinearCellComplexTraits.h +++ b/Linear_cell_complex/doc/Linear_cell_complex/Concepts/LinearCellComplexTraits.h @@ -64,8 +64,8 @@ which constructs a vector as the difference of points `p2-p1`, and \link LinearCellComplexTraits::Vector ` Vector `\endlink `operator() (const CGAL::Origin&, const ` \link Point ` Point`\endlink`& p)` which constructs a vector as the difference of point `p` and a point at the origin (used in \link CGAL::barycenter `barycenter`\endlink -and `CGAL::import_from_plane_graph`). -*/ +and `CGAL::read_plane_graph_in_lcc`).*/ + typedef unspecified_type Construct_vector; /*! @@ -104,7 +104,7 @@ a model of \link Kernel::Direction_2 `Direction_2`\endlink. typedef unspecified_type Direction_2; /*! -a model of \link Kernel::ConstructDirection_2 `ConstructDirection_2`\endlink (used in `CGAL::import_from_plane_graph`). +a model of \link Kernel::ConstructDirection_2 `ConstructDirection_2`\endlink (used in `CGAL::read_plane_graph_in_lcc`). */ typedef unspecified_type Construct_direction_2; diff --git a/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt b/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt index d58e0f6e2e5..1b19dfc111d 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt +++ b/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt @@ -105,11 +105,12 @@ There are several member functions allowing to insert specific configurations of There are two functions allowing to build a linear cell complex from two other \cgal data types:
    -
  • \link ::import_from_triangulation_3 `import_from_triangulation_3(lcc,atr)`\endlink: adds in `lcc` all the tetrahedra present in `atr`, a \link CGAL::Triangulation_3 `Triangulation_3`\endlink; -
  • \link ::import_from_polyhedron_3 `import_from_polyhedron_3(lcc,ap)`\endlink: adds in `lcc` all the cells present in `ap`, a `Polyhedron_3`. + +
  • \link CGAL::triangulation_3_to_lcc `triangulation_3_to_lcc(lcc,atr)`\endlink: adds in `lcc` all the tetrahedra present in `atr`, a \link CGAL::Triangulation_3 `Triangulation_3`\endlink; +
  • \link CGAL::polyhedron_3_to_lcc `polyhedron_3_to_lcc(lcc,ap)`\endlink: adds in `lcc` all the cells present in `ap`, a `Polyhedron_3`.
-Lastly, the function \link ::import_from_plane_graph `import_from_plane_graph(lcc,ais)`\endlink adds in `lcc` all the cells reconstructed from the planar graph read in `ais`, a `std::istream` (see the \link ::import_from_plane_graph `reference manual`\endlink for the file format). +Lastly, the function \link CGAL::read_plane_graph_in_lcc `read_plane_graph_in_lcc(lcc,ais)`\endlink adds in `lcc` all the cells reconstructed from the planar graph read in `ais`, a `std::istream` (see the \link CGAL::read_plane_graph_in_lcc `reference manual`\endlink for the file format). \subsection Linear_cell_complexModificationOperations Modification Operations \anchor ssecmodifop diff --git a/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt b/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt index caf7173fbee..f0f70d53797 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt +++ b/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt @@ -62,9 +62,9 @@ \cgalCRPSection{Global Functions} \cgalCRPSubsection{Constructions for Linear Cell Complex} -- `CGAL::import_from_plane_graph` -- `CGAL::import_from_triangulation_3` -- `CGAL::import_from_polyhedron_3` +- `CGAL::read_plane_graph_in_lcc` (formerly `import_from_plane_graph`) +- `CGAL::triangulation_3_to_lcc` (formerly `import_from_triangulation_3`) +- `CGAL::polyhedron_3_to_lcc` (formerly `import_from_polyhedron_3`) \cgalCRPSubsection{Operations for Linear Cell Complex} - `CGAL::compute_normal_of_cell_0` diff --git a/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt b/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt index e9604793e4b..d5b66adf6fa 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt +++ b/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt @@ -24,7 +24,7 @@ create_single_source_cgal_program( "linear_cell_complex_3_with_colored_vertices.cpp") create_single_source_cgal_program("linear_cell_complex_3_with_mypoint.cpp") create_single_source_cgal_program("linear_cell_complex_4.cpp") -create_single_source_cgal_program("plane_graph_to_lcc_2.cpp") +create_single_source_cgal_program("read_plane_graph_in_lcc_2.cpp") create_single_source_cgal_program("voronoi_2.cpp") create_single_source_cgal_program("voronoi_3.cpp") diff --git a/Linear_cell_complex/examples/Linear_cell_complex/README.txt b/Linear_cell_complex/examples/Linear_cell_complex/README.txt index e461312f2dd..9184123bfeb 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/README.txt +++ b/Linear_cell_complex/examples/Linear_cell_complex/README.txt @@ -8,7 +8,7 @@ Examples for Linear_cell_complex package: Three "basic" examples, detailed in the user manual. -* plane_graph_to_lcc_2.cpp +* read_plane_graph_in_lcc_2.cpp Program allowing to transform a planar graph into a 2D linear cell complex. diff --git a/Linear_cell_complex/examples/Linear_cell_complex/plane_graph_to_lcc_2.cpp b/Linear_cell_complex/examples/Linear_cell_complex/read_plane_graph_in_lcc_2.cpp similarity index 97% rename from Linear_cell_complex/examples/Linear_cell_complex/plane_graph_to_lcc_2.cpp rename to Linear_cell_complex/examples/Linear_cell_complex/read_plane_graph_in_lcc_2.cpp index 58fd07d2bf9..c6ef3bac676 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/plane_graph_to_lcc_2.cpp +++ b/Linear_cell_complex/examples/Linear_cell_complex/read_plane_graph_in_lcc_2.cpp @@ -42,7 +42,7 @@ int main(int narg, char** argv) std::ifstream is(filename.c_str()); std::cout<<"Import plane graph from "< vol_to_dart; - Dart_descriptor d=CGAL::import_from_triangulation_3 + Dart_descriptor d=CGAL::triangulation_3_to_lcc (lcc, T, &vol_to_dart); std::cout<<"Delaunay triangulation :"< #include #include +#include namespace CGAL { @@ -36,7 +37,7 @@ namespace CGAL { * Imports a plane-embedded graph from a list of points and edges represented as pairs of vertex indices */ template< class LCC > - typename LCC::Dart_descriptor import_from_plane_graph(LCC& alcc, + typename LCC::Dart_descriptor read_plane_graph_in_lcc(LCC& alcc, const std::vector& vertices, const std::vector& edge_indices) { @@ -130,6 +131,21 @@ namespace CGAL { return first; } +#ifndef CGAL_NO_DEPRECATED_CODE +/*! + \deprecated This function is deprecated since CGAL 6.2. Use `read_plane_graph_in_lcc()` instead. +*/ +template< class LCC > +CGAL_DEPRECATED +typename LCC::Dart_descriptor +import_from_plane_graph(LCC& alcc, + const std::vector& vertices, + const std::vector& edge_indices) +{ + return read_plane_graph_in_lcc(alcc, vertices, edge_indices); +} +#endif + /** * Imports a plane-embedded graph from a file into a LinearCellComplex. * @@ -138,7 +154,7 @@ namespace CGAL { * @return A dart created during the conversion. */ template< class LCC > - typename LCC::Dart_descriptor import_from_plane_graph(LCC& alcc, + typename LCC::Dart_descriptor read_plane_graph_in_lcc(LCC& alcc, std::istream& ais) { using FT = typename LCC::FT; @@ -185,18 +201,44 @@ namespace CGAL { edge_indices.push_back(v2); } - return import_from_plane_graph(alcc, vertices, edge_indices); + return read_plane_graph_in_lcc(alcc, vertices, edge_indices); } +#ifndef CGAL_NO_DEPRECATED_CODE +/*! + \deprecated This function is deprecated since CGAL 6.2. Use `read_plane_graph_in_lcc()` instead. +*/ +template< class LCC > +CGAL_DEPRECATED +typename LCC::Dart_descriptor +import_from_plane_graph(LCC& alcc, std::istream& ais) +{ + return read_plane_graph_in_lcc(alcc, ais); +} +#endif + template < class LCC > typename LCC::Dart_descriptor - import_from_plane_graph(LCC& alcc, const char* filename) + read_plane_graph_in_lcc(LCC& alcc, const char* filename) { std::ifstream input(filename); if (!input.is_open()) return alcc.null_descriptor; - return import_from_plane_graph(alcc, input); + return read_plane_graph_in_lcc(alcc, input); } +#ifndef CGAL_NO_DEPRECATED_CODE +/*! + \deprecated This function is deprecated since CGAL 6.2. Use `read_plane_graph_in_lcc()` instead. +*/ +template< class LCC > +CGAL_DEPRECATED +typename LCC::Dart_descriptor +import_from_plane_graph(LCC& alcc, const char* filename) +{ + return read_plane_graph_in_lcc(alcc, filename); +} +#endif + template < class LCC > bool load_off(LCC& alcc, std::istream& in) { diff --git a/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt b/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt index d19fc827d59..b7bc367cf27 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt +++ b/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt @@ -36,3 +36,13 @@ add_executable(Linear_cell_complex_copy_test_index Linear_cell_complex_copy_test target_compile_definitions(Linear_cell_complex_copy_test_index PRIVATE USE_COMPACT_CONTAINER_WITH_INDEX) target_link_libraries(Linear_cell_complex_copy_test_index PRIVATE CGAL CGAL::Data) cgal_add_compilation_test(Linear_cell_complex_copy_test_index) + +# Alias tests (test old function names, with deprecated warnings disabled) +create_single_source_cgal_program(test_triangulation_alias.cpp ${hfiles}) +target_compile_definitions(test_triangulation_alias PRIVATE CGAL_NO_DEPRECATION_WARNINGS) + +create_single_source_cgal_program(test_polyhedron_3_alias.cpp ${hfiles}) +target_compile_definitions(test_polyhedron_3_alias PRIVATE CGAL_NO_DEPRECATION_WARNINGS) + +create_single_source_cgal_program(test_plane_graph_alias.cpp ${hfiles}) +target_compile_definitions(test_plane_graph_alias PRIVATE CGAL_NO_DEPRECATION_WARNINGS) diff --git a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_2_test.h b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_2_test.h index f22bd0a480a..c1a80876d35 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_2_test.h +++ b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_2_test.h @@ -382,7 +382,7 @@ bool test_LCC_2() std::cout<<"Error: impossible to open 'data/graph.txt'"<(lcc,in); + CGAL::read_plane_graph_in_lcc(lcc,in); if ( !check_number_of_cells_2(lcc, 66, 166, 104, 2) ) return false; lcc.clear(); @@ -431,7 +431,7 @@ struct Test_change_orientation_LCC_2 std::cout<<"Error: impossible to open 'data/graph.txt'"<(lcc,in); + CGAL::read_plane_graph_in_lcc(lcc,in); trace_test_begin(); diff --git a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_3_test.h b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_3_test.h index 1f696a41811..4222e553c43 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_3_test.h +++ b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_3_test.h @@ -997,7 +997,7 @@ bool test_LCC_3() } in >> P; - CGAL::import_from_polyhedron_3(lcc,P); + CGAL::polyhedron_3_to_lcc(lcc,P); if ( !check_number_of_cells_3(lcc, 1539, 4434, 2894, 2, 2) ) return false; @@ -1029,7 +1029,7 @@ bool test_LCC_3() } T.insert ( std::istream_iterator < Point >(in), std::istream_iterator < Point >() ); - CGAL::import_from_triangulation_3(lcc,T); + CGAL::triangulation_3_to_lcc(lcc,T); if ( !lcc.is_valid() ) return false; diff --git a/Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp b/Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp new file mode 100644 index 00000000000..cafb22ad4b4 --- /dev/null +++ b/Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp @@ -0,0 +1,35 @@ +#include +#include +#include +#include +#include +#include + +typedef CGAL::Linear_cell_complex_for_combinatorial_map<2> LCC; + + + +int main() +{ +#ifndef CGAL_NO_DEPRECATED_CODE + LCC lcc1, lcc2; + + // Planar graph with 3 vertices and 3 edges (triangle) + std::stringstream input; + input << "3 3\n0.0 0.0\n1.0 0.0\n0.0 1.0\n0 1\n1 2\n2 0\n"; + + // Test new function + auto d1 = CGAL::read_plane_graph_in_lcc(lcc1, input); + assert(d1 != LCC::null_descriptor); + + // Rewind input stream for second test + input.clear(); + input.seekg(0, std::ios::beg); + + // Test deprecated function + auto d2 = CGAL::import_from_plane_graph(lcc2, input); + assert(d2 != LCC::null_descriptor); +#endif // CGAL_NO_DEPRECATED_CODE + return EXIT_SUCCESS; +} + diff --git a/Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp b/Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp new file mode 100644 index 00000000000..183aac6e0be --- /dev/null +++ b/Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp @@ -0,0 +1,31 @@ +#include +#include +#include +#include +#include +#include +#include + +typedef CGAL::Linear_cell_complex_for_combinatorial_map<3> LCC; +typedef CGAL::Polyhedron_3 Polyhedron; + + +int main() +{ +#ifndef CGAL_NO_DEPRECATED_CODE + std::stringstream ss("OFF\n0 0 0\n"); + + Polyhedron P; + ss >> P; + + LCC lcc1, lcc2; + + auto d1 = CGAL::polyhedron_3_to_lcc(lcc1, P); + assert(d1 == LCC::null_descriptor); + + auto d2 = CGAL::import_from_polyhedron_3(lcc2, P); + assert(d2 == LCC::null_descriptor); +#endif // CGAL_NO_DEPRECATED_CODE + return EXIT_SUCCESS; +} + diff --git a/Linear_cell_complex/test/Linear_cell_complex/test_triangulation_alias.cpp b/Linear_cell_complex/test/Linear_cell_complex/test_triangulation_alias.cpp new file mode 100644 index 00000000000..43b9e0ebf82 --- /dev/null +++ b/Linear_cell_complex/test/Linear_cell_complex/test_triangulation_alias.cpp @@ -0,0 +1,29 @@ +#include +#include +#include +#include +#include +#include + +typedef CGAL::Linear_cell_complex_for_combinatorial_map<3> LCC_3; +typedef CGAL::Delaunay_triangulation_3 Triangulation; + + + +int main() +{ +#ifndef CGAL_NO_DEPRECATED_CODE + LCC_3 lcc1, lcc2; + Triangulation T; + + assert(T.dimension() == -1); + + auto d1 = CGAL::triangulation_3_to_lcc(lcc1, T); + assert(d1 == LCC_3::null_descriptor); + + auto d2 = CGAL::import_from_triangulation_3(lcc2, T); + assert(d2 == LCC_3::null_descriptor); +#endif // CGAL_NO_DEPRECATED_CODE + return EXIT_SUCCESS; +} + diff --git a/Maintenance/public_release/scripts/github-release-upload b/Maintenance/public_release/scripts/github-release-upload index 8a253f112bd..02d0311ee5e 100755 --- a/Maintenance/public_release/scripts/github-release-upload +++ b/Maintenance/public_release/scripts/github-release-upload @@ -6,5 +6,5 @@ release=${${PWD:t}/CGAL-/} tag=v${release} -gh release upload "$tag" *.(zip|xz|txt|exe) -R CGAL/cgal -gh release upload "$tag" CGAL-${release}-win64-auxiliary-libraries-gmp-mpfr.zip'#GMP and MPFR libraries, for Windows 64bits' -R CGAL/cgal --clobber +gh release upload --clobber "$tag" *.(zip|xz|txt|exe) -R CGAL/cgal +gh release upload --clobber "$tag" CGAL-${release}-win64-auxiliary-libraries-gmp-mpfr.zip'#GMP and MPFR libraries, for Windows 64bits' -R CGAL/cgal --clobber diff --git a/Mesh_2/package_info/Mesh_2/dependencies b/Mesh_2/package_info/Mesh_2/dependencies index 8e839394994..debbfb4bc39 100644 --- a/Mesh_2/package_info/Mesh_2/dependencies +++ b/Mesh_2/package_info/Mesh_2/dependencies @@ -12,5 +12,4 @@ Number_types Profiling_tools STL_Extension Stream_support -TDS_2 Triangulation_2 diff --git a/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_static_filters.h b/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_static_filters.h index cd870c938e6..a630fdca5cb 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_static_filters.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_static_filters.h @@ -18,6 +18,9 @@ #include #include #include +#include +#include +#include namespace CGAL { namespace SFA { // static filter adapter @@ -151,6 +154,150 @@ template struct Side_of_oriented_sphere_3 : private Store return typename internal::Static_filters_predicates::Side_of_oriented_sphere_3()(P(this->kernel(),c,A),P(this->kernel(),c,B),P(this->kernel(),c,C),P(this->kernel(),c,D),P(this->kernel(),c,E)); } }; + + +template struct Adapter_4 { + typedef typename Get_type::type Orientation; + typedef typename Get_type::type Oriented_side; + typedef typename Get_type::type Point; + typedef typename Get_functor::type CC; + typedef typename Get_functor::type Orientation_base; + struct Point_4 { + R_ const&r; CC const&c; Point const& p; + Point_4(R_ const&r_, CC const&c_, Point const&p_):r(r_),c(c_),p(p_){} + decltype(auto) c0()const{return c(p,0);} + decltype(auto) c1()const{return c(p,1);} + decltype(auto) c2()const{return c(p,2);} + decltype(auto) c3()const{return c(p,3);} + }; + struct Orientation_4 { + typedef typename Get_type::type result_type; + auto operator()(Point_4 const&A, Point_4 const&B, Point_4 const&C, + Point_4 const&D, Point_4 const&E)const{ + Point const* t[6]={&A.p,&B.p,&C.p,&D.p,&E.p}; + return Orientation_base(A.r)(make_transforming_iterator(t+0),make_transforming_iterator(t+5)); + } + }; +}; + + +template struct Orientation_of_points_4 : private Store_kernel { + CGAL_FUNCTOR_INIT_STORE(Orientation_of_points_4) + typedef typename Get_type::type Point; + typedef typename Get_type::type result_type; + typedef typename Get_functor::type CC; + typedef Adapter_4 Adapter; + template result_type operator()(Iter f, Iter CGAL_assertion_code(e))const{ + CC c(this->kernel()); + Point const& A=*f; + Point const& B=*++f; + Point const& C=*++f; + Point const& D=*++f; + Point const& E=*++f; + CGAL_assertion(++f==e); + typedef typename Adapter::Point_4 P; + return typename internal::Static_filters_predicates::Orientation_4()(P(this->kernel(),c,A),P(this->kernel(),c,B),P(this->kernel(),c,C), + P(this->kernel(),c,D),P(this->kernel(),c,E)); + } +}; + +template struct Adapter_5 { + typedef typename Get_type::type Orientation; + typedef typename Get_type::type Oriented_side; + typedef typename Get_type::type Point; + typedef typename Get_functor::type CC; + typedef typename Get_functor::type Orientation_base; + struct Point_5 { + R_ const&r; CC const&c; Point const& p; + Point_5(R_ const&r_, CC const&c_, Point const&p_):r(r_),c(c_),p(p_){} + decltype(auto) c0()const{return c(p,0);} + decltype(auto) c1()const{return c(p,1);} + decltype(auto) c2()const{return c(p,2);} + decltype(auto) c3()const{return c(p,3);} + decltype(auto) c4()const{return c(p,4);} + }; + struct Orientation_5 { + typedef typename Get_type::type result_type; + auto operator()(Point_5 const&A, Point_5 const&B, Point_5 const&C, + Point_5 const&D, Point_5 const&E, Point_5 const&F)const{ + Point const* t[6]={&A.p,&B.p,&C.p,&D.p,&E.p,&F.p}; + return Orientation_base(A.r)(make_transforming_iterator(t+0),make_transforming_iterator(t+6)); + } + }; +}; + + +template struct Orientation_of_points_5 : private Store_kernel { + CGAL_FUNCTOR_INIT_STORE(Orientation_of_points_5) + typedef typename Get_type::type Point; + typedef typename Get_type::type result_type; + typedef typename Get_functor::type CC; + typedef Adapter_5 Adapter; + template result_type operator()(Iter f, Iter CGAL_assertion_code(e))const{ + CC c(this->kernel()); + Point const& A=*f; + Point const& B=*++f; + Point const& C=*++f; + Point const& D=*++f; + Point const& E=*++f; + Point const& F=*++f; + CGAL_assertion(++f==e); + typedef typename Adapter::Point_5 P; + return typename internal::Static_filters_predicates::Orientation_5()(P(this->kernel(),c,A),P(this->kernel(),c,B),P(this->kernel(),c,C), + P(this->kernel(),c,D),P(this->kernel(),c,E),P(this->kernel(),c,F)); + } +}; + +template struct Adapter_6 { + typedef typename Get_type::type Orientation; + typedef typename Get_type::type Oriented_side; + typedef typename Get_type::type Point; + typedef typename Get_functor::type CC; + typedef typename Get_functor::type Orientation_base; + struct Point_6 { + R_ const&r; CC const&c; Point const& p; + Point_6(R_ const&r_, CC const&c_, Point const&p_):r(r_),c(c_),p(p_){} + decltype(auto) c0()const{return c(p,0);} + decltype(auto) c1()const{return c(p,1);} + decltype(auto) c2()const{return c(p,2);} + decltype(auto) c3()const{return c(p,3);} + decltype(auto) c4()const{return c(p,4);} + decltype(auto) c5()const{return c(p,5);} + }; + struct Orientation_6 { + typedef typename Get_type::type result_type; + auto operator()(Point_6 const&A, Point_6 const&B, Point_6 const&C, + Point_6 const&D, Point_6 const&E, Point_6 const&F, Point_6 const&G)const{ + Point const* t[7]={&A.p,&B.p,&C.p,&D.p,&E.p,&F.p,&G.p}; + return Orientation_base(A.r)(make_transforming_iterator(t+0),make_transforming_iterator(t+7)); + } + }; +}; +template struct Orientation_of_points_6 : private Store_kernel { + CGAL_FUNCTOR_INIT_STORE(Orientation_of_points_6) + typedef typename Get_type::type Point; + typedef typename Get_type::type result_type; + typedef typename Get_functor::type CC; + typedef Adapter_6 Adapter; + template result_type operator()(Iter f, Iter CGAL_assertion_code(e))const{ + CC c(this->kernel()); + Point const& A=*f; + Point const& B=*++f; + Point const& C=*++f; + Point const& D=*++f; + Point const& E=*++f; + Point const& F=*++f; + Point const& G=*++f; + CGAL_assertion(++f==e); + typedef typename Adapter::Point_6 P; + return typename internal::Static_filters_predicates::Orientation_6()(P(this->kernel(),c,A),P(this->kernel(),c,B),P(this->kernel(),c,C), + P(this->kernel(),c,D),P(this->kernel(),c,E),P(this->kernel(),c,F), + P(this->kernel(),c,G)); + } +}; + + + } // namespace SFA template @@ -194,5 +341,44 @@ struct Cartesian_static_filters, R_, Derived_> : public R_ { typedef SFA::Side_of_oriented_sphere_3 type; }; }; + +#ifndef CGAL_NO_STATIC_FILTER_456 + +template +struct Cartesian_static_filters, R_, Derived_> : public R_ { + constexpr Cartesian_static_filters(){} + constexpr Cartesian_static_filters(int d):R_(d){} + typedef Cartesian_static_filters, R_, Derived_> Self; + typedef typename Default::Get::type Derived; + template struct Functor : Inherit_functor {}; + template struct Functor { + typedef SFA::Orientation_of_points_4 type; + }; +}; + +template +struct Cartesian_static_filters, R_, Derived_> : public R_ { + constexpr Cartesian_static_filters(){} + constexpr Cartesian_static_filters(int d):R_(d){} + typedef Cartesian_static_filters, R_, Derived_> Self; + typedef typename Default::Get::type Derived; + template struct Functor : Inherit_functor {}; + template struct Functor { + typedef SFA::Orientation_of_points_5 type; + }; +}; + +template +struct Cartesian_static_filters, R_, Derived_> : public R_ { + constexpr Cartesian_static_filters(){} + constexpr Cartesian_static_filters(int d):R_(d){} + typedef Cartesian_static_filters, R_, Derived_> Self; + typedef typename Default::Get::type Derived; + template struct Functor : Inherit_functor {}; + template struct Functor { + typedef SFA::Orientation_of_points_6 type; + }; +}; +#endif } // namespace CGAL #endif diff --git a/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Point_d.h b/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Point_d.h index af2d970f3f2..33287420f01 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Point_d.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Point_d.h @@ -137,6 +137,12 @@ public: friend auto operator!=(Point_d const&p, Point_d const&q) { return !(p==q); } + // May be accidentally inherited from the base class otherwise + friend auto operator< (Point_d const&p, Point_d const&q) = delete; + friend auto operator> (Point_d const&p, Point_d const&q) = delete; + friend auto operator<=(Point_d const&p, Point_d const&q) = delete; + friend auto operator>=(Point_d const&p, Point_d const&q) = delete; + friend std::ostream& operator <<(std::ostream& os, const Point_d& p) { auto b = p.cartesian_begin(); diff --git a/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Vector_d.h b/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Vector_d.h index 1b150be0aae..1a1aa56896e 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Vector_d.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Vector_d.h @@ -130,6 +130,19 @@ public: return SLBase()(rep()); } + friend auto operator==(Vector_d const&p, Vector_d const&q) { + typedef typename Get_functor::type EPBase; + return EPBase()(p.rep(), q.rep()); + } + + friend auto operator!=(Vector_d const&p, Vector_d const&q) { return !(p==q); } + + // May be accidentally inherited from the base class otherwise + friend auto operator< (Vector_d const&p, Vector_d const&q) = delete; + friend auto operator> (Vector_d const&p, Vector_d const&q) = delete; + friend auto operator<=(Vector_d const&p, Vector_d const&q) = delete; + friend auto operator>=(Vector_d const&p, Vector_d const&q) = delete; + friend std::ostream& operator <<(std::ostream& os, const Vector_d& v) { auto b = v.cartesian_begin(); diff --git a/NewKernel_d/include/CGAL/NewKernel_d/function_objects_cartesian.h b/NewKernel_d/include/CGAL/NewKernel_d/function_objects_cartesian.h index 4fbf2441276..74252ce22a1 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/function_objects_cartesian.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/function_objects_cartesian.h @@ -1279,6 +1279,36 @@ template struct Equal_points : private Store_kernel { CGAL_KD_DEFAULT_FUNCTOR(Equal_points_tag,(CartesianDKernelFunctors::Equal_points),(),(Construct_ttag)); +namespace CartesianDKernelFunctors { +template struct Equal_vectors : private Store_kernel { + CGAL_FUNCTOR_INIT_STORE(Equal_vectors) + typedef R_ R; + typedef typename Get_type::type result_type; + typedef typename Get_functor >::type CI; + // TODO: This is_exact thing should be reengineered. + // the goal is to have a way to tell: don't filter this + typedef typename CGAL::Uses_no_arithmetic Uses_no_arithmetic; + + template + result_type operator()(V const&a, W const&b)const{ + CI c(this->kernel()); + + + auto a_begin=c(a,Begin_tag()); + auto b_begin=c(b,Begin_tag()); + auto a_end=c(a,End_tag()); + + result_type res = true; + // Is using CGAL::possibly for Uncertain really an optimization? + do res = res & (*a_begin++ == *b_begin++); + while(a_begin!=a_end && possibly(res)); + return res; + } +}; +} + +CGAL_KD_DEFAULT_FUNCTOR(Equal_vectors_tag,(CartesianDKernelFunctors::Equal_vectors),(),(Construct_ttag)); + namespace CartesianDKernelFunctors { template struct Oriented_side : private Store_kernel { CGAL_FUNCTOR_INIT_STORE(Oriented_side) diff --git a/NewKernel_d/include/CGAL/NewKernel_d/functor_tags.h b/NewKernel_d/include/CGAL/NewKernel_d/functor_tags.h index 927b51fcb35..934d6102a61 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/functor_tags.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/functor_tags.h @@ -282,6 +282,7 @@ namespace CGAL { CGAL_DECL_PREDICATE(Less_lexicographically); CGAL_DECL_PREDICATE(Less_or_equal_lexicographically); CGAL_DECL_PREDICATE(Equal_points); + CGAL_DECL_PREDICATE(Equal_vectors); CGAL_DECL_PREDICATE(Has_on_positive_side); CGAL_DECL_PREDICATE_(Orientation); // duplicate with the type CGAL_DECL_PREDICATE_(Oriented_side); // duplicate with the type diff --git a/NewKernel_d/include/CGAL/NewKernel_d/orientationC4.h b/NewKernel_d/include/CGAL/NewKernel_d/orientationC4.h new file mode 100644 index 00000000000..3915204817a --- /dev/null +++ b/NewKernel_d/include/CGAL/NewKernel_d/orientationC4.h @@ -0,0 +1,254 @@ +// Copyright (c) 2025 +// INRIA Saclay-Ile de France (France) +// +// This file is part of CGAL (www.cgal.org) +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Andreas Fabri + +// Files needed as input for the static filter generator + +#if 0 + +double determinant( + double a00, double a01, double a02, double a03, + double a10, double a11, double a12, double a13, + double a20, double a21, double a22, double a23, + double a30, double a31, double a32, double a33) +{ + double m01 = a10*a01 - a00*a11; + double m02 = a20*a01 - a00*a21; + double m03 = a30*a01 - a00*a31; + double m12 = a20*a11 - a10*a21; + double m13 = a30*a11 - a10*a31; + double m23 = a30*a21 - a20*a31; + + double m012 = m12*a02 - m02*a12 + m01*a22; + double m013 = m13*a02 - m03*a12 + m01*a32; + double m023 = m23*a02 - m03*a22 + m02*a32; + double m123 = m23*a12 - m13*a22 + m12*a32; + + double m0123 = m123*a03 - m023*a13 + m013*a23 - m012*a33; + return m0123; +} + +int orientationC4(double p0, double p1, double p2, double p3, + double q0, double q1, double q2, double q3, + double r0, double r1, double r2, double r3, + double s0, double s1, double s2, double s3, + double t0, double t1, double t2, double t3) +group p0 q0 r0 t0 q0; +group p1 q1 r1 t1 q1; +group p2 q2 r2 t2 q2; +group p3 q3 r3 t3 q3; +{ + + double m01; + m01 = (q0 - p0); + double m02; + m02 = (r0 - p0); + double m03; + m03 = (s0 - p0); + double m04; + m04 = (t0 - p0); + + double m11; + m11 = (q1 - p1); + double m12; + m12 = (r1 - p1); + double m13; + m13 = (s1 - p1); + double m14; + m14 = (t1 - p1); + + double m21; + m21 = (q2 - p2); + double m22; + m22 = (r2 - p2); + double m23; + m23 = (s2 - p2); + double m24; + m24 = (t2 - p2); + + double m31; + m31 = (q3 - p3); + double m32; + m32 = (r3 - p3); + double m33; + m33 = (s3 - p3); + double m34; + m34 = (t3 - p3); + + double det = determinant(m01, m02, m03, m04, + m11, m12, m13, m14, + m21, m22, m23, m24, + m31, m32, m33, m34); + return sign(det); + + +} + +//===========generated ================== + +inline int orientationC4( double p0, double p1, double p2, double p3, double q0, double q1, double q2, double q3, double r0, double r1, double r2, double r3, double s0, double s1, double s2, double s3, double t0, double t1, double t2, double t3) { + double m01; + m01 = (q0 - p0); + double m02; + m02 = (r0 - p0); + double m03; + m03 = (s0 - p0); + double m04; + m04 = (t0 - p0); + double m11; + m11 = (q1 - p1); + double m12; + m12 = (r1 - p1); + double m13; + m13 = (s1 - p1); + double m14; + m14 = (t1 - p1); + double m21; + m21 = (q2 - p2); + double m22; + m22 = (r2 - p2); + double m23; + m23 = (s2 - p2); + double m24; + m24 = (t2 - p2); + double m31; + m31 = (q3 - p3); + double m32; + m32 = (r3 - p3); + double m33; + m33 = (s3 - p3); + double m34; + m34 = (t3 - p3); + double det; + det = determinant( m01, m02, m03, m04, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34 ); + int int_tmp_result; + double eps; + double max1 = CGAL::abs(m01); + double am = CGAL::abs(m02); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m03); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m11); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m12); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m13); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m23); + if( (max1 < am) ) { max1 = am; } + + + double max2 = CGAL::abs(m01); + am = CGAL::abs(m02); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m11); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m12); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m21); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m22); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m23); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m33); + if( (max2 < am) ) { max2 = am; } + + + double max3 = CGAL::abs(m04); + am = CGAL::abs(m14); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m24); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m34); + if( (max3 < am) ) { max3 = am; } + + + double max4 = CGAL::abs(m11); + am = CGAL::abs(m12); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m21); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m22); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m31); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m32); + if( (max4 < am) ) { max4 = am; } + + + double lower_bound_1; + double upper_bound_1; + lower_bound_1 = max1; + upper_bound_1 = max1; + if( (max2 < lower_bound_1) ) + { + lower_bound_1 = max2; + } + else + { + if( (max2 > upper_bound_1) ) + { + upper_bound_1 = max2; + } + } + if( (max3 < lower_bound_1) ) + { + lower_bound_1 = max3; + } + else + { + if( (max3 > upper_bound_1) ) + { + upper_bound_1 = max3; + } + } + if( (max4 < lower_bound_1) ) + { + lower_bound_1 = max4; + } + else + { + if( (max4 > upper_bound_1) ) + { + upper_bound_1 = max4; + } + } + if( (lower_bound_1 < 2.89273249588395272840e-74) ) + { + return FPG_UNCERTAIN_VALUE; + } + else + { + if( (upper_bound_1 > 7.23700557733225900010e+75) ) + { + return FPG_UNCERTAIN_VALUE; + } + eps = (3.17768858673611327578e-14 * (((max4 * max2) * max1) * max3)); + if( (det > eps) ) + { + int_tmp_result = 1; + } + else + { + if( (det < -eps) ) + { + int_tmp_result = -1; + } + else + { + return FPG_UNCERTAIN_VALUE; + } + } + } + return int_tmp_result; +} + +#endif diff --git a/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h b/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h new file mode 100644 index 00000000000..a97977fb89e --- /dev/null +++ b/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h @@ -0,0 +1,345 @@ +// Copyright (c) 2025 +// INRIA Saclay-Ile de France (France) +// +// This file is part of CGAL (www.cgal.org) +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Andreas Fabri + +// Files needed as input for the static filter generator + +#if 0 + +double +determinant( + double a00, double a01, double a02, double a03, double a04, + double a10, double a11, double a12, double a13, double a14, + double a20, double a21, double a22, double a23, double a24, + double a30, double a31, double a32, double a33, double a34, + double a40, double a41, double a42, double a43, double a44) +{ + double m01 = a10*a01 - a00*a11; + double m02 = a20*a01 - a00*a21; + double m03 = a30*a01 - a00*a31; + double m04 = a40*a01 - a00*a41; + double m12 = a20*a11 - a10*a21; + double m13 = a30*a11 - a10*a31; + double m14 = a40*a11 - a10*a41; + double m23 = a30*a21 - a20*a31; + double m24 = a40*a21 - a20*a41; + double m34 = a40*a31 - a30*a41; + double m012 = m12*a02 - m02*a12 + m01*a22; + double m013 = m13*a02 - m03*a12 + m01*a32; + double m014 = m14*a02 - m04*a12 + m01*a42; + double m023 = m23*a02 - m03*a22 + m02*a32; + double m024 = m24*a02 - m04*a22 + m02*a42; + double m034 = m34*a02 - m04*a32 + m03*a42; + double m123 = m23*a12 - m13*a22 + m12*a32; + double m124 = m24*a12 - m14*a22 + m12*a42; + double m134 = m34*a12 - m14*a32 + m13*a42; + double m234 = m34*a22 - m24*a32 + m23*a42; + double m0123 = m123*a03 - m023*a13 + m013*a23 - m012*a33; + double m0124 = m124*a03 - m024*a13 + m014*a23 - m012*a43; + double m0134 = m134*a03 - m034*a13 + m014*a33 - m013*a43; + double m0234 = m234*a03 - m034*a23 + m024*a33 - m023*a43; + double m1234 = m234*a13 - m134*a23 + m124*a33 - m123*a43; + double m01234 = m1234*a04 - m0234*a14 + m0134*a24 - m0124*a34 + m0123*a44; + return m01234; +} + +int orientationC5(double p0, double p1, double p2, double p3, double p4, + double q0, double q1, double q2, double q3, double q4, + double r0, double r1, double r2, double r3, double r4, + double s0, double s1, double s2, double s3, double s4, + double t0, double t1, double t2, double t3, double t4, + double u0, double u1, double u2, double u3, double u4) +group p0 q0 r0 t0 q0 u0; +group p1 q1 r1 t1 q1 u1; +group p2 q2 r2 t2 q2 u2; +group p3 q3 r3 t3 q3 u3; +group p4 q4 r4 t4 q4 u4; +{ + double m01; + m01 = (q0 - p0); + double m02; + m02 = (r0 - p0); + double m03; + m03 = (s0 - p0); + double m04; + m04 = (t0 - p0); + double m05; + m05 = (u0 - p0); + + double m11; + m11 = (q1 - p1); + double m12; + m12 = (r1 - p1); + double m13; + m13 = (s1 - p1); + double m14; + m14 = (t1 - p1); + double m15; + m15 = (u1 - p1); + + double m21; + m21 = (q2 - p2); + double m22; + m22 = (r2 - p2); + double m23; + m23 = (s2 - p2); + double m24; + m24 = (t2 - p2); + double m25; + m25 = (u2 - p2); + + double m31; + m31 = (q3 - p3); + double m32; + m32 = (r3 - p3); + double m33; + m33 = (s3 - p3); + double m34; + m34 = (t3 - p3); + double m35; + m35 = (u3 - p3); + + double m41; + m41 = (q4 - p4); + double m42; + m42 = (r4 - p4); + double m43; + m43 = (s4 - p4); + double m44; + m44 = (t4 - p4); + double m45; + m45 = (u4 - p4); + + double det = determinant(m01, m02, m03, m04, m05, + m11, m12, m13, m14, m15, + m21, m22, m23, m24, m25, + m31, m32, m33, m34, m35, + m41, m42, m43, m44, m45); + return sign(det); +} + +//===========generated ================== + +inline int orientationC5( double p0, double p1, double p2, double p3, double p4, double q0, double q1, double q2, double q3, double q4, double r0, double r1, double r2, double r3, double r4, double s0, double s1, double s2, double s3, double s4, double t0, double t1, double t2, double t3, double t4, double u0, double u1, double u2, double u3, double u4) { + double m01; + m01 = (q0 - p0); + double m02; + m02 = (r0 - p0); + double m03; + m03 = (s0 - p0); + double m04; + m04 = (t0 - p0); + double m05; + m05 = (u0 - p0); + double m11; + m11 = (q1 - p1); + double m12; + m12 = (r1 - p1); + double m13; + m13 = (s1 - p1); + double m14; + m14 = (t1 - p1); + double m15; + m15 = (u1 - p1); + double m21; + m21 = (q2 - p2); + double m22; + m22 = (r2 - p2); + double m23; + m23 = (s2 - p2); + double m24; + m24 = (t2 - p2); + double m25; + m25 = (u2 - p2); + double m31; + m31 = (q3 - p3); + double m32; + m32 = (r3 - p3); + double m33; + m33 = (s3 - p3); + double m34; + m34 = (t3 - p3); + double m35; + m35 = (u3 - p3); + double m41; + m41 = (q4 - p4); + double m42; + m42 = (r4 - p4); + double m43; + m43 = (s4 - p4); + double m44; + m44 = (t4 - p4); + double m45; + m45 = (u4 - p4); + double det; + det = determinant( m01, m02, m03, m04, m05, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25, m31, m32, m33, m34, m35, m41, m42, m43, m44, m45 ); + int int_tmp_result; + double eps; + double max1 = CGAL::abs(m01); + double am = CGAL::abs(m02); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m03); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m11); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m12); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m13); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m21); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m22); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m23); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m33); + if( (max1 < am) ) { max1 = am; } + + + double max2 = CGAL::abs(m01); + am = CGAL::abs(m02); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m11); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m12); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m21); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m22); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m23); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m31); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m32); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m33); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m43); + if( (max2 < am) ) { max2 = am; } + + + double max3 = CGAL::abs(m04); + am = CGAL::abs(m14); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m24); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m34); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m44); + if( (max3 < am) ) { max3 = am; } + + + double max4 = CGAL::abs(m05); + am = CGAL::abs(m15); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m25); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m35); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m45); + if( (max4 < am) ) { max4 = am; } + + + double max5 = CGAL::abs(m11); + am = CGAL::abs(m12); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m21); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m22); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m31); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m32); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m41); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m42); + if( (max5 < am) ) { max5 = am; } + + double lower_bound_1; + double upper_bound_1; + lower_bound_1 = max5; + upper_bound_1 = max5; + if( (max1 < lower_bound_1) ) + { + lower_bound_1 = max1; + } + else + { + if( (max1 > upper_bound_1) ) + { + upper_bound_1 = max1; + } + } + if( (max2 < lower_bound_1) ) + { + lower_bound_1 = max2; + } + else + { + if( (max2 > upper_bound_1) ) + { + upper_bound_1 = max2; + } + } + if( (max3 < lower_bound_1) ) + { + lower_bound_1 = max3; + } + else + { + if( (max3 > upper_bound_1) ) + { + upper_bound_1 = max3; + } + } + if( (max4 < lower_bound_1) ) + { + lower_bound_1 = max4; + } + else + { + if( (max4 > upper_bound_1) ) + { + upper_bound_1 = max4; + } + } + if( (lower_bound_1 < 9.99657131447050328602e-60) ) + { + return FPG_UNCERTAIN_VALUE; + } + else + { + if( (upper_bound_1 > 3.21387608851797912384e+60) ) + { + return FPG_UNCERTAIN_VALUE; + } + eps = (2.22889232457534740153e-13 * ((((max5 * max2) * max1) * max3) * max4)); + if( (det > eps) ) + { + int_tmp_result = 1; + } + else + { + if( (det < -eps) ) + { + int_tmp_result = -1; + } + else + { + return FPG_UNCERTAIN_VALUE; + } + } + } + return int_tmp_result; +} + +#endif diff --git a/NewKernel_d/include/CGAL/NewKernel_d/orientationC6.h b/NewKernel_d/include/CGAL/NewKernel_d/orientationC6.h new file mode 100644 index 00000000000..ca9f32a5d99 --- /dev/null +++ b/NewKernel_d/include/CGAL/NewKernel_d/orientationC6.h @@ -0,0 +1,477 @@ +// Copyright (c) 2025 +// INRIA Saclay-Ile de France (France) +// +// This file is part of CGAL (www.cgal.org) +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Andreas Fabri + +// Files needed as input for the static filter generator + +#if 0 +double +determinant( + double a00, double a01, double a02, double a03, double a04, double a05, + double a10, double a11, double a12, double a13, double a14, double a15, + double a20, double a21, double a22, double a23, double a24, double a25, + double a30, double a31, double a32, double a33, double a34, double a35, + double a40, double a41, double a42, double a43, double a44, double a45, + double a50, double a51, double a52, double a53, double a54, double a55) +{ + double m01 = a00*a11 - a10*a01; + double m02 = a00*a21 - a20*a01; + double m03 = a00*a31 - a30*a01; + double m04 = a00*a41 - a40*a01; + double m05 = a00*a51 - a50*a01; + double m12 = a10*a21 - a20*a11; + double m13 = a10*a31 - a30*a11; + double m14 = a10*a41 - a40*a11; + double m15 = a10*a51 - a50*a11; + double m23 = a20*a31 - a30*a21; + double m24 = a20*a41 - a40*a21; + double m25 = a20*a51 - a50*a21; + double m34 = a30*a41 - a40*a31; + double m35 = a30*a51 - a50*a31; + double m45 = a40*a51 - a50*a41; + + double m012 = m01*a22 - m02*a12 + m12*a02; + double m013 = m01*a32 - m03*a12 + m13*a02; + double m014 = m01*a42 - m04*a12 + m14*a02; + double m015 = m01*a52 - m05*a12 + m15*a02; + double m023 = m02*a32 - m03*a22 + m23*a02; + double m024 = m02*a42 - m04*a22 + m24*a02; + double m025 = m02*a52 - m05*a22 + m25*a02; + double m034 = m03*a42 - m04*a32 + m34*a02; + double m035 = m03*a52 - m05*a32 + m35*a02; + double m045 = m04*a52 - m05*a42 + m45*a02; + double m123 = m12*a32 - m13*a22 + m23*a12; + double m124 = m12*a42 - m14*a22 + m24*a12; + double m125 = m12*a52 - m15*a22 + m25*a12; + double m134 = m13*a42 - m14*a32 + m34*a12; + double m135 = m13*a52 - m15*a32 + m35*a12; + double m145 = m14*a52 - m15*a42 + m45*a12; + double m234 = m23*a42 - m24*a32 + m34*a22; + double m235 = m23*a52 - m25*a32 + m35*a22; + double m245 = m24*a52 - m25*a42 + m45*a22; + double m345 = m34*a52 - m35*a42 + m45*a32; + + double m0123 = m012*a33 - m013*a23 + m023*a13 - m123*a03; + double m0124 = m012*a43 - m014*a23 + m024*a13 - m124*a03; + double m0125 = m012*a53 - m015*a23 + m025*a13 - m125*a03; + double m0134 = m013*a43 - m014*a33 + m034*a13 - m134*a03; + double m0135 = m013*a53 - m015*a33 + m035*a13 - m135*a03; + double m0145 = m014*a53 - m015*a43 + m045*a13 - m145*a03; + double m0234 = m023*a43 - m024*a33 + m034*a23 - m234*a03; + double m0235 = m023*a53 - m025*a33 + m035*a23 - m235*a03; + double m0245 = m024*a53 - m025*a43 + m045*a23 - m245*a03; + double m0345 = m034*a53 - m035*a43 + m045*a33 - m345*a03; + double m1234 = m123*a43 - m124*a33 + m134*a23 - m234*a13; + double m1235 = m123*a53 - m125*a33 + m135*a23 - m235*a13; + double m1245 = m124*a53 - m125*a43 + m145*a23 - m245*a13; + double m1345 = m134*a53 - m135*a43 + m145*a33 - m345*a13; + double m2345 = m234*a53 - m235*a43 + m245*a33 - m345*a23; + + double m01234 = m0123*a44 - m0124*a34 + m0134*a24 - m0234*a14 + m1234*a04; + double m01235 = m0123*a54 - m0125*a34 + m0135*a24 - m0235*a14 + m1235*a04; + double m01245 = m0124*a54 - m0125*a44 + m0145*a24 - m0245*a14 + m1245*a04; + double m01345 = m0134*a54 - m0135*a44 + m0145*a34 - m0345*a14 + m1345*a04; + double m02345 = m0234*a54 - m0235*a44 + m0245*a34 - m0345*a24 + m2345*a04; + double m12345 = m1234*a54 - m1235*a44 + m1245*a34 - m1345*a24 + m2345*a14; + + double m012345 = m01234*a55 - m01235*a45 + m01245*a35 - m01345*a25 + + m02345*a15 - m12345*a05; + return m012345; +} + +int orientationC6(double p0, double p1, double p2, double p3, double p4, double p5, + double q0, double q1, double q2, double q3, double q4, double q5, + double r0, double r1, double r2, double r3, double r4, double r5, + double s0, double s1, double s2, double s3, double s4, double s5, + double t0, double t1, double t2, double t3, double t4, double t5, + double u0, double u1, double u2, double u3, double u4, double u5, + double v0, double v1, double v2, double v3, double v4, double v5) +group p0 q0 r0 t0 q0 u0 v0; +group p1 q1 r1 t1 q1 u1 v1; +group p2 q2 r2 t2 q2 u2 v2; +group p3 q3 r3 t3 q3 u3 v3; +group p4 q4 r4 t4 q4 u4 v4; +group p5 q5 r5 t5 q5 u5 v5; +{ + double m01; + m01 = (q0 - p0); + double m02; + m02 = (r0 - p0); + double m03; + m03 = (s0 - p0); + double m04; + m04 = (t0 - p0); + double m05; + m05 = (u0 - p0); + double m06; + m06 = (v0 - p0); + + double m11; + m11 = (q1 - p1); + double m12; + m12 = (r1 - p1); + double m13; + m13 = (s1 - p1); + double m14; + m14 = (t1 - p1); + double m15; + m15 = (u1 - p1); + double m16; + m16 = (v1 - p1); + + double m21; + m21 = (q2 - p2); + double m22; + m22 = (r2 - p2); + double m23; + m23 = (s2 - p2); + double m24; + m24 = (t2 - p2); + double m25; + m25 = (u2 - p2); + double m26; + m26 = (v2 - p2); + + double m31; + m31 = (q3 - p3); + double m32; + m32 = (r3 - p3); + double m33; + m33 = (s3 - p3); + double m34; + m34 = (t3 - p3); + double m35; + m35 = (u3 - p3); + double m36; + m36 = (v3 - p3); + + double m41; + m41 = (q4 - p4); + double m42; + m42 = (r4 - p4); + double m43; + m43 = (s4 - p4); + double m44; + m44 = (t4 - p4); + double m45; + m45 = (u4 - p4); + double m46; + m46 = (v4 - p4); + + double m51; + m51 = (q5 - p5); + double m52; + m52 = (r5 - p5); + double m53; + m53 = (s5 - p5); + double m54; + m54 = (t5 - p5); + double m55; + m55 = (u5 - p5); + double m56; + m56 = (v5 - p5); + + double det = determinant(m01, m02, m03, m04, m05, m06, + m11, m12, m13, m14, m15, m16, + m21, m22, m23, m24, m25, m26, + m31, m32, m33, m34, m35, m36, + m41, m42, m43, m44, m45, m46, + m51, m52, m53, m54, m55, m56); + return sign(det); +} + +//===========generated ================== + +inline int orientationC6( double p0, double p1, double p2, double p3, double p4, double p5, double q0, double q1, double q2, double q3, double q4, double q5, double r0, double r1, double r2, double r3, double r4, double r5, double s0, double s1, double s2, double s3, double s4, double s5, double t0, double t1, double t2, double t3, double t4, double t5, double u0, double u1, double u2, double u3, double u4, double u5, double v0, double v1, double v2, double v3, double v4, double v5) { + double m01; + m01 = (q0 - p0); + double m02; + m02 = (r0 - p0); + double m03; + m03 = (s0 - p0); + double m04; + m04 = (t0 - p0); + double m05; + m05 = (u0 - p0); + double m06; + m06 = (v0 - p0); + double m11; + m11 = (q1 - p1); + double m12; + m12 = (r1 - p1); + double m13; + m13 = (s1 - p1); + double m14; + m14 = (t1 - p1); + double m15; + m15 = (u1 - p1); + double m16; + m16 = (v1 - p1); + double m21; + m21 = (q2 - p2); + double m22; + m22 = (r2 - p2); + double m23; + m23 = (s2 - p2); + double m24; + m24 = (t2 - p2); + double m25; + m25 = (u2 - p2); + double m26; + m26 = (v2 - p2); + double m31; + m31 = (q3 - p3); + double m32; + m32 = (r3 - p3); + double m33; + m33 = (s3 - p3); + double m34; + m34 = (t3 - p3); + double m35; + m35 = (u3 - p3); + double m36; + m36 = (v3 - p3); + double m41; + m41 = (q4 - p4); + double m42; + m42 = (r4 - p4); + double m43; + m43 = (s4 - p4); + double m44; + m44 = (t4 - p4); + double m45; + m45 = (u4 - p4); + double m46; + m46 = (v4 - p4); + double m51; + m51 = (q5 - p5); + double m52; + m52 = (r5 - p5); + double m53; + m53 = (s5 - p5); + double m54; + m54 = (t5 - p5); + double m55; + m55 = (u5 - p5); + double m56; + m56 = (v5 - p5); + double det; + det = determinant( m01, m02, m03, m04, m05, m06, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26, m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56 ); + int int_tmp_result; + double eps; + double max1 = CGAL::abs(m01); + double am = CGAL::abs(m02); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m11); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m12); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m21); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m22); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m31); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m32); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m41); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m42); + if( (max1 < am) ) { max1 = am; } + + + double max2 = CGAL::abs(m03); + am = CGAL::abs(m11); + + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m12); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m13); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m21); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m22); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m23); + + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m31); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m32); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m33); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m41); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m42); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m43); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m51); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m52); + if( (max2 < am) ) { max2 = am; } + + + double max3 = CGAL::abs(m04); + am = CGAL::abs(m14); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m24); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m34); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m44); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m54); + if( (max3 < am) ) { max3 = am; } + + double max4 = CGAL::abs(m05); + am = CGAL::abs(m15); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m25); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m35); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m45); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m55); + if( (max4 < am) ) { max4 = am; } + + + double max5 = CGAL::abs(m06); + am = CGAL::abs(m16); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m26); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m36); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m46); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m56); + if( (max5 < am) ) { max5 = am; } + + + double max6 = CGAL::abs(m13); + am = CGAL::abs(m21); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m22); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m23); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m31); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m32); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m33); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m41); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m42); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m43); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m51); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m52); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m53); + if( (max6 < am) ) { max6 = am; } + + + double lower_bound_1; + double upper_bound_1; + lower_bound_1 = max6; + upper_bound_1 = max6; + if( (max5 < lower_bound_1) ) + { + lower_bound_1 = max5; + } + else + { + if( (max5 > upper_bound_1) ) + { + upper_bound_1 = max5; + } + } + if( (max1 < lower_bound_1) ) + { + lower_bound_1 = max1; + } + else + { + if( (max1 > upper_bound_1) ) + { + upper_bound_1 = max1; + } + } + if( (max2 < lower_bound_1) ) + { + lower_bound_1 = max2; + } + else + { + if( (max2 > upper_bound_1) ) + { + upper_bound_1 = max2; + } + } + if( (max3 < lower_bound_1) ) + { + lower_bound_1 = max3; + } + else + { + if( (max3 > upper_bound_1) ) + { + upper_bound_1 = max3; + } + } + if( (max4 < lower_bound_1) ) + { + lower_bound_1 = max4; + } + else + { + if( (max4 > upper_bound_1) ) + { + upper_bound_1 = max4; + } + } + if( (lower_bound_1 < 4.82472686053427214432e-50) ) + { + return FPG_UNCERTAIN_VALUE; + } + else + { + if( (upper_bound_1 > 1.87072209578355511223e+50) ) + { + return FPG_UNCERTAIN_VALUE; + } + eps = (1.76403842114300859158e-12 * (((((max1 * max2) * max6) * max3) * max4) * max5)); + if( (det > eps) ) + { + int_tmp_result = 1; + } + else + { + if( (det < -eps) ) + { + int_tmp_result = -1; + } + else + { + return FPG_UNCERTAIN_VALUE; + } + } + } + return int_tmp_result; +} + +#endif diff --git a/NewKernel_d/test/NewKernel_d/Epick_d.cpp b/NewKernel_d/test/NewKernel_d/Epick_d.cpp index 7daa52459e5..a0344fb75bd 100644 --- a/NewKernel_d/test/NewKernel_d/Epick_d.cpp +++ b/NewKernel_d/test/NewKernel_d/Epick_d.cpp @@ -277,6 +277,7 @@ void test2(){ P x4=cp(0,0); P x5=cp(0,-1); P tab2[]={x1,x2,x3,x4}; + assert(x1==x1 && x1!=x2); assert(dp(x1,x2)[1]==2); assert(po(tab2+0,tab2+3)==CGAL::COUNTERCLOCKWISE); assert(sos(tab2+0,tab2+3,x4)==CGAL::ON_POSITIVE_SIDE); @@ -285,6 +286,7 @@ void test2(){ assert(y1.squared_length()==2); assert(sl(y1)==2); V y2=cv(3,-3); + assert(y1==y1 && y1!=y2); assert(spr(y1,y2)==6); assert(dv(y2,y1)[0]==2); V tab3[]={y1,y2}; diff --git a/Number_types/include/CGAL/FPU.h b/Number_types/include/CGAL/FPU.h index ede509604d4..048c5becee9 100644 --- a/Number_types/include/CGAL/FPU.h +++ b/Number_types/include/CGAL/FPU.h @@ -629,7 +629,9 @@ inline double IA_sqrt_toward_zero(double d) { } //namespace CGAL #ifdef CGAL_HEADER_ONLY +#ifndef CGAL_DISABLE_ROUNDING_MATH_CHECK #include +#endif #endif // CGAL_HEADER_ONLY #endif // CGAL_FPU_H diff --git a/Number_types/include/CGAL/test_FPU_rounding_mode_impl.h b/Number_types/include/CGAL/test_FPU_rounding_mode_impl.h index 0107cc32b1a..60efe1be2c6 100644 --- a/Number_types/include/CGAL/test_FPU_rounding_mode_impl.h +++ b/Number_types/include/CGAL/test_FPU_rounding_mode_impl.h @@ -51,11 +51,13 @@ get_static_check_fpu_rounding_mode_is_restored() return check_fpu_rounding_mode_is_restored; } +#ifndef CGAL_DISABLE_ROUNDING_MATH_CHECK namespace { CGAL_UNUSED const Check_FPU_rounding_mode_is_restored & check_fpu_rounding_mode_is_restored = get_static_check_fpu_rounding_mode_is_restored(); } +#endif #else diff --git a/Number_types/test/Number_types/Interval_nt_new.cpp b/Number_types/test/Number_types/Interval_nt_new.cpp index 0b4e7b06495..8bb553a4076 100644 --- a/Number_types/test/Number_types/Interval_nt_new.cpp +++ b/Number_types/test/Number_types/Interval_nt_new.cpp @@ -1,3 +1,4 @@ +#define CGAL_DISABLE_ROUNDING_MATH_CHECK 1 #include #include #include diff --git a/Periodic_3_triangulation_3/doc/Periodic_3_triangulation_3/CGAL/Periodic_3_triangulation_3.h b/Periodic_3_triangulation_3/doc/Periodic_3_triangulation_3/CGAL/Periodic_3_triangulation_3.h index 8a4de97b43a..daec23b7c5d 100644 --- a/Periodic_3_triangulation_3/doc/Periodic_3_triangulation_3/CGAL/Periodic_3_triangulation_3.h +++ b/Periodic_3_triangulation_3/doc/Periodic_3_triangulation_3/CGAL/Periodic_3_triangulation_3.h @@ -1312,7 +1312,7 @@ OutputIterator adjacent_vertices(Vertex_handle v, OutputIterator vertices) const; /*! -Returns the degree of a vertex, that is, the number of adjacent vertices. +Returns the degree of `v`, that is, the number of adjacent vertices. \pre `v` \f$ \neq\f$ `Vertex_handle()`, `t`.`is_vertex(v)`. */ size_type degree(Vertex_handle v) const; diff --git a/Point_set_processing_3/include/CGAL/IO/read_las_points.h b/Point_set_processing_3/include/CGAL/IO/read_las_points.h index c1dc8453fc9..258a580160c 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_las_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_las_points.h @@ -547,91 +547,6 @@ bool read_LAS(const std::string& fname, OutputIterator output, const CGAL_NP_CLA } // namespace IO -#ifndef CGAL_NO_DEPRECATED_CODE - -/// \cond SKIP_IN_MANUAL - -using IO::make_las_point_reader; -namespace LAS_property = IO::LAS_property; - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_las_points(), please update your code") -bool read_las_points(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3. -{ - return read_las_points(is, output, CGAL::parameters::point_map (point_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_las_points(), please update your code") -bool read_las_points(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3. -{ - return read_las_points::type>(is, output, - CGAL::parameters::point_map(point_map)); -} - -/// \endcond - - -template -CGAL_DEPRECATED bool read_las_points_with_properties(std::istream& is, - OutputIterator output, - PropertyHandler&& ... properties) -{ - return IO::read_LAS_with_properties(is, output, std::forward(properties)...); -} - -/// \cond SKIP_IN_MANUAL - -template -CGAL_DEPRECATED bool read_las_points_with_properties(std::istream& is, - OutputIterator output, - PropertyHandler&& ... properties) -{ - return IO::read_LAS_with_properties::type>(is, output, std::forward(properties)...); -} - -/// \endcond - -template -CGAL_DEPRECATED bool read_las_points(std::istream& is, - OutputIterator output, - const CGAL_NP_CLASS& np = parameters::default_values()) -{ - using parameters::choose_parameter; - using parameters::get_parameter; - - typename CGAL::GetPointMap, CGAL_NP_CLASS>::type point_map = - choose_parameter, CGAL_NP_CLASS>::type>(get_parameter(np, internal_np::point_map)); - - return IO::read_LAS(is, output, make_las_point_reader(point_map)); -} - -/// \cond SKIP_IN_MANUAL - - -// variant with default output iterator value type -template -CGAL_DEPRECATED bool read_las_points(std::istream& is, OutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::read_LAS::type>(is, output, np); -} - -/// \endcond - -#endif // CGAL_NO_DEPRECATED_CODE - } // namespace CGAL #endif // CGAL_POINT_SET_PROCESSING_READ_LAS_POINTS_H diff --git a/Point_set_processing_3/include/CGAL/IO/read_off_points.h b/Point_set_processing_3/include/CGAL/IO/read_off_points.h index e193661dffd..cd752f463c7 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_off_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_off_points.h @@ -271,174 +271,6 @@ bool read_OFF(const std::string& fname, OutputIterator output, const CGAL_NP_CLA } // namespace IO -#ifndef CGAL_NO_DEPRECATED_CODE - -/// \cond SKIP_IN_MANUAL - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points_and_normals(), please update your code") -bool read_off_points_and_normals(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - NormalPMap normal_map, ///< property map: value_type of OutputIterator -> Vector_3. - const Kernel& /*kernel*/) ///< geometric traits. -{ - return IO::read_OFF(is, output, - parameters::point_map(point_map) - .normal_map(normal_map) - .geom_traits(Kernel())); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points_and_normals(), please update your code") -bool read_off_points_and_normals(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - NormalPMap normal_map, ///< property map: value_type of OutputIterator -> Vector_3. - const Kernel& kernel) ///< geometric traits. -{ - return IO::read_OFF::type>(is, output, - parameters::point_map(point_map) - .normal_map(normal_map) - .geom_traits(kernel)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points_and_normals(), please update your code") -bool read_off_points_and_normals(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. -{ - return IO::read_OFF(is, output, parameters::point_map(point_map) - .normal_map(normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points_and_normals(), please update your code") -bool read_off_points_and_normals(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. -{ - return IO::read_OFF::type>(is, output, - parameters::point_map(point_map) - .normal_map(normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points_and_normals(), please update your code") -bool read_off_points_and_normals(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. -{ - return IO::read_OFF(is, output, parameters::normal_map(normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points_and_normals(), please update your code") -bool read_off_points_and_normals(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. -{ - return IO::read_OFF::type>(is, output, parameters::normal_map(normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points(), please update your code") -bool read_off_points(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - const Kernel& kernel) ///< geometric traits. -{ - return read_off_points(is, output, parameters::point_map(point_map) - .geom_traits(kernel)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points(), please update your code") -bool read_off_points(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - const Kernel& kernel) ///< geometric traits. -{ - return read_off_points::type>(is, output, - parameters::point_map(point_map) - .geom_traits (kernel)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points(), please update your code") -bool read_off_points(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointPMap point_map) ///< property map: value_type of OutputIterator -> Point_3. -{ - return read_off_points(is, output, parameters::point_map (point_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points(), please update your code") -bool read_off_points(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointPMap point_map) ///< property map: value_type of OutputIterator -> Point_3. -{ - return read_off_points::type>(is, output, parameters::point_map(point_map)); -} - -/// \endcond - -template -CGAL_DEPRECATED bool read_off_points(std::istream& is, - OutputIterator output, - const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::read_OFF(is, output, np); -} - -/// \cond SKIP_IN_MANUAL - -template -CGAL_DEPRECATED bool read_off_points(std::istream& is, OutputIterator output) -{ - return IO::read_OFF(is, output); -} - -// variant with default output iterator value type -template -CGAL_DEPRECATED bool read_off_points(std::istream& is, OutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::read_OFF(is, output, np); -} - -/// \endcond - -#endif //CGAL_NO_DEPRECATED_CODE - } // namespace CGAL #endif // CGAL_POINT_SET_PROCESSING_READ_OFF_POINTS_H diff --git a/Point_set_processing_3/include/CGAL/IO/read_ply_points.h b/Point_set_processing_3/include/CGAL/IO/read_ply_points.h index f49e6ba1f2c..69775af74d0 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_ply_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_ply_points.h @@ -358,114 +358,6 @@ bool read_PLY(const std::string& fname, OutputIterator output, const CGAL_NP_CLA } // namespace IO -#ifndef CGAL_NO_DEPRECATED_CODE - -/// \cond SKIP_IN_MANUAL - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_ply_points_and_normals(), please update your code") -bool read_ply_points_and_normals(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - NormalMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. -{ - return IO::read_PLY(is, output, parameters::point_map(point_map) - .normal_map(normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_ply_points_and_normals(), please update your code") -bool read_ply_points_and_normals(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - NormalMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. -{ - return IO::read_PLY::type>(is, output, parameters::point_map(point_map) - .normal_map(normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_ply_points_and_normals(), please update your code") -bool read_ply_points_and_normals(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - NormalMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. -{ - return IO::read_PLY(is, output, parameters::normal_map(normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_ply_points_and_normals(), please update your code") -bool read_ply_points_and_normals(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - NormalMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. -{ - return IO::read_PLY::type>(is, output, parameters::normal_map(normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_ply_points(), please update your code") -bool read_ply_points(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3. -{ - return IO::read_PLY(is, output, parameters::point_map(point_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_ply_points(), please update your code") -bool read_ply_points(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3. -{ - return IO::read_PLY::type>(is, output, parameters::point_map(point_map)); -} - -/// \endcond - -template -CGAL_DEPRECATED bool read_ply_points_with_properties(std::istream& is, OutputIterator output, PropertyHandler&& ... properties) -{ - return IO::read_PLY_with_properties(is, output, std::forward(properties)...); -} - - -template -CGAL_DEPRECATED bool read_ply_points(std::istream& is, OutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::read_PLY(is, output, np); -} - -/// \cond SKIP_IN_MANUAL - -template -CGAL_DEPRECATED bool read_ply_points_with_properties(std::istream& is, OutputIterator output, PropertyHandler&& ... properties) -{ - return IO::read_PLY_with_properties::type>(is, output, std::forward(properties)...); -} - -// variant with default output iterator value type -template -CGAL_DEPRECATED bool read_ply_points(std::istream& is, OutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::read_PLY::type>(is, output, np); -} - -/// \endcond - -#endif // CGAL_NO_DEPRECATED_CODE - } // namespace CGAL #undef TRY_TO_GENERATE_POINT_PROPERTY diff --git a/Point_set_processing_3/include/CGAL/IO/read_xyz_points.h b/Point_set_processing_3/include/CGAL/IO/read_xyz_points.h index 5dd9fa8678f..ddf772be51b 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_xyz_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_xyz_points.h @@ -251,173 +251,6 @@ bool read_XYZ(const std::string& fname, OutputIterator output, const CGAL_NP_CLA -#ifndef CGAL_NO_DEPRECATED_CODE - -/// \cond SKIP_IN_MANUAL - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points_and_normals(), please update your code") -bool read_xyz_points_and_normals(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - NormalPMap normal_map, ///< property map: value_type of OutputIterator -> Vector_3. - const Kernel& /*kernel*/) ///< geometric traits. -{ - return IO::read_XYZ(is, output, - parameters::point_map(point_map) - .normal_map(normal_map) - .geom_traits(Kernel())); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points_and_normals(), please update your code") -bool read_xyz_points_and_normals(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - NormalPMap normal_map, ///< property map: value_type of OutputIterator -> Vector_3. - const Kernel& kernel) ///< geometric traits. -{ - return IO::read_XYZ::type>(is, output, - parameters::point_map(point_map) - .normal_map(normal_map) - .geom_traits(kernel)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points_and_normals(), please update your code") -bool read_xyz_points_and_normals(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. -{ - return IO::read_XYZ(is, output, - parameters::point_map(point_map) - .normal_map(normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points_and_normals(), please update your code") -bool read_xyz_points_and_normals(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. -{ - return IO::read_XYZ::type>(is, output, - parameters::point_map(point_map) - .normal_map(normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points_and_normals(), please update your code") -bool read_xyz_points_and_normals(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. -{ - return IO::read_XYZ(is, output, parameters::normal_map(normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points_and_normals(), please update your code") -bool read_xyz_points_and_normals(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. -{ - return IO::read_XYZ::type>(is, output, - parameters::normal_map(normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points(), please update your code") -bool read_xyz_points(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - const Kernel& kernel) ///< geometric traits. -{ - return IO::read_XYZ(is, output, - parameters::point_map(point_map) - .geom_traits(kernel)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points(), please update your code") -bool read_xyz_points(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - const Kernel& kernel) ///< geometric traits. -{ - return IO::read_XYZ::type>(is, output, - parameters::point_map(point_map) - .geom_traits(kernel)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points(), please update your code") -bool read_xyz_points(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointPMap point_map) ///< property map: value_type of OutputIterator -> Point_3. -{ - return IO::read_XYZ(is, output, parameters::point_map(point_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points(), please update your code") -bool read_xyz_points(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointPMap point_map) ///< property map: value_type of OutputIterator -> Point_3. -{ - return IO::read_XYZ::type>(is, output, - parameters::point_map(point_map)); -} - -/// \endcond - - -template -CGAL_DEPRECATED bool read_xyz_points(std::istream& is, - OutputIterator output, - const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::read_XYZ(is, output, np); -} - -/// \cond SKIP_IN_MANUAL -template -CGAL_DEPRECATED bool read_xyz_points(std::istream& is, - OutputIterator output, - const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::read_XYZ::type>(is, output, np); -} -/// \endcond - -#endif //CGAL_NO_DEPRECATED_CODE - } // namespace CGAL #endif // CGAL_POINT_SET_PROCESSING_READ_XYZ_POINTS_H diff --git a/Point_set_processing_3/include/CGAL/IO/write_las_points.h b/Point_set_processing_3/include/CGAL/IO/write_las_points.h index f3a96c919fd..94ff12182ff 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_las_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_las_points.h @@ -379,59 +379,6 @@ bool write_LAS(const std::string& filename, } // namespace IO -#ifndef CGAL_NO_DEPRECATED_CODE - -using IO::make_las_point_writer; - -/// \cond SKIP_IN_MANUAL - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_las_points(), please update your code") -bool write_las_points(std::ostream& os, ///< output stream. - ForwardIterator first, ///< first input point. - ForwardIterator beyond, ///< past-the-end input point. - PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3. -{ - CGAL::Iterator_range points (first, beyond); - return IO::write_LAS(os, points, parameters::point_map(point_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_las_points(), please update your code") -bool write_las_points(std::ostream& os, ///< output stream. - ForwardIterator first, ///< first input point. - ForwardIterator beyond) ///< past-the-end input point. -{ - CGAL::Iterator_range points (first, beyond); - return IO::write_LAS(os, points); -} - -/// \endcond - -template -CGAL_DEPRECATED bool write_las_points_with_properties(std::ostream& os, - const PointRange& points, - std::tuple point_property, - PropertyHandler&& ... properties) -{ - return IO::write_LAS_with_properties(os, points, point_property, std::forward(properties)...); -} - - -template -bool write_las_points(std::ostream& os, const PointRange& points, const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::write_LAS(os, points, np); -} - -#endif //CGAL_NO_DEPRECATED_CODE - } // namespace CGAL #endif // CGAL_POINT_SET_PROCESSING_WRITE_LAS_POINTS_H diff --git a/Point_set_processing_3/include/CGAL/IO/write_off_points.h b/Point_set_processing_3/include/CGAL/IO/write_off_points.h index e99a2c90bce..0ef9d0bbcc7 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_off_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_off_points.h @@ -198,107 +198,6 @@ bool write_OFF(const std::string& filename, } // IO namespace -#ifndef CGAL_NO_DEPRECATED_CODE - -/// \cond SKIP_IN_MANUAL - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_off_points_and_normals(), please update your code") -bool write_off_points_and_normals(std::ostream& os, ///< output stream. - ForwardIterator first, ///< iterator over the first input point. - ForwardIterator beyond, ///< past-the-end iterator over the input points. - PointMap point_map, ///< property map: value_type of ForwardIterator -> Point_3. - NormalMap normal_map, ///< property map: value_type of ForwardIterator -> Vector_3. - const Kernel& /*kernel*/) ///< geometric traits. -{ - CGAL::Iterator_range points(first, beyond); - return write_off_points(os, points, - CGAL::parameters::point_map(point_map) - .normal_map(normal_map) - .geom_traits(Kernel())); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_off_points_and_normals(), please update your code") -bool write_off_points_and_normals(std::ostream& os, ///< output stream. - ForwardIterator first, ///< first input point. - ForwardIterator beyond, ///< past-the-end input point. - PointMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - NormalMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. -{ - CGAL::Iterator_range points(first, beyond); - return write_off_points(os, points, - parameters::point_map(point_map) - .normal_map(normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_off_points_and_normals(), please update your code") -bool write_off_points_and_normals(std::ostream& os, ///< output stream. - ForwardIterator first, ///< first input point. - ForwardIterator beyond, ///< past-the-end input point. - NormalMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. -{ - CGAL::Iterator_range points(first, beyond); - return write_off_points(os, points, parameters::normal_map (normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_off_points(), please update your code") -bool write_off_points(std::ostream& os, ///< output stream. - ForwardIterator first, ///< iterator over the first input point. - ForwardIterator beyond, ///< past-the-end iterator over the input points. - PointMap point_map, ///< property map: value_type of ForwardIterator -> Point_3. - const Kernel&) ///< geometric traits. -{ - CGAL::Iterator_range points(first, beyond); - return write_off_points(os, points, - parameters::point_map(point_map) - .geom_traits(Kernel())); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_off_points(), please update your code") -bool write_off_points(std::ostream& os, ///< output stream. - ForwardIterator first, ///< first input point. - ForwardIterator beyond, ///< past-the-end input point. - PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3. -{ - CGAL::Iterator_range points(first, beyond); - return write_off_points(os, points, parameters::point_map (point_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_off_points(), please update your code") -bool write_off_points(std::ostream& os, ///< output stream. - ForwardIterator first, ///< first input point. - ForwardIterator beyond) ///< past-the-end input point. -{ - CGAL::Iterator_range points(first, beyond); - return write_off_points(os, points); -} - -/// \endcond - -template -CGAL_DEPRECATED bool write_off_points(std::ostream& os, const PointRange& points, const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::write_OFF(os, points, np); -} - -#endif // CGAL_NO_DEPRECATED_CODE - } // namespace CGAL #endif // CGAL_POINT_SET_PROCESSING_WRITE_OFF_POINTS_H diff --git a/Point_set_processing_3/include/CGAL/IO/write_ply_points.h b/Point_set_processing_3/include/CGAL/IO/write_ply_points.h index 0ddbb70d613..bdc9c8077e0 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_ply_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_ply_points.h @@ -298,80 +298,6 @@ bool write_PLY(const std::string& filename, } // namespace IO -#ifndef CGAL_NO_DEPRECATED_CODE - -/// \cond SKIP_IN_MANUAL - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_ply_points_and_normals(), please update your code") -bool write_ply_points_and_normals(std::ostream& os, ///< output stream. - ForwardIterator first, ///< first input point. - ForwardIterator beyond, ///< past-the-end input point. - PointMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - VectorMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. -{ - CGAL::Iterator_range points (first, beyond); - return IO::write_PLY(os, points, parameters::point_map(point_map) - .normal_map(normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_ply_points_and_normals(), please update your code") -bool write_ply_points_and_normals(std::ostream& os, ///< output stream. - ForwardIterator first, ///< first input point. - ForwardIterator beyond, ///< past-the-end input point. - VectorMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. -{ - CGAL::Iterator_range points(first, beyond); - return IO::write_PLY(os, points, parameters::normal_map (normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_ply_points(), please update your code") -bool write_ply_points(std::ostream& os, ///< output stream. - ForwardIterator first, ///< first input point. - ForwardIterator beyond, ///< past-the-end input point. - PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3. -{ - CGAL::Iterator_range points(first, beyond); - return IO::write_PLY(os, points, parameters::point_map(point_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_ply_points(), please update your code") -bool write_ply_points(std::ostream& os, ///< output stream. - ForwardIterator first, ///< first input point. - ForwardIterator beyond) ///< past-the-end input point. -{ - CGAL::Iterator_range points (first, beyond); - return IO::write_PLY(os, points); -} - -/// \endcond - - -template -CGAL_DEPRECATED bool write_ply_points_with_properties(std::ostream& os, ///< output stream. - const PointRange& points, ///< input point range. - PropertyHandler&& ... properties) ///< parameter pack of property handlers -{ - return IO::write_PLY_with_properties(os, points, std::forward(properties)...); -} - - -template -CGAL_DEPRECATED bool write_ply_points(std::ostream& os, const PointRange& points, const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::write_PLY(os, points, np); -} - -#endif // CGAL_NO_DEPRECATED_CODE - } // namespace CGAL #endif // CGAL_POINT_SET_PROCESSING_WRITE_PLY_POINTS_H diff --git a/Point_set_processing_3/include/CGAL/IO/write_xyz_points.h b/Point_set_processing_3/include/CGAL/IO/write_xyz_points.h index 036e060367b..da1c2a402ed 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_xyz_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_xyz_points.h @@ -189,106 +189,6 @@ bool write_XYZ(const std::string& filename, } // namespace IO -#ifndef CGAL_NO_DEPRECATED_CODE - -/// \cond SKIP_IN_MANUAL - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_xyz_points_and_normals(), please update your code") -bool write_xyz_points_and_normals(std::ostream& os, ///< output stream. - ForwardIterator first, ///< iterator over the first input point. - ForwardIterator beyond, ///< past-the-end iterator over the input points. - PointMap point_map, ///< property map: value_type of ForwardIterator -> Point_3. - NormalMap normal_map, ///< property map: value_type of ForwardIterator -> Vector_3. - const Kernel& /*kernel*/) ///< geometric traits. -{ - CGAL::Iterator_range points(first, beyond); - return IO::write_XYZ(os, points, - parameters::point_map(point_map) - .normal_map(normal_map) - .geom_traits(Kernel())); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_xyz_points_and_normals(), please update your code") -bool write_xyz_points_and_normals(std::ostream& os, ///< output stream. - ForwardIterator first, ///< first input point. - ForwardIterator beyond, ///< past-the-end input point. - PointMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - NormalMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. -{ - CGAL::Iterator_range points (first, beyond); - return IO::write_XYZ(os, points, - parameters::point_map(point_map) - .normal_map(normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_xyz_points_and_normals(), please update your code") -bool write_xyz_points_and_normals(std::ostream& os, ///< output stream. - ForwardIterator first, ///< first input point. - ForwardIterator beyond, ///< past-the-end input point. - NormalMap normal_map) ///< property map: value_type of ForwardIterator -> Vector_3. -{ - CGAL::Iterator_range points(first, beyond); - return IO::write_XYZ(os, points, parameters::normal_map(normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_xyz_points(), please update your code") -bool write_xyz_points(std::ostream& os, ///< output stream. - ForwardIterator first, ///< first input point. - ForwardIterator beyond, ///< past-the-end input point. - PointMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - const Kernel& kernel) -{ - CGAL::Iterator_range points (first, beyond); - return IO::write_XYZ(os, points, parameters::point_map(point_map) - .geom_traits (kernel)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_xyz_points(), please update your code") -bool write_xyz_points(std::ostream& os, ///< output stream. - ForwardIterator first, ///< first input point. - ForwardIterator beyond, ///< past-the-end input point. - PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3. -{ - CGAL::Iterator_range points(first, beyond); - return IO::write_XYZ(os, points, parameters::point_map(point_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_xyz_points(), please update your code") -bool write_xyz_points(std::ostream& os, ///< output stream. - ForwardIterator first, ///< first input point. - ForwardIterator beyond) ///< past-the-end input point. -{ - CGAL::Iterator_range points (first, beyond); - return IO::write_XYZ(os, points); -} - -/// \endcond - - -template -CGAL_DEPRECATED bool write_xyz_points(std::ostream& os, const PointRange& points, const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::write_XYZ(os, points, np); -} - -#endif // CGAL_NO_DEPRECATED_CODE - } // namespace CGAL #endif // CGAL_POINT_SET_PROCESSING_WRITE_XYZ_POINTS_H diff --git a/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt b/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt index a1582cc1f7e..f05160e32fc 100644 --- a/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt +++ b/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt @@ -22,7 +22,6 @@ endif() # Executables that do *not* require Eigen create_single_source_cgal_program( "read_test.cpp" ) create_single_source_cgal_program( "test_read_write_point_set.cpp" ) -create_single_source_cgal_program( "test_deprecated_io_point_set.cpp" ) create_single_source_cgal_program( "test_poisson_eliminate.cpp" ) create_single_source_cgal_program( "read_test_with_different_pmaps.cpp" ) create_single_source_cgal_program( "analysis_test.cpp" ) @@ -39,7 +38,6 @@ if(NOT MSVC_VERSION OR MSVC_VERSION GREATER_EQUAL 1919 OR MSVC_VERSION LESS 1910 include(CGAL_LASLIB_support) if (TARGET CGAL::LASLIB_support) target_link_libraries(test_read_write_point_set PRIVATE ${CGAL_libs} CGAL::LASLIB_support) - target_link_libraries(test_deprecated_io_point_set PRIVATE ${CGAL_libs} CGAL::LASLIB_support) else() message(STATUS "NOTICE: the LAS reader test requires LASlib and will not be compiled.") endif() diff --git a/Point_set_processing_3/test/Point_set_processing_3/test_deprecated_io_point_set.cpp b/Point_set_processing_3/test/Point_set_processing_3/test_deprecated_io_point_set.cpp deleted file mode 100644 index 35c6e5b0e6f..00000000000 --- a/Point_set_processing_3/test/Point_set_processing_3/test_deprecated_io_point_set.cpp +++ /dev/null @@ -1,241 +0,0 @@ -#include - -#include - -#include -#include -#include - -// Just to try and create ambiguities -#include -#include - -#include - -#include -#include -#include -#include - -typedef CGAL::Simple_cartesian Kernel; -typedef Kernel::Point_3 Point_3; -typedef Kernel::Vector_3 Vector_3; -typedef std::array Color; -typedef std::pair PointWithColor; -typedef CGAL::Nth_of_tuple_property_map<1, PointWithColor> Color_map; - -struct GetRedMap -{ - typedef PointWithColor key_type; - typedef unsigned short value_type; - typedef const value_type& reference; - typedef boost::lvalue_property_map_tag category; -}; -unsigned short get(const GetRedMap&, const PointWithColor& p) -{ - return p.second[0]; -} - -struct GetGreenMap -{ - typedef PointWithColor key_type; - typedef unsigned short value_type; - typedef const value_type& reference; - typedef boost::lvalue_property_map_tag category; -}; -unsigned short get(const GetGreenMap&, const PointWithColor& p) -{ - return p.second[1]; -} - -struct GetBlueMap -{ - typedef PointWithColor key_type; - typedef unsigned short value_type; - typedef const value_type& reference; - typedef boost::lvalue_property_map_tag category; -}; -unsigned short get(const GetBlueMap&, const PointWithColor& p) -{ - return p.second[2]; -} - -struct GetAlphaMap -{ - typedef PointWithColor key_type; - typedef unsigned short value_type; - typedef const value_type& reference; - typedef boost::lvalue_property_map_tag category; -}; - -unsigned short get(const GetAlphaMap&, const PointWithColor& p) -{ - return p.second[3]; -} - -int main() -{ - std::vector points(3); - points[0] = std::make_pair(Point_3(1,0,0), Color{255,0,0,255}); - points[1] = std::make_pair(Point_3(0,1,0), Color{0,255,0,255}); - points[2] = std::make_pair(Point_3(0,0,1), Color{0,0,255,255}); - - bool ok; - std::vector ps; - ps.push_back(Point_3(1,0,0)); - ps.push_back(Point_3(0,1,0)); - ps.push_back(Point_3(0,0,1)); - - std::string input; - - //LAS -#ifdef CGAL_LINKED_WITH_LASLIB - - { - std::ostringstream os(std::ios::binary); - ok = CGAL::write_las_points_with_properties(os, points, - CGAL::make_las_point_writer(CGAL::First_of_pair_property_map()), - std::make_pair(GetRedMap(),CGAL::LAS_property::R()), - std::make_pair(GetGreenMap(), CGAL::LAS_property::G()), - std::make_pair(GetBlueMap(), CGAL::LAS_property::B()), - std::make_pair(GetAlphaMap(), CGAL::LAS_property::I()) - ); - assert(ok); - os.flush(); - input = os.str(); - - } - - { - points.clear(); - std::istringstream is(input, std::ios::binary); - ok = CGAL::read_las_points_with_properties(is, std::back_inserter (points), - CGAL::make_las_point_reader(CGAL::First_of_pair_property_map()), - std::make_tuple(CGAL::Second_of_pair_property_map(), - CGAL::Construct_array(), - CGAL::LAS_property::R(), - CGAL::LAS_property::G(), - CGAL::LAS_property::B(), - CGAL::LAS_property::I())); - assert(ok); - assert(points.size() == 3); - assert(points[1].second[1] == 255); - } - - { - std::ostringstream os(std::ios_base::binary); - CGAL::write_las_points(os, ps); - assert(ok); - os.flush(); - input = os.str(); - } - - { - ps.clear(); - std::istringstream is(input, std::ios::binary); - ok = CGAL::read_las_points(is, std::back_inserter (ps)); - assert(ok); - assert(ps.size() == 3); - } -#endif - - //PLY - { - std::ostringstream os; - assert(os.good()); - ok = CGAL::write_ply_points_with_properties(os, points, - CGAL::make_ply_point_writer (CGAL::First_of_pair_property_map()), - std::make_pair(GetRedMap(),CGAL::PLY_property("red")), - std::make_pair(GetGreenMap(), CGAL::PLY_property("green")), - std::make_pair(GetBlueMap(), CGAL::PLY_property("blue")), - std::make_pair(GetAlphaMap(), CGAL::PLY_property("alpha")) - ); - assert(! os.fail()); - assert(ok); - os.flush(); - input = os.str(); - } - - { - std::istringstream is(input); - assert(is.good()); - points.clear(); - ok = CGAL::read_ply_points_with_properties(is, std::back_inserter (points), - CGAL::make_ply_point_reader(CGAL::First_of_pair_property_map()), - std::make_tuple(CGAL::Second_of_pair_property_map(), - CGAL::Construct_array(), - CGAL::PLY_property("red"), - CGAL::PLY_property("green"), - CGAL::PLY_property("blue"), - CGAL::PLY_property("alpha"))); - assert(! is.fail()); - assert(ok); - assert(points.size() == 3); - assert(points[1].second[1] == 255); - } - - { - std::ostringstream os; - assert(os.good()); - ok = CGAL::write_ply_points(os, ps); - assert(! os.fail()); - assert(ok); - os.flush(); - input = os.str(); - } - - { - std::istringstream is(input); - assert(is.good()); - ps.clear(); - ok = CGAL::read_ply_points(is, std::back_inserter (ps)); - assert(! is.fail()); - assert(ok); - assert(ps.size() == 3); - } - - //OFF - { - std::ostringstream os; - assert(os.good()); - ok = CGAL::write_off_points(os, ps); - assert(! os.fail()); - assert(ok); - os.flush(); - input = os.str(); - } - - { - std::istringstream is(input); - assert(is.good()); - ps.clear(); - ok = CGAL::read_off_points(is, std::back_inserter (ps)); - assert(! is.fail()); - assert(ok); - assert(ps.size() == 3); - } - - //XYZ - { - std::ostringstream os; - assert(os.good()); - ok = CGAL::write_xyz_points(os, ps); - assert(! os.fail()); - assert(ok); - os.flush(); - input = os.str(); - } - - { - std::istringstream is(input); - assert(is.good()); - ps.clear(); - ok = CGAL::read_xyz_points(is, std::back_inserter (ps)); - assert(! is.fail()); - assert(ok); - assert(ps.size() == 3); - } - - std::cout << "Done" << std::endl; - return EXIT_SUCCESS; -} diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h index 36c5d029fce..79e449530ee 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h @@ -45,10 +45,227 @@ #include +#ifndef CGAL_PLANE_CLIP_DO_NOT_USE_TRIANGULATION +#include +#include +#include +#include +#include +#include +#include +#endif + namespace CGAL { namespace Polygon_mesh_processing { namespace internal { +#ifndef CGAL_PLANE_CLIP_DO_NOT_USE_TRIANGULATION +template +void close_and_triangulate(TriangleMesh& tm, VertexPointMap vpm, typename Traits::Vector_3 plane_normal, Visitor& visitor) +{ + using vertex_descriptor = typename boost::graph_traits::vertex_descriptor; + using halfedge_descriptor = typename boost::graph_traits::halfedge_descriptor; + using face_descriptor = typename boost::graph_traits::face_descriptor; + using P_traits = Projection_traits_3; + using Vb = Triangulation_vertex_base_with_info_2; + using Fb = CGAL::Delaunay_mesh_face_base_2; + using TDS = Triangulation_data_structure_2; + using Itag = No_constraint_intersection_tag; + using CDT = Constrained_Delaunay_triangulation_2; + + P_traits p_traits(plane_normal); + + std::vector> points; + std::vector> csts; + + halfedge_descriptor href = boost::graph_traits::null_halfedge (); + bool first=true; + + for (halfedge_descriptor h : halfedges(tm)) + { + if (is_border(h, tm)) + { + if (first) + { + href=h; + first=false; + } + vertex_descriptor src = source(h, tm), tgt = target(h, tm); + points.emplace_back(get(vpm, tgt), tgt); + csts.emplace_back(src, tgt); + } + } + + if (points.empty()) return; + + CDT cdt(p_traits); + cdt.insert(points.begin(), points.end()); + + // TODO: in case of degenerate edges, we don't triangulate but it's kind of an issue on our side + if (cdt.number_of_vertices()!=points.size()) return; + + + typedef CGAL::dynamic_vertex_property_t V_tag; + typename boost::property_map::type v2v = get(V_tag(), tm); + for (auto vh : cdt.finite_vertex_handles()) + put(v2v, vh->info(), vh); + + for (auto vv : csts) + cdt.insert_constraint(get(v2v, vv.first), get(v2v, vv.second)); + + mark_domain_in_triangulation(cdt); + + typename CDT::Edge edge_ref; + CGAL_assertion_code(bool OK =) + cdt.is_edge(get(v2v, csts[0].first), get(v2v, csts[0].second), edge_ref.first, edge_ref.second); + CGAL_assertion(OK); + + if (!edge_ref.first->is_in_domain()) edge_ref = cdt.mirror_edge(edge_ref); + CGAL_assertion(edge_ref.first->is_in_domain()); + + bool flip_ori = ( edge_ref.first->vertex( (edge_ref.second+1)%3 )->info() != source(href, tm) ); + + CGAL_assertion( + ( !flip_ori && + edge_ref.first->vertex( (edge_ref.second+1)%3 )->info() == source(href, tm) && + edge_ref.first->vertex( (edge_ref.second+2)%3 )->info() == target(href, tm) ) + || + ( flip_ori && + edge_ref.first->vertex( (edge_ref.second+2)%3 )->info() == source(href, tm) && + edge_ref.first->vertex( (edge_ref.second+1)%3 )->info() == target(href, tm) ) + ); + + for (auto fh : cdt.finite_face_handles()) + { + if (!fh->is_in_domain()) continue; + + std::array vrts = make_array(fh->vertex(0)->info(), + fh->vertex(1)->info(), + fh->vertex(2)->info()); + if (flip_ori) std::swap(vrts[0], vrts[1]); + + CGAL_assertion(Euler::can_add_face(vrts, tm)); + visitor.before_face_copy(boost::graph_traits::null_face(), tm, tm); + face_descriptor f = Euler::add_face(vrts, tm); + visitor.after_face_copy(boost::graph_traits::null_face(), tm, f, tm); + } +} + +template +bool close(PolygonMesh& pm, VertexPointMap vpm, typename Traits::Vector_3 plane_normal, Visitor& visitor) +{ + //using vertex_descriptor = typename boost::graph_traits::vertex_descriptor; + using halfedge_descriptor = typename boost::graph_traits::halfedge_descriptor; + // using face_descriptor = typename boost::graph_traits::face_descriptor; + using Point_3 = typename Traits::Point_3; + using P_traits = Projection_traits_3; + + std::vector< std::vector > polygons; + std::vector< halfedge_descriptor > border_cycles; + std::vector< Bbox_3 > bboxes; + + typedef CGAL::dynamic_halfedge_property_t H_tag; + typename boost::property_map::type + is_hedge_selected = get(H_tag(), pm, false); + + for (halfedge_descriptor h : halfedges(pm)) + { + if (is_border(h, pm) && get(is_hedge_selected, h)==false) + { + border_cycles.push_back(h); + polygons.emplace_back(); + bboxes.emplace_back(); + for (halfedge_descriptor he : CGAL::halfedges_around_face(h, pm)) + { + put(is_hedge_selected, he, true); + polygons.back().push_back(get(vpm, target(he, pm))); + bboxes.back()+=polygons.back().back().bbox(); + } + } + } + + if (bboxes.empty()) return true; + + Bbox_3 gbox; + for (const Bbox_3& bb : bboxes) + gbox+=bb; + + // arrange polygons + int axis = 0; + if ((gbox.ymax()-gbox.ymin()) > (gbox.xmax()-gbox.xmin())) axis=1; + if ((gbox.zmax()-gbox.zmin()) > ((gbox.max)(axis)-(gbox.min)(axis))) axis=2; + + std::vector poly_ids(polygons.size()); + std::iota(poly_ids.begin(), poly_ids.end(), 0); + + std::sort(poly_ids.begin(), poly_ids.end(), + [&bboxes, axis](std::size_t i, std::size_t j) + { + return (bboxes[i].min)(axis) < (bboxes[j].min)(axis); + }); + + + std::vector simply_connected_faces; + std::vector handled(poly_ids.size(), false); + + P_traits ptraits(plane_normal); + + + for (std::size_t pid=0; pid nested; + for (std::size_t npid=pid+1; npid::null_face(), pm, pm); + Euler::fill_hole(h, pm); + visitor.after_face_copy(boost::graph_traits::null_face(), pm, face(h, pm), pm); + } + + return simply_connected_faces.size()==poly_ids.size(); +} + +#endif + + template @@ -791,7 +1008,7 @@ bool clip(PolygonMesh& pm, Default_visitor default_visitor; using Visitor_ref = typename internal_np::Lookup_named_param_def::reference; Visitor_ref visitor = choose_parameter(get_parameter_reference(np, internal_np::visitor), default_visitor); - constexpr bool has_visitor = !std::is_same_v>>; + // constexpr bool has_visitor = !std::is_same_v>>; typedef typename internal_np::Lookup_named_param_def < internal_np::concurrency_tag_t, @@ -834,6 +1051,8 @@ bool clip(PolygonMesh& pm, if (clip_volume && !is_closed(pm)) clip_volume=false; if (clip_volume && !use_compact_clipper) use_compact_clipper=true; + CGAL_precondition(!clip_volume || !triangulate || does_bound_a_volume(pm)); + auto fcc = get(dynamic_face_property_t(), pm); std::size_t nbcc = connected_components(pm, fcc, CGAL::parameters::edge_is_constrained_map(ecm)); @@ -865,35 +1084,12 @@ bool clip(PolygonMesh& pm, if (clip_volume) { - std::vector borders; - extract_boundary_cycles(pm, std::back_inserter(borders)); - - for (halfedge_descriptor h : borders) - { -#ifndef CGAL_PLANE_CLIP_DO_NOT_USE_TRIANGULATION - if (triangulate) - { - Euler::fill_hole(h, pm); // visitor call done in the triangulation visitor - if constexpr (!has_visitor) - { - triangulate_face(face(h,pm), pm, parameters::vertex_point_map(vpm).geom_traits(traits)); - } - else - { - using Base_visitor = std::remove_cv_t>; - internal::Visitor_wrapper_for_triangulate_face visitor_wrapper(pm, visitor); - triangulate_face(face(h,pm), pm, parameters::vertex_point_map(vpm).geom_traits(traits).visitor(visitor_wrapper)); - } - } - else -#endif - { - visitor.before_face_copy(boost::graph_traits::null_face(), pm, pm); - Euler::fill_hole(h, pm); - visitor.after_face_copy(boost::graph_traits::null_face(), pm, face(h, pm), pm); - } - - } + //TODO: add in the traits construct_orthogonal_vector + if (triangulate) + internal::close_and_triangulate(pm, vpm, plane.orthogonal_vector(), visitor); + else + if (!internal::close(pm, vpm, plane.orthogonal_vector(), visitor)) + internal::close_and_triangulate(pm, vpm, plane.orthogonal_vector(), visitor); } return true; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h index dd77b2e9843..7492c34eeef 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h @@ -278,6 +278,7 @@ template bool does_enclose_other_normals(const std::size_t i, const std::size_t j, const std::size_t k, const typename K::Vector_3& nb, const typename K::FT sp_bi, + typename boost::graph_traits::face_descriptor ¬_enclose_normal, const std::vector::face_descriptor>& incident_faces, const FaceNormalVector& face_normals, const K& traits) @@ -291,6 +292,7 @@ bool does_enclose_other_normals(const std::size_t i, const std::size_t j, const // check that this min circle defined by the diameter contains the other points const std::size_t nif = incident_faces.size(); + bool enclose_other_normals=true; for(std::size_t l=0; l @@ -385,156 +394,160 @@ typename GT::Vector_3 compute_normals_bisector(const typename GT::Vector_3& ni, return nb; } -template -typename GT::Vector_3 -compute_most_visible_normal_2_points(std::vector::face_descriptor>& incident_faces, - const FaceNormalVector& face_normals, - const GT& traits) -{ - typedef typename GT::FT FT; - typedef typename GT::Vector_3 Vector_3; - typedef typename boost::property_traits::reference Vector_ref; - - typename GT::Compute_scalar_product_3 sp_3 = traits.compute_scalar_product_3_object(); - typename GT::Construct_vector_3 cv_3 = traits.construct_vector_3_object(); - -#ifdef CGAL_PMP_COMPUTE_NORMAL_DEBUG_PP - std::cout << "Trying to find enclosing normal with 2 normals" << std::endl; -#endif - - FT min_sp = -1; - Vector_3 n = cv_3(CGAL::NULL_VECTOR); - - const std::size_t nif = incident_faces.size(); - for(std::size_t i=0; i(i, j, -1 /*NA*/, nb, sp_bi, incident_faces, face_normals, traits)) - continue; - - min_sp = sp_bi; - n = nb; - } - } - - return n; -} - -template -typename GT::Vector_3 -compute_most_visible_normal_3_points(const std::vector::face_descriptor>& incident_faces, - const FaceNormalVector& face_normals, - const GT& traits) -{ - typedef typename GT::FT FT; - typedef typename GT::Vector_3 Vector_3; - typedef typename boost::property_traits::reference Vector_ref; - -#ifdef CGAL_PMP_COMPUTE_NORMAL_DEBUG_PP - std::cout << "Trying to find enclosing normal with 3 normals" << std::endl; -#endif - - FT min_sp = -1; - - Vector_3 n = traits.construct_vector_3_object()(CGAL::NULL_VECTOR); - - const std::size_t nif = incident_faces.size(); - for(std::size_t i=0; i(i, j, k, nb, sp_bi, incident_faces, face_normals, traits)) - continue; - - min_sp = sp_bi; - n = nb; - } - } - } - -#ifdef CGAL_PMP_COMPUTE_NORMAL_DEBUG_PP - std::cout << "Best normal from 3-normals-approach: " << n << std::endl; -#endif - - return n; -} - // Inspired by Aubry et al. On the most 'normal' normal template typename GT::Vector_3 compute_vertex_normal_most_visible_min_circle(typename boost::graph_traits::vertex_descriptor v, const FaceNormalVector& face_normals, const PolygonMesh& pmesh, - const GT& traits) -{ + const GT& traits){ typedef typename boost::graph_traits::face_descriptor face_descriptor; + typedef typename GT::FT FT; typedef typename GT::Vector_3 Vector_3; + typedef typename boost::property_traits::reference Vector_ref; + + typename GT::Compute_scalar_product_3 sp_3 = traits.compute_scalar_product_3_object(); + typename GT::Construct_cross_product_vector_3 cp_3 = traits.construct_cross_product_vector_3_object(); std::vector incident_faces; incident_faces.reserve(8); for(face_descriptor f : CGAL::faces_around_target(halfedge(v, pmesh), pmesh)) { - if(f == boost::graph_traits::null_face()) + // Remove degenerate and redundant faces + if((f == boost::graph_traits::null_face()) || (get(face_normals, f)==NULL_VECTOR) ) continue; + if(! incident_faces.empty()){ + if(get(face_normals, incident_faces.back()) == get(face_normals, f) ) + continue; + } incident_faces.push_back(f); } - + if(incident_faces.size() == 0) + return NULL_VECTOR; if(incident_faces.size() == 1) return get(face_normals, incident_faces.front()); - Vector_3 res = compute_most_visible_normal_2_points(incident_faces, face_normals, traits); + std::array circum_points; + short int circum_points_size=2; + circum_points[0]=incident_faces[0]; + circum_points[1]=incident_faces[1]; - if(res != CGAL::NULL_VECTOR) // found a valid normal through 2 point min circle - return res; + // Get the farthest point from circum_points[0] + const Vector_ref n0 = get(face_normals, circum_points[0]); + const Vector_ref n1 = get(face_normals, circum_points[1]); + FT sp_min = sp_3(n0, n1); + for(size_t i=2; i= 2); + if(circum_points_size==2){ + center = compute_normals_bisector(ni, nj, traits); + } else { + CGAL_assertion(circum_points_size==3); + const Vector_ref nk = get(face_normals, circum_points[2]); + center = compute_normals_bisector(ni, nj, nk, traits); + } - return compute_most_visible_normal_3_points(incident_faces, face_normals, traits); + if(center==NULL_VECTOR) + return NULL_VECTOR; + + radius = -sp_3(ni, center); + + if(is_positive(radius)) + return NULL_VECTOR; // The circle is larger than a hemisphere, so no normal is visible to all + + face_descriptor f_out; + if(does_enclose_other_normals(-1,-2,-3, center, -radius, f_out, incident_faces, face_normals, traits)) + return center; + const Vector_ref no = get(face_normals, f_out); + + if(circum_points_size==2){ + circum_points[2]=f_out; + circum_points_size=3; + } else { + if(is_negative(sp_3(center, no))) + return NULL_VECTOR; // The circle will become bigger than a hemisphere, no normal visible by all + + const Vector_ref nk = get(face_normals, circum_points[2]); + + // We need to remove one of the previous points + // We keep the farthest point from the new one + // Then we divide the sphere in two along the equator that passes through the first point and the center + // We remove the previous point that lies in the same hemisphere as the new one + + // move the farthest point to f_out at the beginning of circum_points + FT sp_ni_no = sp_3(ni, no); + FT sp_nj_no = sp_3(nj, no); + FT sp_nk_no = sp_3(nk, no); + + if(sp_nj_no < sp_nk_no){ + if(sp_nj_no < sp_ni_no){ + std::swap(circum_points[0], circum_points[1]); + } + } else { + if(sp_nk_no < sp_ni_no){ + std::swap(circum_points[0], circum_points[2]); + } + } + + // Get the new vectors + const Vector_ref n0 = get(face_normals, circum_points[0]); + const Vector_ref n1 = get(face_normals, circum_points[1]); + const Vector_ref n2 = get(face_normals, circum_points[2]); + + // Search for the points that lie in the same hemisphere as f_out compared to ni + Vector_3 n_middle = cp_3(n0, center); + FT sp_no_nm = sp_3(no, n_middle); + FT sp_n1_nm = sp_3(n1, n_middle); + FT sp_n2_nm = sp_3(n2, n_middle); + + //We use the same bound than above in does_enclose_other_normals + const FT nmn = CGAL::approximate_sqrt(traits.compute_squared_length_3_object()(n_middle)); + const FT sp_diff_bound = nmn*0.00017453292431333; + CGAL_assertion((CGAL::sign(sp_n1_nm)!=CGAL::sign(sp_n2_nm)) || (abs(sp_n1_nm)<=sp_diff_bound) || (abs(sp_n2_nm)<=sp_diff_bound)); + if((abs(sp_n1_nm)<=sp_diff_bound) || (abs(sp_n2_nm)<=sp_diff_bound)) + return NULL_VECTOR; // The case is nearly degenerate and leads to geometric inconsistencies due to numerical errors + + if( CGAL::sign(sp_no_nm) == CGAL::sign(sp_n1_nm)){ + circum_points[1]=f_out; + } else { + circum_points[2]=f_out; + } + } + + // Delete one vertex if it is included in the circumcircle of the other two + const Vector_ref ni2 = get(face_normals, circum_points[0]); + const Vector_ref nj2 = get(face_normals, circum_points[1]); + const Vector_ref nk2 = get(face_normals, circum_points[2]); + Vector_3 center_ni_nj = compute_normals_bisector(ni2, nj2, traits); + Vector_3 center_ni_nk = compute_normals_bisector(ni2, nk2, traits); + Vector_3 center_nj_nk = compute_normals_bisector(nj2, nk2, traits); + + if(sp_3(center_ni_nj, nk2) > sp_3(center_ni_nj, ni2)){ + circum_points_size=2; + } else if(sp_3(center_ni_nk, nj2) > sp_3(center_ni_nk, ni2)){ + std::swap(circum_points[1],circum_points[2]); + circum_points_size=2; + } else if(sp_3(center_nj_nk, ni2) > sp_3(center_nj_nk, nj2)){ + std::swap(circum_points[0],circum_points[2]); + circum_points_size=2; + } + } } template @@ -727,7 +740,6 @@ compute_vertex_normal(typename boost::graph_traits::vertex_descript std::cout << "get normal at f " << face(h, pmesh) << " : " << get(face_normals, face(h, pmesh)) << std::endl; } #endif - Vector_3 normal = internal::compute_vertex_normal_most_visible_min_circle(v, face_normals, pmesh, traits); if(traits.equal_3_object()(normal, CGAL::NULL_VECTOR)) // can't always find a most visible normal { diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h index 2bded6d6373..29d4d5810bb 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h @@ -1689,8 +1689,9 @@ bounded_error_squared_Hausdorff_distance_impl(const TriangleMesh1& tm1, // Thus, subdivision can only decrease the min, and the upper bound. Local_bounds bounds(triangle_bounds.upper); - // Ensure 'uface' is initialized in case the upper bound is not changed by the subdivision + // Ensure 'lface' and 'uface' are initialized in case the bounds are not changed by the subdivision bounds.tm2_uface = triangle_bounds.tm2_uface; + bounds.tm2_lface = triangle_bounds.tm2_lface; TM2_hd_traits traversal_traits_tm2(sub_t1_bbox, tm2, vpm2, bounds, global_bounds, infinity_value); tm2_tree.traversal_with_priority(sub_triangles[i], traversal_traits_tm2); diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt b/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt index 51e2e1491a2..919ac774e0d 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt @@ -7,6 +7,7 @@ project(Polygon_mesh_processing_Tests) # CGAL and its components find_package(CGAL REQUIRED COMPONENTS Core) +create_single_source_cgal_program("slow_compute_normal.cpp") create_single_source_cgal_program("test_pmp_triangle.cpp") create_single_source_cgal_program("test_hausdorff_bounded_error_distance.cpp") create_single_source_cgal_program("test_pmp_read_polygon_mesh.cpp") @@ -72,6 +73,7 @@ create_single_source_cgal_program("test_isolevel_refinement.cpp") create_single_source_cgal_program("test_corefinement_nm_bo.cpp") create_single_source_cgal_program("test_corefinement_cavities.cpp") create_single_source_cgal_program("issue_8730.cpp") +create_single_source_cgal_program("issue_7164.cpp") # create_single_source_cgal_program("test_pmp_repair_self_intersections.cpp") find_package(Eigen3 3.2.0 QUIET) #(requires 3.2.0 or greater) diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/data/slow_compute_normal.off b/Polygon_mesh_processing/test/Polygon_mesh_processing/data/slow_compute_normal.off new file mode 100644 index 00000000000..5c09e19ef8f --- /dev/null +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/data/slow_compute_normal.off @@ -0,0 +1,1202 @@ +OFF +600 598 0 + +-103.33809661865234 -9.7869815826416016 -40 +-103.33809661865234 -71.779998779296875 -40 +-103.33809661865234 -72.139999389648438 -40 +-103.33809661865234 -44.599998474121094 -40 +-103.33809661865234 11.718429565429688 -40 +-103.33809661865234 5.2999997138977051 -40 +-103.33809661865234 -24.547355651855469 -40 +-103.33809661865234 -46.799999237060547 -40 +-103.33809661865234 -72.400001525878906 -40 +-103.33809661865234 -24.420000076293945 -40 +-103.33809661865234 2.4800000190734863 -40 +-103.33809661865234 8.5199995040893555 -40 +-103.33809661865234 -24.119998931884766 -40 +-103.33809661865234 -72.760002136230469 -40 +-103.33809661865234 -50.746982574462891 -40 +-103.33809661865234 -29.214235305786133 -40 +-103.33809661865234 -63.799999237060547 -40 +-103.33809661865234 -73.05999755859375 -40 +-103.33809661865234 -23.613948822021484 -40 +-103.33809661865234 5.0399999618530273 -40 +-103.33809661865234 -73.419998168945312 -40 +-103.33809661865234 -23.5 -40 +-103.33809661865234 4.679999828338623 -40 +-103.33809661865234 -50.486980438232422 -40 +-103.33809661865234 -15.819999694824219 -40 +-103.33809661865234 -41.05999755859375 -40 +-103.33809661865234 -50.126979827880859 -40 +-103.33809661865234 -23.139999389648438 -40 +-103.33809661865234 -18.639999389648438 -40 +-103.33809661865234 -45.259998321533203 -40 +-103.33809661865234 -16.079999923706055 -40 +-103.33809661865234 -73.680000305175781 -40 +-103.33809661865234 -22.680595397949219 -40 +-103.33809661865234 -74.040000915527344 -40 +-103.33809661865234 -46.539997100830078 -40 +-103.33809661865234 -22.479999542236328 -40 +-103.33809661865234 -64.099998474121094 -40 +-103.33809661865234 4.380000114440918 -40 +-103.33809661865234 4.0199999809265137 -40 +-103.33809661865234 -49.826980590820312 -40 +-103.33809661865234 -22.219999313354492 -40 +-103.33809661865234 -47.159999847412109 -40 +-103.33809661865234 -16.739999771118164 -40 +-103.33809661865234 -49.46697998046875 -40 +-103.33809661865234 -27.959999084472656 -40 +-103.33809661865234 -49.206981658935547 -40 +-103.33809661865234 -21.747188568115234 -40 +-103.33809661865234 10.159999847412109 -40 +-103.33809661865234 -17.08030891418457 -40 +-103.33809661865234 -21.559999465942383 -40 +-103.33809661865234 -41.348213195800781 -40 +-103.33809661865234 -64.459999084472656 -40 +-103.33809661865234 1.1999999284744263 -40 +-103.33809661865234 -57.039997100830078 -40 +-103.33809661865234 -20.813833236694336 -40 +-103.33809661865234 -31.799999237060547 -40 +-103.33809661865234 -74.339996337890625 -40 +-103.33809661865234 12.059999465942383 -40 +-103.33809661865234 -74.699996948242188 -40 +-103.33809661865234 -36.681282043457031 -40 +-103.33809661865234 3.7599999904632568 -40 +103.33809661865234 88.099998474121094 -90 +-103.33809661865234 1.8199999332427979 -40 +-103.33809661865234 3.3999998569488525 -40 +-103.33809661865234 -42.040000915527344 -40 +-103.33809661865234 -12.899999618530273 -40 +-103.33809661865234 -47.459999084472656 -40 +-103.33809661865234 -48.846981048583984 -40 +-103.33809661865234 -51 -40 +-103.33809661865234 -20.579999923706055 -40 +-103.33809661865234 15.539999961853027 -40 +-103.33809661865234 -48.546981811523438 -40 +-103.33809661865234 -36.55999755859375 -40 +-103.33809661865234 -19.880426406860352 -40 +-103.33809661865234 -51.299999237060547 -40 +-103.33809661865234 -48.186981201171875 -40 +-103.33809661865234 -19.659999847412109 -40 +-103.33809661865234 -25.039999008178711 -40 +-103.33809661865234 -57.699996948242188 -40 +-103.33809661865234 -36.299999237060547 -40 +-103.33809661865234 -56.779998779296875 -40 +-103.33809661865234 -18.947071075439453 -40 +-103.33809661865234 -50.639999389648438 -40 +-103.33809661865234 -0.71999996900558472 -40 +-103.33809661865234 -28.260000228881836 -40 +-103.33809661865234 -74.959999084472656 -40 +-103.33809661865234 -47.926982879638672 -40 +-103.33809661865234 1.4599999189376831 -40 +-103.33809661865234 -47.566982269287109 -40 +-103.33809661865234 -47.819999694824219 -40 +-103.33809661865234 -47.266983032226562 -40 +-103.33809661865234 -12.413379669189453 -40 +-103.33809661865234 -75.319999694824219 -40 +-103.33809661865234 -1.3799999952316284 -40 +-103.33809661865234 12.719999313354492 -40 +-103.33809661865234 -30.819999694824219 -40 +-103.33809661865234 16.385309219360352 -40 +-103.33809661865234 8.880000114440918 -40 +-103.33809661865234 12.979999542236328 -40 +-103.33809661865234 -35.279998779296875 -40 +-103.33809661865234 -64.720001220703125 -40 +-103.33809661865234 -7.4800000190734863 -40 +-103.33809661865234 -1.7400000095367432 -40 +-103.33809661865234 -46.906982421875 -40 +-103.33809661865234 -46.646980285644531 -40 +-103.33809661865234 -75.6199951171875 -40 +-103.33809661865234 -75.979995727539062 -40 +-103.33809661865234 -46.286979675292969 -40 +-103.33809661865234 -45.986980438232422 -40 +-103.33809661865234 -48.079998016357422 -40 +-103.33809661865234 -45.626979827880859 -40 +-103.33809661865234 -45.366981506347656 -40 +-103.33809661865234 -46.180000305175781 -40 +-103.33809661865234 -65.080001831054688 -40 +-103.33809661865234 -45.006980895996094 -40 +-103.33809661865234 -12.239999771118164 -40 +-103.33809661865234 -2 -40 +-103.33809661865234 -75.066978454589844 -40 +-103.33809661865234 -74.806983947753906 -40 +-103.33809661865234 -44.706981658935547 -40 +-103.33809661865234 -44.346981048583984 -40 +-103.33809661865234 -7.7799997329711914 -40 +-103.33809661865234 -44.086982727050781 -40 +-103.33809661865234 -43.726982116699219 -40 +-103.33809661865234 -8.1399993896484375 -40 +-103.33809661865234 -2.3599998950958252 -40 +-103.33809661865234 -76.239997863769531 -40 +-103.33809661865234 -43.066982269287109 -40 +-103.33809661865234 -42.806980133056641 -40 +-103.33809661865234 -54.219997406005859 -40 +-103.33809661865234 -42.146980285644531 -40 +-103.33809661865234 -65.379997253417969 -40 +-103.33809661865234 -48.439998626708984 -40 +-103.33809661865234 -76.599998474121094 -40 +-103.33809661865234 -44.239997863769531 -40 +-103.33809661865234 -41.166980743408203 -40 +-103.33809661865234 -53.55999755859375 -40 +-103.33809661865234 -76.900001525878906 -40 +-103.33809661865234 -40.866981506347656 -40 +-103.33809661865234 -26.979999542236328 -40 +-103.33809661865234 -65.739997863769531 -40 +-103.33809661865234 -40.246982574462891 -40 +-103.33809661865234 -74.446983337402344 -40 +-103.33809661865234 -39.919857025146484 -40 +-103.33809661865234 -77.259994506835938 -40 +-103.33809661865234 -53.199996948242188 -40 +-103.33809661865234 2.119999885559082 -40 +-103.33809661865234 -39.226982116699219 -40 +-103.33809661865234 -77.519996643066406 -40 +-103.33809661865234 -77.879997253417969 -40 +-103.33809661865234 -38.9864501953125 -40 +-103.33809661865234 -18.013666152954102 -40 +-103.33809661865234 -38.306980133056641 -40 +-103.33809661865234 16.559999465942383 -40 +-103.33809661865234 -66 -40 +-103.33809661865234 -2.6599998474121094 -40 +-103.33809661865234 -38.053092956542969 -40 +-103.33809661865234 -74.146980285644531 -40 +-103.33809661865234 -37.326980590820312 -40 +103.33809661865234 -88.099998474121094 -40 +-103.33809661865234 -3.0199999809265137 -40 +-103.33809661865234 -78.180000305175781 -40 +-103.33809661865234 -37.11968994140625 -40 +-103.33809661865234 -78.540000915527344 -40 +-103.33809661865234 -36.666980743408203 -40 +-103.33809661865234 8.2200002670288086 -40 +-103.33809661865234 14.619999885559082 -40 +-103.33809661865234 -66.360000610351562 -40 +-103.33809661865234 -36.406982421875 -40 +-103.33809661865234 -36.186336517333984 -40 +-103.33809661865234 -8.3999996185302734 -40 +-103.33809661865234 -35.746982574462891 -40 +-103.33809661865234 -78.799995422363281 -40 +-103.33809661865234 -73.786979675292969 -40 +-103.33809661865234 -58.05999755859375 -40 +-103.33809661865234 -35.386981964111328 -40 +-103.33809661865234 -48.739997863769531 -40 +-103.33809661865234 -28.879999160766602 -40 +-103.33809661865234 -35.2529296875 -40 +-103.33809661865234 -79.159996032714844 -40 +-103.33809661865234 -3.2799999713897705 -40 +-103.33809661865234 -34.766983032226562 -40 +-103.33809661865234 -8.7600002288818359 -40 +-103.33809661865234 -73.5269775390625 -40 +-103.33809661865234 -3.6399998664855957 -40 +-103.33809661865234 -34.46697998046875 -40 +-103.33809661865234 -71.479995727539062 -40 +-103.33809661865234 -32.947761535644531 -40 +-103.33809661865234 -34.319572448730469 -40 +-103.33809661865234 -73.166984558105469 -40 +-103.33809661865234 -33.739997863769531 -40 +-103.33809661865234 -79.459999084472656 -40 +-103.33809661865234 -33.846981048583984 -40 +-103.33809661865234 -72.866981506347656 -40 +-103.33809661865234 -9.0599994659423828 -40 +-103.33809661865234 -33.486980438232422 -40 +-103.33809661865234 -79.819999694824219 -40 +-103.33809661865234 -33.88116455078125 -40 +-103.33809661865234 -17.719999313354492 -40 +-103.33809661865234 -32.826980590820312 -40 +-103.33809661865234 -3.9399998188018799 -40 +-103.33809661865234 -72.506980895996094 -40 +-103.33809661865234 -32.566982269287109 -40 +-103.33809661865234 -9.4200000762939453 -40 +-103.33809661865234 -4.2999997138977051 -40 +-103.33809661865234 -32.452808380126953 -40 +-103.33809661865234 -80.080001831054688 -40 +-103.33809661865234 -80.439994812011719 -40 +-103.33809661865234 -49.099998474121094 -40 +-103.33809661865234 -31.906982421875 -40 +-103.33809661865234 -72.246978759765625 -40 +-103.33809661865234 -6.8599996566772461 -40 +-103.33809661865234 -31.546981811523438 -40 +-103.33809661865234 -4.559999942779541 -40 +-103.33809661865234 -71.886978149414062 -40 +-103.33809661865234 -30.926980972290039 -40 +-103.33809661865234 -9.6799993515014648 -40 +-103.33809661865234 -30.626981735229492 -40 +-103.33809661865234 -4.9200000762939453 -40 +-103.33809661865234 -80.739997863769531 -40 +-103.33809661865234 -10.039999961853027 -40 +-103.33809661865234 -30.006980895996094 -40 +-103.33809661865234 -71.586982727050781 -40 +-103.33809661865234 -29.652643203735352 -40 +-103.33809661865234 -71.226982116699219 -40 +-103.33809661865234 -81.099998474121094 -40 +-103.33809661865234 -28.986982345581055 -40 +-103.33809661865234 -5.2199997901916504 -40 +-103.33809661865234 -28.726982116699219 -40 +-103.33809661865234 -81.360000610351562 -40 +-103.33809661865234 -81.720001220703125 -40 +-103.33809661865234 -5.5799999237060547 -40 +-103.33809661865234 -28.066982269287109 -40 +-103.33809661865234 -70.96697998046875 -40 +-103.33809661865234 13.639999389648438 -40 +-103.33809661865234 -27.785881042480469 -40 +-103.33809661865234 -49.360000610351562 -40 +-103.33809661865234 -10.340000152587891 -40 +-103.33809661865234 -38.5 -40 +-103.33809661865234 -27.086982727050781 -40 +-103.33809661865234 5.9600000381469727 -40 +-103.33809661865234 -5.8399996757507324 -40 +-103.33809661865234 -26.852523803710938 -40 +-103.33809661865234 -70.606979370117188 -40 +-103.33809661865234 -10.54661750793457 -40 +-103.33809661865234 -26.166982650756836 -40 +-103.33809661865234 -6.1999998092651367 -40 +-103.33809661865234 -32.719997406005859 -40 +-103.33809661865234 -70.306983947753906 -40 +-103.33809661865234 -82.019996643066406 -40 +-103.33809661865234 -26.059999465942383 -40 +-103.33809661865234 -56.419998168945312 -40 +-103.33809661865234 -71.1199951171875 -40 +-103.33809661865234 -69.946983337402344 -40 +-103.33809661865234 -69.686981201171875 -40 +-103.33809661865234 -43.979999542236328 -40 +-103.33809661865234 -38.200000762939453 -40 +-103.33809661865234 -34.360000610351562 -40 +-103.33809661865234 -82.379997253417969 -40 +-103.33809661865234 -69.326980590820312 -40 +-103.33809661865234 2.7400000095367432 -40 +-103.33809661865234 -69.0269775390625 -40 +-103.33809661865234 -32.459999084472656 -40 +-103.33809661865234 -0.079999998211860657 -40 +-103.33809661865234 6.3199996948242188 -40 +-103.33809661865234 -34.659999847412109 -40 +-103.33809661865234 -52.939998626708984 -40 +-103.33809661865234 3.0999999046325684 -40 +-103.33809661865234 -82.639999389648438 -40 +-103.33809661865234 -6.5 -40 +-103.33809661865234 -1.0799999237060547 -40 +-103.33809661865234 -56.119998931884766 -40 +-103.33809661865234 -68.666984558105469 -40 +-103.33809661865234 -68.406982421875 -40 +-103.33809661865234 9.8000001907348633 -40 +-103.33809661865234 -83 -40 +-103.33809661865234 7.5999999046325684 -40 +-103.33809661865234 -35.639999389648438 -40 +-103.33809661865234 -68.046981811523438 -40 +-103.33809661865234 -49.719997406005859 -40 +-103.33809661865234 -58.319999694824219 -40 +-103.33809661865234 -83.299995422363281 -40 +-103.33809661865234 -7.119999885559082 -40 +-103.33809661865234 -67.746978759765625 -40 +-103.33809661865234 -67.386978149414062 -40 +-103.33809661865234 -83.659996032714844 -40 +-103.33809661865234 -67.126983642578125 -40 +-103.33809661865234 -55.759998321533203 -40 +-103.33809661865234 -25.919118881225586 -40 +-103.33809661865234 -58.680000305175781 -40 +-103.33809661865234 -66.766983032226562 -40 +-103.33809661865234 -66.46697998046875 -40 +-103.33809661865234 -66.106979370117188 -40 +-103.33809661865234 -35.747928619384766 -40 +-103.33809661865234 -55.5 -40 +-103.33809661865234 -65.846977233886719 -40 +-103.33809661865234 -65.486984252929688 -40 +-103.33809661865234 -65.186981201171875 -40 +-103.33809661865234 -55.139999389648438 -40 +-103.33809661865234 -83.919998168945312 -40 +-103.33809661865234 14.920000076293945 -40 +-103.33809661865234 -64.826980590820312 -40 +-103.33809661865234 -64.566978454589844 -40 +-103.33809661865234 -64.206977844238281 -40 +-103.33809661865234 -58.979999542236328 -40 +-103.33809661865234 -54.840000152587891 -40 +-103.33809661865234 -63.906982421875 -40 +-103.33809661865234 -29.899999618530273 -40 +-103.33809661865234 -63.546981811523438 -40 +-103.33809661865234 5.6599998474121094 -40 +-103.33809661865234 7.2399997711181641 -40 +-103.33809661865234 -63.286979675292969 -40 +-103.33809661865234 -59.340000152587891 -40 +-103.33809661865234 -84.279998779296875 -40 +-103.33809661865234 -15.159999847412109 -40 +-103.33809661865234 -62.926982879638672 -40 +-103.33809661865234 -41.786979675292969 -40 +-103.33809661865234 6.940000057220459 -40 +-103.33809661865234 -25.146982192993164 -40 +-103.33809661865234 -62.626979827880859 -40 +-103.33809661865234 -30.14764404296875 -40 +-103.33809661865234 -34.814521789550781 -40 +-103.33809661865234 -52.579998016357422 -40 +-103.33809661865234 11.079999923706055 -40 +-103.33809661865234 -62.266979217529297 -40 +-103.33809661865234 -84.580001831054688 -40 +-103.33809661865234 -62.006980895996094 -40 +-103.33809661865234 -45.520000457763672 -40 +-103.33809661865234 -63.439998626708984 -40 +-103.33809661865234 -59.599998474121094 -40 +-103.33809661865234 -61.646980285644531 -40 +-103.33809661865234 -61.346981048583984 -40 +-103.33809661865234 -42.281570434570312 -40 +-103.33809661865234 -60.986980438232422 -40 +-103.33809661865234 -60.726982116699219 -40 +-103.33809661865234 -9.1669816970825195 -40 +-103.33809661865234 -24.985763549804688 -40 +-103.33809661865234 -84.939994812011719 -40 +-103.33809661865234 -60.366981506347656 -40 +-103.33809661865234 16.819999694824219 -40 +-103.33809661865234 -60.066982269287109 -40 +-103.33809661865234 -59.959999084472656 -40 +-103.33809661865234 -59.706981658935547 -40 +-103.33809661865234 15.899999618530273 -40 +-103.33809661865234 -14.799999237060547 -40 +-103.33809661865234 -59.446979522705078 -40 +-103.33809661865234 -59.086982727050781 -40 +-103.33809661865234 -24.526981353759766 -40 +-103.33809661865234 -58.786979675292969 -40 +-103.33809661865234 -9.5269813537597656 -40 +-103.33809661865234 -85.199996948242188 -40 +-103.33809661865234 -37.579998016357422 -40 +-103.33809661865234 -58.426982879638672 -40 +-103.33809661865234 -0.45999997854232788 -40 +-103.33809661865234 -58.166980743408203 -40 +-103.33809661865234 -57.806980133056641 -40 +-103.33809661865234 -24.226982116699219 -40 +-103.33809661865234 -85.55999755859375 -40 +-103.33809661865234 -57.506980895996094 -40 +-103.33809661865234 -70.860000610351562 -40 +-103.33809661865234 7.8599996566772461 -40 +-103.33809661865234 -57.399997711181641 -40 +-103.33809661865234 -86.586982727050781 -40 +-103.33809661865234 -82.746978759765625 -40 +-103.33809661865234 -78.646980285644531 -40 +-103.33809661865234 -78.906982421875 -40 +-103.33809661865234 -86.946983337402344 -40 +-103.33809661865234 -83.106979370117188 -40 +-103.33809661865234 -79.266983032226562 -40 +-103.33809661865234 -87.246978759765625 -40 +-103.33809661865234 -83.406982421875 -40 +-103.33809661865234 -75.426979064941406 -40 +-103.33809661865234 -79.566978454589844 -40 +-103.33809661865234 -83.766983032226562 -40 +-103.33809661865234 -75.726982116699219 -40 +-103.33809661865234 -79.926979064941406 -40 +-103.33809661865234 -84.0269775390625 -40 +-103.33809661865234 -76.086982727050781 -40 +-103.33809661865234 -80.186981201171875 -40 +-103.33809661865234 -84.386978149414062 -40 +-103.33809661865234 -76.346977233886719 -40 +-103.33809661865234 -84.686981201171875 -40 +-103.33809661865234 -76.706977844238281 -40 +-103.33809661865234 -80.546981811523438 -40 +-103.33809661865234 -85.046981811523438 -40 +-103.33809661865234 -77.006980895996094 -40 +-103.33809661865234 -80.846977233886719 -40 +-103.33809661865234 -86.839996337890625 -40 +-103.33809661865234 -85.306983947753906 -40 +-103.33809661865234 -77.366981506347656 -40 +-103.33809661865234 -81.206977844238281 -40 +-103.33809661865234 -81.46697998046875 -40 +-103.33809661865234 -85.666976928710938 -40 +-103.33809661865234 -77.626983642578125 -40 +-103.33809661865234 -81.826980590820312 -40 +-103.33809661865234 -85.96697998046875 -40 +-103.33809661865234 -77.986984252929688 -40 +-103.33809661865234 -82.126983642578125 -40 +-103.33809661865234 -86.326980590820312 -40 +-103.33809661865234 -78.286979675292969 -40 +-103.33809661865234 -82.486984252929688 -40 +-103.33809661865234 -87.606979370117188 -40 +-103.33809661865234 -87.866981506347656 -40 +-103.33809661865234 -60.259998321533203 -40 +-103.33809661865234 -24.05235481262207 -40 +-103.33809661865234 -23.60698127746582 -40 +-103.33809661865234 -23.246982574462891 -40 +-103.33809661865234 -60.619998931884766 -40 +-103.33809661865234 10.814975738525391 -40 +-103.33809661865234 -23.119001388549805 -40 +-103.33809661865234 -22.586982727050781 -40 +-103.33809661865234 -22.326982498168945 -40 +-103.33809661865234 -54.479999542236328 -40 +-103.33809661865234 -60.879997253417969 -40 +-103.33809661865234 -22.18559455871582 -40 +-103.33809661865234 -21.666982650756836 -40 +-103.33809661865234 -21.306982040405273 -40 +-103.33809661865234 -61.239997863769531 -40 +-103.33809661865234 -45.879997253417969 -40 +-103.33809661865234 -20.686981201171875 -40 +-103.33809661865234 -20.386981964111328 -40 +-103.33809661865234 -19.76698112487793 -40 +-103.33809661865234 -40.399997711181641 -40 +-103.33809661865234 -61.539997100830078 -40 +-103.33809661865234 -19.406982421875 -40 +-103.33809661865234 -18.746982574462891 -40 +-103.33809661865234 -18.486982345581055 -40 +-103.33809661865234 -61.899997711181641 -40 +-103.33809661865234 -32.014404296875 -40 +-103.33809661865234 -17.826982498168945 -40 +-103.33809661865234 -17.518714904785156 -40 +-103.33809661865234 -16.846982955932617 -40 +-103.33809661865234 6.5799999237060547 -40 +-103.33809661865234 -62.159999847412109 -40 +-103.33809661865234 -16.585309982299805 -40 +-103.33809661865234 -15.926981925964355 -40 +-103.33809661865234 -15.65195369720459 -40 +-103.33809661865234 -62.520000457763672 -40 +-103.33809661865234 -40.139999389648438 -40 +-103.33809661865234 -14.906982421875 -40 +-103.33809661865234 -14.718546867370605 -40 +-103.33809661865234 -13.986982345581055 -40 +-103.33809661865234 -27.340000152587891 -40 +-103.33809661865234 -62.819999694824219 -40 +-103.33809661865234 -13.785191535949707 -40 +-103.33809661865234 -13.00698184967041 -40 +-103.33809661865234 -12.851785659790039 -40 +-103.33809661865234 -63.180000305175781 -40 +-103.33809661865234 0.53999996185302734 -40 +-103.33809661865234 -57.146980285644531 -40 +-103.33809661865234 -11.319999694824219 -40 +-103.33809661865234 -12.346982002258301 -40 +-103.33809661865234 -56.886981964111328 -40 +-103.33809661865234 -11.480024337768555 -40 +-103.33809661865234 -25.399999618530273 -40 +-103.33809661865234 -50.020000457763672 -40 +-103.33809661865234 -12.086981773376465 -40 +-103.33809661865234 -56.526981353759766 -40 +-103.33809661865234 -56.226982116699219 -40 +-103.33809661865234 -11.918430328369141 -40 +-103.33809661865234 -55.866981506347656 -40 +-103.33809661865234 -11.979999542236328 -40 +-103.33809661865234 -50.379997253417969 -40 +-103.33809661865234 -31.080997467041016 -40 +-103.33809661865234 -11.426981925964355 -40 +-103.33809661865234 0.8399999737739563 -40 +-103.33809661865234 -55.606979370117188 -40 +-103.33809661865234 -66.659996032714844 -40 +-103.33809661865234 -52.279998779296875 -40 +-103.33809661865234 -55.246982574462891 -40 +-103.33809661865234 -85.860000610351562 -40 +-103.33809661865234 -67.019996643066406 -40 +-103.33809661865234 -44.899997711181641 -40 +-103.33809661865234 -37.219997406005859 -40 +-103.33809661865234 -14.179999351501465 -40 +-103.33809661865234 -26.319999694824219 -40 +-103.33809661865234 -67.279998779296875 -40 +-103.33809661865234 -86.220001220703125 -40 +-103.33809661865234 -11.066982269287109 -40 +-103.33809661865234 -43.185024261474609 -40 +-103.33809661865234 -67.639999389648438 -40 +-103.33809661865234 -39.479999542236328 -40 +-103.33809661865234 -54.946979522705078 -40 +-103.33809661865234 -54.586982727050781 -40 +-103.33809661865234 -86.479995727539062 -40 +-103.33809661865234 0.17999999225139618 -40 +-103.33809661865234 -67.939994812011719 -40 +-103.33809661865234 -51.919998168945312 -40 +-103.33809661865234 -54.326980590820312 -40 +-103.33809661865234 9.1399993896484375 -40 +-103.33809661865234 -68.299995422363281 -40 +-103.33809661865234 -53.860000610351562 -40 +-103.33809661865234 -13.880000114440918 -40 +-103.33809661865234 -53.96697998046875 -40 +-103.33809661865234 -10.446982383728027 -40 +-103.33809661865234 -53.666980743408203 -40 +-103.33809661865234 -68.55999755859375 -40 +-103.33809661865234 -53.306980133056641 -40 +-103.33809661865234 -53.046981811523438 -40 +-103.33809661865234 -87.139999389648438 -40 +-103.33809661865234 -68.919998168945312 -40 +-103.33809661865234 -52.686981201171875 -40 +-103.33809661865234 -52.386981964111328 -40 +-103.33809661865234 14 -40 +-103.33809661865234 -87.5 -40 +103.33809661865234 -88.099998474121094 -90 +-103.33809661865234 -69.220001220703125 -40 +-103.33809661865234 9.5 -40 +-103.33809661865234 -51.659999847412109 -40 +-103.33809661865234 -10.146981239318848 -40 +-103.33809661865234 -69.580001831054688 -40 +-103.33809661865234 -70.5 -40 +-103.33809661865234 -52.026981353759766 -40 +-103.33809661865234 -87.759994506835938 -40 +-103.33809661865234 -88.099998474121094 -40 +-103.33809661865234 -39.119998931884766 -40 +-103.33809661865234 -69.839996337890625 -40 +-103.33809661865234 -51.106983184814453 -40 +-103.33809661865234 -13.25999927520752 -40 +-103.33809661865234 -42.959999084472656 -40 +-103.33809661865234 -70.199996948242188 -40 +-103.33809661865234 -51.766983032226562 -40 +-103.33809661865234 -51.406982421875 -40 +-103.33809661865234 -88.099998474121094 -90 +-103.33809661865234 16.88031005859375 -40 +-103.33809661865234 16.713016510009766 -40 +-103.33809661865234 16.45301628112793 -40 +-103.33809661865234 15.946902275085449 -40 +-103.33809661865234 15.793017387390137 -40 +-103.33809661865234 15.013546943664551 -40 +-103.33809661865234 14.813016891479492 -40 +-103.33809661865234 14.080141067504883 -40 +-103.33809661865234 13.893016815185547 -40 +-103.33809661865234 13.146785736083984 -40 +-103.33809661865234 12.873017311096191 -40 +-103.33809661865234 12.213379859924316 -40 +-103.33809661865234 11.953017234802246 -40 +-103.33809661865234 11.280024528503418 -40 +-103.33809661865234 10.973017692565918 -40 +-103.33809661865234 10.313016891479492 -40 +-103.33809661865234 10.053017616271973 -40 +-103.33809661865234 9.6930179595947266 -40 +-103.33809661865234 9.3930177688598633 -40 +-103.33809661865234 9.0330181121826172 -40 +-103.33809661865234 8.7730178833007812 -40 +-103.33809661865234 8.4130182266235352 -40 +-103.33809661865234 8.1130180358886719 -40 +-103.33809661865234 7.7530179023742676 -40 +-103.33809661865234 7.4930181503295898 -40 +-103.33809661865234 7.1330180168151855 -40 +-103.33809661865234 6.8330178260803223 -40 +-103.33809661865234 6.4730181694030762 -40 +-103.33809661865234 6.2130179405212402 -40 +-103.33809661865234 5.8530182838439941 -40 +-103.33809661865234 5.5530180931091309 -40 +-103.33809661865234 5.1930179595947266 -40 +-103.33809661865234 4.9330177307128906 -40 +-103.33809661865234 4.5730175971984863 -40 +-103.33809661865234 4.2730178833007812 -40 +-103.33809661865234 3.913017749786377 -40 +-103.33809661865234 3.6530177593231201 -40 +-103.33809661865234 3.2930178642272949 -40 +-103.33809661865234 2.9930179119110107 -40 +-103.33809661865234 2.6330177783966064 -40 +-103.33809661865234 2.3730180263519287 -40 +-103.33809661865234 2.0130178928375244 -40 +-103.33809661865234 1.7130179405212402 -40 +-103.33809661865234 1.353018045425415 -40 +-103.33809661865234 1.0930179357528687 -40 +-103.33809661865234 0.73301792144775391 -40 +-103.33809661865234 0.43301793932914734 -40 +-103.33809661865234 0.073017969727516174 -40 +-103.33809661865234 -0.18698202073574066 -40 +-103.33809661865234 -0.56698203086853027 -40 +-103.33809661865234 -0.82698202133178711 -40 +-103.33809661865234 -1.1869820356369019 -40 +-103.33809661865234 -1.486981987953186 -40 +-103.33809661865234 -1.8469818830490112 -40 +-103.33809661865234 -2.1069819927215576 -40 +-103.33809661865234 -2.4669818878173828 -40 +-103.33809661865234 -2.7669820785522461 -40 +-103.33809661865234 -3.1269819736480713 -40 +-103.33809661865234 -3.3869819641113281 -40 +-103.33809661865234 -3.7469820976257324 -40 +-103.33809661865234 -4.0469818115234375 -40 +-103.33809661865234 -4.4069819450378418 -40 +-103.33809661865234 -4.6669821739196777 -40 +-103.33809661865234 -5.0269818305969238 -40 +-103.33809661865234 -5.3269815444946289 -40 +-103.33809661865234 -5.6869816780090332 -40 +-103.33809661865234 -5.9469819068908691 -40 +-103.33809661865234 -6.3069815635681152 -40 +-103.33809661865234 -6.6069817543029785 -40 +-103.33809661865234 -6.9669818878173828 -40 +-103.33809661865234 -7.2269816398620605 -40 +-103.33809661865234 -7.5869817733764648 -40 +-103.33809661865234 -7.8869814872741699 -40 +-103.33809661865234 -8.2469816207885742 -40 +-103.33809661865234 -8.5069818496704102 -40 +-103.33809661865234 -8.8669815063476562 -40 +3 523 598 170 +3 523 170 597 +3 523 597 124 +3 523 124 596 +3 523 596 121 +3 523 121 595 +3 523 18 405 +3 523 404 18 +3 523 595 101 +3 523 101 594 +3 523 12 404 +3 523 594 282 +3 523 282 593 +3 523 593 211 +3 523 356 12 +3 523 9 356 +3 523 211 592 +3 523 592 269 +3 523 347 9 +3 523 6 347 +3 523 269 591 +3 523 591 246 +3 523 336 6 +3 523 77 336 +3 523 115 456 +3 523 246 590 +3 523 318 77 +3 523 456 461 +3 523 590 241 +3 523 241 589 +3 523 461 459 +3 523 92 117 +3 523 589 231 +3 523 231 588 +3 523 454 318 +3 523 288 454 +3 523 588 227 +3 523 227 587 +3 523 250 288 +3 523 446 91 +3 523 587 218 +3 523 245 250 +3 523 459 453 +3 523 218 586 +3 523 453 464 +3 523 586 213 +3 523 475 245 +3 523 242 475 +3 523 213 585 +3 523 585 204 +3 523 139 242 +3 523 239 139 +3 523 204 584 +3 523 584 200 +3 523 442 239 +3 523 235 442 +3 523 200 583 +3 523 583 184 +3 523 44 235 +3 523 232 44 +3 523 184 582 +3 523 117 85 +3 523 84 232 +3 523 228 84 +3 523 582 180 +3 523 180 581 +3 523 177 228 +3 523 226 177 +3 523 581 160 +3 523 464 450 +3 523 15 226 +3 523 223 15 +3 523 160 580 +3 523 580 155 +3 523 307 223 +3 523 221 307 +3 523 155 579 +3 523 579 125 +3 523 320 221 +3 523 217 320 +3 523 125 578 +3 523 85 118 +3 523 95 217 +3 523 215 95 +3 523 450 478 +3 523 478 244 +3 523 463 215 +3 523 212 463 +3 523 118 58 +3 523 578 116 +3 523 55 212 +3 523 209 55 +3 523 116 577 +3 523 577 102 +3 523 102 576 +3 523 428 209 +3 523 576 93 +3 523 93 575 +3 523 205 428 +3 523 262 205 +3 523 58 142 +3 523 142 56 +3 523 202 262 +3 523 247 202 +3 523 575 270 +3 523 244 494 +3 523 199 247 +3 523 187 199 +3 523 270 574 +3 523 574 83 +3 523 195 187 +3 523 190 195 +3 523 83 573 +3 523 573 353 +3 523 353 572 +3 523 192 190 +3 523 56 157 +3 523 405 21 +3 523 21 406 +3 523 406 27 +3 523 572 263 +3 523 263 571 +3 523 27 409 +3 523 409 32 +3 523 32 410 +3 523 410 35 +3 523 35 411 +3 523 411 40 +3 523 40 414 +3 523 414 46 +3 523 46 415 +3 523 415 49 +3 523 49 416 +3 523 416 54 +3 523 54 419 +3 523 419 69 +3 523 422 141 +3 523 69 420 +3 523 420 73 +3 523 73 421 +3 523 421 76 +3 523 76 424 +3 523 424 81 +3 523 571 485 +3 523 485 570 +3 523 494 237 +3 523 237 509 +3 523 509 220 +3 523 220 0 +3 523 0 216 +3 523 81 425 +3 523 425 28 +3 523 570 448 +3 523 448 569 +3 523 28 426 +3 523 216 349 +3 523 349 203 +3 523 451 115 +3 523 91 451 +3 523 203 335 +3 523 335 194 +3 523 194 599 +3 523 569 465 +3 523 599 182 +3 523 182 598 +3 523 339 524 +3 523 525 339 +3 523 141 438 +3 523 82 23 +3 523 14 82 +3 523 465 568 +3 523 568 52 +3 523 52 567 +3 523 153 525 +3 523 526 153 +3 523 96 526 +3 523 527 96 +3 523 426 151 +3 523 151 429 +3 523 343 527 +3 523 528 343 +3 523 429 198 +3 523 198 430 +3 523 68 14 +3 523 517 68 +3 523 567 87 +3 523 87 566 +3 61 505 523 +3 523 70 528 +3 159 523 505 +3 159 514 523 +3 523 430 48 +3 523 566 62 +3 523 529 70 +3 523 62 565 +3 523 565 146 +3 523 146 564 +3 523 197 192 +3 523 564 10 +3 523 300 529 +3 523 10 563 +3 523 157 33 +3 523 530 300 +3 523 33 173 +3 523 173 31 +3 523 31 183 +3 523 183 20 +3 523 563 260 +3 523 20 189 +3 523 260 562 +3 523 189 17 +3 523 17 193 +3 523 166 530 +3 523 193 13 +3 523 13 201 +3 523 531 166 +3 523 201 8 +3 523 8 210 +3 523 65 446 +3 523 503 531 +3 523 210 2 +3 523 2 214 +3 523 214 1 +3 523 562 267 +3 523 48 431 +3 523 1 222 +3 523 222 186 +3 523 186 224 +3 523 224 252 +3 523 252 233 +3 523 233 359 +3 523 431 42 +3 523 267 561 +3 523 359 243 +3 523 243 511 +3 523 511 248 +3 523 248 520 +3 523 520 253 +3 523 253 516 +3 523 561 63 +3 523 63 560 +3 523 516 254 +3 523 254 510 +3 523 510 259 +3 523 259 506 +3 523 506 261 +3 523 261 500 +3 523 560 60 +3 523 60 559 +3 523 500 272 +3 523 272 496 +3 523 496 273 +3 523 273 490 +3 523 42 434 +3 523 559 38 +3 523 434 30 +3 523 30 435 +3 523 435 24 +3 523 38 558 +3 523 24 436 +3 523 490 278 +3 523 278 486 +3 523 558 37 +3 523 436 314 +3 523 486 283 +3 523 283 480 +3 523 480 284 +3 523 284 476 +3 523 476 286 +3 523 286 471 +3 523 314 439 +3 523 37 557 +3 523 471 290 +3 523 557 22 +3 523 290 467 +3 523 467 291 +3 523 291 167 +3 523 167 292 +3 523 292 154 +3 523 154 295 +3 523 295 140 +3 523 140 296 +3 523 296 131 +3 523 131 297 +3 523 297 113 +3 523 113 301 +3 523 301 100 +3 523 100 302 +3 523 302 51 +3 523 51 303 +3 523 303 36 +3 523 36 306 +3 523 306 16 +3 523 16 308 +3 523 22 556 +3 523 308 328 +3 523 328 311 +3 523 311 447 +3 523 532 503 +3 523 447 315 +3 523 315 443 +3 523 443 319 +3 523 319 437 +3 523 437 324 +3 523 324 433 +3 523 234 532 +3 523 556 19 +3 523 19 555 +3 523 433 326 +3 523 326 427 +3 523 427 330 +3 523 330 423 +3 523 423 331 +3 523 533 234 +3 523 555 5 +3 523 331 417 +3 523 417 333 +3 523 333 413 +3 523 413 334 +3 523 334 407 +3 523 407 338 +3 523 98 533 +3 523 338 403 +3 523 5 554 +3 523 403 340 +3 523 340 341 +3 523 341 342 +3 523 342 329 +3 523 329 345 +3 523 554 309 +3 523 534 98 +3 523 345 312 +3 523 74 517 +3 523 309 553 +3 523 522 74 +3 523 312 346 +3 523 94 534 +3 523 535 94 +3 523 57 535 +3 523 553 240 +3 523 240 552 +3 523 536 57 +3 523 4 536 +3 523 537 4 +3 523 323 537 +3 523 445 65 +3 523 538 323 +3 523 439 344 +3 523 344 440 +3 523 408 538 +3 523 539 408 +3 523 47 539 +3 523 540 47 +3 523 274 540 +3 523 518 445 +3 523 552 264 +3 523 264 551 +3 523 188 197 +3 523 257 188 +3 523 185 257 +3 523 265 185 +3 523 181 265 +3 523 321 181 +3 523 551 432 +3 523 432 550 +3 523 178 321 +3 523 99 178 +3 523 175 99 +3 523 277 175 +3 523 171 277 +3 523 293 171 +3 523 550 317 +3 523 440 474 +3 523 169 293 +3 523 79 169 +3 523 168 79 +3 523 72 168 +3 523 164 72 +3 523 317 549 +3 523 59 164 +3 523 474 441 +3 523 162 59 +3 523 473 162 +3 523 158 473 +3 523 351 158 +3 523 156 351 +3 523 346 304 +3 523 304 348 +3 523 348 289 +3 523 289 352 +3 523 256 156 +3 523 152 256 +3 523 441 492 +3 523 549 310 +3 523 238 152 +3 523 150 238 +3 523 515 150 +3 523 147 515 +3 523 481 147 +3 523 143 481 +3 523 310 548 +3 523 352 280 +3 523 280 354 +3 523 548 276 +3 523 438 143 +3 523 354 174 +3 523 174 355 +3 523 276 547 +3 523 355 78 +3 523 547 360 +3 523 78 358 +3 523 358 361 +3 523 361 449 +3 523 449 53 +3 523 53 452 +3 523 452 80 +3 523 80 457 +3 523 457 251 +3 523 251 458 +3 523 458 271 +3 523 360 546 +3 523 546 165 +3 523 271 460 +3 523 460 287 +3 523 287 466 +3 523 466 294 +3 523 294 469 +3 523 469 298 +3 523 492 444 +3 523 165 545 +3 523 444 518 +3 523 298 482 +3 523 482 305 +3 523 545 11 +3 523 305 483 +3 523 483 412 +3 523 412 488 +3 523 488 129 +3 523 129 493 +3 523 493 491 +3 523 491 495 +3 523 495 136 +3 523 11 544 +3 523 136 497 +3 523 544 97 +3 523 97 543 +3 523 497 145 +3 523 145 498 +3 523 498 266 +3 523 266 501 +3 523 501 322 +3 523 322 502 +3 523 543 489 +3 523 489 542 +3 523 502 468 +3 523 468 512 +3 523 512 487 +3 523 487 521 +3 523 521 508 +3 523 508 522 +3 523 542 507 +3 523 507 541 +3 523 541 274 +3 523 362 484 +3 523 230 391 +3 523 363 268 +3 523 364 163 +3 523 249 394 +3 523 365 172 +3 523 366 387 +3 523 258 397 +3 523 268 400 +3 523 367 275 +3 523 275 363 +3 523 368 179 +3 523 369 499 +3 523 281 367 +3 523 370 281 +3 523 371 92 +3 523 285 370 +3 523 105 371 +3 523 372 191 +3 523 373 285 +3 523 299 373 +3 523 106 374 +3 523 374 105 +3 523 375 196 +3 523 313 376 +3 523 126 377 +3 523 376 299 +3 523 377 106 +3 523 325 379 +3 523 133 380 +3 523 378 206 +3 523 337 381 +3 523 137 382 +3 523 379 313 +3 523 380 126 +3 523 350 384 +3 523 144 385 +3 523 357 388 +3 523 148 389 +3 523 381 325 +3 523 382 133 +3 523 383 207 +3 523 470 392 +3 523 149 393 +3 523 477 395 +3 523 161 396 +3 523 384 337 +3 523 385 137 +3 523 386 219 +3 523 484 398 +3 523 163 399 +3 523 387 362 +3 523 172 364 +3 523 388 350 +3 523 389 144 +3 523 390 225 +3 523 499 366 +3 523 179 365 +3 523 391 229 +3 523 504 369 +3 523 191 368 +3 523 392 357 +3 523 393 148 +3 523 196 372 +3 523 394 230 +3 523 206 375 +3 523 395 470 +3 523 396 149 +3 523 207 378 +3 523 397 249 +3 523 398 477 +3 523 219 383 +3 523 225 386 +3 523 399 161 +3 523 229 390 +3 523 400 258 +3 401 504 523 +3 513 401 523 +3 402 513 523 +3 514 402 523 +3 523 23 462 +3 523 462 26 +3 523 26 455 +3 523 455 39 +3 523 39 279 +3 523 279 43 +3 523 43 236 +3 523 236 45 +3 523 45 208 +3 523 208 67 +3 523 67 176 +3 523 176 71 +3 523 71 132 +3 523 132 75 +3 523 75 109 +3 523 109 86 +3 523 86 89 +3 523 89 88 +3 523 88 66 +3 523 66 90 +3 523 90 41 +3 523 41 103 +3 523 103 7 +3 523 7 104 +3 523 104 34 +3 523 34 107 +3 523 107 112 +3 523 112 108 +3 523 108 418 +3 523 418 110 +3 523 110 327 +3 523 327 111 +3 523 111 29 +3 523 29 114 +3 523 114 472 +3 523 472 119 +3 523 119 3 +3 523 3 120 +3 523 120 134 +3 523 134 122 +3 523 122 255 +3 523 255 123 +3 523 123 479 +3 523 479 127 +3 523 127 519 +3 523 519 128 +3 523 128 332 +3 523 332 130 +3 523 130 64 +3 523 64 316 +3 523 316 50 +3 523 50 135 +3 523 135 25 +3 523 25 138 +3 523 138 422 + diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/issue_7164.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/issue_7164.cpp new file mode 100644 index 00000000000..de4e16a74e6 --- /dev/null +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/issue_7164.cpp @@ -0,0 +1,61 @@ +#include +#include +#include +#include +#include +using Kernel = CGAL::Exact_predicates_inexact_constructions_kernel; +using Point_3 = Kernel::Point_3; +using Mesh = CGAL::Surface_mesh; +namespace PMP = CGAL::Polygon_mesh_processing; + +int main(/*int argc, char** argv*/) +{ + // A simple triangle + std::vector pts_A; + std::vector> trs_A; + pts_A.emplace_back( 0.26641936088212415, 0.2664193608821242, 0.73358063911787585); + pts_A.emplace_back(-0.14011519816541251, 0.6017979969632727, 1.1810107045967466); + pts_A.emplace_back(-0.14011519816541279,-0.1810107045967464, 0.39820200303672726); + trs_A.emplace_back(std::vector{0,1,2}); + Mesh A; + PMP::polygon_soup_to_polygon_mesh(pts_A, trs_A, A); + + // An open tetrahedron + std::vector pts_B; + std::vector> trs_B; + pts_B.emplace_back(0,0,0); + pts_B.emplace_back(1,1,0); + pts_B.emplace_back(1,0,1); + pts_B.emplace_back(0,1,1); + trs_B.emplace_back(std::vector{0,1,2}); + trs_B.emplace_back(std::vector{3,1,0}); + trs_B.emplace_back(std::vector{3,2,1}); + Mesh B; + PMP::polygon_soup_to_polygon_mesh(pts_B, trs_B, B); + + double bound = 0.01 * 0.42149467833714593; + PMP::bounded_error_Hausdorff_distance(A, B, bound); + PMP::bounded_error_Hausdorff_distance(B, A, bound); + + // The bug was possible with closed models + std::vector pts_C; + std::vector> trs_C; + pts_C.emplace_back(0,0,0); + pts_C.emplace_back(1,1,0); + pts_C.emplace_back(1,0,1); + pts_C.emplace_back(0,1,1); + pts_C.emplace_back(0.75,0.75,0); + trs_C.emplace_back(std::vector{0,1,2}); + trs_C.emplace_back(std::vector{3,1,0}); + trs_C.emplace_back(std::vector{3,2,1}); + trs_C.emplace_back(std::vector{0,2,4}); + trs_C.emplace_back(std::vector{3,0,4}); + trs_C.emplace_back(std::vector{3,4,2}); + Mesh C; + PMP::polygon_soup_to_polygon_mesh(pts_C, trs_C, C); + + PMP::bounded_error_Hausdorff_distance(A, C, bound); + PMP::bounded_error_Hausdorff_distance(C, A, bound); + + return EXIT_SUCCESS; +} diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/slow_compute_normal.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/slow_compute_normal.cpp new file mode 100644 index 00000000000..70d9e73fc39 --- /dev/null +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/slow_compute_normal.cpp @@ -0,0 +1,39 @@ +#include +#include +#include +#include +#include + +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; + +typedef K::Point_3 Point; +typedef K::Vector_3 Vector; + +typedef CGAL::Surface_mesh Mesh; +typedef boost::graph_traits::vertex_descriptor vertex_descriptor; +typedef boost::graph_traits::face_descriptor face_descriptor; + +namespace PMP = CGAL::Polygon_mesh_processing; + +int main() +{ + const std::string filename = "./data/slow_compute_normal.off"; + + Mesh mesh; + if(!PMP::IO::read_polygon_mesh(filename, mesh)) + { + std::cerr << "Invalid input." << std::endl; + return 1; + } + + CGAL::Timer t; + t.start(); + std::cout << "compute_vertex_normal" << std::endl; + PMP::compute_vertex_normal(vertex_descriptor(523), mesh); + std::cout << t.time() << " sec." << std::endl; + + return 0; +} diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_clip.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_clip.cpp index 5ffe16c9108..bf9f752144c 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_clip.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_clip.cpp @@ -555,6 +555,49 @@ void test() PMP::clip(tm1, K::Plane_3(0,0,-1,1), CGAL::parameters::use_compact_clipper(true).allow_self_intersections(true)); assert(vertices(tm1).size()==176); } + + // non-simply connected output faces + { + TriangleMesh tm1; + + CGAL::make_hexahedron(CGAL::Bbox_3(-3.5,-0.5,-0.5, -2.5,0.5,0.5), tm1); + PMP::reverse_face_orientations(tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(-4,-1,-1, -2,1,1), tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(-1,-1,-1, 1,1,1), tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(2,-1,-1, 4,1,1), tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(5,-1,-1, 7,1,1), tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(-1,2,-1, 1,4,1), tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(2,2,-1, 4,4,1), tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(5,2,-1, 7,4,1), tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(-1,5,-1, 1,7,1), tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(2,5,-1, 4,7,1), tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(5,5,-1, 7,7,1), tm1); + + PMP::clip(tm1, K::Plane_3(0,0,1,0), CGAL::parameters::do_not_triangulate_faces(true).clip_volume(true)); + + assert(vertices(tm1).size()==88); + assert(faces(tm1).size()==72); + } + { + TriangleMesh tm1; + + CGAL::make_hexahedron(CGAL::Bbox_3(-1,-1,-1, 1,1,1), tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(-3,-3,-3, 3,3,3), tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(-5,-5,-5, 5,5,5), tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(-7,-7,-7, 7,7,7), tm1); + PMP::reverse_face_orientations(tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(-0.5,-0.5,-0.5, 0.5,0.5,0.5), tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(-2,-2,-2, 2,2,2), tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(-4,-4,-4, 4,4,4), tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(-6,-6,-6, 6,6,6), tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(-8,-8,-8, 8,8,8), tm1); + + PMP::clip(tm1, K::Plane_3(0,0,1,0), CGAL::parameters::do_not_triangulate_faces(true).clip_volume(true)); + assert(vertices(tm1).size()==72); + assert(faces(tm1).size()==79); + } + + } template diff --git a/Polyhedron/doc/Polyhedron/CGAL/IO/Polyhedron_iostream.h b/Polyhedron/doc/Polyhedron/CGAL/IO/Polyhedron_iostream.h index 671dd6f49f8..45f33b220b5 100644 --- a/Polyhedron/doc/Polyhedron/CGAL/IO/Polyhedron_iostream.h +++ b/Polyhedron/doc/Polyhedron/CGAL/IO/Polyhedron_iostream.h @@ -34,13 +34,6 @@ polyhedral surface. template bool read_OFF( std::istream& in, CGAL::Polyhedron_3& P); -/*! -\deprecated This function is deprecated since \cgal 5.3, - \ref read_OFF(std::istream&, Polyhedron_3&) should be used instead. -*/ -template -bool read_off( std::istream& in, CGAL::Polyhedron_3& P); - } // namespace IO /*! @@ -79,12 +72,6 @@ This function overloads the generic function \link PkgBGLIoFuncsOFF `write_OFF(s template bool write_OFF( std::ostream& out, const CGAL::Polyhedron_3& P); -/*! -\deprecated This function is deprecated since \cgal 5.3, - \ref CGAL::IO::write_OFF(std::ostream&, const Polyhedron_3&) should be used instead. -*/ -template -bool write_off( std::ostream& out, const CGAL::Polyhedron_3& P); } // namespace IO diff --git a/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h b/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h index bda362a0d2d..45aabbbf1bc 100644 --- a/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h +++ b/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h @@ -21,6 +21,7 @@ #include #include #include +#include namespace CGAL { @@ -30,7 +31,7 @@ namespace CGAL { * @return A dart created during the conversion. */ template< class LCC, class Polyhedron > - typename LCC::Dart_descriptor import_from_polyhedron_3(LCC& alcc, + typename LCC::Dart_descriptor polyhedron_3_to_lcc(LCC& alcc, const Polyhedron &apoly) { static_assert( LCC::dimension>=2 && LCC::ambient_dimension==3 ); @@ -94,6 +95,21 @@ namespace CGAL { return firstAll; } +#ifndef CGAL_NO_DEPRECATED_CODE + +/*! + \deprecated This function is deprecated since CGAL 6.2. Use `polyhedron_3_to_lcc()` instead. +*/ +template< class LCC, class Polyhedron > +CGAL_DEPRECATED +typename LCC::Dart_descriptor +import_from_polyhedron_3(LCC& alcc, const Polyhedron &apoly) +{ + return polyhedron_3_to_lcc(alcc, apoly); +} + +#endif // CGAL_NO_DEPRECATED_CODE + /** Convert a Polyhedron_3 read into a flux into 3D linear cell complex. * @param alcc the linear cell complex where Polyhedron_3 will be converted. * @param ais the istream where read the Polyhedron_3. @@ -101,7 +117,7 @@ namespace CGAL { */ template < class LCC > typename LCC::Dart_descriptor - import_from_polyhedron_3_flux(LCC& alcc, std::istream& ais) + polyhedron_3_flux_to_lcc(LCC& alcc, std::istream& ais) { if (!ais.good()) { @@ -110,7 +126,7 @@ namespace CGAL { } CGAL::Polyhedron_3 P; ais >> P; - return import_from_polyhedron_3 > (alcc, P); } diff --git a/Surface_mesh/include/CGAL/Surface_mesh/IO.h b/Surface_mesh/include/CGAL/Surface_mesh/IO.h index 55d6bbd8be8..8e68678dbea 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/IO.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/IO.h @@ -22,34 +22,5 @@ #include -#include - -namespace CGAL { - -#ifndef CGAL_NO_DEPRECATED_CODE - -/*! - \ingroup PkgSurfaceMeshIOFuncDeprecated - \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_polygon_mesh()` should be used instead. -*/ -template -CGAL_DEPRECATED bool read_mesh(Surface_mesh& sm, const std::string& filename) -{ - return IO::read_polygon_mesh(filename, sm); -} - -/*! - \ingroup PkgSurfaceMeshIOFuncDeprecated - \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_polygon_mesh()` should be used instead. -*/ -template -CGAL_DEPRECATED bool write_mesh(const Surface_mesh& mesh, const std::string& filename) -{ - return IO::write_polygon_mesh(filename, mesh); -} - -#endif // CGAL_NO_DEPRECATED_CODE - -} // namespace CGAL #endif // CGAL_SURFACE_MESH_IO_H diff --git a/Surface_mesh/include/CGAL/Surface_mesh/IO/3MF.h b/Surface_mesh/include/CGAL/Surface_mesh/IO/3MF.h index 227d0c9ec06..dd39a118297 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/IO/3MF.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/IO/3MF.h @@ -137,20 +137,6 @@ bool read_3MF(const std::string& filename, } // namespace IO -#ifndef CGAL_NO_DEPRECATED_CODE - -/*! - \ingroup PkgSurfaceMeshIOFuncDeprecated - \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_3MF()` should be used instead. -*/ -template -CGAL_DEPRECATED int read_3mf(const std::string& filename, std::vector >& output) -{ - return IO::read_3MF(filename, output); -} - -#endif // CGAL_NO_DEPRECATED_CODE - } // namespace CGAL #endif // defined(CGAL_LINKED_WITH_3MF) || defined(DOXYGEN_RUNNING) diff --git a/Surface_mesh/include/CGAL/Surface_mesh/IO/OFF.h b/Surface_mesh/include/CGAL/Surface_mesh/IO/OFF.h index a186d98115a..d28361f08b3 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/IO/OFF.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/IO/OFF.h @@ -347,30 +347,6 @@ bool read_OFF(const std::string& fname, } // namespace IO -#ifndef CGAL_NO_DEPRECATED_CODE - -/*! - \ingroup PkgSurfaceMeshIOFuncDeprecated - \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_OFF(std::istream&, const Surface_mesh&)` should be used instead. -*/ -template -CGAL_DEPRECATED bool read_off(std::istream& is, Surface_mesh& sm, const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::read_OFF(is, sm, np); -} - -/*! - \ingroup PkgSurfaceMeshIOFuncDeprecated - \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_OFF(std::istream&, const Surface_mesh&)` should be used instead. -*/ -template -CGAL_DEPRECATED bool read_off(Surface_mesh& sm, const std::string& filename) -{ - return IO::read_OFF(filename, sm, parameters::default_values()); -} -#endif // CGAL_NO_DEPRECATED_CODE - -//////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// // Write @@ -549,30 +525,6 @@ bool write_OFF(std::ostream& os, } // namespace IO -#ifndef CGAL_NO_DEPRECATED_CODE - -/*! - \ingroup PkgSurfaceMeshIOFuncDeprecated - \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_OFF(std::ostream&, const Surface_mesh&)` should be used instead. -*/ -template -CGAL_DEPRECATED bool write_off(std::ostream& os, const Surface_mesh& sm, const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::write_OFF(os, sm, np); -} - -/*! - \ingroup PkgSurfaceMeshIOFuncDeprecated - \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_OFF(std::ostream&, const Surface_mesh&)` should be used instead. -*/ -template -CGAL_DEPRECATED bool write_off(const Surface_mesh& sm, const std::string& filename) -{ - return IO::write_OFF(filename, sm, parameters::default_values()); -} - -#endif // CGAL_NO_DEPRECATED_CODE - } // namespace CGAL #endif // CGAL_SURFACE_MESH_IO_OFF_H diff --git a/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h b/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h index 4c91236aada..0f0056a486a 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h @@ -169,10 +169,7 @@ public: const std::string& name = property->name(); if(name == "vertex1" || name == "vertex2") return true; -#ifndef CGAL_NO_DEPRECATED_CODE - if(name == "v0" || name == "v1") - return true; -#endif + return false; } @@ -888,21 +885,7 @@ bool read_PLY(std::istream& is, Surface_mesh

& sm) } // namespace IO -#ifndef CGAL_NO_DEPRECATED_CODE -/*! - \ingroup PkgSurfaceMeshIOFuncDeprecated - \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_PLY(std::ostream&, const Surface_mesh&)` should be used instead. -*/ -template -CGAL_DEPRECATED bool read_ply(std::istream& is, Surface_mesh

& sm, std::string& comments) -{ - return IO::read_PLY(is, sm, comments); -} - -#endif // CGAL_NO_DEPRECATED_CODE - -//////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// // Write @@ -1155,26 +1138,6 @@ bool write_PLY(std::ostream& os, const Surface_mesh

& sm, const CGAL_NP_CLASS& } // namespace IO -#ifndef CGAL_NO_DEPRECATED_CODE - -/*! - \ingroup PkgSurfaceMeshIOFuncDeprecated - \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_PLY(std::ostream&, const Surface_mesh&)` should be used instead. -*/ - -template -CGAL_DEPRECATED bool write_ply(std::ostream& os, const Surface_mesh

& sm, const std::string& comments) -{ - return IO::write_PLY(os, sm, comments); -} - -template -CGAL_DEPRECATED bool write_ply(std::ostream& os, const Surface_mesh

& sm) -{ - return write_PLY(os, sm, ""); -} -#endif // CGAL_NO_DEPRECATED_CODE - } // namespace CGAL #endif // CGAL_SURFACE_MESH_IO_PLY_H diff --git a/Surface_mesh/test/Surface_mesh/CMakeLists.txt b/Surface_mesh/test/Surface_mesh/CMakeLists.txt index 3b516fc15d0..eaf09a942f5 100644 --- a/Surface_mesh/test/Surface_mesh/CMakeLists.txt +++ b/Surface_mesh/test/Surface_mesh/CMakeLists.txt @@ -15,15 +15,3 @@ foreach(cppfile ${cppfiles}) create_single_source_cgal_program("${cppfile}") endforeach() -find_path(3MF_INCLUDE_DIR - NAMES Model/COM/NMR_DLLInterfaces.h - DOC "Path to lib3MF headers" - ) -find_library(3MF_LIBRARIES NAMES 3MF DOC "Path to the lib3MF library") -if(3MF_LIBRARIES AND 3MF_INCLUDE_DIR AND EXISTS "${3MF_INCLUDE_DIR}/Model/COM/NMR_DLLInterfaces.h") - include_directories(${3MF_INCLUDE_DIR}) - target_link_libraries(test_deprecated_io_sm PRIVATE ${3MF_LIBRARIES}) - target_compile_definitions(test_deprecated_io_sm PRIVATE -DCGAL_LINKED_WITH_3MF) -else() - message(STATUS "NOTICE: read_3mf requires the lib3MF library, and will not be tested.") -endif() diff --git a/Surface_mesh/test/Surface_mesh/test_deprecated_io_sm.cpp b/Surface_mesh/test/Surface_mesh/test_deprecated_io_sm.cpp deleted file mode 100644 index 32930445895..00000000000 --- a/Surface_mesh/test/Surface_mesh/test_deprecated_io_sm.cpp +++ /dev/null @@ -1,70 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -typedef CGAL::Simple_cartesian Kernel; -typedef Kernel::Point_3 Point_3; -typedef CGAL::Surface_mesh SM; - -int main() -{ - // OFF - SM sm_in, sm_out; - Point_3 p0(0,0,0), p1(1,0,0), p2(0,1,0); - CGAL::make_triangle(p0, p1, p2, sm_out); - bool ok = CGAL::write_off(sm_out, "tmp.off"); - assert(ok); - ok = CGAL::read_off(sm_in, "tmp.off"); - assert(ok); - assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1); - sm_in.clear(); - - std::ofstream os("tmp.off"); - ok = CGAL::write_off(os, sm_out); - assert(ok); - os.close(); - std::ifstream is("tmp.off"); - ok = CGAL::read_off(is, sm_in); - assert(ok); - assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1); - is.close(); - sm_in.clear(); - - //PLY - os.open("tmp.ply"); - std::string comments; - ok = CGAL::write_ply(os, sm_out, comments); - assert(ok); - os.close(); - is.open("tmp.ply"); - ok = CGAL::read_ply(is, sm_in, comments); - assert(ok); - assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1); - is.close(); - sm_in.clear(); - -#ifdef CGAL_LINKED_WITH_3MF - // 3mf - std::vector output_3mf; - ok = CGAL::read_3mf("test.3mf", output_3mf); - assert(ok); - assert(output_3mf.size() == 2); - sm_in.clear(); -#endif - - //others - ok = CGAL::write_mesh(sm_out, "tmp.off"); - assert(ok); - ok = CGAL::read_mesh(sm_in, "tmp.ply"); - assert(ok); - assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1); - sm_in.clear(); - return EXIT_SUCCESS; -} diff --git a/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_metric_test.cpp b/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_metric_test.cpp index 74e63634183..94f8dfcfd3f 100644 --- a/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_metric_test.cpp +++ b/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_metric_test.cpp @@ -102,7 +102,7 @@ int main() } // create compact metric approximation algorithm instance - std::cout << "create compact vas instance" << std::endl; + std::cout << "create compact vsa instance" << std::endl; Compact_metric_point_proxy error_metric(center_pmap, area_pmap); Compact_approx approx(mesh, vpmap, error_metric); diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_bounded_normal_change.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_bounded_normal_change.cpp index 04561d2239c..e4d0de6ed33 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_bounded_normal_change.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_bounded_normal_change.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include @@ -36,8 +37,8 @@ int main(int argc, char** argv) { Surface_mesh surface_mesh; const std::string filename = (argc > 1) ? argv[1] : CGAL::data_file_path("meshes/fold.off"); - std::ifstream is(filename); - if(!is || !(is >> surface_mesh)) + + if(!CGAL::IO::read_polygon_mesh(filename, surface_mesh)) { std::cerr << "Failed to read input mesh: " << filename << std::endl; return EXIT_FAILURE; diff --git a/Surface_mesh_simplification/include/CGAL/Cartesian/MatrixC33.h b/Surface_mesh_simplification/include/CGAL/Cartesian/MatrixC33.h index 3c24abbc3c2..a41c8e768ca 100644 --- a/Surface_mesh_simplification/include/CGAL/Cartesian/MatrixC33.h +++ b/Surface_mesh_simplification/include/CGAL/Cartesian/MatrixC33.h @@ -13,6 +13,8 @@ #include +#include + #include #include #include @@ -183,17 +185,19 @@ MatrixC33 cofactors_matrix(const MatrixC33& m) { typedef typename R::RT RT; - RT c00 = determinant(m.r1().y(),m.r1().z(),m.r2().y(),m.r2().z()); - RT c01 = -determinant(m.r1().x(),m.r1().z(),m.r2().x(),m.r2().z()); - RT c02 = determinant(m.r1().x(),m.r1().y(),m.r2().x(),m.r2().y()); + using ::CGAL::Surface_mesh_simplification::internal::diff_of_products; - RT c10 = -determinant(m.r0().y(),m.r0().z(),m.r2().y(),m.r2().z()); - RT c11 = determinant(m.r0().x(),m.r0().z(),m.r2().x(),m.r2().z()); - RT c12 = -determinant(m.r0().x(),m.r0().y(),m.r2().x(),m.r2().y()); + RT c00 = diff_of_products(m.r1().y(), m.r2().z(), m.r2().y(), m.r1().z()); + RT c01 = -diff_of_products(m.r1().x(), m.r2().z(), m.r2().x(), m.r1().z()); + RT c02 = diff_of_products(m.r1().x(), m.r2().y(), m.r2().x(), m.r1().y()); - RT c20 = determinant(m.r0().y(),m.r0().z(),m.r1().y(),m.r1().z()); - RT c21 = -determinant(m.r0().x(),m.r0().z(),m.r1().x(),m.r1().z()); - RT c22 = determinant(m.r0().x(),m.r0().y(),m.r1().x(),m.r1().y()); + RT c10 = -diff_of_products(m.r0().y(), m.r2().z(), m.r2().y(), m.r0().z()); + RT c11 = diff_of_products(m.r0().x(), m.r2().z(), m.r2().x(), m.r0().z()); + RT c12 = -diff_of_products(m.r0().x(), m.r2().y(), m.r2().x(), m.r0().y()); + + RT c20 = diff_of_products(m.r0().y(), m.r1().z(), m.r1().y(), m.r0().z()); + RT c21 = -diff_of_products(m.r0().x(), m.r1().z(), m.r1().x(), m.r0().z()); + RT c22 = diff_of_products(m.r0().x(), m.r1().y(), m.r1().x(), m.r0().y()); return MatrixC33(c00,c01,c02, c10,c11,c12, @@ -211,7 +215,9 @@ std::optional< MatrixC33 > inverse_matrix(const MatrixC33& m) { typedef typename R::RT RT; typedef MatrixC33 Matrix; - typedef std::optional result_type; + typedef std::optional result_type; + + using ::CGAL::Surface_mesh_simplification::internal::diff_of_products; result_type rInverse; @@ -219,17 +225,17 @@ std::optional< MatrixC33 > inverse_matrix(const MatrixC33& m) if(! CGAL_NTS is_zero(det)) { - RT c00 = (m.r1().y()*m.r2().z() - m.r1().z()*m.r2().y()) / det; - RT c01 = (m.r2().y()*m.r0().z() - m.r0().y()*m.r2().z()) / det; - RT c02 = (m.r0().y()*m.r1().z() - m.r1().y()*m.r0().z()) / det; + RT c00 = diff_of_products(m.r1().y(),m.r2().z(),m.r2().y(),m.r1().z()) / det; + RT c01 = diff_of_products(m.r2().y(),m.r0().z(),m.r0().y(),m.r2().z()) / det; + RT c02 = diff_of_products(m.r0().y(),m.r1().z(),m.r1().y(),m.r0().z()) / det; - RT c10 = (m.r1().z()*m.r2().x() - m.r1().x()*m.r2().z()) / det; - RT c11 = (m.r0().x()*m.r2().z() - m.r2().x()*m.r0().z()) / det; - RT c12 = (m.r1().x()*m.r0().z() - m.r0().x()*m.r1().z()) / det; + RT c10 = diff_of_products(m.r2().x(),m.r1().z(),m.r1().x(),m.r2().z()) / det; + RT c11 = diff_of_products(m.r0().x(),m.r2().z(),m.r2().x(),m.r0().z()) / det; + RT c12 = diff_of_products(m.r1().x(),m.r0().z(),m.r0().x(),m.r1().z()) / det; - RT c20 = (m.r1().x()*m.r2().y() - m.r2().x()*m.r1().y()) / det; - RT c21 = (m.r2().x()*m.r0().y() - m.r0().x()*m.r2().y()) / det; - RT c22 = (m.r0().x()*m.r1().y() - m.r0().y()*m.r1().x()) / det; + RT c20 = diff_of_products(m.r1().x(),m.r2().y(),m.r2().x(),m.r1().y()) / det; + RT c21 = diff_of_products(m.r2().x(),m.r0().y(),m.r0().x(),m.r2().y()) / det; + RT c22 = diff_of_products(m.r0().x(),m.r1().y(),m.r1().x(),m.r0().y()) / det; rInverse = result_type(Matrix(c00,c01,c02, c10,c11,c12, diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h index 1d20c428152..83589a60d51 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h @@ -18,6 +18,7 @@ #include #include +#include #include #include @@ -101,6 +102,8 @@ private : void extract_triangle_data(); void extract_boundary_data(); + double maxBb; + void add_boundary_preservation_constraints(const Boundary_data_vector& aBdry); void add_volume_preservation_constraints(const Triangle_data_vector& triangles); void add_boundary_and_volume_optimization_constraints(const Boundary_data_vector& aBdry, @@ -119,42 +122,6 @@ private : const Geom_traits& geom_traits() const { return mProfile.geom_traits(); } const TM& surface() const { return mProfile.surface(); } -#if 0 - // a*b - c*d - // The next two functions are from https://stackoverflow.com/questions/63665010/accurate-floating-point-computation-of-the-sum-and-difference-of-two-products - static double diff_of_products_kahan(const double a, const double b, const double c, const double d) - { - double w = d * c; - double e = std::fma(c, -d, w); - double f = std::fma(a, b, -w); - return f + e; - } - - static double diff_of_products_cht(const double a, const double b, const double c, const double d) - { - double p1 = a * b; - double p2 = c * d; - double e1 = std::fma (a, b, -p1); - double e2 = std::fma (c, -d, p2); - double r = p1 - p2; - double e = e1 + e2; - return r + e; - } - - static double diff_of_products(const double a, const double b, const double c, const double d) - { - // the next two are equivalent in results and speed - return diff_of_products_kahan(a, b, c, d); - // return diff_of_products_cht(a, b, c, d); - } - - template - static OFT diff_of_products(const OFT& a, const OFT& b, const OFT& c, const OFT& d) - { - return a*b - c*d; - } -#endif - #ifdef __AVX__ static Vector SL_cross_product_avx(const Vector& A, const Vector& B) { @@ -185,67 +152,10 @@ private : } #endif - static Vector SL_cross_product(const Vector& a, const Vector& b) - { - const FT ax=a.x(), ay=a.y(), az=a.z(); - const FT bx=b.x(), by=b.y(), bz=b.z(); - - auto compute_minor = [](double ai, double bi, double aj, double bj) - { - // The main idea is that we expect ai and bi (and aj and bj) to have roughly the same magnitude - // since this function is used to compute the cross product of two vectors that are defined - // as (ORIGIN, pa) and (ORIGIN, pb) and pa and pb are part of the same triangle. - // - // We can abuse this fact to trade 2 extra subtractions to lower the error. - return ai * (bj - aj) + aj * (ai - bi); - }; - - // ay* - FT x = compute_minor(ay, by, az, bz); - FT y = compute_minor(az, bz, ax, bx); - FT z = compute_minor(ax, bx, ay, by); - - return Vector(x, y, z); - } - -#if 0 - static Vector exact_cross_product(const Vector& a, const Vector& b) - { - CGAL::Cartesian_converter to_exact; - CGAL::Cartesian_converter to_approx; - auto exv = cross_product(to_exact(a), to_exact(b)); - exv.exact(); - return to_approx(exv); - } -#endif - - static Vector X_product(const Vector& u, const Vector& v) - { -#if 0 - // this can create large errors and spiky meshes for kernels with inexact constructions - return CGAL::cross_product(u,v); -#elif 0 - // improves the problem mentioned above a bit, but not enough - return { std::fma(u.y(), v.z(), -u.z()*v.y()), - std::fma(u.z(), v.x(), -u.x()*v.z()), - std::fma(u.x(), v.y(), -u.y()*v.x()) }; -#elif 0 - // this is the best without resorting to exact, but it inflicts a 20% slowdown - return { diff_of_products(u.y(), v.z(), u.z(), v.y()), - diff_of_products(u.z(), v.x(), u.x(), v.z()), - diff_of_products(u.x(), v.y(), u.y(), v.x()) }; -#elif 1 - // balanced solution based on abusing the fact that here we expect u and v to have similar coordinates - return SL_cross_product(u, v); -#elif 0 - // obviously too slow - return exact_cross_product(u, v); -#endif - } static Vector point_cross_product(const Point& a, const Point& b) { - return X_product(a-ORIGIN, b-ORIGIN); + return robust_cross_product(a-ORIGIN, b-ORIGIN); } // This is the (uX)(Xu) product described in the Lindstrom-Turk paper @@ -352,17 +262,21 @@ LindstromTurkCore:: extract_triangle_data() { mTriangle_data.reserve(mProfile.triangles().size()); - + maxBb = 0.0; for(const Triangle& tri : mProfile.triangles()) { const Point_reference p0 = get_point(tri.v0); const Point_reference p1 = get_point(tri.v1); const Point_reference p2 = get_point(tri.v2); + maxBb=(std::max)({maxBb,CGAL::abs(p0.x()),CGAL::abs(p0.y()),CGAL::abs(p0.z()), + CGAL::abs(p1.x()),CGAL::abs(p1.y()),CGAL::abs(p1.z()), + CGAL::abs(p2.x()),CGAL::abs(p2.y()),CGAL::abs(p2.z())}); + Vector v01 = p1 - p0; Vector v02 = p2 - p0; - Vector lNormalV = cross_product(v01,v02); + Vector lNormalV = robust_cross_product(v01,v02); FT lNormalL = point_cross_product(p0,p1) * (p2 - ORIGIN); CGAL_SMS_LT_TRACE(1, " Extracting triangle v" << tri.v0 << "->v" << tri.v1 << "->v" << tri.v2 @@ -370,6 +284,7 @@ extract_triangle_data() mTriangle_data.push_back(Triangle_data(lNormalV,lNormalL)); } + maxBb *= 2.0; // to avoid numerical problems } template @@ -394,11 +309,12 @@ compute_placement() // A1 * v = b1 // A2 * v = b2 // - // Which in matrix form is : A * v = b + // Which in matrix form is: A * v = b // // (with 'A' a 3x3 matrix and 'b' a vector) // - // The member variable mConstrinas contains A and b. Indidivual constraints (Ai,bi) can be added to it. + // The member variables mConstraints_A and mConstraints_b contain A and b. + // Indidivual constraints (Ai,bi) can be added to it. // Once 3 such constraints have been added 'v' is directly solved a: // // v = b*inverse(A) @@ -421,7 +337,7 @@ compute_placement() // In that case there is simply no good vertex placement if(mConstraints_n == 3) { - // If the matrix is singular it's inverse cannot be computed so an 'absent' value is returned. + // If the matrix is singular its inverse cannot be computed so an 'absent' value is returned. std::optional lOptional_Ai = inverse_matrix(mConstraints_A); if(lOptional_Ai) { @@ -686,7 +602,10 @@ add_constraint_if_alpha_compatible(const Vector& Ai, FT l = CGAL_NTS sqrt(slai); CGAL_SMS_LT_TRACE(3, " l: " << n_to_string(l)); - if(!CGAL_NTS is_zero(l)) + // Due to double number type, l may have a small value instead of zero (example sum of the face normals of a tetrahedron for volume constraint) + // if bi is greater than maxBb, we consider that l is zero + CGAL_SMS_LT_TRACE(3, " error consider: " << (CGAL::abs(bi) / maxBb)); + if(l > (CGAL::abs(bi) / maxBb)) { Vector Ain = Ai / l; FT bin = bi / l; @@ -861,6 +780,7 @@ add_constraint_from_gradient(const Matrix& H, } break; } + } } // namespace internal diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Common.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Common.h index 2d3158a7095..2cce78e52b3 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Common.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Common.h @@ -114,8 +114,9 @@ inline std::string optional_to_string(const std::optional& o) { namespace internal { namespace { bool cgal_enable_sms_trace = true; } } #define CGAL_SMS_TRACE_IMPL(m) \ if(::internal::cgal_enable_sms_trace) { \ - std::ostringstream ss; ss << m; std::string s = ss.str(); \ - /*Surface_simplification_external_trace(s)*/ std::cerr << s << std::endl; \ + std::ostringstream ss; ss << m; \ + std::string s = ss.str(); \ + Surface_simplification_external_trace(s); \ } #define CGAL_SMS_DEBUG_CODE(code) code diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Edge_collapse.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Edge_collapse.h index d53b3458d15..2335bb5a843 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Edge_collapse.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Edge_collapse.h @@ -296,6 +296,8 @@ private: void insert_in_PQ(const halfedge_descriptor h, Edge_data& data) { + CGAL_SMS_TRACE(5, "Insert " << edge_to_string(h) << " in PQ"); + CGAL_assertion(is_primary_edge(h)); CGAL_expensive_assertion(!data.is_in_PQ()); CGAL_expensive_assertion(!mPQ->contains(h)); @@ -594,12 +596,33 @@ loop() std::optional opt_h; +// #define CGAL_SURF_SIMPL_INTERMEDIATE_STEPS_PRINTING #ifdef CGAL_SURF_SIMPL_INTERMEDIATE_STEPS_PRINTING int i_rm = 0; #endif - while((opt_h = pop_from_PQ())) + for(;;) { +#ifdef CGAL_SURFACE_SIMPLIFICATION_ENABLE_TRACE + if(5 <= CGAL_SURFACE_SIMPLIFICATION_ENABLE_TRACE) + { + CGAL_SMS_TRACE_IMPL("== Current queue =="); + + auto mPQ_clone = *mPQ; + std::optional opt_th; + while((opt_th = mPQ_clone.extract_top())) + { + CGAL_SMS_TRACE_IMPL("\t" + edge_to_string(*opt_th)); + Cost_type tcost = get_data(*opt_th).cost(); + if(tcost) + CGAL_SMS_TRACE_IMPL("\t" + std::to_string(CGAL::to_double(*tcost))); + } + } +#endif + + if(!(opt_h = pop_from_PQ())) + break; + CGAL_SMS_TRACE(1, "Popped " << edge_to_string(*opt_h)); CGAL_assertion(!is_constrained(*opt_h)); @@ -639,7 +662,7 @@ loop() m_visitor.OnNonCollapsable(profile); - CGAL_SMS_TRACE(1, edge_to_string(*opt_h) << " NOT Collapsible" ); + CGAL_SMS_TRACE(1, edge_to_string(*opt_h) << " NOT Collapsible (filter)" ); } #ifdef CGAL_SURF_SIMPL_INTERMEDIATE_STEPS_PRINTING @@ -660,7 +683,7 @@ loop() m_visitor.OnNonCollapsable(profile); - CGAL_SMS_TRACE(1, edge_to_string(*opt_h) << " NOT Collapsible" ); + CGAL_SMS_TRACE(1, edge_to_string(*opt_h) << " NOT Collapsible (topology)" ); } } else @@ -823,7 +846,10 @@ is_collapse_topologically_valid(const Profile& profile) { /// ensure two constrained edges cannot get merged if(is_edge_adjacent_to_a_constrained_edge(profile, m_ecm)) + { + CGAL_SMS_TRACE(3," edge to collapse is adjacent to a constrained edge."); return false; + } if(profile.is_v0_v1_a_border()) { diff --git a/Surface_mesh_simplification/include/CGAL/internal/robust_cross_product.h b/Surface_mesh_simplification/include/CGAL/internal/robust_cross_product.h new file mode 100644 index 00000000000..e8e2caf095f --- /dev/null +++ b/Surface_mesh_simplification/include/CGAL/internal/robust_cross_product.h @@ -0,0 +1,143 @@ +// Copyright (c) 2025 GeometryFactory (France). All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Mael Rouxel-Labbé +// +#ifndef CGAL_SMS_INTERNAL_ROBUST_CROSS_PRODUCT_H +#define CGAL_SMS_INTERNAL_ROBUST_CROSS_PRODUCT_H + +#include + +#include + +#include + +namespace CGAL { +namespace Surface_mesh_simplification { +namespace internal { + +// a*b - c*d +// The next two functions are from https://stackoverflow.com/questions/63665010/accurate-floating-point-computation-of-the-sum-and-difference-of-two-products +inline double diff_of_products_kahan(const double a, const double b, const double c, const double d) +{ + double w = d * c; + double e = std::fma(c, -d, w); + double f = std::fma(a, b, -w); + return f + e; +} + +inline double diff_of_products_cht(const double a, const double b, const double c, const double d) +{ + double p1 = a * b; + double p2 = c * d; + double e1 = std::fma (a, b, -p1); + double e2 = std::fma (c, -d, p2); + double r = p1 - p2; + double e = e1 + e2; + return r + e; +} + +inline double diff_of_products(const double a, const double b, const double c, const double d) +{ +#if 0 + // this can create large errors with inexact constructions + return a*b - c*d; + // the next two are equivalent in results and speed +#elif 1 + return diff_of_products_kahan(a, b, c, d); +#elif 0 + return diff_of_products_cht(a, b, c, d); +#endif +} + +template +inline OFT diff_of_products(const OFT& a, const OFT& b, const OFT& c, const OFT& d) +{ + return a*b - c*d; +} + +// balanced solution based on abusing the fact that here we expect u and v to have similar coordinates +template +typename GeomTraits::Vector_3 similar_coordinates_cross_product(const typename GeomTraits::Vector_3& u, + const typename GeomTraits::Vector_3& v) +{ + using FT = typename GeomTraits::FT; + using Vector = typename GeomTraits::Vector_3; + + const FT& ux = u.x(); + const FT& uy = u.y(); + const FT& uz = u.z(); + const FT& vx = v.x(); + const FT& vy = v.y(); + const FT& vz = v.z(); + + auto minor = [](const FT& ui, const FT& vi, const FT& uj, const FT& vj) + { + // The main idea is that we expect ai and bi (and aj and bj) to have roughly the same magnitude + // since this function is used to compute the cross product of two vectors that are defined + // as (ORIGIN, pa) and (ORIGIN, pb) and pa and pb are part of the same triangle. + // + // We can abuse this fact to trade 2 extra subtractions to lower the error. + return ui * (vj - uj) + uj * (ui - vi); + }; + + // ay* + FT x = minor(uy, vy, uz, vz); + FT y = minor(uz, vz, ux, vx); + FT z = minor(ux, vx, uy, vy); + + return Vector(x, y, z); +} + +#if 0 +template +typename GeomTraits::Vector_3 exact_cross_product(const typename GeomTraits::Vector_3& a, + const typename GeomTraits::Vector_3& b) +{ + CGAL::Cartesian_converter to_exact; + CGAL::Cartesian_converter to_approx; + auto exv = cross_product(to_exact(a), to_exact(b)); + exv.exact(); + return to_approx(exv); +} +#endif + +template +typename GeomTraits::Vector_3 robust_cross_product(const typename GeomTraits::Vector_3& u, + const typename GeomTraits::Vector_3& v) +{ +#if 0 + // this can create large errors and spiky meshes for kernels with inexact constructions + return CGAL::cross_product(u,v); +#elif 0 + // improves the problem mentioned above a bit, but not enough + return { std::fma(u.y(), v.z(), -u.z()*v.y()), + std::fma(u.z(), v.x(), -u.x()*v.z()), + std::fma(u.x(), v.y(), -u.y()*v.x()) }; +#elif 0 + // this is the best without resorting to exact, but it inflicts a 20% slowdown + return { diff_of_products(u.y(), v.z(), u.z(), v.y()), + diff_of_products(u.z(), v.x(), u.x(), v.z()), + diff_of_products(u.x(), v.y(), u.y(), v.x()) }; +#elif 0 + // obviously too slow + return exact_cross_product(u, v); +#elif 1 + // balanced solution based on abusing the fact that in this package, we usually have that + // u and v to have similar coordinates + return similar_coordinates_cross_product(u, v); +#endif +} + +} // namespace CGAL +} // namespace Surface_mesh_simplification +} // namespace internal + +#endif // CGAL_SMS_INTERNAL_ROBUST_CROSS_PRODUCT_H + + diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/CMakeLists.txt b/Surface_mesh_simplification/test/Surface_mesh_simplification/CMakeLists.txt index 5453440119b..75e178c4fd9 100644 --- a/Surface_mesh_simplification/test/Surface_mesh_simplification/CMakeLists.txt +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/CMakeLists.txt @@ -6,6 +6,7 @@ project(Surface_mesh_simplification_Tests) find_package(CGAL REQUIRED) +create_single_source_cgal_program("issue_8213.cpp") create_single_source_cgal_program("edge_collapse_topology.cpp") create_single_source_cgal_program("test_edge_collapse_bounded_distance.cpp") create_single_source_cgal_program("test_edge_collapse_Envelope.cpp") diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/data/issue_8213.off b/Surface_mesh_simplification/test/Surface_mesh_simplification/data/issue_8213.off new file mode 100644 index 00000000000..14e2cf1fbe3 --- /dev/null +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/data/issue_8213.off @@ -0,0 +1,13 @@ +OFF +5 4 0 + +0.60153250345565623 3.2925554343503594 -0.93390733763467004 +0.50125687092531912 3.266008536541555 -0.80580753798383942 +0.57499779785916183 3.2558452065056969 -0.97860403852322797 +0.56586410588624558 3.2541065339825863 -0.99341202997519495 +0.56756366821062887 3.2478315549358072 -0.99100621040927039 + +3 0 1 2 +3 1 3 2 +3 1 0 3 +3 0 4 3 diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/issue_8213.cpp b/Surface_mesh_simplification/test/Surface_mesh_simplification/issue_8213.cpp new file mode 100644 index 00000000000..2e9811ca6ee --- /dev/null +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/issue_8213.cpp @@ -0,0 +1,75 @@ +#include +#include + +#include + +#define CGAL_CHECK_EXPENSIVE + +#define CGAL_SURFACE_SIMPLIFICATION_ENABLE_TRACE 5 +#define CGAL_SURFACE_SIMPLIFICATION_ENABLE_LT_TRACE 4 + +void Surface_simplification_external_trace(const std::string& s) +{ + std::cout << s << std::endl; +} + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +namespace SMS = CGAL::Surface_mesh_simplification; +namespace PMP = CGAL::Polygon_mesh_processing; + +using Kernel = CGAL::Simple_cartesian; +// using Kernel = CGAL::Exact_predicates_exact_constructions_kernel; + +using Surface_mesh = CGAL::Surface_mesh; + +int main(int argc, char** argv) +{ + std::cout.precision(17); + std::cerr.precision(17); + + const char* filename = (argc > 1) ? argv[1] : "data/issue_8213.off"; + + Surface_mesh sm; + + if(!CGAL::IO::read_polygon_mesh(filename, sm)) + { + std::cerr << "Error: failed to read input data" << std::endl; + return EXIT_FAILURE; + } + + CGAL::Bbox_3 bb = PMP::bbox(sm); + std::cout << "Bbox:" << bb << std::endl; + std::cout << "Input mesh has " << num_vertices(sm) << " vertices" << std::endl; + std::cout << "Input mesh has " << num_faces(sm) << " faces" << std::endl; + + SMS::Face_count_stop_predicate stop(1); + SMS::edge_collapse(sm, stop, + CGAL::parameters::get_cost(SMS::LindstromTurk_cost()) + .get_placement(SMS::LindstromTurk_placement())); + + CGAL::IO::write_OFF(std::cout, sm, CGAL::parameters::stream_precision(17)); + + for(auto v : vertices(sm)) + { + // To be within the bounding box isn't a guarantee, but here it is a sufficient test + // to check if things went awry + if(!CGAL::do_overlap(bb, sm.point(v).bbox())) + { + std::cerr << "Error: " << sm.point(v) << " is outside the initial bbox" << std::endl; + return EXIT_FAILURE; + } + } + + return EXIT_SUCCESS; +} diff --git a/TDS_3/doc/TDS_3/Concepts/TriangulationDataStructure_3.h b/TDS_3/doc/TDS_3/Concepts/TriangulationDataStructure_3.h index 03e4ad24928..752093512af 100644 --- a/TDS_3/doc/TDS_3/Concepts/TriangulationDataStructure_3.h +++ b/TDS_3/doc/TDS_3/Concepts/TriangulationDataStructure_3.h @@ -960,7 +960,7 @@ OutputIterator adjacent_vertices(Vertex_handle v, OutputIterator vertices) const; /*! -Returns the degree of a vertex, that is, the number of incident vertices. +Returns the degree of `v`, that is, the number of incident vertices. \pre `v` \f$ \neq\f$ `Vertex_handle()`, `tds.is_vertex(v)`. */ size_type degree(Vertex_handle v) const; diff --git a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h index fd9981c1426..cf73ab88891 100644 --- a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h +++ b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h @@ -91,6 +91,13 @@ private: std::vector m_free_vertices{}; bool m_flip_smooth_steps{false}; + struct Move + { + Vector_3 move; + int neighbors; + FT mass; + }; + public: Tetrahedral_remeshing_smoother(const SizingFunction& sizing, const CellSelector& cell_selector, @@ -627,8 +634,8 @@ private: const C3t3& c3t3, const bool boundary_edge = false) const { - const auto mwi = midpoint_with_info(e, boundary_edge, c3t3); - const FT s = sizing_at_midpoint(e, mwi.dim, mwi.index, m_sizing, c3t3, m_cell_selector); + const auto [pt, dim, index] = midpoint_with_info(e, boundary_edge, c3t3); + const FT s = sizing_at_midpoint(e, pt, dim, index, m_sizing, c3t3, m_cell_selector); const FT density = 1. / s; //density = 1 / size^(dimension) //edge dimension is 1, so density = 1 / size //to have mass = length * density with no dimension @@ -655,9 +662,8 @@ private: auto& tr = c3t3.triangulation(); const std::size_t nbv = tr.number_of_vertices(); - std::vector moves(nbv, CGAL::NULL_VECTOR); - std::vector neighbors(nbv, 0); - std::vector masses(nbv, 0.); + const Move default_move{CGAL::NULL_VECTOR, 0 /*neighbors*/, 0. /*mass*/}; + std::vector moves(nbv, default_move); //collect neighbors for (const Edge& e : c3t3.edges_in_complex()) @@ -683,33 +689,35 @@ private: if (vh0_moving) { - moves[i0] += density * Vector_3(p0, p1); - neighbors[i0]++; - masses[i0] += density; + moves[i0].move += density * Vector_3(p0, p1); + moves[i0].mass += density; + ++moves[i0].neighbors; } if (vh1_moving) { - moves[i1] += density * Vector_3(p1, p0); - neighbors[i1]++; - masses[i1] += density; + moves[i1].move += density * Vector_3(p1, p0); + moves[i1].mass += density; + ++moves[i1].neighbors; } } - // iterate over map of - for (auto [v, vid] : m_vertex_id) + // iterate over vertices and move + for(Vertex_handle v : tr.finite_vertex_handles()) { + const std::size_t vid = vertex_id(v); + if (!is_free(vid) || !is_on_feature(v)) continue; const Point_3 current_pos = point(v->point()); - const std::size_t nb_neighbors = neighbors[vid]; + const std::size_t nb_neighbors = moves[vid].neighbors; if(nb_neighbors == 0) continue; - CGAL_assertion(masses[vid] > 0); + CGAL_assertion(moves[vid].mass > 0); const Vector_3 move = (nb_neighbors > 0) - ? moves[vid] / masses[vid] + ? moves[vid].move / moves[vid].mass : CGAL::NULL_VECTOR; const Point_3 smoothed_position = current_pos + move; @@ -771,9 +779,8 @@ std::size_t smooth_vertices_on_surfaces(C3t3& c3t3, auto& tr = c3t3.triangulation(); const std::size_t nbv = tr.number_of_vertices(); - std::vector moves(nbv, CGAL::NULL_VECTOR); - std::vector neighbors(nbv, 0); - std::vector masses(nbv, 0.); + const Move default_move{CGAL::NULL_VECTOR, 0 /*neighbors*/, 0. /*mass*/}; + std::vector moves(nbv, default_move); for (const Edge& e : tr.finite_edges()) { @@ -797,26 +804,28 @@ std::size_t smooth_vertices_on_surfaces(C3t3& c3t3, if (vh0_moving) { - moves[i0] += density * Vector_3(p0, p1); - neighbors[i0]++; - masses[i0] += density; + moves[i0].move += density * Vector_3(p0, p1); + moves[i0].mass += density; + ++moves[i0].neighbors; } if (vh1_moving) { - moves[i1] += density * Vector_3(p1, p0); - neighbors[i1]++; - masses[i1] += density; + moves[i1].move += density * Vector_3(p1, p0); + moves[i1].mass += density; + ++moves[i1].neighbors; } } } - // iterate over map of - for (auto [v, vid] : m_vertex_id) + // iterate over vertices and move + for(Vertex_handle v : tr.finite_vertex_handles()) { + const std::size_t vid = vertex_id(v); + if (!is_free(vid) || v->in_dimension() != 2) continue; - const std::size_t nb_neighbors = neighbors[vid]; + const std::size_t nb_neighbors = moves[vid].neighbors; const Point_3 current_pos = point(v->point()); const auto& incident_surface_patches = vertices_surface_indices.at(v); @@ -830,7 +839,7 @@ std::size_t smooth_vertices_on_surfaces(C3t3& c3t3, if (nb_neighbors > 1) { - const Vector_3 move = moves[vid] / masses[vid]; + const Vector_3 move = moves[vid].move / moves[vid].mass; const Point_3 smoothed_position = point(v->point()) + move; #ifdef CGAL_TET_REMESHING_SMOOTHING_WITH_MLS @@ -969,9 +978,9 @@ std::size_t smooth_internal_vertices(C3t3& c3t3, auto& tr = c3t3.triangulation(); const std::size_t nbv = tr.number_of_vertices(); - std::vector moves(nbv, CGAL::NULL_VECTOR); - std::vector neighbors(nbv, 0);/*for dim 3 vertices, start counting directly from 0*/ - std::vector masses(nbv, 0.); + const Move default_move{CGAL::NULL_VECTOR, 0 /*neighbors*/, 0. /*mass*/}; + std::vector moves(nbv, default_move); + /*for dim 3 vertices, start counting neighbors directly from 0*/ for (const Edge& e : tr.finite_edges()) { @@ -979,8 +988,7 @@ std::size_t smooth_internal_vertices(C3t3& c3t3, continue; else { - const Vertex_handle vh0 = e.first->vertex(e.second); - const Vertex_handle vh1 = e.first->vertex(e.third); + const auto [vh0, vh1] = make_vertex_pair(e); const std::size_t& i0 = vertex_id(vh0); const std::size_t& i1 = vertex_id(vh1); @@ -997,31 +1005,32 @@ std::size_t smooth_internal_vertices(C3t3& c3t3, if (vh0_moving) { - moves[i0] += density * Vector_3(p0, p1); - neighbors[i0]++; - masses[i0] += density; + moves[i0].move += density * Vector_3(p0, p1); + moves[i0].mass += density; + ++moves[i0].neighbors; } if (vh1_moving) { - moves[i1] += density * Vector_3(p1, p0); - neighbors[i1]++; - masses[i1] += density; + moves[i1].move += density * Vector_3(p1, p0); + moves[i1].mass += density; + ++moves[i1].neighbors; } } } - // iterate over map of - for (auto [v, vid] : m_vertex_id) + // iterate over vertices and move + for(Vertex_handle v : tr.finite_vertex_handles()) { + const std::size_t vid = vertex_id(v); if (!is_free(vid)) continue; - if (c3t3.in_dimension(v) == 3 && neighbors[vid] > 1) + if (c3t3.in_dimension(v) == 3 && moves[vid].neighbors > 1) { #ifdef CGAL_TETRAHEDRAL_REMESHING_DEBUG os_vol << "2 " << point(v->point()); #endif - const Vector_3 move = moves[vid] / masses[vid];// static_cast(neighbors[vid]); + const Vector_3 move = moves[vid].move / moves[vid].mass;// static_cast(neighbors[vid]); Point_3 new_pos = point(v->point()) + move; if (check_inversion_and_move(v, new_pos, inc_cells[vid], tr, total_move)){ nb_done_3d++; diff --git a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/tetrahedral_remeshing_helpers.h b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/tetrahedral_remeshing_helpers.h index c667cfe9d12..2c3cfe46cd4 100644 --- a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/tetrahedral_remeshing_helpers.h +++ b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/tetrahedral_remeshing_helpers.h @@ -1439,6 +1439,7 @@ auto sizing_at_vertex(const Vertex_handle v, template auto sizing_at_midpoint(const typename C3t3::Edge& e, + const typename C3t3::Triangulation::Geom_traits::Point_3& m, // edge midpoint const int dim, const typename C3t3::Index& index, const Sizing& sizing, @@ -1446,17 +1447,13 @@ auto sizing_at_midpoint(const typename C3t3::Edge& e, const Cell_selector& cell_selector) { using FT = typename C3t3::Triangulation::Geom_traits::FT; - using Point_3 = typename C3t3::Triangulation::Geom_traits::Point_3; - auto cp = c3t3.triangulation().geom_traits().construct_point_3_object(); - const Point_3 m = CGAL::midpoint(cp(e.first->vertex(e.second)->point()), - cp(e.first->vertex(e.third)->point())); + const FT size = sizing(m, dim, index); if (dim < 3 && size == 0) { - const auto u = e.first->vertex(e.second); - const auto v = e.first->vertex(e.third); + const auto [u, v] = make_vertex_pair(e); const FT size_at_u = sizing(cp(u->point()), u->in_dimension(), u->index()); const FT size_at_v = sizing(cp(v->point()), v->in_dimension(), v->index()); @@ -1572,7 +1569,6 @@ auto midpoint_with_info(const typename C3t3::Edge& e, const C3t3& c3t3) { using Tr = typename C3t3::Triangulation; - using Vertex_handle = typename Tr::Vertex_handle; using Gt = typename Tr::Geom_traits; using Point_3 = typename Gt::Point_3; using Index = typename C3t3::Index; @@ -1584,9 +1580,7 @@ auto midpoint_with_info(const typename C3t3::Edge& e, Index index; }; - const auto vs = c3t3.triangulation().vertices(e); - const Vertex_handle u = vs[0]; - const Vertex_handle v = vs[1]; + const auto [u, v] = make_vertex_pair(e); const auto& gt = c3t3.triangulation().geom_traits(); auto cp = gt.construct_point_3_object(); diff --git a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/CMakeLists.txt b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/CMakeLists.txt index 63bc0c06023..3747ae19125 100644 --- a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/CMakeLists.txt +++ b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/CMakeLists.txt @@ -16,6 +16,7 @@ create_single_source_cgal_program("test_tetrahedral_remeshing_with_features.cpp" create_single_source_cgal_program("test_tetrahedral_remeshing_of_one_subdomain.cpp") create_single_source_cgal_program("test_tetrahedral_remeshing_io.cpp") create_single_source_cgal_program("test_tetrahedral_remeshing_from_mesh_file.cpp") +create_single_source_cgal_program("test_tetrahedral_remeshing_determinism.cpp") # Test MLS projection add_executable(test_tetrahedral_remeshing_mls diff --git a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_determinism.cpp b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_determinism.cpp new file mode 100644 index 00000000000..7bf3bc26a7f --- /dev/null +++ b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_determinism.cpp @@ -0,0 +1,104 @@ +//#define CGAL_TETRAHEDRAL_REMESHING_VERBOSE +//#define CGAL_TETRAHEDRAL_REMESHING_DEBUG + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; + +typedef CGAL::Tetrahedral_remeshing::Remeshing_triangulation_3 Remeshing_triangulation; + +template +void generate_input_one_subdomain(const std::size_t nbv, T3& tr) +{ + CGAL::Random rng; + + typedef typename T3::Point Point; + std::vector pts; + while (pts.size() < nbv) + { + const float x = rng.uniform_real(-10.f, 10.f); + const float y = rng.uniform_real(-10.f, 10.f); + const float z = rng.uniform_real(-10.f, 10.f); + + pts.push_back(Point(x, y, z)); + } + tr.insert(pts.begin(), pts.end()); + + for (typename T3::Cell_handle c : tr.finite_cell_handles()) + c->set_subdomain_index(1); + + assert(tr.is_valid(true)); + +#ifdef CGAL_TETRAHEDRAL_REMESHING_GENERATE_INPUT_FILES + std::ofstream out("data/triangulation_one_subdomain.binary.cgal", + std::ios_base::out | std::ios_base::binary); + CGAL::save_binary_triangulation(out, tr); + out.close(); +#endif +} + +int main(int argc, char* argv[]) +{ + std::cout << "CGAL Random seed = " << CGAL::get_default_random().get_seed() << std::endl; + + // Collect options + std::size_t nb_runs = 5; + + Remeshing_triangulation tr; + generate_input_one_subdomain(1000, tr); + + const int target_edge_length = (argc > 1) ? atoi(argv[1]) : 1; + + std::ofstream ofs0("in.mesh"); + CGAL::IO::write_MEDIT(ofs0, tr); + ofs0.close(); + + const Remeshing_triangulation tr_ref = tr; // Keep a reference for comparison + + std::vector output_tr; + output_tr.reserve(nb_runs); + + for(std::size_t i = 0; i < nb_runs; ++i) + { + std::cout << "Run " << i << " of " << nb_runs << std::endl; + + tr = tr_ref; // Reset triangulation to reference + CGAL::tetrahedral_isotropic_remeshing(tr, target_edge_length); + + std::ostringstream oss; + CGAL::IO::write_MEDIT(oss, tr); + output_tr.push_back(oss.str()); + oss.clear(); + + if(i == 0) + continue; // skip first run, it is the reference + else + { + if(0 != output_tr[i-1].compare(output_tr[i])) + { + std::cerr << "******************************************" << std::endl; + std::cerr << "*** Run " << i << " differs from run " << i-1 << std::endl; + assert(false); // This should not happen + } + else + { + std::cout << "******************************************" << std::endl; + std::cout << "*** Run " << i << " is identical to run " << i - 1 << std::endl; + std::cout << "******************************************" << std::endl; + } + } + } + + return EXIT_SUCCESS; +} diff --git a/Triangulation/benchmark/Triangulation/CMakeLists.txt b/Triangulation/benchmark/Triangulation/CMakeLists.txt index 5a3787259ee..40dbbfd3e36 100644 --- a/Triangulation/benchmark/Triangulation/CMakeLists.txt +++ b/Triangulation/benchmark/Triangulation/CMakeLists.txt @@ -11,10 +11,17 @@ include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) include_directories(BEFORE "include") + create_single_source_cgal_program("generate_d.cpp") + create_single_source_cgal_program("bench4d.cpp") + create_single_source_cgal_program("bench5d.cpp") + create_single_source_cgal_program("bench6d.cpp") create_single_source_cgal_program("delaunay.cpp") target_link_libraries(delaunay PRIVATE CGAL::Eigen3_support) create_single_source_cgal_program("Td_vs_T2_and_T3.cpp") target_link_libraries(Td_vs_T2_and_T3 PRIVATE CGAL::Eigen3_support) + target_link_libraries(bench4d PRIVATE CGAL::Eigen3_support) + target_link_libraries(bench5d PRIVATE CGAL::Eigen3_support) + target_link_libraries(bench6d PRIVATE CGAL::Eigen3_support) else() message("NOTICE: Executables in this directory require Eigen 3.1 (or greater), and will not be compiled.") endif() diff --git a/Triangulation/benchmark/Triangulation/bench4d.cpp b/Triangulation/benchmark/Triangulation/bench4d.cpp new file mode 100644 index 00000000000..b0746ed464e --- /dev/null +++ b/Triangulation/benchmark/Triangulation/bench4d.cpp @@ -0,0 +1,64 @@ +// Switch off the static filters for 4, 5, and 6 points. +// #define CGAL_NO_STATIC_FILTER_456 + +#include +#include +#include +#include +#include +#include +#include +#include + +typedef CGAL::Epick_d< CGAL::Dimension_tag<4> > K; +typedef CGAL::Triangulation_vertex Vertex; +typedef CGAL::Triangulation_ds_full_cell DS_full_cell; +typedef CGAL::Triangulation_full_cell Full_cell; +typedef CGAL::Triangulation_data_structure, + Vertex, + Full_cell> TDS; +typedef CGAL::Triangulation Triangulation; + + +int main() +{ + const int D = 4; // we work in Euclidean 4-space + + std::vector points; + std::ifstream in("points_4.txt"); + Triangulation::Point p; + int d; + in >> d; + assert(d == D); + int n; + in >> n; + std::cout << n << " points in dimension " << d << std::endl; + points.reserve(n); + while (in >> p) { + points.push_back(p); + } + CGAL::Timer timer; + timer.start(); + Triangulation t(D); // create triangulation + assert(t.empty()); + + //std::array ar = { 0, 0, 0, 0}; + //Triangulation::Point orig(ar.begin(), ar.end()); + //t.insert(orig); // insert origin + t.insert(points.begin(), points.end()); // compute triangulation + + std::cout << "Time taken to insert "<< points.size() << " points: " << timer.time() << " seconds." << std::endl; + timer.reset(); + assert( t.is_valid() ); + // - - - - - - - - - - - - - - - - - - - - - - - - STEP 2 + typedef Triangulation::Face Face; + typedef std::vector Faces; + Faces edges; + std::back_insert_iterator out(edges); + t.tds().incident_faces(t.infinite_vertex(), 1, out); + // collect faces of dimension 1 (edges) incident to the infinite vertex + std::cout << "There are " << edges.size() + << " vertices on the convex hull." << std::endl; + std::cout << "Time taken to find edges: " << timer.time() << " seconds." << std::endl; + return 0; +} \ No newline at end of file diff --git a/Triangulation/benchmark/Triangulation/bench5d.cpp b/Triangulation/benchmark/Triangulation/bench5d.cpp new file mode 100644 index 00000000000..e605c53f9fd --- /dev/null +++ b/Triangulation/benchmark/Triangulation/bench5d.cpp @@ -0,0 +1,64 @@ +// Switch off the static filters for 4, 5, and 6 points. +// #define CGAL_NO_STATIC_FILTER_456 + +#include +#include +#include +#include +#include +#include +#include +#include + +typedef CGAL::Epick_d< CGAL::Dimension_tag<5> > K; +typedef CGAL::Triangulation_vertex Vertex; +typedef CGAL::Triangulation_ds_full_cell DS_full_cell; +typedef CGAL::Triangulation_full_cell Full_cell; +typedef CGAL::Triangulation_data_structure, + Vertex, + Full_cell> TDS; +typedef CGAL::Triangulation Triangulation; + + +int main() +{ + const int D = 5; // we work in Euclidean 5-space + + std::vector points; + std::ifstream in("points_5.txt"); + Triangulation::Point p; + int d; + in >> d; + assert(d == D); + int n; + in >> n; + points.reserve(n); + while (in >> p) { + points.push_back(p); + } + + CGAL::Timer timer; + timer.start(); + Triangulation t(D); // create triangulation + assert(t.empty()); + + //std::array ar = { 0, 0, 0, 0, 0 }; + //Triangulation::Point orig(ar.begin(), ar.end()); + //t.insert(orig); // insert origin + t.insert(points.begin(), points.end()); // compute triangulation + + std::cout << "Time taken to insert "<< points.size() << " points: " << timer.time() << " seconds." << std::endl; + timer.reset(); + assert( t.is_valid() ); + // - - - - - - - - - - - - - - - - - - - - - - - - STEP 2 + typedef Triangulation::Face Face; + typedef std::vector Faces; + Faces edges; + std::back_insert_iterator out(edges); + t.tds().incident_faces(t.infinite_vertex(), 1, out); + // collect faces of dimension 1 (edges) incident to the infinite vertex + std::cout << "There are " << edges.size() + << " vertices on the convex hull." << std::endl; + std::cout << "Time taken to find edges: " << timer.time() << " seconds." << std::endl; + return 0; +} \ No newline at end of file diff --git a/Triangulation/benchmark/Triangulation/bench6d.cpp b/Triangulation/benchmark/Triangulation/bench6d.cpp new file mode 100644 index 00000000000..90fc41c680a --- /dev/null +++ b/Triangulation/benchmark/Triangulation/bench6d.cpp @@ -0,0 +1,83 @@ + +#include +#include +#include +#include +#include +#include +#include +#include + +typedef CGAL::Epick_d< CGAL::Dimension_tag<6> > K; +typedef CGAL::Triangulation_vertex Vertex; +typedef CGAL::Triangulation_ds_full_cell DS_full_cell; +typedef CGAL::Triangulation_full_cell Full_cell; +typedef CGAL::Triangulation_data_structure, + Vertex, + Full_cell> TDS; +typedef CGAL::Triangulation Triangulation; + + +int main(int argc, char* argv[]) +{ + const int D = 6; // we work in Euclidean 6-space + + std::vector points; + std::ifstream in(argv[1]); + Triangulation::Point p; + int d; + in >> d; + assert(d == D); + int n; + in >> n; + points.reserve(n); + while (in >> p) { + points.push_back(p); + } + + CGAL::Timer timer; + timer.start(); + Triangulation t(D); // create triangulation + assert(t.empty()); + + + t.insert_and_index(points.begin(), points.end()); // compute triangulation + + std::cout << "Time taken to insert "<< points.size() << " points: " << timer.time() << " seconds." << std::endl; + timer.reset(); + assert( t.is_valid() ); + + std::vector infinite_cells; + t.tds().incident_full_cells(t.infinite_vertex(), std::back_inserter(infinite_cells)); + + return 0; + std::set> edges; + + for(auto ch : infinite_cells) { + std::vector vertices; + std::cout << "cell" << std::endl; + vertices.reserve(D); + for(int i = 0; i < D + 1; ++i) { + if(ch->vertex(i) != t.infinite_vertex()) { + vertices.push_back(ch->vertex(i)); + std::cout << ch->vertex(i)->data() << " "; + } + } + std::cout << std::endl; + for (int i = 0; i < D-1; i++) { + for (int j = 0; j < D-1; j++) { + + if((i != j) && (vertices[i]->data() < vertices[j]->data())) { + edges.insert(std::make_pair(vertices[i]->data(), vertices[j]->data())); + } + } + } + } + for(auto pair : edges) { + std::cout << "edge between vertices " << pair.first << " and " << pair.second << std::endl; + } + + std::cout << "Time taken to find edges: " << timer.time() << " seconds." << std::endl; + + return 0; +} \ No newline at end of file diff --git a/Triangulation/benchmark/Triangulation/generate_d.cpp b/Triangulation/benchmark/Triangulation/generate_d.cpp new file mode 100644 index 00000000000..6759b9c908f --- /dev/null +++ b/Triangulation/benchmark/Triangulation/generate_d.cpp @@ -0,0 +1,24 @@ +#include +#include +#include + +int main() { + CGAL::Random rng; + std::cout.precision(17); + std ::cout << 4 << std::endl; + std::cout << 100000 << std::endl; + for(int i = 0; i < 100000; ++i) { + std::array arr; + double slength = 0; + for(int i = 0; i < arr.size(); ++i) { + arr[i] = rng.get_double(-1, 1); + slength += arr[i] * arr[i]; + } + slength = std::sqrt(slength); + for(int i = 0; i < arr.size(); ++i) { + arr[i] /= slength; + } + std::cout << "4 " << arr[0] << " " << arr[1] << " " << arr[2] << " " << arr[3] /* << " " << arr[4] /* << " " << arr[5] */ << std::endl; + } + return 0; +} diff --git a/Triangulation/doc/Triangulation/CGAL/TDS_full_cell_default_storage_policy.h b/Triangulation/doc/Triangulation/CGAL/TDS_full_cell_default_storage_policy.h new file mode 100644 index 00000000000..225ee67becb --- /dev/null +++ b/Triangulation/doc/Triangulation/CGAL/TDS_full_cell_default_storage_policy.h @@ -0,0 +1,10 @@ + +namespace CGAL { + + /*! + \ingroup PkgTriangulationsRef + A tag class to indicate that no mirror indices are stored in full cells. + */ +class TDS_full_cell_default_storage_policy +{}; +} \ No newline at end of file diff --git a/Triangulation/doc/Triangulation/CGAL/TDS_full_cell_mirror_storage_policy.h b/Triangulation/doc/Triangulation/CGAL/TDS_full_cell_mirror_storage_policy.h new file mode 100644 index 00000000000..55d1a3547fa --- /dev/null +++ b/Triangulation/doc/Triangulation/CGAL/TDS_full_cell_mirror_storage_policy.h @@ -0,0 +1,11 @@ + +namespace CGAL { + + /*! + \ingroup PkgTriangulationsRef + A tag class to indicate that mirror indices are stored in full cells. + \pre The dimension is not larger than 127. + */ +class TDS_full_cell_mirror_storage_policy +{}; +} \ No newline at end of file diff --git a/Triangulation/doc/Triangulation/CGAL/Triangulation.h b/Triangulation/doc/Triangulation/CGAL/Triangulation.h index 32188c44323..49ffb246f1c 100644 --- a/Triangulation/doc/Triangulation/CGAL/Triangulation.h +++ b/Triangulation/doc/Triangulation/CGAL/Triangulation.h @@ -520,7 +520,7 @@ position `p`. Returns a handle to that vertex. \pre The boundary of the union of full cells incident to `f` must be a triangulation of a sphere of dimension `tr`.`current_dimension()`). */ -Vertex_handle collapse_face(const Point & p, const Face & f); +Vertex_handle contract_face(const Point & p, const Face & f); /// @} diff --git a/Triangulation/doc/Triangulation/Concepts/TriangulationDataStructure.h b/Triangulation/doc/Triangulation/Concepts/TriangulationDataStructure.h index e12ab593ff7..370bbad3e8e 100644 --- a/Triangulation/doc/Triangulation/Concepts/TriangulationDataStructure.h +++ b/Triangulation/doc/Triangulation/Concepts/TriangulationDataStructure.h @@ -26,8 +26,8 @@ which is also the unique vertex and the unique full cell in the `TriangulationDataStructure`. In a geometric realization of the `TriangulationDataStructure` (e.g., in a -`Triangulation` or a -`Delaunay_triangulation`), this vertex +`CGAL::Triangulation` or a +`CGAL::Delaunay_triangulation`), this vertex corresponds to the vertex at infinity.

0
This corresponds to two vertices, each incident to one \f$ 0\f$-face; @@ -456,14 +456,14 @@ Insertion in a hole, \f$ d=2\f$ \cgalAdvancedEnd */ template< class ForwardIterator > Vertex_handle -insert_in_hole(ForwardIterator start, ForwardIterator end, Facet f); +insert_in_hole(ForwardIterator s, ForwardIterator e, Facet f); /*! Same as above, but handles to the new full cells are appended to the `out` output iterator. */ template< class ForwardIterator, class OutputIterator > -Vertex_handle insert_in_hole(ForwardIterator start, ForwardIterator end, Facet +Vertex_handle insert_in_hole(ForwardIterator s, ForwardIterator e, Facet f, OutputIterator out); /*! @@ -594,7 +594,7 @@ Calls `delete_full_cell` over an iterator range of value type `Full_cell_handle` \cgalAdvancedEnd */ template< typename ForwardIterator > void -delete_full_cells(ForwardIterator start, ForwardIterator end); +delete_full_cells(ForwardIterator s, ForwardIterator e); /// @} diff --git a/Triangulation/doc/Triangulation/PackageDescription.txt b/Triangulation/doc/Triangulation/PackageDescription.txt index 9816b3efa1e..714038db533 100644 --- a/Triangulation/doc/Triangulation/PackageDescription.txt +++ b/Triangulation/doc/Triangulation/PackageDescription.txt @@ -101,6 +101,8 @@ The latter two concepts are also abbreviated respectively as `TrVertex` and `TrF - `CGAL::Triangulation_ds_vertex` - `CGAL::Triangulation_ds_full_cell` - `CGAL::Triangulation_face` +- `CGAL::TDS_full_cell_default_storage_policy` +- `CGAL::TDS_full_cell_mirror_storage_policy` \cgalCRPSection{(Geometric) Triangulations} diff --git a/Triangulation/include/CGAL/Triangulation.h b/Triangulation/include/CGAL/Triangulation.h index 0dedf02b9ca..22087f89a5d 100644 --- a/Triangulation/include/CGAL/Triangulation.h +++ b/Triangulation/include/CGAL/Triangulation.h @@ -22,6 +22,8 @@ #include #include #include +#include +#include // for CGAL::Identity_property_map #include #include #include @@ -721,6 +723,34 @@ public: } return number_of_vertices() - n; } + + + template< typename RandomAccessIterator > + size_type insert_and_index(RandomAccessIterator start, RandomAccessIterator end) + { + size_type n = number_of_vertices(); + std::vector indices(boost::counting_iterator(0), + boost::counting_iterator(end - start)); + + using Point_property_map = boost::iterator_property_map>; + using Search_traits_d = CGAL::Spatial_sort_traits_adapter_d; + + CGAL::spatial_sort(indices.begin(), indices.end(), Search_traits_d(start)); + Full_cell_handle hint = Full_cell_handle(); + + for (auto index : indices) { + typename Triangulation::Vertex_handle pos = insert(*(start+index), hint); + if (pos != nullptr) { + // Save index value as data to retrieve it after insertion + pos->data() = n+index; + hint = pos->full_cell(); + } + } + return number_of_vertices() - n; + } + + Vertex_handle insert(const Point &, Locate_type, const Face &, const Facet &, Full_cell_handle); Vertex_handle insert(const Point &, Full_cell_handle start = Full_cell_handle()); Vertex_handle insert(const Point &, Vertex_handle); diff --git a/Triangulation/include/CGAL/Triangulation_data_structure.h b/Triangulation/include/CGAL/Triangulation_data_structure.h index c93ddb76507..93e30b4144c 100644 --- a/Triangulation/include/CGAL/Triangulation_data_structure.h +++ b/Triangulation/include/CGAL/Triangulation_data_structure.h @@ -30,8 +30,11 @@ #include #include #include +#include #include +#include + namespace CGAL { template< class Dimen, @@ -138,7 +141,7 @@ protected: // DATA MEMBERS int dmax_, dcur_; // dimension of the current triangulation Vertex_container vertices_; // list of all vertices Full_cell_container full_cells_; // list of all full cells - + mutable std::vector visited; private: void clean_dynamic_memory() @@ -306,10 +309,10 @@ public: return s->mirror_index(i); } - int mirror_vertex(Full_cell_handle s, int i) const /* Concept */ + Vertex_handle mirror_vertex(Full_cell_handle s, int i) const /* Concept */ { CGAL_precondition(Full_cell_handle() != s && check_range(i)); - return s->mirror_vertex(i); + return s->mirror_vertex(i, current_dimension()); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FACETS OPERATIONS @@ -365,7 +368,7 @@ protected: public: // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - REMOVALS - Vertex_handle collapse_face(const Face &); /* Concept */ + Vertex_handle contract_face(const Face &); /* Concept */ void remove_decrease_dimension(Vertex_handle, Vertex_handle); /* Concept */ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - INSERTIONS @@ -374,12 +377,12 @@ public: Vertex_handle insert_in_face(const Face &); /* Concept */ Vertex_handle insert_in_facet(const Facet &); /* Concept */ template< typename Forward_iterator > - Vertex_handle insert_in_hole(Forward_iterator, Forward_iterator, Facet); /* Concept */ + Vertex_handle insert_in_hole(Forward_iterator, Forward_iterator, const Facet&); /* Concept */ template< typename Forward_iterator, typename OutputIterator > - Vertex_handle insert_in_hole(Forward_iterator, Forward_iterator, Facet, OutputIterator); /* Concept */ + Vertex_handle insert_in_hole(Forward_iterator, Forward_iterator, const Facet&, OutputIterator); /* Concept */ template< typename OutputIterator > - Full_cell_handle insert_in_tagged_hole(Vertex_handle, Facet, OutputIterator); + Full_cell_handle insert_in_tagged_hole(Vertex_handle, const Facet&, OutputIterator); Vertex_handle insert_increase_dimension(Vertex_handle=Vertex_handle()); /* Concept */ @@ -667,8 +670,10 @@ Triangulation_data_structure TraversalPredicate & tp, OutputIterator & out) const /* Concept */ { + CGAL_precondition(visited.empty()); std::queue queue; set_visited(start, true); + visited.push_back(start); queue.push(start); const int cur_dim = current_dimension(); Facet ft; @@ -684,6 +689,7 @@ Triangulation_data_structure if( ! get_visited(n) ) { set_visited(n, true); + visited.push_back(n); if( tp(Facet(s, i)) ) queue.push(n); else @@ -691,7 +697,9 @@ Triangulation_data_structure } } } - clear_visited_marks(start); + for(auto fch : visited) + set_visited(fch, false); + visited.clear(); return ft; } @@ -776,13 +784,13 @@ Triangulation_data_structure template typename Triangulation_data_structure::Vertex_handle Triangulation_data_structure -::collapse_face(const Face & f) /* Concept */ +::contract_face(const Face & f) /* Concept */ { const int fd = f.face_dimension(); CGAL_precondition( (1 <= fd ) && (fd < current_dimension())); std::vector simps; // save the Face's vertices: - Full_cell s; + Full_cell s(current_dimension()); for( int i = 0; i <= fd; ++i ) s.set_vertex(i, f.vertex(i)); // compute the star of f @@ -926,7 +934,7 @@ template template < typename OutputIterator > typename Triangulation_data_structure::Full_cell_handle Triangulation_data_structure -::insert_in_tagged_hole(Vertex_handle v, Facet f, +::insert_in_tagged_hole(Vertex_handle v, const Facet& f, OutputIterator new_full_cells) { CGAL_assertion_msg(is_boundary_facet(f), "starting facet should be on the hole boundary"); @@ -934,13 +942,13 @@ Triangulation_data_structure const int cur_dim = current_dimension(); Full_cell_handle new_s; - std::queue task_queue; + std::stack> task_queue; task_queue.push( IITH_task(f, mirror_index(full_cell(f), index_of_covertex(f))) ); while (!task_queue.empty()) { - IITH_task task = task_queue.front(); + IITH_task task = task_queue.top(); task_queue.pop(); Full_cell_handle old_s = full_cell(task.boundary_facet); @@ -1028,7 +1036,7 @@ template< class Dim, class Vb, class Fcb > template< typename Forward_iterator, typename OutputIterator > typename Triangulation_data_structure::Vertex_handle Triangulation_data_structure -::insert_in_hole(Forward_iterator start, Forward_iterator end, Facet f, +::insert_in_hole(Forward_iterator start, Forward_iterator end, const Facet& f, OutputIterator out) /* Concept */ { CGAL_expensive_precondition( @@ -1047,7 +1055,7 @@ template< class Dim, class Vb, class Fcb > template< typename Forward_iterator > typename Triangulation_data_structure::Vertex_handle Triangulation_data_structure -::insert_in_hole(Forward_iterator start, Forward_iterator end, Facet f) /* Concept */ +::insert_in_hole(Forward_iterator start, Forward_iterator end, const Facet& f) /* Concept */ { Emptyset_iterator out; return insert_in_hole(start, end, f, out); diff --git a/Triangulation/package_info/Triangulation/dependencies b/Triangulation/package_info/Triangulation/dependencies index c7893bd09b0..b13119b12fe 100644 --- a/Triangulation/package_info/Triangulation/dependencies +++ b/Triangulation/package_info/Triangulation/dependencies @@ -6,6 +6,7 @@ Kernel_23 Modular_arithmetic Number_types Profiling_tools +Property_map Random_numbers STL_Extension Spatial_sorting diff --git a/Triangulation/test/Triangulation/CMakeLists.txt b/Triangulation/test/Triangulation/CMakeLists.txt index 23b67f9c497..3d38d402271 100644 --- a/Triangulation/test/Triangulation/CMakeLists.txt +++ b/Triangulation/test/Triangulation/CMakeLists.txt @@ -17,6 +17,9 @@ if(TARGET CGAL::Eigen3_support) include_directories(BEFORE "include") create_single_source_cgal_program("test_triangulation.cpp") + create_single_source_cgal_program("test_triangulation_static_filters_4.cpp") + create_single_source_cgal_program("test_triangulation_static_filters_5.cpp") + create_single_source_cgal_program("test_triangulation_static_filters_6.cpp") create_single_source_cgal_program("test_delaunay.cpp") create_single_source_cgal_program("test_regular.cpp") create_single_source_cgal_program("test_tds.cpp") @@ -25,6 +28,7 @@ if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("simple_io_test.cpp") create_single_source_cgal_program("issue_8347.cpp") foreach(target test_triangulation test_delaunay test_regular test_tds + test_triangulation_static_filters_4 test_triangulation_static_filters_5 test_triangulation_static_filters_6 test_torture test_insert_if_in_star simple_io_test issue_8347) target_link_libraries(${target} PRIVATE CGAL::Eigen3_support) endforeach() diff --git a/Triangulation/test/Triangulation/data/points_4.txt b/Triangulation/test/Triangulation/data/points_4.txt new file mode 100644 index 00000000000..a4cf574bb48 --- /dev/null +++ b/Triangulation/test/Triangulation/data/points_4.txt @@ -0,0 +1,100 @@ +4 +99 +4 0.52895023818873566 0.76946003711969879 0.10332507879995133 -0.34273433572785694 +4 0.41163016466811042 -0.3682073981839451 -0.52956435788869938 0.64385208729322574 +4 0.093453054760633439 0.2119054808051985 0.80105365911776638 -0.5519743010092597 +4 -0.52686178424608165 0.012815670898233643 0.37212064538747264 -0.76405408457574153 +4 0.58805166366770167 0.58151399203483489 -0.47736704319070539 -0.29691315902250165 +4 -0.25264853451566094 -0.78418366656495475 0.26672951531689387 -0.50008005434994851 +4 -0.60084190523524728 -0.5604455825189717 -0.49723069044393314 -0.27865999789869078 +4 -0.14100899254743662 -0.0089631723914645051 0.58363636804963048 -0.79962786060221414 +4 0.66702813144169226 0.71770163828613143 0.1794509474955823 0.088177024840630905 +4 0.067272560205402301 -0.78148557790668927 -0.60747442496113713 -0.12541737194421723 +4 -0.61117866728631531 -0.58630168897870427 0.4298657207341281 0.31293198668811495 +4 -0.35008556358761689 -0.66710053886097986 -0.65486926625208763 -0.059692657315481151 +4 0.46389645798324758 0.47388246271298917 -0.51250089951229549 0.54550739298634399 +4 0.60473888028283973 0.43542140981498328 0.61445566011491715 -0.2591202892514034 +4 -0.63570028008489909 0.069092069777339338 0.3692217899235456 -0.67437875829500826 +4 -0.17348381490574671 -0.72178783898784937 0.63597493154819651 -0.21085911860117806 +4 -0.43092415807804269 0.2933088414657809 -0.54542871271981364 0.65633970841595324 +4 -0.5872648129848288 -0.46519898124859577 0.20233236501175669 -0.63069133603048011 +4 -0.52163736145174866 -0.47914359898299425 0.4166108058131846 -0.56986955627667146 +4 -0.12233355367126869 0.84810365508989349 0.2899362015809886 0.42625308313501986 +4 -0.35742920641469561 -0.89683785609357769 0.062741086193053408 -0.25296200976145039 +4 -0.78852300220962024 -0.5639275096056745 0.02976513928181115 -0.24358012106861993 +4 0.16102552058740011 -0.34832861043240554 -0.77230337173088703 -0.5062464448140741 +4 -0.36473468498674155 -0.62632680133606067 -0.54342581243374721 -0.423523002771376 +4 0.38669371701382688 -0.092732194702578818 -0.68929567367330924 0.60559077233964875 +4 -0.33299174094142142 -0.49029782075996031 0.45014108485129106 0.66790534595235718 +4 -0.91282645715811384 -0.23702217761885661 0.24831940460126919 0.22114660234209427 +4 -0.77031248006615938 0.38630334371017139 0.43488982620221239 0.26126471012839414 +4 0.66172375169441366 -0.12261672629530741 -0.32075261333440069 -0.66648674098982941 +4 0.57034670408866528 0.48753644666462048 -0.36186729861405409 -0.5532313336232858 +4 -0.082725091078310692 0.65143093101200744 0.73450978815824752 0.17114225815572512 +4 0.21876173156734111 0.32898578539329398 0.43347340676139118 -0.80994596328489088 +4 -0.33699604068423233 -0.65780652131241102 -0.37739592337029015 -0.55793957209137057 +4 -0.14452111750932306 -0.29980077878167161 0.44117552773782037 0.83342503763746811 +4 -0.60890866237581964 -0.03479345133360897 -0.43514476779108269 0.66232068342460104 +4 0.71245784249865418 -0.23592015892187332 -0.54082939892555126 0.37980134614593941 +4 -0.60755677753783255 -0.50900445335692879 -0.42092208946750237 0.44115056741317993 +4 -0.58629760542664433 0.70435639453918453 -0.22180443664834243 -0.33307653658859659 +4 -0.011568009781532355 0.74683659337957264 -0.59111127229640315 -0.30444826769587074 +4 -0.73402745671071856 0.45001202934735579 0.34256269222203234 -0.37595700304032337 +4 0.96955534991982739 0.21094272681275947 0.1237686011083543 0.012121172646227195 +4 -0.33515152801797943 0.58731518520960269 -0.73529604380016256 -0.04554178807703145 +4 -0.1695992685331843 0.71732121764303036 0.1045943664094339 -0.66764240229896898 +4 0.41021678724271049 -0.058137600323793059 -0.69428206500086809 -0.58848502199375474 +4 -0.39592571191104603 0.58200935707952561 -0.50286009397814668 0.50163698508373367 +4 -0.45424480336633766 0.10665895997127596 0.74939096527122961 0.469785808685594 +4 -0.3454697098753714 0.55281901613449536 -0.74845218643798317 0.12190627373075473 +4 -0.59790770721886854 0.60881430552998739 0.02530587143431251 0.52077934665390191 +4 -0.56362033043166415 -0.60248915001345682 -0.43114306807172986 0.36531438801922317 +4 -0.053942383466521714 -0.3825000007038053 -0.90743388492682919 -0.16537144014049615 +4 0.38943960202183897 0.59168265087118188 -0.56545151418878548 -0.4225080142869867 +4 0.32757750767416155 -0.37422123516358158 0.86705900240528766 -0.029327972425235223 +4 0.30707527803241386 -0.44803155642495435 0.41282918565941928 -0.73112554430585286 +4 -0.073800290225580531 0.40020628037959349 0.0842177799924263 0.90955803324499174 +4 -0.64001436371529896 -0.072225436170897023 0.49413648819736417 -0.5839471137354828 +4 -0.59015206232128126 0.53584682889683521 0.30898692279128281 -0.51876372352268263 +4 0.54724228238081274 0.035143265750607743 0.11919629083806163 0.8276974565005436 +4 -0.35323392216813781 0.82302655685535431 -0.42310323289497054 -0.13724699360772272 +4 -0.41065725894900967 -0.61041191065378753 -0.022994082078545822 -0.67692627899487234 +4 -0.70970746461224699 -0.22383791996053623 0.012330134011180993 -0.66787713544982452 +4 0.55072527194049248 0.69518182768471604 -0.32858051402398963 0.32474412559234861 +4 0.71368785213334873 -0.29618392689360484 0.41394892791451326 -0.48121826258528067 +4 -0.19788064543206449 -0.52332638918801311 -0.42611224498755368 -0.7109156737718566 +4 -0.73260416198605427 0.61391060086551386 -0.29356437748944109 0.014995741225163756 +4 0.06751903424971531 0.71405042477407443 0.5473252660834188 0.4312867074240343 +4 -0.18348163268247566 -0.050192144559362807 -0.64188866758252738 -0.74282849805445195 +4 0.63687181402246784 -0.22003876193015062 -0.51659922543729686 -0.52830150106692175 +4 -0.11028158722874594 0.88420614899701044 0.42720087446642768 -0.15335211263397941 +4 -0.013748538374202431 -0.56244270297759258 0.21313224138875758 -0.79877645886720827 +4 -0.33934630169439356 0.87504428007586932 -0.32234472481531135 0.1234320615423013 +4 0.020641313329517623 -0.034793745494681526 -0.4958497406739199 -0.86746548411570279 +4 0.52203848059009927 0.43330117515096306 0.47283390118077567 -0.56227574933491786 +4 -0.40054895466475599 -0.79547572989096216 -0.4476148397395544 -0.080123987147080605 +4 -0.71649876630467513 0.4523690473971671 0.41922525050126752 0.32594777523862256 +4 -0.36070581595586504 -0.41026930366011455 -0.32455192495028179 0.77216349358210712 +4 0.7705609584869002 -0.4953157763775814 -0.39996122520888822 -0.030481293552415547 +4 0.28303350219616347 0.63943282663784418 0.11251583685128733 0.70594467439748088 +4 -0.40169841911732779 0.38324938887974475 0.68336451387909214 0.4741004399626032 +4 -0.62006911748363935 -0.55619344959426886 -0.52050366542307425 0.18772072462206343 +4 -0.49268718648182941 -0.31898831529416238 -0.80785558586700856 0.053620363350908903 +4 -0.36696017144017445 0.25428710781938241 -0.75112771736490647 0.48629769851361304 +4 -0.6762857935197728 -0.60184509135112363 0.12406042037932141 -0.40623764423695996 +4 -0.3666763716786815 0.59232631101849398 0.084652342433469516 0.71241277406311754 +4 -0.76719307170352091 0.45208369346607641 -0.34422833381589385 0.29756004273174891 +4 0.82489704276678244 0.34579891834392634 0.064163335194787313 -0.44255061103049992 +4 0.45564567873025064 -0.22926076391181213 0.74158978325192637 -0.43574202340534296 +4 0.52214745052855083 0.27359451350772929 0.80769505426164601 -0.011695358322007989 +4 -0.41332356519969343 -0.4212363812082196 0.33906221189151459 0.73263930966366508 +4 0.1838662558741771 -0.35081918453578126 -0.0091141922386424549 0.9181699359118104 +4 0.65789904901077378 -0.64943157580971833 0.27398923148746029 -0.2652119354043791 +4 -0.37303592269023383 0.60300377304686248 -0.10667396639645926 -0.69703035440871652 +4 0.10315594841993071 -0.82693376104025118 0.4808678171094436 -0.27259043935143445 +4 -0.89464835998641834 -0.023071055052995115 0.22497109841239393 0.38530513008714889 +4 0.2653611823080248 0.61537576292522267 0.13785152217861019 -0.7293099966141473 +4 -0.21380924996700196 -0.13124084180973827 0.96126618299929023 0.11414364411387168 +4 0.87240111990088531 -0.36008466117017685 0.27199676339958556 0.18781129754567474 +4 -0.44220740212185472 -0.70374614146887182 -0.24198731969355564 -0.50063571485047287 +4 0.63576818856786788 0.49539717675654271 0.44626626174819567 -0.38887899312262875 diff --git a/Triangulation/test/Triangulation/data/points_5.txt b/Triangulation/test/Triangulation/data/points_5.txt new file mode 100644 index 00000000000..6b885d39507 --- /dev/null +++ b/Triangulation/test/Triangulation/data/points_5.txt @@ -0,0 +1,100 @@ +5 +99 +5 -0.64095941196659478 0.42422061910202236 -0.11427904012605219 -0.54638535945002176 -0.31242797331012567 +5 0.44732454860440324 0.49607483933338892 0.47235547227129621 -0.45736405185315043 -0.34858131602833875 +5 0.049977903241973112 -0.41566435029188453 0.47034156364498109 0.5314014231286428 0.56667159633142805 +5 -0.31858406166597525 0.55293922510375226 -0.098876917441046278 0.66185744478651076 0.38069736927394077 +5 0.1883028908220821 0.1625166528920311 -0.90658142749714132 0.11334777454589573 -0.32154743998911944 +5 0.32925500379336742 0.6048540056497308 -0.086063069913405219 -0.69326730751901255 0.19420700978318073 +5 0.43778721990629893 -0.33151202897445026 -0.41155460656703702 -0.59664728782302312 0.41602517289082297 +5 0.62257265376051363 0.69293819835728199 0.30234871432571214 -0.053274980604846874 0.19490247672643263 +5 0.44105487515035374 -0.42039030928286697 -0.48068520779332113 0.34447782922782266 -0.52822281392073556 +5 0.016084439725856742 -0.25191131235609143 0.7629458374992345 0.52353744836895799 -0.28302680209416425 +5 0.43354106860716723 -0.22705781874127151 0.068849436504207148 0.73368495821250479 0.46631858848343127 +5 -0.64456383107308368 0.37500823725746141 0.15272334561406656 -0.44653621962219042 0.47030551127050385 +5 -0.01363735448457239 0.30485208355187349 0.43905750564271206 -0.62699965173691685 0.56655023888206812 +5 0.0078606115325960974 0.13430751581905762 0.2181755898170861 0.53805349733372398 0.8029928692060484 +5 0.52338099659430393 -0.014615020320186925 -0.48914523816770017 -0.47549568516135032 0.51039153887559274 +5 -0.69482670411781933 -0.030010825193797691 0.34327877508094107 0.56440594895759255 0.28270268653863861 +5 -0.75400593882254485 0.20528914441943982 -0.011183249996636422 0.28305090197467592 -0.5559573124033016 +5 -0.26478115474184827 -0.45814239612429802 0.058790619333674764 -0.82550288646510983 -0.18731025728238973 +5 0.75370149289146393 0.041265752398890396 -0.31598075959816507 -0.50970148811628602 -0.26569107976735346 +5 -0.4519268127481933 0.17613049993809574 0.64157833191917701 -0.1199529988420301 -0.58200405925682863 +5 -0.67422492315129878 0.0052508128669294055 -0.34989951630863758 0.59640231454536097 -0.25936034711917605 +5 -0.84536670492017962 -0.023545078714723985 0.23188336199914605 -0.39941072573741931 -0.26739847059135646 +5 -0.6832142989651836 -0.12691169799999982 0.57357419956766675 -0.1281663346418801 0.41436417660681707 +5 0.63151709095033293 0.11572773552335802 -0.45061917023719628 0.14637578686667163 -0.6027518125249961 +5 -0.63457899564060283 -0.52966844727893914 -0.51456049526593051 -0.21838548693858054 -0.06554471798063273 +5 -0.72586407046590262 0.53323169069976017 0.32142119181324058 -0.28443313725001818 -0.067613039627090948 +5 0.11048228638172189 0.12809754988080219 -0.40887921694271862 -0.77092857165846906 0.45811745815166749 +5 0.51397355334880024 0.32553149207748472 0.5186652471029648 -0.19028592634504338 -0.56977018332521023 +5 0.52471838621722444 0.20265571519982001 -0.5961767637385692 -0.2552020089464791 -0.51288056823234041 +5 -0.42618238121168606 0.67925070936879339 0.11809074419895899 0.5837804744939592 -0.047349609300101507 +5 -0.75979859206098521 -0.17280413824019189 -0.1813534331371959 0.59978037174150067 -0.014807676123859496 +5 0.39184709577815358 -0.46011983815751623 -0.55867615995912812 -0.43478136258019162 -0.36550198783366711 +5 -0.47631197080770421 -0.13866838726394107 0.56944074766219055 -0.20924017616748669 -0.62117128750307116 +5 0.69836618593825928 -0.31047848566369102 0.30402750685925439 0.12607668433628302 -0.55458067494075669 +5 0.1869131312461339 -0.14541256019221543 -0.88720967185608168 -0.37122076821132544 0.13774181688843901 +5 0.066168156653027055 -0.79153357077416386 -0.0022462197273692267 0.46469566632383441 -0.39134291047548841 +5 0.89469701530926082 0.11759766993898985 0.34387377605733604 -0.10906814641318215 0.23567563386927023 +5 0.44839548790055422 -0.215872738581219 -0.31689404873737492 0.48576723561113194 -0.64494092896126687 +5 0.6459123373501775 -0.46663502702373549 -0.32530950233450889 -0.039516958959050295 0.50760333101634691 +5 0.050417291553477184 -0.047285079262706954 -0.2138273059584746 -0.90923374708311278 -0.35041988297366083 +5 -0.59264984179337254 -0.45580598211515067 0.41834884196290151 0.32848532800592428 0.39760370647602505 +5 -0.13481014216375148 0.098149972390238663 -0.71288083854571282 -0.46824774456146634 -0.49470978182874609 +5 0.020717171016991894 -0.61151395060645808 0.18739980633705816 -0.63488453348310792 0.43292543095492175 +5 -0.29319280111406504 -0.71141445302303752 0.43866572973669665 -0.42414838726394366 -0.18867427100902645 +5 -0.12195022572923944 0.1597275130261441 0.37359538094266925 0.87248224896209947 -0.24252109312678227 +5 0.26916794620313855 -0.79643329338601399 -0.17842819374734853 0.24827897357108525 0.446949165880907 +5 0.1453113711518611 0.55890701106684326 -0.33506119215671726 -0.56060928342351557 0.4898558841579691 +5 -0.13559765406608318 0.22424015035632619 0.89051035130708844 -0.2844260176919719 -0.23963051945601349 +5 -0.50566728258429727 -0.35078461251646564 -0.44622952634161051 0.39434995372518228 -0.51635073231610096 +5 -0.081206578882796046 0.7080562679527399 -0.42730522360386669 -0.31493163319195694 -0.45857401284294996 +5 -0.56221514665255945 0.26352028510021092 -0.32431871644229199 0.44640018134880266 -0.5567902984716282 +5 0.67127300073285578 -0.56121759668984272 -0.11438199626517255 0.32066898964093893 0.34426083957638576 +5 0.46427394220581342 0.46813361706404572 0.43431336049942787 -0.029219081499168249 0.6130405968051752 +5 0.085830281871806843 -0.68075675673231806 0.36464348542014058 -0.55908690912039871 -0.28924100239757228 +5 0.41364898446754872 0.44051277392034793 -0.51368389933707281 0.27089667753848867 0.54551522006487996 +5 -0.12351866879421199 0.37823568590421885 0.070649994572097946 -0.14105158010103419 -0.90376652648006106 +5 -0.55545110175425316 -0.57820471208033508 -0.43080087411301676 -0.38794497232024833 -0.14512990664568667 +5 0.7651360106358821 0.26858554943456936 -0.32320967256616323 0.45271513727326118 0.18169534916024627 +5 0.45441543922986888 0.5544933959770898 0.37209878757560882 -0.34801976791573092 -0.4758869780020909 +5 -0.48382144387953951 0.21412341598565873 0.48837003184817313 0.56894254401428956 -0.39732488818612011 +5 -0.27038670992649089 0.7177459738405968 -0.024815590179790174 0.61932329771149031 0.16599573345882931 +5 0.52568529402156838 -0.6686179658279312 -0.30453683091328215 0.39362339728539719 -0.17006741942057541 +5 0.15294938992472662 -0.23462980298095978 0.2749232088212652 0.63828078540744748 0.66224633476210426 +5 -0.53568255103656881 0.078022991883987841 -0.31948842617438705 0.62671984273267689 -0.46054967323641327 +5 -0.23310206113273735 0.38122357958778275 -0.62218473180664657 -0.51308258950399432 0.38725240776077069 +5 0.062519229350989067 0.60935859588898855 0.36557460415396498 0.64016700136989868 -0.28515761734925249 +5 0.40055103808277742 0.11420518938708622 -0.13612792768426063 0.2722551771516088 -0.85665765999400478 +5 -0.55472894977000109 0.14438622704861134 0.35711517550786664 0.19748727548511219 0.71056029805301646 +5 -0.039226168712433881 0.53046963553531501 0.58724338979502344 0.3304297025089995 -0.51285932408901158 +5 -0.36549272643511066 -0.1944460632762828 0.42892482070515675 0.54746427240095541 -0.58729223051810131 +5 -0.51444905998852453 -0.54308624712485065 -0.44536997670499018 -0.057662778907800395 0.48858989002966047 +5 -0.15440932419624182 0.48219819045804607 0.047093757444803284 -0.60392043033692211 0.61376294898897477 +5 0.43481889665508638 0.21724186040536617 0.41122418484105694 -0.036198505808205945 0.77027452195845758 +5 -0.45335160348155307 -0.0090240382671407781 -0.54837361755857228 -0.56749016125780805 -0.41428514672308675 +5 0.47114542832518985 0.46505950774730731 -0.62278318402538824 0.41519154489887244 -0.038713387371715736 +5 -0.50136442182277852 0.18939946722006479 -0.44745642645398664 -0.036410595617002037 0.71499550578930915 +5 -0.50890485936191909 -0.54100797605641604 0.44170900156992093 -0.27187048708488765 -0.42344516781455299 +5 -0.18074952593523871 -0.18860582205590692 0.57887192516180996 0.039211533315703977 -0.77144487986847987 +5 -0.47365805515360904 0.01465502819126422 0.85229770070622901 0.15425760518747605 -0.15882851617236068 +5 -0.30745671248873752 0.57057989273713283 0.60645536747604767 0.19965378698854283 -0.41504121307446745 +5 -0.24028271704320009 0.58912913017564106 0.73907633222396696 0.20948416633465156 0.071229509827560183 +5 -0.64228704065956665 -0.37111771514629771 -0.51078840781267765 0.2517172542564432 0.35422115303741308 +5 -0.45413924048414522 0.52788021885267411 0.39677332786249203 0.39688971574050569 -0.44738071553530406 +5 0.41505598340153971 -0.22025041501083814 0.80109954759996271 0.34641357884080504 0.13211900907884189 +5 -0.20025735851245358 -0.6592702299950165 -0.32273296816240932 -0.32053493269293298 0.56423447465442167 +5 0.58716421726361867 -0.17367850226005824 -0.3234252705857012 -0.576311210468198 -0.43397631600486125 +5 0.24500268030283279 -0.37673527821663111 0.26197175324156724 -0.831532046129559 0.1948575724846065 +5 0.5221610049491775 0.15958174522100452 -0.48361390102525659 -0.55613903653367458 0.39838237697118678 +5 0.16962234853857569 -0.58401971243880413 -0.62282869411315633 -0.32534521602588351 -0.36930223741202295 +5 0.58028138836141019 -0.34025869019701482 0.5807426490215255 0.41704964830718566 0.19053897375886178 +5 0.49658935038669683 -0.1325969999793061 -0.64242700913886752 0.43871198504738879 0.36143655706593286 +5 0.6541749555201487 0.11495532575987849 -0.47189266545231384 -0.46477475130993412 0.34661526724417524 +5 -0.37016121969427745 0.68870175579814763 0.23906708910490926 -0.55701266918805681 -0.14578880706657554 +5 -0.61783888880336935 0.32189539528913458 -0.46086045339499304 0.38667673368942418 -0.39082887315768933 +5 0.032116226250772636 0.37788382751053184 0.37339170905185354 0.24931481645654946 0.80906928926017996 +5 -0.062201604939676421 0.48158547236711069 -0.55318649438944401 -0.64020204958944993 0.21984638108110963 +5 0.43963286001154867 -0.58237961543813122 -0.68268015123007919 0.016241394588271955 0.03522726413596125 +5 0.36598575138692213 -0.072439024911306132 -0.56340774519713788 0.68450645966869139 -0.27355006264916204 diff --git a/Triangulation/test/Triangulation/data/points_6.txt b/Triangulation/test/Triangulation/data/points_6.txt new file mode 100644 index 00000000000..ffa708c9f61 --- /dev/null +++ b/Triangulation/test/Triangulation/data/points_6.txt @@ -0,0 +1,100 @@ +6 +99 +6 -0.52248578532016376 -0.48346324138645691 -0.58974456741264414 0.22252777840028556 -0.015931087719839573 -0.30935551046981807 +6 0.34754132905984381 -0.074985127922628902 0.49930955656743814 -0.49297991574953459 0.3743412038014835 -0.49104143176539627 +6 0.49995311666702108 -0.57210736482775315 -0.25164036633515868 0.10175875354232455 -0.17957742984389918 0.56286257029905196 +6 0.39906582656602591 0.47457715471780493 -0.082408075327093433 -0.15562564967545028 0.36076517581009854 -0.67406308643465562 +6 0.47762233059349435 -0.2842328008690938 0.38623842606683151 0.25571542872305203 -0.48436897768414289 -0.49183820045637949 +6 -0.0042314478443558987 0.66049090972627666 0.47606918346155225 0.26460949335869488 -0.47947866280804441 -0.19280563662043465 +6 -0.38374085169832239 -0.58506782737244056 -0.28816302750472883 0.3515802173604044 -0.5279113747823817 -0.15843483463882974 +6 0.23917340386004574 -0.54065741121454236 -0.33612792325867147 0.0073138842190205713 0.49193768445111852 -0.54355081409662509 +6 -0.33027866095233116 -0.56180392557603231 -0.32646623884361697 -0.56886147641690643 0.33908986323916374 -0.17357083718015598 +6 -0.39192523875775492 0.54423469918164857 0.43041308504361298 0.45346132108040205 0.22340600649055789 0.33077237218748201 +6 0.066836254602841441 -0.52920520249210112 -0.33068598406842653 -0.26992400905794661 0.62845484338677204 0.37189660905209698 +6 0.19743860684640982 0.081543364953937478 0.63446506243002354 -0.097012508529634223 0.70768239786789711 -0.2039533222355914 +6 0.42350956524488981 0.53817080890286528 -0.44826665925687231 -0.4630016158560194 0.23378709098204101 0.24706665212948764 +6 0.09785501454807044 -0.11456262890775261 -0.31134303673278318 -0.49637806372022192 0.55949777724624261 0.56651246127285459 +6 -0.10326273668695649 -0.65814304095940668 -0.31725909306625727 -0.555960810177341 -0.25255650990838052 -0.28749608617380074 +6 -0.61542480481483819 0.0011280450683139097 0.55328692027642723 0.34400335684157046 0.37016000457099912 0.24447470724330039 +6 0.43813574182814297 0.29379416544186204 -0.55292433586480871 -0.36707484188102968 0.413424369672585 0.33216425140632733 +6 0.62368126529536638 -0.3064881542207466 -0.43871298975197703 0.53742069886050947 0.15085507286218508 -0.11418994129448788 +6 0.16476372090864744 0.1109205078824663 -0.23399740855607967 -0.44517529682570806 -0.76827227146836241 0.34259515755693032 +6 -0.4582030961925827 -0.2663673224056024 -0.54961052165427071 0.51751923392842392 0.35978158750630773 -0.14056208054272484 +6 -0.11495774297936535 0.17677227221875624 -0.45880764506787858 0.44376921050871543 0.46355481773156476 0.57725007119384819 +6 -0.52160176513875189 0.31426462456544085 -0.35933189154758549 -0.51331867425419864 -0.43205016526292017 0.22335292571602985 +6 -0.20947455578544788 0.47005432960768112 -0.41475967751478227 0.40696776076920221 -0.54940083105174653 0.30932138002011456 +6 -0.35515545955131517 0.28659947063783103 -0.43389023672403004 -0.75423410037367455 -0.13058245691460899 0.1324528189063271 +6 -0.1072324954411312 0.53549378529716085 0.5303451149630013 -0.13897402329310882 -0.090546592722667144 -0.62687254865762698 +6 0.1102357638392452 0.35390965540162767 -0.15921053186861117 0.56662571537935513 -0.50343143562548798 0.51258182470829694 +6 -0.7521414280651405 -0.34476026492334633 0.19505386347651005 -0.49783859325421242 -0.1655035063064634 -0.04629197260795017 +6 -0.43546464287814302 0.23273923325366619 0.0044777062314122424 0.67556119443422513 0.50870812033248003 0.20252423345567822 +6 0.53251647928358914 -0.39729448899929043 0.58369316051078268 0.22564615748686082 0.37811475342857548 0.15491490414482306 +6 0.24289310169624273 0.11859386955210122 -0.29281369162847548 0.59092439680912245 -0.63259583083229609 0.30303374286919554 +6 -0.35598184358712603 0.77960773923442395 0.26584688554881319 -0.18885184748169259 -0.1277532527817529 0.37792620908390379 +6 -0.57775461906181802 0.56398136201948956 0.24716950956221539 0.26633847280431333 -0.37362408068361069 -0.27658763751791582 +6 -0.57990647596989886 -0.28836767266607671 0.22685410250953331 0.14944399270179443 0.64174541296874976 -0.30808943286460289 +6 -0.5335030315141126 0.54805489620934245 0.42406328570339591 0.093393095662535883 -0.12783094169714468 0.45838592457889477 +6 -0.12909382114378909 -0.56639935858156654 -0.58803157227785718 0.43124035398267208 0.24059819736254101 -0.26998090019131404 +6 -0.43975002441797462 0.42549076003343606 -0.10026091502860482 -0.74594444050366826 -0.23934857461929585 0.042478577866581706 +6 0.96344235807064582 -0.019659692709547497 0.15982487206874871 0.15259660437219755 0.14992374705924039 -0.0092453138313178737 +6 -0.084430753927450891 0.54594301169552162 0.53653011372194326 -0.41453990405074331 0.43836397417083728 -0.20723611398676234 +6 -0.15115603394306507 0.55281885912085593 -0.15786414392716869 0.45384926769871159 -0.57847546467799149 0.32559031533506255 +6 0.54204921011102858 -0.48557698424209411 0.063433639091453539 -0.57195606016163636 0.24305832909277175 -0.28313024127949815 +6 -0.20964859633944177 0.64422189446086331 0.49286994349553021 -0.016379507018461248 -0.25142041984651609 -0.48438034619801107 +6 -0.66412915962225783 -0.078748905511993067 0.26534993875875773 -0.46284549334831837 0.1802169516138587 -0.4854033156654165 +6 -0.025354298800610967 -0.39942902492434534 -0.29081623107075677 0.51367327514162064 -0.4798586670872439 0.51099408935197155 +6 -0.45624010445234175 0.49728960762817503 -0.71376636112381542 0.14604468681390875 0.086243214125533443 -0.079489951774571604 +6 0.042777457242166465 -0.45576092006574703 -0.552753958269535 0.42815940751197412 0.21138424160935149 -0.50686424086565252 +6 -0.69726903180472077 0.58427371427586983 -0.26549450486140008 0.04515354794769965 0.28681486789955868 -0.13285774587986951 +6 0.43703961063496144 -0.10262789880626823 -0.30317985370822126 0.4423049505563586 0.66160948460225333 0.2705274293408918 +6 -0.44503643360426454 0.44210396394781937 -0.30552946308447798 -0.087224327910949404 0.29239336350668083 0.64810218531607033 +6 -0.33416852970579863 0.43114438367926067 -0.37015382974558247 0.4394289146016731 -0.4941491374465089 -0.35798172505540032 +6 0.58427360418679308 0.13212854546799202 0.32961365957906164 -0.15457700371906985 -0.52591774988985029 -0.48170292568554879 +6 -0.14692240259726411 0.50795249686667387 0.32018789462677638 0.58144701994589676 0.41352260304947402 -0.32984269044448206 +6 -0.30224776324831804 -0.54016932402525564 0.062437141365121823 0.29982639105377751 -0.48343582303649113 0.53792093713141187 +6 0.62544035465474512 0.14389245436402084 0.11513839092542102 0.44236996603616979 0.59184763957735986 0.16996370188194654 +6 0.16399979716296756 -0.54611276403195308 0.31075827322246652 0.30247091078354782 0.69596494174650481 -0.049379743875720375 +6 -0.11219854773022092 0.61621528084473354 -0.20736244405315685 0.59256100282170987 -0.26794828151981021 -0.37651853434125537 +6 -0.46302684227036922 -0.25443861931412992 0.32594642236734189 0.11169860998106729 0.43606185210305048 0.64187190603214217 +6 -0.45102710013912661 0.34319441954205482 -0.47602676819679662 0.40310344265859838 0.43758453310888407 0.31339759443247434 +6 -0.51942334686053926 -0.37233703787629813 -0.51991348946415983 -0.3753013101271776 -0.41630361563609058 0.084230081681330463 +6 0.58470861285556364 -0.27462643035008216 -0.26429262032141643 -0.3765127120977812 -0.28781649242151536 0.53688491966927399 +6 0.50045126191095868 0.7871626075227196 -0.21282467832228918 0.28028649755337315 -0.043024392064293426 0.064943060010571332 +6 -0.69508790074194882 0.43616299845857603 -0.3591724438510307 -0.049576650667123003 -0.090986178416972305 0.43228864852267174 +6 0.27823226432546638 -0.072653878980126624 0.44563536030377265 -0.1696865917185551 -0.48061373991631517 -0.67744685415092498 +6 -0.30768510623989498 -0.50822449378663159 0.18610948363783017 -0.71726533661442327 -0.23675331849272591 0.20464433167719714 +6 0.46757798287119678 -0.13228547514553321 -0.69909562048719887 0.51494410224708809 -0.069923553034947503 -0.071273871139087508 +6 0.30979245895544522 -0.27528069259249532 0.40534747257084985 0.38280137237753259 0.7111072591652291 0.108315162414837 +6 -0.75447113237181862 0.22335469077359976 -0.078453049118816759 0.57794290835632367 -0.089983576170946739 -0.18059917583172225 +6 0.53097636282674088 0.47993989234775414 -0.14341376704799877 0.37633704676626029 -0.27087538177519738 -0.50214663998975873 +6 -0.54501406879560677 -0.027692701375586291 -0.018425467843559137 -0.18240602791855356 0.27664238093066079 -0.76944805886565038 +6 0.0049593326721196094 -0.55640609995536572 -0.090097818767519516 0.52601054123491187 -0.32750199904052951 -0.54619171646909292 +6 -0.5246820629099288 0.15438725569802475 -0.40052392363106931 0.61912072585885058 -0.28944503954220524 -0.27085972501316796 +6 0.23252207147619353 -0.088889793755518587 -0.43408635618399199 0.060187728890766561 -0.74515951113397694 -0.43671027750096514 +6 -0.082635336835963871 -0.49519261695606376 0.15854845703115641 -0.56216663205680517 0.38233422075054319 -0.51049709248558417 +6 -0.63625730633727418 0.25866481089124316 0.44123359845324261 -0.49027168711023134 -0.27636701110074274 -0.1297575251319382 +6 -0.44887073462772731 -0.49904555043438975 -0.30600411449649562 -0.21972017202857003 -0.37941072591180663 0.51342052078625433 +6 -0.34623422926080971 0.11834562879027813 -0.58051057852027854 0.45782288815419275 -0.27114225180370755 -0.49598762205263436 +6 0.18476465374966927 0.16780923027338854 -0.42003736535999353 0.32891322320538224 0.44078292065455432 0.67734570576710706 +6 -0.58826517628267483 0.13974808135952232 0.62318859849813157 -0.12874611043451153 0.46759218180316064 0.10407938026297492 +6 -0.31641160184325334 0.54818645501247232 -0.1073258390615717 -0.28649693243150826 -0.24692955978787859 0.666934609418251 +6 0.10226792288332755 0.60622551567028793 -0.53017506565965233 0.071605228794985001 0.40996565618803915 -0.40956946640067621 +6 0.46043313457149759 -0.074442042067401834 0.30689113367015464 0.11103519893154284 -0.70251964235567732 0.42710054991633023 +6 -0.064156465396957033 -0.82837155645765004 0.49937300767398479 -0.21915544003533366 -0.10694135232173688 -0.029078374659791989 +6 0.0042208998272006927 0.36747111488458412 0.76684135998135416 -0.29458715192078899 -0.43565218876602341 0.018085151330519758 +6 0.65851529280804311 0.5194851618852423 -0.41811762733101349 -0.12994527743920986 0.1772560295364389 0.27085965055413574 +6 0.12993326316132806 -0.51206545526523228 0.39669591115833769 0.14384532909354469 -0.65561573013643804 0.33617734369548297 +6 0.16664316396641046 -0.13200053855335347 0.33194364778908209 0.60516407129239946 0.65067562957865477 -0.23455702996626543 +6 -0.54726594996923195 -0.092098298754806088 -0.31987289797771662 -0.4279187441318057 -0.62561590332491124 -0.12324569946937439 +6 -0.11298168347438495 0.36544841132413869 -0.60324357694674791 0.55848239564997726 0.23122326525371081 -0.35272227047200261 +6 -0.58723545016046963 0.58944372207482276 -0.22662085714400246 -0.027374002377005865 0.20652708682257323 0.46146596634115078 +6 0.25382119670786951 -0.49035434210113238 -0.46264611340318978 -0.44845091744845272 -0.46735464124745502 0.24810765200085477 +6 0.59601104905273994 -0.4194785680875594 0.33460981878342455 -0.16429160937140283 -0.25171322089750281 -0.51623013376937443 +6 0.41563033855507381 -0.48609408425483569 -0.08739976523333666 -0.061961248085371137 -0.58592390826984109 -0.48598273777543055 +6 -0.031533077985587805 0.13928846673339906 0.58357639428533792 0.48352257655397113 -0.11733201912831731 0.62568530053903204 +6 0.16248922520275433 -0.47085387551133417 -0.66619299328217085 0.14775302067779422 -0.48370792262089657 0.22864047276252492 +6 0.10089789149314744 0.18194720556532579 -0.66592379404892899 -0.44749698377552732 0.46944144644050056 -0.30435424799785848 +6 -0.16137300109253624 0.4975763651263943 0.040717095122033017 -0.55028097459815839 -0.4278321603812576 -0.48874239133681002 +6 -0.046330434202731273 0.36620529921638473 0.42638300010025254 -0.29858665784419686 -0.55582640196409261 0.532773615670874 +6 0.58075496826088835 0.62077282856651106 -0.01995679162257755 -0.40908951563845819 0.11026240062152064 -0.31217696876264217 +6 -0.2011053790337092 -0.462204381963504 0.52235264924999425 -0.52403901785865747 0.0083805492421482313 -0.44540354712899355 diff --git a/Triangulation/test/Triangulation/test_triangulation_static_filters_4.cpp b/Triangulation/test/Triangulation/test_triangulation_static_filters_4.cpp new file mode 100644 index 00000000000..aa332b213a8 --- /dev/null +++ b/Triangulation/test/Triangulation/test_triangulation_static_filters_4.cpp @@ -0,0 +1,64 @@ +// Switch off the static filters for 4, 5, and 6 points. +// #define CGAL_NO_STATIC_FILTER_456 + +#include +#include +#include +#include +#include +#include +#include +#include + +typedef CGAL::Epick_d< CGAL::Dimension_tag<4> > K; +typedef CGAL::Triangulation_vertex Vertex; +typedef CGAL::Triangulation_ds_full_cell DS_full_cell; +typedef CGAL::Triangulation_full_cell Full_cell; +typedef CGAL::Triangulation_data_structure, + Vertex, + Full_cell> TDS; +typedef CGAL::Triangulation Triangulation; + + +int main() +{ + const int D = 4; // we work in Euclidean 4-space + + std::vector points; + std::ifstream in("data/points_4.txt"); + Triangulation::Point p; + int d; + in >> d; + assert(d == D); + int n; + in >> n; + std::cout << n << " points in dimension " << d << std::endl; + points.reserve(n); + while (in >> p) { + points.push_back(p); + } + CGAL::Timer timer; + timer.start(); + Triangulation t(D); // create triangulation + assert(t.empty()); + + //std::array ar = { 0, 0, 0, 0}; + //Triangulation::Point orig(ar.begin(), ar.end()); + //t.insert(orig); // insert origin + t.insert(points.begin(), points.end()); // compute triangulation + + std::cout << "Time taken to insert "<< points.size() << " points: " << timer.time() << " seconds." << std::endl; + timer.reset(); + assert( t.is_valid() ); + // - - - - - - - - - - - - - - - - - - - - - - - - STEP 2 + typedef Triangulation::Face Face; + typedef std::vector Faces; + Faces edges; + std::back_insert_iterator out(edges); + t.tds().incident_faces(t.infinite_vertex(), 1, out); + // collect faces of dimension 1 (edges) incident to the infinite vertex + std::cout << "There are " << edges.size() + << " vertices on the convex hull." << std::endl; + std::cout << "Time taken to find edges: " << timer.time() << " seconds." << std::endl; + return 0; +} \ No newline at end of file diff --git a/Triangulation/test/Triangulation/test_triangulation_static_filters_5.cpp b/Triangulation/test/Triangulation/test_triangulation_static_filters_5.cpp new file mode 100644 index 00000000000..fb2cebc8cf5 --- /dev/null +++ b/Triangulation/test/Triangulation/test_triangulation_static_filters_5.cpp @@ -0,0 +1,64 @@ +// Switch off the static filters for 4, 5, and 6 points. +// #define CGAL_NO_STATIC_FILTER_456 + +#include +#include +#include +#include +#include +#include +#include +#include + +typedef CGAL::Epick_d< CGAL::Dimension_tag<5> > K; +typedef CGAL::Triangulation_vertex Vertex; +typedef CGAL::Triangulation_ds_full_cell DS_full_cell; +typedef CGAL::Triangulation_full_cell Full_cell; +typedef CGAL::Triangulation_data_structure, + Vertex, + Full_cell> TDS; +typedef CGAL::Triangulation Triangulation; + + +int main() +{ + const int D = 5; // we work in Euclidean 5-space + + std::vector points; + std::ifstream in("data/points_5.txt"); + Triangulation::Point p; + int d; + in >> d; + assert(d == D); + int n; + in >> n; + points.reserve(n); + while (in >> p) { + points.push_back(p); + } + + CGAL::Timer timer; + timer.start(); + Triangulation t(D); // create triangulation + assert(t.empty()); + + //std::array ar = { 0, 0, 0, 0, 0 }; + //Triangulation::Point orig(ar.begin(), ar.end()); + //t.insert(orig); // insert origin + t.insert(points.begin(), points.end()); // compute triangulation + + std::cout << "Time taken to insert "<< points.size() << " points: " << timer.time() << " seconds." << std::endl; + timer.reset(); + assert( t.is_valid() ); + // - - - - - - - - - - - - - - - - - - - - - - - - STEP 2 + typedef Triangulation::Face Face; + typedef std::vector Faces; + Faces edges; + std::back_insert_iterator out(edges); + t.tds().incident_faces(t.infinite_vertex(), 1, out); + // collect faces of dimension 1 (edges) incident to the infinite vertex + std::cout << "There are " << edges.size() + << " vertices on the convex hull." << std::endl; + std::cout << "Time taken to find edges: " << timer.time() << " seconds." << std::endl; + return 0; +} \ No newline at end of file diff --git a/Triangulation/test/Triangulation/test_triangulation_static_filters_6.cpp b/Triangulation/test/Triangulation/test_triangulation_static_filters_6.cpp new file mode 100644 index 00000000000..624ff5c7cdf --- /dev/null +++ b/Triangulation/test/Triangulation/test_triangulation_static_filters_6.cpp @@ -0,0 +1,83 @@ + +#include +#include +#include +#include +#include +#include +#include +#include + +typedef CGAL::Epick_d< CGAL::Dimension_tag<6> > K; +typedef CGAL::Triangulation_vertex Vertex; +typedef CGAL::Triangulation_ds_full_cell DS_full_cell; +typedef CGAL::Triangulation_full_cell Full_cell; +typedef CGAL::Triangulation_data_structure, + Vertex, + Full_cell> TDS; +typedef CGAL::Triangulation Triangulation; + + +int main() +{ + const int D = 6; // we work in Euclidean 6-space + + std::vector points; + std::ifstream in("data/points_6.txt"); + Triangulation::Point p; + int d; + in >> d; + assert(d == D); + int n; + in >> n; + points.reserve(n); + while (in >> p) { + points.push_back(p); + } + + CGAL::Timer timer; + timer.start(); + Triangulation t(D); // create triangulation + assert(t.empty()); + + + t.insert_and_index(points.begin(), points.end()); // compute triangulation + + std::cout << "Time taken to insert "<< points.size() << " points: " << timer.time() << " seconds." << std::endl; + timer.reset(); + assert( t.is_valid() ); + + std::vector infinite_cells; + t.tds().incident_full_cells(t.infinite_vertex(), std::back_inserter(infinite_cells)); + + return 0; + std::set> edges; + + for(auto ch : infinite_cells) { + std::vector vertices; + std::cout << "cell" << std::endl; + vertices.reserve(D); + for(int i = 0; i < D + 1; ++i) { + if(ch->vertex(i) != t.infinite_vertex()) { + vertices.push_back(ch->vertex(i)); + std::cout << ch->vertex(i)->data() << " "; + } + } + std::cout << std::endl; + for (int i = 0; i < D-1; i++) { + for (int j = 0; j < D-1; j++) { + + if((i != j) && (vertices[i]->data() < vertices[j]->data())) { + edges.insert(std::make_pair(vertices[i]->data(), vertices[j]->data())); + } + } + } + } + for(auto pair : edges) { + std::cout << "edge between vertices " << pair.first << " and " << pair.second << std::endl; + } + + std::cout << "Time taken to find edges: " << timer.time() << " seconds." << std::endl; + + return 0; +} \ No newline at end of file diff --git a/Triangulation_2/doc/Triangulation_2/CGAL/Triangulation_2.h b/Triangulation_2/doc/Triangulation_2/CGAL/Triangulation_2.h index ffc29f933bb..8ae0ea8c2fe 100644 --- a/Triangulation_2/doc/Triangulation_2/CGAL/Triangulation_2.h +++ b/Triangulation_2/doc/Triangulation_2/CGAL/Triangulation_2.h @@ -472,7 +472,7 @@ const TriangulationDataStructure_2 & tds() const; /// @} -/// \name Non const access +/// \name Non-Const Access /// \attention The responsibility of keeping a valid triangulation belongs to the /// user when using advanced operations allowing a direct manipulation /// of the `tds`. This method is mainly a help for users implementing @@ -528,6 +528,11 @@ is_infinite(Edge_circulator ec) const; bool is_infinite(All_edges_iterator ei) const; +/*! +`true` if `v` is a vertex of the triangulation. +*/ +bool is_vertex(Vertex_handle v) const; + /*! `true` if there is an edge having `va` and `vb` as vertices. @@ -1117,6 +1122,13 @@ in counterclockwise order around `v`. */ Vertex_circulator incident_vertices(Vertex_handle v, Face_handle f) ; +/*! +Returns the degree of `v`, that is, the number of incident vertices. +The infinite vertex is counted. +\pre `v != Vertex_handle()`, `t.is_vertex(v)`. +*/ +size_type degree(Vertex_handle v) const; + /// @} /// \name Traversal Between Adjacent Faces diff --git a/Mesh_2/include/CGAL/Constrained_Delaunay_triangulation_face_base_2.h b/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_face_base_2.h similarity index 98% rename from Mesh_2/include/CGAL/Constrained_Delaunay_triangulation_face_base_2.h rename to Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_face_base_2.h index fe4d4fd9869..77b0fac6238 100644 --- a/Mesh_2/include/CGAL/Constrained_Delaunay_triangulation_face_base_2.h +++ b/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_face_base_2.h @@ -14,7 +14,7 @@ #ifndef CGAL_CONSTRAINED_DELAUNAY_TRIANGULATION_FACE_BASE_2_H #define CGAL_CONSTRAINED_DELAUNAY_TRIANGULATION_FACE_BASE_2_H -#include +#include #include diff --git a/Mesh_2/include/CGAL/Delaunay_mesh_face_base_2.h b/Triangulation_2/include/CGAL/Delaunay_mesh_face_base_2.h similarity index 97% rename from Mesh_2/include/CGAL/Delaunay_mesh_face_base_2.h rename to Triangulation_2/include/CGAL/Delaunay_mesh_face_base_2.h index 5601684ed22..8912e372171 100644 --- a/Mesh_2/include/CGAL/Delaunay_mesh_face_base_2.h +++ b/Triangulation_2/include/CGAL/Delaunay_mesh_face_base_2.h @@ -13,7 +13,7 @@ #ifndef CGAL_DELAUNAY_FACE_BASE_2_H #define CGAL_DELAUNAY_FACE_BASE_2_H -#include +#include #include diff --git a/Mesh_2/include/CGAL/Delaunay_mesh_vertex_base_2.h b/Triangulation_2/include/CGAL/Delaunay_mesh_vertex_base_2.h similarity index 97% rename from Mesh_2/include/CGAL/Delaunay_mesh_vertex_base_2.h rename to Triangulation_2/include/CGAL/Delaunay_mesh_vertex_base_2.h index 0c62a20fb5c..b463ad2c154 100644 --- a/Mesh_2/include/CGAL/Delaunay_mesh_vertex_base_2.h +++ b/Triangulation_2/include/CGAL/Delaunay_mesh_vertex_base_2.h @@ -13,7 +13,7 @@ #ifndef CGAL_DELAUNAY_VERTEX_BASE_2_H #define CGAL_DELAUNAY_VERTEX_BASE_2_H -#include +#include #include diff --git a/Triangulation_2/include/CGAL/Triangulation_2.h b/Triangulation_2/include/CGAL/Triangulation_2.h index 5078301504b..95e331ef2b7 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2.h @@ -294,6 +294,7 @@ public: bool is_infinite(const Edge& e) const; bool is_infinite(const Edge_circulator& ec) const; bool is_infinite(const All_edges_iterator& ei) const; + bool is_vertex(Vertex_handle va) const; bool is_edge(Vertex_handle va, Vertex_handle vb) const; bool is_edge(Vertex_handle va, Vertex_handle vb, Face_handle& fr, int & i) const; @@ -1096,6 +1097,14 @@ is_infinite(const All_edges_iterator& ei) const return is_infinite(*ei); } +template +inline bool +Triangulation_2:: +is_vertex(Vertex_handle va) const +{ + return _tds.is_vertex(va); +} + template inline bool Triangulation_2:: diff --git a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_2.h b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_2.h index 0aee5fb2e42..27815a98f9f 100644 --- a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_2.h +++ b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_2.h @@ -182,6 +182,7 @@ _test_cls_triangulation_2( const Triangul & ) Triangul T0_2; Vertex_handle v0_2_0 = T0_2.insert_first(p0); assert( v0_2_0 != nullptr ); + assert( T0_2.is_vertex(v0_2_0) ); assert( T0_2.dimension() == 0 ); assert( T0_2.number_of_vertices() == 1 ); assert( T0_2.number_of_faces() == 0); diff --git a/Triangulation_3/doc/Triangulation_3/CGAL/Triangulation_3.h b/Triangulation_3/doc/Triangulation_3/CGAL/Triangulation_3.h index 045d2be3c20..32a38695566 100644 --- a/Triangulation_3/doc/Triangulation_3/CGAL/Triangulation_3.h +++ b/Triangulation_3/doc/Triangulation_3/CGAL/Triangulation_3.h @@ -1669,7 +1669,7 @@ OutputIterator finite_adjacent_vertices(Vertex_handle v, OutputIterator vertices) const; /*! -Returns the degree of a vertex, that is, the number of incident vertices. +Returns the degree of `v`, that is, the number of incident vertices. The infinite vertex is counted. \pre `v != Vertex_handle()`, `t.is_vertex(v)`. */ diff --git a/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h b/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h index 19f495dbfbe..eaeb1345a0e 100644 --- a/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h +++ b/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h @@ -19,6 +19,7 @@ #include #include #include +#include namespace CGAL { @@ -47,7 +48,7 @@ namespace CGAL { * @return A dart incident to the infinite vertex. */ template < class LCC, class Triangulation > - typename LCC::Dart_descriptor import_from_triangulation_3 + typename LCC::Dart_descriptor triangulation_3_to_lcc (LCC& alcc, const Triangulation &atr, std::map* avol_to_dart=nullptr) @@ -149,6 +150,21 @@ namespace CGAL { return dart; } +#ifndef CGAL_NO_DEPRECATED_CODE +/*! + \deprecated This function is deprecated since CGAL 6.2. Use `triangulation_3_to_lcc()` instead. +*/ +template +CGAL_DEPRECATED +typename LCC::Dart_descriptor +import_from_triangulation_3(LCC& alcc, const Triangulation& atr, + std::map* avol_to_dart = nullptr) +{ + return triangulation_3_to_lcc(alcc, atr, avol_to_dart); +} +#endif + } // namespace CGAL #endif // CGAL_TRIANGULATION_3_TO_LCC_H