chrisidefix / cgal-bindings

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

pickle support for CGAL objects #33

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
It seems that it is not yet possible to use pickle with objects from CGAL.

I tried : 

from CGAL.CGAL_Polyhedron_3 import Polyhedron_3
import pickle
polyhedron=Polyhedron_3()
filename='datafile'
with open( filename,'w') as f: 
    pickle.dump(polyhedron,f)

And I get the error "TypeError: can't pickle SwigPyObject objects"
on the line
File "C:\Python27\Lib\copy_reg.py", line 70, in _reduce_ex
  raise TypeError, "can't pickle %s objects" % base.__name__

Maybe this could be done by defining __getstate__ and __setstate_ methods in 
the c++ code ?
_

Original issue reported on code.google.com by martin.d...@gmail.com on 12 Jun 2013 at 1:01

GoogleCodeExporter commented 9 years ago
Indeed there is no support for the serialization now

Original comment by sloriot...@gmail.com on 13 Jun 2013 at 10:16

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
should that be added in the road map ?

Original comment by martin.d...@gmail.com on 14 Jun 2013 at 12:52

GoogleCodeExporter commented 9 years ago
Are there plans to add pickle support to the cgal-bindings?

Original comment by willie.m...@gmail.com on 31 Aug 2014 at 8:47

GoogleCodeExporter commented 9 years ago
Not yet

Original comment by sloriot...@gmail.com on 1 Sep 2014 at 5:57