mirror of https://github.com/CGAL/cgal
missing inline. convert points without iterators.
This commit is contained in:
parent
212ca488ea
commit
92e92d730d
|
|
@ -35,7 +35,7 @@ const int UNKNOWN_DIMENSION=Eigen::Dynamic;
|
|||
const int UNKNOWN_DIMENSION=std::numeric_limits<int>::max();
|
||||
#endif
|
||||
|
||||
bool check_dimension(int d1, int d2){
|
||||
inline bool check_dimension(int d1, int d2){
|
||||
//return (d2==UNKNOWN_DIMENSION)||(d1<=d2);
|
||||
return d1<=d2;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,17 @@
|
|||
#ifndef CGAL_KD_KO_CONVERTER_H
|
||||
#define CGAL_KD_KO_CONVERTER_H
|
||||
#include <CGAL/marcutils.h>
|
||||
#include <CGAL/functor_tags.h>
|
||||
#include <CGAL/Kernel/mpl.h> // First_if_different
|
||||
namespace CGAL {
|
||||
template <class Tag_, class K1, class K2> struct KO_converter;
|
||||
//TODO: It would probably be better if this was a Misc Functor in K1.
|
||||
// This way K1 could chose how it wants to present its points (sparse
|
||||
// iterator?) and derived classes would inherit it.
|
||||
|
||||
template <class K1, class K2> struct KO_converter<Point_tag,K1,K2>{
|
||||
namespace internal {
|
||||
template <class D /*=Dynamic_dimension_tag*/, class K1, class K2>
|
||||
struct Point_converter_help {
|
||||
typedef typename K1::template Type<Point_tag>::type argument_type;
|
||||
typedef typename K2::template Type<Point_tag>::type result_type;
|
||||
template <class C>
|
||||
|
|
@ -16,6 +21,29 @@ template <class K1, class K2> struct KO_converter<Point_tag,K1,K2>{
|
|||
return cp(conv(i(p,Begin_tag())),conv(i(p,End_tag())));
|
||||
}
|
||||
};
|
||||
#ifdef CGAL_CXX0X
|
||||
// This doesn't seem so useful, the compiler should be able to handle
|
||||
// the iterators just as efficiently.
|
||||
template <int d, class K1, class K2>
|
||||
struct Point_converter_help<Dimension_tag<d>,K1,K2> {
|
||||
typedef typename K1::template Type<Point_tag>::type argument_type;
|
||||
typedef typename K2::template Type<Point_tag>::type result_type;
|
||||
template <class C,int...I>
|
||||
result_type help(Indices<I...>, K1 const& k1, K2 const& k2, C const& conv, argument_type const& p) const {
|
||||
typename K1::template Functor<Compute_cartesian_coordinate_tag>::type cc(k1);
|
||||
typename K2::template Functor<Construct_ttag<Point_tag> >::type cp(k2);
|
||||
return cp(conv(cc(p,I))...);
|
||||
}
|
||||
template <class C>
|
||||
result_type operator()(K1 const& k1, K2 const& k2, C const& conv, argument_type const& p) const {
|
||||
return help(typename N_increasing_indices<d>::type(),k1,k2,conv,p);
|
||||
}
|
||||
};
|
||||
#endif
|
||||
}
|
||||
template <class K1, class K2> struct KO_converter<Point_tag,K1,K2>
|
||||
: internal::Point_converter_help<typename K1::Default_ambient_dimension,K1,K2>
|
||||
{};
|
||||
|
||||
template <class K1, class K2> struct KO_converter<Vector_tag,K1,K2>{
|
||||
typedef typename K1::template Type<Vector_tag>::type K1_Vector;
|
||||
|
|
|
|||
Loading…
Reference in New Issue