Corrections following Sebastien review (nyf)

This commit is contained in:
Guillaume Damiand 2016-10-04 12:13:43 -04:00
parent 12f8efdba0
commit c88fd4fd1c
16 changed files with 67 additions and 63 deletions

View File

@ -4,24 +4,21 @@ namespace CGAL {
/*! /*!
\ingroup PkgCombinatorialMapsClasses \ingroup PkgCombinatorialMapsClasses
The class `Dart` represents a <I>d</I>D dart in a combinatorial map. The class `Combinatorial_map_dart` represents a <I>d</I>D dart in a combinatorial map.
\f$ \beta_i\f$ pointers are coded in a array of <I>d+1</I> \link Dart::Dart_handle `Dart_handle`\endlink \f$ \beta_i\f$ pointers are coded in a array of <I>d+1</I> \link Combinatorial_map_dart::Dart_handle `Dart_handle`\endlink (because we describe also the \f$ \beta_0\f$ link). Attributes are associated to each dart by \link Attribute_handle `Attribute_handle<i>`\endlink, one for each non void <I>i</I>-attribute.
(because we describe also the \f$ \beta_0\f$ link). Attributes are
associated to each dart by \link Attribute_handle `Attribute_handle<i>`\endlink, one for each
non void <I>i</I>-attribute.
\cgalModels `::BasicDart` \cgalModels `Dart`
\tparam d an integer for the dimension of the dart. \tparam d the dimension of the dart.
\tparam CMap must be a model of the `CombinatorialMap` concept. \tparam CMap a model of the `CombinatorialMap` concept.
\sa `CombinatorialMap` \sa `CombinatorialMap`
*/ */
template< typename d, typename CMap > template< typename d, typename CMap >
class Dart { class Combinatorial_map_dart {
public: public:
/// \name Types /// \name Types
@ -82,5 +79,5 @@ Returns \f$ \beta_i^{-1}\f$(`*this`) when the dart is const.
*/ */
Dart_const_handle beta_inv(unsigned int i) const; Dart_const_handle beta_inv(unsigned int i) const;
}; /* end Dart */ }; /* end Combinatorial_map_dart */
} /* end namespace CGAL */ } /* end namespace CGAL */

View File

