On 11/06/2015 01:22 AM, Willie Maddox wrote:
> Ok I am starting to get somewhere with this.
>
> I've created a new typemap for converting an Nx9 list of doubles to a
> list of N Triangle_3 objects and placed it in SWIG_CGAL/Python/typemaps.i
>
> As soon as you wrote the typemap in the Python directory, you need to
> use it inside CGAL_AABB_tree.i otherwise it cannot be taken into
> account.
>
>
> This part has me a bit confused.
> I noticed that of all the typemaps defined in Java/typemaps.i, the only
> one that gets used is in the CGAL_Box_intersection_d.i.
>
> #ifdef SWIGJAVA
> %include "SWIG_CGAL/Java/typemaps.i"
> SWIG_CGAL_array_of_int_to_vector_of_pair_of_int_typemap_in
> #endif
>
>
> Which lines in the CGAL_Box_intersection_d.i actually "use" this typemap?
>
I don't think I use it in the public repo but I do for other projects.
You simply need to call the macro before %template'ing the class
containing the (member) function with the share_ptr parameter.
(%template is wrapped in SWIG_CGAL_declare_identifier_of_template_class
here)
> Also, when you say,
>
> This would need adding a new template parameter to the tree
> wrapper indicating the number of double defining the primitive type.
>
> Do mean creating something similar to the struct
> Primitive_iterator_helper from the AABB_tree.h file?
>
Oh! Actually you don't.
These two line are the instantiation of the template wrapper.
SWIG_CGAL_declare_identifier_of_template_class(AABB_tree_Segment_3_soup,AABB_tree_wrapper<CGAL_SSP_Tree,Segment_3,int
>)
SWIG_CGAL_declare_identifier_of_template_class(AABB_tree_Triangle_3_soup,AABB_tree_wrapper<CGAL_TSP_Tree,Triangle_3,int
>)
Before each of these line you need to call the approxiate macro
and you should be done (because Segment_3/Triangle_3 is a
template parameter). There might need a trick to make
other instantiations (for Polyhedron) to ignore the constructor.
Sebastien.
> Thanks,
>
> -Will