Typedefs for the weighted_point interfaces.

This commit is contained in:
Marc Glisse 2014-05-28 17:17:35 +02:00
parent 66679e327d
commit 1d2d456d17
2 changed files with 24 additions and 11 deletions

View File

@ -54,6 +54,7 @@ template <class Base_> struct Kernel_d_interface : public Base_ {
typedef typename Get_type<Base, Ray_tag>::type Ray_d;
typedef typename Get_type<Base, Iso_box_tag>::type Iso_box_d;
typedef typename Get_type<Base, Aff_transformation_tag>::type Aff_transformation_d;
typedef typename Get_type<Base, Weighted_point_tag>::type Weighted_point_d;
typedef typename Get_functor<Base, Compute_point_cartesian_coordinate_tag>::type Compute_coordinate_d;
typedef typename Get_functor<Base, Compare_lexicographically_tag>::type Compare_lexicographically_d;
typedef typename Get_functor<Base, Equal_points_tag>::type Equal_d;
@ -64,10 +65,12 @@ template <class Base_> struct Kernel_d_interface : public Base_ {
typedef typename Get_functor<Base, Less_point_cartesian_coordinate_tag>::type Less_coordinate_d;
typedef typename Get_functor<Base, Point_dimension_tag>::type Point_dimension_d;
typedef typename Get_functor<Base, Side_of_oriented_sphere_tag>::type Side_of_oriented_sphere_d;
typedef typename Get_functor<Base, Power_test_tag>::type Power_test_d;
typedef typename Get_functor<Base, Contained_in_affine_hull_tag>::type Contained_in_affine_hull_d;
typedef typename Get_functor<Base, Construct_flat_orientation_tag>::type Construct_flat_orientation_d;
typedef typename Get_functor<Base, In_flat_orientation_tag>::type In_flat_orientation_d;
typedef typename Get_functor<Base, In_flat_side_of_oriented_sphere_tag>::type In_flat_side_of_oriented_sphere_d;
typedef typename Get_functor<Base, In_flat_power_test_tag>::type In_flat_power_test_d;
typedef typename Get_functor<Base, Point_to_vector_tag>::type Point_to_vector_d;
typedef typename Get_functor<Base, Vector_to_point_tag>::type Vector_to_point_d;
typedef typename Get_functor<Base, Construct_ttag<Point_tag> >::type Construct_point_d;
@ -80,6 +83,7 @@ template <class Base_> struct Kernel_d_interface : public Base_ {
typedef typename Get_functor<Base, Construct_ttag<Ray_tag> >::type Construct_ray_d;
typedef typename Get_functor<Base, Construct_ttag<Iso_box_tag> >::type Construct_iso_box_d;
typedef typename Get_functor<Base, Construct_ttag<Aff_transformation_tag> >::type Construct_aff_transformation_d;
typedef typename Get_functor<Base, Construct_ttag<Weighted_point_tag> >::type Construct_weighted_point_d;
typedef typename Get_functor<Base, Midpoint_tag>::type Midpoint_d;
struct Component_accessor_d : private Store_kernel<Kernel> {
typedef Kernel R_; // for the macro
@ -145,6 +149,9 @@ template <class Base_> struct Kernel_d_interface : public Base_ {
typedef typename Get_functor<Base, Orthogonal_vector_tag>::type Orthogonal_vector_d;
typedef typename Get_functor<Base, Linear_base_tag>::type Linear_base_d;
typedef typename Get_functor<Base, Point_weight_tag>::type Point_weight_d;
typedef typename Get_functor<Base, Point_drop_weight_tag>::type Point_drop_weight_d;
//TODO:
//typedef ??? Intersect_d;
@ -161,6 +168,7 @@ template <class Base_> struct Kernel_d_interface : public Base_ {
Point_dimension_d point_dimension_d_object()const{ return Point_dimension_d(*this); }
Point_of_sphere_d point_of_sphere_d_object()const{ return Point_of_sphere_d(*this); }
Side_of_oriented_sphere_d side_of_oriented_sphere_d_object()const{ return Side_of_oriented_sphere_d(*this); }
Power_test_d power_test_d_object()const{ return Power_test_d(*this); }
Side_of_bounded_sphere_d side_of_bounded_sphere_d_object()const{ return Side_of_bounded_sphere_d(*this); }
Contained_in_affine_hull_d contained_in_affine_hull_d_object()const{ return Contained_in_affine_hull_d(*this); }
Contained_in_linear_hull_d contained_in_linear_hull_d_object()const{ return Contained_in_linear_hull_d(*this); }
@ -168,6 +176,7 @@ template <class Base_> struct Kernel_d_interface : public Base_ {
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); }
In_flat_power_test_d in_flat_power_test_d_object()const{ return In_flat_power_test_d(*this); }
Point_to_vector_d point_to_vector_d_object()const{ return Point_to_vector_d(*this); }
Vector_to_point_d vector_to_point_d_object()const{ return Vector_to_point_d(*this); }
Affine_rank_d affine_rank_d_object()const{ return Affine_rank_d(*this); }
@ -193,6 +202,10 @@ template <class Base_> struct Kernel_d_interface : public Base_ {
Construct_ray_d construct_ray_d_object()const{ return Construct_ray_d(*this); }
Construct_iso_box_d construct_iso_box_d_object()const{ return Construct_iso_box_d(*this); }
Construct_aff_transformation_d construct_aff_transformation_d_object()const{ return Construct_aff_transformation_d(*this); }
Construct_weighted_point_d construct_weighted_point_d_object()const{ return Construct_weighted_point_d(*this); }
Point_weight_d point_weight_d_object()const{ return Point_weight_d(*this); }
Point_drop_weight_d point_drop_weight_d_object()const{ return Point_drop_weight_d(*this); }
// Dummies for those required functors missing a concept.
typedef Null_functor Position_on_line_d;

View File

@ -516,17 +516,17 @@ void test3(){
assert(ifsos(fozp, tz+0, tz+3, tz[5]) == CGAL::ON_NEGATIVE_SIDE);
assert(ifsos(fozn, tz+0, tz+3, tz[5]) == CGAL::ON_POSITIVE_SIDE);
typedef typename CGAL::Get_type<K1, CGAL::Weighted_point_tag>::type WP;
typedef typename CGAL::Get_functor<K1, CGAL::Construct_ttag<CGAL::Weighted_point_tag> >::type CWP;
typedef typename CGAL::Get_functor<K1, CGAL::Point_drop_weight_tag>::type PDW;
typedef typename CGAL::Get_functor<K1, CGAL::Point_weight_tag>::type PW;
typedef typename CGAL::Get_functor<K1, CGAL::Power_test_tag>::type PT;
typedef typename CGAL::Get_functor<K1, CGAL::In_flat_power_test_tag>::type IFPT;
CWP cwp (k);
PDW pdw (k);
PW pw (k);
PT pt (k);
IFPT ifpt (k);
typedef typename K1::Weighted_point_d WP;
typedef typename K1::Construct_weighted_point_d CWP;
typedef typename K1::Point_drop_weight_d PDW;
typedef typename K1::Point_weight_d PW;
typedef typename K1::Power_test_d PT;
typedef typename K1::In_flat_power_test_d IFPT;
CWP cwp Kinit(construct_weighted_point_d_object);
PDW pdw Kinit(point_drop_weight_d_object);
PW pw Kinit(point_weight_d_object);
PT pt Kinit(power_test_d_object);
IFPT ifpt Kinit(in_flat_power_test_d_object);
WP wp = cwp (x1, 2);
WP xw6 = cwp (x6, 0);
assert (pw(wp) == 2);