* Add generic beta in CMap (small feature);

* Add generic create_dart and create_attribute in CMap (small feature);
* Add generic create_vertex_attribute in LCC (small feature);
* BugFix in LCC doc (wrong concept for item class).
This commit is contained in:
Guillaume Damiand 2012-09-06 11:42:50 +00:00
parent ca3dd4848b
commit c871aa06b4
16 changed files with 121 additions and 40 deletions

View File

@ -742,7 +742,7 @@ accessed through \emph{handles}. A handle is a model of the
\subsection{Combinatorial Maps}\label{ssec-combinatorial-map}
The class \ccc{Combinatorial_map<d,CMItems,Alloc>} is a model of the
The class \ccc{Combinatorial_map<d,Items,Alloc>} is a model of the
\ccc{CombinatorialMap} concept. It has three template parameters
standing for the dimension of the combinatorial map (an
\ccc{unsigned int}), an items class (a model of the

View File

@ -80,7 +80,7 @@ The class \ccRefName\ represents an attribute containing (or not) an information
\ccSeeAlso
%\ccRefIdfierPage{CGAL::Void_functor}\\
%\ccRefIdfierPage{CGAL::Cell_attribute_with_info}\\
\ccRefIdfierPage{CGAL::Combinatorial_map<d,CMItems,Alloc>}
\ccRefIdfierPage{CGAL::Combinatorial_map<d,Items,Alloc>}
\end{ccRefClass}
% +------------------------------------------------------------------------+

View File

@ -478,7 +478,7 @@ combinatorial tetrahedra:\\
\end{ccAdvanced}
\ccHasModels
\ccRefIdfierPage{CGAL::Combinatorial_map<d,CMItems,Alloc>}
\ccRefIdfierPage{CGAL::Combinatorial_map<d,Items,Alloc>}
% \ccSeeAlso
% \ccRefIdfierPage{CGAL::CombinatorialMapWithPoints}

View File

@ -8,7 +8,7 @@
%%RefPage: end of header, begin of main body
% +------------------------------------------------------------------------+
\begin{ccRefClass}{Combinatorial_map<d,CMItems,Alloc>}
\begin{ccRefClass}{Combinatorial_map<d,Items,Alloc>}
\ccRefLabel{CGAL::Combinatorial_map}
\ccInclude{CGAL/Combinatorial_map.h}
@ -25,19 +25,19 @@ Darts and non void attributes are stored in memory using
\ccParameters
\ccc{d} an integer for the dimension of the map.\\
\ccc{CMItems} must be a model of the \ccc{CombinatorialMapItems} concept. \\
\ccc{Items} must be a model of the \ccc{CombinatorialMapItems} concept. \\
\ccc{Alloc} has to match the standard allocator requirements. The \ccc{rebind} mechanism from
\ccc{Alloc} will be used to create appropriate allocators internally with value type \ccc{Dart}.
There are two default template arguments:
\ccc{Combinatorial_map_min_items<d>} for \ccc{CMItems} and
\ccc{Combinatorial_map_min_items<d>} for \ccc{Items} and
\ccc{CGAL_ALLOCATOR(int)} from the \ccc{<CGAL/memory.h>} header file for \ccc{Alloc}.
\ccTypes
\ccThree{typedef Combinatorial_map<d,CMItems,Alloc>}{}{}
\ccTypedef{typedef Combinatorial_map<d,CMItems,Alloc> Self;}{}
\ccThree{typedef Combinatorial_map<d,Items,Alloc>}{}{}
\ccTypedef{typedef Combinatorial_map<d,Items,Alloc> Self;}{}
\ccGlue
\ccTypedef{typedef CMItems::Dart_wrapper<Self>::Dart Dart;}{}
\ccTypedef{typedef Items::Dart_wrapper<Self>::Dart Dart;}{}
\ccHeading{Complexity}

View File

@ -43,7 +43,7 @@ struct Combinatorial_map_min_items
\end{ccExampleCode}
\ccSeeAlso
\ccRefIdfierPage{CGAL::Combinatorial_map<d,CMItems,Alloc>}\\
\ccRefIdfierPage{CGAL::Combinatorial_map<d,Items,Alloc>}\\
\ccRefIdfierPage{CGAL::Dart<d,CMap>}
% \ccRefIdfierPage{CGAL::HalfedgeDS_items_2}\\

View File

@ -16,7 +16,7 @@
%\ccRefConceptPage{CGAL::CombinatorialMapWithPointsTraits}
\subsection{Classes}
\ccRefIdfierPage{CGAL::Combinatorial_map<d,CMItems,Alloc>}\\
\ccRefIdfierPage{CGAL::Combinatorial_map<d,Items,Alloc>}\\
\ccRefIdfierPage{CGAL::Dart<d,CMap>}\\
%\ccRefIdfierPage{CGAL::Combinatorial_map_with_points}
\ccRefIdfierPage{CGAL::Cell_attribute<CMap,Info_,Tag,OnMerge,OnSplit>}\\

View File

@ -257,6 +257,12 @@ namespace CGAL {
Dart_handle create_dart(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4,
const T5 &t5, const T6 &t6, const T7 &t7, const T8 &t8)
{ return mdarts.emplace(mmask_marks, t1, t2, t3, t4, t5, t6, t7, t8); }
template < typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9 >
Dart_handle create_dart(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4,
const T5 &t5, const T6 &t6, const T7 &t7, const T8 &t8,
const T9 &t9)
{ return mdarts.emplace(mmask_marks, t1, t2, t3, t4, t5, t6, t7, t8, t9); }
#endif
/** Erase a dart from the list of darts.
@ -944,6 +950,18 @@ namespace CGAL {
return CGAL::cpp0x::get<Helper::template Dimension_index<i>::value>
(mattribute_containers).emplace(t1, t2, t3, t4, t5, t6, t7, t8);
}
template<unsigned int i, typename T1, typename T2, typename T3, typename T4,
typename T5, typename T6, typename T7, typename T8, typename T9>
typename Attribute_handle<i>::type
create_attribute(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4,
const T5 &t5, const T6 &t6, const T7 &t7, const T8 &t8,
const T9 &t9)
{
CGAL_static_assertion_msg(Helper::template Dimension_index<i>::value>=0,
"create_attribute<i> but i-attributes are disabled");
return CGAL::cpp0x::get<Helper::template Dimension_index<i>::value>
(mattribute_containers).emplace(t1, t2, t3, t4, t5, t6, t7, t8, t9);
}
#endif
/// Erase an attribute.

View File

@ -182,7 +182,7 @@ Section~\ref{ssec-attribute-wp}).
\subsection{Linear Cell Complex}\label{ssec-linear-cell-complex}
The \ccc{CGAL::Linear_cell_complex<d,d2,LCCTraits,CMItems,Alloc>} class
The \ccc{CGAL::Linear_cell_complex<d,d2,LCCTraits,Items,Alloc>} class
is a model of the \ccc{CombinatorialMap} concept. It guarantees that
each vertex of the combinatorial map is associated with an attribute
containing a point. This class can be used in geometric algorithms (it

View File

@ -45,7 +45,7 @@ of a combinatorial map.
\ccTypedef{typedef LCC::Dart_const_handle Dart_const_handle;}{}
\ccSeeAlso
\ccRefIdfierPage{CGAL::Linear_cell_complex<d,d2,LCCTraits,CMItems,Alloc>}\\
\ccRefIdfierPage{CGAL::Linear_cell_complex<d,d2,LCCTraits,Items,Alloc>}\\
\ccRefIdfierPage{CGAL::Linear_cell_complex_min_items<d>}\\
\ccRefIdfierPage{CGAL::Cell_attribute<CMap,Info_,Tag,OnMerge,OnSplit>}

View File

@ -28,7 +28,7 @@ The first type in \ccc{Attributes} must be a model of the
\ccRefIdfierPage{CGAL::Linear_cell_complex_min_items<d>}
\ccSeeAlso
\ccRefIdfierPage{CGAL::Linear_cell_complex<d,d2,LCCTraits,CMItems,Alloc>}\\
\ccRefIdfierPage{CGAL::Linear_cell_complex<d,d2,LCCTraits,Items,Alloc>}\\
\ccRefConceptPage{CellAttributeWithPoint}\\
\ccRefIdfierPage{CGAL::Dart<d,CMap>}

View File

@ -76,7 +76,7 @@ class.
\ccRefIdfierPage{CGAL::Linear_cell_complex_traits<d,K>}.
\ccSeeAlso
\ccRefIdfierPage{CGAL::Linear_cell_complex<d,d2,LCCTraits,CMItems,Alloc>}
\ccRefIdfierPage{CGAL::Linear_cell_complex<d,d2,LCCTraits,Items,Alloc>}
\end{ccRefConcept}
% +------------------------------------------------------------------------+

View File

@ -7,7 +7,7 @@
\ccRefPageBegin
%%RefPage: end of header, begin of main body
% +------------------------------------------------------------------------+
\begin{ccRefClass}{Linear_cell_complex<d,d2,LCCTraits,CMItems,Alloc>}
\begin{ccRefClass}{Linear_cell_complex<d,d2,LCCTraits,Items,Alloc>}
\ccInclude{CGAL/Linear_cell_complex.h}
@ -23,25 +23,25 @@ model of \ccc{CellAttributeWithPoint}.
\ccRefConceptPage{CombinatorialMap}
\ccInheritsFrom
\ccRefIdfierPage{CGAL::Combinatorial_map<d,CMItems,Alloc>}
\ccRefIdfierPage{CGAL::Combinatorial_map<d,Items,Alloc>}
\ccParameters
\ccc{d} an integer for the dimension of the combinatorial map,\\
\ccc{d2} an integer for the dimension of the ambient space,\\
\ccc{LCCTraits} must be a model of the \ccc{LinearCellComplexTraits} concept, satisfying \ccc{LCCTraits::ambiant_dimension==d2},\\
\ccc{CMItems} must be a model of the \ccc{CombinatorialMapItems} concept,\\
\ccc{Items} must be a model of the \ccc{LinearCellComplexItems} concept,\\
\ccc{Alloc} has to match the standard allocator requirements.
There are four default template arguments:
\ccc{d2} is equal to \ccc{d},
\ccc{LCCTraits} is equal to \ccc{CGAL::Linear_cell_complex_traits<d2>},
\ccc{CMItems} is equal to \ccc{CGAL::Linear_cell_complex_min_items<d>} and
\ccc{Items} is equal to \ccc{CGAL::Linear_cell_complex_min_items<d>} and
\ccc{Alloc} is \ccc{CGAL_ALLOCATOR(int)}.
\begin{ccAdvanced}
Note that there is an additional, and undocumented, template
parameter \ccc{CMap} for
\ccc{Linear_cell_complex<d,d2,LCCTraits,CMItems,Alloc,CMap>} allowing
\ccc{Linear_cell_complex<d,d2,LCCTraits,Items,Alloc,CMap>} allowing
to inherit from any model of the \ccc{CombinatorialMap} concept.
\end{ccAdvanced}
@ -56,14 +56,14 @@ There are four default template arguments:
% +-----------------------------------+
\ccTypes
\ccThree{typedef Linear_cell_complex<d,d2,LCCTraits,CMItems,Alloc>}{}{}
\ccTypedef{typedef Linear_cell_complex<d,d2,LCCTraits,CMItems,Alloc> Self;}{}
\ccThree{typedef Linear_cell_complex<d,d2,LCCTraits,Items,Alloc>}{}{}
\ccTypedef{typedef Linear_cell_complex<d,d2,LCCTraits,Items,Alloc> Self;}{}
\ccGlue
\ccTypedef{typedef CMItems::Dart_wrapper<Self>::Dart Dart;}{The type of dart, must satisfy \ccc{Dart::dimension==d}.}
\ccTypedef{typedef Items::Dart_wrapper<Self>::Dart Dart;}{The type of dart, must satisfy \ccc{Dart::dimension==d}.}
\ccTypedef{typedef LCCTraits Traits;}{}
\ccGlue
\ccTypedef{typedef CMItems Items;}{}
\ccTypedef{typedef Items Items;}{}
\ccGlue
\ccTypedef{typedef Alloc Alloc;}{}
@ -157,13 +157,22 @@ if it is a valid combinatorial map, and if for each dart handle \emph{dh} such t
of the new dart to this new 0-attribute,
and returns the corresponding handle.}
\ccMethod{Vertex_attribute_handle create_vertex_attribute();}
{Creates a new 0-attribute in \ccc{lcc}, and returns the corresponding handle
(a shortcut for \ccc{create_attribute<0>()}).}
\ccMethod{template<typename T1> Vertex_attribute_handle
create_vertex_attribute(T1 t1);} {Creates a new 0-attribute in
\ccc{lcc}, and returns the corresponding handle (a shortcut for
\ccc{create_attribute<0>(t1)}). Calls the constructor of
Vertex_attribute having \ccc{T1} as parameter. Overloads of this
member function are defined that take from zero to nine arguments.
With zero argument, \ccc{create_vertex_attribute()} creates a new
0-attribute by using the default constructor.}
\ccMethod{Vertex_attribute_handle create_vertex_attribute(const Point& apoint);}
{Creates a new 0-attribute in \ccc{lcc} initialized with \ccc{apoint},
and returns the corresponding handle.}
% \ccMethod{Vertex_attribute_handle create_vertex_attribute();}
% {Creates a new 0-attribute in \ccc{lcc}, and returns the corresponding handle
% (a shortcut for \ccc{create_attribute<0>()}).}
% \ccMethod{Vertex_attribute_handle create_vertex_attribute(const Point& apoint);}
% {Creates a new 0-attribute in \ccc{lcc} initialized with \ccc{apoint},
% and returns the corresponding handle.}
\ccMethod{void erase_vertex_attribute(Vertex_attribute_handle vh);}
{Removes the 0-attribute pointed to by \ccc{vh} from \ccc{lcc}
@ -328,7 +337,7 @@ if it is a valid combinatorial map, and if for each dart handle \emph{dh} such t
% +-----------------------------------+
\ccSeeAlso
\ccRefConceptPage{CombinatorialMap}\\
\ccRefIdfierPage{CGAL::Combinatorial_map<d,CMItems,Alloc>}\\
\ccRefIdfierPage{CGAL::Combinatorial_map<d,Items,Alloc>}\\
\ccRefConceptPage{Dart}\\
\ccRefConceptPage{LinearCellComplexItems}\\
\ccRefIdfierPage{CGAL::Linear_cell_complex_min_items<d>}\\

View File

@ -46,7 +46,7 @@ The following example shows one implementation of the
\end{ccExampleCode}
\ccSeeAlso
\ccRefIdfierPage{CGAL::Linear_cell_complex<d,d2,LCCTraits,CMItems,Alloc>}\\
\ccRefIdfierPage{CGAL::Linear_cell_complex<d,d2,LCCTraits,Items,Alloc>}\\
\ccRefIdfierPage{CGAL::Dart<d,CMap>}
\end{ccRefClass}

View File

@ -43,7 +43,7 @@ use predicates are only defined in 2D and 3D.
\ccVariable{static unsigned int ambient_dimension = d;}{}
\ccSeeAlso
\ccRefIdfierPage{CGAL::Linear_cell_complex<d,d2,LCCTraits,CMItems,Alloc>}
\ccRefIdfierPage{CGAL::Linear_cell_complex<d,d2,LCCTraits,Items,Alloc>}
\end{ccRefClass}
% +------------------------------------------------------------------------+

View File

@ -10,7 +10,7 @@
\ccRefConceptPage{CellAttributeWithPoint}
\subsection{Classes}
\ccRefIdfierPage{CGAL::Linear_cell_complex<d,d2,LCCTraits,CMItems,Alloc>}\\
\ccRefIdfierPage{CGAL::Linear_cell_complex<d,d2,LCCTraits,Items,Alloc>}\\
\ccRefIdfierPage{CGAL::Linear_cell_complex_min_items<d>}\\
\ccRefIdfierPage{CGAL::Linear_cell_complex_traits<d,K>}\\
\ccRefIdfierPage{CGAL::Cell_attribute_with_point<LCC,Info_,Tag,OnMerge,OnSplit>}

View File

@ -88,15 +88,69 @@ namespace CGAL {
/** Create a vertex attribute.
* @return an handle on the new attribute.
*/
#ifndef CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES
template<typename... Args>
Vertex_attribute_handle create_vertex_attribute(const Args&... args)
{ return Base::template create_attribute<0>(args...); }
#else
Vertex_attribute_handle create_vertex_attribute()
{ return Base::template create_attribute<0>(); }
/** Create a vertex attribute associated with a point.
* @param point the point to associated with the dart.
* @return an handle on the new attribute.
*/
Vertex_attribute_handle create_vertex_attribute(const Point& apoint)
{ return Base::template create_attribute<0>(apoint); }
template<typename T1>
Vertex_attribute_handle create_vertex_attribute(const T1& t1)
{ return Base::template create_attribute<0>(t1); }
template<typename T1, typename T2>
Vertex_attribute_handle create_vertex_attribute
(const T1& t1, const T2 &t2)
{ return Base::template create_attribute<0>(t1, t2); }
template<typename T1, typename T2, typename T3>
Vertex_attribute_handle create_vertex_attribute
(const T1& t1, const T2 &t2, const T3 &t3)
{ return Base::template create_attribute<0>(t1, t2, t3); }
template<typename T1, typename T2, typename T3, typename T4>
Vertex_attribute_handle create_vertex_attribute
(const T1& t1, const T2 &t2, const T3 &t3, const T4 &t4)
{ return Base::template create_attribute<0>(t1, t2, t3, t4); }
template<typename T1, typename T2, typename T3, typename T4, typename T5>
Vertex_attribute_handle create_vertex_attribute
(const T1& t1, const T2 &t2, const T3 &t3, const T4 &t4,
const T5 &t5)
{ return Base::template create_attribute<0>(t1, t2, t3, t4, t5); }
template<typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6>
Vertex_attribute_handle create_vertex_attribute
(const T1& t1, const T2 &t2, const T3 &t3, const T4 &t4,
const T5 &t5, const T6 &t6)
{ return Base::template create_attribute<0>(t1, t2, t3, t4, t5, t6); }
template<typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7>
Vertex_attribute_handle create_vertex_attribute
(const T1& t1, const T2 &t2, const T3 &t3, const T4 &t4,
const T5 &t5, const T6 &t6, const T7 &t7)
{ return Base::template create_attribute<0>(t1, t2, t3, t4, t5, t6, t7); }
template<typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8>
Vertex_attribute_handle create_vertex_attribute
(const T1& t1, const T2 &t2, const T3 &t3, const T4 &t4,
const T5 &t5, const T6 &t6, const T7 &t7, const T8 &t8)
{ return Base::template create_attribute<0>(t1, t2, t3, t4, t5, t6, t7,
t8); }
template<typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9>
Vertex_attribute_handle create_vertex_attribute
(const T1& t1, const T2 &t2, const T3 &t3, const T4 &t4,
const T5 &t5, const T6 &t6, const T7 &t7, const T8 &t8, const T9 &t9)
{ return Base::template create_attribute<0>(t1, t2, t3, t4, t5, t6, t7,
t8, t9); }
#endif // CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES
/**
* Create a new dart associated with an handle through an attribute.