@ -4,7 +4,7 @@ namespace CGAL {
/*! /*!
\ingroup PkgCombinatorialMapsClasses \ingroup PkgCombinatorialMapsClasses
The class `Combinatorial_map_min_items` is a model of the `BasicMapItems` concept. It defines the type of darts which is a `Dart<d,CMap>`. The `Combinatorial_map_min_items` has a template argument for the dimension of the combinatorial map. In this class, no attribute is enabled. The class `Combinatorial_map_min_items` is a model of the `BasicMapItems` concept. It defines the type of darts which is a `Combinatorial_map_dart<d,CMap>`. The `Combinatorial_map_min_items` has a template argument for the dimension of the combinatorial map. In this class, no attribute is enabled.
\cgalModels `BasicMapItems` \cgalModels `BasicMapItems`
@ -21,17 +21,17 @@ struct Combinatorial_map_min_items
template <class CMap> template <class CMap>
struct Dart_wrapper struct Dart_wrapper
{ {
typedef CGAL::Dart<d, CMap> Dart; typedef CGAL::Combinatorial_map_dart<d, CMap> Dart;
typedef CGAL::cpp11::tuple<> Attributes; typedef CGAL::cpp11::tuple<> Attributes;
}; };
}; };
\endcode \endcode
\sa `Combinatorial_map<d,Items,Alloc>` \sa `Combinatorial_map<d,Items,Alloc>`
\sa `Dart<d,CMap>` \sa `Combinatorial_map_dart<d,CMap>`
*/ */
template< typename d > template< unsigned int d >
class Combinatorial_map_min_items { class Combinatorial_map_min_items {
public: public:

View File

@ -191,19 +191,19 @@ All information associated to darts (\f$ \beta\f$ links and attributes) can be a
\subsection ssecitem Combinatorial Map Items \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 `::BasicDart` concept, and `%Attributes` which defines the attributes and their types.} \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.}
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 `%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 `Dart<d,CMap>` as type of dart, and `Attributes` as empty tuple. 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.
\subsection ssecdarts Darts \subsection ssecdarts Darts
The class `Dart<d,CMap>`, a model of the `BasicDart` 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 BasicMap::Dart_handle `Dart_handle`\endlink and \link BasicMap::Dart_const_handle `Dart_const_handle`\endlink.
Each instance `d0` of `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 BasicMap::Attribute_handle `CMap::Attribute_handle<i>::type` \endlink, one for each non void <I>i</I>-attribute.
Note that the use of the `Dart` class is not hard wired in the combinatorial map class. Users can provide their own model of the `BasicDart` concept, and pass it to the combinatorial map with the help of a custom item class. 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 \subsection ssecattributes Cell Attributes
@ -219,7 +219,7 @@ What we said for the dart also holds for the cell attribute. The combinatorial m
\subsection ssecexampledef Example of Combinatorial Map Definition \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 (`Dart` and `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 `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 `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.
\code{.cpp} \code{.cpp}
@ -230,7 +230,7 @@ struct Example_items_3
template <class CMap> template <class CMap>
struct Dart_wrapper struct Dart_wrapper
{ {
typedef CGAL::Dart<3, CMap> Dart; typedef CGAL::Combinatorial_map_dart<3, CMap> Dart;
typedef CGAL::Cell_attribute<CMap, int> Edge_attrib; typedef CGAL::Cell_attribute<CMap, int> Edge_attrib;
typedef CGAL::cpp11::tuple<void,Edge_attrib> Attributes; typedef CGAL::cpp11::tuple<void,Edge_attrib> Attributes;
}; };
@ -461,7 +461,7 @@ The output is:
\subsection sseccombimapwithcolor Combinatorial Map With Attributes \subsection sseccombimapwithcolor Combinatorial Map With Attributes
In the following example, we illustrate how to specify the 2-attributes in a 3D combinatorial map. For that, we define our own item class using `Dart<3,CMap>` as type of dart, and \link Cell_attribute `Cell_attribute<CMap,int,Tag_true,Sum_functor,Divide_by_two_functor>`\endlink as attributes which contain an `int` and which are associated to 2-cells of the combinatorial map. In the following example, we illustrate how to specify the 2-attributes in a 3D combinatorial map. For that, we define our own item class using `Combinatorial_map_dart<3,CMap>` as type of dart, and \link Cell_attribute `Cell_attribute<CMap,int,Tag_true,Sum_functor,Divide_by_two_functor>`\endlink as attributes which contain an `int` and which are associated to 2-cells of the combinatorial map.
Functors `Sum_functor` and `Divide_by_two_functor` define a custom behavior: when two attributes `ca1` and `ca2` are merged into `ca1`, the value of `ca1` is the sum of the two initial values. When an attribute `ca1` is split in the two attributes `ca1` and `ca2`, the value of each attribute is half of the first value. Functors `Sum_functor` and `Divide_by_two_functor` define a custom behavior: when two attributes `ca1` and `ca2` are merged into `ca1`, the value of `ca1` is the sum of the two initial values. When an attribute `ca1` is split in the two attributes `ca1` and `ca2`, the value of each attribute is half of the first value.

View File

@ -38,17 +38,17 @@ BasicMap(const BMap& bmap);
/// @{ /// @{
/*! /*!
%Dart type, a model of the `BasicDart` concept. %Dart type, a model of the `Dart` concept.
*/ */
typedef unspecified_type Dart; typedef unspecified_type Dart;
/*! /*!
%Dart handle type, equal to `BasicDart::Dart_handle`. %Dart handle type, equal to `Dart::Dart_handle`.
*/ */
typedef unspecified_type Dart_handle; typedef unspecified_type Dart_handle;
/*! /*!
%Dart const handle type, equal to `BasicDart::Dart_const_handle`. %Dart const handle type, equal to `Dart::Dart_const_handle`.
*/ */
typedef unspecified_type Dart_const_handle; typedef unspecified_type Dart_const_handle;
@ -63,7 +63,7 @@ typedef unspecified_type size_type;
/// @{ /// @{
/*! /*!
The dimension <I>d</I> of the basic map, equal to `BasicDart::dimension`. The dimension <I>d</I> of the basic map, equal to `Dart::dimension`.
*/ */
static const unsigned int dimension; static const unsigned int dimension;
@ -107,7 +107,7 @@ typedef unspecified_type Attributes;
using Attribute_type = unspecified_type; using Attribute_type = unspecified_type;
/*! /*!
`Attribute_handle<i>::%type` is a handle to <I>i</I>-attributes, equal to \link BasicDart::Attribute_handle `Dart::Attribute_handle<i>::type` \endlink. `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 BasicMap::dimension `dimension`\endlink
and <I>i</I>-attributes are non void. and <I>i</I>-attributes are non void.
\note It can be implemented using a nested template class. \note It can be implemented using a nested template class.
@ -116,7 +116,7 @@ typedef unspecified_type Attributes;
using Attribute_handle = unspecified_type; using Attribute_handle = unspecified_type;
/*! /*!
`Attribute_handle<i>::%type` is a const handle to <I>i</I>-attributes, equal to \link BasicDart::Attribute_const_handle `Dart::Attribute_const_handle<i>::type` \endlink. `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 BasicMap::dimension `dimension`\endlink
and <I>i</I>-attributes are non void. and <I>i</I>-attributes are non void.
\note It can be implemented using a nested template class. \note It can be implemented using a nested template class.

View File

@ -20,7 +20,11 @@ A combinatorial map is valid (see Sections \ref sec_definition and \ref sseccomb
- `d` is 0-free, or \f$ \beta_1(\beta_0(d))=d\f$; - `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$; - `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$\link BasicMap::dimension `dimension`\endlink: `d` is <i>i</i>-free, or \f$ \beta_i(\beta_i(d))=d\f$; - \f$ \forall\f$<I>i</I>, 2\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink: `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$\link BasicMap::dimension `dimension`\endlink 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>, \f$ \forall\f$ <I>j</I>, such that 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink-2
and <I>i</I>+2\f$ \leq\f$<I>j</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink:
\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$\link BasicMap::dimension `dimension`\endlink - \f$ \forall\f$<I>i</I>, 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink
such that <I>i</I>-attributes are non void: 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 the same <I>i</I>-cell than <I>d</I>: <I>d</I> and <I>d2</I> have the same <I>i</I>-attribute;

View File

@ -3,18 +3,18 @@
\ingroup PkgCombinatorialMapsConcepts \ingroup PkgCombinatorialMapsConcepts
\cgalConcept \cgalConcept
The concept `BasicDart` defines a <I>d</I>-dimensional dart for basic maps. A dart mainly stores handles to the darts linked with itself by \tred{the different applications of the basic map}. Moreover, it stores also handles to each non void attribute associated with itself. The concept `Dart` defines a <I>d</I>-dimensional dart for basic maps. A dart mainly stores handles to the darts linked with itself by \tred{the different applications of the basic map}. Moreover, it stores also handles to each non void attribute associated with itself.
\cgalHeading{Creation} \cgalHeading{Creation}
A dart `d0` is never constructed directly, but always created within a basic map `bm` by using the method \link BasicMap::create_dart `bm.create_dart()`\endlink. 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 having all its attribute handles initialized to `NULL`, for each non `void` attribute. A dart `d0` is never constructed directly, but always created within a basic map `bm` by using the method \link BasicMap::create_dart `bm.create_dart()`\endlink. 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 having all its attribute handles initialized to `NULL`, for each non `void` attribute.
\cgalHasModel \link CGAL::Dart `CGAL::Dart<d,CMap>`\endlink \cgalHasModel \link CGAL::Combinatorial_map_dart `CGAL::Combinatorial_map_dart<d,CMap>`\endlink
\cgalHasModel \link CGAL::GMap_dart `CGAL::GMap_dart<d,GMap>`\endlink \cgalHasModel \link CGAL::Generalized_map_dart `CGAL::Generalized_map_dart<d,GMap>`\endlink
*/ */
class BasicDart { class Dart {
public: public:
/// \name Constants /// \name Constants
@ -76,4 +76,4 @@ Attribute_const_handle<i>::type attribute() const;
/// @} /// @}
}; /* end BasicDart */ }; /* end Dart */

View File

@ -42,7 +42,7 @@
\cgalClassifedRefPages \cgalClassifedRefPages
## Concepts ## ## Concepts ##
- `BasicDart` - `Dart`
- `BasicMap` - `BasicMap`
- `BasicMapItems` - `BasicMapItems`
- `CellAttribute` - `CellAttribute`
@ -50,9 +50,9 @@
## Classes ## ## Classes ##
- `CGAL::Combinatorial_map<d,Items,Alloc>` - `CGAL::Combinatorial_map<d,Items,Alloc>`
- `CGAL::Dart<d,CMap>` - `CGAL::Combinatorial_map_dart<d,CMap>`
- `CGAL::Cell_attribute<CMap,Info_,Tag,OnMerge,OnSplit>`
- `CGAL::Combinatorial_map_min_items<d>` - `CGAL::Combinatorial_map_min_items<d>`
- `CGAL::Cell_attribute<CMap,Info_,Tag,OnMerge,OnSplit>`
## Global Functions ## ## Global Functions ##
### Constructions for Combinatorial Maps ### ### Constructions for Combinatorial Maps ###

View File

@ -4,21 +4,21 @@ namespace CGAL {
/*! /*!
\ingroup PkgGeneralizedMapsClasses \ingroup PkgGeneralizedMapsClasses
The class `GMap_dart` represents a <I>d</I>D dart in a generalized map. The class `Generalized_map_dart` represents a <I>d</I>D dart in a generalized map.
\f$ \alpha_i\f$ pointers are coded in a array of <I>d+1</I> \link GMap_dart::Dart_handle `Dart_handle`\endlink. Attributes are associated to each dart by \link Attribute_handle `Attribute_handle<i>`\endlink, one for each non void <I>i</I>-attribute. \f$ \alpha_i\f$ pointers are coded in a array of <I>d+1</I> \link Generalized_map_dart::Dart_handle `Dart_handle`\endlink. Attributes are associated to each dart by \link Attribute_handle `Attribute_handle<i>`\endlink, one for each non void <I>i</I>-attribute.
\cgalModels `::BasicDart` \cgalModels `Dart`
\tparam d an integer for the dimension of the dart. \tparam d the dimension of the dart.
\tparam GMap must be a model of the `GeneralizedMap` concept. \tparam GMap a model of the `GeneralizedMap` concept.
\sa `GeneralizedMap` \sa `GeneralizedMap`
*/ */
template< typename d, typename GMap > template< typename d, typename GMap >
class GMap_dart { class Generalized_map_dart {
public: public:
/// \name Types /// \name Types
@ -48,5 +48,5 @@ using Attribute_const_handle = GMap::Attribute_const_handle<i>;
/// @} /// @}
}; /* end GMap_dart */ }; /* end Generalized_map_dart */
} /* end namespace CGAL */ } /* end namespace CGAL */

View File

@ -4,7 +4,7 @@ namespace CGAL {
/*! /*!
\ingroup PkgGeneralizedMapsClasses \ingroup PkgGeneralizedMapsClasses
The class `Generalized_map_min_items` is a model of the `BasicMapItems` concept. It defines the type of darts which is a `GMap_dart<d,GMap>`. The `Generalized_map_min_items` has a template argument for the dimension of the generalized map. In this class, no attribute is enabled. The class `Generalized_map_min_items` is a model of the `BasicMapItems` concept. It defines the type of darts which is a `Generalized_map_dart<d,GMap>`. The `Generalized_map_min_items` has a template argument for the dimension of the generalized map. In this class, no attribute is enabled.
\cgalModels `BasicMapItems` \cgalModels `BasicMapItems`
@ -21,17 +21,17 @@ struct Generalized_map_min_items
template <class GMap> template <class GMap>
struct Dart_wrapper struct Dart_wrapper
{ {
typedef CGAL::GMap_dart<d, GMap> Dart; typedef CGAL::Generalized_map_dart<d, GMap> Dart;
typedef CGAL::cpp11::tuple<> Attributes; typedef CGAL::cpp11::tuple<> Attributes;
}; };
}; };
\endcode \endcode
\sa `Generalized_map<d,Items,Alloc>` \sa `Generalized_map<d,Items,Alloc>`
\sa `GMap_dart<d,GMap>` \sa `Generalized_map_dart<d,GMap>`
*/ */
template< typename d > template< unsigned int d >
class Generalized_map_min_items { class Generalized_map_min_items {
public: public:

View File

@ -14,11 +14,14 @@ For a generalized map, the function \link BasicMap::next `next`\endlink is equal
\cgalHeading{Validity} \cgalHeading{Validity}
The function \link BasicMap::is_valid `is_valid`\endlink returns iff the generalized map is valid. The function \link BasicMap::is_valid `is_valid`\endlink returns true iff the generalized map is valid.
A generalized map is valid (see Sections \ref sec_definition_gmap and \ref ssecgenmapvalidity) if for all its darts `d` \f$\in\f$`darts()`: A generalized map is valid (see Sections \ref sec_definition_gmap and \ref ssecgenmapvalidity) if for all its darts `d` \f$\in\f$`darts()`:
- \f$ \forall\f$<I>i</I>, 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink: \f$ \alpha_i(\alpha_i(d))=d\f$; - \f$ \forall\f$<I>i</I>, 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink: \f$ \alpha_i(\alpha_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$\link BasicMap::dimension `dimension`\endlink such that <I>j</I>\f$ \geq\f$ 3: \f$ \alpha_j(\alpha_i(\alpha_j(\alpha_i(d))))=d\f$; - \f$ \forall\f$<I>i</I>, \f$ \forall\f$ <I>j</I> such that
0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink-2
and <I>i</I>+2\f$ \leq\f$<I>j</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink:
\f$ \alpha_j(\alpha_i(\alpha_j(\alpha_i(d))))=d\f$;
- \f$ \forall\f$<I>i</I>, 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink such that <I>i</I>-attributes are non void: - \f$ \forall\f$<I>i</I>, 0\f$ \leq\f$<I>i</I>\f$ \leq\f$\link BasicMap::dimension `dimension`\endlink 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 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. + \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.

View File

@ -193,19 +193,19 @@ All information associated to darts \tred{(\f$ \alpha\f$ links and attributes)}
\subsection ssecitemgmap Generalized Map Items \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 `::BasicDart` concept, and `%Attributes` which defines the attributes and their types.} \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.}
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 `%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{`GMap_dart<d,GMap>`} as type of dart, and `Attributes` as empty tuple. 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.
\subsection ssecdartsgmap Darts \subsection ssecdartsgmap Darts
The class \tred{`GMap_dart<d,GMap>`}, a model of the `BasicDart` 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 BasicMap::Dart_handle `Dart_handle`\endlink and \link BasicMap::Dart_const_handle `Dart_const_handle`\endlink.
Each instance `d0` of `GMap_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 BasicMap::Attribute_handle `GMap::Attribute_handle<i>::type`\endlink, one for each non void <I>i</I>-attribute.
Note that the use of the `GMap_dart` class is not hard wired in the generalized map class. Users can provide their own model of the `BasicDart` concept, and pass it to the generalized map with the help of a custom item class. 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 \subsection ssecattributesgmap Cell Attributes
@ -221,7 +221,7 @@ What we said for the dart also holds for the cell attribute. The generalized map
\subsection ssecexampledefgmap Example of Generalized Map Definition \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 (`GMap_dart` and `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 `GMap_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 `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.
\code{.cpp} \code{.cpp}
@ -232,7 +232,7 @@ struct Example_items_3
template <class GMap> template <class GMap>
struct Dart_wrapper struct Dart_wrapper
{ {
typedef CGAL::GMap_dart<3, GMap> Dart; typedef CGAL::Generalized_map_dart<3, GMap> Dart;
typedef CGAL::Cell_attribute<GMap, int> Edge_attrib; typedef CGAL::Cell_attribute<GMap, int> Edge_attrib;
typedef CGAL::cpp11::tuple<void,Edge_attrib> Attributes; typedef CGAL::cpp11::tuple<void,Edge_attrib> Attributes;
}; };
@ -478,7 +478,7 @@ The output is:
\subsection ssecgenmapwithcolor Generalized Map With Attributes \subsection ssecgenmapwithcolor Generalized Map With Attributes
In the following example, we illustrate how to specify the 2-attributes in a 3D generalized map. For that, we define our own item class using `Dart<3,GMap>` as type of dart, and \link Cell_attribute `Cell_attribute<GMap,int,Tag_true,Sum_functor,Divide_by_two_functor>`\endlink as attributes which contain an `int` and which are associated to 2-cells of the generalized map. In the following example, we illustrate how to specify the 2-attributes in a 3D generalized map. For that, we define our own item class using `Generalized_map_dart<3,GMap>` as type of dart, and \link Cell_attribute `Cell_attribute<GMap,int,Tag_true,Sum_functor,Divide_by_two_functor>`\endlink as attributes which contain an `int` and which are associated to 2-cells of the generalized map.
Functors `Sum_functor` and `Divide_by_two_functor` define a custom behavior: when two attributes `ca1` and `ca2` are merged into `ca1`, the value of `ca1` is the sum of the two initial values. When an attribute `ca1` is split in the two attributes `ca1` and `ca2`, the value of each attribute is half of the first value. Functors `Sum_functor` and `Divide_by_two_functor` define a custom behavior: when two attributes `ca1` and `ca2` are merged into `ca1`, the value of `ca1` is the sum of the two initial values. When an attribute `ca1` is split in the two attributes `ca1` and `ca2`, the value of each attribute is half of the first value.

View File

@ -25,7 +25,7 @@
\cgalClassifedRefPages \cgalClassifedRefPages
## Concepts ## ## Concepts ##
- `BasicDart` - `Dart`
- `BasicMap` - `BasicMap`
- `BasicMapItems` - `BasicMapItems`
- `CellAttribute` - `CellAttribute`
@ -33,9 +33,9 @@
## Classes ## ## Classes ##
- `CGAL::Generalized_map<d,Items,Alloc>` - `CGAL::Generalized_map<d,Items,Alloc>`
- `CGAL::GMap_dart<d,GMap>` - `CGAL::Generalized_map_dart<d,GMap>`
- `CGAL::Cell_attribute<GMap,Info_,Tag,OnMerge,OnSplit>`
- `CGAL::Generalized_map_min_items<d>` - `CGAL::Generalized_map_min_items<d>`
- `CGAL::Cell_attribute<GMap,Info_,Tag,OnMerge,OnSplit>`
*/ */

View File

@ -50,7 +50,7 @@ static unsigned int ambient_dimension = d2;
typedef GMap_linear_cell_complex<d,d2,LCCTraits,Items,Alloc> Self; typedef GMap_linear_cell_complex<d,d2,LCCTraits,Items,Alloc> Self;
/*! /*!
The type of dart, must satisfy \link BasicDart::dimension `Dart::dimension`\endlink`==d`. The type of dart, must satisfy \link Dart::dimension `Dart::dimension`\endlink`==d`.
*/ */
typedef Items::Dart_wrapper<Self>::Dart Dart; typedef Items::Dart_wrapper<Self>::Dart Dart;

View File

@ -50,7 +50,7 @@ static const unsigned int ambient_dimension = d2;
typedef Linear_cell_complex<d,d2,LCCTraits,Items,Alloc> Self; typedef Linear_cell_complex<d,d2,LCCTraits,Items,Alloc> Self;
/*! /*!
The type of dart, must satisfy \link BasicDart::dimension `Dart::dimension`\endlink`==d`. The type of dart, must satisfy \link Dart::dimension `Dart::dimension`\endlink`==d`.
*/ */
typedef Items::Dart_wrapper<Self>::Dart Dart; typedef Items::Dart_wrapper<Self>::Dart Dart;