Bryan Cole a écrit :
> Hi,
>   

Hi Bryan,

> I'm in the process of writing a simple OCAF document browser. I can
> browse the TDF_Label tree OK, but accessing the attributes is proving
> tricky. Mostly, the problem is getting data out of OCC types back to
> python.
>
> Can anyone suggest how to get the content out of a
> TCollection.TCollection_ExtendedString ?
>
> Also, converting Standard_GUID to a python value is difficult. I'd like
> to access the GUID as a string. To use the Standard_GUID::ToCString()
> method, I need to pre-create a C-string (full of zeros), and pass it in
> by reference (as a Standard_PCharacter). Phew, C++ make things so
> hard... Does SWIG give us any tools to construct types manually (from
> ctypes objects perhaps)?
>   

You don't need that. SWIG can handle C++ byreference passed parameters. 
Thanks for the feedback, I'll add a SWIG template that enable the 
Standard_GUID::ToCString() method to take 0 parameters and return a 
python string.

> Finally, are the SWIG interface files written manually? If time permits,
> I'll starting looking as these.
>   

SWIG interface files are *all* generated from the SWIG_generator.py 
script. There is absolutely no manual tweak to the resulting swig files.

> cheers,
>   

Cheers,

> Bryan C
>   

Thomas


_______________________________________________
Pythonocc-users mailing list
Pythonocc-users@gna.org
https://mail.gna.org/listinfo/pythonocc-users

Reply via email to