Subject: CGAL users discussion list
List archive
- From: Mahmood NT <>
- To:
- Subject: Re: [cgal-discuss] can not call a function taht takes Alg_point_2
- Date: Thu, 3 Jan 2008 23:28:30 -0800 (PST)
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Message-ID; b=cAOLO0BGHvICsFeyPJfd32NMGE1YVMrSbjoixXu6rTK2GgJpJ4kb8mA5ZQjc5N20kTtzMw4VCLbKeQKT63voHYYcThGDxxLuzOOQUFEeRlVL2yS+kbaxDTi6BmkTIf4vhySG6G4QkSgSQDag/FdFyS79dy4O/IIeDaJrKgtNY6g=;
Hi,
>Alternatively, it might help, to write "const Alg_point_2& first",
>but this is a wild guess looking at the error message.
it was not a bad guess... but I add "const" at the end of decleration as:
bool isShorter( Alg_point_2& first, Alg_point_2& second, Alg_point_2& goal )
const
and the error actually gone! I do not know why, but the problem solved
Mahmood NT
----- Original Message ----
From: Andreas Fabri
<>
To:
Sent: Friday, January 4, 2008 12:18:03 AM
Subject: Re: [cgal-discuss] can not call a function taht takes Alg_point_2
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,
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
- Re: [cgal-discuss] can not call a function taht takes Alg_point_2, Mahmood NT, 01/04/2008
- Re: [cgal-discuss] can not call a function taht takes Alg_point_2, Laurent Rineau, 01/04/2008
- <Possible follow-up(s)>
- Re: [cgal-discuss] can not call a function taht takes Alg_point_2, Mahmood NT, 01/04/2008
Archive powered by MHonArc 2.6.16.