mirror of https://github.com/CGAL/cgal
Kernel_d-like interface
This commit is contained in:
parent
13c3f90e33
commit
b5b521381c
|
|
@ -76,6 +76,9 @@ template<class R_,bool force_=false,class Derived_=Default> struct Cartesian_com
|
||||||
template<class R_,bool force_=false,class Derived_=Default> struct Cartesian_complete_predicates
|
template<class R_,bool force_=false,class Derived_=Default> struct Cartesian_complete_predicates
|
||||||
: public R_
|
: public R_
|
||||||
{
|
{
|
||||||
|
// TODO: this doesn't look like the right place for this typedef...
|
||||||
|
typedef CartesianDKernelFunctors::Flat_orientation Flat_orientation;
|
||||||
|
|
||||||
typedef R_ Kernel_base;
|
typedef R_ Kernel_base;
|
||||||
typedef typename Default::Get<Derived_,Cartesian_complete_predicates>::type Derived;
|
typedef typename Default::Get<Derived_,Cartesian_complete_predicates>::type Derived;
|
||||||
template<class F,class D=void,class=typename map_functor_type<F>::type> struct Functor :
|
template<class F,class D=void,class=typename map_functor_type<F>::type> struct Functor :
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
|
#include <CGAL/Dimension.h>
|
||||||
#include <CGAL/functor_tags.h>
|
#include <CGAL/functor_tags.h>
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
@ -20,7 +21,7 @@ template<class R_> struct Construct_flat_orientation : private Store_kernel<R_>
|
||||||
typedef typename R::template Functor<Compute_cartesian_coordinate_tag>::type CCC;
|
typedef typename R::template Functor<Compute_cartesian_coordinate_tag>::type CCC;
|
||||||
typedef typename R::LA LA;
|
typedef typename R::LA LA;
|
||||||
typedef typename Increment_dimension<typename R::Max_ambient_dimension>::type Dplusone;
|
typedef typename Increment_dimension<typename R::Max_ambient_dimension>::type Dplusone;
|
||||||
typedef typename LA::template Matrix<Dynamic_dimension,Dynamic_dimension,Dplusone,Dplusone>::type Matrix;
|
typedef typename LA::template Matrix<Dynamic_dimension_tag,Dynamic_dimension_tag,Dplusone,Dplusone>::type Matrix;
|
||||||
typedef typename R::template Functor<Point_dimension_tag>::type PD;
|
typedef typename R::template Functor<Point_dimension_tag>::type PD;
|
||||||
typedef Flat_orientation result_type;
|
typedef Flat_orientation result_type;
|
||||||
|
|
||||||
|
|
@ -60,7 +61,7 @@ template<class R_> struct Construct_flat_orientation : private Store_kernel<R_>
|
||||||
}
|
}
|
||||||
//CGAL_assertion(it!=rest.end());
|
//CGAL_assertion(it!=rest.end());
|
||||||
}
|
}
|
||||||
std::sort(proj.begin(),proj.last());
|
std::sort(proj.begin(),proj.end());
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -69,13 +70,14 @@ template<class R_> struct Contained_in_affine_hull : private Store_kernel<R_> {
|
||||||
CGAL_FUNCTOR_INIT_STORE(Contained_in_affine_hull)
|
CGAL_FUNCTOR_INIT_STORE(Contained_in_affine_hull)
|
||||||
typedef R_ R;
|
typedef R_ R;
|
||||||
typedef typename R_::FT FT;
|
typedef typename R_::FT FT;
|
||||||
|
typedef typename R::LA LA;
|
||||||
typedef typename R::template Type<Point_tag>::type Point;
|
typedef typename R::template Type<Point_tag>::type Point;
|
||||||
typedef typename R::Orientation result_type;
|
typedef typename R::Orientation result_type;
|
||||||
typedef typename R::template Functor<Compute_cartesian_coordinate_tag>::type CCC;
|
typedef typename R::template Functor<Compute_cartesian_coordinate_tag>::type CCC;
|
||||||
typedef typename R::template Functor<Point_dimension_tag>::type PD;
|
typedef typename R::template Functor<Point_dimension_tag>::type PD;
|
||||||
typedef typename Increment_dimension<typename R::Default_ambient_dimension>::type D1;
|
typedef typename Increment_dimension<typename R::Default_ambient_dimension>::type D1;
|
||||||
typedef typename Increment_dimension<typename R::Max_ambient_dimension>::type D2;
|
typedef typename Increment_dimension<typename R::Max_ambient_dimension>::type D2;
|
||||||
typedef typename R::LA::template Matrix<D1,D1,D2,D2>::type Matrix;
|
typedef typename LA::template Matrix<D1,D1,D2,D2>::type Matrix;
|
||||||
|
|
||||||
// mostly copied from Construct_flat_orientation. TODO: dedup this code.
|
// mostly copied from Construct_flat_orientation. TODO: dedup this code.
|
||||||
template<class Iter>
|
template<class Iter>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
#ifndef CGAL_KD_KERNEL_3_INTERFACE_H
|
||||||
|
#define CGAL_KD_KERNEL_3_INTERFACE_H
|
||||||
|
|
||||||
|
#include <CGAL/functor_tags.h>
|
||||||
|
#include <CGAL/transforming_iterator.h>
|
||||||
|
#include <CGAL/marcutils.h>
|
||||||
|
#include <CGAL/tuple.h>
|
||||||
|
|
||||||
|
|
||||||
|
namespace CGAL {
|
||||||
|
template <class Base_> struct Kernel_d_interface : public Base_ {
|
||||||
|
typedef Base_ Base;
|
||||||
|
typedef Kernel_d_interface<Base> Kernel;
|
||||||
|
typedef typename Base::Flat_orientation Flat_orientation_d;
|
||||||
|
typedef typename Base::template Type<Point_tag>::type Point_d;
|
||||||
|
typedef typename Base::template Type<Vector_tag>::type Vector_d;
|
||||||
|
//typedef typename Base::template Type<Segment_tag>::type Segment_d;
|
||||||
|
typedef typename Base::template Functor<Compare_lexicographically_tag>::type Compare_lexicographically_d;
|
||||||
|
typedef typename Base::template Functor<Orientation_of_points_tag>::type Orientation_d;
|
||||||
|
typedef typename Base::template Functor<Side_of_oriented_sphere_tag>::type Side_of_oriented_sphere_d;
|
||||||
|
typedef typename Base::template Functor<Contained_in_affine_hull_tag>::type Contained_in_affine_hull_d;
|
||||||
|
typedef typename Base::template Functor<Construct_flat_orientation_tag>::type Construct_flat_orientation_d;
|
||||||
|
typedef typename Base::template Functor<In_flat_orientation_tag>::type In_flat_orientation_d;
|
||||||
|
typedef typename Base::template Functor<In_flat_side_of_oriented_sphere_tag>::type In_flat_side_of_oriented_sphere_d;
|
||||||
|
|
||||||
|
|
||||||
|
Compare_lexicographically_d compare_lexicographically_d_object()const{ return Compare_lexicographically_d(*this); }
|
||||||
|
Orientation_d orientation_d_object()const{ return Orientation_d(*this); }
|
||||||
|
Side_of_oriented_sphere_d side_of_oriented_sphere_d_object()const{ return Side_of_oriented_sphere_d(*this); }
|
||||||
|
Contained_in_affine_hull_d contained_in_affine_hull_d_object()const{ return Contained_in_affine_hull_d(*this); }
|
||||||
|
Construct_flat_orientation_d construct_flat_orientation_d_object()const{ return Construct_flat_orientation_d(*this); }
|
||||||
|
In_flat_orientation_d in_flat_orientation_d_object()const{ return In_flat_orientation_d(*this); }
|
||||||
|
In_flat_side_of_oriented_sphere_d in_flat_side_of_oriented_sphere_d_object()const{ return In_flat_side_of_oriented_sphere_d(*this); }
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -490,4 +490,5 @@ template<class R_> struct Compare_lexicographically : private Store_kernel<R_> {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#include <CGAL/Kernel_d/Coaffine.h>
|
||||||
#endif // CGAL_KERNEL_D_FUNCTION_OBJECTS_CARTESIAN_H
|
#endif // CGAL_KERNEL_D_FUNCTION_OBJECTS_CARTESIAN_H
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,14 @@ CGAL_Kernel_pred(Compare_distance,
|
||||||
compare_distance_object)
|
compare_distance_object)
|
||||||
CGAL_Kernel_pred(Compare_lexicographically,
|
CGAL_Kernel_pred(Compare_lexicographically,
|
||||||
compare_lexicographically_object)
|
compare_lexicographically_object)
|
||||||
|
CGAL_Kernel_pred(Contained_in_affine_hull,
|
||||||
|
contained_in_affine_hull_object)
|
||||||
|
CGAL_Kernel_pred(In_flat_orientation,
|
||||||
|
in_flat_orientation_object)
|
||||||
|
CGAL_Kernel_pred(In_flat_side_of_oriented_sphere,
|
||||||
|
in_flat_side_of_oriented_sphere_object)
|
||||||
|
CGAL_Kernel_pred(Construct_flat_orientation,
|
||||||
|
construct_flat_orientation_object)
|
||||||
|
|
||||||
#undef CGAL_Kernel_pred
|
#undef CGAL_Kernel_pred
|
||||||
#undef CGAL_Kernel_comp
|
#undef CGAL_Kernel_comp
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue