Links in CMap concept; almost finished...

This commit is contained in:
Guillaume Damiand 2012-10-19 14:09:01 +00:00
parent d22b3862de
commit 40be2c8ff6
2 changed files with 185 additions and 134 deletions

View File

@ -6,6 +6,7 @@ namespace CGAL {
\anchor ChapterCombinatorialMap
\author Guillaume Damiand
\autotoc
# Introduction # {#Combinatorial_mapIntroduction}
@ -15,10 +16,10 @@ obtained by taking <I>d</I>D cells, and allowing to glue <I>d</I>D
cells along <I>(d-1)</I>D cells. It provides a description of all the
cells of the subdivision (for example vertices and edges), together
with incidence and adjacency relationships. This package is a
generalization of the halfedge data structure to higher
dimension. Indeed, a 2D combinatorial map is equivalent to a halfedge
data structure: there is a one-to-one mapping between elements of both
data structures, halfedges corresponding to darts.
generalization of the \ref chapterHalfedgeDS "halfedge data structure"
to higher dimension. Indeed, a 2D combinatorial map is equivalent to a
halfedge data structure: there is a one-to-one mapping between elements
of both data structures, halfedges corresponding to darts.
We denote <I>i</I>-cell for an <I>i</I>-dimensional cell (for example
in 3D, 0-cells are <I>vertices</I>, 1-cells are <I>edges</I>, 2-cells

View File

@ -61,8 +61,8 @@ static size_type NB_MARKS;
/*!
The null dart handle constant.
A dart `d0` is <I>i</I>-free if `d0.beta(i)==null_dart_handle`.
Note that `*null_dart_handle`\f$ \notin\f$`cm.darts()`.
A dart `d` is <I>i</I>-free if `beta(d, i)==null_dart_handle`.
Note that `*null_dart_handle`\f$ \notin\f$`darts()`.
*/
static Dart_handle null_dart_handle;
@ -73,7 +73,7 @@ static Dart_handle null_dart_handle;
/*!
The tuple of cell attributes.
It contains at most <I>dimension+1</I> types
It contains at most \ref CombinatorialMap::dimension "dimension"`+1` types
(one for each possible cell 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
@ -81,9 +81,9 @@ the tuple must be either a model of the `CellAttribute` concept or
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$<I>dimension+1</I>, \f$ \forall\f$<I>i</I>: <I>k</I>\f$
\leq\f$<I>i</I>\f$ \leq\f$<I>dimension</I>, <I>i</I>-attributes are
disabled.
<\f$\ref CombinatorialMap::dimension "dimension"`+1`, \f$ \forall\f$<I>i</I>: <I>k</I>\f$
\leq\f$<I>i</I>\f$ \leq\f$\ref CombinatorialMap::dimension "dimension",
<I>i</I>-attributes are disabled.
*/
typedef Hidden_type Attributes;
@ -95,7 +95,8 @@ struct Attribute_type
Type of <I>i</I>-attributes, a model of `CellAttribute` concept.
`Attribute_type<i>::type::Dart_handle` is equal to `Dart_handle`, and
`Attribute_type<i>::type::Dart_const_handle` is equal to `Dart_const_handle`.
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dimension</I> and <I>i</I>-attributes are non void.
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\ref CombinatorialMap::dimension "dimension"
and <I>i</I>-attributes are non void.
*/
template<unsigned int i>
typedef Attribute_type<i>::type;
@ -104,7 +105,8 @@ template<unsigned int i>
struct Attribute_handle {
/*!
Handle to <I>i</I>-attributes, equal to `Dart::Attribute_handle<i>::type`.
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dimension</I> and <I>i</I>-attributes are non void.
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\ref CombinatorialMap::dimension "dimension"
and <I>i</I>-attributes are non void.
*/
typedef Hidden_type type;
};
@ -113,7 +115,8 @@ template<unsigned int i>
struct Attribute_const_handle {
/*!
Const handle to <I>i</I>-attributes, equal to `Dart::Attribute_const_handle<i>::type`.
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dimension</I> and <I>i</I>-attributes are non void.
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\ref CombinatorialMap::dimension "dimension"
and <I>i</I>-attributes are non void.
*/
typedef Hidden_type type;
};
@ -125,13 +128,15 @@ struct Attribute_const_handle {
/*!
Range of all the darts of the combinatorial map.
This type is a model of `Range` concept, its iterator type is bidirectional and its value type is `Dart`.
This type is a model of `Range` concept, its iterator type is bidirectional and its value type is
\ref CombinatorialMap::Dart "Dart".
*/
typedef Hidden_type Dart_range;
/*!
Const range of all the darts of the combinatorial map.
This type is a model of `ConstRange` concept, its iterator type is bidirectional and its value type is `Dart`.
This type is a model of `ConstRange` concept, its iterator type is bidirectional and its value type is
\ref CombinatorialMap::Dart "Dart".
*/
typedef Hidden_type Dart_const_range;
@ -140,8 +145,11 @@ template<unsigned int i>
struct Attribute_range {
/*!
Range of all the <I>i</I>-attributes.
The <I>i</I>-attributes must be non void, and 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dimension</I>.
This type is a model of `Range` concept, its iterator type is bidirectional and its value type is `Attribute_type<i>::type`.
The <I>i</I>-attributes must be non void, and
0\f$ \leq\f$<I>i</I>\f$ \leq\f$\ref CombinatorialMap::dimension "dimension".
This type is a model of `Range` concept, its iterator type is bidirectional and its value type is
`Attribute_type<i>::type`.
\todo add links when typedef are ok
*/
typedef Hidden_type type;
};
@ -151,22 +159,27 @@ template<unsigned int i>
struct Attribute_const_range {
/*!
Const range of all the <I>i</I>-attributes.
The <I>i</I>-attributes must be non void, and 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dimension</I>.
This type is a model of `ConstRange` concept, its iterator type is bidirectional and its value type is `Attribute_type<i>::type`.
The <I>i</I>-attributes must be non void, and
0\f$ \leq\f$<I>i</I>\f$ \leq\f$\ref CombinatorialMap::dimension "dimension".
This type is a model of `ConstRange` concept, its iterator type is bidirectional and its value type is
`Attribute_type<i>::type`.
\todo add links when typedef are ok
*/
typedef Hidden_type type;
};
/*!
Range of all the darts of the `<Beta...>` orbit.
This type is a model of `Range` concept, its iterator type is forward and its value type is `Dart`.
This type is a model of `Range` concept, its iterator type is forward and its value type is
\ref CombinatorialMap::Dart "Dart".
*/
template<unsigned int... Beta>
using Dart_of_orbit_range = Hidden_type;
/*!
Const range of all the darts of the `<Beta...>` orbit.
This type is a model of `ConstRange` concept, its iterator type is forward and its value type is `Dart`.
This type is a model of `ConstRange` concept, its iterator type is forward and its value type is
\ref CombinatorialMap::Dart "Dart".
*/
template<unsigned int ... Beta>
using Dart_of_orbit_const_range = Hidden_type;
@ -174,9 +187,10 @@ using Dart_of_orbit_const_range = Hidden_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$<I>dimension</I>. If <I>i==dim+1</I>,
0\f$ \leq\f$<I>dim</I>\f$ \leq\f$\ref CombinatorialMap::dimension "dimension". 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 `Dart`.
This type is a model of `Range` concept, its iterator type is forward and its value type is
\ref CombinatorialMap::Dart "Dart".
*/
template<unsigned int i,unsigned int dim=dimension>
using Dart_of_cell_range = Hidden_type;
@ -184,9 +198,10 @@ using Dart_of_cell_range = Hidden_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$<I>dimension</I>. If <I>i==dim+1</I>,
0\f$ \leq\f$<I>dim</I>\f$ \leq\f$\ref CombinatorialMap::dimension "dimension". 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 `Dart`.
This type is a model of `ConstRange` concept, its iterator type is forward and its value type is
\ref CombinatorialMap::Dart "Dart".
*/
template<unsigned int i,unsigned int dim=dimension>
using Dart_of_cell_const_range = Hidden_type;
@ -195,10 +210,11 @@ using Dart_of_cell_const_range = Hidden_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$<I>dimension</I>. If <I>i</I>==<I>dim+1</I>,
0\f$ \leq\f$<I>dim</I>\f$ \leq\f$\ref CombinatorialMap::dimension "dimension". 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 `Dart`.
This type is a model of `Range` concept, its iterator type is forward and its value type is
\ref CombinatorialMap::Dart "Dart".
*/
template<unsigned int i,unsigned int j,unsigned int dim=dimension>
using One_dart_per_incident_cell_range = Hidden_type;
@ -207,10 +223,11 @@ using One_dart_per_incident_cell_range = Hidden_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$<I>dimension</I>. If <I>i==dim+1</I>,
0\f$ \leq\f$<I>dim</I>\f$ \leq\f$\ref CombinatorialMap::dimension "dimension". 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 `Dart`.
This type is a model of `ConstRange` concept, its iterator type is forward and its value type is
\ref CombinatorialMap::Dart "Dart".
*/
template<unsigned int i,unsigned int j,unsigned int dim=dimension>
using One_dart_per_incident_cell_const_range = Hidden_type;
@ -218,9 +235,11 @@ using One_dart_per_incident_cell_const_range = Hidden_type;
/*!
Range of one dart of each <I>i</I>-cell of the combinatorial 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$<I>dimension</I>.
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$\ref CombinatorialMap::dimension "dimension".
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 `Dart`.
This type is a model of `Range` concept, its iterator type is forward and its value type is
\ref CombinatorialMap::Dart "Dart".
*/
template<unsigned int i,unsigned int dim=dimension>
using One_dart_per_cell_range = Hidden_type;
@ -228,9 +247,11 @@ using One_dart_per_cell_range = Hidden_type;
/*!
Const range of one dart of each <I>i</I>-cell of the combinatorial 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$<I>dimension</I>.
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$\ref CombinatorialMap::dimension "dimension".
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 `Dart`.
This type is a model of `ConstRange` concept, its iterator type is forward and its value type is
\ref CombinatorialMap::Dart "Dart".
*/
template<unsigned int i,unsigned int dim=dimension>
using One_dart_per_cell_const_range = Hidden_type;
@ -250,15 +271,20 @@ Returns true iff the combinatorial map is valid.
A combinatorial map is valid (see Sections \ref
sseccombimapanddarts and \ref sseccombimapvalidity) if for all its darts `d`
handle <I>dh</I> such that \f$\in\f$`cm.darts()`:
\f$\in\f$`darts()`:
- `dh->is_free(0)`, or `dh->beta(0)->beta(1)==dh`;
- `dh->is_free(1)`, or `dh->beta(1)->beta(0)==dh`;
- \f$ \forall\f$<I>i</I>, 2\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dimension</I>:
`dh->is_free(i)`, or `dh->beta(i)->beta(i)==dh`;
- \f$ \forall\f$<I>i</I>,<I>j</I>, 0\f$ \leq\f$<I>i</I>\f$ <\f$<I>i</I>+2\f$ \leq\f$<I>j</I>\f$ \leq\f$<I>dimension</I> such that <I>j</I>\f$ \geq\f$ 3: `dh->beta(i)->beta(j)==null_dart_handle` or `dh->beta(i)->beta(j)->beta(i)->beta(j)==dh`;
- \f$ \forall\f$<I>i</I>, 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dimension</I> such that <I>i</I>-attributes are non void: \f$ \forall\f$<I>dh2</I> such that belong to the same <I>i</I>-cell than `dh2->attribute<i>()==dh->attribute<i>()`.
\todo Replace the use of dart functions by corresponding mathematical notions.
- `d` is 0-free, or \f$ \beta_1(\beta_0(d))=d\f$;
- `d` is 1-free, or \f$ \beta_0(\beta_1(d))=d\f$;
- \f$ \forall\f$<I>i</I>, 2\f$ \leq\f$<I>i</I>\f$ \leq\f$\ref CombinatorialMap::dimension "dimension":
`d` is <i>i</i>-free, or \f$ \beta_i(\beta_i(d))=d\f$;
- \f$ \forall\f$<I>i</I>, <I>j</I>,
0\f$ \leq\f$<I>i</I>\f$ <\f$<I>i</I>+2\f$ \leq\f$<I>j</I>\f$ \leq\f$\ref CombinatorialMap::dimension "dimension"
such that <I>j</I>\f$ \geq\f$ 3: \f$ \beta_j(\beta_i(d))=\varnothing\f$ or ;
\f$ \beta_j(\beta_i(\beta_j(\beta_i(d))))=d\f$;
- \f$ \forall\f$<I>i</I>, 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\ref CombinatorialMap::dimension "dimension"
such that <I>i</I>-attributes are non void:
+ \f$ \forall\f$<I>d2</I> in the same <I>i</I>-cell than <I>d</I>: <I>d</I> and <I>d2</I> have the same <I>i</I>-attribute;
+ \f$ \forall\f$<I>d2</I> in a different <I>i</I>-cell than <I>d</I>: <I>d</I> and <I>d2</I> have different <I>i</I>-attributes.
*/
bool is_valid() const;
@ -266,7 +292,7 @@ bool is_valid() const;
Returns true iff the combinatorial 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$<I>dimension</I>.
\pre 1\f$ \leq\f$<I>i</I>\f$ \leq\f$\ref CombinatorialMap::dimension "dimension".
*/
bool is_without_boundary(unsigned int i) const;
@ -282,63 +308,71 @@ size_type number_of_darts() const;
/*!
Returns the number of <I>i</I>-attributes in the combinatorial map.
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dimension</I>, and <I>i</I>-attributes are non void.
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\ref CombinatorialMap::dimension "dimension",
and <I>i</I>-attributes are non void.
*/
template <unsigned int i>
size_type number_of_attributes() const;
/*!
Returns the dart handle of `adart`.
\pre `adart`\f$ \in\f$`cm.darts()`.
Returns the dart handle of `d`.
\pre `d`\f$ \in\f$`darts()`.
*/
Dart_handle dart_handle(Dart& adart);
Dart_handle dart_handle(Dart& d);
/*!
Returns the dart const handle of `adart`.
\pre `adart`\f$ \in\f$`cm.darts()`.
Returns the dart const handle of `d`.
\pre `d`\f$ \in\f$`darts()`.
*/
Dart_const_handle dart_handle(const Dart& adart) const;
Dart_const_handle dart_handle(const Dart& d) const;
/*!
Returns \f$ \beta_j\f$(\f$ \beta_i\f$(`dh`)).
Returns \f$ \beta_j\f$(\f$ \beta_i\f$(`*dh`)).
Overloads of this member function are defined that take from one to nine integer as arguments.
For each function, betas are applied in the same order as their indices are given as parameters.
For example `beta(dh,1)`=\f$ \beta_1\f$(`dh`),
and `beta(dh,1,2,3,0)`=\f$ \beta_0\f$(\f$ \beta_3\f$(\f$ \beta_2\f$(\f$ \beta_1\f$(`dh`)))).
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dimension</I>, 0\f$ \leq\f$<I>j</I>\f$ \leq\f$<I>dimension</I> and `*dh`\f$ \in\f$`cm.darts()`.
For example `beta(dh,1)`=\f$ \beta_1\f$(`*dh`),
and `beta(dh,1,2,3,0)`=\f$ \beta_0\f$(\f$ \beta_3\f$(\f$ \beta_2\f$(\f$ \beta_1\f$(`*dh`)))).
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\ref CombinatorialMap::dimension "dimension",
0\f$ \leq\f$<I>j</I>\f$ \leq\f$\ref CombinatorialMap::dimension "dimension"
and `*dh`\f$ \in\f$`darts()`.
*/
Dart_handle beta(Dart_handle dh, int i, int j) const;
/*!
Returns \f$ \beta_j\f$(\f$ \beta_i\f$(`dh`)).
Returns \f$ \beta_j\f$(\f$ \beta_i\f$(`*dh`)).
Overloads of this member function are defined that take from one to nine integer as arguments.
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dimension</I>, 0\f$ \leq\f$<I>j</I>\f$ \leq\f$<I>dimension</I> and `*dh`\f$ \in\f$`cm.darts()`.
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\ref CombinatorialMap::dimension "dimension",
0\f$ \leq\f$<I>j</I>\f$ \leq\f$\ref CombinatorialMap::dimension "dimension"
and `*dh`\f$ \in\f$`darts()`.
*/
Dart_const_handle beta(Dart_const_handle dh, int i, int j) const;
/*!
Returns true iff `dh1` can be <I>i</I>-sewn with `dh2` by keeping the combinatorial map valid.
Returns true iff `*dh1` can be <I>i</I>-sewn with `*dh2` by keeping the combinatorial map valid.
True if there is
This is true 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$ \ldots\f$,\f$ \beta_{i-2}\f$,\f$ \beta_{i+2}\f$,\f$ \ldots\f$,\f$ \beta_d\f$\f$ \rangle{}\f$(<I>dh1</I>) and
<I>D2</I>=\f$ \langle{}\f$\f$ \beta_1\f$,\f$ \ldots\f$,\f$ \beta_{i-2}\f$,\f$ \beta_{i+2}\f$,\f$ \ldots\f$,\f$ \beta_d\f$\f$ \rangle{}\f$(<I>dh2</I>)
satisfying: <I>f</I>(<I>dh1</I>)=<I>dh2</I>, and for all <I>e</I>\f$ \in\f$<I>D1</I>, for all <I>j</I>\f$ \in\f${1,\f$ \ldots\f$,<I>i</I>-2,<I>i</I>+2,\f$ \ldots\f$,<I>d</I>},
<I>D1</I>=\f$ \langle{}\f$\f$ \beta_1\f$,\f$ \ldots\f$,\f$ \beta_{i-2}\f$,\f$ \beta_{i+2}\f$,\f$ \ldots\f$,\f$ \beta_d\f$\f$ \rangle{}\f$(<I>*dh1</I>) and
<I>D2</I>=\f$ \langle{}\f$\f$ \beta_1\f$,\f$ \ldots\f$,\f$ \beta_{i-2}\f$,\f$ \beta_{i+2}\f$,\f$ \ldots\f$,\f$ \beta_d\f$\f$ \rangle{}\f$(<I>*dh2</I>)
satisfying: <I>f</I>(<I>*dh1</I>)=<I>*dh2</I>, and for all <I>e</I>\f$ \in\f$<I>D1</I>, for all <I>j</I>\f$ \in\f${1,\f$ \ldots\f$,<I>i</I>-2,<I>i</I>+2,\f$ \ldots\f$,<I>d</I>},
<I>f</I>(\f$ \beta_j\f$(<I>e</I>))=\f$ \beta_j^{-1}\f$(<I>f</I>(<I>e</I>)).
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dimension</I>, `*dh1`\f$ \in\f$`cm.darts()`, and `*dh2`\f$ \in\f$`cm.darts()`.
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\ref CombinatorialMap::dimension "dimension",
`*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;
/*!
Displays on `os` the number of elements of the combinatorial 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$CMap::<I>dimension</I>,
its number of <I>i</I>-cells, for each <I>i</I>,
0\f$ \leq\f$<I>i</I>\f$ \leq\f$\ref CombinatorialMap::dimension "dimension",
and its number of connected components.
Example of output for a 3D combinatorial map containing two disjoint
combinatorial tetrahedra:
<TT>\#Darts=24, \#0-cells=8, \#1-cells=12, \#2-cells=8, \#3-cells=2, \#ccs=2</TT>
*/
std::ostream& display_characteristics(std::ostream & os) const;
@ -360,58 +394,65 @@ Dart_const_range& darts() const;
/*!
Returns a range of all the <I>i</I>-attributes in the combinatorial map.
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dimension</I>, and <I>i</I>-attributes are non void.
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\ref CombinatorialMap::dimension "dimension",
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 combinatorial map.
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dimension</I>, and <I>i</I>-attributes are non void.
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\ref CombinatorialMap::dimension "dimension",
and <I>i</I>-attributes are non void.
*/
template<unsigned int i> Attribute_const_range<i>::type & attributes() const;
/*!
Returns a range of all the darts of the orbit `<Beta...>(dh)`.
\pre `*dh`\f$ \in\f$`cm.darts()` and `Beta...` 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$<I>dimension</I>, and (\f$ i_1\f$\f$ \neq\f$ 0 or \f$ i_2\f$\f$ \neq\f$1).
Returns a range of all the darts of the orbit `<Beta...>(*dh)`.
\pre `*dh`\f$ \in\f$`darts()` and `Beta...` 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$\ref CombinatorialMap::dimension "dimension",
and (\f$ i_1\f$\f$ \neq\f$ 0 or \f$ i_2\f$\f$ \neq\f$ 1).
*/
template<unsigned int ... Beta> Dart_of_orbit_range darts_of_orbit(Dart_handle dh);
/*!
Returns a const range of all the darts of the orbit `<Beta...>(dh)`.
Returns a const range of all the darts of the orbit `<Beta...>(*dh)`.
\pre Same as for the non const version.
*/
template<unsigned int ... Beta> Dart_of_orbit_const_range darts_of_orbit(Dart_const_handle dh) const;
/*!
Returns a range of all the darts of the <I>i</I>-cell containing `dh`.
Returns a range of all the darts of the <I>i</I>-cell containing `*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$`cm.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$<I>dimension</I>.
\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$\ref CombinatorialMap::dimension "dimension".
*/
template<unsigned int i,unsigned int dim=dimension> Dart_of_cell_range darts_of_cell(Dart_handle dh);
/*!
Returns a const range of all the darts of the <I>i</I>-cell containing `dh`.
Returns a const range of all the darts of the <I>i</I>-cell containing `*dh`.
<I>i</I>-cells are considered in <I>dim</I> dimension. If <I>i==dim+1</I>,
const range of all the darts of the connected component containing `dh`.
const range of all the darts of the connected component containing `*dh`.
\pre Same as for the non const version.
*/
template<unsigned int i,unsigned int dim=dimension> Dart_of_cell_const_range darts_of_cell(Dart_const_handle dh) const;
/*!
Returns a range of one dart of each <I>i</I>-cell incident to the <I>j</I>-cell containing `dh`.
Returns a range of one dart of each <I>i</I>-cell incident to the <I>j</I>-cell containing `*dh`.
Cells are considered in <I>dim</I> dimension. If <I>i==dim+1</I>,
consider each connected component instead of each <I>i</I>-cell. If <I>j==dim+1</I>,
consider the connected component containing `dh` instead of the <I>j</I>-cell.
\pre `*dh`\f$ \in\f$`cm.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$<I>dimension</I>.
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$\ref CombinatorialMap::dimension "dimension".
*/
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);
/*!
Returns a const range of one dart of each <I>i</I>-cell incident to the <I>j</I>-cell containing `dh`.
Returns a const range of one dart of each <I>i</I>-cell incident to the <I>j</I>-cell containing `*dh`.
Cells are considered in <I>dim</I> dimension. If <I>i==dim+1</I>,
consider each connected component instead of each <I>i</I>-cell. If <I>j==dim+1</I>,
consider the connected component containing `dh` instead of the <I>j</I>-cell.
consider the connected component containing `*dh` instead of the <I>j</I>-cell.
\pre Same as for the non const version.
*/
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;
@ -420,7 +461,8 @@ template<unsigned int i,unsigned int j,unsigned int dim=dimension> One_dart_per_
Returns a range of one dart of each <I>i</I>-cell in the combinatorial 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 combinatorial 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$<I>dimension</I>.
\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$\ref CombinatorialMap::dimension "dimension".
*/
template<unsigned int i,unsigned int dim=dimension> One_dart_per_cell_range one_dart_per_cell();
@ -441,8 +483,8 @@ template<unsigned int i,unsigned int dim=dimension> One_dart_per_cell_const_rang
Creates a new dart in the combinatorial 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$<I>dimension</I>, 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$\ref CombinatorialMap::dimension "dimension",
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.
@ -452,7 +494,7 @@ Dart_handle create_dart(T1 t1);
/*!
Removes `*dh` from the combinatorial map.
\pre `*dh`\f$ \in\f$`cm.darts()`.
\pre `*dh`\f$ \in\f$`darts()`.
*/
void erase_dart(Dart_handle dh);
@ -462,20 +504,23 @@ Creates a new <I>i</I>-attribute in the combinatorial map, and returns the corre
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$<I>dimension</I>, and <I>i</I>-attributes are non void.
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\ref CombinatorialMap::dimension "dimension",
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 combinatorial map.
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dimension</I>, <I>i</I>-attributes are non void, and `*ah`\f$ \in\f$`cm.attributes<i>()`.
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\ref CombinatorialMap::dimension "dimension",
<I>i</I>-attributes are non void, and
`*ah`\f$ \in\f$\ref CombinatorialMap::attributes() "attributes<i>()".
*/
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$`cm.darts()`, 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dimension</I>,
<I>i</I>-attributes are non void, and `*ah`\f$ \in\f$`cm.attributes<i>()`.
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$\ref CombinatorialMap::dimension "dimension",
<I>i</I>-attributes are non void, and `*ah`\f$ \in\f$\ref CombinatorialMap::attributes() "attributes<i>()".
*/
template <unsigned int i> void set_attribute(Dart_handle dh, Attribute_handle<i>::type ah);
@ -489,13 +534,15 @@ void clear();
/// \name Operations
/// @{
/*!
<I>i</I>-sew darts `dh1` and `dh2`, by keeping the combinatorial map valid.
<I>i</I>-sew darts `*dh1` and `*dh2`, by keeping the combinatorial map valid.
Links by \f$ \beta_i\f$
two by two all the darts of the orbit
<I>D1</I>=\f$ \langle{}\f$\f$ \beta_1\f$,\f$ \ldots\f$,\f$ \beta_{i-2}\f$,\f$ \beta_{i+2}\f$,\f$ \ldots\f$,\f$ \beta_d\f$\f$ \rangle{}\f$(`dh1`) and
<I>D2</I>=\f$ \langle{}\f$\f$ \beta_0\f$,\f$ \beta_2\f$,\f$ \ldots\f$,\f$ \beta_{i-2}\f$,\f$ \beta_{i+2}\f$,\f$ \ldots\f$,\f$ \beta_d\f$\f$ \rangle{}\f$ (`dh2`)
such that <I>d2</I>=<I>f</I>(<I>d1</I>), <I>f</I> being the bijection between <I>D1</I> and <I>D2</I>
satisfying: <I>f</I>(<I>dh1</I>)=<I>dh2</I>, and for all <I>e</I>\f$ \in\f$<I>D1</I>, for all
<I>D1</I>=\f$ \langle{}\f$\f$ \beta_1\f$,\f$ \ldots\f$,\f$ \beta_{i-2}\f$,\f$ \beta_{i+2}\f$,\f$ \ldots\f$,\f$ \beta_d\f$\f$ \rangle{}\f$(`*dh1`) and
<I>D2</I>=\f$ \langle{}\f$\f$ \beta_0\f$,\f$ \beta_2\f$,\f$ \ldots\f$,\f$ \beta_{i-2}\f$,\f$ \beta_{i+2}\f$,\f$ \ldots\f$,\f$ \beta_d\f$\f$ \rangle{}\f$(`*dh2`)
such that <I>d2</I>=<I>f</I>(<I>d1</I>).
<I>f</I> is the bijection between <I>D1</I> and <I>D2</I>
satisfying: <I>f</I>(<I>*dh1</I>)=<I>*dh2</I>, and for all <I>e</I>\f$ \in\f$<I>D1</I>, for all
<I>j</I>\f$ \in\f${1,\f$ \ldots\f$,<I>i</I>-2,<I>i</I>+2,\f$ \ldots\f$,<I>d</I>},
<I>f</I>(\f$ \beta_j\f$(<I>e</I>))=\f$ \beta_j^{-1}\f$(<I>f</I>(<I>e</I>)).
@ -511,20 +558,20 @@ is called on
the two attributes <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 combinatorial map.
\pre `cm.is_sewable<i>(dh1,dh2)`.
\pre \ref CombinatorialMap::is_sewable "is_sewable<i>(dh1,dh2)".
\advanced If `update_attributes` is `false`, non void attributes are
not updated; thus the combinatorial map can be no more valid after this modification.
not updated; thus the combinatorial map can be no more valid after this operation.
*/
template <unsigned int i> void sew(Dart_handle dh1,
Dart_handle dh2, bool update_attributes=true);
/*!
<I>i</I>-unsew darts `dh` and \f$ \beta_i\f$`(dh)`, by keeping the combinatorial map valid.
<I>i</I>-unsew darts `*dh` and \f$ \beta_i\f$`(*dh)`, by keeping the combinatorial map valid.
Unlinks by \f$ \beta_i\f$ all the darts in the
orbit
\f$ \langle{}\f$\f$ \beta_1\f$,\f$ \ldots\f$,\f$ \beta_{i-2}\f$,\f$ \beta_{i+2}\f$,\f$ \ldots\f$,\f$ \beta_d\f$\f$ \rangle{}\f$(`dh`). If
\f$ \langle{}\f$\f$ \beta_1\f$,\f$ \ldots\f$,\f$ \beta_{i-2}\f$,\f$ \beta_{i+2}\f$,\f$ \ldots\f$,\f$ \beta_d\f$\f$ \rangle{}\f$(`*dh`). If
`update_attributes` is `true`, when necessary, non void
attributes are updated to ensure the validity of the combinatorial 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
@ -534,32 +581,35 @@ belonging to <I>c2</I> are associated with this new attribute. Finally,
the functor \ref CellAttribute::On_split "Attribute_type<i>::type::On_split"
is called on the
two attributes <I>attr1</I> and <I>attr2</I>.
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dimension</I>, `*dh`\f$ \in\f$`cm.darts()` and `dh` is not <I>i</I>-free.
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\ref CombinatorialMap::dimension "dimension",
`*dh`\f$ \in\f$`darts()` and `*dh` is not <I>i</I>-free.
\advanced If `update_attributes` is `false`, non void attributes are
not updated thus the combinatorial map can be no more valid after this modification.
not updated thus the combinatorial map can be no more valid after this operation.
*/
template <unsigned int i> void unsew(Dart_handle dh, bool
update_attributes=true);
/*!
Links `dh1` and `dh2` by \f$ \beta_i\f$.
The combinatorial map can be no more valid after this modification. If
`update_attributes` is true, non void attributes of `dh1` and
`dh2` are updated: if one dart has an attribute and the second
Links `*dh1` and `*dh2` by \f$ \beta_i\f$.
The combinatorial map can be no more valid after this operation. If
`update_attributes` is true, non void attributes of `*dh1` and
`*dh2` are updated: if one dart has an attribute and the second
dart not, the non null attribute is associated to the dart having a null attribute.
If both darts have an attribute,
the attribute of `dh1` is associated to `dh2`.
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dimension</I>, `*dh1`\f$ \in\f$`cm.darts()`, `*dh2`\f$ \in\f$`cm.darts()` and (<I>i</I>\f$ <\f$ 2 or `dh1`\f$ \neq\f$`dh2`).
the attribute of `*dh1` is associated to `*dh2`.
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\ref CombinatorialMap::dimension "dimension",
`*dh1`\f$ \in\f$`darts()`, `*dh2`\f$ \in\f$`darts()` and (<I>i</I>\f$ <\f$ 2 or `dh1`\f$ \neq\f$`dh2`).
*/
template <unsigned int i> void link_beta(Dart_handle dh1, Dart_handle dh2, bool update_attributes=true);
/*!
Unlinks `dh` and \f$ \beta_i\f$(`dh`) by \f$ \beta_i\f$.
The combinatorial map can be no more valid after this modification.
Attributes of `dh` and \f$ \beta_i\f$(`dh`)
Unlinks `*dh` and \f$ \beta_i\f$(`*dh`) by \f$ \beta_i\f$.
The combinatorial map can be no more valid after this operation.
Attributes of `*dh` and \f$ \beta_i\f$(`*dh`)
are not modified.
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$<I>dimension</I>, `*dh`\f$ \in\f$`cm.darts()`, and `dh` is not <I>i</I>-free.
\pre 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\ref CombinatorialMap::dimension "dimension",
`*dh`\f$ \in\f$`darts()`, and `*dh` is not <I>i</I>-free.
*/
template <unsigned int i> void unlink_beta(Dart_handle dh);
@ -575,60 +625,60 @@ index. Returns -1 if there is no more available free mark.
int get_new_mark() const;
/*!
Returns true iff `amark` is a reserved mark of the combinatorial map.
\pre 0\f$ \leq\f$<I>amark</I>\f$ <\f$`NB_MARKS`.
Returns true iff `m` is a reserved mark of the combinatorial map.
\pre 0\f$ \leq\f$<I>m</I>\f$ <\f$\ref CombinatorialMap::NB_MARKS "NB_MARKS".
*/
bool is_reserved(int amark) const;
bool is_reserved(int m) const;
/*!
Returns true iff `dh` is marked for `amark`.
\pre `is_reserved(amark)` and `*dh`\f$ \in\f$`cm.darts()`.
Returns true iff `*dh` is marked for `m`.
\pre \ref CombinatorialMap::is_reserved "is_reserved(m)" and `*dh`\f$ \in\f$`darts()`.
*/
bool is_marked(Dart_const_handle dh, int amark) const;
bool is_marked(Dart_const_handle dh, int m) const;
/*!
Marks `dh` for `amark`.
\pre `is_reserved(amark)` and `*dh`\f$ \in\f$`cm.darts()`.
Marks `*dh` for `m`.
\pre \ref CombinatorialMap::is_reserved "is_reserved(m)" and `*dh`\f$ \in\f$`darts()`.
*/
void mark(Dart_const_handle dh, int amark) const;
void mark(Dart_const_handle dh, int m) const;
/*!
Unmarks `dh` for the mark `amark`.
\pre `is_reserved(amark)` and `*dh`\f$ \in\f$`cm.darts()`.
Unmarks `*dh` for the mark `m`.
\pre \ref CombinatorialMap::is_reserved "is_reserved(m)" and `*dh`\f$ \in\f$`darts()`.
*/
void unmark(Dart_const_handle dh, int amark) const;
void unmark(Dart_const_handle dh, int m) const;
/*!
Inverse the mark `amark` for all the darts of the combinatorial map.
Inverse the mark `m` for all the darts of the combinatorial map.
All the marked darts become unmarked and all the unmarked darts
become marked.
\pre `is_reserved(amark)`.
\pre \ref CombinatorialMap::is_reserved "is_reserved(m)".
*/
void negate_mark(int amark) const;
void negate_mark(int m) const;
/*!
Unmarks all the darts of the combinatorial map for `amark`.
\pre `is_reserved(amark)`.
Unmarks all the darts of the combinatorial map for `m`.
\pre \ref CombinatorialMap::is_reserved "is_reserved(m)".
*/
void unmark_all(int amark) const;
void unmark_all(int m) const;
/*!
Returns the number of marked darts for `amark`.
\pre `is_reserved(amark)`.
Returns the number of marked darts for `m`.
\pre \ref CombinatorialMap::is_reserved "is_reserved(m)".
*/
size_type number_of_marked_darts(int amark) const;
size_type number_of_marked_darts(int m) const;
/*!
Return the number of unmarked darts for `amark`.
\pre `is_reserved(amark)`.
Return the number of unmarked darts for `m`.
\pre \ref CombinatorialMap::is_reserved "is_reserved(m)".
*/
size_type number_of_unmarked_darts(int amark) const;
size_type number_of_unmarked_darts(int m) const;
/*!
Frees `amark`.
\pre `is_reserved(amark)`.
Frees mark `m`.
\pre \ref CombinatorialMap::is_reserved "is_reserved(m)".
*/
void free_mark(int amark) const;
void free_mark(int m) const;
/// @}
}; /* end CombinatorialMap */