diff --git a/Combinatorial_map/doc/Combinatorial_map/CGAL/Combinatorial_map_operations.h b/Combinatorial_map/doc/Combinatorial_map/CGAL/Combinatorial_map_operations.h index 4944c660254..44f6057fe2b 100644 --- a/Combinatorial_map/doc/Combinatorial_map/CGAL/Combinatorial_map_operations.h +++ b/Combinatorial_map/doc/Combinatorial_map/CGAL/Combinatorial_map_operations.h @@ -10,9 +10,15 @@ Returns a handle on one dart belonging to the new 0-cell. See example in \cgalFigureRef{figinsertvertex}. -If 1-attributes are non `void`, +If \link CombinatorialMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, +if 1-attributes are non `void`, \ref CellAttribute::On_split "Attribute_type<1>::type::On_split"(a,a') is called, with a the original 1-attribute associated with dh and a' the new 1-attribute created during the operation. If set, the dynamic onsplit function of 1-attributes is also called on a and a'. +\cgalAdvancedBegin +If \link CombinatorialMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are +not updated; thus the combinatorial map can be no more valid after this operation. +\cgalAdvancedEnd + \sa `CGAL::insert_cell_0_in_cell_2` \sa `CGAL::insert_cell_1_in_cell_2` \sa `CGAL::insert_dangling_cell_1_in_cell_2` @@ -39,9 +45,14 @@ Returns a handle on one dart belonging to the new 0-cell. See example in \cgalFigureRef{figtriangulate}. -If 2-attributes are non `void`, +If \link CombinatorialMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, +if 2-attributes are non `void`, \ref CellAttribute::On_split "Attribute_type<2>::type::On_split"(a,a') is called, with a the original 2-attribute associated with `dh` and a' each new 2-attribute created during the operation. If set, the dynamic onsplit function of 2-attributes is also called on a and a'. +\cgalAdvancedBegin +If \link CombinatorialMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are +not updated; thus the combinatorial map can be no more valid after this operation. +\cgalAdvancedEnd \sa `CGAL::insert_cell_0_in_cell_2` \sa `CGAL::insert_cell_1_in_cell_2` @@ -68,8 +79,13 @@ Returns \f$ \beta_0\f$(`dh1`), a handle on one dart belonging to the new 1-cell. See example in \cgalFigureRef{figinsertedge}. -If 2-attributes are non `void`, \ref CellAttribute::On_split "Attribute_type<2>::type::On_split"(a,a') is called, with a the original 2-attribute associated with `dh` and a' the new 2-attribute created during the operation. If set, the dynamic onsplit function of 2-attributes is also called on a and a'. +If \link CombinatorialMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, +if 2-attributes are non `void`, \ref CellAttribute::On_split "Attribute_type<2>::type::On_split"(a,a') is called, with a the original 2-attribute associated with `dh` and a' the new 2-attribute created during the operation. If set, the dynamic onsplit function of 2-attributes is also called on a and a'. +\cgalAdvancedBegin +If \link CombinatorialMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are +not updated; thus the combinatorial map can be no more valid after this operation. +\cgalAdvancedEnd \sa `CGAL::is_insertable_cell_1_in_cell_2` \sa `CGAL::insert_cell_0_in_cell_1` @@ -98,8 +114,13 @@ Returns a handle on one dart belonging to the new 2-cell. See example in \cgalFigureRef{figinsertface}. -If 3-attributes are non `void`, \ref CellAttribute::On_split "Attribute_type<3>::type::On_split"(a,a') is called, with a the original 3-attribute associated with `dh` and a' the new 3-attribute created during the operation. If set, the dynamic onsplit function of 3-attributes is also called on a and a'. +If \link CombinatorialMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, +if 3-attributes are non `void`, \ref CellAttribute::On_split "Attribute_type<3>::type::On_split"(a,a') is called, with a the original 3-attribute associated with `dh` and a' the new 3-attribute created during the operation. If set, the dynamic onsplit function of 3-attributes is also called on a and a'. +\cgalAdvancedBegin +If \link CombinatorialMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are +not updated; thus the combinatorial map can be no more valid after this operation. +\cgalAdvancedEnd \sa `CGAL::is_insertable_cell_2_in_cell_3` \sa `CGAL::insert_cell_0_in_cell_1` @@ -129,6 +150,10 @@ Returns a handle on the dart belonging to the new 1-cell and to the new 0-cell. See example in \cgalFigureRef{figinsertedge}. +\cgalAdvancedBegin +If \link CombinatorialMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are +not updated; thus the combinatorial map can be no more valid after this operation. +\cgalAdvancedEnd \sa `CGAL::insert_cell_0_in_cell_1` \sa `CGAL::insert_cell_0_in_cell_2` @@ -136,7 +161,6 @@ See example in \cgalFigureRef{figinsertedge}. \sa `CGAL::insert_cell_2_in_cell_3` \sa `CGAL::remove_cell` - */ template < class CMap > typename CMap::Dart_handle insert_dangling_cell_1_in_cell_2(CMap& cm, @@ -157,11 +181,9 @@ This is possible if `dh1`\f$ \neq\f$`dh2` and `dh1`\f$ \in\f$\f$ \langle{}\f$\f$ `*dh1`\f$ \in\f$\ref CombinatorialMap::darts "cm.darts()", and `*dh2`\f$ \in\f$\ref CombinatorialMap::darts "cm.darts()". - \sa `CGAL::insert_cell_1_in_cell_2` \sa `CGAL::is_insertable_cell_2_in_cell_3` - */ template < class CMap > bool is_insertable_cell_1_in_cell_2(const CMap & cm, @@ -181,11 +203,9 @@ iff each couple of consecutive darts of the path a1 and a2 belong same vertex and the same volume, and if the path is closed. \pre \ref CombinatorialMap::dimension "CMap::dimension"\f$ \geq\f$ 3. - \sa `CGAL::insert_cell_2_in_cell_3` \sa `CGAL::is_insertable_cell_1_in_cell_2` - */ template bool is_insertable_cell_2_in_cell_3(const CMap & cm, @@ -226,9 +246,16 @@ Returns the number of darts removed from `cm`. See examples in \cgalFigureRef{figinsertvertex}, \cgalFigureRef{figinsertedge} and \cgalFigureRef{figinsertface}. -If `i`\f$ <\f$\ref CombinatorialMap::dimension "CMap::dimension", and i+1-attributes are non `void`, and if there are two distinct (i+1)-cells around dart `dh`, \ref CellAttribute::On_merge "Attribute_type::type::On_merge"(a1,a2) is called, with a1 the (i+1)-attribute associated to `dh`, and a2 the (i+1)-attribute associated to \f$ \beta_{i+1}\f$(dh). If set, the dynamic onmerge function of i+1-attributes is also called on a1 and a2. +If \link CombinatorialMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, +if `i`\f$ <\f$\ref CombinatorialMap::dimension "CMap::dimension", and i+1-attributes are non `void`, and if there are two distinct (i+1)-cells around dart `dh`, \ref CellAttribute::On_merge "Attribute_type::type::On_merge"(a1,a2) is called, with a1 the (i+1)-attribute associated to `dh`, and a2 the (i+1)-attribute associated to \f$ \beta_{i+1}\f$(dh). If set, the dynamic onmerge function of i+1-attributes is also called on a1 and a2. -If a j-cell is disconnected in two j-cells during the operation, and if j-attributes are non void, \ref CellAttribute::On_split "Attribute_type::type::On_split"(a,a') is called with a the original j-attribute and a' the new j-attribute created due to the disconnection. If set, the dynamic onsplit function of j-attributes is also called on a and a'. +If \link CombinatorialMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, +if a j-cell is disconnected in two j-cells during the operation, and if j-attributes are non void, \ref CellAttribute::On_split "Attribute_type::type::On_split"(a,a') is called with a the original j-attribute and a' the new j-attribute created due to the disconnection. If set, the dynamic onsplit function of j-attributes is also called on a and a'. + +\cgalAdvancedBegin +If \link CombinatorialMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are +not updated; thus the combinatorial map can be no more valid after this operation. +\cgalAdvancedEnd \sa `CGAL::is_removable` \sa `CGAL::insert_cell_0_in_cell_1` diff --git a/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt b/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt index b3b6d3c99c5..8a4f08882d8 100644 --- a/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt +++ b/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt @@ -1103,12 +1103,12 @@ operation has duplicated the \cgalAdvancedBegin If one wants to modify a combinatorial map manually, it is possible to switch off the updating between darts and -attributes by passing `false` as last argument of -\ref CombinatorialMap::sew "sew(dh1,dh2,update_attributes=true)" and -\ref CombinatorialMap::unsew "unsew(dh0,update_attributes=true)". In these cases, the +attributes by calling \link CombinatorialMap::set_automatic_attributes_management `set_automatic_attributes_management(false)`\endlink before to call +\ref CombinatorialMap::sew "sew(dh1,dh2)" and +\ref CombinatorialMap::unsew "unsew(dh0)". In these cases, the combinatorial map obtained may be no longer valid due to incorrect associations between darts and attributes. In -\cgalFigureRef{figexemplesew} (Left), if we call \ref CombinatorialMap::sew "sew<3>(1,5,false)", the resulting +\cgalFigureRef{figexemplesew} (Left), if we call \ref CombinatorialMap::sew "sew<3>(1,5)", the resulting combinatorial map is similar to the combinatorial map of \cgalFigureRef{figexemplesew} (Right) (we have linked by \f$ \beta_3\f$ the pairs of darts (1,5), (2,8), (3,7) and (4,6)), but associations between darts @@ -1116,12 +1116,12 @@ and attributes are not valid. Indeed, we have kept the four initial attributes and all the associations between darts and attributes, thus two darts belonging to the same 2-cell (for example darts 1 and 5) are associated with two different attributes. We can also use the -\ref CombinatorialMap::link_beta "link_beta(dh1,dh2,update_attributes=true)" which links `d1` and +\ref CombinatorialMap::link_beta "link_beta(dh1,dh2)" which links `d1` and `d2` by \f$ \beta_i\f$ without modifying the other links. Association between darts and attributes are only modified for darts `d1` and `d2`, and similarly as for \ref CombinatorialMap::sew "sew", this updating can be avoided by -passing `false` as last argument of -\ref CombinatorialMap::link_beta "link_beta(dh1,dh2,update_attributes)". Lastly, we can use +calling \link CombinatorialMap::set_automatic_attributes_management `set_automatic_attributes_management(false)`\endlink before to call +\ref CombinatorialMap::link_beta "link_beta(dh1,dh2)". Lastly, we can use \ref CombinatorialMap::unlink_beta "unlink_beta(dh0)" to unlink `d0` for \f$ \beta_i\f$. In this last case, there is no modification of association between darts and attributes. In \cgalFigureRef{figexemplesew} (Left), if we call diff --git a/Combinatorial_map/doc/Combinatorial_map/Concepts/CombinatorialMap.h b/Combinatorial_map/doc/Combinatorial_map/Concepts/CombinatorialMap.h index aa3873d0e02..9900dd6d9db 100644 --- a/Combinatorial_map/doc/Combinatorial_map/Concepts/CombinatorialMap.h +++ b/Combinatorial_map/doc/Combinatorial_map/Concepts/CombinatorialMap.h @@ -750,7 +750,8 @@ satisfying: f(*dh1)=*dh2, and for all e\f$ \in\f$ j\f$ \in\f${1,\f$ \ldots\f$,i-2,i+2,\f$ \ldots\f$,d}, f(\f$ \beta_j\f$(e))=\f$ \beta_j^{-1}\f$(f(e)). -If `update_attributes` is `true`, when necessary, non void +If \link CombinatorialMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, +when necessary, non void attributes are updated to ensure the validity of the combinatorial map: for each j-cells c1 and c2 which are merged into one j-cell during the sew, the two associated attributes attr1 and attr2 are @@ -765,20 +766,20 @@ the two attributes attr1 and attr2. If set, the dynamic onmerge fu \pre \ref CombinatorialMap::is_sewable "is_sewable(dh1,dh2)". \cgalAdvancedBegin -If `update_attributes` is `false`, non void attributes are +If \link CombinatorialMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are not updated; thus the combinatorial map can be no more valid after this operation. \cgalAdvancedEnd */ -template void sew(Dart_handle dh1, -Dart_handle dh2, bool update_attributes=true); +template void sew(Dart_handle dh1,Dart_handle dh2); /*! i-unsew darts `*dh` and \f$ \beta_i\f$`(*dh)`, by keeping the combinatorial map valid. Unlinks by \f$ \beta_i\f$ all the darts in the orbit \f$ \langle{}\f$\f$ \beta_1\f$,\f$ \ldots\f$,\f$ \beta_{i-2}\f$,\f$ \beta_{i+2}\f$,\f$ \ldots\f$,\f$ \beta_d\f$\f$ \rangle{}\f$(`*dh`). If -`update_attributes` is `true`, when necessary, non void +\link CombinatorialMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, +when necessary, non void attributes are updated to ensure the validity of the combinatorial map: for each j-cell c split in two j-cells c1 and c2 by the operation, if c is associated to a j-attribute attr1, then @@ -791,17 +792,17 @@ two attributes attr1 and attr2. If set, the dynamic onsplit functi `*dh`\f$ \in\f$`darts()` and `*dh` is not i-free. \cgalAdvancedBegin -If `update_attributes` is `false`, non void attributes are +If \link CombinatorialMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are not updated thus the combinatorial map can be no more valid after this operation. \cgalAdvancedEnd */ -template void unsew(Dart_handle dh, bool -update_attributes=true); +template void unsew(Dart_handle dh); /*! Links `*dh1` and `*dh2` by \f$ \beta_i\f$. The combinatorial map can be no more valid after this operation. If -`update_attributes` is true, non void attributes of `*dh1` and +\link CombinatorialMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, +non void attributes of `*dh1` and `*dh2` are updated: if one dart has an attribute and the second dart not, the non null attribute is associated to the dart having a null attribute. If both darts have an attribute, @@ -809,7 +810,7 @@ the attribute of `*dh1` is associated to `*dh2`. \pre 0\f$ \leq\f$i\f$ \leq\f$\ref CombinatorialMap::dimension "dimension", `*dh1`\f$ \in\f$`darts()`, `*dh2`\f$ \in\f$`darts()` and (i\f$ <\f$ 2 or `dh1`\f$ \neq\f$`dh2`). */ -template void link_beta(Dart_handle dh1, Dart_handle dh2, bool update_attributes=true); +template void link_beta(Dart_handle dh1, Dart_handle dh2); /*! Unlinks `*dh` and \f$ \beta_i\f$(`*dh`) by \f$ \beta_i\f$. diff --git a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Linear_cell_complex.h b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Linear_cell_complex.h index d51636176fa..1b8e201170e 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Linear_cell_complex.h +++ b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Linear_cell_complex.h @@ -268,11 +268,7 @@ void set_vertex_attribute(Dart_handle dh, Vertex_attribute_handle vh); Correct the invalid attributes of the linear cell complex. We can have invalid attribute either if we have called \link CombinatorialMap::set_automatic_attributes_management `set_automatic_attributes_management(false)`\endlink before to use some modification operations. -\f$ \forall i \f$, 0 \f$ \leq \f$ i \f$ \leq \f$ \ref CombinatorialMap::dimension "dimension" such that the i-attributes are non void, \f$ \forall \f$ d \f$ \in\f$`darts()`: - - if there exists a dart `d2` in the same i-cell than `d` with a different i-attribute, then the i-attribute of `d2` is set to the i-attribute of `d`; - - if there exists a dart `d2` in a different i-cell than `d` with the same i-attribute, then the i-attribute of all the darts in i-cell(`d`) is set to a new i-attribute (copy of the original attribute); - - ensure that \link CombinatorialMap::dart_of_attribute `dart_of_attribute(d)`\endlink \f$ \in \f$ i-cell(`d`); - - if \link Linear_cell_complex::vertex_attribute `vertex_attribute(d)`\endlink`==NULL`, then the vertex attribute of all the darts in 0-cell(`d`) is set to a new \link Linear_cell_complex::Vertex_attribute `Vertex_attribute`\endlink. +The validation process of a linear cell complex validates its combinatorial map (cf. \link CombinatorialMap::correct_invalid_attributes `correct_invalid_attributes()`\endlink), and for each dart `d` having no vertex attribute, a new vertex attribute is created, with its Point initialized to `CGAL::Origin`, and all the darts of the 0-cell containing `d` are linked with the new attribute. */ void correct_invalid_attributes(); @@ -293,11 +289,17 @@ Inserts a point, copy of `p`, in the i-cell containing `dh`. Returns a handle on one dart of this cell. \pre i\f$ \leq\f$\ref CombinatorialMap::dimension "dimension"\f$ \leq\f$2 and `*dh`\f$ \in\f$\ref CombinatorialMap::darts "darts()". -If i-attributes are non void, +If \link CombinatorialMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, +if i-attributes are non void, \ref CellAttribute::On_split "Attribute_type::type::On_split"(a,a') is called, with a the original i-attribute associated with dh and a' each new i-attribute created during the operation. +\cgalAdvancedBegin +If \link CombinatorialMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are +not updated; thus the combinatorial map can be no more valid after this operation. +\cgalAdvancedEnd + */ template Dart_handle insert_point_in_cell(Dart_handle dh, Point p); @@ -306,11 +308,17 @@ Inserts a point in the barycenter of the i-cell containing `dh`. Returns a handle on one dart of this cell. \pre i\f$ \leq\f$\ref CombinatorialMap::dimension "dimension"\f$ \leq\f$2 and `*dh`\f$ \in\f$\ref CombinatorialMap::darts "darts()". -If i-attributes are non void, +If \link CombinatorialMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, +if i-attributes are non void, \ref CellAttribute::On_split "Attribute_type::type::On_split"(a,a') is called, with a the original i-attribute associated with dh and a' each new i-attribute created during the operation. +\cgalAdvancedBegin +If \link CombinatorialMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are +not updated; thus the combinatorial map can be no more valid after this operation. +\cgalAdvancedEnd + */ template Dart_handle insert_barycenter_in_cell(Dart_handle dh); @@ -321,6 +329,11 @@ The second vertex is associated with a new 0-attribute containing a copy of `p` as point. Returns a handle on one dart belonging to the new 0-cell. \pre 2\f$ \leq\f$\ref CombinatorialMap::dimension "dimension" and `*dh`\f$ \in\f$\ref CombinatorialMap::darts "darts()". +\cgalAdvancedBegin +If \link CombinatorialMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are +not updated; thus the combinatorial map can be no more valid after this operation. +\cgalAdvancedEnd + */ Dart_handle insert_dangling_cell_1_in_cell_2(Dart_handle dh, Point p);