Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement backports from CDT_3 branch (Follow-up to PR #8170) #8273

Draft
wants to merge 47 commits into
base: master
Choose a base branch
from

Conversation

lrineau
Copy link
Member

@lrineau lrineau commented Jun 10, 2024

Summary of Changes

In the PR #8170, merged for CGAL-6.0, there was several commits that I had to revert, because they broke the testsuite results:

This pull-request reintroduces those features, for CGAL-6.1.

Release Management

  • Affected package(s):
  • License and copyright ownership: maintenance by GeometryFactory

@lrineau

This comment was marked as outdated.

@lrineau

This comment was marked as outdated.

lrineau added a commit to lrineau/cgal that referenced this pull request Jul 1, 2024
@lrineau lrineau changed the title Follow-up to PR #8170 Improvement backports from CDT_3 branch (Follow-up to PR #8170) Aug 22, 2024
@lrineau

This comment was marked as off-topic.

@lrineau

This comment was marked as off-topic.

@lrineau

This comment was marked as off-topic.

This comment was marked as off-topic.

...and `refactor Polyline_constraint_hierarchy_2` to use it.

`CGAL::unordered_flat_map` will be Boost `unordered_flat_map` if availlable, or the standard `std::unordered_map` otherwise.
To debug non-determinism on Linux platforms.
That uses Boost.STLInterfaces from Boost >= 1.74.
  That code was never used nor tested, and cannot compile anyway.
- remove all mentions of `Edge` and `Constraint`
- `Subconstraint_iterator` is renamed `Subconstraint_and_contexts_iterator` (because of its value type)
- a new `Subconstraint_iterator`, with value type `Subconstraint`
- a few unused/untested and uncompilable functions are removed from the code
- a lot of internal renamings

== Breaking changes ==

For `Constrained_triangulation_plus_2`, there are a few breaking changes...

- The value type of `subconstraints_begin()`, `subconstraints_end()`, of the range `subconstraints()` has changed to `Subconstraint` (a simple `std::pair` of vertex handles). That is actually a kind of bug-fix, because it was documented as such in the user manual.
- The new member functions `subconstraints_and_contexts_begin()`, `subconstraints_and_contexts_end()`, `subconstraints_and_contexts()` are created get the old value type (`std::pair<const Subconstraint, std::list<Context>*>`).
- A few range types have changed from `CGAL::Iterator_range<It>` to `unspecified_type`, for efficiency reasons.
- Doc fixes.

== Determinism ==

Even if it was not documented, the range `subconstraints()` is deterministic (used by Mesh_2), and `subconstraints_and_contexts()` is not.
... add switch to `using` in the whole file.
Instead of storing the hierarchy as a data member, store it
as a hidden (protected) base class. That allows to forward
member functions easily with using-declarations. That also avoids
mismatches between the names in the triangulation and the hierarchy.
- encapsulate the creation/erasure of constraints in the hierarchy class
- add encapsulation in the hierarchy class, to detect direct uses of members
- add a test of `CDt_plus_2::insert_vertex_in_constraint`, and fix it
- rename `concatenate` and `concatenate2` to
  - `concatenate`
  - `prepend`
  and force a rvalue reference on the argument corresponding to the constraint
  that will be swallowed
- rename `split` to `split_tail` and `split2` to `split_head`
- rename `fix_contexts` to give it a longer self-explaning name
VC++ 19.16 thought there was an ambiguous call to `operator==`
between `skip_iterator` and `skip_iterator` in the internals of `boost::iterator_adaptor` (yet another matching bug) of VC++ 19.16).

I solved it by using the more modern `boost::stl_interfaces::iterator_interface` from Boost.STLintface (Boost>=1.74).
@afabri
Copy link
Member

afabri commented Jan 29, 2025

