Jelle Feringa a écrit :
>> I realize I wrote something that is not exactly true: all Swig files,
>> excepted Visualization and Misc, are generated from the
>> SWIG_generator.py script.
>
> Just to understand this right:
>     so how did you set the __hash__ overloader that need to be set to 
> a large number `manually`? do you remember the hack that you told me 
> to set?
>     I'm curious how you re-implemented this at the SWIG level.

Hi Jelle,

The __hash__ overloading is obtained with a few more lines in the SWIG 
file. For the V3d_Viewer class, you have something like:

%extend V3d_Viewer {
    Standard_Integer __hash__() {
    return $self->HashCode(__PYTHONOCC_MAXINT__);
    }
};

The __PYTHONCC_MAXINT__ is a define passed to the compiler (in the 
environment.py script):
DEFINE_MACROS = [('WNT', None),('WIN32',None),\
                     ('_WINDOWS',None),('CSFDB',None),\
                     ('__PYTHONOCC_MAXINT__',sys.maxint)]

It's the only (awfull) solution I found so that your *!?&&�...@!!* MacOSX 
machine can run the __hash__ overloading feature :')

>
> Cheers,

Cheers,

>
> -jelle
>
>
Thomas


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

Reply via email to