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

Edge insertion for CMap/GMap #7409

Merged
merged 30 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
669ba26
Allow the use of Foreach_enabled_attributes internal functor starting…
gdamiand Nov 25, 2022
45ee81d
add insert_cell_1_between_two_cells_2 method in genericmap concept
gdamiand Nov 25, 2022
01c05d8
Add index method in cc with index, taking an index as parameter.
gdamiand Nov 25, 2022
bb263e0
add insert_cell_1_between_two_cells_2 method in CMap and GMap
gdamiand Nov 25, 2022
8d66f69
add a function in tests to create all possible attributes.
gdamiand Nov 25, 2022
d381bfb
Add a parameter to group functor to deal with the case where first da…
gdamiand Nov 30, 2022
9687395
Bug fix for remove and contrat operations for CMap and GMap
gdamiand Nov 30, 2022
8b11424
add one insertion test for cmap
gdamiand Nov 30, 2022
f8b6e2c
Bug fix in gmap tests, for the second dart given as parameter to the …
gdamiand Nov 30, 2022
caf6d1b
update lcc test in 2D and 4d
gdamiand Nov 30, 2022
7803086
Start to debug cmap/gmap insertion (nyf)
gdamiand Apr 25, 2023
79ac67c
Create all attributes for LCC tests; add draw to debug (todo: remove …
gdamiand Apr 25, 2023
57f0b89
bug fix in insert cell 1 between two 2 cells
gdamiand Apr 25, 2023
c9a683b
Start to reintroduce last master modifications
gdamiand Apr 26, 2023
eb9dd93
Merge master
gdamiand Apr 26, 2023
1237c7a
Remove a warning for lcc tests
gdamiand Jun 9, 2023
a9e1d59
more warnings lcc
gdamiand Jun 13, 2023
b994bc3
True and on-merge in doc
gdamiand Jun 20, 2023
32655a7
Add () after function names in sa
gdamiand Jun 20, 2023
e4d98ef
add an example for cmap insert cell 1 between two cells 2
gdamiand Jun 21, 2023
e3c36d3
add one example in the user manual
gdamiand Jun 21, 2023
24b38f2
add example
gdamiand Jun 21, 2023
8fb08a1
Update changes.md
gdamiand Jun 21, 2023
4798874
add the example and update the anchor
gdamiand Jun 21, 2023
a2ab7a2
Small corrections in the doc
gdamiand Jun 22, 2023
28ea0d4
Using
gdamiand Jun 22, 2023
c44371a
Merge branch 'master' into CMap-insert-gdamiand
gdamiand Jun 22, 2023
3ed60dc
Examples for insert between two different 2-cells
gdamiand Jun 23, 2023
edc11a8
Example of insert edge between two different 2-cells, for cmap, gmap …
gdamiand Jun 23, 2023
21f945e
Update change (insert concerns both cmap and gmap)
gdamiand Jun 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ Considering these different advantages and drawbacks, you can choose to use gene

The diagram in \cgalFigureRef{fig_cmap_diagramme_class} shows the different classes of the package. `Combinatorial_map` is the main class (see Section \ref sseccombinatorialmap "Combinatorial Maps"). It allows to manage darts and attributes (see Section \ref ssecattributes "Cell Attributes"). Users can customize a combinatorial map thanks to an items class (see Section \ref ssecitem "Combinatorial Map Items"), which defines the information associated with darts and the attribute types. These types may be different for different dimensions, and they may also be void (note that the main concepts of `GenericMap`, `GenericMapItems` and `CellAttribute` are shared between combinatorial maps and generalized maps).

The darts and attributes are accessed through <I>descriptors</I> (either Indices or Handles). A handle is a model of the `Handle` concept, thus supporting the two dereference operators `operator*` and `operator->`. All handles are model of `LessThanComparable` and `Hashable`, that is they can be used as keys in containers such as `std::map` and `std::unordered_map`. An index is a model of the `Index` concept, which is mainly an integer which is convertible from and to std::size_t. Indices can be used as index into vectors which store properties (cf. one example in Section \ref ssecexample3DCMWI "3D Combinatorial Map using Indices").
The darts and attributes are accessed through <I>descriptors</I> (either Indices or Handles). A handle is a model of the `Handle` concept, thus supporting the two dereference operators `operator*` and `operator->`. All handles are model of `LessThanComparable` and `Hashable`, that is they can be used as keys in containers such as `std::map` and `std::unordered_map`. An index is a model of the `Index` concept, which is mainly an integer which is convertible from and to std::size_t. Indices can be used as index into vectors which store properties (cf. one example in Section \ref ssecexample3DCMWI "3D Combinatorial Map Using Indices").

\cgalFigureBegin{fig_cmap_diagramme_class,cmap_diagramme_class.svg}
UML diagram of the main classes of the package. k is the number of non void attributes.
Expand Down Expand Up @@ -393,6 +393,8 @@ Example of \link GenericMap::insert_cell_1_in_cell_2 `insert_cell_1_in_cell_2`\e

`cm.`\link GenericMap::insert_dangling_cell_1_in_cell_2 `insert_dangling_cell_1_in_cell_2(d0)`\endlink adds a 1-cell in the 2-cell containing dart `d0`, the 1-cell being attached by only one of its vertex to the 0-cell containing dart `d0`. This operation is possible if `d0`\f$ \in \f$ \link GenericMap::darts `cm.darts()`\endlink.

`cm.`\link GenericMap::insert_cell_1_between_two_cells_2 `insert_cell_1_between_two_cells_2(d1,d2)`\endlink adds a 1-cell between the two faces containing containing darts `d1` and `d2`, between the two 0-cells containing darts `d1` and `d2`. The 2-cells are merged in one. This operation is possible if <I>d1</I>\f$ \not \in \f$ \f$ \langle{}\f$\f$ \beta_1\f$\f$ \rangle{}\f$(<I>d2</I>) which can be tested thanks to `cm.`\link GenericMap::is_insertable_cell_1_between_two_cells_2 `is_insertable_cell_1_between_two_cells_2(d1,d2)`\endlink.

`cm.`\link GenericMap::insert_cell_2_in_cell_3 `insert_cell_2_in_cell_3(itbegin,itend)`\endlink adds a 2-cell in the 3-cell containing all the darts between `itbegin` and `itend`, along the path of 1-cells containing darts in [`itbegin`,`itend`). The 3-cell is split in two. This operation is possible if all the darts in [`itbegin`,`itend`) form a closed path inside a same 3-cell which can be tested thanks to `cm.`\link GenericMap::is_insertable_cell_2_in_cell_3 `is_insertable_cell_2_in_cell_3(itbegin,itend)`\endlink (see example on \cgalFigureRef{fig_cmap_insert_facet}).

\cgalFigureBegin{fig_cmap_insert_facet,cmap_insert_facet.svg}
Expand Down Expand Up @@ -456,6 +458,24 @@ The second line is the result after the removal operations. We retrieve the orig
Example of high level operations. Left: Initial 3D combinatorial map after the creation of the combinatorial hexahedron. Middle: Combinatorial map obtained after the two 1-cell insertions. The two 2-cells were split in two. Right: Combinatorial map obtained after the 2-cell insertion. The 3-cell was split in two.
\cgalFigureEnd

\subsection Combinatorial_mapInsertion Insert an Edge Between Two Different Faces

\anchor ssecexempleinsertion

This example shows the use of \link GenericMap::insert_cell_1_between_two_cells_2 `insert_cell_1_between_two_cells_2`\endlink operation. First we create a combinatorial hexahedron and a face with 4 edges. This face is inserted in the face of the hexahedron containing dart d1. We display the characteristics of the combinatorial map and check its validity. Then we count and display the number of 2-free darts.

\cgalExample{Combinatorial_map/map_3_insert.cpp}

The output is:
\verbatim
#Darts=30, #0-cells=12, #1-cells=17, #2-cells=6, #3-cells=1, #ccs=1, valid=1
Number of 2-free darts: 4
\endverbatim

We can verify that there are 6 2-cells after the insertion since the squared face was inserted as a hole in one face of the hexahedron. We can also see that there are 4 2-free darts, which are the darts of the squared face. Since they bound an hole, there is no face filling the hole and thus 4 darts are 2-free.

See also a similar example for Linear cell complex \ref Linear_cell_complexInsert "Insert an Edge Between Two Different Faces".

\subsection Combinatorial_mapA4DGenericMap A 4D Combinatorial Map

In this example, a 4-dimensional combinatorial map is used. Two tetrahedral cells are created and sewn by \f$ \beta_4\f$. Then the numbers of cells of the combinatorial map are displayed, and its validity is checked.
Expand Down Expand Up @@ -502,7 +522,7 @@ Lastly we remove the dynamic onmerge functor (step 7). This is done by initializ

\cgalExample{Combinatorial_map/map_3_dynamic_onmerge.cpp}

\subsection ssecexample3DCMWI 3D Combinatorial Map using Indices
\subsection ssecexample3DCMWI 3D Combinatorial Map Using Indices

In this example, a 3-dimensional combinatorial map is used, but using indices instead of handles. Two vectors are created to store some external information associated with darts and 3-attributes. Since descriptors are indices, they can directly be used to access elements of the vector.

Expand Down
Loading