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 42 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.
Copy link

The documentation is built. It will be available, after a few minutes, here: https://cgal.github.io/8273/doc/Manual/index.html

... and add a default constructor to create an
empty range (with singular iterators).
- refactor the member function `enclosing_constraint`
- refactor things around `sc_to_sc_map`, using new member functions
  to encapsulate the logic
- remove unused/undocuments functions
... 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

auto disp_vertex = [&vertex_num_map](Vertex_handle v) {
return CGAL::IO::oformat(
[v, &vertex_num_map](auto& os) -> decltype(os)& {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[v, &vertex_num_map](auto& os) -> decltype(os)& {
[v](auto& os) -> decltype(os)& {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I must reject this suggestion, because vertex_num_map is used, line 1310, in case the vertex type does not have timestamps. I will add a [[maybe_unused]].

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).
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