Creation of Point_2 (cgal 4.12)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Creation of Point_2 (cgal 4.12)

Dinesh
I have declared following
#include<CGAL/Exact_predicates_exact_constructions_kernel.h>
typedef CGAL::Exact_predicates_exact_constructions_kernel             Kernel;
typedef Kernel::Point_2 Point;

The fololling line seems to cause problem

auto status =ld(Point(crd.x, crd.y));

crd.x and crd.y are of type CGAL::Gmpq

I thought this would trigger following constructor
Point_2 (const Kernel::FT &x, const Kernel::FT &y)

The compiler error is listed below
3>D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Lazy.h(1743): error C2665: 'CGAL::exact' : none of the 15 overloads could convert all the argument types
3>          D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Lazy.h(105): could be 'const long double &CGAL::exact(const long double &)'
3>          D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Lazy.h(106): or       'const double &CGAL::exact(const double &)'
3>          D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Lazy.h(107): or       'const float &CGAL::exact(const float &)'
3>          D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Lazy.h(108): or       'const int &CGAL::exact(const int &)'
3>          D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Lazy.h(109): or       'const unsigned int &CGAL::exact(const unsigned int &)'
3>          D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Lazy.h(110): or       'const long &CGAL::exact(const long &)'
3>          D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Lazy.h(111): or       'const unsigned long &CGAL::exact(const unsigned long &)'
3>          D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Lazy.h(113): or       'const __int64 &CGAL::exact(const __int64 &)'
3>          D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Lazy.h(114): or       'const unsigned __int64 &CGAL::exact(const unsigned __int64 &)'
3>          D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Lazy.h(116): or       'const CGAL::Return_base_tag &CGAL::exact(const CGAL::Return_base_tag &)'
3>          D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Lazy.h(117): or       'const CGAL::Null_vector &CGAL::exact(const CGAL::Null_vector &)'
3>          D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Lazy.h(118): or       'const CGAL::Origin &CGAL::exact(const CGAL::Origin &)'
3>          D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Lazy.h(119): or       'const CGAL::Orientation &CGAL::exact(const CGAL::Orientation &)'
3>          D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Lazy.h(120): or       'const CGAL::Bbox_2 &CGAL::exact(const CGAL::Bbox_2 &)'
3>          D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Lazy.h(121): or       'const CGAL::Bbox_3 &CGAL::exact(const CGAL::Bbox_3 &)'
3>          while trying to match the argument list '(const CGAL::Gmpq)'
3>          D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Point_2.h(88) : see reference to function template instantiation 'CGAL::Point_2<R_> CGAL::Lazy_construction<LK,AC,EC>::operator ()<CGAL::Return_base_tag,T1,T2>(const L0 &,const L1 &,const L2 &) const' being compiled
3>          with
3>          [
3>              R_=CGAL::Epeck,
3>              LK=CGAL::Epeck,
3>              AC=CGAL::CartesianKernelFunctors::Construct_point_2<CGAL::Simple_cartesian<CGAL::Interval_nt_advanced>>,
3>              EC=CGAL::CartesianKernelFunctors::Construct_point_2<CGAL::Simple_cartesian<CGAL::Gmpq>>,
3>              T1=CGAL::Gmpq,
3>              T2=CGAL::Gmpq,
3>              L0=CGAL::Return_base_tag,
3>              L1=CGAL::Gmpq,
3>              L2=CGAL::Gmpq
3>          ]
3>          D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Point_2.h(90) : see reference to function template instantiation 'CGAL::Point_2<R_> CGAL::Lazy_construction<LK,AC,EC>::operator ()<CGAL::Return_base_tag,T1,T2>(const L0 &,const L1 &,const L2 &) const' being compiled
3>          with
3>          [
3>              R_=CGAL::Epeck,
3>              LK=CGAL::Epeck,
3>              AC=CGAL::CartesianKernelFunctors::Construct_point_2<CGAL::Simple_cartesian<CGAL::Interval_nt_advanced>>,
3>              EC=CGAL::CartesianKernelFunctors::Construct_point_2<CGAL::Simple_cartesian<CGAL::Gmpq>>,
3>              T1=CGAL::Gmpq,
3>              T2=CGAL::Gmpq,
3>              L0=CGAL::Return_base_tag,
3>              L1=CGAL::Gmpq,
3>              L2=CGAL::Gmpq
3>          ]
3>          src\DdmMesh.cpp(196) : see reference to function template instantiation 'CGAL::Point_2<R_>::Point_2<CGAL::Gmpq,CGAL::Gmpq>(const T1 &,const T2 &)' being compiled
3>          with
3>          [
3>              R_=CGAL::Epeck,
3>              T1=CGAL::Gmpq,
3>              T2=CGAL::Gmpq
3>          ]

if I convert from CGAl::gmpq to double it works.

Regards
Dinesh
Reply | Threaded
Open this post in threaded view
|

Re: Creation of Point_2 (cgal 4.12)

Sebastien Loriot (GeometryFactory)
Try ld(Point(Kernel::FT(crd.x), Kernel::FT(crd.y)))

Sebastien.

On 04/26/2018 05:03 PM, Dinesh Shetty wrote:

