Cleaning stuffs temporarily

This commit is contained in:
Pedro Machado Manhaes de Castro 2008-07-24 13:13:12 +00:00
parent 360f765f8f
commit 65e7bd6974
23 changed files with 12 additions and 2774 deletions

15
.gitattributes vendored
View File

@ -1595,21 +1595,6 @@ Circular_kernel_3/demo/Circular_kernel_3/images/button_texture.gif -text svneol=
Circular_kernel_3/demo/Circular_kernel_3/images/button_wire.gif -text svneol=unset#image/gif
Circular_kernel_3/demo/Circular_kernel_3/images/d_solid_b.gif -text svneol=unset#image/gif
Circular_kernel_3/demo/Circular_kernel_3/images/d_wire_b.gif -text svneol=unset#image/gif
Circular_kernel_3/include/CGAL/Circle_on_reference_sphere_3.h -text
Circular_kernel_3/include/CGAL/Circular_arc_on_reference_sphere_3.h -text
Circular_kernel_3/include/CGAL/Circular_arc_point_on_reference_sphere_3.h -text
Circular_kernel_3/include/CGAL/Circular_kernel_3/Circle_on_reference_sphere_3.h -text
Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_point_on_reference_sphere_3.h -text
Circular_kernel_3/include/CGAL/Circular_kernel_3/Half_circle_on_reference_sphere_3.h -text
Circular_kernel_3/include/CGAL/Circular_kernel_3/Sphere_with_radius_3.h -text
Circular_kernel_3/include/CGAL/Circular_kernel_3/Theta_rep.h -text
Circular_kernel_3/include/CGAL/Circular_kernel_3/constant.h -text
Circular_kernel_3/include/CGAL/Circular_kernel_3/function_objects_polynomial_reference_sphere.h -text
Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_function_compare_to_left_spherical_kernel.h -text
Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_reference_sphere_3.h -text
Circular_kernel_3/include/CGAL/Half_circle_on_reference_sphere_3.h -text
Circular_kernel_3/include/CGAL/Sphere_with_radius_3.h -text
Circular_kernel_3/include/CGAL/Theta_rep.h -text
Circular_kernel_3/test/Circular_kernel_3/test_Lazy_Spherical_kernel.cpp -text
Convex_decomposition_3/demo/Convex_decomposition_3/star.nef3 -text
Convex_decomposition_3/doc_tex/Convex_decomposition_3/PkgDescription.tex -text

View File

@ -1,113 +0,0 @@
// Copyright (c) 2005-2006 INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; version 2.1 of the License.
// See the file LICENSE.LGPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// Partially supported by the IST Programme of the EU as a Shared-cost
// RTD (FET Open) Project under Contract No IST-2000-26473
// (ECG - Effective Computational Geometry for Curves and Surfaces)
// and a STREP (FET Open) Project under Contract No IST-006413
// (ACS -- Algorithms for Complex Shapes)
//
// $URL: svn+ssh://sloriot@scm.gforge.inria.fr/svn/cgal/trunk/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_3.h $
// $Id: Circular_arc_3.h 40627 2007-10-16 15:00:59Z sloriot $
//
// Author(s) : Loriot Sebastien <Sebastien.Loriot@sophia.inria.fr>
// Monique Teillaud <Monique.Teillaud@sophia.inria.fr>
// Sylvain Pion <Sylvain.Pion@sophia.inria.fr>
// Pedro Machado <tashimir@gmail.com>
// Julien Hazebrouck
// Damien Leroy
#ifndef CGAL_CIRCLE_ON_REFERENCE_SPHERE_3_H
#define CGAL_CIRCLE_ON_REFERENCE_SPHERE_3_H
namespace CGAL {
template < typename SphericalKernel >
class Circle_on_reference_sphere_3
: public SphericalKernel::Kernel_base::Circle_on_reference_sphere_3
{
typedef typename SphericalKernel::Kernel_base::Circle_on_reference_sphere_3
RCircle_on_reference_sphere_3;
typedef typename SphericalKernel::Point_3 Point_3;
typedef typename SphericalKernel::FT FT;
typedef typename SphericalKernel::Algebraic_kernel AK;
typedef typename SphericalKernel::Root_for_spheres_2_3 Root_for_spheres_2_3;
public:
typedef SphericalKernel R;
typedef RCircle_on_reference_sphere_3 Repd;
const Repd& rep() const
{
return *this;
}
Repd& rep()
{
return *this;
}
Circle_on_reference_sphere_3()
:RCircle_on_reference_sphere_3(){}
Circle_on_reference_sphere_3(const RCircle_on_reference_sphere_3& p)
:RCircle_on_reference_sphere_3(p){}
Circle_on_reference_sphere_3(const FT& _r,const Point_3& _c,const typename SphericalKernel::Sphere_with_radius_3& S)
: RCircle_on_reference_sphere_3(
typename R::Construct_circle_on_reference_sphere_3()(_r,_c,S))
{}
Circle_on_reference_sphere_3(const FT& _r,const Point_3& _c,CGAL::Circle_type nat,const typename SphericalKernel::Sphere_with_radius_3& S)
: RCircle_on_reference_sphere_3(
typename R::Construct_circle_on_reference_sphere_3()(_r,_c,nat,S))
{}
typename Qualified_result_of<typename R::Compute_type_of_circle_on_reference_sphere_3,Circle_on_reference_sphere_3>::type
type_of_circle_on_reference_sphere() const
{ return typename R::Compute_type_of_circle_on_reference_sphere_3()(*this);}
typename Qualified_result_of<typename R::Compute_supporting_sphere_radius_3,Circle_on_reference_sphere_3>::type
supporting_sphere_radius() const
{ return typename R::Compute_supporting_sphere_radius_3()(*this);}
typename Qualified_result_of<typename R::Compute_supporting_sphere_squared_radius_3,Circle_on_reference_sphere_3>::type
supporting_sphere_squared_radius() const
{ return typename R::Compute_supporting_sphere_squared_radius_3()(*this);}
typename Qualified_result_of<typename R::Compute_supporting_sphere_center_3,Circle_on_reference_sphere_3>::type
supporting_sphere_center() const
{ return typename R::Compute_supporting_sphere_center_3()(*this);}
typename Qualified_result_of<typename R::Compute_reference_sphere_3,Circle_on_reference_sphere_3>::type
reference_sphere() const
{ return typename R::Compute_reference_sphere_3()(*this);}
typename Qualified_result_of<typename R::Compute_extremal_point_z,Circle_on_reference_sphere_3>::type
extremal_point_z() const
{ return typename R::Compute_extremal_point_z()(*this);}
typename Qualified_result_of<typename R::Compute_circle_center_coefficient_3,Circle_on_reference_sphere_3>::type
circle_center_coefficient() const
{ return typename R::Compute_circle_center_coefficient_3()(*this);}
};
}
#endif

View File

@ -1,132 +0,0 @@
// Copyright (c) 2005-2006 INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; version 2.1 of the License.
// See the file LICENSE.LGPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// Partially supported by the IST Programme of the EU as a Shared-cost
// RTD (FET Open) Project under Contract No IST-2000-26473
// (ECG - Effective Computational Geometry for Curves and Surfaces)
// and a STREP (FET Open) Project under Contract No IST-006413
// (ACS -- Algorithms for Complex Shapes)
//
// $URL: svn+ssh://sloriot@scm.gforge.inria.fr/svn/cgal/trunk/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_3.h $
// $Id: Circular_arc_3.h 40627 2007-10-16 15:00:59Z sloriot $
//
// Author(s) : Loriot Sebastien <Sebastien.Loriot@sophia.inria.fr>
// Monique Teillaud <Monique.Teillaud@sophia.inria.fr>
// Sylvain Pion <Sylvain.Pion@sophia.inria.fr>
// Pedro Machado <tashimir@gmail.com>
// Julien Hazebrouck
// Damien Leroy
#ifndef CGAL_CIRCULAR_ARC_ON_REFERENCE_SPHERE_3_H
#define CGAL_CIRCULAR_ARC_ON_REFERENCE_SPHERE_3_H
//~ #include <CGAL/Circular_arc_3.h>
//~ #include <CGAL/utility.h>
//~ #include <CGAL/Circular_kernel_3/internal_functions_on_circular_arc_3.h>
namespace CGAL {
template <class SK>
class Circular_arc_on_reference_sphere_3
//~ : public SK::Kernel_base::Circular_arc_on_reference_sphere_3, public CGAL::Circular_arc_3<SK>
: public SK::Kernel_base::Circular_arc_on_reference_sphere_3
{
typedef typename SK::RT RT;
typedef typename SK::FT FT;
typedef typename SK::Line_3 Line_3;
typedef typename SK::Point_3 Point_3;
typedef typename SK::Plane_3 Plane_3;
typedef typename SK::Circle_on_reference_sphere_3 Circle_3;
typedef typename SK::Sphere_with_radius_3 Sphere_3;
typedef typename SK::Segment_3 Segment_3;
typedef typename SK::Circular_arc_point_on_reference_sphere_3 Circular_arc_point_3;
typedef typename SK::Kernel_base::Circular_arc_on_reference_sphere_3 RCircular_arc_on_reference_sphere_3;
typedef typename CGAL::Circular_arc_3<SK> Circular_arc_3;
public:
typedef RCircular_arc_on_reference_sphere_3 Rep;
typedef SK R;
const Rep& rep() const
{
return *this;
}
Rep& rep()
{
return *this;
}
Circular_arc_on_reference_sphere_3(const RCircular_arc_on_reference_sphere_3 &a)
: RCircular_arc_on_reference_sphere_3(a)
{}
Circular_arc_on_reference_sphere_3()
: RCircular_arc_on_reference_sphere_3(typename R::Construct_circular_arc_on_reference_sphere_3()())
{}
Circular_arc_on_reference_sphere_3(const Circle_3& c,
const Circular_arc_point_3& s,
const Circular_arc_point_3& t)
: RCircular_arc_on_reference_sphere_3(typename R::Construct_circular_arc_on_reference_sphere_3()(c,s,t)){}
Circular_arc_on_reference_sphere_3(const Circle_3& c,
const Point_3& s,
const Circular_arc_point_3& t)
:RCircular_arc_on_reference_sphere_3(typename R::Construct_circular_arc_on_reference_sphere_3()(c,s,t)){}
Circular_arc_on_reference_sphere_3(const Circle_3& c,
const Circular_arc_point_3& s,
const Point_3& t)
: RCircular_arc_on_reference_sphere_3(typename R::Construct_circular_arc_on_reference_sphere_3()(c,s,t)){}
Circular_arc_on_reference_sphere_3(const Circle_3& c,
const Point_3& s,
const Point_3& t)
: RCircular_arc_on_reference_sphere_3(typename R::Construct_circular_arc_on_reference_sphere_3()(c,s,t)){}
Circular_arc_on_reference_sphere_3(const Circle_3& c)
: RCircular_arc_on_reference_sphere_3(typename R::Construct_circular_arc_on_reference_sphere_3()(c)){}
Circular_arc_on_reference_sphere_3(const Circle_3 &c,
const Sphere_3 &s1, bool less_xyz_s1,
const Sphere_3 &s2, bool less_xyz_s2)
: RCircular_arc_on_reference_sphere_3(typename R::Construct_circular_arc_on_reference_sphere_3()(c,s1,less_xyz_s1,s2,less_xyz_s2)){}
Circular_arc_on_reference_sphere_3(const Sphere_3 &s1, bool less_xyz_s1,
const Sphere_3 &s2, bool less_xyz_s2,
const Circle_3 &c)
: RCircular_arc_on_reference_sphere_3(typename R::Construct_circular_arc_on_reference_sphere_3()(s1,less_xyz_s1,s2,less_xyz_s2,c)){}
Circular_arc_on_reference_sphere_3(const Circle_3 &c,
const Plane_3 &p1, bool less_xyz_p1,
const Plane_3 &p2, bool less_xyz_p2)
: RCircular_arc_on_reference_sphere_3(typename R::Construct_circular_arc_on_reference_sphere_3()(c,p1,less_xyz_p1,p2,less_xyz_p2)){}
Circular_arc_on_reference_sphere_3(const Plane_3 &p1, bool less_xyz_p1,
const Plane_3 &p2, bool less_xyz_p2,
const Circle_3 &c)
: RCircular_arc_on_reference_sphere_3(typename R::Construct_circular_arc_on_reference_sphere_3()(p1,less_xyz_p1,p2,less_xyz_p2,c)){}
typename Qualified_result_of
<typename R::Compute_reference_sphere_3,Circular_arc_on_reference_sphere_3>::type
reference_sphere() const
{
return typename R::Compute_reference_sphere_3()(*this);
}
};
}
#endif

View File

@ -1,124 +0,0 @@
// Copyright (c) 2005-2006 INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; version 2.1 of the License.
// See the file LICENSE.LGPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// Partially supported by the IST Programme of the EU as a Shared-cost
// RTD (FET Open) Project under Contract No IST-2000-26473
// (ECG - Effective Computational Geometry for Curves and Surfaces)
// and a STREP (FET Open) Project under Contract No IST-006413
// (ACS -- Algorithms for Complex Shapes)
//
// $URL: svn+ssh://sloriot@scm.gforge.inria.fr/svn/cgal/trunk/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_3.h $
// $Id: Circular_arc_3.h 40627 2007-10-16 15:00:59Z sloriot $
//
// Author(s) : Loriot Sebastien <Sebastien.Loriot@sophia.inria.fr>
// Monique Teillaud <Monique.Teillaud@sophia.inria.fr>
// Sylvain Pion <Sylvain.Pion@sophia.inria.fr>
// Pedro Machado <tashimir@gmail.com>
// Julien Hazebrouck
// Damien Leroy
#ifndef CGAL_CIRCULAR_ARC_POINT_ON_REFERENCE_SPHERE_3_H
#define CGAL_CIRCULAR_ARC_POINT_ON_REFERENCE_SPHERE_3_H
namespace CGAL {
template < typename SphericalKernel >
class Circular_arc_point_on_reference_sphere_3
: public SphericalKernel::Kernel_base::Circular_arc_point_on_reference_sphere_3
{
typedef typename SphericalKernel::Kernel_base::Circular_arc_point_on_reference_sphere_3
RCircular_arc_point_on_reference_sphere_3;
typedef typename SphericalKernel::Root_of_2 Root_of_2;
typedef typename SphericalKernel::Point_3 Point_3;
typedef typename SphericalKernel::Plane_3 Plane_3;
typedef typename SphericalKernel::Line_3 Line_3;
typedef typename SphericalKernel::Circle_3 Circle_3;
typedef typename SphericalKernel::Sphere_3 Sphere_3;
typedef typename SphericalKernel::FT FT;
typedef typename SphericalKernel::Algebraic_kernel AK;
public:
typedef typename SphericalKernel::Root_for_spheres_2_3
Root_for_spheres_2_3;
typedef SphericalKernel R;
typedef RCircular_arc_point_on_reference_sphere_3 Repd;
const Repd& rep() const
{
return *this;
}
Repd& rep()
{
return *this;
}
Circular_arc_point_on_reference_sphere_3(const RCircular_arc_point_on_reference_sphere_3& p)
:RCircular_arc_point_on_reference_sphere_3(p){}
Circular_arc_point_on_reference_sphere_3()
: RCircular_arc_point_on_reference_sphere_3(
typename R::Construct_circular_arc_point_on_reference_sphere_3()())
{}
Circular_arc_point_on_reference_sphere_3(const FT& ftheta,const FT& xt,const FT& yt,const FT& zt,const HQ_NT& _hq)
: RCircular_arc_point_on_reference_sphere_3(
typename R::Construct_circular_arc_point_on_reference_sphere_3()(ftheta,xt,yt,zt,_hq))
{}
Circular_arc_point_on_reference_sphere_3(const HQ_NT& _hq,const Root_of_2& ftheta,const Root_of_2& x_,const Root_of_2& y_,const Root_of_2& z_)
: RCircular_arc_point_on_reference_sphere_3(
typename R::Construct_circular_arc_point_on_reference_sphere_3()(_hq,ftheta,x_,y_,z_))
{}
Circular_arc_point_on_reference_sphere_3(const HQ_NT& hq,const typename AK::Root_for_spheres_2_3& R)
: RCircular_arc_point_on_reference_sphere_3(hq,R)
{}
Circular_arc_point_on_reference_sphere_3(const HQ_NT& hq,const typename SphericalKernel::Circular_arc_point_3& R)
: RCircular_arc_point_on_reference_sphere_3(hq,R)
{}
Circular_arc_point_on_reference_sphere_3(const HQ_NT& _hq,const Root_of_2& ftheta,const typename AK::Root_for_spheres_2_3& rfs)
: RCircular_arc_point_on_reference_sphere_3(
typename R::Construct_circular_arc_point_on_reference_sphere_3()(_hq,ftheta,rfs))
{}
typename Qualified_result_of<typename R::Compute_circular_theta_rep_3,Circular_arc_point_on_reference_sphere_3>::type
theta_rep() const
{ return typename R::Compute_circular_theta_rep_3()(*this);}
typename Qualified_result_of<typename R::Compute_circular_theta_3,Circular_arc_point_on_reference_sphere_3>::type
//const Root_of_2 &
get_f_of_theta() const
{ return typename R::Compute_circular_theta_3()(*this);}
typename Qualified_result_of<typename R::Compute_circular_hq_3,Circular_arc_point_on_reference_sphere_3>::type
get_hq() const
{ return typename R::Compute_circular_hq_3()(*this);}
//~ Bbox_3 bbox() const
//~ { return typename R::Construct_bbox_3()(*this); }
};
}
#endif

