-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SWIG: add downcasting #284
Comments
This is possible using swigs factory feature, see example |
Thanks for the suggestion! I had a look at swig source. This looks really useful. However, it is not clear to me if this only applies to actual factories (i.e. method that create a new object), or also to other methods that just return a (shared) ptr, as in the example above. I have the impression it's only the former (but my SWIG is rusty). Maybe this is a question for the SWIG list though. |
It's both, object generation and object dispatch. |
Here's the SWIG code confusingly, the SWIG FAQ makes it look much harder. |
Possibly this might be as simple as include something like
although how that will work templates I don't know. |
probably we'd have to list |
A difficulty is that some members return a base class ptr, which cannot be downcasted in python. Example
Then
input
is of typeExamData
and there's no way to get at members of aProjData
(or whatever it is).This might be possible as mentioned for instance at tpaviot/pythonocc-generator#28
The text was updated successfully, but these errors were encountered: