add the files....

This commit is contained in:
Sébastien Loriot 2007-10-12 21:20:38 +00:00
parent 5437256b67
commit 7d2ff76317
3 changed files with 140 additions and 0 deletions

2
.gitattributes vendored
View File

@ -1318,7 +1318,9 @@ 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_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/Sphere_with_radius_3.h -text
Circular_kernel_3/include/CGAL/Circular_kernel_3/Theta_rep.h -text

View File

@ -0,0 +1,80 @@
#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(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

@ -0,0 +1,58 @@
#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;
protected:
Circle_type _nature;//NORMAL,THREADED,POLAR,BIPOLAR
public:
Circle_on_reference_sphere_3(const FT& _r,const Point_3& _c,const Sphere_3& ref):Circle_3(Sphere_3(_r,_c),ref){
_nature=SK::classify_one_circle(*this);
#warning TRY WITH FLAG ONLY_SK_ALGEBRA
}
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();}
const FT& supporting_sphere_squared_radius() const { return this->supporting_sphere().squared_radius();}
const 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