View File

@ -1,96 +0,0 @@
// Copyright (c) 2005-2006 INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; version 2.1 of the License.
// See the file LICENSE.LGPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// Partially supported by the IST Programme of the EU as a Shared-cost
// RTD (FET Open) Project under Contract No IST-2000-26473
// (ECG - Effective Computational Geometry for Curves and Surfaces)
// and a STREP (FET Open) Project under Contract No IST-006413
// (ACS -- Algorithms for Complex Shapes)
//
// $URL: svn+ssh://sloriot@scm.gforge.inria.fr/svn/cgal/trunk/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_3.h $
// $Id: Circular_arc_3.h 40627 2007-10-16 15:00:59Z sloriot $
//
// Author(s) : Loriot Sebastien <Sebastien.Loriot@sophia.inria.fr>
// Monique Teillaud <Monique.Teillaud@sophia.inria.fr>
// Sylvain Pion <Sylvain.Pion@sophia.inria.fr>
// Pedro Machado <tashimir@gmail.com>
// Julien Hazebrouck
// Damien Leroy
#ifndef CGAL_SPHERICAL_CIRCLE_ON_REFERENCE_SPHERE_H
#define CGAL_SPHERICAL_CIRCLE_ON_REFERENCE_SPHERE_H
#include <CGAL/Circular_kernel_3/Circle_3.h>
#include <CGAL/Sphere_with_radius_3.h>
namespace CGAL {
namespace CGALi {
template<class SK>
class Circle_on_reference_sphere_3
: public CGAL::CGALi::Circle_3<SK,CGAL::CGALi::Circle_representation_3
<typename CGAL::Sphere_with_radius_3<SK>,typename CGAL::Sphere_with_radius_3<SK>,SK > >{
protected:
typedef typename SK::Point_3 Point_3;
typedef typename SK::FT FT;
//~ typedef typename SK::Sphere_with_radius_3 Sphere_3;
public:
typedef CGAL::CGALi::Circle_3<SK,CGAL::CGALi::Circle_representation_3<
typename CGAL::Sphere_with_radius_3<SK>,
typename CGAL::Sphere_with_radius_3<SK>,SK > > Circle_3;
typedef typename SK::Sphere_with_radius_3 Sphere_3;
protected:
Circle_type _nature;//NORMAL,THREADED,POLAR,BIPOLAR
public:
Circle_on_reference_sphere_3():Circle_3(){}
Circle_on_reference_sphere_3(const FT& _r,const Point_3& _c,const Sphere_3& ref):Circle_3(Sphere_3(_r,_c),ref){
_nature=CGAL::classify_one_circle<SK>(*this);
}
Circle_on_reference_sphere_3(const FT& _r,const Point_3& _c,Circle_type nat,const Sphere_3& ref):Circle_3(Sphere_3(_r,_c),ref),_nature(nat){}
const Circle_type& type_of_circle_on_reference_sphere() const { return _nature;}
const FT& supporting_sphere_radius() const { return this->supporting_sphere().radius();}
//BAD BAD BAD BAD BAD BAD BAD BAD BAD BAD BAD BAD BAD BAD
//~ const FT& supporting_sphere_squared_radius() const { return this->supporting_sphere().squared_radius();}
FT supporting_sphere_squared_radius() const { return this->supporting_sphere().squared_radius();}
//BAD BAD BAD BAD BAD BAD BAD BAD BAD BAD BAD BAD BAD BAD
//~ const Point_3& supporting_sphere_center() const { return this->supporting_sphere().center();}
Point_3 supporting_sphere_center() const { return this->supporting_sphere().center();}
const Sphere_3& reference_sphere() const{return this->base.reference_sphere();}
//according center of the circle=reference_sphere().center() + circle_center_coefficient() * (supporting_sphere().center()-reference_sphere().center())
FT circle_center_coefficient() const {
Point_3 center=this->supporting_sphere().center();
return CGAL::circle_center_coefficent(center.x(),center.y(),center.z(),this->supporting_sphere().squared_radius(),reference_sphere().squared_radius());
}
FT extremal_point_z() const { return 2 / CGAL::compute_a<FT>(this->supporting_sphere().center(),
reference_sphere().squared_radius(),this->supporting_sphere().squared_radius())
* this->supporting_sphere().center().z() * reference_sphere().squared_radius();}
};
}
}
#endif

View File

