Commit Graph

130 Commits

Author SHA1 Message Date
Laurent Rineau 161a313109 fix the move semantic of Constrained_triangulation_plus_2
The comparison functor passed to the constraints hierarchy has a
pointer to the `Constrained_triangulation_plus_2` that contains it.
That means the defaulted move constructor and move assignment operator of `Polyline_constraint_hierarchy_2` cannot be used to
implement the move constructor and move assignment operator of
`Constrained_triangulation_plus_2`.

Add a special constructor for `Polyline_constraint_hierarchy_2`, that is
usee to move the hierarchy and reassign the comparison operator.
2025-06-04 00:51:02 +02:00
Laurent Rineau b28a6bc7f6 workaround for MSVC 2019
See https://cgal.geometryfactory.com/CGAL/testsuite/CGAL-6.1-Ic-155/Constrained_triangulation_3/TestReport_Christo_MSVC-2019-Community-Release.gz
2025-05-16 16:46:34 +02:00
Laurent Rineau fa7a62bd69 fix static_assert(std::is_nothrow_move_assignable<CDT_plus_2> 2025-04-29 11:52:40 +02:00
Laurent Rineau d3fe6989fa fix memory leaks
The move-assignment operator was wrong.
2025-04-28 17:07:43 +02:00
Laurent Rineau 6b97b34a10 Merge 'cgal/master' into Triangulation_3-CDT_3-lrineau 2025-03-21 18:01:23 +01:00
albert-github cc9ab04a27 Spelling correction
Spelling correction
2025-02-19 11:29:09 +01:00
Andreas Fabri db3843bf63 Add #include <stack> 2025-02-13 07:34:28 +00:00
Laurent Rineau 9572c603d5 fix the static assertions about nothrow-movable
```
/mnt/testsuite/include/CGAL/Conforming_constrained_Delaunay_triangulation_3.h:543:23: error: static assertion failed
  543 |   static_assert(CGAL::is_nothrow_movable_v<CDT_3_impl>);
      |                 ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
2025-02-12 13:53:18 +01:00
Laurent Rineau a2571bbab8 Merge remote-tracking branch 'lrineau/CGAL-followup_PR_8170-lrineau' into Triangulation_3-CDT_3-lrineau 2025-02-11 18:26:52 +01:00
Laurent Rineau d837dbde21 fix for STL debug mode
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.
2025-01-30 17:51:20 +01:00
Laurent Rineau 571c2ccadc fix compilation errors with C++>=20, or g++12.2.0 2025-01-30 17:39:32 +01:00
Laurent Rineau c6d6d673af fix compilation error with gcc-12.2 2025-01-29 16:12:04 +01:00
Laurent Rineau b701981572 fix another compilation error
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).
2025-01-28 15:27:48 +01:00
Laurent Rineau 7f88e5b0cf fix compilation errors with MSVC 2017 (VC++ 19.16) 2025-01-28 14:01:58 +01:00
Laurent Rineau 5a1f8cdb21 small optimization 2025-01-28 09:44:42 +01:00
Laurent Rineau 9fa067cb4d recycle the constraints indices 2025-01-24 19:36:57 +01:00
Laurent Rineau b31c2ddbe1 CDt_plus_2: lots of refactoring
- 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
2025-01-24 16:29:56 +01:00
Laurent Rineau 310f4bdf4e glue constraints_set.insert(..) and new_constraint_id()
.. to prepare a refactoring
2025-01-23 18:20:21 +01:00
Laurent Rineau 0d84f271d6 whitespace and comments 2025-01-23 18:14:05 +01:00
Laurent Rineau 796190863c derive Ct_plus_2 from the hierarchy
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.
2025-01-23 17:51:53 +01:00
Laurent Rineau 49a9efa2eb add a nested type using Vertex_handle_compare = Compare;
... add switch to `using` in the whole file.
2025-01-23 16:33:38 +01:00
Laurent Rineau 9f5bee7abd rename contexts_end to contexts_not_found because that name is already used in the class 2025-01-23 16:24:33 +01:00
Laurent Rineau f95027a5c5 Polyline_constraint_hierarchy_2: more refactoring
- 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
2025-01-23 09:36:30 +01:00
Laurent Rineau 58c739c61f clearnup: remove undocumnted/unused member functions 2025-01-23 09:33:35 +01:00
Laurent Rineau 0b4dfa8952 Polyline_constraint_hierarchy_2: get_contexts -> context 2025-01-23 09:33:35 +01:00
Laurent Rineau 7808c6f93d fix the failing test 2025-01-22 22:43:59 +01:00
Laurent Rineau 1ce108778f rewrite/refactor a lot of the code 2025-01-22 16:03:26 +01:00
Laurent Rineau d4e6ffddf4 fix protection against min/max macros
The regular expression I used was:

```
((?!(?:^.*(\/\/|\/\*).*|^ *\* .*|^[^"]*"(?:"[^"]*"|[^"])*))^(?:.*[ ,\(]|))(\b(?:(?:[A-Za-z]+::)*)(?:max|min))\b *\(
```
2025-01-14 16:12:34 +01:00
Laurent Rineau eafa97a862 major cleanup of Polyline_constraint_hierarchy_2
- 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.
2025-01-13 17:06:58 +01:00
Laurent Rineau 926bb0cf89 hierarchy: remove two undefined member functions 2025-01-13 11:36:05 +01:00
Laurent Rineau d468962663 hierarchy: remove `remove_Steiner(T v, T va, T vb)`
That code was never used nor tested, and cannot compile anyway.
2025-01-13 11:36:05 +01:00
Laurent Rineau 93ac1845fa CDT_plus_2 hierarchy: add Edge_iterator, that is deterministic
That uses Boost.STLInterfaces from Boost >= 1.74.
2025-01-13 11:36:05 +01:00
Laurent Rineau 56bb4191ed cleanup existing code 2025-01-13 11:24:30 +01:00
Laurent Rineau 364ba1595c fix a missing #include 2025-01-08 21:53:53 +01:00
Laurent Rineau ea151ff987 fix CGAL_USE_BARE_STD_MAP with Polyline_constraint_hierarchy_2 2025-01-08 21:15:22 +01:00
Laurent Rineau 552685784b Add CGAL::unordered_flat_map implementation
...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.
2025-01-08 11:46:23 +01:00
Laurent Rineau aaac2c2dc1 Merge remote-tracking branch 'cgal/master' into pr/lrineau/8273 2025-01-08 11:34:54 +01:00
Laurent Rineau 196f00c34b Merge remote-tracking branch 'cgal/master' into Triangulation_3-CDT_3-lrineau 2024-12-04 11:27:05 +01:00
Laurent Rineau 2b0c79e85a update reuse to v5 2024-11-26 10:14:17 +01:00
Laurent Rineau 37f3bcfaab Merge remote-tracking branch 'cgal/master' into Triangulation_3-CDT_3-lrineau 2024-09-09 10:57:33 +02:00
Andreas Fabri ff89ba08ad Deal with duplicate lines 2024-08-06 08:06:41 +01:00
Laurent Rineau 93fd96644c use boost::unordered_flat_map to optimize Polyline_constraint_hierarchy_2 2024-06-11 21:59:35 +02:00
Laurent Rineau c0cb990cb9 Revert "use boost::unordered_flat_map to optimize Polyline_constraint_hierarchy_2"
This reverts commit 1ca6c17a2a.
2024-05-22 16:04:49 +02:00
Laurent Rineau 1fb3e0d837 cosmetic change 2024-04-26 16:10:23 +02:00
Laurent Rineau 1ca6c17a2a use boost::unordered_flat_map to optimize Polyline_constraint_hierarchy_2 2024-04-26 13:13:04 +02:00
Laurent Rineau 8e1744fbc1 fix constness 2024-04-26 13:12:05 +02:00
Laurent Rineau 0f8e3eb955 add contexts_range(T va, T vb
a range for `contexts_begin` and `contexts_end` functions.
2024-04-26 12:02:21 +02:00
Sébastien Loriot e7c26349f2 move header in a package to GPL 2024-01-04 13:36:34 +01:00
Laurent Rineau 1d29a75c9a iformat/oformat are in CGAL::IO
The calls without the `IO::` namespace are deprecated.
2023-09-25 16:09:41 +02:00
Andreas Fabri 46b756da12 We know that it is bidirectional, and we prefer that to using const Vertex_handle& 2023-06-27 13:24:27 +01:00