Remove no longer needed predicates/constructions

follow up of 90ee311ba9
This commit is contained in:
Sébastien Loriot 2015-01-09 12:27:23 +01:00
parent 4f46679435
commit aa3feae736
2 changed files with 1 additions and 117 deletions

View File

@ -61,7 +61,6 @@ namespace CGAL
typedef Plane_dual<R> Plane_3;
typedef Segment_dual<R> Segment_3;
typedef Plane_dual<R> Triangle_3;
typedef Vector_dual<R> Vector_3;
// Traits used by convex_hull_2
typedef typename CGAL::Convex_hull_3::Traits_xy_dual<R> Traits_xy_3;
@ -89,26 +88,6 @@ namespace CGAL
}
};
// Vector_3
class Construct_vector_3 {
public:
Vector_3 operator ()(const Point_3& p,
const Point_3& q)
{
return Vector_3(p, q);
}
Vector_3 operator ()(int x,
int y,
int z)
{
Point_3 p(0, 0, 0, -1);
Point_3 q(x, y, z, -1);
return Vector_3(p, q);
}
};
// Plane_3
class Construct_plane_3 {
public:
@ -127,7 +106,6 @@ namespace CGAL
typedef Has_on_positive_side_3_dual_point<R> Has_on_positive_side_3;
typedef Less_distance_to_point_3_dual_point<R> Less_distance_to_point_3;
typedef Less_signed_distance_to_plane_3_dual_point<R> Less_signed_distance_to_plane_3;
typedef Orientation_3_dual_point<R> Orientation_3;
Construct_segment_3
construct_segment_3_object() const
@ -141,10 +119,6 @@ namespace CGAL
construct_triangle_3_object() const
{ return Construct_triangle_3(); }
Construct_vector_3
construct_vector_3_object() const
{ return Construct_vector_3(); }
Collinear_3
collinear_3_object() const
{ return Collinear_3(origin); }
@ -169,9 +143,6 @@ namespace CGAL
less_signed_distance_to_plane_3_object() const
{ return Less_signed_distance_to_plane_3(origin); }
Orientation_3
orientation_3_object() const
{ return Orientation_3(origin); }
};
// Non-filtered traits class
@ -188,7 +159,7 @@ namespace CGAL
{}
} ;
// Converter for dual planes and dual vectors
// Converter for dual planes
template <class K1, class K2>
struct Cartesian_converter_dual : public Cartesian_converter<K1, K2>
{
@ -200,12 +171,6 @@ namespace CGAL
operator()(in.p2),
operator()(in.p3));
}
Vector_dual<K2> operator() (const Vector_dual<K1> &in) const
{
return Vector_dual<K2>(operator()(in.p),
operator()(in.q));
}
};
// Filtered traits
@ -274,12 +239,6 @@ namespace CGAL
Converter_exact_dual,
Converter_approx_dual > Less_signed_distance_to_plane_3;
typedef Filtered_predicate<
typename Exact_traits::Orientation_3,
typename Filtering_traits::Orientation_3,
Converter_exact_dual,
Converter_approx_dual > Orientation_3;
Collinear_3 collinear_3_object() const
{ return Collinear_3(origin); }
@ -299,10 +258,6 @@ namespace CGAL
less_signed_distance_to_plane_3_object() const
{ return Less_signed_distance_to_plane_3(origin); }
Orientation_3
orientation_3_object() const
{ return Orientation_3(origin); }
// Constructions are inherited
};

View File

@ -67,19 +67,6 @@ namespace CGAL
{}
};
// Vector in the dual space : 2 dual points = 2 planes
template <typename K>
struct Vector_dual
{
typedef typename K::Plane_3 Plane_3;
Plane_3 p;
Plane_3 q;
Vector_dual (Plane_3 p, Plane_3 q) : p(p), q(q)
{}
};
// Predicates for dual points
// Equal
template < typename K >
@ -463,64 +450,6 @@ namespace CGAL
Point_3 origin;
};
// Orientation
template < typename K >
struct Orientation_3_dual_point
{
typedef typename K::RT RT;
typedef typename K::Plane_3 Plane_3;
typedef typename K::Point_3 Point_3;
typedef typename CGAL::Orientation result_type;
Orientation_3_dual_point (Point_3 const& o = Point_3(0, 0, 0)) :
origin(o)
{}
result_type
operator()(Vector_dual<K> const& v1,
Vector_dual<K> const& v2,
Vector_dual<K> const& v3) const
{
Plane_3 p1 = v1.p;
Plane_3 q1 = v1.q;
Plane_3 p2 = v2.p;
Plane_3 q2 = v2.q;
Plane_3 p3 = v3.p;
Plane_3 q3 = v3.q;
RT dp1 = p1.d() + origin.x() * p1.a()
+ origin.y() * p1.b() + origin.z() * p1.c();
RT dp2 = p2.d() + origin.x() * p2.a()
+ origin.y() * p2.b() + origin.z() * p2.c();
RT dp3 = p3.d() + origin.x() * p3.a()
+ origin.y() * p3.b() + origin.z() * p3.c();
RT dq1 = q1.d() + origin.x() * q1.a()
+ origin.y() * q1.b() + origin.z() * q1.c();
RT dq2 = q2.d() + origin.x() * q2.a()
+ origin.y() * q2.b() + origin.z() * q2.c();
RT dq3 = q3.d() + origin.x() * q3.a()
+ origin.y() * q3.b() + origin.z() * q3.c();
RT diff1a = p1.a() * dq1 - q1.a() * dp1;
RT diff1b = p1.b() * dq1 - q1.b() * dp1;
RT diff1c = p1.c() * dq1 - q1.c() * dp1;
RT diff2a = p2.a() * dq2 - q2.a() * dp2;
RT diff2b = p2.b() * dq2 - q2.b() * dp2;
RT diff2c = p2.c() * dq2 - q2.c() * dp2;
RT diff3a = p3.a() * dq3 - q3.a() * dp3;
RT diff3b = p3.b() * dq3 - q3.b() * dp3;
RT diff3c = p3.c() * dq3 - q3.c() * dp3;
return (CGAL::sign_of_determinant(diff1a, diff2a, diff3a,
diff1b, diff2b, diff3b,
diff1c, diff2c, diff3c));
}
private:
Point_3 origin;
};
} // namespace Convex_hull_3
} // namespace CGAL