@ -30,32 +30,22 @@
namespace CGAL {
namespace CGALi{
template <class SK,class Circle=CGAL::Circle_3<SK>, class Circular_arc_point=CGAL::Circular_arc_point_3<SK> >
template < class SK >
class Circular_arc_3 {
typedef typename SK::Plane_3 Plane_3;
//~ typedef typename SK::Circle_3 Circle_3;
typedef Circle Circle_3;
//~ typedef typename SK::Sphere_3 Sphere_3;
typedef typename Circle_3::Sphere_3 Sphere_3;
typedef typename SK::Circle_3 Circle_3;
typedef typename SK::Sphere_3 Sphere_3;
typedef typename SK::Point_3 Point_3;
//~ typedef typename SK::Circular_arc_point_3 Circular_arc_point_3;
typedef Circular_arc_point Circular_arc_point_3;
typedef typename SK::Circular_arc_point_3 Circular_arc_point_3;
typedef typename SK::Line_3 Line_3;
typedef typename SK::FT FT;
private:
const Sphere_3& get_ref_sphere(const typename SK::Circle_on_reference_sphere_3& C){return C.reference_sphere();}
Sphere_3 get_ref_sphere(const typename SK::Circle_3& C){CGAL_error();}
typedef Triple<Circle_3, Circular_arc_point_3,
Circular_arc_point_3> Rep;
typedef typename SK::template Handle<Rep>::type Base;
Base base;
mutable bool _full;
// It is the sign of the cross product
@ -244,10 +234,8 @@ namespace CGAL {
return _sign_cross_product;
}
static double pi;
double approximate_angle() const {
if(is_full()) return 2.0*pi;
if(is_full()) return 2.0*CGAL_PI;
const double x1 = to_double(source().x());
const double y1 = to_double(source().y());
const double z1 = to_double(source().z());
@ -260,7 +248,7 @@ namespace CGAL {
const double d_sq = dx*dx + dy*dy + dz*dz;
const double r_sq = to_double(squared_radius());
const double ap_ang = 2.0 * std::asin(0.5 * std::sqrt(d_sq / r_sq));
if(sign_cross_product() == NEGATIVE) return 2.0 * pi - ap_ang;
if(sign_cross_product() == NEGATIVE) return 2.0 * CGAL_PI - ap_ang;
else return ap_ang;
}
@ -280,23 +268,20 @@ namespace CGAL {
};
template < class SK ,class Circle, class Circular_arc_point>
double Circular_arc_3<SK,Circle,Circular_arc_point>::pi = CGAL_PI;
template < class SK ,class Circle, class Circular_arc_point>
template < class SK >
CGAL_KERNEL_INLINE
bool
Circular_arc_3<SK,Circle,Circular_arc_point>::operator==(const Circular_arc_3<SK,Circle,Circular_arc_point> &t) const
Circular_arc_3<SK>::operator==(const Circular_arc_3<SK> &t) const
{
if (CGAL::identical(base, t.base))
return true;
return CGAL::SphericalFunctors::non_oriented_equal<SK>(*this, t);
}
template < class SK ,class Circle, class Circular_arc_point>
template < class SK >
CGAL_KERNEL_INLINE
bool
Circular_arc_3<SK,Circle,Circular_arc_point>::operator!=(const Circular_arc_3<SK,Circle,Circular_arc_point> &t) const
Circular_arc_3<SK>::operator!=(const Circular_arc_3<SK> &t) const
{
return !(*this == t);
}

View File

@ -1,100 +0,0 @@
// Copyright (c) 2005-2006 INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; version 2.1 of the License.
// See the file LICENSE.LGPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// Partially supported by the IST Programme of the EU as a Shared-cost
// RTD (FET Open) Project under Contract No IST-2000-26473
// (ECG - Effective Computational Geometry for Curves and Surfaces)
// and a STREP (FET Open) Project under Contract No IST-006413
// (ACS -- Algorithms for Complex Shapes)
//
// $URL: svn+ssh://sloriot@scm.gforge.inria.fr/svn/cgal/trunk/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_3.h $
// $Id: Circular_arc_3.h 40627 2007-10-16 15:00:59Z sloriot $
//
// Author(s) : Loriot Sebastien <Sebastien.Loriot@sophia.inria.fr>
// Monique Teillaud <Monique.Teillaud@sophia.inria.fr>
// Sylvain Pion <Sylvain.Pion@sophia.inria.fr>
// Pedro Machado <tashimir@gmail.com>
// Julien Hazebrouck
// Damien Leroy
#ifndef CGAL_SPHERICAL_KERNEL_CIRCULAR_ARC_POINT_ON_REFERENCE_SPHERE_3_H
#define CGAL_SPHERICAL_KERNEL_CIRCULAR_ARC_POINT_ON_REFERENCE_SPHERE_3_H
#include <iostream>
#include <CGAL/Cartesian.h>
#include <CGAL/Circular_arc_point_3.h>
#include <CGAL/Circular_kernel_3/constant.h>
namespace CGAL {
namespace CGALi {
template<class SK>
class Circular_arc_point_on_reference_sphere_3:public Circular_arc_point_3<SK>{
typedef typename SK::Algebraic_kernel::Root_of_2 Root_of_2;
typedef typename SK::FT FT;
typedef typename SK::Algebraic_kernel AK;
typedef Circular_arc_point_3<SK> T_Circular_arc_point_3;
typedef typename SK::Theta_rep Theta_rep;
//---------------
Theta_rep Trep;
public:
Circular_arc_point_on_reference_sphere_3(const FT& ftheta,const FT& xt,const FT& yt,const FT& zt,const CGAL::HQ_NT& _hq)
:T_Circular_arc_point_3(typename SK::Point_3(xt,yt,zt)),Trep(_hq,ftheta){};//critical point of non normal circles
Circular_arc_point_on_reference_sphere_3(const CGAL::HQ_NT& _hq,const Root_of_2& ftheta,const Root_of_2& x_,const Root_of_2& y_,const Root_of_2& z_)
:T_Circular_arc_point_3(x_,y_,z_),Trep(_hq,ftheta){};
Circular_arc_point_on_reference_sphere_3(const CGAL::HQ_NT& _hq,const Root_of_2& ftheta,const typename SK::Algebraic_kernel::Root_for_spheres_2_3& rfs)
:T_Circular_arc_point_3(rfs),Trep(_hq,ftheta){};
Circular_arc_point_on_reference_sphere_3():T_Circular_arc_point_3(FT(0),FT(0),FT(0)),Trep(-1,FT(0)){};
Circular_arc_point_on_reference_sphere_3(const CGAL::HQ_NT& hq,const typename AK::Root_for_spheres_2_3& R):T_Circular_arc_point_3(R),Trep(hq,CGAL::auto_ftype(hq)==CGAL::TAN?(R.y()/R.x()):(R.x()/R.y())){};
Circular_arc_point_on_reference_sphere_3(const CGAL::HQ_NT& hq,const T_Circular_arc_point_3& R):T_Circular_arc_point_3(R),Trep(hq,CGAL::auto_ftype(hq)==CGAL::TAN?(R.y()/R.x()):(R.x()/R.y())){};
//~ static inline Circular_arc_point_on_reference_sphere_3 VirtualPt_to_point_on_sphere(){
//~ return Circular_arc_point_on_reference_sphere_3(FT(0),FT(0),FT(0),FT(0),HQ_NT(-1));
//~ };
//~ static inline Circular_arc_point_on_reference_sphere_3 Root_for_sphere_to_point_on_sphere(const CGAL::HQ_NT& hq,const typename AK::Root_for_spheres_2_3& R){
//~ return Circular_arc_point_on_reference_sphere_3(hq,auto_ftype(hq)==TAN?(R.y()/R.x()):(R.x()/R.y()),R);
//~ };
const Theta_rep& theta_rep() const {return Trep;};
const Root_of_2& get_f_of_theta() const {return theta_rep().ftheta();};
const CGAL::HQ_NT& get_hq() const {return theta_rep().hq();}
double get_theta_approx() const{
double ax=CGAL::to_double(this->x());
double ay=CGAL::to_double(this->y());
return ( (atan2 (ay,ax)<0)?(atan2 (ay,ax)+2.*M_PI):(atan2 (ay,ax)) );
};
//TODO : must remove this function and put it in to double or something like thing + remove include Cartesian
CGAL::Cartesian<double>::Point_3 get_point_approx() const {//just for intersection and critical points of normal circles
return CGAL::Cartesian<double>::Point_3(CGAL::to_double(this->x()),CGAL::to_double(this->y()),CGAL::to_double(this->z()));
}
};
} // namespace CGALi
} // namespace CGAL
#endif //CGAL_SPHERICAL_KERNEL_CIRCULAR_ARC_POINT_ON_REFERENCE_SPHERE_3_H

View File

@ -1,52 +0,0 @@
// Copyright (c) 2005-2006 INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; version 2.1 of the License.
// See the file LICENSE.LGPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// Partially supported by the IST Programme of the EU as a Shared-cost
// RTD (FET Open) Project under Contract No IST-2000-26473
// (ECG - Effective Computational Geometry for Curves and Surfaces)
// and a STREP (FET Open) Project under Contract No IST-006413
// (ACS -- Algorithms for Complex Shapes)
//
// $URL: svn+ssh://sloriot@scm.gforge.inria.fr/svn/cgal/trunk/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_3.h $
// $Id: Circular_arc_3.h 40627 2007-10-16 15:00:59Z sloriot $
//
// Author(s) : Loriot Sebastien <Sebastien.Loriot@sophia.inria.fr>
// Monique Teillaud <Monique.Teillaud@sophia.inria.fr>
// Sylvain Pion <Sylvain.Pion@sophia.inria.fr>
// Pedro Machado <tashimir@gmail.com>
// Julien Hazebrouck
// Damien Leroy
#ifndef CGAL_SPHERICAL_HALF_CIRCLE_ON_REFERENCE_SPHERE_H
#define CGAL_SPHERICAL_HALF_CIRCLE_ON_REFERENCE_SPHERE_H
namespace CGAL {
namespace CGALi {
template <class SK>
class Half_circle_on_reference_sphere_3
{
protected:
const typename SK::Circle_on_reference_sphere_3& C;
CGAL::Hcircle_type pos;
public:
const typename SK::Circle_on_reference_sphere_3& supporting_circle() const {return C;}
const CGAL::Hcircle_type& get_position() const {return pos;}
Half_circle_on_reference_sphere_3(const typename SK::Circle_on_reference_sphere_3& C,CGAL::Hcircle_type pos):C(C),pos(pos){}
};
}
}
#endif

View File

@ -1,60 +0,0 @@
// Copyright (c) 2005-2006 INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; version 2.1 of the License.
// See the file LICENSE.LGPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// Partially supported by the IST Programme of the EU as a Shared-cost
// RTD (FET Open) Project under Contract No IST-2000-26473
// (ECG - Effective Computational Geometry for Curves and Surfaces)
// and a STREP (FET Open) Project under Contract No IST-006413
// (ACS -- Algorithms for Complex Shapes)
//
// $URL: svn+ssh://sloriot@scm.gforge.inria.fr/svn/cgal/trunk/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_3.h $
// $Id: Circular_arc_3.h 40627 2007-10-16 15:00:59Z sloriot $
//
// Author(s) : Loriot Sebastien <Sebastien.Loriot@sophia.inria.fr>
// Monique Teillaud <Monique.Teillaud@sophia.inria.fr>
// Sylvain Pion <Sylvain.Pion@sophia.inria.fr>
// Pedro Machado <tashimir@gmail.com>
// Julien Hazebrouck
// Damien Leroy
#ifndef CGAL_SPHERICAL_KERNEL_SPHERE_WITH_RADIUS_3_H
#define CGAL_SPHERICAL_KERNEL_SPHERE_WITH_RADIUS_3_H
//~ #include <CGAL/Cartesian/Sphere_3.h>
#include <CGAL/Sphere_3.h>
namespace CGAL {
namespace CGALi {
template<class SK>
class Sphere_with_radius_3:public CGAL::Sphere_3<SK>{
typedef typename SK::Algebraic_kernel::Root_of_2 Root_of_2;
typedef typename SK::FT FT;
typedef typename SK::Algebraic_kernel AK;
typedef typename SK::Sphere_3 Sphere_3;
//---------------
typename SK::template Handle<FT>::type hrad;
public:
typedef typename SK::Point_3 Point_3;
Sphere_with_radius_3():Sphere_3(){};
Sphere_with_radius_3(const FT& _r,const Point_3& _c):Sphere_3(_c,_r*_r),hrad(_r){};
Sphere_with_radius_3(const Sphere_3& S):Sphere_3(S),hrad(-1){}
const FT& radius() const {CGAL_precondition(CGAL::get(hrad)!=-1); return CGAL::get(hrad);}
};
} // namespace CGALi
} // namespace CGAL
#endif //CGAL_SPHERICAL_KERNEL_SPHERE_WITH_RADIUS_3_H

View File

@ -1,55 +0,0 @@
// Copyright (c) 2005-2006 INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; version 2.1 of the License.
// See the file LICENSE.LGPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// Partially supported by the IST Programme of the EU as a Shared-cost
// RTD (FET Open) Project under Contract No IST-2000-26473
// (ECG - Effective Computational Geometry for Curves and Surfaces)
// and a STREP (FET Open) Project under Contract No IST-006413
// (ACS -- Algorithms for Complex Shapes)
//
// $URL: svn+ssh://sloriot@scm.gforge.inria.fr/svn/cgal/trunk/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_3.h $
// $Id: Circular_arc_3.h 40627 2007-10-16 15:00:59Z sloriot $
//
// Author(s) : Loriot Sebastien <Sebastien.Loriot@sophia.inria.fr>
// Monique Teillaud <Monique.Teillaud@sophia.inria.fr>
// Sylvain Pion <Sylvain.Pion@sophia.inria.fr>
// Pedro Machado <tashimir@gmail.com>
// Julien Hazebrouck
// Damien Leroy
#ifndef CGAL_SPHERICAL_KERNEL_THETA_REP_H
#define CGAL_SPHERICAL_KERNEL_THETA_REP_H
namespace CGAL {
namespace CGALi {
template <class SK>
class Theta_rep{
typedef typename SK::Algebraic_kernel::Root_of_2 Root_of_2;
typedef typename SK::FT FT;
typedef std::pair<HQ_NT,Root_of_2> Rep;
//
typename SK::template Handle<Rep>::type base;
public:
Theta_rep(const HQ_NT& hq,const Root_of_2& r):base(std::pair<HQ_NT,Root_of_2>(hq,r)){}
Theta_rep(){}
const HQ_NT& hq() const {return get(base).first;}
const Root_of_2& ftheta() const {return CGAL::get(base).second;}
};
}
}
#endif

View File

@ -1,260 +0,0 @@
// Copyright (c) 2005-2006 INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; version 2.1 of the License.
// See the file LICENSE.LGPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// Partially supported by the IST Programme of the EU as a Shared-cost
// RTD (FET Open) Project under Contract No IST-2000-26473
// (ECG - Effective Computational Geometry for Curves and Surfaces)
// and a STREP (FET Open) Project under Contract No IST-006413
// (ACS -- Algorithms for Complex Shapes)
//
// $URL: svn+ssh://sloriot@scm.gforge.inria.fr/svn/cgal/trunk/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_3.h $
// $Id: Circular_arc_3.h 40627 2007-10-16 15:00:59Z sloriot $
//
// Author(s) : Loriot Sebastien <Sebastien.Loriot@sophia.inria.fr>
// Monique Teillaud <Monique.Teillaud@sophia.inria.fr>
// Sylvain Pion <Sylvain.Pion@sophia.inria.fr>
// Pedro Machado <tashimir@gmail.com>
// Julien Hazebrouck
// Damien Leroy
#ifndef CGAL_SPHERICAL_KERNEL_CONSTANT_H
#define CGAL_SPHERICAL_KERNEL_CONSTANT_H
namespace CGAL{
typedef float HQ_NT;//type to represent the index of one hquadrant
enum Fct_type{TAN, COT, FIXED, TAG_M2};
enum Circle_type{NORMAL,THREADED,POLAR,BIPOLAR};
enum Hcircle_type{UPPER, LOWER, SENT_NPOLE=3, SENT_SPOLE,UNDEF};
enum Pole_type{NOTAPOLE=-1,NPOLE=3,SPOLE=4};
enum EvtPt_num{TANGENCY_PT,FIRST_PT,SECOND_PT,NONE,ALL,START_PT=1,END_PT,NORTH,SOUTH,UNKNOW,EVTPT_INI=-1};
inline Fct_type auto_ftype(const HQ_NT& hquad){
if (hquad >7 || hquad<2 || (hquad>3 && hquad<6))
return TAN;
return COT;
};
template<class SK>
typename CGAL::HQ_NT hquadrant(const typename SK::Circular_arc_point_3& R)
{
int x=CGAL::sign(R.x());
int y=CGAL::sign(R.y());
if (y>0){
if (x>0) switch (CGAL::sign(R.x()-R.y())){case -1: return 2; break; case 0: return 1.5; break; case 1: return 1; break; };
if (x<0) switch (CGAL::opposite(CGAL::sign(R.x()+R.y()))){case -1: return 3; break; case 0: return 3.5; break; case 1: return 4; break; };
return 2.5;//OPTI : we have more information here by x_y
}
else{
if (y<0){
if (x>0) switch (CGAL::sign(R.x()+R.y())){case -1: return 7; break; case 0: return 7.5; break; case 1: return 8; break; };
if (x<0) switch (CGAL::opposite(CGAL::sign(R.x()-R.y()))){case -1: return 6; break; case 0: return 5.5; break; case 1: return 5; break; };
return 6.5;//OPTI : we have more information here by x_y
}
else{
if (x>0) return 0.5;
if (x<0) return 4.5;
return 0;
}
}
}
struct Inter_alg_info{
CGAL::HQ_NT qF;
CGAL::HQ_NT qS;
int F_index;
int S_index;
bool is_polar;
Inter_alg_info()
:qF(-1),qS(-1),F_index(-1),S_index(-1),is_polar(false){};
void print() const{
std::cout << "(" << qF <<","<< qS <<") ("<< F_index <<","<< S_index <<") " << std::endl;
}
};
//bool operator==(const Inter_alg_info& IA1,const Inter_alg_info& IA2){
// return (IA1.qF==IA2.qF) && (IA1.qS==IA2.qS) && (IA1.F_index==IA2.F_index) && (IA1.S_index==IA2.S_index);
//}
template <class T>
inline static const T& get_point(const T& p){return p;};
template <class T>
inline static const T& get_point(const std::pair<T,unsigned>& p){return p.first;}
template<class SK,class pt_container>
static void init_indices(CGAL::Inter_alg_info& IA,const pt_container& Ipts,bool is_tangency){
if (is_tangency){ //OPTI here adapt to have square free polynomial for tangency or do "if Root_of.poly().size()<3"
IA.qF=hquadrant<SK>(get_point(Ipts[0]));
IA.F_index=0;
IA.S_index=0;
IA.qS=IA.qF;
return;
}
CGAL::HQ_NT q0=hquadrant<SK>(get_point(Ipts[0]));
CGAL::HQ_NT q1=hquadrant<SK>(get_point(Ipts[1]));
CGAL::HQ_NT res=q0-q1;
if (res == 0){//same quadrant
res=CGAL::sign(get_point(Ipts[0]).y()*get_point(Ipts[1]).x()-get_point(Ipts[1]).y()*get_point(Ipts[0]).x());
if (res==0){//same f(theta) value
res=typename SK::Compare_z_3() (get_point(Ipts[1]),get_point(Ipts[0]));
CGAL_precondition(res!=0);//DEBUG
}
}
if (res <0){
IA.qF=(q0==0)?(10):(q0);//hande 2 polar by same pole
IA.qS=q1;
IA.F_index=0;
IA.S_index=1;
}
else{
IA.qS=q0;
IA.qF=(q1==0)?(10):(q1);//hande 2 polar by same pole
IA.F_index=1;
IA.S_index=0;
}
};
template<class G>
inline void exchange(G& v1,G& v2)
{
G tmp=v2;
v2=v1;
v1=tmp;
}
//Never more than Pi between two intersection points
template<class pt_container>
static void set_inter_pt_conv(CGAL::Inter_alg_info& IA,const pt_container& Ipts){
if (IA.qS-IA.qF>4){
exchange(IA.F_index,IA.S_index);
exchange(IA.qF,IA.qS);
}
else{
if (!(IA.qS-IA.qF<4)){//cad =4 | conflict who is the first?
int s=CGAL::sign(get_point(Ipts[IA.F_index]).y()*get_point(Ipts[IA.S_index]).x()-get_point(Ipts[IA.S_index]).y()*get_point(Ipts[IA.F_index]).x());
if (s>0){
exchange(IA.F_index,IA.S_index);
exchange(IA.qF,IA.qS);
}
}
}
}
template<class SK,class pt_container>
static void set_IA(CGAL::Inter_alg_info& IA,const pt_container& Ipts,bool is_tangency){
init_indices<SK>(IA,Ipts,is_tangency);
if (!is_tangency) set_inter_pt_conv(IA,Ipts);
}
template<class FT,class Point_3>
inline FT compute_a(const Point_3& c,const FT& R2,const FT& squared_radius){
return c.x() * c.x() + c.y() * c.y()+ c.z() * c.z() + R2 - squared_radius;
};
template<class FT>
FT circle_center_coefficent(const FT& x,const FT& y,const FT& z,const FT& r2,const FT& R2){
return ((FT)(0.5) + (R2 - r2)/(FT)(2* (x*x +y*y +z*z))) ;
}
template<class SK, class circle_on_sphere>
CGAL::Circle_type classify_one_circle(const circle_on_sphere& C){
if (C.supporting_sphere().center().z()==0){
typename SK::Point_3 Pt=C.center();
if (Pt.z()==0 && Pt.y()==0 && Pt.x()==0)
return CGAL::BIPOLAR;
}
std::vector<CGAL::Object> cont;
typename SK::Plane_3 Pl=SK().construct_plane_3_object()(typename SK::Algebraic_kernel::Polynomial_1_3(0,1,0,0));
typename SK::Intersect_3()(C.reference_sphere(),C.supporting_sphere(),Pl,std::back_inserter(cont));
switch (cont.size()){
case 0:
return CGAL::NORMAL;
case 2:{
std::pair<typename SK::Circular_arc_point_3,unsigned> p1,p2;
CGAL::assign(p1,cont[0]);CGAL::assign(p2,cont[1]);
CGAL::Sign s1=CGAL::sign(p1.first.x());
CGAL::Sign s2=CGAL::sign(p2.first.x());
if (s1==CGAL::opposite(s2))
return CGAL::THREADED;
else
if (s1!=s2) return CGAL::POLAR;
}
break;
case 1:
if (CGAL::abs(C.extremal_point_z())==C.reference_sphere().radius()) return CGAL::POLAR;
}
return CGAL::NORMAL;
}
template <class SK>
int Sign_power_of_pole(const typename SK::Circle_on_reference_sphere_3& C,CGAL::Pole_type P){
typename SK::Point_3 center=C.supporting_sphere().center();
typename SK::FT Part1=CGAL::squared_distance(typename SK::Point_3(0.,0.,0.),center)+C.reference_sphere().squared_radius()-C.supporting_sphere_squared_radius();
typename SK::FT Part2=2*(P==CGAL::NPOLE?-1:1)*center.z();
if (Part1<0 && Part2<0)
return -1;
if (Part1>0 && Part2>0)
return 1;
return (CGAL::sign(Part2)>0?-1:1)*CGAL::sign(CGAL::square(Part1)-CGAL::square(Part2)*C.reference_sphere().squared_radius());
}
template <class SK>
static CGAL::Pole_type pole_covered_by_supporting_sphere(const typename SK::Circle_on_reference_sphere_3& C){
CGAL_precondition(C.type_of_circle_on_reference_sphere()==CGAL::THREADED);
typename SK::FT NP=CGAL::Sign_power_of_pole<SK>(C,CGAL::NPOLE);
if (NP < 0)
return CGAL::NPOLE;
else{
if(CGAL::Sign_power_of_pole<SK>(C,CGAL::SPOLE) < 0 )
return CGAL::SPOLE;
return (NP==0)?(CGAL::NPOLE):(CGAL::SPOLE);
}
}
template <class SK>
CGAL::Pole_type pole_of_polar_circle(const typename SK::Circle_on_reference_sphere_3& C){
CGAL_precondition(C.type_of_circle_on_reference_sphere()==CGAL::POLAR);
return (CGAL::Sign_power_of_pole<SK>(C,CGAL::NPOLE)==0)?(CGAL::NPOLE):(CGAL::SPOLE);
}
//indicate the direction of the tangent to a polar or bipolar circle according to a Start or end tag
template <class SK>
CGAL::Point_3<SK> get_polar_coordinate(const typename SK::Circle_on_reference_sphere_3& C, CGAL::EvtPt_num num){
CGAL_precondition(C.type_of_circle_on_reference_sphere()==CGAL::POLAR || C.type_of_circle_on_reference_sphere()==CGAL::BIPOLAR);
typename SK::FT s= ( C.circle_center_coefficient() <0 )?-1:1;
typename SK::FT x=((num==CGAL::START_PT)?(1):(-1))*s*C.supporting_sphere_center().y();
typename SK::FT y=((num==CGAL::END_PT)?(1):(-1))*s*C.supporting_sphere_center().x();
return typename SK::Point_3(x,y,typename SK::FT(0));
}
//version with the radius known
//~ template<class SK>
//~ static int Sign_power_of_pole(const typename SK::Circle_on_reference_sphere_3& C,CGAL::Pole_type P){
//~ typename SK::Point_3 center=C.supporting_sphere().center();
//~ return CGAL::sign(my_pow(center.x(),2)+my_pow(center.y(),2)+my_pow(center.z()+ (P==CGAL::NPOLE?-1:1)*get_S_0_radius<P_NT>(),2)
//~ -C.supporting_sphere_squared_radius());
//~ }
}
#endif

View File

@ -1,924 +0,0 @@
// Copyright (c) 2005-2006 INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; version 2.1 of the License.
// See the file LICENSE.LGPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// Partially supported by the IST Programme of the EU as a Shared-cost
// RTD (FET Open) Project under Contract No IST-2000-26473
// (ECG - Effective Computational Geometry for Curves and Surfaces)
// and a STREP (FET Open) Project under Contract No IST-006413
// (ACS -- Algorithms for Complex Shapes)
//
// $URL: svn+ssh://sloriot@scm.gforge.inria.fr/svn/cgal/trunk/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_3.h $
// $Id: Circular_arc_3.h 40627 2007-10-16 15:00:59Z sloriot $
//
// Author(s) : Loriot Sebastien <Sebastien.Loriot@sophia.inria.fr>
// Monique Teillaud <Monique.Teillaud@sophia.inria.fr>
// Sylvain Pion <Sylvain.Pion@sophia.inria.fr>
// Pedro Machado <tashimir@gmail.com>
// Julien Hazebrouck
// Damien Leroy
#ifndef CGAL_SPHERICAL_KERNEL_FUNCTION_OBJECTS_POLYNOMIAL_REFERENCE_SPHERE_H
#define CGAL_SPHERICAL_KERNEL_FUNCTION_OBJECTS_POLYNOMIAL_REFERENCE_SPHERE_H
#include <CGAL/kernel_basic.h>
#include <CGAL/Circular_kernel_3/internal_functions_on_circular_arc_point_3.h>
#include <CGAL/Circular_kernel_3/internal_functions_on_sphere_3.h>
#include <CGAL/Circular_kernel_3/internal_functions_on_line_3.h>
#include <CGAL/Circular_kernel_3/internal_functions_on_plane_3.h>
#include <CGAL/Circular_kernel_3/internal_functions_on_circle_3.h>
#include <CGAL/Circular_kernel_3/internal_functions_on_line_arc_3.h>
#include <CGAL/Circular_kernel_3/internal_functions_on_circular_arc_3.h>
#include <CGAL/Circular_kernel_3/internal_function_has_on_spherical_kernel.h>
#include <CGAL/Circular_kernel_3/internal_function_compare_spherical_kernel.h>
#include <CGAL/Circular_kernel_3/internal_function_compare_to_left_spherical_kernel.h>
#include <CGAL/Circular_kernel_3/internal_functions_on_reference_sphere_3.h>
#include <CGAL/Object.h>
namespace CGAL {
namespace SphericalFunctors {
//ACCESS FUNCTIONS
template <class SK>
class Compute_supporting_circle_on_reference_sphere_3: Has_qrt{
typedef typename SK::Half_circle_on_reference_sphere_3 Half_circle_on_reference_sphere_3;
public:
typedef typename SK::Circle_on_reference_sphere_3 result_type;
typedef const result_type & qualified_result_type;
qualified_result_type operator() (const Half_circle_on_reference_sphere_3 & a) const
{ return (a.rep().supporting_circle()); }
};
template <class SK>
class Compute_half_circle_position_3: Has_qrt{
typedef typename SK::Half_circle_on_reference_sphere_3 Half_circle_on_reference_sphere_3;
public:
typedef typename CGAL::Hcircle_type result_type;
typedef const result_type & qualified_result_type;
qualified_result_type operator() (const Half_circle_on_reference_sphere_3 & a) const
{ return (a.rep().get_position()); }
};
template <class SK>
class Compute_circle_center_coefficient_3/*: Has_qrt*/{
typedef typename SK::Circle_on_reference_sphere_3 Circle_on_reference_sphere_3;
public:
typedef typename SK::FT result_type;
//~ typedef const result_type & qualified_result_type;
typedef result_type qualified_result_type;
qualified_result_type operator() (const Circle_on_reference_sphere_3 & a) const
{ return (a.rep().circle_center_coefficient()); }
};
template <class SK>
class Compute_extremal_point_z/*: Has_qrt*/{
typedef typename SK::Circle_on_reference_sphere_3 Circle_on_reference_sphere_3;
public:
typedef typename SK::FT result_type;
//~ typedef const result_type & qualified_result_type;
typedef result_type qualified_result_type;
qualified_result_type operator() (const Circle_on_reference_sphere_3 & a) const
{ return (a.rep().extremal_point_z()); }
};
template <class SK>
class Compute_type_of_circle_on_reference_sphere_3: Has_qrt{
typedef typename SK::Circle_on_reference_sphere_3 Circle_on_reference_sphere_3;
public:
typedef typename CGAL::Circle_type result_type;
typedef const result_type & qualified_result_type;
qualified_result_type operator() (const Circle_on_reference_sphere_3 & a) const
{ return (a.rep().type_of_circle_on_reference_sphere()); }
};
template <class SK>
class Compute_supporting_sphere_radius_3: Has_qrt{
typedef typename SK::Circle_on_reference_sphere_3 Circle_on_reference_sphere_3;
public:
typedef typename SK::FT result_type;
typedef const result_type & qualified_result_type;
qualified_result_type operator() (const Circle_on_reference_sphere_3 & a) const
{ return (a.rep().supporting_sphere_radius()); }
};
//BAD BAD BAD BAD BAD BAD BAD BAD BAD BAD BAD BAD BAD BAD
template <class SK>
class Compute_supporting_sphere_squared_radius_3/*: Has_qrt*/{
typedef typename SK::Circle_on_reference_sphere_3 Circle_on_reference_sphere_3;
public:
typedef typename SK::FT result_type;
//~ typedef const result_type & qualified_result_type;
typedef result_type qualified_result_type;
qualified_result_type operator() (const Circle_on_reference_sphere_3 & a) const
{ return (a.rep().supporting_sphere_squared_radius()); }
};
//BAD BAD BAD BAD BAD BAD BAD BAD BAD BAD BAD BAD BAD BAD
template <class SK>
class Compute_supporting_sphere_center_3/*: Has_qrt*/{
typedef typename SK::Circle_on_reference_sphere_3 Circle_on_reference_sphere_3;
public:
typedef typename SK::Point_3 result_type;
//~ typedef const result_type & qualified_result_type;
typedef result_type qualified_result_type;
qualified_result_type operator() (const Circle_on_reference_sphere_3 & a) const
{ return (a.rep().supporting_sphere_center()); }
};
template <class SK>
class Compute_reference_sphere_3: Has_qrt{
typedef typename SK::Circle_on_reference_sphere_3 Circle_on_reference_sphere_3;
typedef typename SK::Circular_arc_on_reference_sphere_3 Circular_arc_on_reference_sphere_3;
public:
typedef typename SK::Sphere_with_radius_3 result_type;
typedef const result_type & qualified_result_type;
qualified_result_type operator() (const Circle_on_reference_sphere_3 & a) const
{ return (a.rep().reference_sphere()); }
qualified_result_type operator() (const Circular_arc_on_reference_sphere_3 & a) const
{ return (a.rep().reference_sphere()); }
};
template <class SK>
class Compute_radius_sphere_with_radius_3: Has_qrt{
typedef typename SK::Sphere_with_radius_3 Sphere_with_radius_3;
public:
typedef typename SK::FT result_type;
typedef const result_type & qualified_result_type;
qualified_result_type operator() (const Sphere_with_radius_3 & a) const
{ return (a.rep().radius()); }
};
template <class SK>
class Compute_theta_hq_3: Has_qrt{
typedef typename SK::Theta_rep Theta_rep;
public:
typedef CGAL::HQ_NT result_type;
typedef const result_type & qualified_result_type;
qualified_result_type operator() (const Theta_rep & a) const
{ return (a.rep().hq()); }
};
template <class SK>
class Compute_theta_ftheta_3: Has_qrt{
typedef typename SK::Theta_rep Theta_rep;
typedef typename SK::Root_of_2 Root_of_2;
public:
typedef Root_of_2 result_type;
typedef const result_type & qualified_result_type;
qualified_result_type operator() (const Theta_rep & a) const
{ return (a.rep().ftheta()); }
};
template <class SK>
class Compute_circular_theta_rep_3: Has_qrt{
typedef typename SK::Circular_arc_point_on_reference_sphere_3 Circular_arc_point_on_reference_sphere_3;
public:
typedef typename SK::Theta_rep result_type;
typedef const result_type & qualified_result_type;
qualified_result_type operator() (const Circular_arc_point_on_reference_sphere_3 & a) const
{ return (a.rep().theta_rep()); }
};
template <class SK>
class Compute_circular_theta_3: Has_qrt{
typedef typename SK::Circular_arc_point_on_reference_sphere_3 Circular_arc_point_on_reference_sphere_3;
typedef typename SK::Root_of_2 Root_of_2;
public:
typedef Root_of_2 result_type;
typedef const result_type & qualified_result_type;
qualified_result_type operator() (const Circular_arc_point_on_reference_sphere_3 & a) const
{ return (a.rep().theta_rep().ftheta()); }
};
template <class SK>
class Compute_circular_hq_3: Has_qrt{
typedef typename SK::Circular_arc_point_on_reference_sphere_3 Circular_arc_point_on_reference_sphere_3;
public:
typedef CGAL::HQ_NT result_type;
typedef const result_type & qualified_result_type;
qualified_result_type operator() (const Circular_arc_point_on_reference_sphere_3 & a) const
{ return (a.rep().theta_rep().hq()); }
};
//CONSTRUCTIONS
template < class SK >
class Construct_circular_arc_on_reference_sphere_3
{
typedef typename SK::Line_3 Line_3;
typedef typename SK::Point_3 Point_3;
typedef typename SK::Segment_3 Segment_3;
typedef typename SK::Sphere_3 Sphere_3;
typedef typename SK::Plane_3 Plane_3;
typedef typename SK::Line_arc_3 Line_arc_3;
typedef typename SK::Circular_arc_point_on_reference_sphere_3 Circular_arc_point_on_reference_sphere_3;
typedef typename SK::Circle_on_reference_sphere_3 Circle_on_reference_sphere_3;
typedef typename SK::Sphere_with_radius_3 Sphere_with_radius_3;
typedef typename SK::Circular_arc_on_reference_sphere_3 Circular_arc_on_reference_sphere_3;
typedef typename SK::Kernel_base::Circular_arc_on_reference_sphere_3 RCircular_arc_on_reference_sphere_3;
typedef typename Circular_arc_on_reference_sphere_3::Rep Rep;
public:
typedef Circular_arc_on_reference_sphere_3 result_type;
result_type
operator()(void) const
{ return Rep(); }
result_type
operator()(const Circle_on_reference_sphere_3 &c) const
{ return Rep(c); }
result_type
operator()(const Circle_on_reference_sphere_3 &l,
const Circular_arc_point_on_reference_sphere_3 &s,
const Circular_arc_point_on_reference_sphere_3 &t) const
{ return Rep(l,s,t); }
result_type
operator()(const Circle_on_reference_sphere_3 &l,
const Point_3 &s,
const Circular_arc_point_on_reference_sphere_3 &t) const
{ return Rep(l,s,t); }
result_type
operator()(const Circle_on_reference_sphere_3 &l,
const Circular_arc_point_on_reference_sphere_3 &s,
const Point_3 &t) const
{ return Rep(l,s,t); }
result_type
operator()(const Circle_on_reference_sphere_3 &l,
const Point_3 &s,
const Point_3 &t) const
{ return Rep(l,s,t); }
result_type
operator()(const Circle_on_reference_sphere_3 &c,
const Sphere_with_radius_3 &s1, bool less_xyz_s1,
const Sphere_with_radius_3 &s2, bool less_xyz_s2) const
{ return Rep(c,s1,less_xyz_s1,s2,less_xyz_s2); }
result_type
operator()(const Sphere_with_radius_3 &s1, bool less_xyz_s1,
const Sphere_with_radius_3 &s2, bool less_xyz_s2,
const Circle_on_reference_sphere_3 &c) const
{ return Rep(c,s1,less_xyz_s1,s2,less_xyz_s2); }
result_type
operator()(const Circle_on_reference_sphere_3 &c,
const Plane_3 &p1, bool less_xyz_p1,
const Plane_3 &p2, bool less_xyz_p2) const
{ return Rep(c,p1,less_xyz_p1,p2,less_xyz_p2); }
result_type
operator()(const Plane_3 &p1, bool less_xyz_p1,
const Plane_3 &p2, bool less_xyz_p2,
const Circle_on_reference_sphere_3 &c) const
{ return Rep(c,p1,less_xyz_p1,p2,less_xyz_p2); }
};
template < class SK >
class Construct_half_circle_on_reference_sphere_3{
typedef typename SK::Half_circle_on_reference_sphere_3 Half_circle_on_reference_sphere_3;
typedef typename Half_circle_on_reference_sphere_3::Rep Rep;
public:
typedef Half_circle_on_reference_sphere_3 result_type;
//~ result_type
//~ operator()()
//~ { return Rep();}
result_type
operator()(const typename SK::Circle_on_reference_sphere_3& C,CGAL::Hcircle_type pos)
{ return Rep(C,pos);}
};
template < class SK >
class Construct_circle_on_reference_sphere_3
{
typedef typename SK::Circle_on_reference_sphere_3 Circle_on_reference_sphere_3;
typedef typename SK::Kernel_base::Circle_on_reference_sphere_3 RCircle_on_reference_sphere_3;
typedef typename Circle_on_reference_sphere_3::Repd Rep;
public:
typedef Circle_on_reference_sphere_3 result_type;
result_type
operator()()
{ return Rep();}
result_type
operator()(const typename SK::FT& _r,const typename SK::Point_3& _c,const typename SK::Sphere_with_radius_3& S)
{ return Rep(_r,_c,S);}
result_type
operator()(const typename SK::FT& _r,const typename SK::Point_3& _c,CGAL::Circle_type nat,const typename SK::Sphere_with_radius_3& S)
{ return Rep(_r,_c,nat,S);}
};
template < class SK >
class Construct_sphere_with_radius_3
{
typedef typename SK::Sphere_with_radius_3 Sphere_with_radius_3;
typedef typename SK::Kernel_base::Sphere_with_radius_3 RSphere_with_radius_3;
typedef typename Sphere_with_radius_3::Repd Rep;
public:
typedef Sphere_with_radius_3 result_type;
result_type
operator()(void)
{ return Rep(); }
result_type
operator()(const typename SK::FT& _r,const typename SK::Point_3& _c)
{ return Rep(_r,_c);}
result_type
operator()(const CGAL::Sphere_3<SK>& S)
{ return Rep(S);}
};
template < class SK >
class Construct_theta_rep
{
typedef typename SK::Theta_rep Theta_rep;
typedef typename SK::Kernel_base::Theta_rep RTheta_rep;
typedef typename SK::Root_of_2 Root_of_2;
typedef typename Theta_rep::Rep Rep;
public:
typedef Theta_rep result_type;
result_type
operator()(void)
{ return Rep(); }
result_type
operator()(const HQ_NT& hq,const Root_of_2& r)
{ return Rep(hq,r);}
};
template < class SK >
class Construct_circular_arc_point_on_reference_sphere_3
{
typedef typename SK::Point_3 Point_3;
typedef typename SK::Plane_3 Plane_3;
typedef typename SK::Line_3 Line_3;
typedef typename SK::Circle_3 Circle_3;
typedef typename SK::Sphere_3 Sphere_3;
typedef typename SK::Circular_arc_point_on_reference_sphere_3 Circular_arc_point_on_reference_sphere_3;
typedef typename SK::Kernel_base::Circular_arc_point_on_reference_sphere_3 RCircular_arc_point_on_reference_sphere_3;
typedef typename SK::Root_of_2 Root_of_2;
typedef typename SK::FT FT;
typedef typename Circular_arc_point_on_reference_sphere_3::Repd Rep;
public:
typedef Circular_arc_point_on_reference_sphere_3 result_type;
result_type
operator()(void)
{ return Rep(); }
result_type
operator()(const FT& ftheta, const FT& xt, const FT& yt, const FT& zt, const HQ_NT& hq)
{ return Rep(ftheta,xt,yt,zt,hq);}
result_type
operator()(const HQ_NT& _hq,const Root_of_2& ftheta,const Root_of_2& x_,const Root_of_2& y_,const Root_of_2& z_)
{Rep(_hq,ftheta,x_,y_,z_);}
result_type
operator()(const HQ_NT& _hq,const Root_of_2& ftheta,const typename SK::Algebraic_kernel::Root_for_spheres_2_3& rfs)
{return Rep(_hq,ftheta,rfs);}
result_type
operator()(const HQ_NT& hq,const typename SK::Algebraic_kernel::Root_for_spheres_2_3& R)
{return Rep(hq,R);}
result_type
operator()(const HQ_NT& hq,const typename SK::Circular_arc_point_3& R)
{return Rep(hq,R);}
};
//FUNCTORS
template<class SK>
class Theta_extremal_point_3{
template <class OutputIterator>
void normal_solve(const typename SK::Circle_on_reference_sphere_3& C,
OutputIterator Rpts) const{
std::vector<CGAL::Object> cont;
typename SK::Construct_plane_3 theConstruct_plane_3 = SK().construct_plane_3_object();
//~ typename SK::Plane_3 p=theConstruct_plane_3(typename SK::Algebraic_kernel::Polynomial_1_3(0,0,1,-C.extremal_point_z()));
typename SK::Plane_3 p=theConstruct_plane_3(typename SK::Algebraic_kernel().construct_polynomial_1_3_object()(0,0,1,-C.extremal_point_z()));
typename SK::Intersect_3()(C.supporting_sphere(),C.reference_sphere(),p,std::back_inserter(cont));
CGAL_precondition(cont.size()==2);
for (int i=0;i<2;++i)
CGAL::assign(Rpts[i],cont[i]);
}
public:
typedef void result_type;
void set_CA(const typename SK::Circle_on_reference_sphere_3& C,
Inter_alg_info& CA) const{
typename std::pair<typename SK::Circular_arc_point_3,unsigned> Rpts[2];
normal_solve(C,Rpts);
set_IA<SK>(CA,Rpts,false);
}
template<class container>
void set_CA(Inter_alg_info& CA,const container& Pts) const{
set_IA<SK>(CA,Pts,false);
}
template <class OutputIterator>
OutputIterator operator()(const typename SK::Circle_on_reference_sphere_3& C,
OutputIterator it) const{
Inter_alg_info CA;
typename std::pair<typename SK::Circular_arc_point_3,unsigned> Rpts[2];
normal_solve(C,Rpts);
set_CA(CA,Rpts);
*it++= typename SK::Circular_arc_point_on_reference_sphere_3(CA.qF,Rpts[CA.F_index].first);
*it++= typename SK::Circular_arc_point_on_reference_sphere_3(CA.qS,Rpts[CA.S_index].first);
return it;
}
template <class OutputIterator>
OutputIterator operator()(const typename SK::Circle_on_reference_sphere_3& C,
OutputIterator it,
const Inter_alg_info& CA,
CGAL::EvtPt_num num=CGAL::ALL) const{
typename std::pair<typename SK::Circular_arc_point_3,unsigned> Rpts[2];
normal_solve(C,Rpts);
if (num!=END_PT)
*it++= typename SK::Circular_arc_point_on_reference_sphere_3(CA.qF,Rpts[CA.F_index].first);
else{
*it++= typename SK::Circular_arc_point_on_reference_sphere_3(CA.qS,Rpts[CA.S_index].first);
return it;
}
if (num==ALL)
*it++= typename SK::Circular_arc_point_on_reference_sphere_3(CA.qS,Rpts[CA.S_index].first);
return it;
}
};
template <class SK>
struct Compare_theta_3{
typedef CGAL::Comparison_result result_type;
result_type operator()(const typename SK::Theta_rep& T1,const typename SK::Theta_rep& T2) const {
CGAL::HQ_NT res=T1.hq()-T2.hq();
if (res == 0.){//same quadrant
int m=(CGAL::auto_ftype(T1.hq())==CGAL::TAN)?(1):(-1);
if (truncf(T1.hq())!=T1.hq())//for hquadrant boundary
res=0;
else
res= m*CGAL::compare(T1.ftheta(),T2.ftheta());
}
if (res < 0) return (CGAL::SMALLER);
if (res >0 ) return (CGAL::LARGER);
return CGAL::EQUAL;
}
result_type operator()(const typename SK::Circular_arc_point_on_reference_sphere_3& p1,
const typename SK::Circular_arc_point_on_reference_sphere_3& p2) const{
return (*this)(p1.theta_rep(),p2.theta_rep());
}
};
template <class SK>
struct Compare_theta_z_3{
typedef CGAL::Comparison_result result_type;
result_type operator()(const typename CGAL::Circular_arc_point_on_reference_sphere_3<SK>& p1,
const typename CGAL::Circular_arc_point_on_reference_sphere_3<SK>& p2,
bool decreasing_z=false) const{
SK sk;
CGAL::Comparison_result res=sk.compare_theta_3_object()(p1,p2);
if (res==CGAL::EQUAL)
res=decreasing_z?(CGAL::opposite(sk.compare_z_3_object()(p1,p2))):(sk.compare_z_3_object()(p1,p2));
return res;
}
};
template <class SK>
class Compare_z_at_theta_3{
typedef typename SK::Half_circle_on_reference_sphere_3 Half_circle_on_reference_sphere_3;
typedef typename SK::Circle_on_reference_sphere_3 Circle_on_reference_sphere_3;
typedef typename SK::Circular_arc_point_on_reference_sphere_3 Circular_arc_point_on_reference_sphere_3;
typedef typename SK::FT FT;
public:
typedef CGAL::Comparison_result result_type;
//At theta=0
//Compare the intersection point of an half circle with M_theta for theta=0 with the critical points of a circle on reference sphere
result_type operator() (const Half_circle_on_reference_sphere_3& H,
const Circle_on_reference_sphere_3& S) const{
std::vector<CGAL::Object> cont;
SK sk;
typename SK::Plane_3 p=sk.construct_plane_3_object()(typename SK::Algebraic_kernel::Polynomial_1_3(0,1,0,0));
typename SK::Circular_arc_point_3 Pt;
sk.intersect_3_object()(H.supporting_circle().reference_sphere(),H.supporting_circle().supporting_sphere(),p,std::back_inserter(cont));
select_inter_pt(H.supporting_circle().type_of_circle_on_reference_sphere()==CGAL::THREADED?CGAL::UNDEF:H.get_position(),cont,Pt,0.5);
return sk.compare_z_3_object()(Pt,typename SK::Point_3(0,0,S.extremal_point_z()));
}
//theta=0
//Compare the z coordinates of the intersection points with the meridian at theta=0 of two half_circles
result_type operator() (const Half_circle_on_reference_sphere_3 & H1,
const Half_circle_on_reference_sphere_3& H2) const{
return (*this)(H1,H2,0.5,0);
}
//Compare the z coordinates of the intersection points with the meridian defined by hq and A (A=f(theta) compliant with hq) of two half circles.
result_type operator() ( const Half_circle_on_reference_sphere_3& H1,
const Half_circle_on_reference_sphere_3 & H2,
const typename CGAL::HQ_NT& hq, const FT& A) const {
std::vector<CGAL::Object> cont;
FT a,b;
if (truncf(hq)!=hq){//for hquadrant boundary
if (hq==1.5 || hq==5.5){a=1;b=-1;}
else if (hq==3.5 || hq==7.5){a=1;b=1;}
else if (hq==0.5 || hq==4.5 || hq==8.5){a=0;b=1;}
else if (hq==2.5 || hq==6.5){a=1;b=0;}
}
else
if (CGAL::auto_ftype(hq)==CGAL::TAN){a=A;b=-1;}
else{a=-1;b=A;}
SK sk;
typename SK::Plane_3 p=sk.construct_plane_3_object()(typename SK::Algebraic_kernel::Polynomial_1_3(a,b,0,0));
typename SK::Circular_arc_point_3 Pt1,Pt2;
sk.intersect_3_object()(H1.supporting_circle().reference_sphere(),H1.supporting_circle().supporting_sphere(),p,std::back_inserter(cont));
select_inter_pt(H1.supporting_circle().type_of_circle_on_reference_sphere()==CGAL::THREADED?CGAL::UNDEF:H1.get_position(),cont,Pt1,hq);
cont.clear();
sk.intersect_3_object()(H2.supporting_circle().reference_sphere(),H2.supporting_circle().supporting_sphere(),p,std::back_inserter(cont));
select_inter_pt(H2.supporting_circle().type_of_circle_on_reference_sphere()==CGAL::THREADED?CGAL::UNDEF:H2.get_position(),cont,Pt2,hq);
return sk.compare_z_3_object()(Pt1,Pt2);
}
//Compare the z coordinates of the intersection points with the meridian defined by hq and A (A=f(theta) compliant with hq) of two half circles.
result_type operator() (const Half_circle_on_reference_sphere_3 & H, const Circular_arc_point_on_reference_sphere_3& Pt1) const {
std::vector<CGAL::Object> cont;
const typename CGAL::HQ_NT& hq=Pt1.get_hq();
const FT& A=Pt1.get_f_of_theta();
FT a,b;
if (truncf(hq)!=hq){//for hquadrant boundary
if (hq==1.5 || hq==5.5){a=1;b=-1;}
else if (hq==3.5 || hq==7.5){a=1;b=1;}
else if (hq==0.5 || hq==4.5 || hq==8.5){a=0;b=1;}
else if (hq==2.5 || hq==6.5){a=1;b=0;}
}
else
if (CGAL::auto_ftype(hq)==CGAL::TAN){a=A;b=-1;}
else{a=-1;b=A;}
SK sk;
typename SK::Plane_3 p=sk.construct_plane_3_object()(typename SK::Algebraic_kernel::Polynomial_1_3(a,b,0,0));
typename SK::Circular_arc_point_3 Pt2;
sk.intersect_3_object()(H.supporting_circle().reference_sphere(),H.supporting_circle().supporting_sphere(),p,std::back_inserter(cont));
select_inter_pt(H.supporting_circle().type_of_circle_on_reference_sphere()==CGAL::THREADED?CGAL::UNDEF:H.get_position(),cont,Pt2,hq);
return sk.compare_z_3_object()(Pt2,Pt1);
}
//compare a normal start point vs a theta-monotonic circle arc.
result_type operator() (const Circular_arc_point_on_reference_sphere_3& Pt,
const Half_circle_on_reference_sphere_3& H) const{
CGAL::Hcircle_type pos=H.get_position();
if ( (pos==CGAL::SENT_SPOLE) || (pos==CGAL::SENT_NPOLE) )
{
return (pos==CGAL::SENT_SPOLE)?(CGAL::LARGER):(CGAL::SMALLER);
}
if (H.supporting_circle().type_of_circle_on_reference_sphere()==CGAL::NORMAL)
{
int center_pos=0;//will contain Pt.z-start_pt(H).z
int res = point_VS_supporting_plane(Pt,H.supporting_circle(),center_pos);
if (res > 0)
return (pos==CGAL::UPPER)?(CGAL::SMALLER):(CGAL::LARGER);
if (res < 0 )
return (center_pos>0)?(CGAL::LARGER):(CGAL::SMALLER);
//case res=0
if (pos==CGAL::UPPER)
return (center_pos>0)?(CGAL::EQUAL):(CGAL::SMALLER);
return (center_pos<0)?(CGAL::EQUAL):(CGAL::LARGER);
}
int center_pos=-1;
int res = point_VS_supporting_plane(Pt,H.supporting_circle(),center_pos);
if (res==0)
return (CGAL::EQUAL);
res*=signof(H.supporting_circle().supporting_sphere_center().z());//normal vector always to the top
return (res<0)?(CGAL::SMALLER):(CGAL::LARGER);//threaded or polar circle
}
private:
//Select the intersection point of meridian with Half circle
void select_inter_pt(CGAL::Hcircle_type T,
const std::vector<CGAL::Object>& cont,
typename SK::Circular_arc_point_3& Pt,
const typename CGAL::HQ_NT& hq) const{
std::pair<typename SK::Circular_arc_point_3,unsigned> p1,p2;
CGAL::assign(p1,cont[0]);
CGAL::assign(p2,cont[1]);
SK sk;
if (T==CGAL::UNDEF){
if (hq<2 || hq>7){
Pt=(sk.compare_x_3_object()(p1.first,p2.first)==CGAL::SMALLER?p2.first:p1.first);
return;
}
if (hq>=2 && hq <=3){
Pt=(sk.compare_y_3_object()(p1.first,p2.first)==CGAL::SMALLER?p2.first:p1.first);
return;
}
if (hq>3 && hq<6){
Pt=(sk.compare_x_3_object()(p1.first,p2.first)==CGAL::SMALLER?p1.first:p2.first );
return;
}
if (hq>=6 || hq <=7){
Pt=(sk.compare_y_3_object()(p1.first,p2.first)==CGAL::SMALLER?p1.first:p2.first);
return;
}
}
else{
if (sk.compare_z_3_object()(p1.first,p2.first)==CGAL::SMALLER)
Pt=(T==CGAL::LOWER?p1.first:p2.first);
else
Pt=(T==CGAL::LOWER?p2.first:p1.first);
}
}
//return 1,0,-1 if up to ,on ,under to the plane (else for threaded circle X sign_of(z) to have the same result)
int point_VS_supporting_plane(const Circular_arc_point_on_reference_sphere_3& pt,
const Circle_on_reference_sphere_3& C,
int& center_pos) const{
typename SK::Plane_3 plane=C.supporting_plane();
int i=typename SK::Algebraic_kernel().sign_at_object()(SK().get_equation_object()(plane),pt.coordinates());
if (center_pos==0)//compute the position of the SP wrt circle center only for normal circles
{
center_pos=CGAL::sign(pt.z()-C.extremal_point_z());
i*=signof(C.circle_center_coefficient());//signof(...) handle IVM
}
return i;
}
};
template <class SK>
struct Compare_z_to_left_3{
typedef CGAL::Comparison_result result_type;
//theta=0
result_type
operator()( const typename SK::Half_circle_on_reference_sphere_3& H1,
const typename SK::Half_circle_on_reference_sphere_3& H2) const {
return CGAL::SphericalFunctors::compare_to_hcircle_to_left<SK,CGAL::SphericalFunctors::trait_for_cmp_tgt_theta_0<SK> >()(H1,H2);
}
result_type
operator()( const typename SK::Half_circle_on_reference_sphere_3& H1,
const typename SK::Half_circle_on_reference_sphere_3& H2,
const typename SK::Circular_arc_point_on_reference_sphere_3& p) const{
CGAL::SphericalFunctors::compare_to_hcircle_to_left<SK,CGAL::SphericalFunctors::trait_for_cmp_tgt<SK> > cmp(p.coordinates());
return cmp(H1,H2);
}
};
//convertion of pole to Circular_arc_point_on_reference_sphere_3
#define M_CONVERT(PT)typename SK::Circular_arc_point_on_reference_sphere_3(0,0,PT.x(),PT.y(),PT.z())
template <class SK>
struct Make_theta_monotonic_3{
template<class OutputIterator>
OutputIterator operator()(const typename SK::Circular_arc_on_reference_sphere_3& c,OutputIterator oi){
SK kernel;
typename SK::Has_on_3 has_on_pred=kernel.has_on_3_object();
if (c.supporting_circle().type_of_circle_on_reference_sphere()==CGAL::NORMAL){
CGAL::Object Pts[2];
kernel.theta_extremal_point_3_object(c.supporting_circle(),Pts);
std::pair<typename SK::Circular_arc_point_on_reference_sphere_3,unsigned> Pt1,Pt2;
CGAL::assign(Pt1,Pts[0]);
CGAL::assign(Pt2,Pts[1]);
if (c.is_full()){
*oi++=CGAL::make_object(typename SK::Circular_arc_on_reference_sphere_3(c.supporting_circle(),Pt1,Pt2));
*oi++=CGAL::make_object(typename SK::Circular_arc_on_reference_sphere_3(c.supporting_circle(),Pt2,Pt1));
return oi;
}
if (has_on_pred(c,Pt1)){
typename SK::Circular_arc_on_reference_sphere_3 Cn1(c.supporting_circle(),c.source(),Pt1);
typename SK::Circular_arc_on_reference_sphere_3 Cn2(c.supporting_circle(),Pt1,c.target());
if (has_on_pred(Cn1,Pt2)){
*oi++=CGAL::make_object(typename SK::Circular_arc_on_reference_sphere_3(c.supporting_circle(),Cn1.source(),Pt2));
*oi++=CGAL::make_object(typename SK::Circular_arc_on_reference_sphere_3(c.supporting_circle(),Pt2,Cn1.target()));
*oi++=CGAL::make_object(Cn2);
}
else{
if (has_on_pred(Cn2,Pt2)){
*oi++=CGAL::make_object(Cn1);
*oi++=CGAL::make_object(typename SK::Circular_arc_on_reference_sphere_3(c.supporting_circle(),Cn2.source(),Pt2));
*oi++=CGAL::make_object(typename SK::Circular_arc_on_reference_sphere_3(c.supporting_circle(),Pt2,Cn2.target()));
}
else{
*oi++=CGAL::make_object(Cn1);
*oi++=CGAL::make_object(Cn2);
}
}
}
else{
if (has_on_pred(c,Pt2)){
*oi++=CGAL::make_object(typename SK::Circular_arc_on_reference_sphere_3(c.supporting_circle(),c.source(),Pt2));
*oi++=CGAL::make_object(typename SK::Circular_arc_on_reference_sphere_3(c.supporting_circle(),Pt2,c.target()));
}
else
*oi++=CGAL::make_object(c);
}
return oi;
}
if (c.supporting_circle().type_of_circle_on_reference_sphere()==CGAL::THREADED){
*oi++=CGAL::make_object(c);
return oi;
}
if (c.supporting_circle().type_of_circle_on_reference_sphere()==CGAL::POLAR){
typename SK::Circular_arc_point_3 pole=
( (CGAL::pole_of_polar_circle<SK>(c)==CGAL::NPOLE)?
SK::Circular_arc_point_3(c.reference_sphere().x(),
c.reference_sphere().y(),
c.reference_sphere().z()+CGAL::make_root_of_2(0,1,c.reference_sphere().squared_radius())):
SK::Circular_arc_point_3(c.reference_sphere().x(),
c.reference_sphere().y(),
c.reference_sphere().z()+CGAL::make_root_of_2(0,1,-c.reference_sphere().squared_radius())) );
if (has_on_pred(c,pole)){
typename SK::Circular_arc_point_on_reference_sphere_3 pt=M_CONVERT(pole);
*oi++=CGAL::make_object(typename SK::Circular_arc_on_reference_sphere_3(c.supporting_circle(),c.source(),pt));
*oi++=CGAL::make_object(typename SK::Circular_arc_on_reference_sphere_3(c.supporting_circle(),pt,c.target()));
}
return oi;
}
if (c.supporting_circle().type_of_circle_on_reference_sphere()==CGAL::BIPOLAR){
typename SK::Circular_arc_point_3 npole(c.reference_sphere().x(),
c.reference_sphere().y(),
c.reference_sphere().z()+
CGAL::make_root_of_2(0,1,c.reference_sphere().squared_radius()));
typename SK::Circular_arc_point_3 spole(c.reference_sphere().x(),
c.reference_sphere().y(),
c.reference_sphere().z()+
CGAL::make_root_of_2(0,1,-c.reference_sphere().squared_radius()));
if (c.is_full()){
*oi++=CGAL::make_object(typename SK::Circular_arc_on_reference_sphere_3(c,M_CONVERT(npole),M_CONVERT(spole)));
*oi++=CGAL::make_object(typename SK::Circular_arc_on_reference_sphere_3(c,M_CONVERT(spole),M_CONVERT(npole)));
return oi;
}
if (has_on_pred(c,npole)){
typename SK::Circular_arc_on_reference_sphere_3 C1(c,c.source(), M_CONVERT(npole));
typename SK::Circular_arc_on_reference_sphere_3 C2(c,M_CONVERT(npole),c.target() );
if (has_on_pred(C1,spole)){
*oi++=CGAL::make_object(typename SK::Circular_arc_on_reference_sphere_3(c,C1.source(), M_CONVERT(spole)));
*oi++=CGAL::make_object(typename SK::Circular_arc_on_reference_sphere_3(c,M_CONVERT(spole), C1.target()))
*oi++=CGAL::make_object(C2);
return oi;
}
if (has_on_pred(C2,spole)){
*oi++=CGAL::make_object(C1);
*oi++=CGAL::make_object(typename SK::Circular_arc_on_reference_sphere_3(c,C2.source(),M_CONVERT(spole)))
*oi++=CGAL::make_object(typename SK::Circular_arc_on_reference_sphere_3(c,M_CONVERT(spole),C2.target()));
return oi;
}
}
if (has_on_pred(c,spole)){
*oi++=CGAL::make_object(typename SK::Circular_arc_on_reference_sphere_3(c,c.source(), M_CONVERT(spole)));
*oi++=CGAL::make_object(typename SK::Circular_arc_on_reference_sphere_3(c,M_CONVERT(spole),c.target() ));
return oi;
}
oi++=CGAL::make_object(c);
return oi;
}
}
//~ TODO #warning not finished
//~ TODO #warning should add constructor to circular_arc_on_reference_sphere with one circle : have full and avoid rewritting full operator
template<class OutputIterator>
OutputIterator operator()(const typename SK::Circle_on_reference_sphere_3& c,OutputIterator oi){
if (c.type_of_circle_on_reference_sphere()==CGAL::NORMAL){
CGAL::Object Pts[2];
SK().theta_extremal_point_3_object(c.supporting_circle(),Pts);
std::pair<typename SK::Circular_arc_point_on_reference_sphere_3,unsigned> Pt1,Pt2;
CGAL::assign(Pt1,Pts[0]);
CGAL::assign(Pt2,Pts[1]);
*oi++=CGAL::make_object(typename SK::Circular_arc_on_reference_sphere_3(c,Pt1,Pt2));
*oi++=CGAL::make_object(typename SK::Circular_arc_on_reference_sphere_3(c,Pt2,Pt1));
return oi;
}
if (c.type_of_circle_on_reference_sphere()==CGAL::BIPOLAR){
typename SK::Circular_arc_point_3 npole(c.reference_sphere().x(),
c.reference_sphere().y(),
c.reference_sphere().z()+
CGAL::make_root_of_2(0,1,c.reference_sphere().squared_radius()));
typename SK::Circular_arc_point_3 spole(c.reference_sphere().x(),
c.reference_sphere().y(),
c.reference_sphere().z()+
CGAL::make_root_of_2(0,1,-c.reference_sphere().squared_radius()));
*oi++=CGAL::make_object(typename SK::Circular_arc_on_reference_sphere_3(c,M_CONVERT(npole),M_CONVERT(spole)));
*oi++=CGAL::make_object(typename SK::Circular_arc_on_reference_sphere_3(c,M_CONVERT(spole),M_CONVERT(npole)));
return oi;
}
if (c.type_of_circle_on_reference_sphere()==CGAL::THREADED){
*oi++=CGAL::make_object(c);
return oi;
}
if (c.type_of_circle_on_reference_sphere()==CGAL::POLAR){
typename SK::Circular_arc_point_3 pole=
( (CGAL::pole_of_polar_circle<SK>(c)==CGAL::NPOLE)?
SK::Circular_arc_point_3(c.reference_sphere().x(),
c.reference_sphere().y(),
c.reference_sphere().z()+CGAL::make_root_of_2(0,1,c.reference_sphere().squared_radius())):
SK::Circular_arc_point_3(c.reference_sphere().x(),
c.reference_sphere().y(),
c.reference_sphere().z()+CGAL::make_root_of_2(0,1,-c.reference_sphere().squared_radius())) );
typename SK::Circular_arc_point_on_reference_sphere_3 pt=M_CONVERT(pole);
*oi++=CGAL::make_object(typename SK::Circular_arc_on_reference_sphere_3(c,pt,pt));
return oi;
}
}
};
}
}
#endif

View File

@ -33,7 +33,6 @@
#include <CGAL/Circular_kernel_3/internal_functions_on_circular_arc_3.h>
#include <CGAL/Circular_kernel_3/internal_function_has_on_spherical_kernel.h>
#include <CGAL/Circular_kernel_3/internal_function_compare_spherical_kernel.h>
#include <CGAL/Circular_kernel_3/internal_functions_on_reference_sphere_3.h>
#include <CGAL/Object.h>
@ -44,7 +43,6 @@ namespace SphericalFunctors {
template < class SK > \
class Compare_ ##V## _3: public SK::Linear_kernel::Compare_ ##V## _3{\
typedef typename SK::Circular_arc_point_3 Circular_arc_point_3;\
typedef typename SK::Circular_arc_point_on_reference_sphere_3 Circular_arc_point_on_reference_sphere_3;\
typedef typename SK::Point_3 Point_3;\
public:\
typedef typename SK::Linear_kernel::Compare_ ##V## _3::result_type result_type;\
@ -61,18 +59,6 @@ template < class SK > \
operator() (const Point_3 &p0,\
const Circular_arc_point_3 &p1) const\
{ return compare_ ##V <SK>(p0, p1); }\
result_type\
operator() (const Circular_arc_point_on_reference_sphere_3 &p0,\
const Circular_arc_point_on_reference_sphere_3 &p1) const\
{ return (*this)(static_cast<const Circular_arc_point_3&>(p0), static_cast<const Circular_arc_point_3&>(p1)); }\
result_type\
operator() (const Circular_arc_point_on_reference_sphere_3 &p0,\
const Point_3 &p1) const\
{ return (*this)(static_cast<const Circular_arc_point_3&>(p0),p1);}\
result_type\
operator() (const Point_3 &p0,\
const Circular_arc_point_on_reference_sphere_3 &p1) const\
{ return (*this)(p0, static_cast<const Circular_arc_point_3&>(p1));}\
};\
CGAL_SPHERICAL_KERNEL_MACRO_FUNCTOR_COMPARE_(x)
@ -723,15 +709,12 @@ template < class SK > \
{
typedef typename SK::Point_3 Point_3;
typedef typename SK::Sphere_3 Sphere_3;
typedef typename SK::Sphere_with_radius_3 Sphere_with_radius_3;
typedef typename SK::Plane_3 Plane_3;
typedef typename SK::Line_3 Line_3;
typedef typename SK::Line_arc_3 Line_arc_3;
typedef typename SK::Circular_arc_point_3 Circular_arc_point_3;
typedef typename SK::Circular_arc_point_on_reference_sphere_3 Circular_arc_point_on_reference_sphere_3;
typedef typename SK::Circular_arc_3 Circular_arc_3;
typedef typename SK::Circle_3 Circle_3;
typedef typename SK::Circle_on_reference_sphere_3 Circle_on_reference_sphere_3;
public:
@ -739,29 +722,13 @@ template < class SK > \
using SK::Linear_kernel::Has_on_3::operator();
result_type
operator()(const Sphere_with_radius_3 &a, const Point_3 &p) const
{ return has_on<SK>(static_cast<const Sphere_3&>(a), p); }
result_type
operator()(const Point_3 &p, const Sphere_with_radius_3 &a) const
{ return false; }
result_type
operator()(const Sphere_3 &a, const Circular_arc_point_3 &p) const
{ return has_on<SK>(a, p); }
result_type
operator()(const Sphere_with_radius_3 &a, const Circular_arc_point_on_reference_sphere_3 &p) const
{ return (*this)(static_cast<const Sphere_3&>(a),static_cast<const Circular_arc_point_3&>(p)); }
result_type
operator()(const Circular_arc_point_3 &p, const Sphere_3 &a) const
{ return false; }
result_type
operator()(const Circular_arc_point_3 &p, const Sphere_with_radius_3 &a) const
{ return false; }
result_type
operator()(const Plane_3 &a, const Circular_arc_point_3 &p) const
@ -778,23 +745,11 @@ template < class SK > \
result_type
operator()(const Circular_arc_point_3 &p, const Line_3 &a) const
{ return false; }
result_type
operator()(const Circle_on_reference_sphere_3 &a, const Point_3 &p) const
{ return has_on<SK>(a, p); }
result_type
operator()(const Circle_3 &a, const Circular_arc_point_3 &p) const
{ return has_on<SK>(a, p); }
result_type
operator()(const Circle_on_reference_sphere_3& a, const Circular_arc_point_on_reference_sphere_3 &p) const
{ return has_on<SK>(a.supporting_sphere(), p) && has_on<SK>(a.reference_sphere(), p); }
result_type
operator()(const Sphere_with_radius_3 &a, const Circle_3 &p) const
{ return has_on<SK>(static_cast<const Sphere_3&>(a), p); }
result_type
operator()(const Line_arc_3 &a, const Circular_arc_point_3 &p,
const bool already_know_point_on_line = false) const
@ -871,13 +826,6 @@ template < class SK > \
operator()(const Circular_arc_3 &p, const Circle_3 &a) const
{ return has_on<SK>(p, a); }
result_type
operator() (const typename SK::Half_circle_on_reference_sphere_3& H,
const typename SK::Circular_arc_point_on_reference_sphere_3& P,
bool point_is_on_circle=false) const{
return has_on_ref_sphere<SK>(H,P,point_is_on_circle);
}
};
template < class SK >
@ -1099,58 +1047,6 @@ template < class SK > \
operator()(const Line_arc_3 & la, const Circular_arc_3 & ca,
OutputIterator res) const
{ return intersect_3<SK> (ca,la,res); }
//On reference sphere
//NOTE THAT THIS IMPLEMENTATION PROVIDE ONLY INTERSECTION POINT THAT ARE NOT A POLE
template < class OutputIterator >
OutputIterator
operator()( const typename SK::Circle_on_reference_sphere_3& C1,
const typename SK::Circle_on_reference_sphere_3& C2,
CGAL::Inter_alg_info& IA,
OutputIterator out) const
{
return intersect_3<SK>(C1,C2,IA,out);
}
template < class OutputIterator >
OutputIterator
operator()(const typename SK::Circle_on_reference_sphere_3& C1,
const typename SK::Circle_on_reference_sphere_3& C2,
OutputIterator out) const
{
return intersect_3<SK>(C1,C2,out);
}
template <class OutputIterator>
OutputIterator
operator()(const typename SK::Circle_on_reference_sphere_3& C1,
const typename SK::Circle_on_reference_sphere_3& C2,CGAL::Inter_alg_info &IA,
OutputIterator out, CGAL::EvtPt_num num) const
{
return intersect_3<SK>(C1,C2,IA,out,num);
}
template <class OutputIterator>
OutputIterator operator()(const typename SK::Half_circle_on_reference_sphere_3& H,
const typename SK::Circle_on_reference_sphere_3& C,
OutputIterator out) const{
return intersect_3<SK>(C,H,out);
}
template <class OutputIterator>
OutputIterator operator()(const typename SK::Circle_on_reference_sphere_3& C,
const typename SK::Half_circle_on_reference_sphere_3& H,
OutputIterator out) const{
return intersect_3<SK>(C,H,out);
}
template <class OutputIterator>
OutputIterator operator()(const typename SK::Half_circle_on_reference_sphere_3& H1,
const typename SK::Half_circle_on_reference_sphere_3& H2,
OutputIterator out) const{
return intersect_3<SK>(H1,H2,out);
}
};

View File

@ -29,35 +29,6 @@
// macros CGAL_Kernel_pred and CGAL_Kernel_cons.
// And they are #undefed at the end of this file.
//TAG_SEB
CGAL_Spherical_Kernel_cons(Compute_type_of_circle_on_reference_sphere_3,Compute_type_of_circle_on_reference_sphere_3_object)
CGAL_Spherical_Kernel_cons(Compute_circle_center_coefficient_3,compute_circle_center_coefficient_3_object)
CGAL_Spherical_Kernel_cons(Compute_extremal_point_z,compute_extremal_point_z_object)
CGAL_Spherical_Kernel_cons(Compute_supporting_sphere_radius_3,compute_supporting_sphere_radius_3_object)
CGAL_Spherical_Kernel_cons(Compute_supporting_sphere_squared_radius_3,compute_supporting_sphere_squared_radius_3_object)
CGAL_Spherical_Kernel_cons(Compute_supporting_sphere_center_3,compute_supporting_sphere_center_3_object)
CGAL_Spherical_Kernel_cons(Compute_reference_sphere_3,compute_reference_sphere_3_object)
CGAL_Spherical_Kernel_cons(Compute_circular_theta_rep_3, compute_circular_theta_rep_3_object)
CGAL_Spherical_Kernel_cons(Compute_circular_theta_3, compute_circular_theta_3_object)
CGAL_Spherical_Kernel_cons(Compute_circular_hq_3, compute_circular_hq_3_object)
CGAL_Spherical_Kernel_cons(Compute_theta_hq_3, compute_theta_hq_3_object)
CGAL_Spherical_Kernel_cons(Compute_theta_ftheta_3, compute_theta_ftheta_3_object)
CGAL_Spherical_Kernel_cons(Compute_radius_sphere_with_radius_3, construct_radius_sphere_with_radius_3_object)
CGAL_Spherical_Kernel_cons(Compute_supporting_circle_on_reference_sphere_3, compute_supporting_circle_on_reference_sphere_3_object)
CGAL_Spherical_Kernel_cons(Compute_half_circle_position_3,compute_half_circle_position_3)
CGAL_Spherical_Kernel_cons(Construct_half_circle_on_reference_sphere_3, construct_half_circle_on_reference_sphere_3_object)
CGAL_Spherical_Kernel_cons(Construct_sphere_with_radius_3, construct_sphere_with_radius_3_object)
CGAL_Spherical_Kernel_cons(Construct_theta_rep, construct_theta_rep_object)
CGAL_Spherical_Kernel_cons(Construct_circular_arc_point_on_reference_sphere_3, construct_circular_arc_point_on_reference_sphere_3_object)
CGAL_Spherical_Kernel_cons(Construct_circle_on_reference_sphere_3,construct_circle_on_reference_sphere_3_object)
CGAL_Spherical_Kernel_cons(Construct_circular_arc_on_reference_sphere_3,construct_circular_arc_on_reference_sphere_3_object)
CGAL_Spherical_Kernel_cons(Theta_extremal_point_3,theta_extremal_point_3_object)
CGAL_Spherical_Kernel_cons(Compare_theta_3,compare_theta_3_object)
CGAL_Spherical_Kernel_cons(Compare_theta_z_3,compare_theta_z_3_object)
CGAL_Spherical_Kernel_cons(Compare_z_at_theta_3,compare_z_at_theta_3_object)
CGAL_Spherical_Kernel_cons(Compare_z_to_left_3,compare_z_to_left_3_object)
CGAL_Spherical_Kernel_cons(Get_equation, get_equation_object)
CGAL_Spherical_Kernel_cons(Construct_circular_arc_point_3, construct_circular_arc_point_3_object)
CGAL_Spherical_Kernel_cons(Construct_sphere_3, construct_sphere_3_object)

View File

@ -1,215 +0,0 @@
// Copyright (c) 2005-2006 INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; version 2.1 of the License.
// See the file LICENSE.LGPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// Partially supported by the IST Programme of the EU as a Shared-cost
// RTD (FET Open) Project under Contract No IST-2000-26473
// (ECG - Effective Computational Geometry for Curves and Surfaces)
// and a STREP (FET Open) Project under Contract No IST-006413
// (ACS -- Algorithms for Complex Shapes)
//
// $URL: svn+ssh://sloriot@scm.gforge.inria.fr/svn/cgal/trunk/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_3.h $
// $Id: Circular_arc_3.h 40627 2007-10-16 15:00:59Z sloriot $
//
// Author(s) : Loriot Sebastien <Sebastien.Loriot@sophia.inria.fr>
// Monique Teillaud <Monique.Teillaud@sophia.inria.fr>
// Sylvain Pion <Sylvain.Pion@sophia.inria.fr>
// Pedro Machado <tashimir@gmail.com>
// Julien Hazebrouck
// Damien Leroy
#ifndef CGAL_SPHERICAL_KERNEL_PREDICATES_COMPARE_TO_LEFT_H
#define CGAL_SPHERICAL_KERNEL_PREDICATES_COMPARE_TO_LEFT_H
namespace CGAL {
namespace SphericalFunctors {
//Compare two Half_circle_on_reference_sphere_3 to the left of a common point
template <class SK>
struct trait_for_cmp_tgt{
const typename SK::Algebraic_kernel::Root_for_spheres_2_3& Pt;
typedef typename SK::Algebraic_kernel::Root_of_2 Tk_type;
trait_for_cmp_tgt(const typename SK::Algebraic_kernel::Root_for_spheres_2_3& Pt):Pt(Pt){}
typename SK::Algebraic_kernel::Root_of_2 unsigned_tkz_coeff_normal(const typename SK::Point_3& C,
const typename SK::FT& rk,
const typename SK::FT& R,
typename SK::FT (&gamma_k)(const typename SK::Point_3&,const typename SK::FT&,
const typename SK::FT&) ) const
{
typename SK::FT gk=gamma_k(C,rk,R);
return CGAL::sign(gk)*(C.x()*Pt.y()-C.y()*Pt.x());
};
typename SK::Algebraic_kernel::Root_of_2 unsigned_tkz_coeff_threaded(const typename SK::Point_3& C) const{
return C.x()*Pt.y()-C.y()*Pt.x();
};
};
// Special case: traits use to compare at theta = 0
template <class SK>
struct trait_for_cmp_tgt_theta_0{
typedef typename SK::Algebraic_kernel::Root_of_2 Tk_type;
typename SK::FT unsigned_tkz_coeff_normal(const typename SK::Point_3& C,
const typename SK::FT& rk,
const typename SK::FT& R,
typename SK::FT (&gamma_k)(const typename SK::Point_3&,const typename SK::FT&,const typename SK::FT&) ) const{
typename SK::FT gk=gamma_k(C,rk,R);
return -CGAL::sign(gk)*C.y();
}
typename SK::FT unsigned_tkz_coeff_threaded(const typename SK::Point_3& C) const{
return -C.y();
}
};
template<class SK,class Traits>
struct compare_to_hcircle_to_left{
Traits traits;
compare_to_hcircle_to_left(){}
compare_to_hcircle_to_left(const typename SK::Algebraic_kernel::Root_for_spheres_2_3& Pt):traits(Pt){};
typename SK::FT
gamma_k ( const typename SK::Point_3& c,
const typename SK::FT& rk,
const typename SK::FT& R,
typename SK::FT& ak2) const
{
ak2=c.x()*c.x()+c.y()*c.y()+c.z()*c.z();
return (ak2+R-rk)/(2.*ak2);
};
static typename SK::FT
gamma_k_ (const typename SK::Point_3& c,
const typename SK::FT& rk,
const typename SK::FT& R)
{
typename SK::FT ak2=c.x()*c.x()+c.y()*c.y()+c.z()*c.z();
return (ak2+R-rk)/(2.*ak2);
}
typename SK::FT square_norm_tk_normal (const typename SK::Point_3& c,const typename SK::FT& rk,const typename SK::FT& R) const;
typename SK::FT square_norm_tk_threaded (const typename SK::Point_3& c,const typename SK::FT& rk,const typename SK::FT& R) const;
void fill_tzk_n(const typename SK::Half_circle_on_reference_sphere_3& ES,typename Traits::Tk_type& tz,typename SK::FT& n) const;
int sign_of_delta(const typename SK::Half_circle_on_reference_sphere_3& ES1,const typename SK::Half_circle_on_reference_sphere_3& ES2) const;
typename SK::FT give_rk(const typename SK::Half_circle_on_reference_sphere_3& ES) const;
int compare_for_delta_eq_0_threaded(const typename SK::Half_circle_on_reference_sphere_3& EST,const typename SK::Half_circle_on_reference_sphere_3& ES) const;
int compare_for_delta_eq_0(const typename SK::Half_circle_on_reference_sphere_3& ES1,const typename SK::Half_circle_on_reference_sphere_3& ES2) const;
CGAL::Comparison_result operator()(const typename SK::Half_circle_on_reference_sphere_3& ES1,const typename SK::Half_circle_on_reference_sphere_3& ES2) const;
};
template<class SK,class Traits>
typename SK::FT compare_to_hcircle_to_left<SK,Traits>::square_norm_tk_normal(const typename SK::Point_3& c,const typename SK::FT& rk,const typename SK::FT& R) const{
typename SK::FT ak2;
typename SK::FT gk=gamma_k(c,rk,R,ak2);
return ak2 * (R - gk * gk * ak2);
};
template<class SK,class Traits>
typename SK::FT compare_to_hcircle_to_left<SK,Traits>::square_norm_tk_threaded(const typename SK::Point_3& c,const typename SK::FT& rk,const typename SK::FT& R) const{
typename SK::FT ak2;
typename SK::FT gk=gamma_k(c,rk,R,ak2);
return ak2 * (R - gk * gk * ak2);
};
template<class SK,class Traits>
void compare_to_hcircle_to_left<SK,Traits>::fill_tzk_n (const typename SK::Half_circle_on_reference_sphere_3& ES,typename Traits::Tk_type& tz,typename SK::FT& n) const{
typedef typename SK::FT P_NT;
if (ES.supporting_circle().type_of_circle_on_reference_sphere()==CGAL::THREADED){
tz=traits.unsigned_tkz_coeff_threaded(ES.supporting_circle().supporting_sphere_center());
tz*=(CGAL::pole_covered_by_supporting_sphere<SK>(ES.supporting_circle())==CGAL::NPOLE)?(1):(-1);
n=square_norm_tk_threaded(ES.supporting_circle().supporting_sphere_center(),ES.supporting_circle().supporting_sphere_squared_radius(),ES.supporting_circle().reference_sphere().squared_radius());
}
else{
tz=traits.unsigned_tkz_coeff_normal(ES.supporting_circle().supporting_sphere_center(),ES.supporting_circle().supporting_sphere_squared_radius(),ES.supporting_circle().reference_sphere().squared_radius(),compare_to_hcircle_to_left<SK,Traits>::gamma_k_);
tz*=(ES.get_position()==CGAL::UPPER)?(-1):(1);
n=square_norm_tk_normal(ES.supporting_circle().supporting_sphere_center(),ES.supporting_circle().supporting_sphere_squared_radius(),ES.supporting_circle().reference_sphere().squared_radius());
}
};
template<class SK,class Traits>
int compare_to_hcircle_to_left<SK,Traits>::sign_of_delta (const typename SK::Half_circle_on_reference_sphere_3& ES1,
const typename SK::Half_circle_on_reference_sphere_3& ES2) const{
typename Traits::Tk_type tz1,tz2;
typename SK::FT n1,n2;
fill_tzk_n(ES1,tz1,n1);
fill_tzk_n(ES2,tz2,n2);
if (tz1==0 && tz2==0)
return 0;
if (tz1==0)
return CGAL::sign(tz2);
if (tz2==0)
return -CGAL::sign(tz1);
if (CGAL::sign(tz1)!=CGAL::sign(tz2))
return CGAL::sign(tz2);
return CGAL::sign(tz2)*CGAL::sign(n1*CGAL::square(tz2)-n2*CGAL::square(tz1));
};
template<class SK,class Traits>
typename SK::FT compare_to_hcircle_to_left<SK,Traits>::give_rk(const typename SK::Half_circle_on_reference_sphere_3& ES) const{
return ((ES.get_position()==CGAL::UPPER)?(1):(-1))*ES.supporting_circle().squared_radius();
};
template<class SK,class Traits>
int compare_to_hcircle_to_left<SK,Traits>::compare_for_delta_eq_0_threaded(const typename SK::Half_circle_on_reference_sphere_3& EST,
const typename SK::Half_circle_on_reference_sphere_3& ES) const{
if (ES.supporting_circle().type_of_circle_on_reference_sphere()!=CGAL::THREADED)
return (ES.get_position()==CGAL::UPPER)?(-1):(1);
return (-CGAL::sign(EST.supporting_circle().center().z()-ES.supporting_circle().center().z()));
};
template<class SK,class Traits>
int compare_to_hcircle_to_left<SK,Traits>::compare_for_delta_eq_0(const typename SK::Half_circle_on_reference_sphere_3& ES1,
const typename SK::Half_circle_on_reference_sphere_3& ES2) const{
if (ES1.supporting_circle().type_of_circle_on_reference_sphere()==CGAL::THREADED)
return compare_for_delta_eq_0_threaded(ES1,ES2);
if (ES2.supporting_circle().type_of_circle_on_reference_sphere()==CGAL::THREADED)
return -compare_for_delta_eq_0_threaded(ES2,ES1);
typename SK::FT rc1=give_rk(ES1);
typename SK::FT rc2=give_rk(ES2);
CGAL_precondition(rc1!=0 && rc2!=0);
if(CGAL::sign(rc1)*CGAL::sign(rc2)<0)
return (CGAL::sign(rc1)>0)?(1):(-1);
return (rc1<rc2)?(1):(-1);
};
template<class SK,class Traits>
CGAL::Comparison_result compare_to_hcircle_to_left<SK,Traits>::operator()(const typename SK::Half_circle_on_reference_sphere_3& ES1,
const typename SK::Half_circle_on_reference_sphere_3& ES2) const{
int res=-sign_of_delta(ES1,ES2);
if (res==0)
res=compare_for_delta_eq_0(ES1,ES2);
CGAL_precondition(res!=0);
if (res<0) return CGAL::LARGER;
return CGAL::SMALLER;
};
}
}
#endif

View File

@ -1,163 +0,0 @@
// Copyright (c) 2005-2006 INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; version 2.1 of the License.
// See the file LICENSE.LGPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// Partially supported by the IST Programme of the EU as a Shared-cost
// RTD (FET Open) Project under Contract No IST-2000-26473
// (ECG - Effective Computational Geometry for Curves and Surfaces)
// and a STREP (FET Open) Project under Contract No IST-006413
// (ACS -- Algorithms for Complex Shapes)
//
// $URL: svn+ssh://sloriot@scm.gforge.inria.fr/svn/cgal/trunk/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_3.h $
// $Id: Circular_arc_3.h 40627 2007-10-16 15:00:59Z sloriot $
//
// Author(s) : Loriot Sebastien <Sebastien.Loriot@sophia.inria.fr>
// Monique Teillaud <Monique.Teillaud@sophia.inria.fr>
// Sylvain Pion <Sylvain.Pion@sophia.inria.fr>
// Pedro Machado <tashimir@gmail.com>
// Julien Hazebrouck
// Damien Leroy
#ifndef CGAL_SPHERICAL_KERNEL_PREDICATES_ON_REFERENCE_SPHERE_H
#define CGAL_SPHERICAL_KERNEL_PREDICATES_ON_REFERENCE_SPHERE_H
namespace CGAL {
namespace SphericalFunctors {
//NOTE THAT THIS IMPLEMENTATION PROVIDE ONLY INTERSECTION POINT THAT ARE NOT A POLE
//private fonction
template <class SK, class OutputIterator>
OutputIterator intersect_3( const typename SK::Circle_on_reference_sphere_3& C1,
const typename SK::Circle_on_reference_sphere_3& C2,
CGAL::Inter_alg_info& IA,
OutputIterator out)
{
if (C1.type_of_circle_on_reference_sphere()==CGAL::POLAR && C2.type_of_circle_on_reference_sphere()==CGAL::POLAR &&
CGAL::pole_of_polar_circle<SK>(C1)==CGAL::pole_of_polar_circle<SK>(C2)){//to handle 2 polar circles
if (CGAL::collinear(CGAL::get_polar_coordinate<SK>(C1,CGAL::START_PT),CGAL::get_polar_coordinate<SK>(C2,CGAL::START_PT),typename SK::Point_3(0,0,0)))
return out; //tangency case
IA.is_polar=true;
}
std::vector<CGAL::Object> cont;
typename SK::Intersect_3() (C1.supporting_sphere(),C2.supporting_sphere(),
C1.reference_sphere(),std::back_inserter(cont));
unsigned res=cont.size();
if ( res<1 )
return out;
CGAL_precondition(!IA.is_polar || res!=1 );
typename SK::Circular_arc_point_3 Cir_pts[2];
std::pair<typename SK::Circular_arc_point_3,unsigned> p;
CGAL::assign(p,cont[0]);
Cir_pts[0]=p.first;
if (res==2){
CGAL::assign(p,cont[1]);
Cir_pts[1]=p.first;
}
if (IA.qF==-1)//IA not initialized
CGAL::set_IA <SK>(IA,Cir_pts,res==1);
if (res==1 || IA.is_polar){//handle polar same pole intersecting
if (IA.is_polar)
*out++=typename SK::Circular_arc_point_on_reference_sphere_3(IA.qS,Cir_pts[IA.S_index]);
else
*out++=typename SK::Circular_arc_point_on_reference_sphere_3(IA.qF,Cir_pts[IA.F_index]);
}
else{
*out++=typename SK::Circular_arc_point_on_reference_sphere_3(IA.qF,Cir_pts[IA.F_index]);
*out++=typename SK::Circular_arc_point_on_reference_sphere_3(IA.qS,Cir_pts[IA.S_index]);
}
return out;
}
//return intersection point of two circles as Circular_arc_point_on_reference_sphere_3, the first correspond to FIRST_PT, second to SECOND_PT
template <class SK, class OutputIterator>
inline OutputIterator intersect_3(const typename SK::Circle_on_reference_sphere_3& C1,
const typename SK::Circle_on_reference_sphere_3& C2,
OutputIterator out)
{
CGAL::Inter_alg_info IA;
return intersect_3<SK>(C1,C2,IA,out);
}
template <class SK, class OutputIterator>
OutputIterator intersect_3(const typename SK::Circle_on_reference_sphere_3& C1,
const typename SK::Circle_on_reference_sphere_3& C2,
CGAL::Inter_alg_info &IA,
OutputIterator out, CGAL::EvtPt_num num)
{
typename SK::Circular_arc_point_on_reference_sphere_3 Pts[2];
intersect_3<SK>(C1,C2,IA,Pts);
if (num!=CGAL::SECOND_PT || IA.is_polar)
*out++=Pts[0];
else
*out++=Pts[1];
if (num==CGAL::ALL)
*out++=Pts[1];
return out;
}
template<class SK>
bool has_on_ref_sphere(const typename SK::Half_circle_on_reference_sphere_3& H,const typename SK::Circular_arc_point_on_reference_sphere_3& P,bool point_is_on_circle){
if (!point_is_on_circle){
if (!SK().has_on_3_object()(H.supporting_circle(),P))
return false;
}
int i=(H.get_position()==CGAL::UPPER)?(1):(-1);
int tr=(H.supporting_circle().type_of_circle_on_reference_sphere()==CGAL::NORMAL)?(CGAL::compare(P.z(),H.supporting_circle().extremal_point_z() )):(i);//to handle threaded and polar
return (i*tr>0);
}
template <class SK, class OutputIterator>
OutputIterator intersect_3( const typename SK::Half_circle_on_reference_sphere_3& H1,
const typename SK::Half_circle_on_reference_sphere_3& H2,
OutputIterator out){
std::vector<typename SK::Circular_arc_point_on_reference_sphere_3> res;
intersect_3<SK>(H1.supporting_circle(),H2.supporting_circle(),std::back_inserter(res));
int i=res.size();
if ( i>0 && has_on_ref_sphere<SK>(H1,res[0],true) && has_on_ref_sphere<SK>(H2,res[0],true) )
*out++=typename SK::Circular_arc_point_on_reference_sphere_3(CGAL::hquadrant<SK>(res[0]),res[0]);
if (i>1 && has_on_ref_sphere<SK>(H1,res[1],true) && has_on_ref_sphere<SK>(H2,res[1],true) )
*out++=typename SK::Circular_arc_point_on_reference_sphere_3(CGAL::hquadrant<SK>(res[1]),res[1]);
return out;
}
template <class SK, class OutputIterator>
OutputIterator intersect_3( const typename SK::Circle_on_reference_sphere_3& C,
const typename SK::Half_circle_on_reference_sphere_3& H,
OutputIterator out){
std::vector<typename SK::Circular_arc_point_on_reference_sphere_3> res;
intersect_3<SK>(C,H.supporting_circle(),std::back_inserter(res));
int i=res.size();
if ( i>0 && has_on_ref_sphere<SK>(H,res[0],true) )
*out++=typename SK::Circular_arc_point_on_reference_sphere_3(CGAL::hquadrant<SK>(res[0]),res[0]);
if (i>1 && has_on_ref_sphere<SK>(H,res[1],true) )
*out++=typename SK::Circular_arc_point_on_reference_sphere_3(CGAL::hquadrant<SK>(res[1]),res[1]);
return out;
}
}
}
#endif

View File

@ -1,80 +0,0 @@
// Copyright (c) 2005-2006 INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; version 2.1 of the License.
// See the file LICENSE.LGPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// Partially supported by the IST Programme of the EU as a Shared-cost
// RTD (FET Open) Project under Contract No IST-2000-26473
// (ECG - Effective Computational Geometry for Curves and Surfaces)
// and a STREP (FET Open) Project under Contract No IST-006413
// (ACS -- Algorithms for Complex Shapes)
//
// $URL: svn+ssh://sloriot@scm.gforge.inria.fr/svn/cgal/trunk/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_3.h $
// $Id: Circular_arc_3.h 40627 2007-10-16 15:00:59Z sloriot $
//
// Author(s) : Loriot Sebastien <Sebastien.Loriot@sophia.inria.fr>
// Monique Teillaud <Monique.Teillaud@sophia.inria.fr>
// Sylvain Pion <Sylvain.Pion@sophia.inria.fr>
// Pedro Machado <tashimir@gmail.com>
// Julien Hazebrouck
// Damien Leroy
#ifndef CGAL_HALF_CIRCLE_ON_REFERENCE_SPHERE_3_H
#define CGAL_HALF_CIRCLE_ON_REFERENCE_SPHERE_3_H
namespace CGAL {
template < typename SphericalKernel >
class Half_circle_on_reference_sphere_3
: public SphericalKernel::Kernel_base::Half_circle_on_reference_sphere_3
{
typedef typename SphericalKernel::Kernel_base::Half_circle_on_reference_sphere_3
RHalf_circle_on_reference_sphere_3;
public:
typedef SphericalKernel R;
typedef RHalf_circle_on_reference_sphere_3 Rep;
const Rep& rep() const
{
return *this;
}
Rep& rep()
{
return *this;
}
//~ Half_circle_on_reference_sphere_3()
//~ :RHalf_circle_on_reference_sphere_3(){}
Half_circle_on_reference_sphere_3(const RHalf_circle_on_reference_sphere_3& p)
:RHalf_circle_on_reference_sphere_3(p){}
Half_circle_on_reference_sphere_3(const typename SphericalKernel::Circle_on_reference_sphere_3& C,CGAL::Hcircle_type pos)
: RHalf_circle_on_reference_sphere_3(typename R::Construct_half_circle_on_reference_sphere_3()(C,pos))
{}
typename Qualified_result_of<typename R::Compute_half_circle_position_3,Half_circle_on_reference_sphere_3>::type
get_position() const
{ return typename R::Compute_half_circle_position_3()(*this);}
typename Qualified_result_of<typename R::Compute_supporting_circle_on_reference_sphere_3,Half_circle_on_reference_sphere_3>::type
supporting_circle() const
{ return typename R::Compute_supporting_circle_on_reference_sphere_3()(*this);}
};
}
#endif

View File

@ -27,31 +27,13 @@
#include <CGAL/Circular_kernel_3/Circular_arc_point_3.h>
#include <CGAL/Circular_arc_point_3.h>
#include <CGAL/Circular_kernel_3/Circular_arc_point_on_reference_sphere_3.h>
#include <CGAL/Circular_arc_point_on_reference_sphere_3.h>
#include <CGAL/Circular_kernel_3/Theta_rep.h>
#include <CGAL/Theta_rep.h>
#include <CGAL/Circular_kernel_3/Sphere_with_radius_3.h>
#include <CGAL/Sphere_with_radius_3.h>
#include <CGAL/Circular_kernel_3/Line_arc_3.h>
#include <CGAL/Line_arc_3.h>
#include <CGAL/Circular_kernel_3/Circular_arc_3.h>
#include <CGAL/Circular_arc_3.h>
#include <CGAL/Circular_arc_on_reference_sphere_3.h>
#include <CGAL/Circular_kernel_3/Circle_on_reference_sphere_3.h>
#include <CGAL/Circle_on_reference_sphere_3.h>
#include <CGAL/Circular_kernel_3/Half_circle_on_reference_sphere_3.h>
#include <CGAL/Half_circle_on_reference_sphere_3.h>
#include <CGAL/Circular_kernel_3/function_objects_polynomial_sphere.h>
#include <CGAL/Circular_kernel_3/function_objects_polynomial_reference_sphere.h>
#include <CGAL/Circular_kernel_3/get_equation_object_on_curved_kernel_3.h>

View File

@ -1,81 +0,0 @@
// Copyright (c) 2005-2006 INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; version 2.1 of the License.
// See the file LICENSE.LGPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// Partially supported by the IST Programme of the EU as a Shared-cost
// RTD (FET Open) Project under Contract No IST-2000-26473
// (ECG - Effective Computational Geometry for Curves and Surfaces)
// and a STREP (FET Open) Project under Contract No IST-006413
// (ACS -- Algorithms for Complex Shapes)
//
// $URL: svn+ssh://sloriot@scm.gforge.inria.fr/svn/cgal/trunk/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_3.h $
// $Id: Circular_arc_3.h 40627 2007-10-16 15:00:59Z sloriot $
//
// Author(s) : Loriot Sebastien <Sebastien.Loriot@sophia.inria.fr>
// Monique Teillaud <Monique.Teillaud@sophia.inria.fr>
// Sylvain Pion <Sylvain.Pion@sophia.inria.fr>
// Pedro Machado <tashimir@gmail.com>
// Julien Hazebrouck
// Damien Leroy
#ifndef CGAL_SPHERE_WITH_RADIUS_3_H
#define CGAL_SPHERE_WITH_RADIUS_3_H
namespace CGAL {
template <class SK>
class Sphere_with_radius_3
: public SK::Kernel_base::Sphere_with_radius_3
{
typedef typename SK::FT FT;
typedef typename SK::Point_3 Point_3;
typedef typename SK::Plane_3 Plane_3;
typedef typename SK::Kernel_base::Sphere_with_radius_3 RSphere_with_radius_3;
public:
typedef RSphere_with_radius_3 Repd;
typedef SK R;
const Repd& rep() const{
return *this;
}
Repd& rep(){
return *this;
}
Sphere_with_radius_3(const RSphere_with_radius_3& c)
:RSphere_with_radius_3(c){}
Sphere_with_radius_3()
: RSphere_with_radius_3(typename R::Construct_sphere_with_radius_3()())
{}
Sphere_with_radius_3(const FT& _r,const Point_3& _c)
: RSphere_with_radius_3(typename R::Construct_sphere_with_radius_3()(_r,_c))
{}
Sphere_with_radius_3(const CGAL::Sphere_3<SK>& S)
: RSphere_with_radius_3(typename R::Construct_sphere_with_radius_3()(S))
{}
typename Qualified_result_of
<typename R::Compute_radius_sphere_with_radius_3, Sphere_with_radius_3>::type
//const Sphere_3 &
radius() const
{
return typename R::Compute_radius_sphere_with_radius_3()(*this);
}
};
}
#endif //CGAL_SPHERE_WITH_RADIUS_3_H

View File

@ -27,31 +27,13 @@
#include <CGAL/Circular_kernel_3/Circular_arc_point_3.h>
#include <CGAL/Circular_arc_point_3.h>
#include <CGAL/Circular_kernel_3/Circular_arc_point_on_reference_sphere_3.h>
#include <CGAL/Circular_arc_point_on_reference_sphere_3.h>
#include <CGAL/Circular_kernel_3/Theta_rep.h>
#include <CGAL/Theta_rep.h>
#include <CGAL/Circular_kernel_3/Sphere_with_radius_3.h>
#include <CGAL/Sphere_with_radius_3.h>
#include <CGAL/Circular_kernel_3/Line_arc_3.h>
#include <CGAL/Line_arc_3.h>
#include <CGAL/Circular_kernel_3/Circular_arc_3.h>
#include <CGAL/Circular_arc_3.h>
#include <CGAL/Circular_arc_on_reference_sphere_3.h>
#include <CGAL/Circular_kernel_3/Circle_on_reference_sphere_3.h>
#include <CGAL/Circle_on_reference_sphere_3.h>
#include <CGAL/Circular_kernel_3/Half_circle_on_reference_sphere_3.h>
#include <CGAL/Half_circle_on_reference_sphere_3.h>
#include <CGAL/Circular_kernel_3/function_objects_polynomial_sphere.h>
#include <CGAL/Circular_kernel_3/function_objects_polynomial_reference_sphere.h>
#include <CGAL/Circular_kernel_3/get_equation_object_on_curved_kernel_3.h>
@ -68,14 +50,7 @@ namespace CGAL {
typedef CGALi::Circular_arc_point_3<SphericalKernel> Circular_arc_point_3;
typedef CGALi::Line_arc_3<SphericalKernel> Line_arc_3;
typedef CGALi::Circular_arc_3<SphericalKernel> Circular_arc_3;
typedef CGALi::Circular_arc_point_on_reference_sphere_3<SphericalKernel> Circular_arc_point_on_reference_sphere_3;
typedef CGALi::Circle_on_reference_sphere_3<SphericalKernel> Circle_on_reference_sphere_3;
typedef CGALi::Half_circle_on_reference_sphere_3<SphericalKernel> Half_circle_on_reference_sphere_3;
typedef CGALi::Circular_arc_3<SphericalKernel,CGAL::Circle_on_reference_sphere_3<SphericalKernel>,CGAL::Circular_arc_point_on_reference_sphere_3<SphericalKernel> > Circular_arc_on_reference_sphere_3;
typedef CGALi::Theta_rep<SphericalKernel> Theta_rep;
typedef CGALi::Sphere_with_radius_3<SphericalKernel> Sphere_with_radius_3;
// The mecanism that allows to specify reference-counting or not.
template < typename T >
struct Handle { typedef Handle_for<T> type; };

View File

@ -43,12 +43,6 @@ struct Spherical_kernel_type_equality_wrapper
typedef CGAL::Circular_arc_point_3<Kernel> Circular_arc_point_3;
typedef CGAL::Circular_arc_3<Kernel> Circular_arc_3;
typedef CGAL::Line_arc_3<Kernel> Line_arc_3;
typedef CGAL::Circular_arc_on_reference_sphere_3<Kernel> Circular_arc_on_reference_sphere_3;
typedef CGAL::Circular_arc_point_on_reference_sphere_3<Kernel> Circular_arc_point_on_reference_sphere_3;
typedef CGAL::Circle_on_reference_sphere_3<Kernel> Circle_on_reference_sphere_3;
typedef CGAL::Half_circle_on_reference_sphere_3<Kernel> Half_circle_on_reference_sphere_3;
typedef CGAL::Theta_rep<Kernel> Theta_rep;
typedef CGAL::Sphere_with_radius_3<Kernel> Sphere_with_radius_3;
//~ typedef CGAL::Root_of_2<typename Kernel_base::FT> Root_of_2;
};

View File

@ -1,90 +0,0 @@
// Copyright (c) 2005-2006 INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; version 2.1 of the License.
// See the file LICENSE.LGPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// Partially supported by the IST Programme of the EU as a Shared-cost
// RTD (FET Open) Project under Contract No IST-2000-26473
// (ECG - Effective Computational Geometry for Curves and Surfaces)
// and a STREP (FET Open) Project under Contract No IST-006413
// (ACS -- Algorithms for Complex Shapes)
//
// $URL: svn+ssh://sloriot@scm.gforge.inria.fr/svn/cgal/trunk/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_3.h $
// $Id: Circular_arc_3.h 40627 2007-10-16 15:00:59Z sloriot $
//
// Author(s) : Loriot Sebastien <Sebastien.Loriot@sophia.inria.fr>
// Monique Teillaud <Monique.Teillaud@sophia.inria.fr>
// Sylvain Pion <Sylvain.Pion@sophia.inria.fr>
// Pedro Machado <tashimir@gmail.com>
// Julien Hazebrouck
// Damien Leroy
#ifndef CGAL_THETA_REP_H
#define CGAL_THETA_REP_H
namespace CGAL {
template < typename SphericalKernel >
class Theta_rep
: public SphericalKernel::Kernel_base::Theta_rep
{
typedef typename SphericalKernel::Kernel_base::Theta_rep
RTheta_rep;
typedef typename SphericalKernel::Root_of_2 Root_of_2;
typedef typename SphericalKernel::FT FT;
typedef typename SphericalKernel::Algebraic_kernel AK;
typedef typename SphericalKernel::Root_for_spheres_2_3 Root_for_spheres_2_3;
public:
typedef SphericalKernel R;
typedef RTheta_rep Rep;
const Rep& rep() const
{
return *this;
}
Rep& rep()
{
return *this;
}
Theta_rep(const RTheta_rep& p)
:RTheta_rep(p){}
Theta_rep()
: RTheta_rep(
typename R::Construct_theta_rep()())
{}
Theta_rep(const HQ_NT& hq,const Root_of_2& r)
: RTheta_rep(
typename R::Construct_theta_rep()(hq,r))
{}
typename Qualified_result_of<typename R::Compute_theta_ftheta_3,Theta_rep>::type
ftheta() const
{ return typename R::Compute_theta_ftheta_3()(*this);}
typename Qualified_result_of<typename R::Compute_theta_hq_3,Theta_rep>::type
hq() const
{ return typename R::Compute_theta_hq_3()(*this);}
};
}
#endif

View File

@ -48,7 +48,7 @@ template <class R_>
typedef typename R_::Point_3 Point_3;
typedef typename R_::Plane_3 Plane_3;
typedef typename R_::Vector_3 Vector_3;
// typedef typename R_::Sphere_3 Sphere_3;
typedef typename R_::Sphere_3 Sphere_3;
typedef typename R_::Direction_3 Direction_3;
typedef Circle_3 Self;
@ -56,11 +56,6 @@ template <class R_>
public:
// NOTE: this one is here so the stuffs of Sebastien keep working
// on Circular_kernel_3, but this need to be fixed
typedef typename R_::Sphere_3 Sphere_3;
// TODO: from public to private
typedef Dimension_tag<3> Ambient_dimension;
typedef Dimension_tag<1> Feature_dimension;