> I have declared following
> #include<CGAL/Exact_predicates_exact_constructions_kernel.h>
> typedef CGAL::Exact_predicates_exact_constructions_kernel            
>   Kernel;
> typedef Kernel::Point_2 Point;
>
> The fololling line seems to cause problem
>
> auto status =ld(Point(crd.x, crd.y));
>
> crd.x and crd.y are of type CGAL::Gmpq
>
> I thought this would trigger following constructor
> Point_2
> <https://doc.cgal.org/latest/Kernel_23/classCGAL_1_1Point__2.html#ae86ad08ceefb6b2d9aac560c7ddc34ef>(constKernel::FT
> <https://doc.cgal.org/latest/Kernel_23/classKernel.html#a55e83f5a9f8ca43588b02ae8256a8fbd>&x
> <https://doc.cgal.org/latest/Kernel_23/classCGAL_1_1Point__2.html#a2d77e6a2b4ae36169e0cf4e2e9c35378>,
> constKernel::FT
> <https://doc.cgal.org/latest/Kernel_23/classKernel.html#a55e83f5a9f8ca43588b02ae8256a8fbd>&y
> <https://doc.cgal.org/latest/Kernel_23/classCGAL_1_1Point__2.html#ac844c95dbfc2e70e82dc6ee1095871f4>)
>
>
> The compiler error is listed below
> 3>D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Lazy.h(1743):
> error C2665: 'CGAL::exact' : none of the 15 overloads could convert all
> the argument types
> 3>          
> D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Lazy.h(105):
> could be 'const long double &CGAL::exact(const long double &)'
> 3>          
> D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Lazy.h(106): or  
>       'const double &CGAL::exact(const double &)'
> 3>          
> D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Lazy.h(107): or  
>       'const float &CGAL::exact(const float &)'
> 3>          
> D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Lazy.h(108): or  
>       'const int &CGAL::exact(const int &)'
> 3>          
> D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Lazy.h(109): or  
>       'const unsigned int &CGAL::exact(const unsigned int &)'
> 3>          
> D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Lazy.h(110): or  
>       'const long &CGAL::exact(const long &)'
> 3>          
> D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Lazy.h(111): or  
>       'const unsigned long &CGAL::exact(const unsigned long &)'
> 3>          
> D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Lazy.h(113): or  
>       'const __int64 &CGAL::exact(const __int64 &)'
> 3>          
> D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Lazy.h(114): or  
>       'const unsigned __int64 &CGAL::exact(const unsigned __int64 &)'
> 3>          
> D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Lazy.h(116): or  
>       'const CGAL::Return_base_tag &CGAL::exact(const
> CGAL::Return_base_tag &)'
> 3>          
> D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Lazy.h(117): or  
>       'const CGAL::Null_vector &CGAL::exact(const CGAL::Null_vector &)'
> 3>          
> D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Lazy.h(118): or  
>       'const CGAL::Origin &CGAL::exact(const CGAL::Origin &)'
> 3>          
> D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Lazy.h(119): or  
>       'const CGAL::Orientation &CGAL::exact(const CGAL::Orientation &)'
> 3>          
> D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Lazy.h(120): or  
>       'const CGAL::Bbox_2 &CGAL::exact(const CGAL::Bbox_2 &)'
> 3>          
> D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Lazy.h(121): or  
>       'const CGAL::Bbox_3 &CGAL::exact(const CGAL::Bbox_3 &)'
> 3>          while trying to match the argument list '(const CGAL::Gmpq)'
> 3>          
> D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Point_2.h(88) :
> see reference to function template instantiation 'CGAL::Point_2<R_>
> CGAL::Lazy_construction<LK,AC,EC>::operator
> ()<CGAL::Return_base_tag,T1,T2>(const L0 &,const L1 &,const L2 &) const'
> being compiled
> 3>          with
> 3>          [
> 3>              R_=CGAL::Epeck,
> 3>              LK=CGAL::Epeck,
> 3>              
> AC=CGAL::CartesianKernelFunctors::Construct_point_2<CGAL::Simple_cartesian<CGAL::Interval_nt_advanced>>,
> 3>              
> EC=CGAL::CartesianKernelFunctors::Construct_point_2<CGAL::Simple_cartesian<CGAL::Gmpq>>,
> 3>              T1=CGAL::Gmpq,
> 3>              T2=CGAL::Gmpq,
> 3>              L0=CGAL::Return_base_tag,
> 3>              L1=CGAL::Gmpq,
> 3>              L2=CGAL::Gmpq
> 3>          ]
> 3>          
> D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12\include\CGAL/Point_2.h(90) :
> see reference to function template instantiation 'CGAL::Point_2<R_>
> CGAL::Lazy_construction<LK,AC,EC>::operator
> ()<CGAL::Return_base_tag,T1,T2>(const L0 &,const L1 &,const L2 &) const'
> being compiled
> 3>          with
> 3>          [
> 3>              R_=CGAL::Epeck,
> 3>              LK=CGAL::Epeck,
> 3>              
> AC=CGAL::CartesianKernelFunctors::Construct_point_2<CGAL::Simple_cartesian<CGAL::Interval_nt_advanced>>,
> 3>              
> EC=CGAL::CartesianKernelFunctors::Construct_point_2<CGAL::Simple_cartesian<CGAL::Gmpq>>,
> 3>              T1=CGAL::Gmpq,
> 3>              T2=CGAL::Gmpq,
> 3>              L0=CGAL::Return_base_tag,
> 3>              L1=CGAL::Gmpq,
> 3>              L2=CGAL::Gmpq
> 3>          ]
> 3>          src\DdmMesh.cpp(196) : see reference to function template
> instantiation 'CGAL::Point_2<R_>::Point_2<CGAL::Gmpq,CGAL::Gmpq>(const
> T1 &,const T2 &)' being compiled
> 3>          with
> 3>          [
> 3>              R_=CGAL::Epeck,
> 3>              T1=CGAL::Gmpq,
> 3>              T2=CGAL::Gmpq
> 3>          ]
>
> if I convert from CGAl::gmpq to double it works.
>
> Regards
> Dinesh

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss