mirror of https://github.com/CGAL/cgal
copy cont
This commit is contained in:
parent
1cc9540daf
commit
6e7babc14b
|
|
@ -119,6 +119,12 @@ namespace CGAL {
|
||||||
bool is_valid() const
|
bool is_valid() const
|
||||||
{ return true; }
|
{ return true; }
|
||||||
|
|
||||||
|
bool operator==(const Cell_attribute_without_info&) const
|
||||||
|
{ return true; }
|
||||||
|
|
||||||
|
bool operator!=(const Cell_attribute_without_info& other) const
|
||||||
|
{ return !operator==(other); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// Contructor without parameter.
|
/// Contructor without parameter.
|
||||||
Cell_attribute_without_info(): mrefcounting(0)
|
Cell_attribute_without_info(): mrefcounting(0)
|
||||||
|
|
@ -221,6 +227,12 @@ namespace CGAL {
|
||||||
bool is_valid() const
|
bool is_valid() const
|
||||||
{ return mdart!=NULL; }
|
{ return mdart!=NULL; }
|
||||||
|
|
||||||
|
bool operator==(const Cell_attribute_without_info&) const
|
||||||
|
{ return true; }
|
||||||
|
|
||||||
|
bool operator!=(const Cell_attribute_without_info& other) const
|
||||||
|
{ return !operator==(other); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// Contructor without parameter.
|
/// Contructor without parameter.
|
||||||
Cell_attribute_without_info() : mdart(NULL),
|
Cell_attribute_without_info() : mdart(NULL),
|
||||||
|
|
@ -326,6 +338,13 @@ namespace CGAL {
|
||||||
typedef OnSplit On_split;
|
typedef OnSplit On_split;
|
||||||
typedef Info_ Info;
|
typedef Info_ Info;
|
||||||
|
|
||||||
|
bool operator==(const Self& other) const
|
||||||
|
{ return this->info()==other.info(); }
|
||||||
|
|
||||||
|
bool operator!=(const Self& other) const
|
||||||
|
{ return !operator==(other); }
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// Default contructor.
|
/// Default contructor.
|
||||||
Cell_attribute()
|
Cell_attribute()
|
||||||
|
|
|
||||||
|
|
@ -191,12 +191,11 @@ struct Cast_converter_cmap_attributes
|
||||||
(const Map1& map1, Map2& map2, typename Map1::Dart_const_handle dh1,
|
(const Map1& map1, Map2& map2, typename Map1::Dart_const_handle dh1,
|
||||||
typename Map2::Dart_handle dh2) const
|
typename Map2::Dart_handle dh2) const
|
||||||
{
|
{
|
||||||
|
typename Map2::template Attribute_handle<i>::type
|
||||||
|
res = map2.template create_attribute<i>();
|
||||||
if ( dh1->template attribute<i>()!=NULL )
|
if ( dh1->template attribute<i>()!=NULL )
|
||||||
return map2.template create_attribute<i>
|
res->info() = dh1->template attribute<i>()->info();
|
||||||
((typename Map2::template Attribute_type<i>::type::Info)
|
return res;
|
||||||
dh1->template attribute<i>()->info());
|
|
||||||
|
|
||||||
return map2.template create_attribute<i>();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// ****************************************************************************
|
// ****************************************************************************
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,8 @@
|
||||||
|
|
||||||
#include <CGAL/Dart_const_iterators.h>
|
#include <CGAL/Dart_const_iterators.h>
|
||||||
#include <CGAL/Combinatorial_map_basic_operations.h>
|
#include <CGAL/Combinatorial_map_basic_operations.h>
|
||||||
|
#include <CGAL/Dimension.h>
|
||||||
|
#include <CGAL/Kernel_traits.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
/* Definition of functors used internally to manage attributes (we need
|
/* Definition of functors used internally to manage attributes (we need
|
||||||
|
|
@ -457,7 +459,7 @@ struct Is_same_info<Attr1, Attr2, Info, Info>
|
||||||
// Case of two non void type
|
// Case of two non void type
|
||||||
template<typename Map1, typename Map2,
|
template<typename Map1, typename Map2,
|
||||||
typename T1, typename T2, int i>
|
typename T1, typename T2, int i>
|
||||||
struct Is_same_attribute_functor
|
struct Is_same_attribute_info_functor
|
||||||
{
|
{
|
||||||
static bool run(typename Map1::Dart_const_handle dh1,
|
static bool run(typename Map1::Dart_const_handle dh1,
|
||||||
typename Map2::Dart_const_handle dh2)
|
typename Map2::Dart_const_handle dh2)
|
||||||
|
|
@ -478,33 +480,177 @@ struct Is_same_attribute_functor
|
||||||
|
|
||||||
// Case T1==void
|
// Case T1==void
|
||||||
template <typename Map1, typename Map2,
|
template <typename Map1, typename Map2,
|
||||||
typename T1, int i>
|
typename T2, int i>
|
||||||
struct Is_same_attribute_functor<Map1, Map2, Void, T1, i>
|
struct Is_same_attribute_info_functor<Map1, Map2, Void, T2, i>
|
||||||
{
|
{
|
||||||
static bool run(typename Map1::Dart_const_handle,
|
static bool run(typename Map1::Dart_const_handle,
|
||||||
typename Map2::Dart_const_handle dh2)
|
typename Map2::Dart_const_handle dh2)
|
||||||
{ return dh2->template attribute<i>()==NULL; }
|
{
|
||||||
|
return dh2->template attribute<i>()==NULL ||
|
||||||
|
Is_same_info<int,T2,void,typename T2::Info>::
|
||||||
|
run(0, *(dh2->template attribute<i>()));
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Case T2==void
|
// Case T2==void
|
||||||
template <typename Map1, typename Map2,
|
template <typename Map1, typename Map2,
|
||||||
typename T1, int i>
|
typename T1, int i>
|
||||||
struct Is_same_attribute_functor<Map1, Map2, T1, Void, i>
|
struct Is_same_attribute_info_functor<Map1, Map2, T1, Void, i>
|
||||||
{
|
{
|
||||||
static bool run(typename Map1::Dart_const_handle dh1,
|
static bool run(typename Map1::Dart_const_handle dh1,
|
||||||
typename Map2::Dart_const_handle)
|
typename Map2::Dart_const_handle)
|
||||||
{ return dh1->template attribute<i>()==NULL; }
|
{
|
||||||
|
return dh1->template attribute<i>()==NULL ||
|
||||||
|
Is_same_info<T1, int, typename T1::Info, void>::
|
||||||
|
run(*(dh1->template attribute<i>()), 0);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Case T1==T2==void
|
// Case T1==T2==void
|
||||||
template <typename Map1, typename Map2, int i>
|
template <typename Map1, typename Map2, int i>
|
||||||
struct Is_same_attribute_functor<Map1, Map2, Void, Void, i>
|
struct Is_same_attribute_info_functor<Map1, Map2, Void, Void, i>
|
||||||
{
|
{
|
||||||
static bool run(typename Map1::Dart_const_handle,
|
static bool run(typename Map1::Dart_const_handle,
|
||||||
typename Map2::Dart_const_handle)
|
typename Map2::Dart_const_handle)
|
||||||
{ return true; }
|
{ return true; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// ****************************************************************************
|
||||||
|
// Functor allowing to test if two points are the same or not.
|
||||||
|
// Here we know both attributes have points.
|
||||||
|
template< typename Attr1, typename Attr2,
|
||||||
|
typename Point1=typename Attr1::Point,
|
||||||
|
typename Point2=typename Attr2::Point,
|
||||||
|
typename T1=typename Ambient_dimension<Point1>::type >
|
||||||
|
struct Is_same_point
|
||||||
|
{
|
||||||
|
static bool run(const Attr1&, const Attr2&)
|
||||||
|
{ return false; }
|
||||||
|
};
|
||||||
|
|
||||||
|
template< typename Attr1, typename Attr2, typename Point>
|
||||||
|
struct Is_same_point<Attr1, Attr2, Point, Point, Dimension_tag<2> >
|
||||||
|
{
|
||||||
|
static bool run(const Attr1& a1, const Attr2& a2)
|
||||||
|
{ return typename Kernel_traits<Point>::Kernel::Equal_2()
|
||||||
|
(a1.point(),a2.point()); }
|
||||||
|
};
|
||||||
|
|
||||||
|
template< typename Attr1, typename Attr2, typename Point>
|
||||||
|
struct Is_same_point<Attr1, Attr2, Point, Point, Dimension_tag<3> >
|
||||||
|
{
|
||||||
|
static bool run(const Attr1& a1, const Attr2& a2)
|
||||||
|
{ return typename Kernel_traits<Point>::Kernel::Equal_3()
|
||||||
|
(a1.point(),a2.point()); }
|
||||||
|
};
|
||||||
|
|
||||||
|
template< typename Attr1, typename Attr2, typename Point>
|
||||||
|
struct Is_same_point<Attr1, Attr2, Point, Point, Dynamic_dimension_tag >
|
||||||
|
{
|
||||||
|
static bool run(const Attr1& a1, const Attr2& a2)
|
||||||
|
{ return typename Kernel_traits<Point>::Kernel::Equal_d()
|
||||||
|
(a1.point(),a2.point()); }
|
||||||
|
};
|
||||||
|
|
||||||
|
// Case of two non void type, with two points
|
||||||
|
template<typename Map1, typename Map2,
|
||||||
|
typename T1, typename T2, bool Withpoint1, bool Withpoint2, int i>
|
||||||
|
struct Is_same_attribute_point_functor
|
||||||
|
{
|
||||||
|
static bool run(typename Map1::Dart_const_handle dh1,
|
||||||
|
typename Map2::Dart_const_handle dh2)
|
||||||
|
{
|
||||||
|
CGAL_static_assertion( Withpoint1==true && Withpoint2==true );
|
||||||
|
if (dh1->template attribute<i>()==NULL &&
|
||||||
|
dh2->template attribute<i>()==NULL)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (dh1->template attribute<i>()==NULL ||
|
||||||
|
dh2->template attribute<i>()==NULL)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return
|
||||||
|
Is_same_point<T1,T2>::run(*(dh1->template attribute<i>()),
|
||||||
|
*(dh2->template attribute<i>()));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Case of two non void type, first without point
|
||||||
|
template<typename Map1, typename Map2,
|
||||||
|
typename T1, typename T2, int i>
|
||||||
|
struct Is_same_attribute_point_functor<Map1, Map2, T1, T2, false, true, i>
|
||||||
|
{
|
||||||
|
static bool run(typename Map1::Dart_const_handle,
|
||||||
|
typename Map2::Dart_const_handle)
|
||||||
|
{ return false; }
|
||||||
|
};
|
||||||
|
|
||||||
|
// Case of two non void type, second without point
|
||||||
|
template<typename Map1, typename Map2,
|
||||||
|
typename T1, typename T2, int i>
|
||||||
|
struct Is_same_attribute_point_functor<Map1, Map2, T1, T2, true, false, i>
|
||||||
|
{
|
||||||
|
static bool run(typename Map1::Dart_const_handle,
|
||||||
|
typename Map2::Dart_const_handle)
|
||||||
|
{ return false; }
|
||||||
|
};
|
||||||
|
|
||||||
|
// Case of two non void type, both without point
|
||||||
|
template<typename Map1, typename Map2,
|
||||||
|
typename T1, typename T2, int i>
|
||||||
|
struct Is_same_attribute_point_functor<Map1, Map2, T1, T2, false, false, i>
|
||||||
|
{
|
||||||
|
static bool run(typename Map1::Dart_const_handle,
|
||||||
|
typename Map2::Dart_const_handle)
|
||||||
|
{ return true; }
|
||||||
|
};
|
||||||
|
|
||||||
|
// Case T1==void
|
||||||
|
/*template <typename Map1, typename Map2,
|
||||||
|
typename T2, bool Withpoint1, bool Withpoint2, int i>
|
||||||
|
struct Is_same_attribute_point_functor<Map1, Map2, Void, T2,
|
||||||
|
Withpoint1, Withpoint2, i>
|
||||||
|
{
|
||||||
|
static bool run(typename Map1::Dart_const_handle,
|
||||||
|
typename Map2::Dart_const_handle dh2)
|
||||||
|
{
|
||||||
|
return dh2->template attribute<i>()==NULL ||
|
||||||
|
Withpoint2==false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Case T2==void
|
||||||
|
template <typename Map1, typename Map2,
|
||||||
|
typename T1, bool Withpoint1, bool Withpoint2, int i>
|
||||||
|
struct Is_same_attribute_point_functor<Map1, Map2, T1, Void,
|
||||||
|
Withpoint1, Withpoint2, i>
|
||||||
|
{
|
||||||
|
static bool run(typename Map1::Dart_const_handle dh1,
|
||||||
|
typename Map2::Dart_const_handle)
|
||||||
|
{
|
||||||
|
return dh1->template attribute<i>()==NULL ||
|
||||||
|
Withpoint1==false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Case T1==T2==void
|
||||||
|
template <typename Map1, typename Map2, bool Withpoint1, bool Withpoint2, int i>
|
||||||
|
struct Is_same_attribute_point_functor<Map1, Map2, Void, Void,
|
||||||
|
Withpoint1, Withpoint2, i>
|
||||||
|
{
|
||||||
|
static bool run(typename Map1::Dart_const_handle,
|
||||||
|
typename Map2::Dart_const_handle)
|
||||||
|
{ return true; }
|
||||||
|
};*/
|
||||||
|
|
||||||
|
struct twochar{ char dummy[2]; };
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
static char has_point(typename T::Point*){}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
static twochar has_point(...){}
|
||||||
|
|
||||||
/// Test if the two darts are associated with the same attribute.
|
/// Test if the two darts are associated with the same attribute.
|
||||||
template<typename Map1, typename Map2>
|
template<typename Map1, typename Map2>
|
||||||
struct Test_is_same_attribute_functor
|
struct Test_is_same_attribute_functor
|
||||||
|
|
@ -514,11 +660,23 @@ struct Test_is_same_attribute_functor
|
||||||
typename Map2::Dart_const_handle dh2 )
|
typename Map2::Dart_const_handle dh2 )
|
||||||
{
|
{
|
||||||
if (value)
|
if (value)
|
||||||
value = Is_same_attribute_functor
|
{
|
||||||
|
value = Is_same_attribute_info_functor
|
||||||
<Map1, Map2,
|
<Map1, Map2,
|
||||||
typename Map1::Helper::template Attribute_type<i>::type,
|
typename Map1::template Attribute_type<i>::type,
|
||||||
typename Map2::Helper::template Attribute_type<i>::type,
|
typename Map2::template Attribute_type<i>::type,
|
||||||
i>::run(dh1, dh2);
|
i>::run(dh1, dh2);
|
||||||
|
}
|
||||||
|
if (value)
|
||||||
|
{
|
||||||
|
value = Is_same_attribute_point_functor
|
||||||
|
<Map1, Map2,
|
||||||
|
typename Map1::template Attribute_type<i>::type,
|
||||||
|
typename Map2::template Attribute_type<i>::type,
|
||||||
|
sizeof(has_point<typename Map1::template Attribute_type<i>::type>(NULL))==sizeof(char),
|
||||||
|
sizeof(has_point<typename Map2::template Attribute_type<i>::type>(NULL))==sizeof(char),
|
||||||
|
i>::run(dh1, dh2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
static bool value;
|
static bool value;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,12 @@ namespace CGAL {
|
||||||
|
|
||||||
using Base1::info;
|
using Base1::info;
|
||||||
|
|
||||||
|
bool operator==(const Self& other) const
|
||||||
|
{ return Base1::operator==(other) && this->point()==other.point(); }
|
||||||
|
|
||||||
|
bool operator!=(const Self& other) const
|
||||||
|
{ return !operator==(other); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// Default contructor.
|
/// Default contructor.
|
||||||
Cell_attribute_with_point()
|
Cell_attribute_with_point()
|
||||||
|
|
@ -132,6 +138,16 @@ namespace CGAL {
|
||||||
typedef Functor_on_merge_ Functor_on_merge;
|
typedef Functor_on_merge_ Functor_on_merge;
|
||||||
typedef Functor_on_split_ Functor_on_split;
|
typedef Functor_on_split_ Functor_on_split;
|
||||||
|
|
||||||
|
bool operator==(const Cell_attribute_with_point& other) const
|
||||||
|
{ return Base1::operator==(other) && this->point()==other.point(); }
|
||||||
|
|
||||||
|
bool operator!=(const Cell_attribute_with_point& other) const
|
||||||
|
{ return !operator==(other); }
|
||||||
|
|
||||||
|
template<typename Cellattr>
|
||||||
|
bool operator==(const Cellattr& other) const
|
||||||
|
{ return false; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// Default contructor.
|
/// Default contructor.
|
||||||
Cell_attribute_with_point()
|
Cell_attribute_with_point()
|
||||||
|
|
|
||||||
|
|
@ -91,8 +91,7 @@ struct Set_point_if_possible<Point1, Point2, Dynamic_dimension_tag,
|
||||||
{
|
{
|
||||||
static void run(const Point1& p1, Point2& p2)
|
static void run(const Point1& p1, Point2& p2)
|
||||||
{
|
{
|
||||||
if ( p1.dimension()==p2.dimension() )
|
Set_point_d_if_same<Point1, Point2>::run(p1, p2);
|
||||||
Set_point_d_if_same<Point1, Point2>::run(p1, p2);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -123,15 +122,13 @@ struct Set_point_if_exist<Attr1, Attr2, CGAL::Void, Point2>
|
||||||
};
|
};
|
||||||
// ****************************************************************************
|
// ****************************************************************************
|
||||||
#ifndef CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES
|
#ifndef CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES
|
||||||
template <typename LCC1, typename LCC2, class Tuple,
|
template <typename LCC1, typename LCC2, class Tuple>
|
||||||
class Res=CGAL::cpp11::tuple<> >
|
|
||||||
struct Modify_tuple_of_converter_for_vertex_attribute;
|
struct Modify_tuple_of_converter_for_vertex_attribute;
|
||||||
|
|
||||||
// empty tuple and empty res: res is a tuple with only
|
// empty tuple
|
||||||
// Point_converter_lcc_vertex_attributes
|
|
||||||
template <typename LCC1, typename LCC2>
|
template <typename LCC1, typename LCC2>
|
||||||
struct Modify_tuple_of_converter_for_vertex_attribute
|
struct Modify_tuple_of_converter_for_vertex_attribute
|
||||||
<LCC1, LCC2, CGAL::cpp11::tuple<>, CGAL::cpp11::tuple<> >
|
<LCC1, LCC2, CGAL::cpp11::tuple<> >
|
||||||
{
|
{
|
||||||
typedef CGAL::cpp11::tuple
|
typedef CGAL::cpp11::tuple
|
||||||
<Modify_attribute_converter_lcc_vertex_attributes
|
<Modify_attribute_converter_lcc_vertex_attributes
|
||||||
|
|
@ -141,51 +138,22 @@ struct Modify_tuple_of_converter_for_vertex_attribute
|
||||||
{ return type(); }
|
{ return type(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
// empty tuple but non empty res: we already have modified vertex attribute
|
// non empty empty tuple, Firsttype is vertex attribute.
|
||||||
template < typename LCC1, typename LCC2, class ... Res >
|
|
||||||
struct Modify_tuple_of_converter_for_vertex_attribute
|
|
||||||
<LCC1, LCC2, CGAL::cpp11::tuple<>, CGAL::cpp11::tuple<Res...> >
|
|
||||||
{
|
|
||||||
typedef CGAL::cpp11::tuple<Res...> type;
|
|
||||||
|
|
||||||
static type run(const CGAL::cpp11::tuple<>&)
|
|
||||||
{ CGAL_assertion(false); return type(); }
|
|
||||||
};
|
|
||||||
|
|
||||||
// empty res but non empty empty tuple, Firsttype is vertex attribute.
|
|
||||||
template < typename LCC1, typename LCC2, class Firsttype, class ... Tuple >
|
template < typename LCC1, typename LCC2, class Firsttype, class ... Tuple >
|
||||||
struct Modify_tuple_of_converter_for_vertex_attribute
|
struct Modify_tuple_of_converter_for_vertex_attribute
|
||||||
<LCC1, LCC2, CGAL::cpp11::tuple<Firstype, Tuple...>, CGAL::cpp11::tuple<> >
|
<LCC1, LCC2, CGAL::cpp11::tuple<Firstype, Tuple...> >
|
||||||
{
|
{
|
||||||
typedef typename Modify_tuple_of_converter_for_vertex_attribute
|
typedef typename CGAL::cpp11::tuple
|
||||||
<LCC1, LCC2, CGAL::cpp11::tuple<Tuple...>,
|
<Modify_attribute_converter_lcc_vertex_attributes<Firsttype, LCC1, LCC2>,
|
||||||
CGAL::cpp11::tuple
|
Tuple...> type;
|
||||||
<Modify_attribute_converter_lcc_vertex_attributes<Firsttype, LCC1, LCC2> >::
|
|
||||||
type type;
|
|
||||||
|
|
||||||
static type run(const CGAL::cpp11::tuple<Firsttype, Tuple...>& t)
|
static type run(const CGAL::cpp11::tuple<Firsttype, Tuple...>& t)
|
||||||
{
|
{
|
||||||
return type
|
return boost::tuples::cons
|
||||||
(Modify_attribute_converter_lcc_vertex_attributes<Firsttype, LCC1, LCC2>
|
<Modify_attribute_converter_lcc_vertex_attributes<T1, LCC1, LCC2>,
|
||||||
(t.get_head()),
|
Tuple... >(t.get_head(),t.get_tail());
|
||||||
t.get_tail());
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// non empty res, non empty tuple, we copy
|
|
||||||
template < typename LCC1, typename LCC2, class Firsttype,
|
|
||||||
class ... Tuple, class ... Res >
|
|
||||||
struct Modify_tuple_of_converter_for_vertex_attribute
|
|
||||||
<LCC1, LCC2, CGAL::cpp11::tuple<Firsttype,Tuple...>,
|
|
||||||
CGAL::cpp11::tuple<Res...> >
|
|
||||||
{
|
|
||||||
typedef typename Modify_tuple_of_converter_for_vertex_attribute
|
|
||||||
<LCC1, LCC2, CGAL::cpp11::tuple<Tuple...>,
|
|
||||||
CGAL::cpp11::tuple<Res...,Functor> >::type type;
|
|
||||||
|
|
||||||
static type run(const CGAL::cpp11::tuple<>&)
|
|
||||||
{ CGAL_assertion(false); return type; }
|
|
||||||
};
|
|
||||||
#else // CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES
|
#else // CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES
|
||||||
template <class LCC1, class LCC2, class Tuple>
|
template <class LCC1, class LCC2, class Tuple>
|
||||||
struct Modify_tuple_of_converter_for_vertex_attribute;
|
struct Modify_tuple_of_converter_for_vertex_attribute;
|
||||||
|
|
@ -200,9 +168,10 @@ struct Modify_tuple_of_converter_for_vertex_attribute
|
||||||
static type run(const CGAL::cpp11::tuple<>&)
|
static type run(const CGAL::cpp11::tuple<>&)
|
||||||
{
|
{
|
||||||
CGAL::Default_converter_cmap_attributes<LCC1, LCC2,0> tmp;
|
CGAL::Default_converter_cmap_attributes<LCC1, LCC2,0> tmp;
|
||||||
return type(Modify_attribute_converter_lcc_vertex_attributes
|
return CGAL::cpp11::tuple
|
||||||
<CGAL::Default_converter_cmap_attributes<LCC1, LCC2,0>, LCC1, LCC2>
|
<CGAL::Modify_attribute_converter_lcc_vertex_attributes
|
||||||
(tmp));
|
<CGAL::Default_converter_cmap_attributes<LCC1, LCC2,0>, LCC1, LCC2> >
|
||||||
|
(tmp);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -214,10 +183,9 @@ struct Modify_tuple_of_converter_for_vertex_attribute
|
||||||
|
|
||||||
static type run(const CGAL::cpp11::tuple<T1>& t)
|
static type run(const CGAL::cpp11::tuple<T1>& t)
|
||||||
{
|
{
|
||||||
return type
|
return boost::tuples::cons
|
||||||
(Modify_attribute_converter_lcc_vertex_attributes<T1, LCC1, LCC2>
|
<Modify_attribute_converter_lcc_vertex_attributes<T1, LCC1, LCC2>,
|
||||||
(t.get_head()),
|
CGAL::cpp11::tuple<> >(t.get_head(),t.get_tail());
|
||||||
t.get_tail());
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -229,10 +197,9 @@ struct Modify_tuple_of_converter_for_vertex_attribute
|
||||||
|
|
||||||
static type run(const CGAL::cpp11::tuple<T1,T2>& t)
|
static type run(const CGAL::cpp11::tuple<T1,T2>& t)
|
||||||
{
|
{
|
||||||
return type
|
return boost::tuples::cons
|
||||||
(Modify_attribute_converter_lcc_vertex_attributes<T1, LCC1, LCC2>
|
<Modify_attribute_converter_lcc_vertex_attributes<T1, LCC1, LCC2>,
|
||||||
(t.get_head()),
|
CGAL::cpp11::tuple<T2> >(t.get_head(),t.get_tail());
|
||||||
t.get_tail());
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -245,10 +212,9 @@ struct Modify_tuple_of_converter_for_vertex_attribute
|
||||||
|
|
||||||
static type run(const CGAL::cpp11::tuple<T1,T2,T3>& t)
|
static type run(const CGAL::cpp11::tuple<T1,T2,T3>& t)
|
||||||
{
|
{
|
||||||
return type
|
return boost::tuples::cons
|
||||||
(Modify_attribute_converter_lcc_vertex_attributes<T1, LCC1, LCC2>
|
<Modify_attribute_converter_lcc_vertex_attributes<T1, LCC1, LCC2>,
|
||||||
(t.get_head()),
|
CGAL::cpp11::tuple<T2,T3> >(t.get_head(),t.get_tail());
|
||||||
t.get_tail());
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -261,10 +227,9 @@ struct Modify_tuple_of_converter_for_vertex_attribute
|
||||||
|
|
||||||
static type run(const CGAL::cpp11::tuple<T1,T2,T3,T4>& t)
|
static type run(const CGAL::cpp11::tuple<T1,T2,T3,T4>& t)
|
||||||
{
|
{
|
||||||
return type
|
return boost::tuples::cons
|
||||||
(Modify_attribute_converter_lcc_vertex_attributes<T1, LCC1, LCC2>
|
<Modify_attribute_converter_lcc_vertex_attributes<T1, LCC1, LCC2>,
|
||||||
(t.get_head()),
|
CGAL::cpp11::tuple<T2,T3,T4> >(t.get_head(),t.get_tail());
|
||||||
t.get_tail());
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -278,10 +243,9 @@ struct Modify_tuple_of_converter_for_vertex_attribute
|
||||||
|
|
||||||
static type run(const CGAL::cpp11::tuple<T1,T2,T3,T4,T5>& t)
|
static type run(const CGAL::cpp11::tuple<T1,T2,T3,T4,T5>& t)
|
||||||
{
|
{
|
||||||
return type
|
return boost::tuples::cons
|
||||||
(Modify_attribute_converter_lcc_vertex_attributes<T1, LCC1, LCC2>
|
<Modify_attribute_converter_lcc_vertex_attributes<T1, LCC1, LCC2>,
|
||||||
(t.get_head()),
|
CGAL::cpp11::tuple<T2,T3,T4,T5> >(t.get_head(),t.get_tail());
|
||||||
t.get_tail());
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -295,10 +259,9 @@ struct Modify_tuple_of_converter_for_vertex_attribute
|
||||||
|
|
||||||
static type run(const CGAL::cpp11::tuple<T1,T2,T3,T4,T5,T6>& t)
|
static type run(const CGAL::cpp11::tuple<T1,T2,T3,T4,T5,T6>& t)
|
||||||
{
|
{
|
||||||
return type
|
return boost::tuples::cons
|
||||||
(Modify_attribute_converter_lcc_vertex_attributes<T1, LCC1, LCC2>
|
<Modify_attribute_converter_lcc_vertex_attributes<T1, LCC1, LCC2>,
|
||||||
(t.get_head()),
|
CGAL::cpp11::tuple<T2,T3,T4,T5,T6> >(t.get_head(),t.get_tail());
|
||||||
t.get_tail());
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -312,10 +275,9 @@ struct Modify_tuple_of_converter_for_vertex_attribute
|
||||||
|
|
||||||
static type run(const CGAL::cpp11::tuple<T1,T2,T3,T4,T5,T6,T7>& t)
|
static type run(const CGAL::cpp11::tuple<T1,T2,T3,T4,T5,T6,T7>& t)
|
||||||
{
|
{
|
||||||
return type
|
return boost::tuples::cons
|
||||||
(Modify_attribute_converter_lcc_vertex_attributes<T1, LCC1, LCC2>
|
<Modify_attribute_converter_lcc_vertex_attributes<T1, LCC1, LCC2>,
|
||||||
(t.get_head()),
|
CGAL::cpp11::tuple<T2,T3,T4,T5,T6,T7> >(t.get_head(),t.get_tail());
|
||||||
t.get_tail());
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -329,10 +291,9 @@ struct Modify_tuple_of_converter_for_vertex_attribute
|
||||||
|
|
||||||
static type run(const CGAL::cpp11::tuple<T1,T2,T3,T4,T5,T6,T7,T8>& t)
|
static type run(const CGAL::cpp11::tuple<T1,T2,T3,T4,T5,T6,T7,T8>& t)
|
||||||
{
|
{
|
||||||
return type
|
return boost::tuples::cons
|
||||||
(Modify_attribute_converter_lcc_vertex_attributes<T1, LCC1, LCC2>
|
<Modify_attribute_converter_lcc_vertex_attributes<T1, LCC1, LCC2>,
|
||||||
(t.get_head()),
|
CGAL::cpp11::tuple<T2,T3,T4,T5,T6,T7,T8> >(t.get_head(),t.get_tail());
|
||||||
t.get_tail());
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -346,10 +307,9 @@ struct Modify_tuple_of_converter_for_vertex_attribute
|
||||||
|
|
||||||
static type run(const CGAL::cpp11::tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9>& t)
|
static type run(const CGAL::cpp11::tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9>& t)
|
||||||
{
|
{
|
||||||
return type
|
return boost::tuples::cons
|
||||||
(Modify_attribute_converter_lcc_vertex_attributes<T1, LCC1, LCC2>
|
<Modify_attribute_converter_lcc_vertex_attributes<T1, LCC1, LCC2>,
|
||||||
(t.get_head()),
|
CGAL::cpp11::tuple<T2,T3,T4,T5,T6,T7,T8,T9> >(t.get_head(),t.get_tail());
|
||||||
t.get_tail());
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ struct Map_2_dart_items
|
||||||
typedef CGAL::Dart< 2, Refs > Dart;
|
typedef CGAL::Dart< 2, Refs > Dart;
|
||||||
|
|
||||||
typedef CGAL::Cell_attribute< Refs, int > Int_attrib;
|
typedef CGAL::Cell_attribute< Refs, int > Int_attrib;
|
||||||
typedef CGAL::Cell_attribute< Refs, int > Double_attrib;
|
typedef CGAL::Cell_attribute< Refs, double > Double_attrib;
|
||||||
typedef CGAL::Cell_attribute_with_point< Refs, double > Double_attrib_wp;
|
typedef CGAL::Cell_attribute_with_point< Refs, double > Double_attrib_wp;
|
||||||
|
|
||||||
typedef CGAL::cpp11::tuple<Double_attrib_wp, void, Double_attrib> Attributes;
|
typedef CGAL::cpp11::tuple<Double_attrib_wp, void, Double_attrib> Attributes;
|
||||||
|
|
@ -562,19 +562,65 @@ bool testCopy()
|
||||||
map2a.number_of_attributes<2>()==0 &&
|
map2a.number_of_attributes<2>()==0 &&
|
||||||
map2a.number_of_attributes<3>()==0 );
|
map2a.number_of_attributes<3>()==0 );
|
||||||
assert( map2a.is_isomorphic_to(map2)==map2.is_isomorphic_to(map2a) );
|
assert( map2a.is_isomorphic_to(map2)==map2.is_isomorphic_to(map2a) );
|
||||||
//map2.display_characteristics(std::cout)<<std::endl;
|
|
||||||
//map2a.display_characteristics(std::cout)<<std::endl;
|
|
||||||
|
|
||||||
Map2 map5a(map5); assert(map5a.is_valid());
|
Map2 map5a(map5); assert(map5a.is_valid());
|
||||||
// Here we cannot use is_isomorphic_to because map5a has several cc
|
if ( map5a.is_isomorphic_to(map5) ) { assert(false); return false; }
|
||||||
assert( map5a.number_of_attributes<0>()==map2.number_of_attributes<0>() &&
|
assert( map5a.number_of_attributes<0>()==map2.number_of_attributes<0>() &&
|
||||||
map5a.number_of_attributes<2>()==0 );
|
map5a.number_of_attributes<2>()==0 );
|
||||||
//map5.display_characteristics(std::cout)<<std::endl;
|
|
||||||
//map5a.display_characteristics(std::cout)<<std::endl;
|
Map5 map9a(map9); assert(map9a.is_valid());
|
||||||
|
if ( map9a.is_isomorphic_to(map9) ) { assert(false); return false; }
|
||||||
|
assert( map9a.number_of_attributes<0>()>=map9.number_of_attributes<0>() &&
|
||||||
|
map9a.number_of_attributes<2>()>=map9.number_of_attributes<2>() &&
|
||||||
|
map9a.number_of_attributes<3>()==0 );
|
||||||
|
assert( map9a.is_isomorphic_to(map9)==map9.is_isomorphic_to(map9a) );
|
||||||
|
|
||||||
|
CGAL::Cast_converter_cmap_attributes<Map9,Map5,0> c0;
|
||||||
|
CGAL::Default_converter_cmap_attributes<Map9,Map5,1> c1;
|
||||||
|
CGAL::Default_converter_cmap_attributes<Map9,Map5,2> c2;
|
||||||
|
CGAL::Cast_converter_cmap_attributes<Map9,Map5,3> c3;
|
||||||
|
|
||||||
|
CGAL::cpp11::tuple<CGAL::Cast_converter_cmap_attributes<Map9,Map5,0>,
|
||||||
|
CGAL::Default_converter_cmap_attributes<Map9,Map5,1>,
|
||||||
|
CGAL::Default_converter_cmap_attributes<Map9,Map5,2>,
|
||||||
|
CGAL::Cast_converter_cmap_attributes<Map9,Map5,3> > myconverters
|
||||||
|
(c0, c1, c2, c3);
|
||||||
|
|
||||||
|
Map5 map9b(map9, myconverters); assert(map9a.is_valid());
|
||||||
|
if ( map9b.is_isomorphic_to(map9) ) { assert(false); return false; }
|
||||||
|
assert( map9b.number_of_attributes<0>()>=map9.number_of_attributes<0>() &&
|
||||||
|
map9b.number_of_attributes<2>()>=map9.number_of_attributes<2>() &&
|
||||||
|
map9b.number_of_attributes<3>()>=map9.number_of_attributes<3>() );
|
||||||
|
assert( map9b.is_isomorphic_to(map9)==map9.is_isomorphic_to(map9b) );
|
||||||
|
|
||||||
|
CGAL::Cast_converter_cmap_attributes<Map5,Map9,0> cb0;
|
||||||
|
CGAL::Default_converter_cmap_attributes<Map5,Map9,1> cb1;
|
||||||
|
CGAL::Default_converter_cmap_attributes<Map5,Map9,2> cb2;
|
||||||
|
CGAL::Cast_converter_cmap_attributes<Map5,Map9,3> cb3;
|
||||||
|
|
||||||
|
CGAL::cpp11::tuple<CGAL::Cast_converter_cmap_attributes<Map5,Map9,0>,
|
||||||
|
CGAL::Default_converter_cmap_attributes<Map5,Map9,1>,
|
||||||
|
CGAL::Default_converter_cmap_attributes<Map5,Map9,2>,
|
||||||
|
CGAL::Cast_converter_cmap_attributes<Map5,Map9,3> > myconverters2
|
||||||
|
(cb0, cb1, cb2, cb3);
|
||||||
|
|
||||||
|
Map9 map5b(map5, myconverters2); assert(map5b.is_valid());
|
||||||
|
if ( map5b.is_isomorphic_to(map5) ) { assert(false); return false; }
|
||||||
|
if ( !map5b.is_isomorphic_to(map5, false) ) { assert(false); return false; }
|
||||||
|
assert( map5b.number_of_attributes<0>()==map5.number_of_attributes<0>() &&
|
||||||
|
map5b.number_of_attributes<2>()==map5.number_of_attributes<2>() &&
|
||||||
|
map5b.number_of_attributes<3>()==map5.number_of_attributes<3>() );
|
||||||
|
assert( map5b.is_isomorphic_to(map5)==map5.is_isomorphic_to(map5b) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// displayAllAttribs2D(mapXX, "mapXX******************\n");
|
/*map2.display_characteristics(std::cout)<<std::endl;
|
||||||
// displayAllAttribs2D(mapYY, "mapYY******************\n");
|
map2a.display_characteristics(std::cout)<<std::endl;
|
||||||
|
displayAllAttribs2D(mapXX, "mapXX******************\n");
|
||||||
|
displayAllAttribs2D(mapYY, "mapYY******************\n");*/
|
||||||
|
/*map5.display_characteristics(std::cout)<<std::endl;
|
||||||
|
map5b.display_characteristics(std::cout)<<std::endl;
|
||||||
|
displayAllAttribs3D(map5, "map5******************\n");
|
||||||
|
displayAllAttribs3D(map5b, "map5b******************\n");*/
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue