Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Question about intersection(A,B)

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Question about intersection(A,B)


Chronological Thread 
  • From: Laurent Rineau <>
  • To:
  • Subject: Re: [cgal-discuss] Question about intersection(A,B)
  • Date: Sun, 8 Jun 2008 12:43:56 +0200
  • Organization: Inria, Sophia Antipolis, FRANCE

On Sunday 08 June 2008 12:22:45 Mahmood Naderan wrote:
> I tried both your solutions, but they have one compiler error:
> error C2784: 'CGAL::Object CGAL::intersection(const CGAL::Triangle_2<R_>
> &,const CGAL::Iso_rectangle_2<R_> &)' : could not deduce template argument
> for 'const CGAL::Triangle_2<R_> &' from 'const
> CGAL::Approximated_Cartesian<NT_,Compare_NT_,Sqrt_NT_>::Segment_2' with
>         [
>             NT_=double,
>             Compare_NT_=Compare_double_eps,
>             Sqrt_NT_=Square_root_eps
>         ]

As far as I know, CGAL::Approximated_Cartesian is not a CGAL class. If you
create a custom kernel, with custom Segment_2 or Point_2 subtype, you cannot
except that the CGAL::intersection template can deal with those types!

Well, maybe it can. At this point, if you want to get help, you'll need to
give us your complete code. If your code is bigger that 2-5ko, you should not
attached it to a mail to a mailing list, but put it on the web (accessible
with http of ftp, for example).


Anyway, it seems that you should *really* read the documentation! For
example,
the documentation of CGAL::intersection is here:
http://www.cgal.org/Manual/3.3/doc_html/cgal_manual/Kernel_23_ref/Function_intersection.html

On that reference page, you can see two informations that you missed:
- the return type of CGAL::intersection is always CGAL::Object,
- that function can take a couple a CGAL::Segment_2<K> objects, as soon as
K
is a model of Kernel concept¹. Your Segment_2 does not seem to be an instance
of CGAL::Segment_2<K>. The error you get, for the moment, is for that reason!


¹) The Kernel concept is documented here:
http://www.cgal.org/Manual/3.3/doc_html/cgal_manual/Kernel_23_ref/Concept_Kernel.html
Good reading.

--
Laurent Rineau
INRIA - Sophia Antipolis
BP 93, 2004 Route des Lucioles
06902 Sophia Antipolis Cedex FRANCE
Tel: +33 4 92 38 78 62 (Fax: +33.4.97.15.53.95)



Archive powered by MHonArc 2.6.16.

Top of Page