chrisidefix / cgal-bindings

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

Ease use of output arguments for Triangulation_x::is_edge in Python #47

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The C++ Triangulation_2::is_edge method uses two output arguments : a reference 
to a Face_handle and to an int.

(cf. 
http://doc.cgal.org/latest/Triangulation_2/classCGAL_1_1Triangulation__2.html#ad
beb9736f9bfc588658316669cd7fb44)

For now the method has to be used as follow (thanks to Sébastien Loriot for 
the trick):

from CGAL_Mesh_2 import 
Ref_Mesh_2_Constrained_Delaunay_triangulation_plus_2_Face_handle
from CGAL_Kernel import Ref_int

# Assume `cdt` is a CDT+2 and `va`, `vb` are  valid `Face_handle`s
fh_ref=Ref_Mesh_2_Constrained_Delaunay_triangulation_plus_2_Face_handle()
i = Ref_int()
is_edge = cdt.is_edge(va, vb, fh, i)
if is_edge:
  return (fh.object(), i.object()) 

Please consider documenting this and/or reducing the complexity. 

I'm willing to contribute the doc patch or help with the patch.

Original issue reported on code.google.com by anthony.truchet@gmail.com on 1 Jul 2014 at 7:02