mirror of https://github.com/CGAL/cgal
Update doc of CMap and GMap (cont)
This commit is contained in:
parent
65569a9ff0
commit
ae55b10e8b
|
|
@ -170,7 +170,7 @@ Considering these different advantages and drawbacks, you can choose to use gene
|
|||
|
||||
\section secsoftwaredesign Software Design
|
||||
|
||||
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 (see Section \ref ssecdarts "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 dart type and the attribute types. These types may be different for different dimensions, and they may also be void \tred{(note that the main concepts are shared between combinatorial maps and generalized maps; their name are prefixed by `Basic` except for the `CellAttribute` concept)}.
|
||||
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 (see Section \ref ssecdarts "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 dart type and the attribute types. These types may be different for different dimensions, and they may also be void \tred{(note that the main concepts of `GenericMap`, `GenericMapItems`, `Dart` and `CellAttribute` are shared between combinatorial maps and generalized maps)}.
|
||||
|
||||
The darts and attributes are accessed through <I>handles</I>. 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 `boost::unordered_map`.
|
||||
|
||||
|
|
@ -180,46 +180,46 @@ UML diagram of the main classes of the package. k is the number of non void attr
|
|||
|
||||
\subsection sseccombinatorialmap Combinatorial Maps
|
||||
|
||||
The class `Combinatorial_map<d,Items,Alloc>` is a model of the `CombinatorialMap` concept \tred{which refines the generic concept of `BasicMap`}. It has three template parameters standing for the dimension of the combinatorial map (an `unsigned int`), an items class (a model of the `BasicMapItems` concept), and an allocator which must be a model of the allocator concept of the \stl. %Default classes are provided for the items and the allocator classes.
|
||||
The class `Combinatorial_map<d,Items,Alloc>` is a model of the `CombinatorialMap` concept \tred{which refines the generic concept of `GenericMap`}. It has three template parameters standing for the dimension of the combinatorial map (an `unsigned int`), an items class (a model of the `GenericMapItems` concept), and an allocator which must be a model of the allocator concept of the \stl. %Default classes are provided for the items and the allocator classes.
|
||||
|
||||
The main role of the class `Combinatorial_map` is the storage and the management of darts. It allows to create or remove an isolated dart from the combinatorial map. The \link BasicMap::Dart_handle `Dart_handle`\endlink type defines a handle to the type of used darts (given in the items class). `Combinatorial_map` provides several <I>ranges</I> which allow to iterate over specific subsets of darts of the combinatorial map (see Section \ref ssecrange "Iterating over Orbits, Cells, and Attributes"). It also defines several methods to link and to unlink darts by \f$ \beta_i\f$s (see Section \ref sseclinkdarts "Sewing Orbits and Linking Darts"). We said that a dart <I>d0</I> is <I>i</I>-free if \f$ \beta_i\f$(<I>d0</I>)=\f$ \varnothing\f$. The \f$ \varnothing\f$ constant is represented in the class `Combinatorial_map` through a `Dart_handle` called \link CombinatorialMap::null_dart_handle `null_dart_handle`\endlink. Finally, some high level operations are defined as global functions taking a `Combinatorial_map` as argument (see Section \ref ssecoperations "Removal and Insertion Operations")
|
||||
The main role of the class `Combinatorial_map` is the storage and the management of darts. It allows to create or remove an isolated dart from the combinatorial map. The \link GenericMap::Dart_handle `Dart_handle`\endlink type defines a handle to the type of used darts (given in the items class). `Combinatorial_map` provides several <I>ranges</I> which allow to iterate over specific subsets of darts of the combinatorial map (see Section \ref ssecrange "Iterating over Orbits, Cells, and Attributes"). It also defines several methods to link and to unlink darts by \f$ \beta_i\f$s (see Section \ref sseclinkdarts "Sewing Orbits and Linking Darts"). We said that a dart <I>d0</I> is <I>i</I>-free if \f$ \beta_i\f$(<I>d0</I>)=\f$ \varnothing\f$. The \f$ \varnothing\f$ constant is represented in the class `Combinatorial_map` through a `Dart_handle` called \link CombinatorialMap::null_dart_handle `null_dart_handle`\endlink. Finally, some high level operations are defined as global functions taking a `Combinatorial_map` as argument (see Section \ref ssecoperations "Removal and Insertion Operations")
|
||||
|
||||
The second role of the class `Combinatorial_map` is the storage and the management of attributes. It allows to create or remove an attribute, and provides methods to associate attributes and cells. A range is defined for each <I>i</I>-attribute allowing to iterate over all the <I>i</I>-attributes of the combinatorial map. Finally, `Combinatorial_map` defines several types allowing to manage the attributes. We can use \link BasicMap::Attribute_handle `Combinatorial_map::Attribute_handle<i>::type`\endlink for a handle to the <I>i</I>-attributes (and the const version \link BasicMap::Attribute_const_handle `Combinatorial_map::Attribute_const_handle<i>::type` \endlink) and \link BasicMap::Attribute_type `Combinatorial_map::Attribute_type<i>::type` \endlink for the type of the <I>i</I>-attributes.
|
||||
The second role of the class `Combinatorial_map` is the storage and the management of attributes. It allows to create or remove an attribute, and provides methods to associate attributes and cells. A range is defined for each <I>i</I>-attribute allowing to iterate over all the <I>i</I>-attributes of the combinatorial map. Finally, `Combinatorial_map` defines several types allowing to manage the attributes. We can use \link GenericMap::Attribute_handle `Combinatorial_map::Attribute_handle<i>::type`\endlink for a handle to the <I>i</I>-attributes (and the const version \link GenericMap::Attribute_const_handle `Combinatorial_map::Attribute_const_handle<i>::type` \endlink) and \link GenericMap::Attribute_type `Combinatorial_map::Attribute_type<i>::type` \endlink for the type of the <I>i</I>-attributes.
|
||||
|
||||
All information associated to darts (\f$ \beta\f$ links and attributes) can be accessed through member functions in `CombinatorialMap`.
|
||||
|
||||
|
||||
\subsection ssecitem Combinatorial Map Items
|
||||
|
||||
\tred{The `BasicMapItems` concept defines dart and attribute types of a combinatorial map. It contains one inner class named \link BasicMapItems::Dart_wrapper `Dart_wrapper`\endlink, having one template parameter, `BMap`, a model of `BasicMap` concept. The \link BasicMapItems::Dart_wrapper `Dart_wrapper<CMap>`\endlink class provides two local types: `%Dart` which must be a model of the `::Dart` concept, and `%Attributes` which defines the attributes and their types.}
|
||||
\tred{The `GenericMapItems` concept defines dart and attribute types of a combinatorial map. It contains one inner class named \link GenericMapItems::Dart_wrapper `Dart_wrapper`\endlink, having one template parameter, `BMap`, a model of `GenericMap` concept. The \link GenericMapItems::Dart_wrapper `Dart_wrapper<CMap>`\endlink class provides two local types: `%Dart` which must be a model of the `::Dart` concept, and `%Attributes` which defines the attributes and their types.}
|
||||
|
||||
The `%Attributes` tuple must contain at most <I>d</I>+1 types (one for each possible cell dimension of the combinatorial map). Each type of the tuple must be either a model of the `CellAttribute` concept or `void`. The first type corresponds to 0-attributes, the second to 1-attributes and so on. If the <i>i <sup>th</sup></i> type in the tuple is `void`, <I>(i-1)</I>-attributes are disabled: we say that <I>(i-1)</I>-attributes are <I>void</I>. Otherwise, <I>(i-1)</I>-attributes are enabled and have the given type: we say <I>(i-1)</I>-attributes are <I>non void</I>. If the size of the tuple is <I>k</I>, with <I>k</I>\f$ <\f$<I>dimension+1</I>, \f$ \forall\f$<I>i</I>: <I>k</I>\f$ \leq\f$<I>i</I>\f$ \leq\f$dimension, <I>i</I>-attributes are void.
|
||||
|
||||
The class `Combinatorial_map_min_items<d>` is a model of the `BasicMapItems` concept which can be used for default behaviors. It defines `Combinatorial_map_dart<d,CMap>` as type of dart, and `Attributes` as empty tuple.
|
||||
The class `Combinatorial_map_min_items<d>` is a model of the `GenericMapItems` concept which can be used for default behaviors. It defines `Combinatorial_map_dart<d,CMap>` as type of dart, and `Attributes` as empty tuple.
|
||||
|
||||
\subsection ssecdarts Darts
|
||||
|
||||
The class `Combinatorial_map_dart<d,CMap>`, a model of the `Dart` concept, defines a <I>d</I>D dart for combinatorial maps. It has two template parameters standing for the dimension of the combinatorial map, and a model of the `CombinatorialMap` concept, which provides the two types \link BasicMap::Dart_handle `Dart_handle`\endlink and \link BasicMap::Dart_const_handle `Dart_const_handle`\endlink.
|
||||
The class `Combinatorial_map_dart<d,CMap>`, a model of the `Dart` concept, defines a <I>d</I>D dart for combinatorial maps. It has two template parameters standing for the dimension of the combinatorial map, and a model of the `CombinatorialMap` concept, which provides the two types \link GenericMap::Dart_handle `Dart_handle`\endlink and \link GenericMap::Dart_const_handle `Dart_const_handle`\endlink.
|
||||
|
||||
Each instance `d0` of `Combinatorial_map_dart<d,CMap>` stores the \f$ \beta_i\f$ pointers in an array of <I>d</I>+1 `Dart_handle` (because we describe also the \f$ \beta_0\f$ pointer). It also stores the attributes associated to this dart in a tuple of \link BasicMap::Attribute_handle `CMap::Attribute_handle<i>::type` \endlink, one for each non void <I>i</I>-attribute.
|
||||
Each instance `d0` of `Combinatorial_map_dart<d,CMap>` stores the \f$ \beta_i\f$ pointers in an array of <I>d</I>+1 `Dart_handle` (because we describe also the \f$ \beta_0\f$ pointer). It also stores the attributes associated to this dart in a tuple of \link GenericMap::Attribute_handle `CMap::Attribute_handle<i>::type` \endlink, one for each non void <I>i</I>-attribute.
|
||||
|
||||
Note that the use of the `Combinatorial_map_dart` class is not hard wired in the combinatorial map class. Users can provide their own model of the `Dart` concept, and pass it to the combinatorial map with the help of a custom item class.
|
||||
|
||||
\subsection ssecattributes Cell Attributes
|
||||
|
||||
The class `Cell_attribute<Map,Info_,Tag,OnMerge,OnSplit>`, a model of the `CellAttribute` concept, represents an attribute associated with a cell of a combinatorial map. The template parameter `Map` must be a model of the `BasicMap` concept. The attribute stores a handle to one dart of its associated cell when the template parameter `Tag` is \link CGAL::Tag_true `Tag_true`\endlink. `Info_` is the type of information stored in the attribute. It may be `void`. `OnMerge` and `OnSplit` must be either `Null_functor`, or models of the `Binary Function` concept having two references to a model of `CellAttribute` as type of both parameters and `void` as return type. There are two default parameters for `OnMerge` and `OnSplit`, which are `Null_functor`, a default parameter for `Tag` which is `Tag_true`, and a default parameter for `Info_` which is `void`.
|
||||
The class `Cell_attribute<Map,Info_,Tag,OnMerge,OnSplit>`, a model of the `CellAttribute` concept, represents an attribute associated with a cell of a combinatorial map. The template parameter `Map` must be a model of the `GenericMap` concept. The attribute stores a handle to one dart of its associated cell when the template parameter `Tag` is \link CGAL::Tag_true `Tag_true`\endlink. `Info_` is the type of information stored in the attribute. It may be `void`. `OnMerge` and `OnSplit` must be either `Null_functor`, or models of the `Binary Function` concept having two references to a model of `CellAttribute` as type of both parameters and `void` as return type. There are two default parameters for `OnMerge` and `OnSplit`, which are `Null_functor`, a default parameter for `Tag` which is `Tag_true`, and a default parameter for `Info_` which is `void`.
|
||||
|
||||
If `Info_` is different from `void`, the class `Cell_attribute` contains two methods `info()` returning the information contained in the attribute (const and non const version). The information is returned by reference, thus the non const version allows the modification of the information.
|
||||
|
||||
Two attributes are merged when their corresponding cells are merged into one cell during some operation. In this case, the functor `OnMerge` is called, unless it is equal to `Null_functor`. This functor allows the user to define its own custom behavior when two attributes are merged (for example if the information is a color, we can compute the average color of the two initial attributes, and affect this value to the first attribute, see example in Section \ref sseccombimapwithcolor "Combinatorial Map With Attributes"). Similarly, the functor `OnSplit` is called when one attribute is split in two, because its corresponding cell is split in two during some operation, unless it is equal to `Null_functor`. In any high level operation, `OnMerge` is called before to start the operation (i.e.\ before modifying the combinatorial map), and `OnSplit` is called when the operation is finished (i.e.\ after all the modifications were made).
|
||||
|
||||
In addition, there are dynamic onmerge and onsplit functions that can be associated to i-attributes, and modified, thanks to the \link BasicMap::onmerge_function() `onmerge_function()`\endlink and \link BasicMap::onsplit_function() `onsplit_function()`\endlink. When these functions are set, they are also called in addition to the previous mechanism when two attributes are merged or one attribute is split into two (see example in Section \ref sseccombimapdynamicattibute "Use of Dynamic Onmerge and Onsplit Functors").
|
||||
In addition, there are dynamic onmerge and onsplit functions that can be associated to i-attributes, and modified, thanks to the \link GenericMap::onmerge_function() `onmerge_function()`\endlink and \link GenericMap::onsplit_function() `onsplit_function()`\endlink. When these functions are set, they are also called in addition to the previous mechanism when two attributes are merged or one attribute is split into two (see example in Section \ref sseccombimapdynamicattibute "Use of Dynamic Onmerge and Onsplit Functors").
|
||||
|
||||
What we said for the dart also holds for the cell attribute. The combinatorial map can be used with any user defined model of the `CellAttribute` concept.
|
||||
|
||||
\subsection ssecexampledef Example of Combinatorial Map Definition
|
||||
|
||||
Here comes an example of two combinatorial map definitions. The first case `Example_cmap4` defines a 4D combinatorial map which uses all the default values (`Combinatorial_map_min_items`). The second example `Example_custom_cmap3` uses its own model of the `BasicMapItems` concept. In this model, the type of dart is `Combinatorial_map_dart<3,CMap>`, thus a dart is in 3D, and an attribute containing an integer is associated to edges.
|
||||
Here comes an example of two combinatorial map definitions. The first case `Example_cmap4` defines a 4D combinatorial map which uses all the default values (`Combinatorial_map_min_items`). The second example `Example_custom_cmap3` uses its own model of the `GenericMapItems` concept. In this model, the type of dart is `Combinatorial_map_dart<3,CMap>`, thus a dart is in 3D, and an attribute containing an integer is associated to edges.
|
||||
|
||||
\code{.cpp}
|
||||
|
||||
|
|
@ -252,48 +252,48 @@ Instead of the `begin()/end()` member function pair as we know it from \stl cont
|
|||
There are three different categories of dart range classes:
|
||||
<UL>
|
||||
|
||||
<LI>\link BasicMap::Dart_range `Dart_range`\endlink: range of all the darts of a combinatorial map;
|
||||
<LI>\link GenericMap::Dart_range `Dart_range`\endlink: range of all the darts of a combinatorial map;
|
||||
|
||||
<LI>\link BasicMap::Dart_of_orbit_range `Dart_of_orbit_range<Beta...>`\endlink: range of all the darts of the orbit \f$ \langle{}\f$`Beta...`\f$ \rangle{}\f$(<I>d0</I>) for a given <I>d0</I>. `Beta...` is a sequence of integers \f$ i_1\f$,..., \f$ i_k\f$, each \f$ i_j\f$\f$ \in\f${0, ..., <I>d</I>}. These integers must satisfy: \f$ i_1\f$\f$ <\f$\f$ i_2\f$\f$ <\f$...\f$ <\f$\f$ i_k\f$, and (\f$ i_1\f$\f$ \neq\f$ 0 or \f$ i_2\f$\f$ \neq\f$ 1) (for example \link BasicMap::Dart_of_orbit_range `Dart_of_orbit_range<1,2>`\endlink for the orbit \f$ \langle{}\f$\f$ \beta_1\f$,\f$ \beta_2\f$\f$ \rangle{}\f$(<I>d0</I>));
|
||||
<LI>\link GenericMap::Dart_of_orbit_range `Dart_of_orbit_range<Beta...>`\endlink: range of all the darts of the orbit \f$ \langle{}\f$`Beta...`\f$ \rangle{}\f$(<I>d0</I>) for a given <I>d0</I>. `Beta...` is a sequence of integers \f$ i_1\f$,..., \f$ i_k\f$, each \f$ i_j\f$\f$ \in\f${0, ..., <I>d</I>}. These integers must satisfy: \f$ i_1\f$\f$ <\f$\f$ i_2\f$\f$ <\f$...\f$ <\f$\f$ i_k\f$, and (\f$ i_1\f$\f$ \neq\f$ 0 or \f$ i_2\f$\f$ \neq\f$ 1) (for example \link GenericMap::Dart_of_orbit_range `Dart_of_orbit_range<1,2>`\endlink for the orbit \f$ \langle{}\f$\f$ \beta_1\f$,\f$ \beta_2\f$\f$ \rangle{}\f$(<I>d0</I>));
|
||||
|
||||
<LI>\link BasicMap::Dart_of_cell_range `Dart_of_cell_range<i,dim>`\endlink: range of all the darts of the <I>i</I>-cell containing a given dart. The <I>i</I>-cell is considered in dimension `dim` (with 0\f$ \leq\f$<I>dim</I>\f$ \leq\f$<I>d</I>, <I>dim</I>=<I>d</I> by default), with 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dim+1</I>. If <I>i</I>=<I>dim+1</I>, \link BasicMap::Dart_of_cell_range `Dart_of_cell_range<i,dim>`\endlink is the range of all the darts of the connected component containing a given dart.
|
||||
<LI>\link GenericMap::Dart_of_cell_range `Dart_of_cell_range<i,dim>`\endlink: range of all the darts of the <I>i</I>-cell containing a given dart. The <I>i</I>-cell is considered in dimension `dim` (with 0\f$ \leq\f$<I>dim</I>\f$ \leq\f$<I>d</I>, <I>dim</I>=<I>d</I> by default), with 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dim+1</I>. If <I>i</I>=<I>dim+1</I>, \link GenericMap::Dart_of_cell_range `Dart_of_cell_range<i,dim>`\endlink is the range of all the darts of the connected component containing a given dart.
|
||||
</UL>
|
||||
|
||||
There are also two different classes of ranges containing one dart per <I>i</I>-cell. Note that in these classes, the dart of each <I>i</I>-cell can be any dart of the cell. Moreover, each <I>i</I>-cell (and <I>j</I>-cell in the second case) is considered in dimension `dim` (with 0\f$ \leq\f$<I>dim</I>\f$ \leq\f$<I>d</I>, <I>dim=d</I> by default).
|
||||
<UL>
|
||||
<LI>\link BasicMap::One_dart_per_cell_range `One_dart_per_cell_range<i,dim>`\endlink: range containing one dart of each <I>i</I>-cell of the combinatorial map, 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dim+1</I> (for example \link BasicMap::One_dart_per_cell_range `One_dart_per_cell_range<2>`\endlink for the range of one dart per 2-cell of the combinatorial map);
|
||||
<LI>\link GenericMap::One_dart_per_cell_range `One_dart_per_cell_range<i,dim>`\endlink: range containing one dart of each <I>i</I>-cell of the combinatorial map, 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dim+1</I> (for example \link GenericMap::One_dart_per_cell_range `One_dart_per_cell_range<2>`\endlink for the range of one dart per 2-cell of the combinatorial map);
|
||||
|
||||
<LI>\link BasicMap::One_dart_per_incident_cell_range `One_dart_per_incident_cell_range<i,j,dim>`\endlink: range containing one dart of each <I>i</I>-cell incident to the <I>j</I>-cell containing a given dart, with 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dim+1</I> and 0\f$ \leq\f$<I>j</I>\f$ \leq\f$<I>dim+1</I> (for example \link BasicMap::One_dart_per_incident_cell_range `One_dart_per_incident_cell_range<0,3>`\endlink for the range of one dart per vertex of the volume incident to the starting dart). If <I>i</I>=<I>j</I>, the range contains only the given dart.
|
||||
<LI>\link GenericMap::One_dart_per_incident_cell_range `One_dart_per_incident_cell_range<i,j,dim>`\endlink: range containing one dart of each <I>i</I>-cell incident to the <I>j</I>-cell containing a given dart, with 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dim+1</I> and 0\f$ \leq\f$<I>j</I>\f$ \leq\f$<I>dim+1</I> (for example \link GenericMap::One_dart_per_incident_cell_range `One_dart_per_incident_cell_range<0,3>`\endlink for the range of one dart per vertex of the volume incident to the starting dart). If <I>i</I>=<I>j</I>, the range contains only the given dart.
|
||||
</UL>
|
||||
|
||||
The iterators of the \link BasicMap::Dart_range `Dart_range`\endlink are bidirectional iterators, while the iterators of the other four ranges are forward iterators. The value type of all these iterators is `Dart` thus all these iterators can be directly used as \link BasicMap::Dart_handle `Dart_handle`\endlink.
|
||||
The iterators of the \link GenericMap::Dart_range `Dart_range`\endlink are bidirectional iterators, while the iterators of the other four ranges are forward iterators. The value type of all these iterators is `Dart` thus all these iterators can be directly used as \link GenericMap::Dart_handle `Dart_handle`\endlink.
|
||||
|
||||
Additionally, there is a range over non void <I>i</I>-attributes: \link BasicMap::Attribute_range `Attribute_range<i>::type`\endlink, having a bidirectional iterator with value type \link BasicMap::Attribute_type Attribute_type<i>::type`\endlink.
|
||||
Additionally, there is a range over non void <I>i</I>-attributes: \link GenericMap::Attribute_range `Attribute_range<i>::type`\endlink, having a bidirectional iterator with value type \link GenericMap::Attribute_type Attribute_type<i>::type`\endlink.
|
||||
|
||||
For each range, there is an associated const range, a model of the `ConstRange` concept. You can find some examples of ranges in Section \ref ssecexample3DCM "A 3D Combinatorial Map".
|
||||
|
||||
\subsection ssecconstruction Construction Operations
|
||||
|
||||
Several functions allow to create specific configurations of darts into a combinatorial map. Existing darts in the combinatorial map are not modified. Note that the dimension of the combinatorial map must be large enough: darts must contain all the \f$ \beta\f$ pointers used by the operation. All these functions return a \link BasicMap::Dart_handle `Dart_handle`\endlink to a new dart created during the operation.
|
||||
Several functions allow to create specific configurations of darts into a combinatorial map. Existing darts in the combinatorial map are not modified. Note that the dimension of the combinatorial map must be large enough: darts must contain all the \f$ \beta\f$ pointers used by the operation. All these functions return a \link GenericMap::Dart_handle `Dart_handle`\endlink to a new dart created during the operation.
|
||||
|
||||
<UL>
|
||||
<LI>`cm.`\link BasicMap::make_edge `make_edge()`\endlink: creates an isolated edge (two darts linked by \f$ \beta_2\f$); dimension must be greater or equal than two;
|
||||
<LI>`cm.`\link BasicMap::make_combinatorial_polygon `make_combinatorial_polygon(lg)`\endlink: creates an isolated combinatorial polygon of length `lg` (`lg` darts linked by \f$ \beta_1\f$), for `lg>0`; dimension must be greater or equal than one;
|
||||
<LI>`cm.`\link BasicMap::make_combinatorial_tetrahedron `make_combinatorial_tetrahedron()`\endlink: creates an isolated combinatorial tetrahedron (four combinatorial triangles linked together by \f$ \beta_2\f$); dimension must be greater or equal than two;
|
||||
<LI>`cm.`\link BasicMap::make_combinatorial_hexahedron `make_combinatorial_hexahedron()`\endlink: creates an isolated combinatorial hexahedron (six combinatorial quadrangles linked together by \f$ \beta_2\f$); dimension must be greater or equal than two.
|
||||
<LI>`cm.`\link GenericMap::make_edge `make_edge()`\endlink: creates an isolated edge (two darts linked by \f$ \beta_2\f$); dimension must be greater or equal than two;
|
||||
<LI>`cm.`\link GenericMap::make_combinatorial_polygon `make_combinatorial_polygon(lg)`\endlink: creates an isolated combinatorial polygon of length `lg` (`lg` darts linked by \f$ \beta_1\f$), for `lg>0`; dimension must be greater or equal than one;
|
||||
<LI>`cm.`\link GenericMap::make_combinatorial_tetrahedron `make_combinatorial_tetrahedron()`\endlink: creates an isolated combinatorial tetrahedron (four combinatorial triangles linked together by \f$ \beta_2\f$); dimension must be greater or equal than two;
|
||||
<LI>`cm.`\link GenericMap::make_combinatorial_hexahedron `make_combinatorial_hexahedron()`\endlink: creates an isolated combinatorial hexahedron (six combinatorial quadrangles linked together by \f$ \beta_2\f$); dimension must be greater or equal than two.
|
||||
</UL>
|
||||
|
||||
\subsection ssecadvmarks Boolean Marks
|
||||
|
||||
It is often necessary to mark darts, for example to retrieve in <I>O(1)</I> if a given dart was already processed during a specific algorithm, for example, iteration over a given range. Users can also mark specific parts of a combinatorial map (for example mark all the darts belonging to objects having specific semantics). To answer these needs, a `BasicMap` has a certain number of Boolean marks (fixed by the constant \link BasicMap::NB_MARKS `NB_MARKS`\endlink). When one wants to use a Boolean mark, the following methods are available (with `cm` an instance of a combinatorial map):
|
||||
It is often necessary to mark darts, for example to retrieve in <I>O(1)</I> if a given dart was already processed during a specific algorithm, for example, iteration over a given range. Users can also mark specific parts of a combinatorial map (for example mark all the darts belonging to objects having specific semantics). To answer these needs, a `GenericMap` has a certain number of Boolean marks (fixed by the constant \link GenericMap::NB_MARKS `NB_MARKS`\endlink). When one wants to use a Boolean mark, the following methods are available (with `cm` an instance of a combinatorial map):
|
||||
<ul>
|
||||
<li> get a new free mark: `size_type m = cm.`\link BasicMap::get_new_mark `get_new_mark()`\endlink (throws the exception Exception_no_more_available_mark if no mark is available);
|
||||
<li> set mark `m` for a given dart `d0`: `cm.`\link BasicMap::mark `mark(dh0,m)`\endlink;
|
||||
<li> unset mark `m` for a given dart `d0`: `cm.`\link BasicMap::unmark `unmark(dh0,m)`\endlink;
|
||||
<li> test if a given dart `d0` is marked for `m`: `cm.`\link BasicMap::is_marked `is_marked(dh0,m)`\endlink;
|
||||
<li> unmark all the darts of `cm` for `m`: `cm.`\link BasicMap::unmark_all `unmark_all(m)`\endlink;
|
||||
<li> negate mark `m` of all the darts of `cm`: `cm.`\link BasicMap::negate_mark `negate_mark(m)`\endlink. All the marked darts become unmarked and all the unmarked darts become marked;
|
||||
<li> free mark `m`: `cm.`\link BasicMap::free_mark `free_mark(m)`\endlink. This method unmarks all the darts of `cm` for `m` before freeing it.
|
||||
<li> get a new free mark: `size_type m = cm.`\link GenericMap::get_new_mark `get_new_mark()`\endlink (throws the exception Exception_no_more_available_mark if no mark is available);
|
||||
<li> set mark `m` for a given dart `d0`: `cm.`\link GenericMap::mark `mark(dh0,m)`\endlink;
|
||||
<li> unset mark `m` for a given dart `d0`: `cm.`\link GenericMap::unmark `unmark(dh0,m)`\endlink;
|
||||
<li> test if a given dart `d0` is marked for `m`: `cm.`\link GenericMap::is_marked `is_marked(dh0,m)`\endlink;
|
||||
<li> unmark all the darts of `cm` for `m`: `cm.`\link GenericMap::unmark_all `unmark_all(m)`\endlink;
|
||||
<li> negate mark `m` of all the darts of `cm`: `cm.`\link GenericMap::negate_mark `negate_mark(m)`\endlink. All the marked darts become unmarked and all the unmarked darts become marked;
|
||||
<li> free mark `m`: `cm.`\link GenericMap::free_mark `free_mark(m)`\endlink. This method unmarks all the darts of `cm` for `m` before freeing it.
|
||||
</ul>
|
||||
|
||||
It is important to free a mark when it is no longer needed, otherwise you may at some point run out of marks.
|
||||
|
|
@ -306,15 +306,15 @@ The following example illustrates how to use marks. Two combinatorial tetrahedra
|
|||
|
||||
Several operations allow to modify a given combinatorial map. There are two main categories of modification operations:
|
||||
<UL>
|
||||
<LI>\ref BasicMap::sew "Sew", \ref CombinatorialMap::link_beta "link_beta", \ref BasicMap::unsew "unsew" and \ref CombinatorialMap::unlink_beta "unlink_beta" which modify some existing \f$ \beta\f$ pointers, without creating or removing darts (see Section \ref sseclinkdarts "Sewing Orbits and Linking Darts");
|
||||
<LI>\ref GenericMap::sew "Sew", \ref CombinatorialMap::link_beta "link_beta", \ref GenericMap::unsew "unsew" and \ref CombinatorialMap::unlink_beta "unlink_beta" which modify some existing \f$ \beta\f$ pointers, without creating or removing darts (see Section \ref sseclinkdarts "Sewing Orbits and Linking Darts");
|
||||
<LI>Removal and insertion of cells which modify both darts and \f$ \beta\f$ pointers (see Section \ref ssecoperations "Removal and Insertion Operations").
|
||||
</UL>
|
||||
|
||||
\subsection sseclinkdarts Sewing Orbits and Linking Darts
|
||||
|
||||
The `BasicMap` defines two groups of methods to modify the \f$ \beta\f$ pointers of existing darts.
|
||||
The `GenericMap` defines two groups of methods to modify the \f$ \beta\f$ pointers of existing darts.
|
||||
|
||||
The sew and unsew methods iterate over two orbits in order to link or unlink specific darts two by two. Intuitively, a \link BasicMap::sew `sew<i>`\endlink operation glues two <I>i</I>-cells by identifying two of their <I>(i-1)</I>-cells (see example in \cgalFigureRef{fig_cmap_example_3d_sew} where \link BasicMap::sew `sew<3>`\endlink is used to glue two 3-cells along one 2-cell). Reciprocally, a \link BasicMap::unsew `unsew<i>`\endlink operation un-glues two <I>i</I>-cells which were glued along one of their <I>(i-1)</I>-cells. These methods guarantee that given a valid combinatorial map and a possible operation we obtain a valid combinatorial map as result of the operation.
|
||||
The sew and unsew methods iterate over two orbits in order to link or unlink specific darts two by two. Intuitively, a \link GenericMap::sew `sew<i>`\endlink operation glues two <I>i</I>-cells by identifying two of their <I>(i-1)</I>-cells (see example in \cgalFigureRef{fig_cmap_example_3d_sew} where \link GenericMap::sew `sew<3>`\endlink is used to glue two 3-cells along one 2-cell). Reciprocally, a \link GenericMap::unsew `unsew<i>`\endlink operation un-glues two <I>i</I>-cells which were glued along one of their <I>(i-1)</I>-cells. These methods guarantee that given a valid combinatorial map and a possible operation we obtain a valid combinatorial map as result of the operation.
|
||||
|
||||
\cgalAdvancedBegin
|
||||
The \link CombinatorialMap::link_beta `link_beta`\endlink and \link CombinatorialMap::unlink_beta `unlink_beta`\endlink methods only modify the pointer of two darts: the obtained combinatorial maps may be not valid. These operations can be useful to use low level operations in a specific algorithm, for example to modify locally a combinatorial map in a really fast way. In such a case, additional operations may be needed to restore the validity conditions.
|
||||
|
|
@ -326,29 +326,29 @@ Linking two darts <I>d1</I> and <I>d2</I> by \f$ \beta_i\f$, with 2\f$ \leq\f$<I
|
|||
Reciprocally, unlinking a given dart <I>d0</I> by \f$ \beta_i\f$, with 2\f$ \leq\f$ <I>i</I>\f$ \leq\f$<I>d</I>, consists in modifying two \f$ \beta_i\f$ pointers such that \f$ \beta_i\f$(\f$ \beta_i\f$(<I>d0</I>))=\f$ \varnothing\f$ and \f$ \beta_i\f$(<I>d0</I>)=\f$ \varnothing\f$. For <I>i=1</I>, the modification is \f$ \beta_1\f$(<I>d0</I>)=\f$ \varnothing\f$ (and thus \f$ \beta_0\f$(\f$ \beta_1\f$(<I>d0</I>))=\f$ \varnothing\f$ by definition of \f$ \beta_0\f$). Note that is it possible to unlink a given dart for \f$ \beta_i\f$ only if it is not <I>i</I>-free.
|
||||
|
||||
\cgalFigureBegin{fig_cmap_example_3d_sew,cmap_example_3d_sew.svg}
|
||||
Example of 3-sew operation. Left: A 3D combinatorial map containing two volumes that are not connected, with 2-attributes. Each attribute contains a color in RGB format, and there are four 2-cells associated with attributes. Associations between darts and attributes are drawn with red segments. Right: The 3D combinatorial map obtained as result of \link BasicMap::sew `sew<3>(1,5)`\endlink (or \link BasicMap::sew `sew<3>(2,8)`\endlink, or \link BasicMap::sew `sew<3>(3,7)`\endlink, or \link BasicMap::sew `sew<3>(4,6)`\endlink). Darts (1,5), (2,8), (3,7) and (4,6) are linked together by \f$ \beta_3\f$. The two 2-cells <I>c1</I>={1,2,3,4} and <I>c2</I>={5,6,7,8} are merged after the sew into the 2-cell {1,2,3,4,5,6,7,8}. We are in the case where the two attributes are non NULL, thus the first one is kept, and all the darts of <I>c2</I> are associated with the first attribute.
|
||||
Example of 3-sew operation. Left: A 3D combinatorial map containing two volumes that are not connected, with 2-attributes. Each attribute contains a color in RGB format, and there are four 2-cells associated with attributes. Associations between darts and attributes are drawn with red segments. Right: The 3D combinatorial map obtained as result of \link GenericMap::sew `sew<3>(1,5)`\endlink (or \link GenericMap::sew `sew<3>(2,8)`\endlink, or \link GenericMap::sew `sew<3>(3,7)`\endlink, or \link GenericMap::sew `sew<3>(4,6)`\endlink). Darts (1,5), (2,8), (3,7) and (4,6) are linked together by \f$ \beta_3\f$. The two 2-cells <I>c1</I>={1,2,3,4} and <I>c2</I>={5,6,7,8} are merged after the sew into the 2-cell {1,2,3,4,5,6,7,8}. We are in the case where the two attributes are non NULL, thus the first one is kept, and all the darts of <I>c2</I> are associated with the first attribute.
|
||||
\cgalFigureEnd
|
||||
|
||||
The \link BasicMap::sew `sew<i>(dh1,dh2)`\endlink method consists mainly to link two by two several darts by \f$ \beta_i\f$. This operation is possible only if there is a bijection <I>f</I> between all the darts of the orbit <I>D1</I>=\f$ \langle{}\f$\f$ \beta_1\f$,...,\f$ \beta_{i-2}\f$,\f$ \beta_{i+2}\f$,...,\f$ \beta_d\f$\f$ \rangle{}\f$(<I>d1</I>) and <I>D2</I>=\f$ \langle{}\f$\f$ \beta_1\f$,...,\f$ \beta_{i-2}\f$,\f$ \beta_{i+2}\f$,..., \f$ \beta_d\f$\f$ \rangle{}\f$(<I>d2</I>) satisfying: <I>f</I>(<I>d1</I>)=<I>d2</I>, and for all <I>e</I>\f$ \in\f$<I>D1</I>, for all <I>j</I>\f$ \in\f${1,..., i-2,i+2,...,<I>d</I>}, <I>f</I>(\f$ \beta_j\f$(<I>e</I>))=\f$ \beta_j^{-1}\f$(<I>f</I>(<I>e</I>)). Intuitively, this condition ensures the validity of the combinatorial map by verifying that condition discussed in Section \ref sseccombimapvalidity "Combinatorial Map Properties" will be satisfied after the operation. This condition can be tested by using the method \link BasicMap::is_sewable `is_sewable<i>(dh1,dh2)`\endlink. For example, the function \link BasicMap::is_sewable `is_sewable<3>`\endlink would return `false` if we tried to 3-sew a triangular facet with a quad facet. Note that given two darts <I>d1</I> and <I>d2</I>, if there is such a bijection, it is uniquely defined. So giving the two darts as arguments of the \link BasicMap::sew `sew<i>`\endlink is enough to retrieve all the pairs of darts to link. If such a bijection exists, the \link BasicMap::sew `sew<i>(dh1,dh2)`\endlink operation consists only in linking by \f$ \beta_i\f$ each couple of darts <I>d3</I> and <I>d4</I> such that <I>d3</I>=<I>f</I>(<I>d4</I>).
|
||||
The \link GenericMap::sew `sew<i>(dh1,dh2)`\endlink method consists mainly to link two by two several darts by \f$ \beta_i\f$. This operation is possible only if there is a bijection <I>f</I> between all the darts of the orbit <I>D1</I>=\f$ \langle{}\f$\f$ \beta_1\f$,...,\f$ \beta_{i-2}\f$,\f$ \beta_{i+2}\f$,...,\f$ \beta_d\f$\f$ \rangle{}\f$(<I>d1</I>) and <I>D2</I>=\f$ \langle{}\f$\f$ \beta_1\f$,...,\f$ \beta_{i-2}\f$,\f$ \beta_{i+2}\f$,..., \f$ \beta_d\f$\f$ \rangle{}\f$(<I>d2</I>) satisfying: <I>f</I>(<I>d1</I>)=<I>d2</I>, and for all <I>e</I>\f$ \in\f$<I>D1</I>, for all <I>j</I>\f$ \in\f${1,..., i-2,i+2,...,<I>d</I>}, <I>f</I>(\f$ \beta_j\f$(<I>e</I>))=\f$ \beta_j^{-1}\f$(<I>f</I>(<I>e</I>)). Intuitively, this condition ensures the validity of the combinatorial map by verifying that condition discussed in Section \ref sseccombimapvalidity "Combinatorial Map Properties" will be satisfied after the operation. This condition can be tested by using the method \link GenericMap::is_sewable `is_sewable<i>(dh1,dh2)`\endlink. For example, the function \link GenericMap::is_sewable `is_sewable<3>`\endlink would return `false` if we tried to 3-sew a triangular facet with a quad facet. Note that given two darts <I>d1</I> and <I>d2</I>, if there is such a bijection, it is uniquely defined. So giving the two darts as arguments of the \link GenericMap::sew `sew<i>`\endlink is enough to retrieve all the pairs of darts to link. If such a bijection exists, the \link GenericMap::sew `sew<i>(dh1,dh2)`\endlink operation consists only in linking by \f$ \beta_i\f$ each couple of darts <I>d3</I> and <I>d4</I> such that <I>d3</I>=<I>f</I>(<I>d4</I>).
|
||||
|
||||
In addition, the sew operation updates the associations between darts and non void attributes in order to guarantee that all the darts belonging to a given cell are associated with the same attribute (which is a condition of combinatorial map validity). For each couple of <I>j</I>-cells <I>c1</I> and <I>c2</I> that are merged into one <I>j</I>-cell during the sew, we have to update the two associated attributes <I>attr1</I> and <I>attr2</I>. If both are NULL, there is nothing to do. If one is NULL and the other not, we only associate the non NULL attribute to all the darts of the resulting cell. When the two attributes are non NULL, we first apply functor \link CellAttribute::On_merge `On_merge`\endlink on the two attributes <I>attr1</I> and <I>attr2</I> (see Section \ref ssecattributes "Cell Attributes"). Then, we associate the attribute <I>attr1</I> to all darts of the resulting <I>j</I>-cell. Finally, attribute <I>attr2</I> is removed from the combinatorial map.
|
||||
|
||||
Note that when the two attributes are non NULL, the first one is kept. But user can customize this behavior in order to update the information contained in the attributes according to its needs. For that, we can define a specific functor, and use it as template argument for \link CellAttribute::On_merge `On_merge`\endlink parameter of the `Cell_attribute` definition. This functor can for example copy the information of the second attribute in the information of the first one to make as if the second attribute is kept.
|
||||
|
||||
For example, in \cgalFigureRef{fig_cmap_example_3d_sew}, we want to 3-sew the two initial volumes. \link BasicMap::sew `sew<3>(1,5)`\endlink links by \f$ \beta_3\f$ the pairs of darts (1,5), (2,8), (3,7) and (4,6), thus the combinatorial map obtained is valid. 2-attributes are updated so that all the darts belonging to the 2-cell containing dart 1 become associated to the same 2-attribute after the operation.
|
||||
For example, in \cgalFigureRef{fig_cmap_example_3d_sew}, we want to 3-sew the two initial volumes. \link GenericMap::sew `sew<3>(1,5)`\endlink links by \f$ \beta_3\f$ the pairs of darts (1,5), (2,8), (3,7) and (4,6), thus the combinatorial map obtained is valid. 2-attributes are updated so that all the darts belonging to the 2-cell containing dart 1 become associated to the same 2-attribute after the operation.
|
||||
|
||||
Similarly, \link BasicMap::unsew `unsew<i>(dh0)`\endlink operation unlinks \f$ \beta_i\f$ for all the darts in the orbit \f$ \langle{}\f$\f$ \beta_1\f$,..., \f$ \beta_{i-2}\f$,\f$ \beta_{i+2}\f$,...,\f$ \beta_d\f$\f$ \rangle{}\f$(<I>d0</I>), and thus guarantees to obtain a valid combinatorial map. This operation is possible for any non <I>i</I>-free dart.
|
||||
Similarly, \link GenericMap::unsew `unsew<i>(dh0)`\endlink operation unlinks \f$ \beta_i\f$ for all the darts in the orbit \f$ \langle{}\f$\f$ \beta_1\f$,..., \f$ \beta_{i-2}\f$,\f$ \beta_{i+2}\f$,...,\f$ \beta_d\f$\f$ \rangle{}\f$(<I>d0</I>), and thus guarantees to obtain a valid combinatorial map. This operation is possible for any non <I>i</I>-free dart.
|
||||
|
||||
As for the sew operations, attributes are updated to guarantee that two darts belonging to two different <I>j</I>-cells are associated to two different <I>j</I>-attributes. If the unsew operation splits a <I>j</I>-cell <I>c</I> in two <I>j</I>-cells <I>c1</I> and <I>c2</I>, and if <I>c</I> is associated to a <I>j</I>-attribute <I>attr1</I>, then this attribute is duplicated into <I>attr2</I>, and all the darts belonging to <I>c2</I> are associated with this new attribute. Finally, we call the functor \link CellAttribute::On_split `On_split`\endlink on the two attributes <I>attr1</I> and <I>attr2</I> (see Section \ref ssecattributes "Cell Attributes").
|
||||
|
||||
Let us consider the combinatorial map given in \cgalFigureRef{fig_cmap_example_3d_sew} (Right). If we call \link BasicMap::unsew `unsew<3>(2)`\endlink, we obtain the combinatorial map in \cgalFigureRef{fig_cmap_example_3d_sew} (Left) (except for the color of the attribute associated to the 2-cell {5,6,7,8} which would be <TT>#00ff00</TT>). The \link BasicMap::unsew `unsew<3>`\endlink operation has duplicated the 2-attribute associated to the 2-cell {1,2,3,4,5,6,7,8} since this 2-cell is split in two after the unsew operation.
|
||||
Let us consider the combinatorial map given in \cgalFigureRef{fig_cmap_example_3d_sew} (Right). If we call \link GenericMap::unsew `unsew<3>(2)`\endlink, we obtain the combinatorial map in \cgalFigureRef{fig_cmap_example_3d_sew} (Left) (except for the color of the attribute associated to the 2-cell {5,6,7,8} which would be <TT>#00ff00</TT>). The \link GenericMap::unsew `unsew<3>`\endlink operation has duplicated the 2-attribute associated to the 2-cell {1,2,3,4,5,6,7,8} since this 2-cell is split in two after the unsew operation.
|
||||
|
||||
\cgalAdvancedBegin
|
||||
If one wants to modify a combinatorial map <I>manually</I>, it is possible to switch off the updating between darts and attributes by calling \link BasicMap::set_automatic_attributes_management `set_automatic_attributes_management(false)`\endlink before to call \link BasicMap::sew `sew<i>(dh1,dh2)`\endlink and \link BasicMap::unsew `unsew<i>(dh0)`\endlink. In these cases, the combinatorial map obtained may be no longer valid due to incorrect associations between darts and attributes. A call later to \link BasicMap::set_automatic_attributes_management `set_automatic_attributes_management(true)`\endlink will correct the invalid non void attributes.
|
||||
If one wants to modify a combinatorial map <I>manually</I>, it is possible to switch off the updating between darts and attributes by calling \link GenericMap::set_automatic_attributes_management `set_automatic_attributes_management(false)`\endlink before to call \link GenericMap::sew `sew<i>(dh1,dh2)`\endlink and \link GenericMap::unsew `unsew<i>(dh0)`\endlink. In these cases, the combinatorial map obtained may be no longer valid due to incorrect associations between darts and attributes. A call later to \link GenericMap::set_automatic_attributes_management `set_automatic_attributes_management(true)`\endlink will correct the invalid non void attributes.
|
||||
|
||||
In \cgalFigureRef{fig_cmap_example_3d_sew} (Left), if we call \link BasicMap::sew `sew<3>(1,5)`\endlink, the resulting combinatorial map is similar to the combinatorial map of \cgalFigureRef{fig_cmap_example_3d_sew} (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 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.
|
||||
In \cgalFigureRef{fig_cmap_example_3d_sew} (Left), if we call \link GenericMap::sew `sew<3>(1,5)`\endlink, the resulting combinatorial map is similar to the combinatorial map of \cgalFigureRef{fig_cmap_example_3d_sew} (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 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 \link CombinatorialMap::link_beta `link_beta<i>(dh1,dh2)`\endlink 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 \link BasicMap::sew `sew<i>`\endlink, this updating can be avoided by calling \link BasicMap::set_automatic_attributes_management `set_automatic_attributes_management(false)`\endlink before to call \link CombinatorialMap::link_beta `link_beta<i>(dh1,dh2)`\endlink. Lastly, we can use \link CombinatorialMap::unlink_beta `unlink_beta<i>(dh0)`\endlink to unlink `d0` for \f$ \beta_i\f$. In this last case, there is no modification of association between darts and attributes.
|
||||
We can also use the \link CombinatorialMap::link_beta `link_beta<i>(dh1,dh2)`\endlink 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 \link GenericMap::sew `sew<i>`\endlink, this updating can be avoided by calling \link GenericMap::set_automatic_attributes_management `set_automatic_attributes_management(false)`\endlink before to call \link CombinatorialMap::link_beta `link_beta<i>(dh1,dh2)`\endlink. Lastly, we can use \link CombinatorialMap::unlink_beta `unlink_beta<i>(dh0)`\endlink to unlink `d0` for \f$ \beta_i\f$. In this last case, there is no modification of association between darts and attributes.
|
||||
|
||||
In \cgalFigureRef{fig_cmap_example_3d_sew} (Left), if we call \link CombinatorialMap::link_beta `link_beta<3>(1,5)`\endlink, in the resulting combinatorial map we have now \f$ \beta_3\f$(1)=5 and \f$ \beta_3\f$(5)=1. This combinatorial map is no longer valid (for example dart 2 is 3-free and we should have \f$ \beta_3\f$(2)=8).
|
||||
\cgalAdvancedEnd
|
||||
|
|
@ -357,46 +357,46 @@ In \cgalFigureRef{fig_cmap_example_3d_sew} (Left), if we call \link Combinatoria
|
|||
|
||||
The following high level operations are defined. All these methods ensure that given a valid combinatorial map and a possible operation, the modified combinatorial map is also valid.
|
||||
|
||||
The first one is `cm.`\link BasicMap::remove_cell `remove_cell<i>(dh0)`\endlink which modifies the combinatorial map to remove the <I>i</I>-cell containing dart `d0`, with 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>d</I>. This operation is possible if <I>i</I>=<I>d</I> or if the given <I>i</I>-cell is incident to at most two <I>(i+1)</I>-cells which can be tested thanks to `cm.`\link BasicMap::is_removable `is_removable<i>(dh0)`\endlink. If the removed <I>i</I>-cell was incident to two different <I>(i+1)</I>-cells, these two cells are merged into one <I>(i+1)</I>-cell. In this case, the \link CellAttribute::On_merge `On_merge`\endlink functor is called if two <I>(i+1)</I>-attributes are associated to the two <I>(i+1)</I>-cells. If the <I>i</I>-cell is associated with a non void attribute, it is removed from the combinatorial map (see three examples on \cgalFigureRef{fig_cmap_insert_vertex}, \cgalFigureRef{fig_cmap_insert_edge} and \cgalFigureRef{fig_cmap_insert_facet}).
|
||||
The first one is `cm.`\link GenericMap::remove_cell `remove_cell<i>(dh0)`\endlink which modifies the combinatorial map to remove the <I>i</I>-cell containing dart `d0`, with 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>d</I>. This operation is possible if <I>i</I>=<I>d</I> or if the given <I>i</I>-cell is incident to at most two <I>(i+1)</I>-cells which can be tested thanks to `cm.`\link GenericMap::is_removable `is_removable<i>(dh0)`\endlink. If the removed <I>i</I>-cell was incident to two different <I>(i+1)</I>-cells, these two cells are merged into one <I>(i+1)</I>-cell. In this case, the \link CellAttribute::On_merge `On_merge`\endlink functor is called if two <I>(i+1)</I>-attributes are associated to the two <I>(i+1)</I>-cells. If the <I>i</I>-cell is associated with a non void attribute, it is removed from the combinatorial map (see three examples on \cgalFigureRef{fig_cmap_insert_vertex}, \cgalFigureRef{fig_cmap_insert_edge} and \cgalFigureRef{fig_cmap_insert_facet}).
|
||||
|
||||
\cgalFigureBegin{fig_cmap_insert_vertex,cmap_insert_vertex.svg}
|
||||
Example of \link BasicMap::insert_cell_0_in_cell_1 `insert_cell_0_in_cell_1`\endlink and \link BasicMap::remove_cell `remove_cell<0>`\endlink operations. Left: Initial combinatorial map. Right: After the insertion of a 0-cell in the 1-cell containing dart `d1`. Now if we remove the 0-cell containing dart `d2`, we obtain the initial combinatorial map.
|
||||
Example of \link GenericMap::insert_cell_0_in_cell_1 `insert_cell_0_in_cell_1`\endlink and \link GenericMap::remove_cell `remove_cell<0>`\endlink operations. Left: Initial combinatorial map. Right: After the insertion of a 0-cell in the 1-cell containing dart `d1`. Now if we remove the 0-cell containing dart `d2`, we obtain the initial combinatorial map.
|
||||
\cgalFigureEnd
|
||||
|
||||
The inverse operation of the removal is the insertion operation. Several versions exist, sharing a common principle. They consist in adding a new <I>i</I>-cell <em>inside</em> an existing <I>j</I>-cell, <I>i</I>\f$ <\f$<I>j</I>, by splitting the <I>j</I>-cell into several <I>j</I>-cells. Contrary to `remove_cell<i>`, is it not possible to define a unique `insert_cell_i_in_cell_j<i,j>` function because parameters are different depending on `i` and `j`.
|
||||
|
||||
`cm.`\link BasicMap::insert_cell_0_in_cell_1 `insert_cell_0_in_cell_1(dh0)`\endlink adds a 0-cell in the 1-cell containing dart `d0`. The 1-cell is split in two. This operation is possible if `d0`\f$ \in\f$\link BasicMap::darts `cm.darts()`\endlink (see example on \cgalFigureRef{fig_cmap_insert_vertex}).
|
||||
`cm.`\link GenericMap::insert_cell_0_in_cell_1 `insert_cell_0_in_cell_1(dh0)`\endlink adds a 0-cell in the 1-cell containing dart `d0`. The 1-cell is split in two. This operation is possible if `d0`\f$ \in\f$\link GenericMap::darts `cm.darts()`\endlink (see example on \cgalFigureRef{fig_cmap_insert_vertex}).
|
||||
|
||||
`cm.`\link BasicMap::insert_cell_0_in_cell_2 `insert_cell_0_in_cell_2(dh0)`\endlink adds a 0-cell in the 2-cell containing dart `d0`. The 2-cell is split in triangles, one for each initial edge of the facet. This operation is possible if `d0`\f$ \in\f$\link BasicMap::darts `cm.darts()`\endlink (see example on \cgalFigureRef{fig_cmap_triangulation}).
|
||||
`cm.`\link GenericMap::insert_cell_0_in_cell_2 `insert_cell_0_in_cell_2(dh0)`\endlink adds a 0-cell in the 2-cell containing dart `d0`. The 2-cell is split in triangles, one for each initial edge of the facet. This operation is possible if `d0`\f$ \in\f$\link GenericMap::darts `cm.darts()`\endlink (see example on \cgalFigureRef{fig_cmap_triangulation}).
|
||||
|
||||
\cgalFigureBegin{fig_cmap_triangulation,cmap_triangulation.svg}
|
||||
Example of \link BasicMap::insert_cell_0_in_cell_2 `insert_cell_0_in_cell_2`\endlink operation.
|
||||
Example of \link GenericMap::insert_cell_0_in_cell_2 `insert_cell_0_in_cell_2`\endlink operation.
|
||||
\cgalFigureEnd
|
||||
|
||||
`cm.`\link BasicMap::insert_cell_1_in_cell_2 `insert_cell_1_in_cell_2(dh1,dh2)`\endlink adds a 1-cell in the 2-cell containing darts `d1` and `d2`, between the two 0-cells containing darts `d1` and `d2`. The 2-cell is split in two. This operation is possible if <I>d1</I>\f$ \in\f$\f$ \langle{}\f$\f$ \beta_1\f$\f$ \rangle{}\f$(<I>d2</I>) which can be tested thanks to `cm.`\link BasicMap::is_insertable_cell_1_in_cell_2 `is_insertable_cell_1_in_cell_2(dh1,dh2)`\endlink. In the example on \cgalFigureRef{fig_cmap_insert_edge}, it is possible to insert an edge between darts <I>d2</I> and <I>d3</I>, but it is not possible to insert an edge between <I>d1</I> and <I>d3</I>.
|
||||
`cm.`\link GenericMap::insert_cell_1_in_cell_2 `insert_cell_1_in_cell_2(dh1,dh2)`\endlink adds a 1-cell in the 2-cell containing darts `d1` and `d2`, between the two 0-cells containing darts `d1` and `d2`. The 2-cell is split in two. This operation is possible if <I>d1</I>\f$ \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_in_cell_2 `is_insertable_cell_1_in_cell_2(dh1,dh2)`\endlink. In the example on \cgalFigureRef{fig_cmap_insert_edge}, it is possible to insert an edge between darts <I>d2</I> and <I>d3</I>, but it is not possible to insert an edge between <I>d1</I> and <I>d3</I>.
|
||||
|
||||
\cgalFigureBegin{fig_cmap_insert_edge,cmap_insert_edge.svg}
|
||||
Example of \link BasicMap::insert_cell_1_in_cell_2 `insert_cell_1_in_cell_2`\endlink and \link BasicMap::remove_cell `remove_cell<1>`\endlink operations. Left: Initial combinatorial map. Right: After the insertion of two 1-cells: a first one between the two 0-cells containing darts `d2` and `d3`, and a second one incident to the 0-cell containing dart `d1`. Now if we remove the two 1-cells containing darts `d4` and `d5`, we obtain the initial combinatorial map.
|
||||
Example of \link GenericMap::insert_cell_1_in_cell_2 `insert_cell_1_in_cell_2`\endlink and \link GenericMap::remove_cell `remove_cell<1>`\endlink operations. Left: Initial combinatorial map. Right: After the insertion of two 1-cells: a first one between the two 0-cells containing darts `d2` and `d3`, and a second one incident to the 0-cell containing dart `d1`. Now if we remove the two 1-cells containing darts `d4` and `d5`, we obtain the initial combinatorial map.
|
||||
\cgalFigureEnd
|
||||
|
||||
`cm.`\link BasicMap::insert_dangling_cell_1_in_cell_2 `insert_dangling_cell_1_in_cell_2(dh0)`\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 BasicMap::darts `cm.darts()`\endlink.
|
||||
`cm.`\link GenericMap::insert_dangling_cell_1_in_cell_2 `insert_dangling_cell_1_in_cell_2(dh0)`\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 BasicMap::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 BasicMap::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}).
|
||||
`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}
|
||||
Example of \link BasicMap::insert_cell_2_in_cell_3 `insert_cell_2_in_cell_3`\endlink and \link BasicMap::remove_cell `remove_cell<2>`\endlink operations. Left: Initial combinatorial map. Right: After the insertion of a 2-cell along the path of 1-cells containing respectively `d1,d2,d3,d4`. Now if we remove the 2-cell containing dart `d5`, we obtain the initial combinatorial map. \cgalFigureEnd
|
||||
Example of \link GenericMap::insert_cell_2_in_cell_3 `insert_cell_2_in_cell_3`\endlink and \link GenericMap::remove_cell `remove_cell<2>`\endlink operations. Left: Initial combinatorial map. Right: After the insertion of a 2-cell along the path of 1-cells containing respectively `d1,d2,d3,d4`. Now if we remove the 2-cell containing dart `d5`, we obtain the initial combinatorial map. \cgalFigureEnd
|
||||
|
||||
Some examples of use of these operations are given in Section \ref ssecexempleoperations "High Level Operations".
|
||||
|
||||
\cgalAdvancedBegin
|
||||
If \link BasicMap::set_automatic_attributes_management `set_automatic_attributes_management(false)`\endlink is called, all the future insertion or removal operations will not update non void attributes. These attributes will be updated later by the call to \link BasicMap::set_automatic_attributes_management `set_automatic_attributes_management(true)`\endlink. This can be useful to speed up an algorithm which uses several successive insertion and removal operations. See example \ref ssecAttributesManagement "Automatic attributes management".
|
||||
If \link GenericMap::set_automatic_attributes_management `set_automatic_attributes_management(false)`\endlink is called, all the future insertion or removal operations will not update non void attributes. These attributes will be updated later by the call to \link GenericMap::set_automatic_attributes_management `set_automatic_attributes_management(true)`\endlink. This can be useful to speed up an algorithm which uses several successive insertion and removal operations. See example \ref ssecAttributesManagement "Automatic attributes management".
|
||||
\cgalAdvancedEnd
|
||||
|
||||
\section Combinatorial_mapExamples Examples
|
||||
|
||||
\subsection ssecexample3DCM A 3D Combinatorial Map
|
||||
|
||||
In this example, a 3-dimensional combinatorial map is constructed. Two combinatorial tetrahedra are created, then the numbers of cells of the combinatorial map are displayed, and the validity of the combinatorial map is checked. Then, we illustrate the use of ranges to iterate over specific darts. The first loop enumerates all the darts of the first tetrahedron by using the range \link BasicMap::Dart_of_orbit_range `Dart_of_orbit_range<1,2>`\endlink, and the second loop enumerates all the darts of the facet containing dart `dh2` by using the range \link BasicMap::Dart_of_orbit_range `Dart_of_orbit_range<1>`\endlink.
|
||||
In this example, a 3-dimensional combinatorial map is constructed. Two combinatorial tetrahedra are created, then the numbers of cells of the combinatorial map are displayed, and the validity of the combinatorial map is checked. Then, we illustrate the use of ranges to iterate over specific darts. The first loop enumerates all the darts of the first tetrahedron by using the range \link GenericMap::Dart_of_orbit_range `Dart_of_orbit_range<1,2>`\endlink, and the second loop enumerates all the darts of the facet containing dart `dh2` by using the range \link GenericMap::Dart_of_orbit_range `Dart_of_orbit_range<1>`\endlink.
|
||||
|
||||
\cgalExample{Combinatorial_map/map_3_simple_example.cpp}
|
||||
|
||||
|
|
@ -409,7 +409,7 @@ Number of darts of the facet containing dh2: 3
|
|||
|
||||
which gives the number of darts of the combinatorial map, the numbers of different cells, the number of connected components, and finally a Boolean showing the validity of the combinatorial map (a tetrahedron is made up of 12 darts because there are 3 darts per facet and there are 4 facets).
|
||||
|
||||
Note the creation in the for loops of the two instances of \link BasicMap::Dart_of_orbit_range `Dart_of_orbit_range`\endlink::`const_iterator`: `it` is the current iterator, and `itend` an iterator to the end of the range. Having `itend` avoids calling \link BasicMap::darts_of_orbit `cm.darts_of_orbit<1,2>(dh1)`\endlink`.end()` again and again as in the following example (which is a bad solution):
|
||||
Note the creation in the for loops of the two instances of \link GenericMap::Dart_of_orbit_range `Dart_of_orbit_range`\endlink::`const_iterator`: `it` is the current iterator, and `itend` an iterator to the end of the range. Having `itend` avoids calling \link GenericMap::darts_of_orbit `cm.darts_of_orbit<1,2>(dh1)`\endlink`.end()` again and again as in the following example (which is a bad solution):
|
||||
|
||||
\code{.cpp}
|
||||
|
||||
|
|
@ -444,13 +444,13 @@ 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_mapA4DBasicMap A 4D Combinatorial Map
|
||||
\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.
|
||||
|
||||
By looking at these numbers of cells, we can see that the 4D combinatorial map contains only one 3-cell. Indeed, the \link BasicMap::sew `sew<4>`\endlink operation has identified by pairs all the darts of the two 3-cells by definition of the sew operation (see Section \ref sseclinkdarts "Sewing Orbits and Linking Darts") which, in 4D, links by \f$ \beta_3\f$ all the darts in \f$ \langle{}\f$\f$ \beta_1\f$,\f$ \beta_2\f$\f$ \rangle{}\f$(<I>d1</I>) and in \f$ \langle{}\f$\f$ \beta_1\f$,\f$ \beta_2\f$\f$ \rangle{}\f$(<I>d2</I>). The situation is similar (but in higher dimension) to the configuration where we have two triangles in a 3D combinatorial map, and you use \link BasicMap::sew `sew<3>`\endlink between these two triangles. The two triangles are identified since all their darts are linked by \f$ \beta_3\f$, thus we obtain a 3D combinatorial map containing only one 3-cell. Note that this 3-cell is unbounded since the darts of the two triangles are all 2-free. In the 4D case, the 4-cell is unbounded since all its darts are 3-free.
|
||||
By looking at these numbers of cells, we can see that the 4D combinatorial map contains only one 3-cell. Indeed, the \link GenericMap::sew `sew<4>`\endlink operation has identified by pairs all the darts of the two 3-cells by definition of the sew operation (see Section \ref sseclinkdarts "Sewing Orbits and Linking Darts") which, in 4D, links by \f$ \beta_3\f$ all the darts in \f$ \langle{}\f$\f$ \beta_1\f$,\f$ \beta_2\f$\f$ \rangle{}\f$(<I>d1</I>) and in \f$ \langle{}\f$\f$ \beta_1\f$,\f$ \beta_2\f$\f$ \rangle{}\f$(<I>d2</I>). The situation is similar (but in higher dimension) to the configuration where we have two triangles in a 3D combinatorial map, and you use \link GenericMap::sew `sew<3>`\endlink between these two triangles. The two triangles are identified since all their darts are linked by \f$ \beta_3\f$, thus we obtain a 3D combinatorial map containing only one 3-cell. Note that this 3-cell is unbounded since the darts of the two triangles are all 2-free. In the 4D case, the 4-cell is unbounded since all its darts are 3-free.
|
||||
|
||||
In this example, we also illustrate how to use the basic methods to build <em>by hand</em> some specific configuration in a combinatorial map. In fact, these functions are already present in the package: function `make_triangle(cm)` is equivalent to \link BasicMap::make_combinatorial_polygon `cm.make_combinatorial_polygon(3)`\endlink and `make_tetrahedral(cm)` is equivalent to \link BasicMap::make_combinatorial_tetrahedron `cm.make_combinatorial_tetrahedron()`\endlink. If we want to create a 4D simplex, we must create five 3D simplexes, and sew them correctly two by two by \f$ \beta_3\f$ (and so on if you want to create higher dimensional combinatorial map).
|
||||
In this example, we also illustrate how to use the basic methods to build <em>by hand</em> some specific configuration in a combinatorial map. In fact, these functions are already present in the package: function `make_triangle(cm)` is equivalent to \link GenericMap::make_combinatorial_polygon `cm.make_combinatorial_polygon(3)`\endlink and `make_tetrahedral(cm)` is equivalent to \link GenericMap::make_combinatorial_tetrahedron `cm.make_combinatorial_tetrahedron()`\endlink. If we want to create a 4D simplex, we must create five 3D simplexes, and sew them correctly two by two by \f$ \beta_3\f$ (and so on if you want to create higher dimensional combinatorial map).
|
||||
|
||||
\cgalExample{Combinatorial_map/map_4_simple_example.cpp}
|
||||
|
||||
|
|
@ -474,9 +474,9 @@ The output is:
|
|||
#Darts=64, #0-cells=13, #1-cells=24, #2-cells=14, #3-cells=2, #ccs=1, valid=1
|
||||
\endverbatim
|
||||
|
||||
Before the `cm.`\link BasicMap::sew `sew<3>`\endlink, each 2-cell of the first cube is associated with an attribute having 7 as value, and each 2-cell of the second cube with an attribute having 13 as value. During the `cm.`\link BasicMap::sew `sew<3>`\endlink, two 2-cells are merged, thus the functor `Sum_functor` is called on the two associated 2-attributes, and the value of the new 2-cell is the sum of the two previous one: 20.
|
||||
Before the `cm.`\link GenericMap::sew `sew<3>`\endlink, each 2-cell of the first cube is associated with an attribute having 7 as value, and each 2-cell of the second cube with an attribute having 13 as value. During the `cm.`\link GenericMap::sew `sew<3>`\endlink, two 2-cells are merged, thus the functor `Sum_functor` is called on the two associated 2-attributes, and the value of the new 2-cell is the sum of the two previous one: 20.
|
||||
|
||||
Then we call \link BasicMap::insert_cell_0_in_cell_2 `insert_cell_0_in_cell_2`\endlink on a dart which belong to this 2-cell. This method splits the existing 2-cell in <I>k</I> 2-cells, <I>k</I> being the number of 1-cells of the initial 2-cell (4 in this example). These splits are made consecutively, thus for the first split, we create a new attribute as copy of the initial one and call functor `Divide_by_two_functor` on these two attributes: the value of each attribute is thus 20/2=10. For the second split, the value of each attribute is thus 10/2=5, and for the last split the value of each attribute is thus 5/2=2 (remember that information contained in 2-attributes in an `int`). At the end, we obtain five 2-attributes with 7 as value, five 2-attributes with 13 as value, and four 2-attributes having respectively 2, 2, 5 and 10 as values.
|
||||
Then we call \link GenericMap::insert_cell_0_in_cell_2 `insert_cell_0_in_cell_2`\endlink on a dart which belong to this 2-cell. This method splits the existing 2-cell in <I>k</I> 2-cells, <I>k</I> being the number of 1-cells of the initial 2-cell (4 in this example). These splits are made consecutively, thus for the first split, we create a new attribute as copy of the initial one and call functor `Divide_by_two_functor` on these two attributes: the value of each attribute is thus 20/2=10. For the second split, the value of each attribute is thus 10/2=5, and for the last split the value of each attribute is thus 5/2=2 (remember that information contained in 2-attributes in an `int`). At the end, we obtain five 2-attributes with 7 as value, five 2-attributes with 13 as value, and four 2-attributes having respectively 2, 2, 5 and 10 as values.
|
||||
|
||||
\subsection sseccombimapdynamicattibute Use of Dynamic Onmerge and Onsplit Functors
|
||||
|
||||
|
|
@ -484,7 +484,7 @@ In the following example, we show an example of use of dynamic onmerge and onspl
|
|||
|
||||
Step 2 defines the onsplit and onmerge dynamic functors. We can see here that with this mechanism, functors can store data member. This is the case in the example for `Split_functor` which stores a reference to the combinatorial map.
|
||||
|
||||
The next operations will call these functors when 2-cells are split or merged. The \link BasicMap::sew `sew<3>`\endlink operation calls 1 onmerge as two faces are identified; the \link BasicMap::insert_cell_0_in_cell_2 `insert_cell_0_in_cell_2`\endlink operation calls 3 onsplit as one face is split in 4.
|
||||
The next operations will call these functors when 2-cells are split or merged. The \link GenericMap::sew `sew<3>`\endlink operation calls 1 onmerge as two faces are identified; the \link GenericMap::insert_cell_0_in_cell_2 `insert_cell_0_in_cell_2`\endlink operation calls 3 onsplit as one face is split in 4.
|
||||
|
||||
Lastly we remove the dynamic onmerge functor (step 7). This is done by initializing the fonctor to a default boost::function. After this initialization, no dynamic merge functor is called when two faces are merged.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,55 +0,0 @@
|
|||
/*!
|
||||
\ingroup PkgCombinatorialMapsConcepts
|
||||
\cgalConcept
|
||||
|
||||
The concept `BasicMapItems` allows to customize a <I>d</I>D basic map by choosing the type of darts, and by enabling and disabling some attributes. For that, it defines an inner class template named
|
||||
\link BasicMapItems::Dart_wrapper `Dart_wrapper`\endlink, with one template parameter, `BMap`, a model of the `BasicMap` concept. This inner class must define two types: `%Dart` and `%Attributes`.
|
||||
|
||||
\cgalHasModel \link CGAL::Combinatorial_map_min_items `CGAL::Combinatorial_map_min_items<d>`\endlink
|
||||
\cgalHasModel \link CGAL::Generalized_map_min_items `CGAL::Generalized_map_min_items<d>`\endlink
|
||||
|
||||
\sa `BasicMap`
|
||||
\sa `BasicDart`
|
||||
|
||||
\cgalHeading{Example}
|
||||
|
||||
The following examples show two possible models of the `BasicMapItems` concept: the first one for a 4D combinatorial map without enabled attributes, the second one for a 3D generalized map with edge attributes enabled, and associated with a \link CGAL::Cell_attribute `Cell_attribute`\endlink containing an `int`.
|
||||
|
||||
\code{.cpp}
|
||||
struct Exemple_Item_4
|
||||
{
|
||||
template < class CMap >
|
||||
struct Dart_wrapper
|
||||
{
|
||||
typedef CGAL::Dart<4, CMap> Dart;
|
||||
typedef CGAL::cpp11::tuple<> Attributes;
|
||||
};
|
||||
};
|
||||
|
||||
struct Exemple_Item_3
|
||||
{
|
||||
template < class GMap >
|
||||
struct Dart_wrapper
|
||||
{
|
||||
typedef CGAL::GMap_dart<3, GMap> Dart;
|
||||
typedef CGAL::Cell_attribute<GMap, int> Edge_attrib;
|
||||
typedef CGAL::cpp11::tuple<void,Edge_attrib> Attributes;
|
||||
};
|
||||
};
|
||||
\endcode
|
||||
*/
|
||||
class BasicMapItems {
|
||||
public:
|
||||
|
||||
/*!
|
||||
Wrapper class defining type of darts and types of attributes. The class `%Dart_wrapper<CMap>` must provide:
|
||||
|
||||
- `%Dart_wrapper<CMap>::%Dart`, the type of dart, a model of the `BasicDart` concept.
|
||||
- `%Dart_wrapper<CMap>::%Attributes` The tuple of attributes, containing at most \link BasicMap::dimension `BMap::dimension+1`\endlink types (one for each possible cell of the basic map). Each type of the tuple must be either a model of the `CellAttribute` concept or `void`. The first type corresponds to 0-attributes, the second to 1-attributes and so on. If the \f$ i^{\mbox{th}}\f$ type in the tuple is `void`, (<I>i</I>-1)-attributes are disabled. Otherwise, (<I>i</I>-1)-attributes are enabled and have the given type. If the size of the tuple is <I>k</I>, with <I>k</I><\link BasicMap::dimension `BMap::dimension+1`\endlink, \f$ \forall\f$<I>i</I>: <I>k</I>\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `BMap::dimension`\endlink, <I>i</I>-attributes are disabled.
|
||||
|
||||
\note It can be implemented using a nested template class.
|
||||
*/
|
||||
template <typename BMap>
|
||||
using Dart_wrapper = unspecified_type;
|
||||
|
||||
}; /* end #BasicMapItems */
|
||||
|
|
@ -2,11 +2,11 @@
|
|||
\ingroup PkgCombinatorialMapsConcepts
|
||||
\cgalConcept
|
||||
|
||||
The concept `BasicMap` defines a <I>d</I>-dimensional basic map. This concept is defined only to factorize the common notions between \link CombinatorialMap `CombinatorialMap`\endlink and \link GeneralizedMap `GeneralizedMap`\endlink concepts.
|
||||
The concept `GenericMap` defines a <I>d</I>-dimensional generic map. This concept is defined only to factorize the common notions between \link CombinatorialMap `CombinatorialMap`\endlink and \link GeneralizedMap `GeneralizedMap`\endlink concepts.
|
||||
|
||||
\cgalRefines DefaultConstructible
|
||||
|
||||
A basic map has a set of darts <I>D</I>, and applications defined on these darts \f$ f_0\f$,\f$ \ldots\f$,\f$ f_{d}\f$.
|
||||
A generic map has a set of darts <I>D</I>, and applications defined on these darts \f$ f_0\f$,\f$ \ldots\f$,\f$ f_{d}\f$.
|
||||
|
||||
\cgalHasModel \link CGAL::Combinatorial_map `CGAL::Combinatorial_map<d,Items,Alloc>`\endlink
|
||||
\cgalHasModel \link CGAL::Generalized_map `CGAL::Generalized_map<d,Items,Alloc>`\endlink
|
||||
|
|
@ -16,18 +16,18 @@ A basic map has a set of darts <I>D</I>, and applications defined on these darts
|
|||
|
||||
*/
|
||||
|
||||
class BasicMap {
|
||||
class GenericMap {
|
||||
public:
|
||||
|
||||
/// \name Creation
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Construct a new basic map from another one.
|
||||
The new basic map is created by copying the darts and the non void attributes of bmap. BMap must be a model of `BasicMap` concept, which can be defined with a different dimension and/or different attributes than `*this`. In this case, only dimensions that are common to `bmap` and `*this`, and only non void i-attributes of `bmap` whose info type is the same to the info of non void i-attributes of `*this`, are copied.
|
||||
Construct a new generic map from another one.
|
||||
The new generic map is created by copying the darts and the non void attributes of bmap. Map must be a model of `GenericMap` concept, which can be defined with a different dimension and/or different attributes than `*this`. In this case, only dimensions that are common to `bmap` and `*this`, and only non void i-attributes of `bmap` whose info type is the same to the info of non void i-attributes of `*this`, are copied.
|
||||
*/
|
||||
template<typename BMap>
|
||||
BasicMap(const BMap& bmap);
|
||||
template<typename Map>
|
||||
GenericMap(const Map& bmap);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
@ -60,12 +60,12 @@ typedef unspecified_type size_type;
|
|||
/// @{
|
||||
|
||||
/*!
|
||||
The dimension <I>d</I> of the basic map, equal to `Dart::dimension`.
|
||||
The dimension <I>d</I> of the generic map, equal to `Dart::dimension`.
|
||||
*/
|
||||
static const unsigned int dimension;
|
||||
|
||||
/*!
|
||||
The number of available Boolean marks of the basic map.
|
||||
The number of available Boolean marks of the generic map.
|
||||
*/
|
||||
static const size_type NB_MARKS;
|
||||
|
||||
|
|
@ -76,16 +76,16 @@ static const size_type NB_MARKS;
|
|||
|
||||
/*!
|
||||
The tuple of cell attributes.
|
||||
It contains at most \link BasicMap::dimension `dimension`\endlink`+1` types
|
||||
(one for each possible cell of the basic map). Each type of
|
||||
It contains at most \link GenericMap::dimension `dimension`\endlink`+1` types
|
||||
(one for each possible cell of the generic map). Each type of
|
||||
the tuple must be either a model of the `CellAttribute` concept or
|
||||
`void`. The first type corresponds to 0-attributes, the second to
|
||||
1-attributes and so on. If the <i>i <sup>th</sup></i> type in the tuple
|
||||
is `void`, <I>(i-1)</I>-attributes are disabled. Otherwise,
|
||||
<I>(i-1)</I>-attributes are enabled and have the given type. If the
|
||||
size of the tuple is <I>k</I>, with <I>k</I>\f$
|
||||
<\f$\link BasicMap::dimension `dimension`\endlink`+1`, \f$ \forall\f$<I>i</I>: <I>k</I>\f$
|
||||
\leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink,
|
||||
<\f$\link GenericMap::dimension `dimension`\endlink`+1`, \f$ \forall\f$<I>i</I>: <I>k</I>\f$
|
||||
\leq\f$<I>i</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink,
|
||||
<I>i</I>-attributes are disabled.
|
||||
*/
|
||||
typedef unspecified_type Attributes;
|
||||
|
|
@ -93,10 +93,10 @@ typedef unspecified_type Attributes;
|
|||
/*!
|
||||
`Attribute_type<i>::%type` is the type of <I>i</I>-attributes, a model of `CellAttribute` concept.
|
||||
\link CellAttribute::Dart_handle `Attribute_type<i>::type::Dart_handle`\endlink is equal to
|
||||
\link BasicMap::Dart_handle `Dart_handle`\endlink, and
|
||||
\link GenericMap::Dart_handle `Dart_handle`\endlink, and
|
||||
\link CellAttribute::Dart_const_handle `Attribute_type<i>::type::Dart_const_handle`\endlink is equal to
|
||||
\link BasicMap::Dart_const_handle `Dart_const_handle`\endlink.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink and
|
||||
\link GenericMap::Dart_const_handle `Dart_const_handle`\endlink.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink and
|
||||
<I>i</I>-attributes are non `void`.
|
||||
\note It can be implemented using a nested template class.
|
||||
*/
|
||||
|
|
@ -105,7 +105,7 @@ typedef unspecified_type Attributes;
|
|||
|
||||
/*!
|
||||
`Attribute_handle<i>::%type` is a handle to <I>i</I>-attributes, equal to \link Dart::Attribute_handle `Dart::Attribute_handle<i>::type` \endlink.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink
|
||||
and <I>i</I>-attributes are non void.
|
||||
\note It can be implemented using a nested template class.
|
||||
*/
|
||||
|
|
@ -114,7 +114,7 @@ typedef unspecified_type Attributes;
|
|||
|
||||
/*!
|
||||
`Attribute_handle<i>::%type` is a const handle to <I>i</I>-attributes, equal to \link Dart::Attribute_const_handle `Dart::Attribute_const_handle<i>::type` \endlink.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink
|
||||
and <I>i</I>-attributes are non void.
|
||||
\note It can be implemented using a nested template class.
|
||||
*/
|
||||
|
|
@ -127,16 +127,16 @@ typedef unspecified_type Attributes;
|
|||
/// @{
|
||||
|
||||
/*!
|
||||
%Range of all the darts of the basic map.
|
||||
%Range of all the darts of the generic map.
|
||||
This type is a model of `Range` concept, its iterator type is bidirectional and its value type is
|
||||
\link BasicMap::Dart `Dart`\endlink.
|
||||
\link GenericMap::Dart `Dart`\endlink.
|
||||
*/
|
||||
typedef unspecified_type Dart_range;
|
||||
|
||||
/*!
|
||||
Const range of all the darts of the basic map.
|
||||
Const range of all the darts of the generic map.
|
||||
This type is a model of `ConstRange` concept, its iterator type is bidirectional and its value type is
|
||||
\link BasicMap::Dart `Dart`\endlink.
|
||||
\link GenericMap::Dart `Dart`\endlink.
|
||||
*/
|
||||
typedef unspecified_type Dart_const_range;
|
||||
|
||||
|
|
@ -144,8 +144,8 @@ typedef unspecified_type Dart_const_range;
|
|||
/*!
|
||||
`Attribute_range<i>::%type` is the range of all the <I>i</I>-attributes.
|
||||
`Attribute_range<i>::%type` is a model of `Range` concept, its iterator type is bidirectional and its value
|
||||
type is \link BasicMap::Attribute_type `Attribute_type<i>::type` \endlink.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink
|
||||
type is \link GenericMap::Attribute_type `Attribute_type<i>::type` \endlink.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink
|
||||
and <I>i</I>-attributes are non void.
|
||||
\note It can be implemented using a nested template class.
|
||||
*/
|
||||
|
|
@ -155,8 +155,8 @@ typedef unspecified_type Dart_const_range;
|
|||
|
||||
/*! `Attribute_const_range<i>::%type` is the const range of all the <I>i</I>-attributes.
|
||||
`Attribute_const_range<i>::%type` is a model of `ConstRange` concept, its iterator type is bidirectional and
|
||||
its value type is \link BasicMap::Attribute_type `Attribute_type<i>::type`\endlink.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink
|
||||
its value type is \link GenericMap::Attribute_type `Attribute_type<i>::type`\endlink.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink
|
||||
and <I>i</I>-attributes are non void.
|
||||
\note It can be implemented using a nested template class.
|
||||
*/
|
||||
|
|
@ -166,7 +166,7 @@ using Attribute_const_range = unspecified_type;
|
|||
/*!
|
||||
%Range of all the darts of the `<I...>` orbit.
|
||||
This type is a model of `Range` concept, its iterator type is forward and its value type is
|
||||
\link BasicMap::Dart `Dart`\endlink.
|
||||
\link GenericMap::Dart `Dart`\endlink.
|
||||
*/
|
||||
template<unsigned int... I>
|
||||
using Dart_of_orbit_range = unspecified_type;
|
||||
|
|
@ -174,7 +174,7 @@ using Dart_of_orbit_range = unspecified_type;
|
|||
/*!
|
||||
Const range of all the darts of the `<I...>` orbit.
|
||||
This type is a model of `ConstRange` concept, its iterator type is forward and its value type is
|
||||
\link BasicMap::Dart `Dart`\endlink.
|
||||
\link GenericMap::Dart `Dart`\endlink.
|
||||
*/
|
||||
template<unsigned int ... I>
|
||||
using Dart_of_orbit_const_range = unspecified_type;
|
||||
|
|
@ -182,10 +182,10 @@ using Dart_of_orbit_const_range = unspecified_type;
|
|||
/*!
|
||||
%Range of all the darts of an <I>i</I>-cell.
|
||||
Cells are considered in <I>dim</I> dimension, with 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dim+1</I> and
|
||||
0\f$ \leq\f$<I>dim</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink. If <I>i==dim+1</I>,
|
||||
0\f$ \leq\f$<I>dim</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink. If <I>i==dim+1</I>,
|
||||
range of all the darts of a connected component.
|
||||
This type is a model of `Range` concept, its iterator type is forward and its value type is
|
||||
\link BasicMap::Dart `Dart`\endlink.
|
||||
\link GenericMap::Dart `Dart`\endlink.
|
||||
*/
|
||||
template<unsigned int i,unsigned int dim=dimension>
|
||||
using Dart_of_cell_range = unspecified_type;
|
||||
|
|
@ -193,10 +193,10 @@ using Dart_of_cell_range = unspecified_type;
|
|||
/*!
|
||||
Const range of all the darts of the <I>i</I>-cell.
|
||||
Cells are considered in <I>dim</I> dimension, with 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dim+1</I> and
|
||||
0\f$ \leq\f$<I>dim</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink. If <I>i==dim+1</I>,
|
||||
0\f$ \leq\f$<I>dim</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink. If <I>i==dim+1</I>,
|
||||
range of all the darts of a connected component.
|
||||
This type is a model of `ConstRange` concept, its iterator type is forward and its value type is
|
||||
\link BasicMap::Dart `Dart`\endlink.
|
||||
\link GenericMap::Dart `Dart`\endlink.
|
||||
*/
|
||||
template<unsigned int i,unsigned int dim=dimension>
|
||||
using Dart_of_cell_const_range = unspecified_type;
|
||||
|
|
@ -205,11 +205,11 @@ using Dart_of_cell_const_range = unspecified_type;
|
|||
%Range of one dart of each <I>i</I>-cell incident to one <I>j</I>-cell.
|
||||
Cells are considered in <I>dim</I> dimension,
|
||||
with 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dim+1</I>, 0\f$ \leq\f$<I>j</I>\f$ \leq\f$<I>dim+1</I> and
|
||||
0\f$ \leq\f$<I>dim</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink. If <I>i</I>==<I>dim+1</I>,
|
||||
0\f$ \leq\f$<I>dim</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink. If <I>i</I>==<I>dim+1</I>,
|
||||
consider each connected component instead of each <I>i</I>-cell. If <I>j</I>==<I>dim+1</I>,
|
||||
consider one connected component instead of one <I>j</I>-cell.
|
||||
This type is a model of `Range` concept, its iterator type is forward and its value type is
|
||||
\link BasicMap::Dart `Dart`\endlink.
|
||||
\link GenericMap::Dart `Dart`\endlink.
|
||||
*/
|
||||
template<unsigned int i,unsigned int j,unsigned int dim=dimension>
|
||||
using One_dart_per_incident_cell_range = unspecified_type;
|
||||
|
|
@ -218,35 +218,35 @@ using One_dart_per_incident_cell_range = unspecified_type;
|
|||
Const range of one dart of each <I>i</I>-cell incident to one <I>j</I>-cell.
|
||||
Cells are considered in <I>dim</I> dimension,
|
||||
with 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dim+1</I>, 0\f$ \leq\f$<I>j</I>\f$ \leq\f$<I>dim+1</I> and
|
||||
0\f$ \leq\f$<I>dim</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink. If <I>i==dim+1</I>,
|
||||
0\f$ \leq\f$<I>dim</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink. If <I>i==dim+1</I>,
|
||||
consider each connected component instead of each <I>i</I>-cell. If <I>j==dim+1</I>,
|
||||
consider one connected component instead of one <I>j</I>-cell.
|
||||
This type is a model of `ConstRange` concept, its iterator type is forward and its value type is
|
||||
\link BasicMap::Dart `Dart`\endlink.
|
||||
\link GenericMap::Dart `Dart`\endlink.
|
||||
*/
|
||||
template<unsigned int i,unsigned int j,unsigned int dim=dimension>
|
||||
using One_dart_per_incident_cell_const_range = unspecified_type;
|
||||
|
||||
/*!
|
||||
%Range of one dart of each <I>i</I>-cell of the basic map.
|
||||
%Range of one dart of each <I>i</I>-cell of the generic map.
|
||||
Cells are considered in <I>dim</I> dimension,
|
||||
with 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dim+1</I> and
|
||||
0\f$ \leq\f$<I>dim</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink.
|
||||
0\f$ \leq\f$<I>dim</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink.
|
||||
If <I>i==dim+1</I>, consider each connected component instead of each <I>i</I>-cell.
|
||||
This type is a model of `Range` concept, its iterator type is forward and its value type is
|
||||
\link BasicMap::Dart `Dart`\endlink.
|
||||
\link GenericMap::Dart `Dart`\endlink.
|
||||
*/
|
||||
template<unsigned int i,unsigned int dim=dimension>
|
||||
using One_dart_per_cell_range = unspecified_type;
|
||||
|
||||
/*!
|
||||
Const range of one dart of each <I>i</I>-cell of the basic map.
|
||||
Const range of one dart of each <I>i</I>-cell of the generic map.
|
||||
Cells are considered in <I>dim</I> dimension,
|
||||
with 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dim+1</I> and
|
||||
0\f$ \leq\f$<I>dim</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink.
|
||||
0\f$ \leq\f$<I>dim</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink.
|
||||
If <I>i==dim+1</I>, consider each connected component instead of each <I>i</I>-cell.
|
||||
This type is a model of `ConstRange` concept, its iterator type is forward and its value type is
|
||||
\link BasicMap::Dart `Dart`\endlink.
|
||||
\link GenericMap::Dart `Dart`\endlink.
|
||||
*/
|
||||
template<unsigned int i,unsigned int dim=dimension>
|
||||
using One_dart_per_cell_const_range = unspecified_type;
|
||||
|
|
@ -257,37 +257,37 @@ using One_dart_per_cell_const_range = unspecified_type;
|
|||
/// @{
|
||||
|
||||
/*!
|
||||
Returns true iff the basic map is empty, i.e.\ it contains no dart.
|
||||
Returns true iff the generic map is empty, i.e.\ it contains no dart.
|
||||
*/
|
||||
bool is_empty() const;
|
||||
|
||||
/*!
|
||||
Returns true iff the basic map is valid.
|
||||
Returns true iff the generic map is valid.
|
||||
See the following links for the definition of valid for \link CombinatorialMap `combinatorial maps`\endlink and for \link GeneralizedMap `generalized maps`\endlink.
|
||||
*/
|
||||
bool is_valid() const;
|
||||
|
||||
/*!
|
||||
Returns true iff the basic map is without <I>i</I>-boundary.
|
||||
Returns true iff the generic map is without <I>i</I>-boundary.
|
||||
|
||||
The map is without <I>i</I>-boundary if there is no `i`-free dart.
|
||||
\pre 1\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink.
|
||||
\pre 1\f$ \leq\f$<I>i</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink.
|
||||
*/
|
||||
bool is_without_boundary(unsigned int i) const;
|
||||
|
||||
/*!
|
||||
Returns true iff the basic map is without boundary in all dimensions.
|
||||
Returns true iff the generic map is without boundary in all dimensions.
|
||||
*/
|
||||
bool is_without_boundary() const;
|
||||
|
||||
/*!
|
||||
Returns the number of darts in the basic map.
|
||||
Returns the number of darts in the generic map.
|
||||
*/
|
||||
size_type number_of_darts() const;
|
||||
|
||||
/*!
|
||||
Returns the number of <I>i</I>-attributes in the basic map.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink,
|
||||
Returns the number of <I>i</I>-attributes in the generic map.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink,
|
||||
and <I>i</I>-attributes are non void.
|
||||
*/
|
||||
template <unsigned int i>
|
||||
|
|
@ -299,13 +299,13 @@ bool is_dart_used(Dart_const_handle dh) const;
|
|||
|
||||
/*!
|
||||
Returns true iff dart `*dh` is <I>i</I>-free.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink.
|
||||
*/
|
||||
bool is_free(Dart_const_handle dh, unsigned int i) const;
|
||||
|
||||
/*!
|
||||
Returns true iff dart `*dh` is <I>i</I>-free.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink.
|
||||
*/
|
||||
template<unsigned int i>
|
||||
bool is_free(Dart_const_handle dh) const;
|
||||
|
|
@ -326,44 +326,44 @@ Returns a const handle to a dart belonging to the other vertex of the edge conta
|
|||
Dart_const_handle other_extremity(Dart_const_handle dh) const;
|
||||
|
||||
/*!
|
||||
Returns a handle to a dart belonging to the next edge after `*dh`, that does not belong to the same <I>0</I>-cell than `*dh` and that belongs to the same <I>i</I>-cell than `*dh`for each <I>i</I>, 2\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink.
|
||||
Returns a handle to a dart belonging to the next edge after `*dh`, that does not belong to the same <I>0</I>-cell than `*dh` and that belongs to the same <I>i</I>-cell than `*dh`for each <I>i</I>, 2\f$ \leq\f$<I>i</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink.
|
||||
*/
|
||||
Dart_handle next(Dart_handle dh);
|
||||
|
||||
/*!
|
||||
Returns a const handle to a dart belonging to the next edge after `*dh`, that does not belong to the same <I>0</I>-cell than `*dh` and that belongs to the same <I>i</I>-cell than `*dh`for each <I>i</I>, 2\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink.
|
||||
Returns a const handle to a dart belonging to the next edge after `*dh`, that does not belong to the same <I>0</I>-cell than `*dh` and that belongs to the same <I>i</I>-cell than `*dh`for each <I>i</I>, 2\f$ \leq\f$<I>i</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink.
|
||||
*/
|
||||
Dart_const_handle next(Dart_const_handle dh) const;
|
||||
|
||||
/*!
|
||||
Returns a handle to a dart belonging to the previous edge begore `*dh`, that does not belong to the same <I>0</I>-cell than `*dh` and that belongs to the same <I>i</I>-cell than `*dh`for each <I>i</I>, 2\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink.
|
||||
Returns a handle to a dart belonging to the previous edge begore `*dh`, that does not belong to the same <I>0</I>-cell than `*dh` and that belongs to the same <I>i</I>-cell than `*dh`for each <I>i</I>, 2\f$ \leq\f$<I>i</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink.
|
||||
*/
|
||||
Dart_handle previous(Dart_handle dh);
|
||||
|
||||
/*!
|
||||
Returns a const handle to a dart belonging to the previous edge begore `*dh`, that does not belong to the same <I>0</I>-cell than `*dh` and that belongs to the same <I>i</I>-cell than `*dh`for each <I>i</I>, 2\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink.
|
||||
Returns a const handle to a dart belonging to the previous edge begore `*dh`, that does not belong to the same <I>0</I>-cell than `*dh` and that belongs to the same <I>i</I>-cell than `*dh`for each <I>i</I>, 2\f$ \leq\f$<I>i</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink.
|
||||
*/
|
||||
Dart_const_handle previous(Dart_const_handle dh) const;
|
||||
|
||||
/*!
|
||||
Returns a handle to a dart belonging to the opposite <I>i</I>-cell than `*dh`. This dart does not belong to the same <I>0</I>-cell than `*dh`, nor to the same <I>i</I>-cell, but belongs to the same <I>i</I>-cell than `*dh`for each <I>j</I>, 2\f$ \leq\f$<I>j</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink, <I>j</I>\f$ \neq\f$<I>i</I>.
|
||||
\pre 2\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink.
|
||||
Returns a handle to a dart belonging to the opposite <I>i</I>-cell than `*dh`. This dart does not belong to the same <I>0</I>-cell than `*dh`, nor to the same <I>i</I>-cell, but belongs to the same <I>i</I>-cell than `*dh`for each <I>j</I>, 2\f$ \leq\f$<I>j</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink, <I>j</I>\f$ \neq\f$<I>i</I>.
|
||||
\pre 2\f$ \leq\f$<I>i</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink.
|
||||
*/
|
||||
template<unsigned int i>
|
||||
Dart_handle opposite(Dart_handle dh);
|
||||
|
||||
/*!
|
||||
Returns a const handle to a dart belonging to the opposite <I>i</I>-cell than `*dh`. This dart does not belong to the same <I>0</I>-cell than `*dh`, nor to the same <I>i</I>-cell, but belongs to the same <I>i</I>-cell than `*dh`for each <I>j</I>, 2\f$ \leq\f$<I>j</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink, <I>j</I>\f$ \neq\f$<I>i</I>.
|
||||
\pre 2\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink.
|
||||
Returns a const handle to a dart belonging to the opposite <I>i</I>-cell than `*dh`. This dart does not belong to the same <I>0</I>-cell than `*dh`, nor to the same <I>i</I>-cell, but belongs to the same <I>i</I>-cell than `*dh`for each <I>j</I>, 2\f$ \leq\f$<I>j</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink, <I>j</I>\f$ \neq\f$<I>i</I>.
|
||||
\pre 2\f$ \leq\f$<I>i</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink.
|
||||
*/
|
||||
template<unsigned int i>
|
||||
Dart_const_handle opposite(Dart_const_handle dh) const;
|
||||
|
||||
/*!
|
||||
Displays on `os` the number of elements of the basic map.
|
||||
Displays on `os` the number of elements of the generic map.
|
||||
Its number of darts,
|
||||
its number of <I>i</I>-cells, for each <I>i</I>,
|
||||
0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink,
|
||||
0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink,
|
||||
and its number of connected components.
|
||||
|
||||
Example of output for a 3D combinatorial map containing two disjoint combinatorial tetrahedra:
|
||||
|
|
@ -379,13 +379,13 @@ std::ostream& display_characteristics(std::ostream & os) const;
|
|||
///
|
||||
/*!
|
||||
Returns a handle to the <I>i</I>-attribute associated to dart `*dh`.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink, and <I>i</I>-attributes are non `void`.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink, and <I>i</I>-attributes are non `void`.
|
||||
*/
|
||||
template <unsigned int i> Attribute_handle<i>::type attribute(Dart_handle dh);
|
||||
|
||||
/*!
|
||||
Returns a const handle to the <I>i</I>-attribute associated to dart `*dh`, when the dart is const.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink, and <I>i</I>-attributes are non `void`.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink, and <I>i</I>-attributes are non `void`.
|
||||
*/
|
||||
template <unsigned int i>
|
||||
Attribute_const_handle<i>::type attribute(Dart_const_handle dh) const;
|
||||
|
|
@ -393,7 +393,7 @@ Attribute_const_handle<i>::type attribute(Dart_const_handle dh) const;
|
|||
/*!
|
||||
Returns one dart of the cell associated to the <I>i</I>-attribute `*ah`.
|
||||
`NULL` if \link CellAttribute::Supports_cell_dart `Supports_cell_dart`\endlink of <I>i</I>-attributes is equal to \link CGAL::Tag_false `Tag_false`\endlink.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink, <I>i</I>-attributes are non `void` and `ah`!=NULL.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink, <I>i</I>-attributes are non `void` and `ah`!=NULL.
|
||||
*/
|
||||
template<unsigned int i>
|
||||
Dart_handle dart_of_attribute(typename Attribute_handle<i>::type ah);
|
||||
|
|
@ -401,7 +401,7 @@ Dart_handle dart_of_attribute(typename Attribute_handle<i>::type ah);
|
|||
/*!
|
||||
Returns one dart of the cell associated to the const <I>i</I>-attribute `*ah`.
|
||||
`NULL` if \link CellAttribute::Supports_cell_dart `Supports_cell_dart`\endlink of <I>i</I>-attributes is equal to \link CGAL::Tag_false `Tag_false`\endlink.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink, <I>i</I>-attributes are non `void` and `ah`!=NULL.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink, <I>i</I>-attributes are non `void` and `ah`!=NULL.
|
||||
*/
|
||||
template<unsigned int i>
|
||||
Dart_const_handle dart_of_attribute(typename Attribute_const_handle<i>::type ah) const;
|
||||
|
|
@ -409,7 +409,7 @@ Dart_const_handle dart_of_attribute(typename Attribute_const_handle<i>::type ah)
|
|||
/*!
|
||||
Returns the information of the <I>i</I>-attribute `*ah`.
|
||||
Defined only if \link CellAttribute::Info `Info`\endlink of <I>i</I>-attributes is not `void`.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink, <I>i</I>-attributes are non `void` and `ah`!=NULL.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink, <I>i</I>-attributes are non `void` and `ah`!=NULL.
|
||||
*/
|
||||
template <unsigned int i>
|
||||
Attribute_type<i>::type::Info& info_of_attribute(typename Attribute_handle<i>::type ah);
|
||||
|
|
@ -417,41 +417,41 @@ Attribute_type<i>::type::Info& info_of_attribute(typename Attribute_handle<i>::t
|
|||
/*!
|
||||
Returns the information of the const <I>i</I>-attribute `*ah`.
|
||||
Defined only if \link CellAttribute::Info `Info`\endlink of <I>i</I>-attributes is not `void`.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink, <I>i</I>-attributes are non `void` and `ah`!=NULL.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink, <I>i</I>-attributes are non `void` and `ah`!=NULL.
|
||||
*/
|
||||
template <unsigned int i>
|
||||
const Attribute_type<i>::type::Info& info_of_attribute(typename Attribute_const_handle<i>::type ah) const;
|
||||
|
||||
/*!
|
||||
A shorcut for \link BasicMap::info_of_attribute `info_of_attribute<i>`\endlink`(`\link BasicMap::attribute `attribute<i>`\endlink`(adart))`.
|
||||
\pre \link BasicMap::attribute `attribute<i>`\endlink`(adart)!=NULL`.
|
||||
A shorcut for \link GenericMap::info_of_attribute `info_of_attribute<i>`\endlink`(`\link GenericMap::attribute `attribute<i>`\endlink`(adart))`.
|
||||
\pre \link GenericMap::attribute `attribute<i>`\endlink`(adart)!=NULL`.
|
||||
*/
|
||||
template<unsigned int i>
|
||||
typename Attribute_type<i>::type::Info & info(Dart_handle adart);
|
||||
|
||||
/*!
|
||||
A shorcut for \link BasicMap::info_of_attribute(typename Attribute_const_handle<i>::type)const `info_of_attribute<i>`\endlink`(`\link BasicMap::attribute(Dart_const_handle)const `attribute<i>`\endlink`(adart))` for const handle.
|
||||
\pre \link BasicMap::attribute(Dart_const_handle)const `attribute<i>`\endlink`(adart)!=NULL`.
|
||||
A shorcut for \link GenericMap::info_of_attribute(typename Attribute_const_handle<i>::type)const `info_of_attribute<i>`\endlink`(`\link GenericMap::attribute(Dart_const_handle)const `attribute<i>`\endlink`(adart))` for const handle.
|
||||
\pre \link GenericMap::attribute(Dart_const_handle)const `attribute<i>`\endlink`(adart)!=NULL`.
|
||||
*/
|
||||
template<unsigned int i>
|
||||
const typename Attribute_type<i>::type::Info & info(Dart_const_handle adart) const;
|
||||
|
||||
/*!
|
||||
A shorcut for \link BasicMap::dart_of_attribute `dart_of_attribute<i>`\endlink`(`\link BasicMap::attribute `attribute<i>`\endlink`(adart))`.
|
||||
A shorcut for \link GenericMap::dart_of_attribute `dart_of_attribute<i>`\endlink`(`\link GenericMap::attribute `attribute<i>`\endlink`(adart))`.
|
||||
\pre `attribute<i>(adart)!=NULL`.
|
||||
*/
|
||||
template<unsigned int i>
|
||||
Dart_handle & dart(Dart_handle adart);
|
||||
|
||||
/*!
|
||||
A shorcut for \link BasicMap::dart_of_attribute(typename Attribute_const_handle<i>::type)const `dart_of_attribute<i>`\endlink`(`\link BasicMap::attribute(Dart_const_handle)const `attribute<i>`\endlink`(adart))` for const handle.
|
||||
A shorcut for \link GenericMap::dart_of_attribute(typename Attribute_const_handle<i>::type)const `dart_of_attribute<i>`\endlink`(`\link GenericMap::attribute(Dart_const_handle)const `attribute<i>`\endlink`(adart))` for const handle.
|
||||
\pre `attribute<i>(adart)!=NULL`.
|
||||
*/
|
||||
template<unsigned int i>
|
||||
Dart_const_handle dart(Dart_const_handle adart) const;
|
||||
|
||||
/*! Returns true if ah points to a used i-attribute (i.e.\ valid).
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink, and <I>i</I>-attributes are non `void`.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink, and <I>i</I>-attributes are non `void`.
|
||||
*/
|
||||
template<unsigned int i>
|
||||
bool is_attribute_used(typename Attribute_const_handle<i>::type ah) const;
|
||||
|
|
@ -479,25 +479,25 @@ Dart_const_handle dart_handle(const Dart& d) const;
|
|||
/// @{
|
||||
|
||||
/*!
|
||||
Returns a range of all the darts in the basic map.
|
||||
Returns a range of all the darts in the generic map.
|
||||
*/
|
||||
Dart_range& darts();
|
||||
|
||||
/*!
|
||||
Returns a const range of all the darts in the basic map.
|
||||
Returns a const range of all the darts in the generic map.
|
||||
*/
|
||||
Dart_const_range& darts() const;
|
||||
|
||||
/*!
|
||||
Returns a range of all the <I>i</I>-attributes in the basic map.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink,
|
||||
Returns a range of all the <I>i</I>-attributes in the generic map.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink,
|
||||
and <I>i</I>-attributes are non void.
|
||||
*/
|
||||
template<unsigned int i> Attribute_range<i>::type & attributes();
|
||||
|
||||
/*!
|
||||
Returns a const range of all the <I>i</I>-attributes in the basic map.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink,
|
||||
Returns a const range of all the <I>i</I>-attributes in the generic map.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink,
|
||||
and <I>i</I>-attributes are non void.
|
||||
*/
|
||||
template<unsigned int i> Attribute_const_range<i>::type & attributes() const;
|
||||
|
|
@ -506,7 +506,7 @@ template<unsigned int i> Attribute_const_range<i>::type & attributes() const;
|
|||
Returns a range of all the darts of the orbit `<I...>(*dh)`.
|
||||
The first element in the range points onto `*dh`.
|
||||
\pre `*dh`\f$ \in\f$`darts()` and `I...` is a sequence of integers \f$ i_1\f$,\f$ \ldots\f$,\f$ i_k\f$,
|
||||
such that 0\f$ \leq\f$\f$ i_1\f$\f$ <\f$\f$ i_2\f$\f$ <\f$\f$ \ldots\f$\f$ <\f$\f$ i_k\f$\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink.
|
||||
such that 0\f$ \leq\f$\f$ i_1\f$\f$ <\f$\f$ i_2\f$\f$ <\f$\f$ \ldots\f$\f$ <\f$\f$ i_k\f$\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink.
|
||||
*/
|
||||
template<unsigned int ... I> Dart_of_orbit_range darts_of_orbit(Dart_handle dh);
|
||||
|
||||
|
|
@ -523,7 +523,7 @@ The first element in the range points onto `*dh`.
|
|||
<I>i</I>-cells are considered in <I>dim</I> dimension. If <I>i==dim+1</I>,
|
||||
range of all the darts of the connected component containing `dh`.
|
||||
\pre `*dh`\f$ \in\f$`darts()`, 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dim+1</I> and
|
||||
0\f$ \leq\f$<I>dim</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink.
|
||||
0\f$ \leq\f$<I>dim</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink.
|
||||
*/
|
||||
template<unsigned int i,unsigned int dim=dimension> Dart_of_cell_range darts_of_cell(Dart_handle dh);
|
||||
|
||||
|
|
@ -544,7 +544,7 @@ consider each connected component instead of each <I>i</I>-cell. If <I>j==dim+1<
|
|||
consider the connected component containing `*dh` instead of the <I>j</I>-cell.
|
||||
\pre `*dh`\f$ \in\f$`darts()`, 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dim+1</I>,
|
||||
0\f$ \leq\f$<I>j</I>\f$ \leq\f$<I>dim+1</I> and
|
||||
0\f$ \leq\f$<I>dim</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink.
|
||||
0\f$ \leq\f$<I>dim</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink.
|
||||
*/
|
||||
template<unsigned int i,unsigned int j,unsigned int dim=dimension> One_dart_per_incident_cell_range one_dart_per_incident_cell(Dart_handle dh);
|
||||
|
||||
|
|
@ -559,18 +559,18 @@ consider the connected component containing `*dh` instead of the <I>j</I>-cell.
|
|||
template<unsigned int i,unsigned int j,unsigned int dim=dimension> One_dart_per_incident_cell_const_range one_dart_per_incident_cell(Dart_const_handle dh) const;
|
||||
|
||||
/*!
|
||||
Returns a range of one dart of each <I>i</I>-cell in the basic map.
|
||||
Returns a range of one dart of each <I>i</I>-cell in the generic map.
|
||||
Cells are considered in <I>dim</I> dimension. If <I>i==dim+1</I>,
|
||||
range of one dart of each connected component in the basic map.
|
||||
range of one dart of each connected component in the generic map.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dim+1</I> and
|
||||
0\f$ \leq\f$<I>dim</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink.
|
||||
0\f$ \leq\f$<I>dim</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink.
|
||||
*/
|
||||
template<unsigned int i,unsigned int dim=dimension> One_dart_per_cell_range one_dart_per_cell();
|
||||
|
||||
/*!
|
||||
Returns a const range of one dart of each <I>i</I>-cell in the basic map.
|
||||
Returns a const range of one dart of each <I>i</I>-cell in the generic map.
|
||||
Cells are considered in <I>dim</I> dimension. If <I>i==dim+1</I>,
|
||||
const range of one dart of each connected component in the basic map.
|
||||
const range of one dart of each connected component in the generic map.
|
||||
\pre Same as for the non const version.
|
||||
*/
|
||||
template<unsigned int i,unsigned int dim=dimension> One_dart_per_cell_const_range one_dart_per_cell() const;
|
||||
|
|
@ -581,10 +581,10 @@ template<unsigned int i,unsigned int dim=dimension> One_dart_per_cell_const_rang
|
|||
/// @{
|
||||
|
||||
/*!
|
||||
Creates a new dart in the basic map, and returns the corresponding handle.
|
||||
Creates a new dart in the generic map, and returns the corresponding handle.
|
||||
Calls the constructor of dart having `T1` as parameter.
|
||||
A new dart is initialized to be <I>i</I>-free,
|
||||
\f$ \forall\f$<I>i</I>: 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink, and to have no associated attribute for each non void attribute.
|
||||
\f$ \forall\f$<I>i</I>: 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink, and to have no associated attribute for each non void attribute.
|
||||
Overloads of this member function are defined that take from zero to nine arguments.
|
||||
With zero argument, `%create_dart()` creates a new dart by using the default constructor.
|
||||
|
||||
|
|
@ -593,53 +593,53 @@ template<typename T1>
|
|||
Dart_handle create_dart(T1 t1);
|
||||
|
||||
/*!
|
||||
Removes `*dh` from the basic map.
|
||||
Removes `*dh` from the generic map.
|
||||
\pre `*dh`\f$ \in\f$`darts()`.
|
||||
|
||||
*/
|
||||
void erase_dart(Dart_handle dh);
|
||||
|
||||
/*!
|
||||
Creates a new <I>i</I>-attribute in the basic map, and returns the corresponding handle.
|
||||
Creates a new <I>i</I>-attribute in the generic map, and returns the corresponding handle.
|
||||
Calls the constructor of <I>i</I>-attribute having `T1` as parameter.
|
||||
Overloads of this member function are defined that take from zero to nine arguments.
|
||||
With zero argument, `create_attribute<i>()` creates a new <I>i</I>-attribute by using the default constructor.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink,
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink,
|
||||
and <I>i</I>-attributes are non void.
|
||||
*/
|
||||
template<unsigned int i,typename T1> Attribute_handle<i>::type create_attribute(T1 t1);
|
||||
|
||||
/*!
|
||||
Removes the <I>i</I>-attribute `*ah` from the basic map.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink,
|
||||
Removes the <I>i</I>-attribute `*ah` from the generic map.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink,
|
||||
<I>i</I>-attributes are non void, and
|
||||
`*ah`\f$ \in\f$\link BasicMap::attributes() `attributes<i>()`\endlink.
|
||||
`*ah`\f$ \in\f$\link GenericMap::attributes() `attributes<i>()`\endlink.
|
||||
*/
|
||||
template <unsigned int i> void erase_attribute(Attribute_handle<i>::type ah);
|
||||
|
||||
/*!
|
||||
Associates the <I>i</I>-attribute of all the darts of the <I>i</I>-cell containing `*dh` to `*ah`.
|
||||
\pre `*dh`\f$ \in\f$`darts()`, 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink,
|
||||
<I>i</I>-attributes are non void, and `*ah`\f$ \in\f$\link BasicMap::attributes() `attributes<i>()`\endlink.
|
||||
\pre `*dh`\f$ \in\f$`darts()`, 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink,
|
||||
<I>i</I>-attributes are non void, and `*ah`\f$ \in\f$\link GenericMap::attributes() `attributes<i>()`\endlink.
|
||||
*/
|
||||
template <unsigned int i> void set_attribute(Dart_handle dh, Attribute_handle<i>::type ah);
|
||||
|
||||
/*!
|
||||
Deletes all the darts and all the attributes of the basic map.
|
||||
Deletes all the darts and all the attributes of the generic map.
|
||||
*/
|
||||
void clear();
|
||||
|
||||
/*!
|
||||
Assignment operator.
|
||||
All darts and attributes are duplicated, and the former basic map is deleted.
|
||||
All darts and attributes are duplicated, and the former generic map is deleted.
|
||||
*/
|
||||
BasicMap& operator= (const BasicMap& bmap);
|
||||
GenericMap& operator= (const GenericMap& bmap);
|
||||
|
||||
/*!
|
||||
Swap the current basic map with `bmap`.
|
||||
Swap the current generic map with `bmap`.
|
||||
There is no copy of darts and attributes thus this method runs in constant time.
|
||||
*/
|
||||
void swap(BasicMap& bmap);
|
||||
void swap(GenericMap& bmap);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
@ -647,28 +647,28 @@ void swap(BasicMap& bmap);
|
|||
/// @{
|
||||
|
||||
/*!
|
||||
Returns the status of the management of the attributes of the basic map. <code>true</code> if the high level operations update the non void attributes (default value); <code>false</code> otherwise.
|
||||
Returns the status of the management of the attributes of the generic map. <code>true</code> if the high level operations update the non void attributes (default value); <code>false</code> otherwise.
|
||||
*/
|
||||
bool are_attributes_automatically_managed() const;
|
||||
|
||||
/*!
|
||||
Set the status of the managment of the attributes of the basic map.
|
||||
Set the status of the managment of the attributes of the generic map.
|
||||
|
||||
\cgalAdvancedBegin
|
||||
After calling `set_automatic_attributes_management(false)`, all high level operations will not update non void attributes, until the call of `set_automatic_attributes_management(true)`. The call of `set_automatic_attributes_management(true)` call the \link BasicMap::correct_invalid_attributes `correct_invalid_attributes()`\endlink function.
|
||||
After calling `set_automatic_attributes_management(false)`, all high level operations will not update non void attributes, until the call of `set_automatic_attributes_management(true)`. The call of `set_automatic_attributes_management(true)` call the \link GenericMap::correct_invalid_attributes `correct_invalid_attributes()`\endlink function.
|
||||
\cgalAdvancedEnd
|
||||
|
||||
*/
|
||||
void set_automatic_attributes_management(bool update_attributes);
|
||||
|
||||
/*!
|
||||
Correct the invalid attributes of the basic map.
|
||||
We can have invalid attribute either if we have called \link BasicMap::set_automatic_attributes_management `set_automatic_attributes_management(false)`\endlink before to use some modification operations or if we have modified the basic map by using low level operations.
|
||||
Correct the invalid attributes of the generic map.
|
||||
We can have invalid attribute either if we have called \link GenericMap::set_automatic_attributes_management `set_automatic_attributes_management(false)`\endlink before to use some modification operations or if we have modified the generic map by using low level operations.
|
||||
|
||||
\f$ \forall i \f$, 0 \f$ \leq \f$ i \f$ \leq \f$ \link BasicMap::dimension `dimension`\endlink such that the i-attributes are non void, \f$ \forall \f$ d \f$ \in\f$`darts()`:
|
||||
\f$ \forall i \f$, 0 \f$ \leq \f$ i \f$ \leq \f$ \link GenericMap::dimension `dimension`\endlink 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);
|
||||
- ensures that \link BasicMap::dart_of_attribute `dart_of_attribute(d)`\endlink \f$ \in \f$ i-cell(`d`).
|
||||
- ensures that \link GenericMap::dart_of_attribute `dart_of_attribute(d)`\endlink \f$ \in \f$ i-cell(`d`).
|
||||
*/
|
||||
void correct_invalid_attributes();
|
||||
|
||||
|
|
@ -678,36 +678,36 @@ void correct_invalid_attributes();
|
|||
/// @{
|
||||
|
||||
/*!
|
||||
Returns true iff `*dh1` can be <I>i</I>-sewn with `*dh2` by keeping the basic map valid.
|
||||
Returns true iff `*dh1` can be <I>i</I>-sewn with `*dh2` by keeping the generic map valid.
|
||||
See the following links for the definition of is_sewable for \link CombinatorialMap `combinatorial maps`\endlink and for \link GeneralizedMap `generalized maps`\endlink.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink,
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink,
|
||||
`*dh1`\f$ \in\f$`darts()`, and `*dh2`\f$ \in\f$`darts()`.
|
||||
*/
|
||||
template <unsigned int i> bool is_sewable(Dart_const_handle dh1, Dart_const_handle dh2) const;
|
||||
|
||||
/*!
|
||||
<I>i</I>-sew darts `*dh1` and `*dh2`, by keeping the basic map valid.
|
||||
<I>i</I>-sew darts `*dh1` and `*dh2`, by keeping the generic map valid.
|
||||
See the following links for the definition of the <I>i</I>-sew for \link CombinatorialMap `combinatorial maps`\endlink and for \link GeneralizedMap `generalized maps`\endlink.
|
||||
|
||||
If \link BasicMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, when necessary, non void attributes are updated to ensure the validity of the basic map: for each <I>j</I>-cells <I>c1</I> and <I>c2</I> which are merged into one <I>j</I>-cell during the sew, the two associated attributes <I>attr1</I> and <I>attr2</I> are considered. If one attribute is NULL and the other not, the non NULL attribute is associated to all the darts of the resulting cell. When the two attributes are non NULL, functor \link CellAttribute::On_merge `Attribute_type<i>::type::On_merge`\endlink is called on the two attributes <I>attr1</I> and <I>attr2</I>. If set, the dynamic onmerge function of <i>i</i>-attributes is also called on <I>attr1</I> and <I>attr2</I>. Then, the attribute <I>attr1</I> is associated to all darts of the resulting <I>j</I>-cell. Finally, attribute <I>attr2</I> is removed from the basic map.
|
||||
\pre \link BasicMap::is_sewable `is_sewable<i>(dh1,dh2)`\endlink.
|
||||
If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, when necessary, non void attributes are updated to ensure the validity of the generic map: for each <I>j</I>-cells <I>c1</I> and <I>c2</I> which are merged into one <I>j</I>-cell during the sew, the two associated attributes <I>attr1</I> and <I>attr2</I> are considered. If one attribute is NULL and the other not, the non NULL attribute is associated to all the darts of the resulting cell. When the two attributes are non NULL, functor \link CellAttribute::On_merge `Attribute_type<i>::type::On_merge`\endlink is called on the two attributes <I>attr1</I> and <I>attr2</I>. If set, the dynamic onmerge function of <i>i</i>-attributes is also called on <I>attr1</I> and <I>attr2</I>. Then, the attribute <I>attr1</I> is associated to all darts of the resulting <I>j</I>-cell. Finally, attribute <I>attr2</I> is removed from the generic map.
|
||||
\pre \link GenericMap::is_sewable `is_sewable<i>(dh1,dh2)`\endlink.
|
||||
|
||||
\cgalAdvancedBegin
|
||||
If \link BasicMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are not updated; thus the basic map can be no more valid after this operation.
|
||||
If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are not updated; thus the generic map can be no more valid after this operation.
|
||||
\cgalAdvancedEnd
|
||||
|
||||
*/
|
||||
template <unsigned int i> void sew(Dart_handle dh1,Dart_handle dh2);
|
||||
|
||||
/*!
|
||||
<I>i</I>-unsew darts `*dh` and `*opposite<i>(*dh)`, by keeping the basic map valid.
|
||||
<I>i</I>-unsew darts `*dh` and `*opposite<i>(*dh)`, by keeping the generic map valid.
|
||||
See the following links for the definition of is_sewable for \link CombinatorialMap `combinatorial maps`\endlink and for \link GeneralizedMap `generalized maps`\endlink.
|
||||
|
||||
If \link BasicMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, when necessary, non void attributes are updated to ensure the validity of the basic map: for each <I>j</I>-cell <I>c</I> split in two <I>j</I>-cells <I>c1</I> and <I>c2</I> by the operation, if <I>c</I> is associated to a <I>j</I>-attribute <I>attr1</I>, then this attribute is duplicated into <I>attr2</I>, and all the darts belonging to <I>c2</I> are associated with this new attribute. Finally, the functor \link CellAttribute::On_split `Attribute_type<i>::type::On_split`\endlink is called on the two attributes <I>attr1</I> and <I>attr2</I>. If set, the dynamic onsplit function of <i>i</i>-attributes is also called on <I>attr1</I> and <I>attr2</I>.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink, `*dh`\f$ \in\f$`darts()` and `*dh` is not <I>i</I>-free.
|
||||
If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, when necessary, non void attributes are updated to ensure the validity of the generic map: for each <I>j</I>-cell <I>c</I> split in two <I>j</I>-cells <I>c1</I> and <I>c2</I> by the operation, if <I>c</I> is associated to a <I>j</I>-attribute <I>attr1</I>, then this attribute is duplicated into <I>attr2</I>, and all the darts belonging to <I>c2</I> are associated with this new attribute. Finally, the functor \link CellAttribute::On_split `Attribute_type<i>::type::On_split`\endlink is called on the two attributes <I>attr1</I> and <I>attr2</I>. If set, the dynamic onsplit function of <i>i</i>-attributes is also called on <I>attr1</I> and <I>attr2</I>.
|
||||
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink, `*dh`\f$ \in\f$`darts()` and `*dh` is not <I>i</I>-free.
|
||||
|
||||
\cgalAdvancedBegin
|
||||
If \link BasicMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are not updated thus the basic map can be no more valid after this operation.
|
||||
If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are not updated thus the generic map can be no more valid after this operation.
|
||||
\cgalAdvancedEnd
|
||||
*/
|
||||
template <unsigned int i> void unsew(Dart_handle dh);
|
||||
|
|
@ -719,7 +719,7 @@ template <unsigned int i> void unsew(Dart_handle dh);
|
|||
|
||||
/*!
|
||||
Return the current dynamic onsplit function associated with i-attributes.
|
||||
This is a boost:function returning void and having two references to \link BasicMap::Attribute_type `Attribute_type<i>::type`\endlink as parameters.
|
||||
This is a boost:function returning void and having two references to \link GenericMap::Attribute_type `Attribute_type<i>::type`\endlink as parameters.
|
||||
The onsplit function is returned by reference so that we can modify it.
|
||||
*/
|
||||
template<int i>
|
||||
|
|
@ -729,7 +729,7 @@ template <unsigned int i> void unsew(Dart_handle dh);
|
|||
|
||||
/*!
|
||||
Return the current dynamic onsplit function associated with i-attributes, when *this is const.
|
||||
This is a boost:function returning void and having two references to \link BasicMap::Attribute_type `Attribute_type<i>::type`\endlink as parameters.
|
||||
This is a boost:function returning void and having two references to \link GenericMap::Attribute_type `Attribute_type<i>::type`\endlink as parameters.
|
||||
*/
|
||||
template<int i>
|
||||
const boost::function<void(typename Attribute_type< i >::type&,
|
||||
|
|
@ -738,7 +738,7 @@ template <unsigned int i> void unsew(Dart_handle dh);
|
|||
|
||||
/*!
|
||||
Return the current dynamic onmerge function associated with i-attributes.
|
||||
This is a boost:function returning void and having two references to \link BasicMap::Attribute_type `Attribute_type<i>::type`\endlink as parameters.
|
||||
This is a boost:function returning void and having two references to \link GenericMap::Attribute_type `Attribute_type<i>::type`\endlink as parameters.
|
||||
The onmerge function is returned by reference so that we can modify it.
|
||||
*/
|
||||
template<int i>
|
||||
|
|
@ -748,7 +748,7 @@ template <unsigned int i> void unsew(Dart_handle dh);
|
|||
|
||||
/*!
|
||||
Return the current dynamic onmerge function associated with i-attributes, when *this is const.
|
||||
This is a boost:function returning void and having two references to \link BasicMap::Attribute_type `Attribute_type<i>::type`\endlink as parameters.
|
||||
This is a boost:function returning void and having two references to \link GenericMap::Attribute_type `Attribute_type<i>::type`\endlink as parameters.
|
||||
*/
|
||||
template<int i>
|
||||
const boost::function<void(typename Attribute_type< i >::type&,
|
||||
|
|
@ -767,58 +767,58 @@ index. If there is no more available free mark, throw the exception Exception_no
|
|||
size_type get_new_mark() const;
|
||||
|
||||
/*!
|
||||
Returns true iff `m` is a reserved mark of the basic map.
|
||||
\pre 0\f$ \leq\f$<I>m</I>\f$ <\f$\link BasicMap::NB_MARKS `NB_MARKS`\endlink.
|
||||
Returns true iff `m` is a reserved mark of the generic map.
|
||||
\pre 0\f$ \leq\f$<I>m</I>\f$ <\f$\link GenericMap::NB_MARKS `NB_MARKS`\endlink.
|
||||
*/
|
||||
bool is_reserved(size_type m) const;
|
||||
|
||||
/*!
|
||||
Returns true iff `*dh` is marked for `m`.
|
||||
\pre \link BasicMap::is_reserved `is_reserved(m)`\endlink and `*dh`\f$ \in\f$`darts()`.
|
||||
\pre \link GenericMap::is_reserved `is_reserved(m)`\endlink and `*dh`\f$ \in\f$`darts()`.
|
||||
*/
|
||||
bool is_marked(Dart_const_handle dh, size_type m) const;
|
||||
|
||||
/*!
|
||||
Marks `*dh` for `m`.
|
||||
\pre \link BasicMap::is_reserved `is_reserved(m)`\endlink and `*dh`\f$ \in\f$`darts()`.
|
||||
\pre \link GenericMap::is_reserved `is_reserved(m)`\endlink and `*dh`\f$ \in\f$`darts()`.
|
||||
*/
|
||||
void mark(Dart_const_handle dh, size_type m) const;
|
||||
|
||||
/*!
|
||||
Unmarks `*dh` for the mark `m`.
|
||||
\pre \link BasicMap::is_reserved `is_reserved(m)`\endlink and `*dh`\f$ \in\f$`darts()`.
|
||||
\pre \link GenericMap::is_reserved `is_reserved(m)`\endlink and `*dh`\f$ \in\f$`darts()`.
|
||||
*/
|
||||
void unmark(Dart_const_handle dh, size_type m) const;
|
||||
|
||||
/*!
|
||||
Inverse the mark `m` for all the darts of the basic map.
|
||||
Inverse the mark `m` for all the darts of the generic map.
|
||||
All the marked darts become unmarked and all the unmarked darts
|
||||
become marked.
|
||||
\pre \link BasicMap::is_reserved `is_reserved(m)`\endlink.
|
||||
\pre \link GenericMap::is_reserved `is_reserved(m)`\endlink.
|
||||
*/
|
||||
void negate_mark(size_type m) const;
|
||||
|
||||
/*!
|
||||
Unmarks all the darts of the basic map for `m`.
|
||||
\pre \link BasicMap::is_reserved `is_reserved(m)`\endlink.
|
||||
Unmarks all the darts of the generic map for `m`.
|
||||
\pre \link GenericMap::is_reserved `is_reserved(m)`\endlink.
|
||||
*/
|
||||
void unmark_all(size_type m) const;
|
||||
|
||||
/*!
|
||||
Returns the number of marked darts for `m`.
|
||||
\pre \link BasicMap::is_reserved `is_reserved(m)`\endlink.
|
||||
\pre \link GenericMap::is_reserved `is_reserved(m)`\endlink.
|
||||
*/
|
||||
size_type number_of_marked_darts(size_type m) const;
|
||||
|
||||
/*!
|
||||
Return the number of unmarked darts for `m`.
|
||||
\pre \link BasicMap::is_reserved `is_reserved(m)`\endlink.
|
||||
\pre \link GenericMap::is_reserved `is_reserved(m)`\endlink.
|
||||
*/
|
||||
size_type number_of_unmarked_darts(size_type m) const;
|
||||
|
||||
/*!
|
||||
Frees mark `m`.
|
||||
\pre \link BasicMap::is_reserved `is_reserved(m)`\endlink.
|
||||
\pre \link GenericMap::is_reserved `is_reserved(m)`\endlink.
|
||||
*/
|
||||
void free_mark(size_type m) const;
|
||||
|
||||
|
|
@ -828,7 +828,7 @@ void free_mark(size_type m) const;
|
|||
/// @{
|
||||
|
||||
/*!
|
||||
Creates a combinatorial hexahedron (six combinatorial quadrangles 2-sewn together), and adds it in the basic map. Returns a handle on one dart of this combinatorial hexahedron.
|
||||
Creates a combinatorial hexahedron (six combinatorial quadrangles 2-sewn together), and adds it in the generic map. Returns a handle on one dart of this combinatorial hexahedron.
|
||||
\pre `dimension` \f$\geq\f$ 2.
|
||||
|
||||
\sa `make_edge`
|
||||
|
|
@ -839,7 +839,7 @@ Creates a combinatorial hexahedron (six combinatorial quadrangles 2-sewn togethe
|
|||
Dart_handle make_combinatorial_hexahedron();
|
||||
|
||||
/*!
|
||||
Creates a combinatorial polygon of length `lg` (a cycle of `lg` darts 1-sewn together), and adds it in the basic map. Returns a handle on one dart of this combinatorial polygon.
|
||||
Creates a combinatorial polygon of length `lg` (a cycle of `lg` darts 1-sewn together), and adds it in the generic map. Returns a handle on one dart of this combinatorial polygon.
|
||||
\pre `dimension`\f$ \geq\f$ 1 and `lg`\f$ >\f$ 0.
|
||||
|
||||
\sa `make_edge`
|
||||
|
|
@ -849,7 +849,7 @@ Creates a combinatorial polygon of length `lg` (a cycle of `lg` darts 1-sewn tog
|
|||
Dart_handle make_combinatorial_polygon(unsigned int lg);
|
||||
|
||||
/*!
|
||||
Creates a combinatorial tetrahedron (four combinatorial triangles 2-sewn together), and adds it in the basic map. Returns a handle on one dart of this combinatorial tetrahedron.
|
||||
Creates a combinatorial tetrahedron (four combinatorial triangles 2-sewn together), and adds it in the generic map. Returns a handle on one dart of this combinatorial tetrahedron.
|
||||
\pre `dimension`\f$ \geq\f$ 2.
|
||||
|
||||
\sa `make_edge`
|
||||
|
|
@ -859,7 +859,7 @@ Creates a combinatorial tetrahedron (four combinatorial triangles 2-sewn togethe
|
|||
Dart_handle make_combinatorial_tetrahedron();
|
||||
|
||||
/*!
|
||||
Creates an isolated edge (two darts sewn to represent one edge and two vertices) and adds it in the basic map. Returns a handle on one dart of this edge.
|
||||
Creates an isolated edge (two darts sewn to represent one edge and two vertices) and adds it in the generic map. Returns a handle on one dart of this edge.
|
||||
\pre `dimension`\f$ \geq\f$ 2.
|
||||
|
||||
\sa `make_combinatorial_polygon`
|
||||
|
|
@ -875,14 +875,14 @@ Dart_handle make_edge();
|
|||
|
||||
/*!
|
||||
Inserts a 0-cell in the 1-cell containing `dh`. Returns `next(dh)`, a handle on one dart belonging to the new 0-cell.
|
||||
\pre \link BasicMap::dimension `dimension`\endlink \f$ \geq\f$ 1 and `*dh`\f$ \in\f$\link BasicMap::darts `darts()`\endlink.
|
||||
\pre \link GenericMap::dimension `dimension`\endlink \f$ \geq\f$ 1 and `*dh`\f$ \in\f$\link GenericMap::darts `darts()`\endlink.
|
||||
|
||||
See examples for combinatorial map in \cgalFigureRef{fig_cmap_insert_vertex} and for generalized map in \cgalFigureRef{fig_gmap_insert_vertex}.
|
||||
|
||||
If \link BasicMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, if 1-attributes are non `void`, \link CellAttribute::On_split `Attribute_type<1>::type::On_split`\endlink(<I>a</I>,<I>a'</I>) is called, with <I>a</I> the original 1-attribute associated with <I>dh</I> and <I>a'</I> the new 1-attribute created during the operation. If set, the dynamic onsplit function of 1-attributes is also called on <I>a</I> and <I>a'</I>.
|
||||
If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, if 1-attributes are non `void`, \link CellAttribute::On_split `Attribute_type<1>::type::On_split`\endlink(<I>a</I>,<I>a'</I>) is called, with <I>a</I> the original 1-attribute associated with <I>dh</I> and <I>a'</I> the new 1-attribute created during the operation. If set, the dynamic onsplit function of 1-attributes is also called on <I>a</I> and <I>a'</I>.
|
||||
|
||||
\cgalAdvancedBegin
|
||||
If \link BasicMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are not updated; thus the basic map can be no more valid after this operation.
|
||||
If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are not updated; thus the generic map can be no more valid after this operation.
|
||||
\cgalAdvancedEnd
|
||||
|
||||
\sa `insert_cell_0_in_cell_2`
|
||||
|
|
@ -895,14 +895,14 @@ Dart_handle insert_cell_0_in_cell_1(Dart_handle dh);
|
|||
|
||||
/*!
|
||||
Inserts a 0-cell in the 2-cell containing `dh`. The 2-cell is split in triangles, one for each initial edge of the facet. Returns a handle on one dart belonging to the new 0-cell.
|
||||
\pre \link BasicMap::dimension `dimension`\endlink \f$ \geq\f$ 2 and `*dh`\f$ \in\f$\link BasicMap::darts `darts()`\endlink.
|
||||
\pre \link GenericMap::dimension `dimension`\endlink \f$ \geq\f$ 2 and `*dh`\f$ \in\f$\link GenericMap::darts `darts()`\endlink.
|
||||
|
||||
See examples for combinatorial map in \cgalFigureRef{fig_cmap_triangulation} and for generalized map in \cgalFigureRef{fig_gmap_triangulation}.
|
||||
|
||||
If \link BasicMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, if 2-attributes are non `void`, \link CellAttribute::On_split `Attribute_type<2>::type::On_split`\endlink(<I>a</I>,<I>a'</I>) is called, with <I>a</I> the original 2-attribute associated with `dh` and <I>a'</I> each new 2-attribute created during the operation. If set, the dynamic onsplit function of 2-attributes is also called on <I>a</I> and <I>a'</I>.
|
||||
If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, if 2-attributes are non `void`, \link CellAttribute::On_split `Attribute_type<2>::type::On_split`\endlink(<I>a</I>,<I>a'</I>) is called, with <I>a</I> the original 2-attribute associated with `dh` and <I>a'</I> each new 2-attribute created during the operation. If set, the dynamic onsplit function of 2-attributes is also called on <I>a</I> and <I>a'</I>.
|
||||
|
||||
\cgalAdvancedBegin
|
||||
If \link BasicMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are not updated; thus the basic map can be no more valid after this operation.
|
||||
If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are not updated; thus the generic map can be no more valid after this operation.
|
||||
\cgalAdvancedEnd
|
||||
|
||||
\sa `insert_cell_0_in_cell_2`
|
||||
|
|
@ -919,10 +919,10 @@ Inserts a 1-cell in the 2-cell containing `dh1` and `dh2`. Returns `previous(dh1
|
|||
|
||||
See examples for combinatorial map in \cgalFigureRef{fig_cmap_insert_edge} and for generalized map in \cgalFigureRef{fig_gmap_insert_edge}.
|
||||
|
||||
If \link BasicMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, if 2-attributes are non `void`, \link CellAttribute::On_split `Attribute_type<2>::type::On_split`\endlink(<I>a</I>,<I>a'</I>) is called, with <I>a</I> the original 2-attribute associated with `dh` and <I>a'</I> the new 2-attribute created during the operation. If set, the dynamic onsplit function of 2-attributes is also called on <I>a</I> and <I>a'</I>.
|
||||
If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, if 2-attributes are non `void`, \link CellAttribute::On_split `Attribute_type<2>::type::On_split`\endlink(<I>a</I>,<I>a'</I>) is called, with <I>a</I> the original 2-attribute associated with `dh` and <I>a'</I> the new 2-attribute created during the operation. If set, the dynamic onsplit function of 2-attributes is also called on <I>a</I> and <I>a'</I>.
|
||||
|
||||
\cgalAdvancedBegin
|
||||
If \link BasicMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are not updated; thus the basic map can be no more valid after this operation.
|
||||
If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are not updated; thus the generic map can be no more valid after this operation.
|
||||
\cgalAdvancedEnd
|
||||
|
||||
\sa `is_insertable_cell_1_in_cell_2`
|
||||
|
|
@ -940,10 +940,10 @@ Inserts a 2-cell along the path of 1-cells containing darts given by the range `
|
|||
|
||||
See examples for combinatorial map in \cgalFigureRef{fig_cmap_insert_facet} and for generalized map in \cgalFigureRef{fig_gmap_insert_facet}.
|
||||
|
||||
If \link BasicMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, if 3-attributes are non `void`, \link CellAttribute::On_split `Attribute_type<3>::type::On_split`\endlink(<I>a</I>,<I>a'</I>) is called, with <I>a</I> the original 3-attribute associated with `dh` and <I>a'</I> the new 3-attribute created during the operation. If set, the dynamic onsplit function of 3-attributes is also called on <I>a</I> and <I>a'</I>.
|
||||
If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, if 3-attributes are non `void`, \link CellAttribute::On_split `Attribute_type<3>::type::On_split`\endlink(<I>a</I>,<I>a'</I>) is called, with <I>a</I> the original 3-attribute associated with `dh` and <I>a'</I> the new 3-attribute created during the operation. If set, the dynamic onsplit function of 3-attributes is also called on <I>a</I> and <I>a'</I>.
|
||||
|
||||
\cgalAdvancedBegin
|
||||
If \link BasicMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are not updated; thus the basic map can be no more valid after this operation.
|
||||
If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are not updated; thus the generic map can be no more valid after this operation.
|
||||
\cgalAdvancedEnd
|
||||
|
||||
\sa `is_insertable_cell_2_in_cell_3<InputIterator>`
|
||||
|
|
@ -958,12 +958,12 @@ Dart_handle insert_cell_2_in_cell_3(InputIterator afirst, InputIterator alast);
|
|||
|
||||
/*!
|
||||
Inserts a 1-cell in a the 2-cell containing `dh`, the 1-cell being attached only by one of its extremity to the 0-cell containing `dh`. Returns `previous(dh)`, a handle on the dart belonging to the new 1-cell and to the new 0-cell.
|
||||
\pre \link BasicMap::dimension `dimension`\endlink \f$ \geq\f$ 2 and `*dh`\f$ \in\f$\link BasicMap::darts `darts()`\endlink.
|
||||
\pre \link GenericMap::dimension `dimension`\endlink \f$ \geq\f$ 2 and `*dh`\f$ \in\f$\link GenericMap::darts `darts()`\endlink.
|
||||
|
||||
See examples for combinatorial map in \cgalFigureRef{fig_cmap_insert_edge} and for generalized map in \cgalFigureRef{fig_gmap_insert_edge}.
|
||||
|
||||
\cgalAdvancedBegin
|
||||
If \link BasicMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are not updated; thus the basic map can be no more valid after this operation.
|
||||
If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are not updated; thus the generic map can be no more valid after this operation.
|
||||
\cgalAdvancedEnd
|
||||
|
||||
\sa `insert_cell_0_in_cell_1`
|
||||
|
|
@ -976,10 +976,10 @@ If \link BasicMap::are_attributes_automatically_managed `are_attributes_automati
|
|||
Dart_handle insert_dangling_cell_1_in_cell_2(Dart_handle dh);
|
||||
|
||||
/*!
|
||||
Returns true iff it is possible to insert a 1-cell in the basic map between `dh1` and `dh2`.
|
||||
Returns true iff it is possible to insert a 1-cell in the generic map between `dh1` and `dh2`.
|
||||
|
||||
This is possible if `dh1`\f$ \neq\f$`dh2` and `dh1` can be reached from `dh2` by using some `previous` and `next` calls.
|
||||
\pre \link BasicMap::dimension `dimension`\endlink \f$ \geq\f$ 2, `*dh1`\f$ \in\f$\link BasicMap::darts `darts()`\endlink, and `*dh2`\f$ \in\f$\link BasicMap::darts `darts()`\endlink.
|
||||
\pre \link GenericMap::dimension `dimension`\endlink \f$ \geq\f$ 2, `*dh1`\f$ \in\f$\link GenericMap::darts `darts()`\endlink, and `*dh2`\f$ \in\f$\link GenericMap::darts `darts()`\endlink.
|
||||
|
||||
\sa `insert_cell_1_in_cell_2`
|
||||
\sa `is_insertable_cell_2_in_cell_3<InputIterator>`
|
||||
|
|
@ -988,8 +988,8 @@ This is possible if `dh1`\f$ \neq\f$`dh2` and `dh1` can be reached from `dh2` by
|
|||
bool is_insertable_cell_1_in_cell_2(Dart_const_handle dh1, Dart_const_handle dh2);
|
||||
|
||||
/*!
|
||||
Returns true iff it is possible to insert a 2-cell in the basic map along the path of darts given by the range `[afirst,alast)`. The 2-cell can be inserted iff the ordered list of darts form a closed path of edges inside a same volume.
|
||||
\pre \link BasicMap::dimension `dimension`\endlink \f$ \geq\f$ 3.
|
||||
Returns true iff it is possible to insert a 2-cell in the generic map along the path of darts given by the range `[afirst,alast)`. The 2-cell can be inserted iff the ordered list of darts form a closed path of edges inside a same volume.
|
||||
\pre \link GenericMap::dimension `dimension`\endlink \f$ \geq\f$ 3.
|
||||
|
||||
\sa `insert_cell_2_in_cell_3<InputIterator>`
|
||||
\sa `is_insertable_cell_1_in_cell_2`
|
||||
|
|
@ -1001,8 +1001,8 @@ bool is_insertable_cell_2_in_cell_3(InputIterator afirst, InputIterator alast);
|
|||
/*!
|
||||
Returns true iff the <I>i</I>-cell containing `dh` can be removed.
|
||||
|
||||
An <I>i</I>-cell can be removed if `i`==\link BasicMap::dimension `dimension`\endlink or if `i`==\link BasicMap::dimension `dimension`\endlink-1 or if `i`\f$ <\f$\link BasicMap::dimension `dimension`\endlink-1 and the <I>i</I>-cell containing `dh` is incident to at most two (<I>i+1</I>)-cells.
|
||||
\pre 0\f$ \leq\f$`i`\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink and `*dh`\f$ \in\f$\link BasicMap::darts `darts()`\endlink.
|
||||
An <I>i</I>-cell can be removed if `i`==\link GenericMap::dimension `dimension`\endlink or if `i`==\link GenericMap::dimension `dimension`\endlink-1 or if `i`\f$ <\f$\link GenericMap::dimension `dimension`\endlink-1 and the <I>i</I>-cell containing `dh` is incident to at most two (<I>i+1</I>)-cells.
|
||||
\pre 0\f$ \leq\f$`i`\f$ \leq\f$\link GenericMap::dimension `dimension`\endlink and `*dh`\f$ \in\f$\link GenericMap::darts `darts()`\endlink.
|
||||
|
||||
\sa `remove_cell<i>`
|
||||
*/
|
||||
|
|
@ -1010,17 +1010,17 @@ template <unsigned int i>
|
|||
bool is_removable(Dart_const_handle dh);
|
||||
|
||||
/*!
|
||||
Removes the <I>i</I>-cell containing `dh`. Returns the number of darts removed from the basic map.
|
||||
Removes the <I>i</I>-cell containing `dh`. Returns the number of darts removed from the generic map.
|
||||
\pre `is_removable<i>(dh)`.
|
||||
|
||||
See examples in \cgalFigureRef{fig_cmap_insert_vertex}, \cgalFigureRef{fig_cmap_insert_edge} and \cgalFigureRef{fig_cmap_insert_facet}.
|
||||
|
||||
If \link BasicMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, if `i`\f$ <\f$\link BasicMap::dimension `dimension`\endlink, and <I>i+1</I>-attributes are non `void`, and if there are two distinct (<I>i+1</I>)-cells around dart `dh`, \link CellAttribute::On_merge `Attribute_type<i+1>::type::On_merge`\endlink(<I>a1</I>,<I>a2</I>) is called, with <I>a1</I> the (<I>i+1</I>)-attribute associated to `dh`, and <I>a2</I> the (<I>i+1</I>)-attribute associated to \f$ \beta_{i+1}\f$(<I>dh</I>). If set, the dynamic onmerge function of <I>i+1</I>-attributes is also called on <I>a1</I> and <I>a2</I>.
|
||||
If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, if `i`\f$ <\f$\link GenericMap::dimension `dimension`\endlink, and <I>i+1</I>-attributes are non `void`, and if there are two distinct (<I>i+1</I>)-cells around dart `dh`, \link CellAttribute::On_merge `Attribute_type<i+1>::type::On_merge`\endlink(<I>a1</I>,<I>a2</I>) is called, with <I>a1</I> the (<I>i+1</I>)-attribute associated to `dh`, and <I>a2</I> the (<I>i+1</I>)-attribute associated to \f$ \beta_{i+1}\f$(<I>dh</I>). If set, the dynamic onmerge function of <I>i+1</I>-attributes is also called on <I>a1</I> and <I>a2</I>.
|
||||
|
||||
If \link BasicMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, if a <I>j</I>-cell is disconnected in two <I>j</I>-cells during the operation, and if <I>j</I>-attributes are non void, \link CellAttribute::On_split `Attribute_type<j>::type::On_split`\endlink(<I>a</I>,<I>a'</I>) is called with <I>a</I> the original <I>j</I>-attribute and <I>a'</I> the new <I>j</I>-attribute created due to the disconnection. If set, the dynamic onsplit function of <i>j</i>-attributes is also called on <I>a</I> and <I>a'</I>.
|
||||
If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, if a <I>j</I>-cell is disconnected in two <I>j</I>-cells during the operation, and if <I>j</I>-attributes are non void, \link CellAttribute::On_split `Attribute_type<j>::type::On_split`\endlink(<I>a</I>,<I>a'</I>) is called with <I>a</I> the original <I>j</I>-attribute and <I>a'</I> the new <I>j</I>-attribute created due to the disconnection. If set, the dynamic onsplit function of <i>j</i>-attributes is also called on <I>a</I> and <I>a'</I>.
|
||||
|
||||
\cgalAdvancedBegin
|
||||
If \link BasicMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are not updated; thus the basic map can be no more valid after this operation.
|
||||
If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==false`, non void attributes are not updated; thus the generic map can be no more valid after this operation.
|
||||
\cgalAdvancedEnd
|
||||
|
||||
\sa `is_removable<i>`
|
||||
|
|
@ -1035,6 +1035,6 @@ size_type remove_cell(Dart_handle dh);
|
|||
|
||||
/// @}
|
||||
|
||||
}; /* end BasicMap */
|
||||
}; /* end GenericMap */
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
/*!
|
||||
\ingroup PkgCombinatorialMapsConcepts
|
||||
\cgalConcept
|
||||
|
||||
The concept `GenericMapItems` allows to customize a <I>d</I>D basic map by choosing the type of darts, and by enabling and disabling some attributes. For that, it defines an inner class template named
|
||||
\link GenericMapItems::Dart_wrapper `Dart_wrapper`\endlink, with one template parameter, `Map`, a model of the `GenericMap` concept. This inner class must define two types: `%Dart` and `%Attributes`.
|
||||
|
||||
\cgalHasModel \link CGAL::Combinatorial_map_min_items `CGAL::Combinatorial_map_min_items<d>`\endlink
|
||||
\cgalHasModel \link CGAL::Generalized_map_min_items `CGAL::Generalized_map_min_items<d>`\endlink
|
||||
|
||||
\sa `GenericMap`
|
||||
\sa `Dart`
|
||||
|
||||
\cgalHeading{Example}
|
||||
|
||||
The following examples show two possible models of the `GenericMapItems` concept: the first one for a 4D combinatorial map without enabled attributes, the second one for a 3D generalized map with edge attributes enabled, and associated with a \link CGAL::Cell_attribute `Cell_attribute`\endlink containing an `int`.
|
||||
|
||||
\code{.cpp}
|
||||
struct Exemple_Item_4
|
||||
{
|
||||
template < class CMap >
|
||||
struct Dart_wrapper
|
||||
{
|
||||
typedef CGAL::Combinatorial_map_dart<4, CMap> Dart;
|
||||
typedef CGAL::cpp11::tuple<> Attributes;
|
||||
};
|
||||
};
|
||||
|
||||
struct Exemple_Item_3
|
||||
{
|
||||
template < class GMap >
|
||||
struct Dart_wrapper
|
||||
{
|
||||
typedef CGAL::Generalized_map_dart<3, GMap> Dart;
|
||||
typedef CGAL::Cell_attribute<GMap, int> Edge_attrib;
|
||||
typedef CGAL::cpp11::tuple<void,Edge_attrib> Attributes;
|
||||
};
|
||||
};
|
||||
\endcode
|
||||
*/
|
||||
class GenericMapItems {
|
||||
public:
|
||||
|
||||
/*!
|
||||
Wrapper class defining type of darts and types of attributes. The class `%Dart_wrapper<CMap>` must provide:
|
||||
|
||||
- `%Dart_wrapper<CMap>::%Dart`, the type of dart, a model of the `BasicDart` concept.
|
||||
- `%Dart_wrapper<CMap>::%Attributes` The tuple of attributes, containing at most \link GenericMap::dimension `Map::dimension+1`\endlink types (one for each possible cell of the basic map). Each type of the tuple must be either a model of the `CellAttribute` concept or `void`. The first type corresponds to 0-attributes, the second to 1-attributes and so on. If the \f$ i^{\mbox{th}}\f$ type in the tuple is `void`, (<I>i</I>-1)-attributes are disabled. Otherwise, (<I>i</I>-1)-attributes are enabled and have the given type. If the size of the tuple is <I>k</I>, with <I>k</I><\link GenericMap::dimension `Map::dimension+1`\endlink, \f$ \forall\f$<I>i</I>: <I>k</I>\f$ \leq\f$<I>i</I>\f$ \leq\f$\link GenericMap::dimension `Map::dimension`\endlink, <I>i</I>-attributes are disabled.
|
||||
|
||||
\note It can be implemented using a nested template class.
|
||||
*/
|
||||
template <typename Map>
|
||||
using Dart_wrapper = unspecified_type;
|
||||
|
||||
}; /* end #GenericMapItems */
|
||||
|
|
@ -43,8 +43,8 @@
|
|||
|
||||
## Concepts ##
|
||||
- `Dart`
|
||||
- `BasicMap`
|
||||
- `BasicMapItems`
|
||||
- `GenericMap`
|
||||
- `GenericMapItems`
|
||||
- `CellAttribute`
|
||||
- `CombinatorialMap`
|
||||
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ Considering these different advantages and drawbacks, you can choose to use gene
|
|||
|
||||
\section secsoftwaredesign_gmap Software Design
|
||||
|
||||
The diagram in \cgalFigureRef{fig_gmap_diagramme_class} shows the different classes of the package. `Generalized_map` is the main class (see Section \ref ssecgeneralizedmap "Generalized Maps"). It allows to manage darts (see Section \ref ssecdartsgmap "Darts") and attributes (see Section \ref ssecattributesgmap "Cell Attributes"). Users can customize a generalized map thanks to an items class (see Section \ref ssecitemgmap "Generalized Map Items"), which defines the dart type and the attribute types. These types may be different for different dimensions, and they may also be void \tred{(note that the main concepts are shared between combinatorial maps and generalized maps; their name are prefixed by `Basic` except for the `CellAttribute` concept)}.
|
||||
The diagram in \cgalFigureRef{fig_gmap_diagramme_class} shows the different classes of the package. `Generalized_map` is the main class (see Section \ref ssecgeneralizedmap "Generalized Maps"). It allows to manage darts (see Section \ref ssecdartsgmap "Darts") and attributes (see Section \ref ssecattributesgmap "Cell Attributes"). Users can customize a generalized map thanks to an items class (see Section \ref ssecitemgmap "Generalized Map Items"), which defines the dart type and the attribute types. These types may be different for different dimensions, and they may also be void \tred{(note that the main concepts of `GenericMap`, `GenericMapItems`, `Dart` and `CellAttribute` are shared between combinatorial maps and generalized maps)}.
|
||||
|
||||
The darts and attributes are accessed through <I>handles</I>. 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 `boost::unordered_map`.
|
||||
|
||||
|
|
@ -183,45 +183,45 @@ UML diagram of the main classes of the package. k is the number of non void attr
|
|||
|
||||
\subsection ssecgeneralizedmap Generalized Maps
|
||||
|
||||
The class `Generalized_map<d,Items,Alloc>` is a model of the `GeneralizedMap` concept \tred{which refines the generic concept of `BasicMap`}. It has three template parameters standing for the dimension of the generalized map (an `unsigned int`), an items class (a model of the `BasicMapItems` concept), and an allocator which must be a model of the allocator concept of the \stl. %Default classes are provided for the items and the allocator classes.
|
||||
The class `Generalized_map<d,Items,Alloc>` is a model of the `GeneralizedMap` concept \tred{which refines the generic concept of `GenericMap`}. It has three template parameters standing for the dimension of the generalized map (an `unsigned int`), an items class (a model of the `GenericMapItems` concept), and an allocator which must be a model of the allocator concept of the \stl. %Default classes are provided for the items and the allocator classes.
|
||||
|
||||
The main role of the class `Generalized_map` is the storage and the management of darts. It allows to create or remove an isolated dart from the generalized map. The \link BasicMap::Dart_handle `Dart_handle`\endlink type defines a handle to the type of used darts (given in the items class). `Generalized_map` provides several <I>ranges</I> which allow to iterate over specific subsets of darts of the generalized map (see Section \ref ssecrange "Iterating over Orbits, Cells, and Attributes"). It also defines several methods to link and to unlink darts by \f$ \alpha_i\f$s (see Section \ref sseclinkdarts_gmap "Sewing Orbits and Linking Darts"). We said that a dart <I>d0</I> is <I>i</I>-free if \f$ \alpha_i\f$(<I>d0</I>)=<I>d0</I>. Finally, some high level operations are defined to update the generalized map (see Section \ref ssecoperationsgmap "Removal and Insertion Operations")
|
||||
The main role of the class `Generalized_map` is the storage and the management of darts. It allows to create or remove an isolated dart from the generalized map. The \link GenericMap::Dart_handle `Dart_handle`\endlink type defines a handle to the type of used darts (given in the items class). `Generalized_map` provides several <I>ranges</I> which allow to iterate over specific subsets of darts of the generalized map (see Section \ref ssecrange "Iterating over Orbits, Cells, and Attributes"). It also defines several methods to link and to unlink darts by \f$ \alpha_i\f$s (see Section \ref sseclinkdarts_gmap "Sewing Orbits and Linking Darts"). We said that a dart <I>d0</I> is <I>i</I>-free if \f$ \alpha_i\f$(<I>d0</I>)=<I>d0</I>. Finally, some high level operations are defined to update the generalized map (see Section \ref ssecoperationsgmap "Removal and Insertion Operations")
|
||||
|
||||
The second role of the class `Generalized_map` is the storage and the management of attributes. It allows to create or remove an attribute, and provides methods to associate attributes and cells. A range is defined for each <I>i</I>-attribute allowing to iterate over all the <I>i</I>-attributes of the generalized map. Finally, `Generalized_map` defines several types allowing to manage the attributes. We can use \link BasicMap::Attribute_handle `Generalized_map::Attribute_handle<i>::type`\endlink for a handle to the <I>i</I>-attributes (and the const version \link BasicMap::Attribute_const_handle `Generalized_map::Attribute_const_handle<i>::type`\endlink) and \link BasicMap::Attribute_type `Generalized_map::Attribute_type<i>::type`\endlink for the type of the <I>i</I>-attributes.
|
||||
The second role of the class `Generalized_map` is the storage and the management of attributes. It allows to create or remove an attribute, and provides methods to associate attributes and cells. A range is defined for each <I>i</I>-attribute allowing to iterate over all the <I>i</I>-attributes of the generalized map. Finally, `Generalized_map` defines several types allowing to manage the attributes. We can use \link GenericMap::Attribute_handle `Generalized_map::Attribute_handle<i>::type`\endlink for a handle to the <I>i</I>-attributes (and the const version \link GenericMap::Attribute_const_handle `Generalized_map::Attribute_const_handle<i>::type`\endlink) and \link GenericMap::Attribute_type `Generalized_map::Attribute_type<i>::type`\endlink for the type of the <I>i</I>-attributes.
|
||||
|
||||
All information associated to darts \tred{(\f$ \alpha\f$ links and attributes)} can be accessed through member functions in `GeneralizedMap`.
|
||||
|
||||
\subsection ssecitemgmap Generalized Map Items
|
||||
|
||||
\tred{The `BasicMapItems` concept defines dart and attribute types of a generalized map. It contains one inner class named \link BasicMapItems::Dart_wrapper `Dart_wrapper`\endlink, having one template parameter, `BMap`, a model of `BasicMap` concept. The \link BasicMapItems::Dart_wrapper `Dart_wrapper<GMap>`\endlink class provides two local types: `%Dart` which must be a model of the `Dart` concept, and `%Attributes` which defines the attributes and their types.}
|
||||
\tred{The `GenericMapItems` concept defines dart and attribute types of a generalized map. It contains one inner class named \link GenericMapItems::Dart_wrapper `Dart_wrapper`\endlink, having one template parameter, `BMap`, a model of `GenericMap` concept. The \link GenericMapItems::Dart_wrapper `Dart_wrapper<GMap>`\endlink class provides two local types: `%Dart` which must be a model of the `Dart` concept, and `%Attributes` which defines the attributes and their types.}
|
||||
|
||||
The `%Attributes` tuple must contain at most <I>d</I>+1 types (one for each possible cell dimension of the generalized map). Each type of the tuple must be either a model of the `CellAttribute` concept or `void`. The first type corresponds to 0-attributes, the second to 1-attributes and so on. If the <i>i <sup>th</sup></i> type in the tuple is `void`, <I>(i-1)</I>-attributes are disabled: we say that <I>(i-1)</I>-attributes are <I>void</I>. Otherwise, <I>(i-1)</I>-attributes are enabled and have the given type: we say <I>(i-1)</I>-attributes are <I>non void</I>. If the size of the tuple is <I>k</I>, with <I>k</I>\f$ <\f$<I>dimension+1</I>, \f$ \forall\f$<I>i</I>: <I>k</I>\f$ \leq\f$<I>i</I>\f$ \leq\f$dimension, <I>i</I>-attributes are void.
|
||||
|
||||
The class `Generalized_map_min_items<d>` is a model of the `BasicMapItems` concept which can be used for default behaviors. It defines \tred{`Generalized_map_dart<d,GMap>`} as type of dart, and `Attributes` as empty tuple.
|
||||
The class `Generalized_map_min_items<d>` is a model of the `GenericMapItems` concept which can be used for default behaviors. It defines \tred{`Generalized_map_dart<d,GMap>`} as type of dart, and `Attributes` as empty tuple.
|
||||
|
||||
\subsection ssecdartsgmap Darts
|
||||
|
||||
The class \tred{`Generalized_map_dart<d,GMap>`}, a model of the `Dart` concept, defines a <I>d</I>D dart for generalized maps. It has two template parameters standing for the dimension of the generalized map, and a model of the `GeneralizedMap` concept, which provides the two types \link BasicMap::Dart_handle `Dart_handle`\endlink and \link BasicMap::Dart_const_handle `Dart_const_handle`\endlink.
|
||||
The class \tred{`Generalized_map_dart<d,GMap>`}, a model of the `Dart` concept, defines a <I>d</I>D dart for generalized maps. It has two template parameters standing for the dimension of the generalized map, and a model of the `GeneralizedMap` concept, which provides the two types \link GenericMap::Dart_handle `Dart_handle`\endlink and \link GenericMap::Dart_const_handle `Dart_const_handle`\endlink.
|
||||
|
||||
Each instance `d0` of `Generalized_map_dart<d,GMap>` stores the \f$ \alpha_i\f$ pointers in an array of <I>d</I>+1 `Dart_handle`. It also stores the attributes associated to this dart in a tuple of \link BasicMap::Attribute_handle `GMap::Attribute_handle<i>::type`\endlink, one for each non void <I>i</I>-attribute.
|
||||
Each instance `d0` of `Generalized_map_dart<d,GMap>` stores the \f$ \alpha_i\f$ pointers in an array of <I>d</I>+1 `Dart_handle`. It also stores the attributes associated to this dart in a tuple of \link GenericMap::Attribute_handle `GMap::Attribute_handle<i>::type`\endlink, one for each non void <I>i</I>-attribute.
|
||||
|
||||
Note that the use of the `Generalized_map_dart` class is not hard wired in the generalized map class. Users can provide their own model of the `Dart` concept, and pass it to the generalized map with the help of a custom item class.
|
||||
|
||||
\subsection ssecattributesgmap Cell Attributes
|
||||
|
||||
The class `Cell_attribute<Map,Info_,Tag,OnMerge,OnSplit>`, a model of the `CellAttribute` concept, represents an attribute associated with a cell of a generalized map. The template parameter `Map` must be a model of the `BasicMap` concept. The attribute stores a handle to one dart of its associated cell when the template parameter `Tag` is \link CGAL::Tag_true `Tag_true`\endlink. `Info_` is the type of information stored in the attribute. It may be `void`. `OnMerge` and `OnSplit` must be either `Null_functor`, or models of the `Binary Function` concept having two references to a model of `CellAttribute` as type of both parameters and `void` as return type. There are two default parameters for `OnMerge` and `OnSplit`, which are `Null_functor`, a default parameter for `Tag` which is `Tag_true`, and a default parameter for `Info_` which is `void`.
|
||||
The class `Cell_attribute<Map,Info_,Tag,OnMerge,OnSplit>`, a model of the `CellAttribute` concept, represents an attribute associated with a cell of a generalized map. The template parameter `Map` must be a model of the `GenericMap` concept. The attribute stores a handle to one dart of its associated cell when the template parameter `Tag` is \link CGAL::Tag_true `Tag_true`\endlink. `Info_` is the type of information stored in the attribute. It may be `void`. `OnMerge` and `OnSplit` must be either `Null_functor`, or models of the `Binary Function` concept having two references to a model of `CellAttribute` as type of both parameters and `void` as return type. There are two default parameters for `OnMerge` and `OnSplit`, which are `Null_functor`, a default parameter for `Tag` which is `Tag_true`, and a default parameter for `Info_` which is `void`.
|
||||
|
||||
If `Info_` is different from `void`, the class `Cell_attribute` contains two methods `info()` returning the information contained in the attribute (const and non const version). The information is returned by reference, thus the non const version allows the modification of the information.
|
||||
|
||||
Two attributes are merged when their corresponding cells are merged into one cell during some operation. In this case, the functor `OnMerge` is called, unless it is equal to `Null_functor`. This functor allows the user to define its own custom behavior when two attributes are merged (for example if the information is a color, we can compute the average color of the two initial attributes, and affect this value to the first attribute, see example in Section \ref ssecgenmapwithcolor "Generalized Map With Attributes"). Similarly, the functor `OnSplit` is called when one attribute is split in two, because its corresponding cell is split in two during some operation, unless it is equal to `Null_functor`. In any high level operation, `OnMerge` is called before to start the operation (i.e.\ before modifying the generalized map), and `OnSplit` is called when the operation is finished (i.e.\ after all the modifications were made).
|
||||
|
||||
In addition, there are dynamic onmerge and onsplit functions that can be associated to i-attributes, and modified, thanks to the \link BasicMap::onmerge_function() `onmerge_function()`\endlink and \link BasicMap::onsplit_function() `onsplit_function()`\endlink. When these functions are set, they are also called in addition to the previous mechanism when two attributes are merged or one attribute is split into two (see example in Section \ref ssecgenmapdynamicattibute "Use of Dynamic Onmerge and Onsplit Functors").
|
||||
In addition, there are dynamic onmerge and onsplit functions that can be associated to i-attributes, and modified, thanks to the \link GenericMap::onmerge_function() `onmerge_function()`\endlink and \link GenericMap::onsplit_function() `onsplit_function()`\endlink. When these functions are set, they are also called in addition to the previous mechanism when two attributes are merged or one attribute is split into two (see example in Section \ref ssecgenmapdynamicattibute "Use of Dynamic Onmerge and Onsplit Functors").
|
||||
|
||||
What we said for the dart also holds for the cell attribute. The generalized map can be used with any user defined model of the `CellAttribute` concept.
|
||||
|
||||
\subsection ssecexampledefgmap Example of Generalized Map Definition
|
||||
|
||||
Here comes an example of two generalized map definitions. The first case `Example_gmap4` defines a 4D generalized map which uses all the default values (`Generalized_map_min_items`). The second example `Example_custom_gmap3` uses its own model of the `BasicMapItems` concept. In this model, the type of dart is `Generalized_map_dart<3,GMap>`, thus a dart is in 3D, and an attribute containing an integer is associated to edges.
|
||||
Here comes an example of two generalized map definitions. The first case `Example_gmap4` defines a 4D generalized map which uses all the default values (`Generalized_map_min_items`). The second example `Example_custom_gmap3` uses its own model of the `GenericMapItems` concept. In this model, the type of dart is `Generalized_map_dart<3,GMap>`, thus a dart is in 3D, and an attribute containing an integer is associated to edges.
|
||||
|
||||
\code{.cpp}
|
||||
|
||||
|
|
@ -254,48 +254,48 @@ Instead of the `begin()/end()` member function pair as we know it from \stl cont
|
|||
There are three different categories of dart range classes:
|
||||
<UL>
|
||||
|
||||
<LI>\link BasicMap::Dart_range `Dart_range`\endlink: range of all the darts of a generalized map;
|
||||
<LI>\link GenericMap::Dart_range `Dart_range`\endlink: range of all the darts of a generalized map;
|
||||
|
||||
<LI>\link BasicMap::Dart_of_orbit_range `Dart_of_orbit_range<Alpha...>`\endlink: range of all the darts of the orbit \f$ \langle{}\f$`Alpha...`\f$ \rangle{}\f$(<I>d0</I>) for a given <I>d0</I>. `Alpha...` is a sequence of integers \f$ i_1\f$,..., \f$ i_k\f$, each \f$ i_j\f$\f$ \in\f${0, ..., <I>d</I>}. These integers must satisfy: \f$ i_1\f$\f$ <\f$\f$ i_2\f$\f$ <\f$...\f$ <\f$\f$ i_k\f$, and (\f$ i_1\f$\f$ \neq\f$ 0 or \f$ i_2\f$\f$ \neq\f$1) (for example \link BasicMap::Dart_of_orbit_range `Dart_of_orbit_range<1,2>`\endlink for the orbit \f$ \langle{}\f$\f$ \alpha_1\f$,\f$ \alpha_2\f$\f$ \rangle{}\f$(<I>d0</I>));
|
||||
<LI>\link GenericMap::Dart_of_orbit_range `Dart_of_orbit_range<Alpha...>`\endlink: range of all the darts of the orbit \f$ \langle{}\f$`Alpha...`\f$ \rangle{}\f$(<I>d0</I>) for a given <I>d0</I>. `Alpha...` is a sequence of integers \f$ i_1\f$,..., \f$ i_k\f$, each \f$ i_j\f$\f$ \in\f${0, ..., <I>d</I>}. These integers must satisfy: \f$ i_1\f$\f$ <\f$\f$ i_2\f$\f$ <\f$...\f$ <\f$\f$ i_k\f$, and (\f$ i_1\f$\f$ \neq\f$ 0 or \f$ i_2\f$\f$ \neq\f$1) (for example \link GenericMap::Dart_of_orbit_range `Dart_of_orbit_range<1,2>`\endlink for the orbit \f$ \langle{}\f$\f$ \alpha_1\f$,\f$ \alpha_2\f$\f$ \rangle{}\f$(<I>d0</I>));
|
||||
|
||||
<LI>\link BasicMap::Dart_of_cell_range `Dart_of_cell_range<i,dim>`\endlink: range of all the darts of the <I>i</I>-cell containing a given dart. The <I>i</I>-cell is considered in dimension `dim` (with 0\f$ \leq\f$<I>dim</I>\f$ \leq\f$<I>d</I>, <I>dim</I>=<I>d</I> by default), with 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dim+1</I>. If <I>i</I>=<I>dim+1</I>, \link BasicMap::Dart_of_cell_range `Dart_of_cell_range<i,dim>`\endlink is the range of all the darts of the connected component containing a given dart.
|
||||
<LI>\link GenericMap::Dart_of_cell_range `Dart_of_cell_range<i,dim>`\endlink: range of all the darts of the <I>i</I>-cell containing a given dart. The <I>i</I>-cell is considered in dimension `dim` (with 0\f$ \leq\f$<I>dim</I>\f$ \leq\f$<I>d</I>, <I>dim</I>=<I>d</I> by default), with 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dim+1</I>. If <I>i</I>=<I>dim+1</I>, \link GenericMap::Dart_of_cell_range `Dart_of_cell_range<i,dim>`\endlink is the range of all the darts of the connected component containing a given dart.
|
||||
</UL>
|
||||
|
||||
There are also two different classes of ranges containing one dart per <I>i</I>-cell. Note that in these classes, the dart of each <I>i</I>-cell can be any dart of the cell. Moreover, each <I>i</I>-cell (and <I>j</I>-cell in the second case) is considered in dimension `dim` (with 0\f$ \leq\f$<I>dim</I>\f$ \leq\f$<I>d</I>, <I>dim=d</I> by default).
|
||||
<UL>
|
||||
<LI>\link BasicMap::One_dart_per_cell_range `One_dart_per_cell_range<i,dim>`\endlink: range containing one dart of each <I>i</I>-cell of the generalized map, 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dim+1</I> (for example \link BasicMap::One_dart_per_cell_range `One_dart_per_cell_range<2>`\endlink for the range of one dart per 2-cell of the generalized map);
|
||||
<LI>\link GenericMap::One_dart_per_cell_range `One_dart_per_cell_range<i,dim>`\endlink: range containing one dart of each <I>i</I>-cell of the generalized map, 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dim+1</I> (for example \link GenericMap::One_dart_per_cell_range `One_dart_per_cell_range<2>`\endlink for the range of one dart per 2-cell of the generalized map);
|
||||
|
||||
<LI>\link BasicMap::One_dart_per_incident_cell_range `One_dart_per_incident_cell_range<i,j,dim>`\endlink: range containing one dart of each <I>i</I>-cell incident to the <I>j</I>-cell containing a given dart, with 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dim+1</I> and 0\f$ \leq\f$<I>j</I>\f$ \leq\f$<I>dim+1</I> (for example \link BasicMap::One_dart_per_incident_cell_range `One_dart_per_incident_cell_range<0,3>`\endlink for the range of one dart per vertex of the volume incident to the starting dart). If <I>i</I>=<I>j</I>, the range contains only the given dart.
|
||||
<LI>\link GenericMap::One_dart_per_incident_cell_range `One_dart_per_incident_cell_range<i,j,dim>`\endlink: range containing one dart of each <I>i</I>-cell incident to the <I>j</I>-cell containing a given dart, with 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dim+1</I> and 0\f$ \leq\f$<I>j</I>\f$ \leq\f$<I>dim+1</I> (for example \link GenericMap::One_dart_per_incident_cell_range `One_dart_per_incident_cell_range<0,3>`\endlink for the range of one dart per vertex of the volume incident to the starting dart). If <I>i</I>=<I>j</I>, the range contains only the given dart.
|
||||
</UL>
|
||||
|
||||
The iterators of the \link BasicMap::Dart_range `Dart_range`\endlink are bidirectional iterators, while the iterators of the other four ranges are forward iterators. The value type of all these iterators is `Dart` thus all these iterators can be directly used as \link BasicMap::Dart_handle `Dart_handle`\endlink.
|
||||
The iterators of the \link GenericMap::Dart_range `Dart_range`\endlink are bidirectional iterators, while the iterators of the other four ranges are forward iterators. The value type of all these iterators is `Dart` thus all these iterators can be directly used as \link GenericMap::Dart_handle `Dart_handle`\endlink.
|
||||
|
||||
Additionally, there is a range over non void <I>i</I>-attributes: \link BasicMap::Attribute_range `Attribute_range<i>::type`\endlink, having a bidirectional iterator with value type \link BasicMap::Attribute_type Attribute_type<i>::type`\endlink.
|
||||
Additionally, there is a range over non void <I>i</I>-attributes: \link GenericMap::Attribute_range `Attribute_range<i>::type`\endlink, having a bidirectional iterator with value type \link GenericMap::Attribute_type Attribute_type<i>::type`\endlink.
|
||||
|
||||
For each range, there is an associated const range, a model of the `ConstRange` concept. You can find some examples of ranges in Section \ref ssecexample3DGM "A 3D Generalized Map".
|
||||
|
||||
\subsection ssecconstructiongmap Construction Operations
|
||||
|
||||
Several functions allow to create specific configurations of darts into a generalized map. Existing darts in the generalized map are not modified. Note that the dimension of the generalized map must be large enough: darts must contain all the \f$ \alpha\f$ pointers used by the operation. All these functions return a \link BasicMap::Dart_handle `Dart_handle`\endlink to a new dart created during the operation.
|
||||
Several functions allow to create specific configurations of darts into a generalized map. Existing darts in the generalized map are not modified. Note that the dimension of the generalized map must be large enough: darts must contain all the \f$ \alpha\f$ pointers used by the operation. All these functions return a \link GenericMap::Dart_handle `Dart_handle`\endlink to a new dart created during the operation.
|
||||
|
||||
<UL>
|
||||
<LI>`gm.`\link BasicMap::make_edge `make_edge()`\endlink: creates an isolated edge (two darts linked by \f$ \alpha_0\f$); dimension must be greater or equal than zero;
|
||||
<LI>`gm.`\link BasicMap::make_combinatorial_polygon `make_combinatorial_polygon(lg)`\endlink: creates an isolated combinatorial polygon of length `lg` (`lg` edges linked by \f$ \alpha_1\f$), for `lg>0`; dimension must be greater or equal than one;
|
||||
<LI>`gm.`\link BasicMap::make_combinatorial_tetrahedron `make_combinatorial_tetrahedron()`\endlink: creates an isolated combinatorial tetrahedron (four combinatorial triangles linked together by \f$ \alpha_2\f$); dimension must be greater or equal than two;
|
||||
<LI>`gm.`\link BasicMap::make_combinatorial_hexahedron `make_combinatorial_hexahedron()`\endlink: creates an isolated combinatorial hexahedron (six combinatorial quadrangles linked together by \f$ \alpha_2\f$); dimension must be greater or equal than two.
|
||||
<LI>`gm.`\link GenericMap::make_edge `make_edge()`\endlink: creates an isolated edge (two darts linked by \f$ \alpha_0\f$); dimension must be greater or equal than zero;
|
||||
<LI>`gm.`\link GenericMap::make_combinatorial_polygon `make_combinatorial_polygon(lg)`\endlink: creates an isolated combinatorial polygon of length `lg` (`lg` edges linked by \f$ \alpha_1\f$), for `lg>0`; dimension must be greater or equal than one;
|
||||
<LI>`gm.`\link GenericMap::make_combinatorial_tetrahedron `make_combinatorial_tetrahedron()`\endlink: creates an isolated combinatorial tetrahedron (four combinatorial triangles linked together by \f$ \alpha_2\f$); dimension must be greater or equal than two;
|
||||
<LI>`gm.`\link GenericMap::make_combinatorial_hexahedron `make_combinatorial_hexahedron()`\endlink: creates an isolated combinatorial hexahedron (six combinatorial quadrangles linked together by \f$ \alpha_2\f$); dimension must be greater or equal than two.
|
||||
</UL>
|
||||
|
||||
\subsection ssecadvmarksgmap Boolean Marks
|
||||
|
||||
It is often necessary to mark darts, for example to retrieve in <I>O(1)</I> if a given dart was already processed during a specific algorithm, for example, iteration over a given range. Users can also mark specific parts of a generalized map (for example mark all the darts belonging to objects having specific semantics). To answer these needs, a `GeneralizedMap` has a certain number of Boolean marks (fixed by the constant \link BasicMap::NB_MARKS `NB_MARKS`\endlink). When one wants to use a Boolean mark, the following methods are available (with `gm` an instance of a generalized map):
|
||||
It is often necessary to mark darts, for example to retrieve in <I>O(1)</I> if a given dart was already processed during a specific algorithm, for example, iteration over a given range. Users can also mark specific parts of a generalized map (for example mark all the darts belonging to objects having specific semantics). To answer these needs, a `GeneralizedMap` has a certain number of Boolean marks (fixed by the constant \link GenericMap::NB_MARKS `NB_MARKS`\endlink). When one wants to use a Boolean mark, the following methods are available (with `gm` an instance of a generalized map):
|
||||
<ul>
|
||||
<li> get a new free mark: `size_type m = gm.`\link BasicMap::get_new_mark `get_new_mark()`\endlink (throws the exception Exception_no_more_available_mark if no mark is available);
|
||||
<li> set mark `m` for a given dart `d0`: `gm.`\link BasicMap::mark `mark(dh0,m)`\endlink;
|
||||
<li> unset mark `m` for a given dart `d0`: `gm.`\link BasicMap::unmark `unmark(dh0,m)`\endlink;
|
||||
<li> test if a given dart `d0` is marked for `m`: `gm.`\link BasicMap::is_marked `is_marked(dh0,m)`\endlink;
|
||||
<li> unmark all the darts of `gm` for `m`: `gm.`\link BasicMap::unmark_all `unmark_all(m)`\endlink;
|
||||
<li> negate mark `m` of all the darts of `gm`: `gm.`\link BasicMap::negate_mark `negate_mark(m)`\endlink. All the marked darts become unmarked and all the unmarked darts become marked;
|
||||
<li> free mark `m`: `gm.`\link BasicMap::free_mark `free_mark(m)`\endlink. This method unmarks all the darts of `gm` for `m` before freeing it.
|
||||
<li> get a new free mark: `size_type m = gm.`\link GenericMap::get_new_mark `get_new_mark()`\endlink (throws the exception Exception_no_more_available_mark if no mark is available);
|
||||
<li> set mark `m` for a given dart `d0`: `gm.`\link GenericMap::mark `mark(dh0,m)`\endlink;
|
||||
<li> unset mark `m` for a given dart `d0`: `gm.`\link GenericMap::unmark `unmark(dh0,m)`\endlink;
|
||||
<li> test if a given dart `d0` is marked for `m`: `gm.`\link GenericMap::is_marked `is_marked(dh0,m)`\endlink;
|
||||
<li> unmark all the darts of `gm` for `m`: `gm.`\link GenericMap::unmark_all `unmark_all(m)`\endlink;
|
||||
<li> negate mark `m` of all the darts of `gm`: `gm.`\link GenericMap::negate_mark `negate_mark(m)`\endlink. All the marked darts become unmarked and all the unmarked darts become marked;
|
||||
<li> free mark `m`: `gm.`\link GenericMap::free_mark `free_mark(m)`\endlink. This method unmarks all the darts of `gm` for `m` before freeing it.
|
||||
</ul>
|
||||
|
||||
It is important to free a mark when it is no longer needed, otherwise you may at some point run out of marks.
|
||||
|
|
@ -308,7 +308,7 @@ The following example illustrates how to use marks. Two combinatorial tetrahedra
|
|||
|
||||
Several operations allow to modify a given generalized map. There are two main categories of modification operations:
|
||||
<UL>
|
||||
<LI>\ref BasicMap::sew "Sew", \ref GeneralizedMap::link_alpha "link_alpha", \ref BasicMap::unsew "unsew" and \ref GeneralizedMap::unlink_alpha "unlink_alpha" which modify some existing \f$ \alpha\f$ pointers, without creating or removing darts (see Section \ref sseclinkdarts_gmap "Sewing Orbits and Linking Darts");
|
||||
<LI>\ref GenericMap::sew "Sew", \ref GeneralizedMap::link_alpha "link_alpha", \ref GenericMap::unsew "unsew" and \ref GeneralizedMap::unlink_alpha "unlink_alpha" which modify some existing \f$ \alpha\f$ pointers, without creating or removing darts (see Section \ref sseclinkdarts_gmap "Sewing Orbits and Linking Darts");
|
||||
<LI>Removal and insertion of cells which modify both darts and \f$ \alpha\f$ pointers (see Section \ref ssecoperationsgmap "Removal and Insertion Operations").
|
||||
</UL>
|
||||
|
||||
|
|
@ -316,7 +316,7 @@ Several operations allow to modify a given generalized map. There are two main c
|
|||
|
||||
The `GeneralizedMap` defines two groups of methods to modify the \f$ \alpha\f$ pointers of existing darts.
|
||||
|
||||
The sew and unsew methods iterate over two orbits in order to link or unlink specific darts two by two. Intuitively, a \link BasicMap::sew `sew<i>`\endlink operation glues two <I>i</I>-cells by identifying two of their <I>(i-1)</I>-cells (see example in \cgalFigureRef{fig_gmap_example_3d_sew} where \link BasicMap::sew `sew<3>`\endlink is used to glue two 3-cells along one 2-cell). Reciprocally, a \link BasicMap::unsew `unsew<i>`\endlink operation un-glues two <I>i</I>-cells which were glued along one of their <I>(i-1)</I>-cells. These methods guarantee that given a valid generalized map and a possible operation we obtain a valid generalized map as result of the operation.
|
||||
The sew and unsew methods iterate over two orbits in order to link or unlink specific darts two by two. Intuitively, a \link GenericMap::sew `sew<i>`\endlink operation glues two <I>i</I>-cells by identifying two of their <I>(i-1)</I>-cells (see example in \cgalFigureRef{fig_gmap_example_3d_sew} where \link GenericMap::sew `sew<3>`\endlink is used to glue two 3-cells along one 2-cell). Reciprocally, a \link GenericMap::unsew `unsew<i>`\endlink operation un-glues two <I>i</I>-cells which were glued along one of their <I>(i-1)</I>-cells. These methods guarantee that given a valid generalized map and a possible operation we obtain a valid generalized map as result of the operation.
|
||||
|
||||
\cgalAdvancedBegin
|
||||
The \link GeneralizedMap::link_alpha `link_alpha`\endlink and \link GeneralizedMap::unlink_alpha `unlink_alpha`\endlink methods only modify the pointer of two darts: the obtained generalized maps may be not valid. These operations can be useful to use low level operations in a specific algorithm, for example to modify locally a generalized map in a really fast way. In such a case, additional operations may be needed to restore the validity conditions.
|
||||
|
|
@ -328,38 +328,38 @@ Linking two darts <I>d1</I> and <I>d2</I> by \f$ \alpha_i\f$, with 0\f$ \leq\f$<
|
|||
Reciprocally, unlinking a given dart <I>d0</I> by \f$ \alpha_i\f$, with 0\f$ \leq\f$ <I>i</I>\f$ \leq\f$<I>d</I>, consists in modifying two \f$ \alpha_i\f$ pointers such that \f$ \alpha_i\f$(\f$ \alpha_i\f$(<I>d0</I>))=\f$ \alpha_i\f$(<I>d0</I>) and \f$ \alpha_i\f$(<I>d0</I>)=<I>d0</I>. Note that is it possible to unlink a given dart for \f$ \alpha_i\f$ only if it is not <I>i</I>-free.
|
||||
|
||||
\cgalFigureBegin{fig_gmap_example_3d_sew,gmap_example_3d_sew.svg}
|
||||
Example of 3-sew operation. Left: A 3D generalized map containing two volumes that are not connected, with 2-attributes. Each attribute contains a color in RGB format, and there are four 2-cells associated with attributes. Associations between darts and attributes are drawn with red segments. Right: The 3D generalized map obtained as result of \tred{\link BasicMap::sew `sew<3>(1,a)`\endlink (or \link BasicMap::sew `sew<3>(2,b)`\endlink ... or \link BasicMap::sew `sew<3>(8,h)`\endlink). Darts (1,a), ..., (8,h)} are linked together by \f$ \alpha_3\f$. The two 2-cells \tred{<I>c1</I>={1,...,8} and <I>c2</I>={a,...,h}} are merged after the sew into the 2-cell \tred{{1,...,8,a,...,h}}. We are in the case where the two attributes are non NULL, thus the first one is kept, and all the darts of <I>c2</I> are associated with the first attribute.
|
||||
Example of 3-sew operation. Left: A 3D generalized map containing two volumes that are not connected, with 2-attributes. Each attribute contains a color in RGB format, and there are four 2-cells associated with attributes. Associations between darts and attributes are drawn with red segments. Right: The 3D generalized map obtained as result of \tred{\link GenericMap::sew `sew<3>(1,a)`\endlink (or \link GenericMap::sew `sew<3>(2,b)`\endlink ... or \link GenericMap::sew `sew<3>(8,h)`\endlink). Darts (1,a), ..., (8,h)} are linked together by \f$ \alpha_3\f$. The two 2-cells \tred{<I>c1</I>={1,...,8} and <I>c2</I>={a,...,h}} are merged after the sew into the 2-cell \tred{{1,...,8,a,...,h}}. We are in the case where the two attributes are non NULL, thus the first one is kept, and all the darts of <I>c2</I> are associated with the first attribute.
|
||||
\cgalFigureEnd
|
||||
|
||||
The \link BasicMap::sew `sew<i>(dh1,dh2)`\endlink method consists mainly to link two by two several darts by \f$ \alpha_i\f$. This operation is possible only if there is a bijection <I>f</I> between all the darts of the orbit <I>D1</I>=\f$ \langle{}\f$\f$ \alpha_1\f$,...,\f$ \alpha_{i-2}\f$,\f$ \alpha_{i+2}\f$,...,\f$ \alpha_d\f$\f$ \rangle{}\f$(<I>d1</I>) and <I>D2</I>=\f$ \langle{}\f$\f$ \alpha_1\f$,...,\f$ \alpha_{i-2}\f$,\f$ \alpha_{i+2}\f$,..., \f$ \alpha_d\f$\f$ \rangle{}\f$(<I>d2</I>) satisfying: <I>f</I>(<I>d1</I>)=<I>d2</I>, and for all <I>e</I>\f$ \in\f$<I>D1</I>, for all <I>j</I>\f$ \in\f${1,..., i-2,i+2,...,<I>d</I>}, <I>f</I>(\f$ \alpha_j\f$(<I>e</I>))=\f$ \alpha_j^{-1}\f$(<I>f</I>(<I>e</I>)). Intuitively, this condition ensures the validity of the generalized map by verifying that condition discussed in Section \ref ssecgenmapvalidity "Generalized Map Properties" will be satisfied after the operation. This condition can be tested by using the method \link BasicMap::is_sewable `is_sewable<i>(dh1,dh2)`\endlink. For example, the function \link BasicMap::is_sewable `is_sewable<3>`\endlink would return `false` if we tried to 3-sew a triangular facet with a quad facet. Note that given two darts <I>d1</I> and <I>d2</I>, if there is such a bijection, it is uniquely defined. So giving the two darts as arguments of the \link BasicMap::sew `sew<i>`\endlink is enough to retrieve all the pairs of darts to link. If such a bijection exists, the \link BasicMap::sew `sew<i>(dh1,dh2)`\endlink operation consists only in linking by \f$ \alpha_i\f$ each couple of darts <I>d3</I> and <I>d4</I> such that <I>d3</I>=<I>f</I>(<I>d4</I>).
|
||||
The \link GenericMap::sew `sew<i>(dh1,dh2)`\endlink method consists mainly to link two by two several darts by \f$ \alpha_i\f$. This operation is possible only if there is a bijection <I>f</I> between all the darts of the orbit <I>D1</I>=\f$ \langle{}\f$\f$ \alpha_1\f$,...,\f$ \alpha_{i-2}\f$,\f$ \alpha_{i+2}\f$,...,\f$ \alpha_d\f$\f$ \rangle{}\f$(<I>d1</I>) and <I>D2</I>=\f$ \langle{}\f$\f$ \alpha_1\f$,...,\f$ \alpha_{i-2}\f$,\f$ \alpha_{i+2}\f$,..., \f$ \alpha_d\f$\f$ \rangle{}\f$(<I>d2</I>) satisfying: <I>f</I>(<I>d1</I>)=<I>d2</I>, and for all <I>e</I>\f$ \in\f$<I>D1</I>, for all <I>j</I>\f$ \in\f${1,..., i-2,i+2,...,<I>d</I>}, <I>f</I>(\f$ \alpha_j\f$(<I>e</I>))=\f$ \alpha_j^{-1}\f$(<I>f</I>(<I>e</I>)). Intuitively, this condition ensures the validity of the generalized map by verifying that condition discussed in Section \ref ssecgenmapvalidity "Generalized Map Properties" will be satisfied after the operation. This condition can be tested by using the method \link GenericMap::is_sewable `is_sewable<i>(dh1,dh2)`\endlink. For example, the function \link GenericMap::is_sewable `is_sewable<3>`\endlink would return `false` if we tried to 3-sew a triangular facet with a quad facet. Note that given two darts <I>d1</I> and <I>d2</I>, if there is such a bijection, it is uniquely defined. So giving the two darts as arguments of the \link GenericMap::sew `sew<i>`\endlink is enough to retrieve all the pairs of darts to link. If such a bijection exists, the \link GenericMap::sew `sew<i>(dh1,dh2)`\endlink operation consists only in linking by \f$ \alpha_i\f$ each couple of darts <I>d3</I> and <I>d4</I> such that <I>d3</I>=<I>f</I>(<I>d4</I>).
|
||||
|
||||
In addition, the sew operation updates the associations between darts and non void attributes in order to guarantee that all the darts belonging to a given cell are associated with the same attribute (which is a condition of generalized map validity). For each couple of <I>j</I>-cells <I>c1</I> and <I>c2</I> that are merged into one <I>j</I>-cell during the sew, we have to update the two associated attributes <I>attr1</I> and <I>attr2</I>. If both are NULL, there is nothing to do. If one is NULL and the other not, we only associate the non NULL attribute to all the darts of the resulting cell. When the two attributes are non NULL, we first apply functor \link CellAttribute::On_merge `On_merge`\endlink on the two attributes <I>attr1</I> and <I>attr2</I> (see Section \ref ssecattributesgmap "Cell Attributes"). Then, we associate the attribute <I>attr1</I> to all darts of the resulting <I>j</I>-cell. Finally, attribute <I>attr2</I> is removed from the generalized map.
|
||||
|
||||
Note that when the two attributes are non NULL, the first one is kept. But user can customize this behavior in order to update the information contained in the attributes according to its needs. For that, we can define a specific functor, and use it as template argument for \link CellAttribute::On_merge `On_merge`\endlink parameter of the `Cell_attribute` definition. This functor can for example copy the information of the second attribute in the information of the first one to make as if the second attribute is kept.
|
||||
|
||||
For example, in \cgalFigureRef{fig_gmap_example_3d_sew}, we want to 3-sew the two initial volumes. \link BasicMap::sew `sew<3>(1,a)`\endlink links by \f$ \alpha_3\f$ the pairs of darts \tred{(1,a), ..., (8,g),} thus the generalized map obtained is valid. 2-attributes are updated so that all the darts belonging to the 2-cell containing dart 1 become associated to the same 2-attribute after the operation.
|
||||
For example, in \cgalFigureRef{fig_gmap_example_3d_sew}, we want to 3-sew the two initial volumes. \link GenericMap::sew `sew<3>(1,a)`\endlink links by \f$ \alpha_3\f$ the pairs of darts \tred{(1,a), ..., (8,g),} thus the generalized map obtained is valid. 2-attributes are updated so that all the darts belonging to the 2-cell containing dart 1 become associated to the same 2-attribute after the operation.
|
||||
|
||||
Similarly, \link BasicMap::unsew `unsew<i>(dh0)`\endlink operation unlinks \f$ \alpha_i\f$ for all the darts in the orbit \f$ \langle{}\f$\f$ \alpha_1\f$,..., \f$ \alpha_{i-2}\f$,\f$ \alpha_{i+2}\f$,...,\f$ \alpha_d\f$\f$ \rangle{}\f$(<I>d0</I>), and thus guarantees to obtain a valid generalized map. This operation is possible for any non <I>i</I>-free dart.
|
||||
Similarly, \link GenericMap::unsew `unsew<i>(dh0)`\endlink operation unlinks \f$ \alpha_i\f$ for all the darts in the orbit \f$ \langle{}\f$\f$ \alpha_1\f$,..., \f$ \alpha_{i-2}\f$,\f$ \alpha_{i+2}\f$,...,\f$ \alpha_d\f$\f$ \rangle{}\f$(<I>d0</I>), and thus guarantees to obtain a valid generalized map. This operation is possible for any non <I>i</I>-free dart.
|
||||
|
||||
As for the sew operations, attributes are updated to guarantee that two darts belonging to two different <I>j</I>-cells are associated to two different <I>j</I>-attributes. If the unsew operation splits a <I>j</I>-cell <I>c</I> in two <I>j</I>-cells <I>c1</I> and <I>c2</I>, and if <I>c</I> is associated to a <I>j</I>-attribute <I>attr1</I>, then this attribute is duplicated into <I>attr2</I>, and all the darts belonging to <I>c2</I> are associated with this new attribute. Finally, we call the functor \link CellAttribute::On_split `On_split`\endlink on the two attributes <I>attr1</I> and <I>attr2</I> (see Section \ref ssecattributesgmap "Cell Attributes").
|
||||
|
||||
Let us consider the generalized map given in \cgalFigureRef{fig_gmap_example_3d_sew} (Right). If we call \link BasicMap::unsew `unsew<3>(1)`\endlink, we obtain the generalized map in \cgalFigureRef{fig_gmap_example_3d_sew} (Left) (except for the color of the attribute associated to the 2-cell \tred{{a,...,g}} which would be <TT>#00ff00</TT>). The \link BasicMap::unsew `unsew<3>`\endlink operation has duplicated the 2-attribute associated to the initial 2-cell \tred{{1,...,8,a,...,g}} since this 2-cell is split in two after the unsew operation.
|
||||
Let us consider the generalized map given in \cgalFigureRef{fig_gmap_example_3d_sew} (Right). If we call \link GenericMap::unsew `unsew<3>(1)`\endlink, we obtain the generalized map in \cgalFigureRef{fig_gmap_example_3d_sew} (Left) (except for the color of the attribute associated to the 2-cell \tred{{a,...,g}} which would be <TT>#00ff00</TT>). The \link GenericMap::unsew `unsew<3>`\endlink operation has duplicated the 2-attribute associated to the initial 2-cell \tred{{1,...,8,a,...,g}} since this 2-cell is split in two after the unsew operation.
|
||||
|
||||
\cgalAdvancedBegin
|
||||
If one wants to modify a generalized map <I>manually</I>, it is possible to switch off the updating between darts and attributes by calling \link BasicMap::set_automatic_attributes_management `set_automatic_attributes_management(false)`\endlink before to call \link BasicMap::sew `sew<i>(dh1,dh2)`\endlink and \link BasicMap::unsew `unsew<i>(dh0)`\endlink. In these cases, the generalized map obtained may be no longer valid due to incorrect associations between darts and attributes. A call later to \link BasicMap::set_automatic_attributes_management `set_automatic_attributes_management(true)`\endlink will correct the invalid non void attributes.
|
||||
If one wants to modify a generalized map <I>manually</I>, it is possible to switch off the updating between darts and attributes by calling \link GenericMap::set_automatic_attributes_management `set_automatic_attributes_management(false)`\endlink before to call \link GenericMap::sew `sew<i>(dh1,dh2)`\endlink and \link GenericMap::unsew `unsew<i>(dh0)`\endlink. In these cases, the generalized map obtained may be no longer valid due to incorrect associations between darts and attributes. A call later to \link GenericMap::set_automatic_attributes_management `set_automatic_attributes_management(true)`\endlink will correct the invalid non void attributes.
|
||||
|
||||
In \cgalFigureRef{fig_gmap_example_3d_sew} (Left), if we call \link BasicMap::sew `sew<3>(1,5)`\endlink, the resulting generalized map is similar to the generalized map of \cgalFigureRef{fig_gmap_example_3d_sew} (Right) (we have linked by \f$ \alpha_3\f$ the pairs of darts \tred{(1,a), ..., (8,g)}, but associations between darts 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 \tred{a}) are associated with two different attributes.
|
||||
In \cgalFigureRef{fig_gmap_example_3d_sew} (Left), if we call \link GenericMap::sew `sew<3>(1,5)`\endlink, the resulting generalized map is similar to the generalized map of \cgalFigureRef{fig_gmap_example_3d_sew} (Right) (we have linked by \f$ \alpha_3\f$ the pairs of darts \tred{(1,a), ..., (8,g)}, but associations between darts 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 \tred{a}) are associated with two different attributes.
|
||||
|
||||
We can also use the \link GeneralizedMap::link_alpha `link_alpha<i>(dh1,dh2)`\endlink which links `d1` and `d2` by \f$ \alpha_i\f$ without modifying the other links. Association between darts and attributes are only modified for darts `d1` and `d2`, and similarly as for \link BasicMap::sew `sew<i>`\endlink, this updating can be avoided by calling \link BasicMap::set_automatic_attributes_management `set_automatic_attributes_management(false)`\endlink before to call \link GeneralizedMap::link_alpha `link_alpha<i>(dh1,dh2)`\endlink. Lastly, we can use \link GeneralizedMap::unlink_alpha `unlink_alpha<i>(dh0)`\endlink to unlink `d0` for \f$ \alpha_i\f$. In this last case, there is no modification of association between darts and attributes.
|
||||
We can also use the \link GeneralizedMap::link_alpha `link_alpha<i>(dh1,dh2)`\endlink which links `d1` and `d2` by \f$ \alpha_i\f$ without modifying the other links. Association between darts and attributes are only modified for darts `d1` and `d2`, and similarly as for \link GenericMap::sew `sew<i>`\endlink, this updating can be avoided by calling \link GenericMap::set_automatic_attributes_management `set_automatic_attributes_management(false)`\endlink before to call \link GeneralizedMap::link_alpha `link_alpha<i>(dh1,dh2)`\endlink. Lastly, we can use \link GeneralizedMap::unlink_alpha `unlink_alpha<i>(dh0)`\endlink to unlink `d0` for \f$ \alpha_i\f$. In this last case, there is no modification of association between darts and attributes.
|
||||
|
||||
In \cgalFigureRef{fig_gmap_example_3d_sew} (Left), if we call \link GeneralizedMap::link_alpha `link_alpha<3>(1,a)`\endlink, in the resulting generalized map we have now \f$ \alpha_3\f$(1)=a and \f$ \alpha_3\f$(a)=1. This generalized map is no longer valid (for example dart 2 is 3-free and we should have \f$ \alpha_3\f$(2)=b).
|
||||
\cgalAdvancedEnd
|
||||
|
||||
\cgalModifBegin
|
||||
Sewing operations can be used in order to build a non-orientable generalized map. Let us consider the 2D generalized map representing a square given in \cgalFigureRef{fig_gmap_sew_non_orientable} (Left). Two opposite edges of the square can be identified by using the \link BasicMap::sew `sew<2>`\endlink operation. But there are two possibilities to make this identification. The first one, shown in \cgalFigureRef{fig_gmap_sew_non_orientable} (Middle), creates an annulus which is thus orientable. The second one, shown in \cgalFigureRef{fig_gmap_sew_non_orientable} (Right), creates a Möbius strip which is thus non-orientable. The choice of the two darts for the sew operation is thus crucial.
|
||||
Sewing operations can be used in order to build a non-orientable generalized map. Let us consider the 2D generalized map representing a square given in \cgalFigureRef{fig_gmap_sew_non_orientable} (Left). Two opposite edges of the square can be identified by using the \link GenericMap::sew `sew<2>`\endlink operation. But there are two possibilities to make this identification. The first one, shown in \cgalFigureRef{fig_gmap_sew_non_orientable} (Middle), creates an annulus which is thus orientable. The second one, shown in \cgalFigureRef{fig_gmap_sew_non_orientable} (Right), creates a Möbius strip which is thus non-orientable. The choice of the two darts for the sew operation is thus crucial.
|
||||
|
||||
\cgalFigureBegin{fig_gmap_sew_non_orientable,gmap_sew_non_orientable.svg}
|
||||
Illustration of the use of the 2-sew operation to construct a non-orientable generalized map. Left: A 2D generalized map <I>M</I> representing a square (one side colored in orange, the other side in green). Middle: the generalized map obtained from <I>M</I> after \link BasicMap::sew `sew<2>(1,3)`\endlink. This map is orientable and corresponds to an annulus. Right: the generalized map obtained from <I>M</I> after \link BasicMap::sew `sew<2>(1,4)`\endlink. This map is non-orientable and corresponds to a Möbius strip.
|
||||
Illustration of the use of the 2-sew operation to construct a non-orientable generalized map. Left: A 2D generalized map <I>M</I> representing a square (one side colored in orange, the other side in green). Middle: the generalized map obtained from <I>M</I> after \link GenericMap::sew `sew<2>(1,3)`\endlink. This map is orientable and corresponds to an annulus. Right: the generalized map obtained from <I>M</I> after \link GenericMap::sew `sew<2>(1,4)`\endlink. This map is non-orientable and corresponds to a Möbius strip.
|
||||
\cgalFigureEnd
|
||||
|
||||
\cgalModifEnd
|
||||
|
|
@ -368,35 +368,35 @@ Illustration of the use of the 2-sew operation to construct a non-orientable gen
|
|||
|
||||
The following high level operations are defined. All these methods ensure that given a valid generalized map and a possible operation, the modified generalized map is also valid.
|
||||
|
||||
The first one is `gm`.\link BasicMap::remove_cell `remove_cell<i>(dh0)`\endlink which modifies the generalized map to remove the <I>i</I>-cell containing dart `d0`, with 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>d</I>. This operation is possible if <I>i</I>=<I>d</I> or if the given <I>i</I>-cell is incident to at most two <I>(i+1)</I>-cells which can be tested thanks to `gm.`\link BasicMap::is_removable `is_removable<i>(dh0)`\endlink. If the removed <I>i</I>-cell was incident to two different <I>(i+1)</I>-cells, these two cells are merged into one <I>(i+1)</I>-cell. In this case, the \link CellAttribute::On_merge `On_merge`\endlink functor is called if two <I>(i+1)</I>-attributes are associated to the two <I>(i+1)</I>-cells. If the <I>i</I>-cell is associated with a non void attribute, it is removed from the generalized map (see three examples on \cgalFigureRef{fig_gmap_insert_vertex}, \cgalFigureRef{fig_gmap_insert_edge} and \cgalFigureRef{fig_gmap_insert_facet}).
|
||||
The first one is `gm`.\link GenericMap::remove_cell `remove_cell<i>(dh0)`\endlink which modifies the generalized map to remove the <I>i</I>-cell containing dart `d0`, with 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>d</I>. This operation is possible if <I>i</I>=<I>d</I> or if the given <I>i</I>-cell is incident to at most two <I>(i+1)</I>-cells which can be tested thanks to `gm.`\link GenericMap::is_removable `is_removable<i>(dh0)`\endlink. If the removed <I>i</I>-cell was incident to two different <I>(i+1)</I>-cells, these two cells are merged into one <I>(i+1)</I>-cell. In this case, the \link CellAttribute::On_merge `On_merge`\endlink functor is called if two <I>(i+1)</I>-attributes are associated to the two <I>(i+1)</I>-cells. If the <I>i</I>-cell is associated with a non void attribute, it is removed from the generalized map (see three examples on \cgalFigureRef{fig_gmap_insert_vertex}, \cgalFigureRef{fig_gmap_insert_edge} and \cgalFigureRef{fig_gmap_insert_facet}).
|
||||
|
||||
|
||||
\cgalFigureBegin{fig_gmap_insert_vertex,gmap_insert_vertex.svg}
|
||||
Example of \link BasicMap::insert_cell_0_in_cell_1 `insert_cell_0_in_cell_1`\endlink and \link BasicMap::remove_cell `remove_cell<0>`\endlink operations. Left: Initial generalized map. Right: After the insertion of a 0-cell in the 1-cell containing dart `d1`. Now if we remove the 0-cell containing dart `d2`, we obtain the initial generalized map.
|
||||
Example of \link GenericMap::insert_cell_0_in_cell_1 `insert_cell_0_in_cell_1`\endlink and \link GenericMap::remove_cell `remove_cell<0>`\endlink operations. Left: Initial generalized map. Right: After the insertion of a 0-cell in the 1-cell containing dart `d1`. Now if we remove the 0-cell containing dart `d2`, we obtain the initial generalized map.
|
||||
\cgalFigureEnd
|
||||
|
||||
The inverse operation of the removal is the insertion operation. Several versions exist, sharing a common principle. They consist in adding a new <I>i</I>-cell <em>inside</em> an existing <I>j</I>-cell, <I>i</I>\f$ <\f$<I>j</I>, by splitting the <I>j</I>-cell into several <I>j</I>-cells. Contrary to `remove_cell<i>`, is it not possible to define a unique `insert_cell_i_in_cell_j<i,j>` function because parameters are different depending on `i` and `j`.
|
||||
|
||||
`gm.`\link BasicMap::insert_cell_0_in_cell_1 `insert_cell_0_in_cell_1(dh0)`\endlink adds a 0-cell in the 1-cell containing dart `d0`. The 1-cell is split in two. This operation is possible if `d0`\f$ \in\f$\link BasicMap::darts `gm.darts()`\endlink (see example on \cgalFigureRef{fig_gmap_insert_vertex}).
|
||||
`gm.`\link GenericMap::insert_cell_0_in_cell_1 `insert_cell_0_in_cell_1(dh0)`\endlink adds a 0-cell in the 1-cell containing dart `d0`. The 1-cell is split in two. This operation is possible if `d0`\f$ \in\f$\link GenericMap::darts `gm.darts()`\endlink (see example on \cgalFigureRef{fig_gmap_insert_vertex}).
|
||||
|
||||
`gm.`\link BasicMap::insert_cell_0_in_cell_2 `insert_cell_0_in_cell_2(dh0)`\endlink adds a 0-cell in the 2-cell containing dart `d0`. The 2-cell is split in triangles, one for each initial edge of the facet. This operation is possible if `d0`\f$ \in\f$\link BasicMap::darts `gm.darts()`\endlink (see example on \cgalFigureRef{fig_gmap_triangulation}).
|
||||
`gm.`\link GenericMap::insert_cell_0_in_cell_2 `insert_cell_0_in_cell_2(dh0)`\endlink adds a 0-cell in the 2-cell containing dart `d0`. The 2-cell is split in triangles, one for each initial edge of the facet. This operation is possible if `d0`\f$ \in\f$\link GenericMap::darts `gm.darts()`\endlink (see example on \cgalFigureRef{fig_gmap_triangulation}).
|
||||
|
||||
\cgalFigureBegin{fig_gmap_triangulation,gmap_triangulation.svg}
|
||||
Example of \link BasicMap::insert_cell_0_in_cell_2 `insert_cell_0_in_cell_2`\endlink operation.
|
||||
Example of \link GenericMap::insert_cell_0_in_cell_2 `insert_cell_0_in_cell_2`\endlink operation.
|
||||
\cgalFigureEnd
|
||||
|
||||
`gm.`\link BasicMap::insert_cell_1_in_cell_2 `insert_cell_1_in_cell_2(dh1,dh2)`\endlink adds a 1-cell in the 2-cell containing darts `d1` and `d2`, between the two 0-cells containing darts `d1` and `d2`. The 2-cell is split in two. This operation is possible \tred{if <I>d1</I>\f$ \in\f$\f$ \langle{}\f$\f$ \alpha_0, \alpha_1\f$\f$ \rangle{}\f$(<I>d2</I>)} which can be tested thanks to `gm.`\link BasicMap::is_insertable_cell_1_in_cell_2 `is_insertable_cell_1_in_cell_2(dh1,dh2)`\endlink. In the example on \cgalFigureRef{fig_gmap_insert_edge}, it is possible to insert an edge between darts <I>d2</I> and <I>d3</I>, but it is not possible to insert an edge between <I>d1</I> and <I>d3</I>.
|
||||
`gm.`\link GenericMap::insert_cell_1_in_cell_2 `insert_cell_1_in_cell_2(dh1,dh2)`\endlink adds a 1-cell in the 2-cell containing darts `d1` and `d2`, between the two 0-cells containing darts `d1` and `d2`. The 2-cell is split in two. This operation is possible \tred{if <I>d1</I>\f$ \in\f$\f$ \langle{}\f$\f$ \alpha_0, \alpha_1\f$\f$ \rangle{}\f$(<I>d2</I>)} which can be tested thanks to `gm.`\link GenericMap::is_insertable_cell_1_in_cell_2 `is_insertable_cell_1_in_cell_2(dh1,dh2)`\endlink. In the example on \cgalFigureRef{fig_gmap_insert_edge}, it is possible to insert an edge between darts <I>d2</I> and <I>d3</I>, but it is not possible to insert an edge between <I>d1</I> and <I>d3</I>.
|
||||
|
||||
\cgalFigureBegin{fig_gmap_insert_edge,gmap_insert_edge.svg}
|
||||
Example of \link BasicMap::insert_cell_1_in_cell_2 `insert_cell_1_in_cell_2`\endlink and \link BasicMap::remove_cell `remove_cell<1>`\endlink operations. Left: Initial generalized map. Right: After the insertion of two 1-cells: a first one between the two 0-cells containing darts `d2` and `d3`, and a second one incident to the 0-cell containing dart `d1`. Now if we remove the two 1-cells containing darts `d4` and `d5`, we obtain the initial generalized map.
|
||||
Example of \link GenericMap::insert_cell_1_in_cell_2 `insert_cell_1_in_cell_2`\endlink and \link GenericMap::remove_cell `remove_cell<1>`\endlink operations. Left: Initial generalized map. Right: After the insertion of two 1-cells: a first one between the two 0-cells containing darts `d2` and `d3`, and a second one incident to the 0-cell containing dart `d1`. Now if we remove the two 1-cells containing darts `d4` and `d5`, we obtain the initial generalized map.
|
||||
\cgalFigureEnd
|
||||
|
||||
`gm.`\link BasicMap::insert_dangling_cell_1_in_cell_2 `insert_dangling_cell_1_in_cell_2(dh0)`\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 BasicMap::darts `gm.darts()`\endlink.
|
||||
`gm.`\link GenericMap::insert_dangling_cell_1_in_cell_2 `insert_dangling_cell_1_in_cell_2(dh0)`\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 `gm.darts()`\endlink.
|
||||
|
||||
`gm.`\link BasicMap::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 `gm.`\link BasicMap::is_insertable_cell_2_in_cell_3 `is_insertable_cell_2_in_cell_3(itbegin,itend)`\endlink (see example on \cgalFigureRef{fig_gmap_insert_facet}).
|
||||
`gm.`\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 `gm.`\link GenericMap::is_insertable_cell_2_in_cell_3 `is_insertable_cell_2_in_cell_3(itbegin,itend)`\endlink (see example on \cgalFigureRef{fig_gmap_insert_facet}).
|
||||
|
||||
\cgalFigureBegin{fig_gmap_insert_facet,gmap_insert_facet.svg}
|
||||
Example of \link BasicMap::insert_cell_2_in_cell_3 `insert_cell_2_in_cell_3`\endlink and \link BasicMap::remove_cell `remove_cell<2>`\endlink operations. Left: Initial generalized map. Right: After the insertion of a 2-cell along the path of 1-cells containing respectively `d1,d2,d3,d4`. Now if we remove the 2-cell containing dart `d5`, we obtain the initial generalized map.
|
||||
Example of \link GenericMap::insert_cell_2_in_cell_3 `insert_cell_2_in_cell_3`\endlink and \link GenericMap::remove_cell `remove_cell<2>`\endlink operations. Left: Initial generalized map. Right: After the insertion of a 2-cell along the path of 1-cells containing respectively `d1,d2,d3,d4`. Now if we remove the 2-cell containing dart `d5`, we obtain the initial generalized map.
|
||||
\cgalFigureEnd
|
||||
|
||||
\cgalModifBegin
|
||||
|
|
@ -406,14 +406,14 @@ As the sew operation, insertion operations could create non-orientable generaliz
|
|||
Some examples of use of these operations are given in Section \ref ssecexempleoperationsgmap "High Level Operations".
|
||||
|
||||
\cgalAdvancedBegin
|
||||
If \link BasicMap::set_automatic_attributes_management `set_automatic_attributes_management(false)`\endlink is called, all the future insertion or removal operations will not update non void attributes. These attributes will be updated later by the call to \link BasicMap::set_automatic_attributes_management `set_automatic_attributes_management(true)`\endlink. This can be useful to speed up an algorithm which uses several successive insertion and removal operations. See example \ref ssecAttributesManagement "Automatic attributes management".
|
||||
If \link GenericMap::set_automatic_attributes_management `set_automatic_attributes_management(false)`\endlink is called, all the future insertion or removal operations will not update non void attributes. These attributes will be updated later by the call to \link GenericMap::set_automatic_attributes_management `set_automatic_attributes_management(true)`\endlink. This can be useful to speed up an algorithm which uses several successive insertion and removal operations. See example \ref ssecAttributesManagement "Automatic attributes management".
|
||||
\cgalAdvancedEnd
|
||||
|
||||
\section Generalized_mapExamples Examples
|
||||
|
||||
\subsection ssecexample3DGM A 3D Generalized Map
|
||||
|
||||
In this example, a 3-dimensional generalized map is constructed. Two combinatorial tetrahedra are created, then the numbers of cells of the generalized map are displayed, and the validity of the generalized map is checked. Then, we illustrate the use of ranges to iterate over specific darts. The first loop enumerates all the darts of the first tetrahedron by using the range \link BasicMap::Dart_of_orbit_range `Dart_of_orbit_range<0,1,2>`\endlink, and the second loop enumerates all the darts of the facet containing dart `dh2` by using the range \link BasicMap::Dart_of_orbit_range `Dart_of_orbit_range<0,1>`\endlink.
|
||||
In this example, a 3-dimensional generalized map is constructed. Two combinatorial tetrahedra are created, then the numbers of cells of the generalized map are displayed, and the validity of the generalized map is checked. Then, we illustrate the use of ranges to iterate over specific darts. The first loop enumerates all the darts of the first tetrahedron by using the range \link GenericMap::Dart_of_orbit_range `Dart_of_orbit_range<0,1,2>`\endlink, and the second loop enumerates all the darts of the facet containing dart `dh2` by using the range \link GenericMap::Dart_of_orbit_range `Dart_of_orbit_range<0,1>`\endlink.
|
||||
|
||||
\cgalExample{Generalized_map/gmap_3_simple_example.cpp}
|
||||
|
||||
|
|
@ -426,7 +426,7 @@ Number of darts of the face incident to d1: 6
|
|||
|
||||
which gives the number of darts of the generalized map, the numbers of different cells, the number of connected components, and finally a Boolean showing the validity of the generalized map (a tetrahedron is made up of 24 darts because there are 6 darts per facet and there are 4 facets).
|
||||
|
||||
Note the creation in the for loops of the two instances of \link BasicMap::Dart_of_orbit_range `Dart_of_orbit_range`\endlink::`const_iterator`: `it` is the current iterator, and `itend` an iterator to the end of the range. Having `itend` avoids calling \link BasicMap::darts_of_orbit `gm.darts_of_orbit<0,1,2>(dh1)`\endlink`.end()` again and again as in the following example (which is a bad solution):
|
||||
Note the creation in the for loops of the two instances of \link GenericMap::Dart_of_orbit_range `Dart_of_orbit_range`\endlink::`const_iterator`: `it` is the current iterator, and `itend` an iterator to the end of the range. Having `itend` avoids calling \link GenericMap::darts_of_orbit `gm.darts_of_orbit<0,1,2>(dh1)`\endlink`.end()` again and again as in the following example (which is a bad solution):
|
||||
|
||||
\code{.cpp}
|
||||
|
||||
|
|
@ -465,9 +465,9 @@ Example of high level operations. Left: Initial 3D generalized map after the cre
|
|||
|
||||
In this example, a 4-dimensional generalized map is used. Two tetrahedral cells are created and sewn by \f$ \alpha_4\f$. Then the numbers of cells of the generalized map are displayed, and its validity is checked.
|
||||
|
||||
By looking at these numbers of cells, we can see that the 4D generalized map contains only one 3-cell. Indeed, the \link BasicMap::sew `sew<4>`\endlink operation has identified by pairs all the darts of the two 3-cells by definition of the sew operation (see Section \ref sseclinkdarts_gmap "Sewing Orbits and Linking Darts") which, in 4D, links by \f$ \alpha_3\f$ all the darts in \f$ \langle{}\f$\f$ \alpha_1\f$,\f$ \alpha_2\f$\f$ \rangle{}\f$(<I>d1</I>) and in \f$ \langle{}\f$\f$ \alpha_1\f$,\f$ \alpha_2\f$\f$ \rangle{}\f$(<I>d2</I>). The situation is similar (but in higher dimension) to the configuration where we have two triangles in a 3D generalized map, and you use \link BasicMap::sew `sew<3>`\endlink between these two triangles. The two triangles are identified since all their darts are linked by \f$ \alpha_3\f$, thus we obtain a 3D generalized map containing only one 3-cell. Note that this 3-cell is unbounded since the darts of the two triangles are all 2-free. In the 4D case, the 4-cell is unbounded since all its darts are 3-free.
|
||||
By looking at these numbers of cells, we can see that the 4D generalized map contains only one 3-cell. Indeed, the \link GenericMap::sew `sew<4>`\endlink operation has identified by pairs all the darts of the two 3-cells by definition of the sew operation (see Section \ref sseclinkdarts_gmap "Sewing Orbits and Linking Darts") which, in 4D, links by \f$ \alpha_3\f$ all the darts in \f$ \langle{}\f$\f$ \alpha_1\f$,\f$ \alpha_2\f$\f$ \rangle{}\f$(<I>d1</I>) and in \f$ \langle{}\f$\f$ \alpha_1\f$,\f$ \alpha_2\f$\f$ \rangle{}\f$(<I>d2</I>). The situation is similar (but in higher dimension) to the configuration where we have two triangles in a 3D generalized map, and you use \link GenericMap::sew `sew<3>`\endlink between these two triangles. The two triangles are identified since all their darts are linked by \f$ \alpha_3\f$, thus we obtain a 3D generalized map containing only one 3-cell. Note that this 3-cell is unbounded since the darts of the two triangles are all 2-free. In the 4D case, the 4-cell is unbounded since all its darts are 3-free.
|
||||
|
||||
In this example, we also illustrate how to use the basic methods to build <em>by hand</em> some specific configuration in a generalized map. In fact, these functions are already present in the package: function `make_triangle(gm)` is equivalent to \link BasicMap::make_combinatorial_polygon() `gm.make_combinatorial_polygon(3)`\endlink and `make_tetrahedron(gm)` is equivalent to \link BasicMap::make_combinatorial_tetrahedron `gm.make_combinatorial_tetrahedron()`\endlink. If we want to create a 4D simplex, we must create five 3D simplexes, and sew them correctly two by two by \f$ \alpha_3\f$ (and so on if you want to create higher dimensional generalized map).
|
||||
In this example, we also illustrate how to use the basic methods to build <em>by hand</em> some specific configuration in a generalized map. In fact, these functions are already present in the package: function `make_triangle(gm)` is equivalent to \link GenericMap::make_combinatorial_polygon() `gm.make_combinatorial_polygon(3)`\endlink and `make_tetrahedron(gm)` is equivalent to \link GenericMap::make_combinatorial_tetrahedron `gm.make_combinatorial_tetrahedron()`\endlink. If we want to create a 4D simplex, we must create five 3D simplexes, and sew them correctly two by two by \f$ \alpha_3\f$ (and so on if you want to create higher dimensional generalized map).
|
||||
|
||||
\cgalExample{Generalized_map/gmap_4_simple_example.cpp}
|
||||
|
||||
|
|
@ -491,9 +491,9 @@ TODO 2; 7; 7; 7; 7; 7; 2; 13; 13; 13; 13; 13; 5; 10;
|
|||
TODO #Darts=64, #0-cells=13, #1-cells=24, #2-cells=14, #3-cells=2, #ccs=1, valid=1
|
||||
\endverbatim
|
||||
|
||||
Before the `gm.`\link BasicMap::sew `sew<3>`\endlink, each 2-cell of the first cube is associated with an attribute having 7 as value, and each 2-cell of the second cube with an attribute having 13 as value. During the `gm.`\link BasicMap::sew `sew<3>`\endlink, two 2-cells are merged, thus the functor `Sum_functor` is called on the two associated 2-attributes, and the value of the new 2-cell is the sum of the two previous one: 20.
|
||||
Before the `gm.`\link GenericMap::sew `sew<3>`\endlink, each 2-cell of the first cube is associated with an attribute having 7 as value, and each 2-cell of the second cube with an attribute having 13 as value. During the `gm.`\link GenericMap::sew `sew<3>`\endlink, two 2-cells are merged, thus the functor `Sum_functor` is called on the two associated 2-attributes, and the value of the new 2-cell is the sum of the two previous one: 20.
|
||||
|
||||
Then we call \link BasicMap::insert_cell_0_in_cell_2 `insert_cell_0_in_cell_2`\endlink on a dart which belong to this 2-cell. This method splits the existing 2-cell in <I>k</I> 2-cells, <I>k</I> being the number of 1-cells of the initial 2-cell (4 in this example). These splits are made consecutively, thus for the first split, we create a new attribute as copy of the initial one and call functor `Divide_by_two_functor` on these two attributes: the value of each attribute is thus 20/2=10. For the second split, the value of each attribute is thus 10/2=5, and for the last split the value of each attribute is thus 5/2=2 (remember that information contained in 2-attributes in an `int`). At the end, we obtain five 2-attributes with 7 as value, five 2-attributes with 13 as value, and four 2-attributes having respectively 2, 2, 5 and 10 as values.
|
||||
Then we call \link GenericMap::insert_cell_0_in_cell_2 `insert_cell_0_in_cell_2`\endlink on a dart which belong to this 2-cell. This method splits the existing 2-cell in <I>k</I> 2-cells, <I>k</I> being the number of 1-cells of the initial 2-cell (4 in this example). These splits are made consecutively, thus for the first split, we create a new attribute as copy of the initial one and call functor `Divide_by_two_functor` on these two attributes: the value of each attribute is thus 20/2=10. For the second split, the value of each attribute is thus 10/2=5, and for the last split the value of each attribute is thus 5/2=2 (remember that information contained in 2-attributes in an `int`). At the end, we obtain five 2-attributes with 7 as value, five 2-attributes with 13 as value, and four 2-attributes having respectively 2, 2, 5 and 10 as values.
|
||||
|
||||
\subsection ssecgenmapdynamicattibute Use of Dynamic Onmerge and Onsplit Functors
|
||||
|
||||
|
|
@ -501,7 +501,7 @@ In the following example, we show an example of use of dynamic onmerge and onspl
|
|||
|
||||
Step 2 defines the onsplit and onmerge dynamic functors. We can see here that with this mechanism, functors can store data member. This is the case in the example for `Split_functor` which stores a reference to the generalized map.
|
||||
|
||||
The next operations will call these functors when 2-cells are split or merged. The \link BasicMap::sew `sew<3>`\endlink operation calls 1 onmerge as two faces are identified; the \link BasicMap::insert_cell_0_in_cell_2 `insert_cell_0_in_cell_2`\endlink operation calls 3 onsplit as one face is split in 4.
|
||||
The next operations will call these functors when 2-cells are split or merged. The \link GenericMap::sew `sew<3>`\endlink operation calls 1 onmerge as two faces are identified; the \link GenericMap::insert_cell_0_in_cell_2 `insert_cell_0_in_cell_2`\endlink operation calls 3 onsplit as one face is split in 4.
|
||||
|
||||
Lastly we remove the dynamic onmerge functor (step 7). This is done by initializing the fonctor to a default boost::function. After this initialization, no dynamic merge functor is called when two faces are merged.
|
||||
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@
|
|||
|
||||
## Concepts ##
|
||||
- `Dart`
|
||||
- `BasicMap`
|
||||
- `BasicMapItems`
|
||||
- `GenericMap`
|
||||
- `GenericMapItems`
|
||||
- `CellAttribute`
|
||||
- `GeneralizedMap`
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue