Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] can not call a function taht takes Alg_point_2

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] can not call a function taht takes Alg_point_2


Chronological Thread 
  • From: Andreas Fabri <>
  • To:
  • Subject: Re: [cgal-discuss] can not call a function taht takes Alg_point_2
  • Date: Thu, 03 Jan 2008 21:48:03 +0100

Hi,

Maybe it helps to switch from mileStones to the metric system, as CGAL is a
rather European project.

Alternatively, it might help, to write "const Alg_point_2& first",
but this is a wild guess looking at the error message.

A happy new year,

andreas



wrote:
Hi,
I write a simple function that takes three Alg_point_2 arguments:
bool isShorter( Alg_point_2& first, Alg_point_2& second, Alg_point_2& goal )
{
double x1 = CGAL::to_double (first.x());
double x2 = CGAL::to_double (second.x());
double y1 = CGAL::to_double (first.y());
double y2 = CGAL::to_double (second.y());
double xg = CGAL::to_double (goal.x());
double yg = CGAL::to_double (goal.y());
double d1 = ::sqrt (CGAL::to_double (CGAL::square (x1 - xg) +
CGAL::square (y1 - yg)));
double d2 = ::sqrt (CGAL::to_double (CGAL::square (x2 - xg) +
CGAL::square (y2 - yg)));
if ( d1 <= d2 )
return true;
else
return false;
}

and I call it somewhere in my code:
isShorter(mileStones[cnti], nextHop, goal);

the compilation error is:
error C2662: 'CGAL::VVc_diagram_2<Traits_,AppKernel_>::isShorter' : cannot convert 'this'
pointer from 'const CGAL::VVc_diagram_2<Traits_,AppKernel_>' to
'CGAL::VVc_diagram_2<Traits_,AppKernel_> &'
with
[
Traits_=Traits_2,
AppKernel_=App_kernel
]
and
[
Traits_=Traits_2,
AppKernel_=App_kernel
]
and
[
Traits_=Traits_2,
AppKernel_=App_kernel
]
Conversion loses qualifiers

What is the problem?
Thanks,



Archive powered by MHonArc 2.6.16.

Top of Page