diff --git a/.gitattributes b/.gitattributes index 5b7eb7a4608..dc9b180e0cc 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/Circular_kernel_3/include/CGAL/Circle_on_reference_sphere_3.h b/Circular_kernel_3/include/CGAL/Circle_on_reference_sphere_3.h new file mode 100644 index 00000000000..8efd3a7d7bb --- /dev/null +++ b/Circular_kernel_3/include/CGAL/Circle_on_reference_sphere_3.h @@ -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::type + type_of_circle_on_reference_sphere() const + { return typename R::Compute_type_of_circle_on_reference_sphere_3()(*this);} + + typename Qualified_result_of::type + supporting_sphere_radius() const + { return typename R::Compute_supporting_sphere_radius_3()(*this);} + + typename Qualified_result_of::type + supporting_sphere_squared_radius() const + { return typename R::Compute_supporting_sphere_squared_radius_3()(*this);} + + typename Qualified_result_of::type + supporting_sphere_center() const + { return typename R::Compute_supporting_sphere_center_3()(*this);} + + typename Qualified_result_of::type + reference_sphere() const + { return typename R::Compute_reference_sphere_3()(*this);} + + typename Qualified_result_of::type + extremal_point_z() const + { return typename R::Compute_extremal_point_z()(*this);} + + typename Qualified_result_of::type + circle_center_coefficient() const + { return typename R::Compute_circle_center_coefficient_3()(*this);} + + + +}; + +} +#endif + diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circle_on_reference_sphere_3.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circle_on_reference_sphere_3.h new file mode 100644 index 00000000000..ffa5f3e01c3 --- /dev/null +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circle_on_reference_sphere_3.h @@ -0,0 +1,58 @@ +#ifndef CGAL_SPHERICAL_CIRCLE_ON_REFERENCE_SPHERE_H +#define CGAL_SPHERICAL_CIRCLE_ON_REFERENCE_SPHERE_H + +#include +#include +namespace CGAL { + namespace CGALi { + + + template + class Circle_on_reference_sphere_3 + : public CGAL::CGALi::Circle_3,typename CGAL::Sphere_with_radius_3,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, + typename CGAL::Sphere_with_radius_3,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(this->supporting_sphere().center(), + reference_sphere().squared_radius(),this->supporting_sphere().squared_radius()) + * this->supporting_sphere().center().z() * reference_sphere().squared_radius();} + + }; + + + } +} + +#endif