more errors:


    35>C:\CGAL_ROOT\CGAL-6.1-Ic-73\include\CGAL/Constrained_Delaunay_triangulation_2.h(912): error C2244: 'CGAL::Constrained_Delaunay_triangulation_2<Gt,Tds_,Itag_>::virtual_insert': unable to match function definition to an existing declaration [C:\CGAL_ROOT\CGAL-6.1-Ic-73\cmake\platforms\MSVC2017-Release-64bits\test\Triangulation_2\issue_3447.vcxproj]
         C:\CGAL_ROOT\CGAL-6.1-Ic-73\include\CGAL/Constrained_Delaunay_triangulation_2.h(907): note: see declaration of 'CGAL::Constrained_Delaunay_triangulation_2<Gt,Tds_,Itag_>::virtual_insert'
         C:\CGAL_ROOT\CGAL-6.1-Ic-73\include\CGAL/Constrained_Delaunay_triangulation_2.h(912): note: definition
         C:\CGAL_ROOT\CGAL-6.1-Ic-73\include\CGAL/Constrained_Delaunay_triangulation_2.h(912): note: 'Constrained_Delaunay_triangulation_2<Gt,Tds_,Itag_>::Vertex_handle CGAL::Constrained_Delaunay_triangulation_2<Gt,Tds_,Itag_>::virtual_insert(const Constrained_Delaunay_triangulation_2<Gt,Tds_,Itag_>::Geom_traits::Point_2 

@afabri
Copy link
Member

afabri commented Jan 30, 2025

Meshing the triangulation with size 0...C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.16.27023\include\xtree(275) : Assertion failed: map/set iterators incompatible

here

@afabri
Copy link
Member

afabri commented Jan 30, 2025

/mnt/testsuite/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h:129:61: error: static assertion failed
  129 |   BOOST_STL_INTERFACES_STATIC_ASSERT_CONCEPT(Point_it, std::bidirectional_iterator);

here

@afabri
Copy link
Member

afabri commented Jan 30, 2025

include\CGAL/Base_with_time_stamp.h(23): error C2248: 'CGAL::Constrained_triangulation_face_base_2<K,CGAL::Triangulation_face_base_2<Gt,CGAL::Triangulation_ds_face_base_2<void>>>::Base': cannot access private typedef declared in class 'CGAL::Constrained_triangulation_face_base_2<K,CGAL::Triangulation_face_base_2<Gt,CGAL::Triangulation_ds_face_base_2<void>>>'

here

It is invalid to try to detect if an iterator is singular or value-initialized.
The only operations allowed with value-initialized iterators are:
  - copy the iterator, or
  - destroy or assign the iterator.

Comparisons like `vertex_it == Vertex_it{}` are not allowed.
@lrineau
Copy link
Member Author

lrineau commented Jan 30, 2025

Meshing the triangulation with size 0...C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.16.27023\include\xtree(275) : Assertion failed: map/set iterators incompatible

here

The code was doing bad operations with value-initialized iterators. Fixed in d837dbd.

/mnt/testsuite/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h:129:61: error: static assertion failed
  129 |   BOOST_STL_INTERFACES_STATIC_ASSERT_CONCEPT(Point_it, std::bidirectional_iterator);

here

With C++20, the behavior of Boost.STLinterface was different. I have fixed, and tested with and without C++20. And I found a bug in the macro BOOST_STL_INTERFACES_STATIC_ASSERT_ITERATOR_TRAITS before Boost 1.83.0. That is fixed in 571c2cc.

include\CGAL/Base_with_time_stamp.h(23): error C2248: 'CGAL::Constrained_triangulation_face_base_2<K,CGAL::Triangulation_face_base_2<Gt,CGAL::Triangulation_ds_face_base_2<void>>>::Base': cannot access private typedef declared in class 'CGAL::Constrained_triangulation_face_base_2<K,CGAL::Triangulation_face_base_2<Gt,CGAL::Triangulation_ds_face_base_2<void>>>'

here

A known issue with MSVC 2017 (see the repro). Fixed in 571c2cc as well (it should have been a distinct commit).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants