mirror of https://github.com/CGAL/cgal
Merge branch 'Combinatorial_map_dynamic_onsplit_onmerge_functors-gdamiand'
Approved by the release manager
This commit is contained in:
commit
bef0f03f19
|
|
@ -11,9 +11,7 @@ Returns a handle on one dart belonging to the new 0-cell.
|
||||||
See example in \cgalFigureRef{figinsertvertex}.
|
See example in \cgalFigureRef{figinsertvertex}.
|
||||||
|
|
||||||
If 1-attributes are non `void`,
|
If 1-attributes are non `void`,
|
||||||
\ref CellAttribute::On_split "Attribute_type<1>::type::On_split"(<I>a</I>,<I>a'</I>) is called,
|
\ref CellAttribute::On_split "Attribute_type<1>::type::On_split"(<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>.
|
||||||
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.
|
|
||||||
|
|
||||||
\sa `CGAL::insert_cell_0_in_cell_2<CMap>`
|
\sa `CGAL::insert_cell_0_in_cell_2<CMap>`
|
||||||
\sa `CGAL::insert_cell_1_in_cell_2<CMap>`
|
\sa `CGAL::insert_cell_1_in_cell_2<CMap>`
|
||||||
|
|
@ -42,9 +40,7 @@ Returns a handle on one dart belonging to the new 0-cell.
|
||||||
See example in \cgalFigureRef{figtriangulate}.
|
See example in \cgalFigureRef{figtriangulate}.
|
||||||
|
|
||||||
If 2-attributes are non `void`,
|
If 2-attributes are non `void`,
|
||||||
\ref CellAttribute::On_split "Attribute_type<2>::type::On_split"(<I>a</I>,<I>a'</I>) is called,
|
\ref CellAttribute::On_split "Attribute_type<2>::type::On_split"(<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>.
|
||||||
with <I>a</I> the original 2-attribute associated
|
|
||||||
with `dh` and <I>a'</I> each new 2-attribute created during the operation.
|
|
||||||
|
|
||||||
|
|
||||||
\sa `CGAL::insert_cell_0_in_cell_2<CMap>`
|
\sa `CGAL::insert_cell_0_in_cell_2<CMap>`
|
||||||
|
|
@ -72,10 +68,7 @@ Returns \f$ \beta_0\f$(`dh1`), a handle on one dart belonging to the new 1-cell.
|
||||||
|
|
||||||
See example in \cgalFigureRef{figinsertedge}.
|
See example in \cgalFigureRef{figinsertedge}.
|
||||||
|
|
||||||
If 2-attributes are non `void`,
|
If 2-attributes are non `void`, \ref CellAttribute::On_split "Attribute_type<2>::type::On_split"(<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>.
|
||||||
\ref CellAttribute::On_split "Attribute_type<2>::type::On_split"(<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.
|
|
||||||
|
|
||||||
|
|
||||||
\sa `CGAL::is_insertable_cell_1_in_cell_2<CMap>`
|
\sa `CGAL::is_insertable_cell_1_in_cell_2<CMap>`
|
||||||
|
|
@ -105,10 +98,7 @@ Returns a handle on one dart belonging to the new 2-cell.
|
||||||
|
|
||||||
See example in \cgalFigureRef{figinsertface}.
|
See example in \cgalFigureRef{figinsertface}.
|
||||||
|
|
||||||
If 3-attributes are non `void`,
|
If 3-attributes are non `void`, \ref CellAttribute::On_split "Attribute_type<3>::type::On_split"(<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>.
|
||||||
\ref CellAttribute::On_split "Attribute_type<3>::type::On_split"(<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.
|
|
||||||
|
|
||||||
|
|
||||||
\sa `CGAL::is_insertable_cell_2_in_cell_3<CMap,InputIterator>`
|
\sa `CGAL::is_insertable_cell_2_in_cell_3<CMap,InputIterator>`
|
||||||
|
|
@ -236,17 +226,9 @@ Returns the number of darts removed from `cm`.
|
||||||
|
|
||||||
See examples in \cgalFigureRef{figinsertvertex}, \cgalFigureRef{figinsertedge} and \cgalFigureRef{figinsertface}.
|
See examples in \cgalFigureRef{figinsertvertex}, \cgalFigureRef{figinsertedge} and \cgalFigureRef{figinsertface}.
|
||||||
|
|
||||||
If `i`\f$ <\f$\ref CombinatorialMap::dimension "CMap::dimension", and <I>i+1</I>-attributes are
|
If `i`\f$ <\f$\ref CombinatorialMap::dimension "CMap::dimension", and <I>i+1</I>-attributes are non `void`, and if there are two distinct (<I>i+1</I>)-cells around dart `dh`, \ref CellAttribute::On_merge "Attribute_type<i+1>::type::On_merge"(<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>.
|
||||||
non `void`, and if there are two distinct (<I>i+1</I>)-cells around dart
|
|
||||||
`dh`, \ref CellAttribute::On_merge "Attribute_type<i+1>::type::On_merge"(<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 a <I>j</I>-cell is disconnected in two <I>j</I>-cells during the
|
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, \ref CellAttribute::On_split "Attribute_type<j>::type::On_split"(<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>.
|
||||||
operation, and if <I>j</I>-attributes are non void,
|
|
||||||
\ref CellAttribute::On_split "Attribute_type<j>::type::On_split"(<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.
|
|
||||||
|
|
||||||
\sa `CGAL::is_removable<CMap,i>`
|
\sa `CGAL::is_removable<CMap,i>`
|
||||||
\sa `CGAL::insert_cell_0_in_cell_1<CMap>`
|
\sa `CGAL::insert_cell_0_in_cell_1<CMap>`
|
||||||
|
|
|
||||||
|
|
@ -726,6 +726,8 @@ before to start the operation (i.e.\ before modifying the combinatorial
|
||||||
map), and `OnSplit` is called when the operation is finished
|
map), and `OnSplit` is called when the operation is finished
|
||||||
(i.e.\ after all the modifications were made).
|
(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 CombinatorialMap::onmerge_function() `onmerge_function()`\endlink and \link CombinatorialMap::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
|
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
|
combinatorial map can be used with any user defined model of the
|
||||||
`CellAttribute` concept.
|
`CellAttribute` concept.
|
||||||
|
|
@ -956,7 +958,7 @@ These methods guarantee that given a valid combinatorial map and a
|
||||||
possible operation we obtain a valid combinatorial map as result of
|
possible operation we obtain a valid combinatorial map as result of
|
||||||
the operation.
|
the operation.
|
||||||
|
|
||||||
\cgalAdvancedBegin
|
\cgalAdvancedBegin
|
||||||
The \ref CombinatorialMap::link_beta "link_beta" and
|
The \ref CombinatorialMap::link_beta "link_beta" and
|
||||||
\ref CombinatorialMap::unlink_beta "unlink_beta" methods only modify
|
\ref CombinatorialMap::unlink_beta "unlink_beta" methods only modify
|
||||||
the pointer of two darts: the obtained combinatorial maps may be not
|
the pointer of two darts: the obtained combinatorial maps may be not
|
||||||
|
|
@ -1405,6 +1407,19 @@ 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
|
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.
|
four 2-attributes having respectively 2, 2, 5 and 10 as values.
|
||||||
|
|
||||||
|
\subsection sseccombimapdynamicattibute Use of Dynamic Onmerge and Onsplit Functors
|
||||||
|
|
||||||
|
In the following example, we show an example of use of dynamic onmerge and onsplit functor. We define our 3D combinatorial map with 2-attributes. Then we create two hexahedra and create all the 2-attributes. We initialize the info of the faces of the first hexahedron to 7 and the info of the faces of the second hexahedron to 13.
|
||||||
|
|
||||||
|
Step 3 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 sew<3> operation calls 1 onmerge as two faces are identified; the insert_cell_0_in_cell_2 operation calls 4 onsplit as one face is split in 4.
|
||||||
|
|
||||||
|
Lastly we remove the dynamic onmerge functor (step 8). 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.
|
||||||
|
|
||||||
|
\cgalExample{Combinatorial_map/map_3_dynamic_onmerge.cpp}
|
||||||
|
|
||||||
|
|
||||||
\section sec_definition Mathematical Definitions
|
\section sec_definition Mathematical Definitions
|
||||||
|
|
||||||
The initial definition of combinatorial map in any dimension is given
|
The initial definition of combinatorial map in any dimension is given
|
||||||
|
|
|
||||||
|
|
@ -544,6 +544,7 @@ void swap(CombinatorialMap& cmap);
|
||||||
|
|
||||||
/// \name Operations
|
/// \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$
|
Links by \f$ \beta_i\f$
|
||||||
|
|
@ -566,7 +567,7 @@ 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
|
the darts of the resulting cell. When the two attributes are non
|
||||||
NULL, functor \ref CellAttribute::On_merge "Attribute_type<i>::type::On_merge"
|
NULL, functor \ref CellAttribute::On_merge "Attribute_type<i>::type::On_merge"
|
||||||
is called on
|
is called on
|
||||||
the two attributes <I>attr1</I> and <I>attr2</I>. Then, the attribute
|
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>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.
|
<I>j</I>-cell. Finally, attribute <I>attr2</I> is removed from the combinatorial map.
|
||||||
\pre \ref CombinatorialMap::is_sewable "is_sewable<i>(dh1,dh2)".
|
\pre \ref CombinatorialMap::is_sewable "is_sewable<i>(dh1,dh2)".
|
||||||
|
|
@ -593,7 +594,7 @@ this attribute is duplicated into <I>attr2</I>, and all the darts
|
||||||
belonging to <I>c2</I> are associated with this new attribute. Finally,
|
belonging to <I>c2</I> are associated with this new attribute. Finally,
|
||||||
the functor \ref CellAttribute::On_split "Attribute_type<i>::type::On_split"
|
the functor \ref CellAttribute::On_split "Attribute_type<i>::type::On_split"
|
||||||
is called on the
|
is called on the
|
||||||
two attributes <I>attr1</I> and <I>attr2</I>.
|
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$\ref CombinatorialMap::dimension "dimension",
|
\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.
|
`*dh`\f$ \in\f$`darts()` and `*dh` is not <I>i</I>-free.
|
||||||
|
|
||||||
|
|
@ -630,6 +631,49 @@ template <unsigned int i> void unlink_beta(Dart_handle dh);
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
|
/// \name Dynamic Onmerge/Onsplit functors
|
||||||
|
/// @{
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Return the current dynamic onsplit function associated with i-attributes.
|
||||||
|
This is a boost:function returning void and having two references to \link CombinatorialMap::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>
|
||||||
|
boost::function<void(typename Attribute_type< i >::type&,
|
||||||
|
typename Attribute_type< i >::type&)>&
|
||||||
|
onsplit_function();
|
||||||
|
|
||||||
|
/*!
|
||||||
|
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 CombinatorialMap::Attribute_type `Attribute_type<i>::type`\endlink as parameters.
|
||||||
|
*/
|
||||||
|
template<int i>
|
||||||
|
const boost::function<void(typename Attribute_type< i >::type&,
|
||||||
|
typename Attribute_type< i >::type&)>&
|
||||||
|
onsplit_function() const;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Return the current dynamic onmerge function associated with i-attributes.
|
||||||
|
This is a boost:function returning void and having two references to \link CombinatorialMap::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>
|
||||||
|
boost::function<void(typename Attribute_type< i >::type&,
|
||||||
|
typename Attribute_type< i >::type&)>&
|
||||||
|
onmerge_function();
|
||||||
|
|
||||||
|
/*!
|
||||||
|
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 CombinatorialMap::Attribute_type `Attribute_type<i>::type`\endlink as parameters.
|
||||||
|
*/
|
||||||
|
template<int i>
|
||||||
|
const boost::function<void(typename Attribute_type< i >::type&,
|
||||||
|
typename Attribute_type< i >::type&)>&
|
||||||
|
onmerge_function() const;
|
||||||
|
|
||||||
|
/// @}
|
||||||
|
|
||||||
/// \name Boolean Marks
|
/// \name Boolean Marks
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,4 +4,5 @@
|
||||||
\example Combinatorial_map/map_3_operations.cpp
|
\example Combinatorial_map/map_3_operations.cpp
|
||||||
\example Combinatorial_map/map_4_simple_example.cpp
|
\example Combinatorial_map/map_4_simple_example.cpp
|
||||||
\example Combinatorial_map/map_3_with_colored_facets.cpp
|
\example Combinatorial_map/map_3_with_colored_facets.cpp
|
||||||
|
\example Combinatorial_map/map_3_dynamic_onmerge.cpp
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,135 @@
|
||||||
|
#include <CGAL/Combinatorial_map.h>
|
||||||
|
#include <CGAL/Combinatorial_map_constructors.h>
|
||||||
|
#include <CGAL/Combinatorial_map_operations.h>
|
||||||
|
#include <CGAL/Cell_attribute.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
|
// My item class: no functor is associated with Face_attribute.
|
||||||
|
struct Myitem
|
||||||
|
{
|
||||||
|
template<class CMap>
|
||||||
|
struct Dart_wrapper
|
||||||
|
{
|
||||||
|
typedef CGAL::Dart<3, CMap> Dart;
|
||||||
|
typedef CGAL::Cell_attribute<CMap, int> Face_attribute;
|
||||||
|
typedef CGAL::cpp11::tuple<void,void,Face_attribute> Attributes;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
// Definition of my combinatorial map.
|
||||||
|
typedef CGAL::Combinatorial_map<3,Myitem> CMap_3;
|
||||||
|
typedef CMap_3::Dart_handle Dart_handle;
|
||||||
|
typedef CMap_3::Attribute_type<2>::type Face_attribute;
|
||||||
|
|
||||||
|
// Functor called when two faces are merged.
|
||||||
|
struct Merge_functor
|
||||||
|
{
|
||||||
|
// operator() automatically called before a merge.
|
||||||
|
void operator()(Face_attribute& ca1, Face_attribute& ca2)
|
||||||
|
{
|
||||||
|
ca1.info()=ca1.info()+ca2.info();
|
||||||
|
std::cout<<"After on merge faces: info of face1="<<ca1.info()
|
||||||
|
<<", info of face2="<<ca2.info()<<std::endl;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Functor called when one face is split in two.
|
||||||
|
struct Split_functor
|
||||||
|
{
|
||||||
|
Split_functor(CMap_3& amap) : mmap(amap)
|
||||||
|
{}
|
||||||
|
|
||||||
|
// operator() automatically called after a split.
|
||||||
|
void operator()(Face_attribute& ca1, Face_attribute& ca2)
|
||||||
|
{
|
||||||
|
set_color_of_face(ca1.dart());
|
||||||
|
set_color_of_face(ca2.dart());
|
||||||
|
std::cout<<"After on split faces: info of face1="<<ca1.info()
|
||||||
|
<<", info of face2="<<ca2.info()<<std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// The info of a face is the mean of the info of all its neighboors faces.
|
||||||
|
void set_color_of_face(CMap_3::Dart_handle dh)
|
||||||
|
{
|
||||||
|
int nb=0;
|
||||||
|
int sum=0;
|
||||||
|
for (CMap_3::Dart_of_orbit_range<1>::iterator
|
||||||
|
it=mmap.darts_of_orbit<1>(dh).begin(),
|
||||||
|
itend=mmap.darts_of_orbit<1>(dh).end();
|
||||||
|
it!=itend; ++it, ++nb)
|
||||||
|
{ sum+=it->beta<2>()->attribute<2>()->info(); }
|
||||||
|
|
||||||
|
dh->attribute<2>()->info()=(sum/nb);
|
||||||
|
}
|
||||||
|
|
||||||
|
CMap_3& mmap;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Function allowing to display all the 2-attributes, and the characteristics
|
||||||
|
// of a given combinatorial map.
|
||||||
|
void display_map_and_2attributes(CMap_3& cm)
|
||||||
|
{
|
||||||
|
for (CMap_3::Attribute_range<2>::type::iterator
|
||||||
|
it=cm.attributes<2>().begin(), itend=cm.attributes<2>().end();
|
||||||
|
it!=itend; ++it)
|
||||||
|
{
|
||||||
|
std::cout<<it->info()<<"; ";
|
||||||
|
}
|
||||||
|
std::cout<<std::endl;
|
||||||
|
cm.display_characteristics(std::cout);
|
||||||
|
std::cout<<", valid="<<cm.is_valid()<<std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
CMap_3 cm;
|
||||||
|
|
||||||
|
// 0) Create 2 hexahedra.
|
||||||
|
Dart_handle dh1 = CGAL::make_combinatorial_hexahedron(cm);
|
||||||
|
Dart_handle dh2 = CGAL::make_combinatorial_hexahedron(cm);
|
||||||
|
|
||||||
|
// 1) Create 2-attributes of the first hexahedron, info()==7.
|
||||||
|
for (CMap_3::One_dart_per_incident_cell_range<2, 3>::iterator
|
||||||
|
it=cm.one_dart_per_incident_cell<2,3>(dh1).begin(),
|
||||||
|
itend=cm.one_dart_per_incident_cell<2,3>(dh1).end(); it!=itend; ++it)
|
||||||
|
{ cm.set_attribute<2>(it, cm.create_attribute<2>(7)); }
|
||||||
|
|
||||||
|
// 2) Create 2-attributes of the second hexahedron, info()==13.
|
||||||
|
for (CMap_3::One_dart_per_incident_cell_range<2, 3>::iterator it=
|
||||||
|
cm.one_dart_per_incident_cell<2,3>(dh2).begin(),
|
||||||
|
itend=cm.one_dart_per_incident_cell<2,3>(dh2).end(); it!=itend; ++it)
|
||||||
|
{ cm.set_attribute<2>(it, cm.create_attribute<2>(13)); }
|
||||||
|
|
||||||
|
// 3) Set the onsplit and onmerge functors.
|
||||||
|
cm.onsplit_functor<2>()=Split_functor(cm);
|
||||||
|
cm.onmerge_functor<2>()=Merge_functor();
|
||||||
|
|
||||||
|
// 4) 3-Sew the two hexahedra along one face. This calls 1 onmerge.
|
||||||
|
cm.sew<3>(dh1, dh2);
|
||||||
|
|
||||||
|
// 5) Display all the values of 2-attributes.
|
||||||
|
display_map_and_2attributes(cm);
|
||||||
|
|
||||||
|
// 6) Insert a vertex in the face between the two hexahedra.
|
||||||
|
// This calls 4 onsplit.
|
||||||
|
Dart_handle resdart=CGAL::insert_cell_0_in_cell_2(cm, dh2);
|
||||||
|
|
||||||
|
// 7) Display all the values of 2-attributes.
|
||||||
|
display_map_and_2attributes(cm);
|
||||||
|
|
||||||
|
// 8) "Remove" the dynamic onmerge functor.
|
||||||
|
cm.onmerge_functor<2>()=boost::function<void(Face_attribute&,
|
||||||
|
Face_attribute&)>();
|
||||||
|
|
||||||
|
// 9) Remove one edge: this merges two faces, however no dynamic
|
||||||
|
// functor is called (because it was removed).
|
||||||
|
CGAL::remove_cell<CMap_3, 1>(cm, resdart);
|
||||||
|
|
||||||
|
// 10) Display all the values of 2-attributes.
|
||||||
|
display_map_and_2attributes(cm);
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
@ -1265,7 +1265,7 @@ namespace CGAL {
|
||||||
{
|
{
|
||||||
CGAL_static_assertion_msg(Helper::template Dimension_index<i>::value>=0,
|
CGAL_static_assertion_msg(Helper::template Dimension_index<i>::value>=0,
|
||||||
"number_of_attributes<i> but i-attributes are disabled");
|
"number_of_attributes<i> but i-attributes are disabled");
|
||||||
return CGAL::cpp11::get<Helper::template Dimension_index<i>::value>
|
return CGAL::cpp11::get<Helper::template Dimension_index<i>::value>
|
||||||
(mattribute_containers).size();
|
(mattribute_containers).size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1316,14 +1316,30 @@ namespace CGAL {
|
||||||
"i-attributes are disabled");
|
"i-attributes are disabled");
|
||||||
|
|
||||||
return CGAL::cpp11::get<Helper::template Dimension_index<i>::value>
|
return CGAL::cpp11::get<Helper::template Dimension_index<i>::value>
|
||||||
(m_onsplit_functors);
|
(m_onsplit_functors);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the ith dynamic onsplit functor (by reference so that we can
|
||||||
|
// modify it directly).
|
||||||
|
template<int i>
|
||||||
|
const boost::function<void(typename Attribute_type<i>::type&,
|
||||||
|
typename Attribute_type<i>::type&)>&
|
||||||
|
onsplit_functor() const
|
||||||
|
{
|
||||||
|
CGAL_static_assertion_msg
|
||||||
|
(Helper::template Dimension_index<i>::value>=0,
|
||||||
|
"onsplit_functor<i> but "
|
||||||
|
"i-attributes are disabled");
|
||||||
|
|
||||||
|
return CGAL::cpp11::get<Helper::template Dimension_index<i>::value>
|
||||||
|
(m_onsplit_functors);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the ith dynamic onmerge functor (by reference so that we can
|
// Get the ith dynamic onmerge functor (by reference so that we can
|
||||||
// modify it directly).
|
// modify it directly).
|
||||||
template<int i>
|
template<int i>
|
||||||
boost::function<void(typename Attribute_type<i>::type&,
|
boost::function<void(typename Attribute_type<i>::type&,
|
||||||
typename Attribute_type<i>::type&)>&
|
typename Attribute_type<i>::type&)>&
|
||||||
onmerge_functor()
|
onmerge_functor()
|
||||||
{
|
{
|
||||||
CGAL_static_assertion_msg
|
CGAL_static_assertion_msg
|
||||||
|
|
@ -1332,9 +1348,23 @@ namespace CGAL {
|
||||||
"i-attributes are disabled");
|
"i-attributes are disabled");
|
||||||
|
|
||||||
return CGAL::cpp11::get<Helper::template Dimension_index<i>::value>
|
return CGAL::cpp11::get<Helper::template Dimension_index<i>::value>
|
||||||
(m_onmerge_functors);
|
(m_onmerge_functors);
|
||||||
}
|
}
|
||||||
|
// Get the ith dynamic onmerge functor (by reference so that we can
|
||||||
|
// modify it directly).
|
||||||
|
template<int i>
|
||||||
|
const boost::function<void(typename Attribute_type<i>::type&,
|
||||||
|
typename Attribute_type<i>::type&)>&
|
||||||
|
onmerge_functor() const
|
||||||
|
{
|
||||||
|
CGAL_static_assertion_msg
|
||||||
|
(Helper::template Dimension_index<i>::value>=0,
|
||||||
|
"onsplit_functor<i> but "
|
||||||
|
"i-attributes are disabled");
|
||||||
|
|
||||||
|
return CGAL::cpp11::get<Helper::template Dimension_index<i>::value>
|
||||||
|
(m_onmerge_functors);
|
||||||
|
}
|
||||||
|
|
||||||
/** Double link a dart with beta 0 to a second dart.
|
/** Double link a dart with beta 0 to a second dart.
|
||||||
* \em adart1 is 0-linked to \em adart2 and \em adart2 is 1-linked
|
* \em adart1 is 0-linked to \em adart2 and \em adart2 is 1-linked
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,9 @@
|
||||||
*
|
*
|
||||||
* Set_i_attribute_functor<CMap, i> to set the i-attribute of a given
|
* Set_i_attribute_functor<CMap, i> to set the i-attribute of a given
|
||||||
* i-cell.
|
* i-cell.
|
||||||
|
*
|
||||||
|
* Test_is_valid_attribute_functor<CMap> to test if an attribute is valid
|
||||||
|
* (used with Foreach_enabled_attributes)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace CGAL
|
namespace CGAL
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,7 @@ struct Get_convert_attribute_functor
|
||||||
{
|
{
|
||||||
static typename Map2::template Attribute_handle<i>::type
|
static typename Map2::template Attribute_handle<i>::type
|
||||||
run( const Map1* cmap1, Map2* cmap2, typename Map1::Dart_const_handle dh1,
|
run( const Map1* cmap1, Map2* cmap2, typename Map1::Dart_const_handle dh1,
|
||||||
typename Map2::Dart_handle dh2, const Converters& converters)
|
typename Map2::Dart_handle dh2, const Converters& /*converters*/)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
CGAL::Default_converter_cmap_attributes<Map1, Map2, i>()
|
CGAL::Default_converter_cmap_attributes<Map1, Map2, i>()
|
||||||
|
|
|
||||||
|
|
@ -77,64 +77,21 @@ namespace CGAL
|
||||||
// ****************************************************************************
|
// ****************************************************************************
|
||||||
namespace internal
|
namespace internal
|
||||||
{
|
{
|
||||||
// Struct to test if the given class has a functor with a map as first
|
|
||||||
// parameter.
|
|
||||||
template <typename CMap, typename Attribute, typename Functor>
|
|
||||||
struct FuctorWithMap
|
|
||||||
{
|
|
||||||
template <typename T, T> struct TypeCheck;
|
|
||||||
|
|
||||||
typedef char Yes;
|
|
||||||
struct No{ char c[2]; };
|
|
||||||
|
|
||||||
template <typename T> struct Fct
|
|
||||||
{
|
|
||||||
// The function we want to test.
|
|
||||||
typedef void (T::*fptr)(CMap*, Attribute&, Attribute&);
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
static Yes
|
|
||||||
HasFunctorWithMap(TypeCheck< typename Fct<T>::fptr, &T::operator() >*);
|
|
||||||
template <typename T> static No HasFunctorWithMap(...);
|
|
||||||
|
|
||||||
public:
|
|
||||||
static bool const
|
|
||||||
value=(sizeof(HasFunctorWithMap<Functor>(0))==sizeof(Yes));
|
|
||||||
};
|
|
||||||
// ****************************************************************************
|
// ****************************************************************************
|
||||||
// Functor which call Functor::operator() on the two given cell_attributes
|
// Functor which call Functor::operator() on the two given cell_attributes
|
||||||
template<typename CMap, typename Cell_attribute, typename Functor,
|
template<typename CMap, typename Cell_attribute, typename Functor>
|
||||||
bool FunctorWithMap=
|
|
||||||
FuctorWithMap<CMap, Cell_attribute, Functor>::value>
|
|
||||||
struct Apply_cell_functor
|
struct Apply_cell_functor
|
||||||
{
|
{
|
||||||
static void run(CMap*, Cell_attribute& acell1, Cell_attribute& acell2)
|
static void run(Cell_attribute& acell1, Cell_attribute& acell2)
|
||||||
{
|
{
|
||||||
Functor() (acell1,acell2);
|
Functor() (acell1, acell2);
|
||||||
}
|
|
||||||
};
|
|
||||||
template<typename CMap, typename Cell_attribute, typename Functor>
|
|
||||||
struct Apply_cell_functor<CMap, Cell_attribute, Functor, true>
|
|
||||||
{
|
|
||||||
static void run(CMap* amap, Cell_attribute& acell1, Cell_attribute& acell2)
|
|
||||||
{
|
|
||||||
Functor() (amap, acell1, acell2);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
//...except for Null_functor.
|
//...except for Null_functor.
|
||||||
template<typename CMap, typename Cell_attribute, bool FunctorWithMap>
|
|
||||||
struct Apply_cell_functor<CMap, Cell_attribute, CGAL::Null_functor,
|
|
||||||
FunctorWithMap>
|
|
||||||
{
|
|
||||||
static void run(CMap*, Cell_attribute&, Cell_attribute&)
|
|
||||||
{}
|
|
||||||
};
|
|
||||||
//...even with true.
|
|
||||||
template<typename CMap, typename Cell_attribute>
|
template<typename CMap, typename Cell_attribute>
|
||||||
struct Apply_cell_functor<CMap, Cell_attribute, CGAL::Null_functor, true>
|
struct Apply_cell_functor<CMap, Cell_attribute, CGAL::Null_functor>
|
||||||
{
|
{
|
||||||
static void run(CMap*, Cell_attribute&, Cell_attribute&)
|
static void run(Cell_attribute&, Cell_attribute&)
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
// ****************************************************************************
|
// ****************************************************************************
|
||||||
|
|
@ -155,15 +112,15 @@ struct Call_split_functor
|
||||||
{
|
{
|
||||||
// Static version
|
// Static version
|
||||||
CGAL::internal::Apply_cell_functor<CMap, Attribute, On_split>::
|
CGAL::internal::Apply_cell_functor<CMap, Attribute, On_split>::
|
||||||
run(amap, *(adart1->template attribute<i>()),
|
run(*(adart1->template attribute<i>()),
|
||||||
*(adart2->template attribute<i>()));
|
*(adart2->template attribute<i>()));
|
||||||
// Dynamic version
|
// Dynamic version
|
||||||
if ( CGAL::cpp11::get<CMap::Helper::template Dimension_index<i>::value>
|
if ( CGAL::cpp11::get<CMap::Helper::template Dimension_index<i>::value>
|
||||||
(amap->m_onsplit_functors) )
|
(amap->m_onsplit_functors) )
|
||||||
CGAL::cpp11::get<CMap::Helper::template Dimension_index<i>::value>
|
CGAL::cpp11::get<CMap::Helper::template Dimension_index<i>::value>
|
||||||
(amap->m_onsplit_functors)
|
(amap->m_onsplit_functors)
|
||||||
(*(adart1->template attribute<i>()),
|
(*(adart1->template attribute<i>()),
|
||||||
*(adart2->template attribute<i>()));
|
*(adart2->template attribute<i>()));
|
||||||
}
|
}
|
||||||
static void
|
static void
|
||||||
run(CMap* amap, typename CMap::template Attribute_handle<i>::type a1,
|
run(CMap* amap, typename CMap::template Attribute_handle<i>::type a1,
|
||||||
|
|
@ -171,12 +128,12 @@ struct Call_split_functor
|
||||||
{
|
{
|
||||||
// Static version
|
// Static version
|
||||||
CGAL::internal::Apply_cell_functor<CMap, Attribute, On_split>::
|
CGAL::internal::Apply_cell_functor<CMap, Attribute, On_split>::
|
||||||
run(amap, *a1, *a2);
|
run(*a1, *a2);
|
||||||
// Dynamic version
|
// Dynamic version
|
||||||
if ( CGAL::cpp11::get<CMap::Helper::template Dimension_index<i>::value>
|
if ( CGAL::cpp11::get<CMap::Helper::template Dimension_index<i>::value>
|
||||||
(amap->m_onsplit_functors) )
|
(amap->m_onsplit_functors) )
|
||||||
CGAL::cpp11::get<CMap::Helper::template Dimension_index<i>::value>
|
CGAL::cpp11::get<CMap::Helper::template Dimension_index<i>::value>
|
||||||
(amap->m_onsplit_functors)(*a1, *a2);
|
(amap->m_onsplit_functors) (*a1, *a2);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// Specialization for disabled attributes.
|
// Specialization for disabled attributes.
|
||||||
|
|
@ -205,15 +162,15 @@ struct Call_merge_functor
|
||||||
{
|
{
|
||||||
// Static version
|
// Static version
|
||||||
CGAL::internal::Apply_cell_functor<CMap, Attribute, On_merge>::
|
CGAL::internal::Apply_cell_functor<CMap, Attribute, On_merge>::
|
||||||
run(amap, *(adart1->template attribute<i>()),
|
run(*(adart1->template attribute<i>()),
|
||||||
*(adart2->template attribute<i>()));
|
*(adart2->template attribute<i>()));
|
||||||
// Dynamic version
|
// Dynamic version
|
||||||
if ( CGAL::cpp11::get<CMap::Helper::template Dimension_index<i>::value>
|
if ( CGAL::cpp11::get<CMap::Helper::template Dimension_index<i>::value>
|
||||||
(amap->m_onmerge_functors) )
|
(amap->m_onmerge_functors) )
|
||||||
CGAL::cpp11::get<CMap::Helper::template Dimension_index<i>::value>
|
CGAL::cpp11::get<CMap::Helper::template Dimension_index<i>::value>
|
||||||
(amap->m_onmerge_functors)
|
(amap->m_onmerge_functors)
|
||||||
(*(adart1->template attribute<i>()),
|
(*(adart1->template attribute<i>()),
|
||||||
*(adart2->template attribute<i>()));
|
*(adart2->template attribute<i>()));
|
||||||
}
|
}
|
||||||
static void
|
static void
|
||||||
run(CMap* amap, typename CMap::template Attribute_handle<i>::type a1,
|
run(CMap* amap, typename CMap::template Attribute_handle<i>::type a1,
|
||||||
|
|
@ -221,12 +178,12 @@ struct Call_merge_functor
|
||||||
{
|
{
|
||||||
// Static version
|
// Static version
|
||||||
CGAL::internal::Apply_cell_functor<CMap, Attribute, On_merge>::
|
CGAL::internal::Apply_cell_functor<CMap, Attribute, On_merge>::
|
||||||
run(amap, *a1, *a2);
|
run(*a1, *a2);
|
||||||
// Dynamic version
|
// Dynamic version
|
||||||
if ( CGAL::cpp11::get<CMap::Helper::template Dimension_index<i>::value>
|
if ( CGAL::cpp11::get<CMap::Helper::template Dimension_index<i>::value>
|
||||||
(amap->m_onmerge_functors) )
|
(amap->m_onmerge_functors) )
|
||||||
CGAL::cpp11::get<CMap::Helper::template Dimension_index<i>::value>
|
CGAL::cpp11::get<CMap::Helper::template Dimension_index<i>::value>
|
||||||
(amap->m_onmerge_functors)(*a1, *a2);
|
(amap->m_onmerge_functors) (*a1, *a2);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// Specialization for disabled attributes.
|
// Specialization for disabled attributes.
|
||||||
|
|
|
||||||
|
|
@ -8,55 +8,6 @@
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
struct f1
|
|
||||||
{
|
|
||||||
template<typename Attr>
|
|
||||||
void operator() (Attr&, Attr&)
|
|
||||||
{}
|
|
||||||
};
|
|
||||||
struct f2
|
|
||||||
{
|
|
||||||
template<typename Attr>
|
|
||||||
void operator() (const Attr&, Attr&)
|
|
||||||
{}
|
|
||||||
};
|
|
||||||
struct f3
|
|
||||||
{
|
|
||||||
template<typename Attr>
|
|
||||||
void operator() (Attr&, const Attr&)
|
|
||||||
{}
|
|
||||||
};
|
|
||||||
struct f4
|
|
||||||
{
|
|
||||||
template<typename Attr>
|
|
||||||
void operator() (const Attr&, const Attr&)
|
|
||||||
{}
|
|
||||||
};
|
|
||||||
struct f5
|
|
||||||
{
|
|
||||||
template<typename Attr>
|
|
||||||
void operator() (const Attr&, const Attr&)
|
|
||||||
{}
|
|
||||||
template<typename Attr>
|
|
||||||
void operator() (Attr&, const Attr&)
|
|
||||||
{}
|
|
||||||
};
|
|
||||||
struct f6
|
|
||||||
{
|
|
||||||
template<typename CMap, typename Attr>
|
|
||||||
void operator() (CMap*, Attr&, Attr&)
|
|
||||||
{}
|
|
||||||
};
|
|
||||||
struct f7
|
|
||||||
{
|
|
||||||
template<typename Attr>
|
|
||||||
void operator() (Attr&, const Attr&)
|
|
||||||
{}
|
|
||||||
template<typename CMap, typename Attr>
|
|
||||||
void operator() (CMap*, Attr&, Attr&)
|
|
||||||
{}
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Map_2_dart_items
|
struct Map_2_dart_items
|
||||||
{
|
{
|
||||||
/// Dart_wrapper defines the type of darts used.
|
/// Dart_wrapper defines the type of darts used.
|
||||||
|
|
@ -65,8 +16,8 @@ struct Map_2_dart_items
|
||||||
{
|
{
|
||||||
typedef CGAL::Dart< 2, Refs > Dart;
|
typedef CGAL::Dart< 2, Refs > Dart;
|
||||||
|
|
||||||
typedef CGAL::Cell_attribute< Refs, int, CGAL::Tag_true, f1, f2 > Int_attrib;
|
typedef CGAL::Cell_attribute< Refs, int, CGAL::Tag_true > Int_attrib;
|
||||||
typedef CGAL::Cell_attribute< Refs, double, CGAL::Tag_true, f3, f4 > Double_attrib;
|
typedef CGAL::Cell_attribute< Refs, double, CGAL::Tag_true > Double_attrib;
|
||||||
|
|
||||||
typedef CGAL::cpp11::tuple<Double_attrib, void, Double_attrib> Attributes;
|
typedef CGAL::cpp11::tuple<Double_attrib, void, Double_attrib> Attributes;
|
||||||
};
|
};
|
||||||
|
|
@ -80,8 +31,8 @@ struct Map_2_dart_max_items_3
|
||||||
{
|
{
|
||||||
typedef CGAL::Dart< 2, Refs > Dart;
|
typedef CGAL::Dart< 2, Refs > Dart;
|
||||||
|
|
||||||
typedef CGAL::Cell_attribute< Refs, int, CGAL::Tag_true, f1, f2 > Int_attrib;
|
typedef CGAL::Cell_attribute< Refs, int, CGAL::Tag_true > Int_attrib;
|
||||||
typedef CGAL::Cell_attribute< Refs, double, CGAL::Tag_true, f3, f4 > Double_attrib;
|
typedef CGAL::Cell_attribute< Refs, double, CGAL::Tag_true > Double_attrib;
|
||||||
|
|
||||||
typedef CGAL::cpp11::tuple<Int_attrib, Int_attrib,
|
typedef CGAL::cpp11::tuple<Int_attrib, Int_attrib,
|
||||||
Double_attrib> Attributes;
|
Double_attrib> Attributes;
|
||||||
|
|
@ -96,8 +47,8 @@ struct Map_3_dart_items_3
|
||||||
{
|
{
|
||||||
typedef CGAL::Dart< 3, Refs > Dart;
|
typedef CGAL::Dart< 3, Refs > Dart;
|
||||||
|
|
||||||
typedef CGAL::Cell_attribute< Refs, int, CGAL::Tag_true, f5, f6 > Int_attrib;
|
typedef CGAL::Cell_attribute< Refs, int, CGAL::Tag_true > Int_attrib;
|
||||||
typedef CGAL::Cell_attribute< Refs, double, CGAL::Tag_true, f7 > Double_attrib;
|
typedef CGAL::Cell_attribute< Refs, double, CGAL::Tag_true > Double_attrib;
|
||||||
|
|
||||||
typedef CGAL::cpp11::tuple<Double_attrib, void,
|
typedef CGAL::cpp11::tuple<Double_attrib, void,
|
||||||
Int_attrib, Double_attrib> Attributes;
|
Int_attrib, Double_attrib> Attributes;
|
||||||
|
|
@ -112,8 +63,8 @@ struct Map_3_dart_max_items_3
|
||||||
{
|
{
|
||||||
typedef CGAL::Dart< 3, Refs > Dart;
|
typedef CGAL::Dart< 3, Refs > Dart;
|
||||||
|
|
||||||
typedef CGAL::Cell_attribute< Refs, int, CGAL::Tag_true, f5, f6 > Int_attrib;
|
typedef CGAL::Cell_attribute< Refs, int, CGAL::Tag_true > Int_attrib;
|
||||||
typedef CGAL::Cell_attribute< Refs, double, CGAL::Tag_true, f7 > Double_attrib;
|
typedef CGAL::Cell_attribute< Refs, double, CGAL::Tag_true > Double_attrib;
|
||||||
|
|
||||||
typedef CGAL::cpp11::tuple<Int_attrib, Int_attrib,
|
typedef CGAL::cpp11::tuple<Int_attrib, Int_attrib,
|
||||||
Int_attrib, Double_attrib> Attributes;
|
Int_attrib, Double_attrib> Attributes;
|
||||||
|
|
|
||||||
|
|
@ -4,55 +4,6 @@
|
||||||
#include "Combinatorial_map_2_test.h"
|
#include "Combinatorial_map_2_test.h"
|
||||||
#include "Combinatorial_map_3_test.h"
|
#include "Combinatorial_map_3_test.h"
|
||||||
|
|
||||||
struct f1
|
|
||||||
{
|
|
||||||
template<typename Attr>
|
|
||||||
void operator() (Attr&, Attr&)
|
|
||||||
{}
|
|
||||||
};
|
|
||||||
struct f2
|
|
||||||
{
|
|
||||||
template<typename Attr>
|
|
||||||
void operator() (const Attr&, Attr&)
|
|
||||||
{}
|
|
||||||
};
|
|
||||||
struct f3
|
|
||||||
{
|
|
||||||
template<typename Attr>
|
|
||||||
void operator() (Attr&, const Attr&)
|
|
||||||
{}
|
|
||||||
};
|
|
||||||
struct f4
|
|
||||||
{
|
|
||||||
template<typename Attr>
|
|
||||||
void operator() (const Attr&, const Attr&)
|
|
||||||
{}
|
|
||||||
};
|
|
||||||
struct f5
|
|
||||||
{
|
|
||||||
template<typename Attr>
|
|
||||||
void operator() (const Attr&, const Attr&)
|
|
||||||
{}
|
|
||||||
template<typename Attr>
|
|
||||||
void operator() (Attr&, const Attr&)
|
|
||||||
{}
|
|
||||||
};
|
|
||||||
struct f6
|
|
||||||
{
|
|
||||||
template<typename CMap, typename Attr>
|
|
||||||
void operator() (CMap*, Attr&, Attr&)
|
|
||||||
{}
|
|
||||||
};
|
|
||||||
struct f7
|
|
||||||
{
|
|
||||||
template<typename Attr>
|
|
||||||
void operator() (Attr&, const Attr&)
|
|
||||||
{}
|
|
||||||
template<typename CMap, typename Attr>
|
|
||||||
void operator() (CMap*, Attr&, Attr&)
|
|
||||||
{}
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Map_2_dart_items
|
struct Map_2_dart_items
|
||||||
{
|
{
|
||||||
/// Dart_wrapper defines the type of darts used.
|
/// Dart_wrapper defines the type of darts used.
|
||||||
|
|
@ -61,8 +12,8 @@ struct Map_2_dart_items
|
||||||
{
|
{
|
||||||
typedef CGAL::Dart< 2, Refs > Dart;
|
typedef CGAL::Dart< 2, Refs > Dart;
|
||||||
|
|
||||||
typedef CGAL::Cell_attribute< Refs, int, CGAL::Tag_true, f1, f2 > Int_attrib;
|
typedef CGAL::Cell_attribute< Refs, int, CGAL::Tag_true > Int_attrib;
|
||||||
typedef CGAL::Cell_attribute< Refs, double, CGAL::Tag_true, f3, f4 > Double_attrib;
|
typedef CGAL::Cell_attribute< Refs, double, CGAL::Tag_true > Double_attrib;
|
||||||
|
|
||||||
typedef CGAL::cpp11::tuple<Double_attrib, void, Double_attrib> Attributes;
|
typedef CGAL::cpp11::tuple<Double_attrib, void, Double_attrib> Attributes;
|
||||||
};
|
};
|
||||||
|
|
@ -76,8 +27,8 @@ struct Map_2_dart_max_items_3
|
||||||
{
|
{
|
||||||
typedef CGAL::Dart< 2, Refs > Dart;
|
typedef CGAL::Dart< 2, Refs > Dart;
|
||||||
|
|
||||||
typedef CGAL::Cell_attribute< Refs, int, CGAL::Tag_true, f1, f2 > Int_attrib;
|
typedef CGAL::Cell_attribute< Refs, int, CGAL::Tag_true > Int_attrib;
|
||||||
typedef CGAL::Cell_attribute< Refs, double, CGAL::Tag_true, f3, f4 > Double_attrib;
|
typedef CGAL::Cell_attribute< Refs, double, CGAL::Tag_true > Double_attrib;
|
||||||
|
|
||||||
typedef CGAL::cpp11::tuple<Int_attrib, Int_attrib,
|
typedef CGAL::cpp11::tuple<Int_attrib, Int_attrib,
|
||||||
Double_attrib> Attributes;
|
Double_attrib> Attributes;
|
||||||
|
|
@ -92,8 +43,8 @@ struct Map_3_dart_items_3
|
||||||
{
|
{
|
||||||
typedef CGAL::Dart< 3, Refs > Dart;
|
typedef CGAL::Dart< 3, Refs > Dart;
|
||||||
|
|
||||||
typedef CGAL::Cell_attribute< Refs, int, CGAL::Tag_true, f5, f6 > Int_attrib;
|
typedef CGAL::Cell_attribute< Refs, int, CGAL::Tag_true > Int_attrib;
|
||||||
typedef CGAL::Cell_attribute< Refs, double, CGAL::Tag_true, f7 > Double_attrib;
|
typedef CGAL::Cell_attribute< Refs, double, CGAL::Tag_true > Double_attrib;
|
||||||
|
|
||||||
typedef CGAL::cpp11::tuple<Double_attrib, void,
|
typedef CGAL::cpp11::tuple<Double_attrib, void,
|
||||||
Int_attrib, Double_attrib> Attributes;
|
Int_attrib, Double_attrib> Attributes;
|
||||||
|
|
@ -108,8 +59,8 @@ struct Map_3_dart_max_items_3
|
||||||
{
|
{
|
||||||
typedef CGAL::Dart< 3, Refs > Dart;
|
typedef CGAL::Dart< 3, Refs > Dart;
|
||||||
|
|
||||||
typedef CGAL::Cell_attribute< Refs, int, CGAL::Tag_true, f5, f6 > Int_attrib;
|
typedef CGAL::Cell_attribute< Refs, int, CGAL::Tag_true > Int_attrib;
|
||||||
typedef CGAL::Cell_attribute< Refs, double, CGAL::Tag_true, f7 > Double_attrib;
|
typedef CGAL::Cell_attribute< Refs, double, CGAL::Tag_true > Double_attrib;
|
||||||
|
|
||||||
typedef CGAL::cpp11::tuple<Int_attrib, Int_attrib,
|
typedef CGAL::cpp11::tuple<Int_attrib, Int_attrib,
|
||||||
Int_attrib, Double_attrib> Attributes;
|
Int_attrib, Double_attrib> Attributes;
|
||||||
|
|
|
||||||
|
|
@ -166,6 +166,7 @@ David A. Wheeler's 'SLOCCount'</a>, restricted to the <code>include/CGAL/</code>
|
||||||
<li>Two bug fixes: do not use the 2 least significant bits for cell attribute without dart support; add share a mark in CMap_cell_iterator.</li>
|
<li>Two bug fixes: do not use the 2 least significant bits for cell attribute without dart support; add share a mark in CMap_cell_iterator.</li>
|
||||||
<li>Add a constructor taking a given combinatorial map as argument, possibly with different dimension and/or different attributes. This allows to transform a combinatorial map. </li>
|
<li>Add a constructor taking a given combinatorial map as argument, possibly with different dimension and/or different attributes. This allows to transform a combinatorial map. </li>
|
||||||
<li>Add operator= and swap method.</li>
|
<li>Add operator= and swap method.</li>
|
||||||
|
<li>Add dynamic onmerge/onsplit functions that can be associated dynamically to i-attributes and which are automatically called when i-cells are split/merged.
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h3>2D Apollonius graphs</h3>
|
<h3>2D Apollonius graphs</h3>
|
||||||
|
|
|
||||||
|
|
@ -145,7 +145,7 @@ namespace CGAL {
|
||||||
{ return !operator==(other); }
|
{ return !operator==(other); }
|
||||||
|
|
||||||
template<typename Cellattr>
|
template<typename Cellattr>
|
||||||
bool operator==(const Cellattr& other) const
|
bool operator==(const Cellattr&) const
|
||||||
{ return false; }
|
{ return false; }
|
||||||
|
|
||||||
// protected:
|
// protected:
|
||||||
|
|
|
||||||
|
|
@ -316,7 +316,7 @@ struct DisplayVertexAttrib
|
||||||
template<typename Map,typename Attr>
|
template<typename Map,typename Attr>
|
||||||
struct DisplayVertexAttrib<Map,Attr,void>
|
struct DisplayVertexAttrib<Map,Attr,void>
|
||||||
{
|
{
|
||||||
static void run(Map& amap)
|
static void run(Map&)
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue