chrisidefix / cgal-bindings

Automatically exported from code.google.com/p/cgal-bindings
Boost Software License 1.0
0 stars 0 forks source link

Bindings example on interpolation #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,
I want to test the natural neighbor coordinates interpolation function on
a delaunay triangulation.

Unfortunately, I can't find how to do it. Basically, here is what I tried in 
python (I attached a python file for more details):

triangulation = Triangulation_2()
p = Point_2()
p_ = Point_2_and_double()
r = natural_neighbor_coordinates_2(t, p, p_)

This leads to the following error:

"""
Wrong number or type of arguments for overloaded function 
'natural_neighbor_coordinates_2'.
  Possible C/C++ prototypes are:
    natural_neighbor_coordinates_2(Delaunay_triangulation_2_SWIG_wrapper const &,Point_2 const &,boost::function_output_iterator< Container_writer< std::pair< Point_2,double >,std::pair< Point_2::cpp_base,double > > >,SWIG_Triangulation_2::CGAL_Face_handle< CGAL_DT2,Point_2 > const &)
    natural_neighbor_coordinates_2(Delaunay_triangulation_2_SWIG_wrapper const &,Point_2 const &,boost::function_output_iterator< Container_writer< std::pair< Point_2,double >,std::pair< Point_2::cpp_base,double > > >)
    natural_neighbor_coordinates_2(Delaunay_triangulation_2_SWIG_wrapper const &,Point_2 const &,boost::function_output_iterator< Container_writer< std::pair< Point_2,double >,std::pair< Point_2::cpp_base,double > > >,std::pair< Input_iterator_wrapper< Delaunay_triangulation_2_Edge_SWIG_wrapper,CGAL_DT2::Edge >,Input_iterator_wrapper< Delaunay_triangulation_2_Edge_SWIG_wrapper,CGAL_DT2::Edge > >)
    natural_neighbor_coordinates_2(Delaunay_triangulation_2_SWIG_wrapper const &,SWIG_Triangulation_2::CGAL_Vertex_handle< CGAL_DT2,Point_2 > const &,boost::function_output_iterator< Container_writer< std::pair< Point_2,double >,std::pair< Point_2::cpp_base,double > > >)
"""

I think I didn't understand what Point_2_and_double is for...

Thx,

François

Original issue reported on code.google.com by francois...@gmail.com on 19 Jan 2012 at 8:53

Attachments:

GoogleCodeExporter commented 9 years ago
Looking at the c++ page here:
http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Interpolation_ref/Functio
n_natural_neighbor_coordinates_2.html
(sorry no target language specific documentation is available for now)

Two problems:
1) t should be a Delaunay_triangulation_2 and not a Triangulation_2
2) the third parameter should be a list and not a Point_and_double

A X_and_Y is a mapping of the c++ type std::pair<X,Y>. So Point_2_and_double
is a python tuple containing a Point and a double.

Original comment by sloriot...@gmail.com on 19 Jan 2012 at 9:44

GoogleCodeExporter commented 9 years ago

Original comment by sloriot...@gmail.com on 19 Jan 2012 at 9:45

GoogleCodeExporter commented 9 years ago
Thx a lot for your help. I've just run an example with linear interpolation. 
I attached a python example.

Original comment by francois...@gmail.com on 19 Jan 2012 at 11:29

Attachments: