-
Notifications
You must be signed in to change notification settings - Fork 40
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
SoCoordinateElement.getInstance() doesn't work in event handler context #73
Comments
@tomkcook do you have any docs/examples for this class? |
@looooo for which class? |
SoCoordinateElement |
No. This is what's in the documentation for SoCoordinateElement:
The approach I'm taking comes from SoVertexShape.cpp, |
SoVertexShape::getVertexData(...):
Do you know what "current" refers to? Maybe someone from the coin-maintainers can help? @VolkerEnderlein |
"Current" here refers to the state of scenegraph traversal. This is used in objects such as TBH I'm not sure if this is a bug or how it's expected to work, and if it is a bug, whether it's a bug in Pivy or in Coin3D. I happen to have come at it via Pivy so I filed a ticket here, but I'm happy to be redirected to Coin3D if that's where the problem is. |
In the C++ API of Coin3d a convenience macro SO_ENABLE is provided to register an element type to an action type. Since pivy (as far as I can see) lacks of this macro you must implement it yourself as a function:
An SoEventCallback node internally uses an SoHandleEventAction to transport an SoEvent. So, in order to allow to access the SoCoordinateElement from within your event handler you must add this line to your code
For more details have a look at The Inventor Toolmaker: http://www-evasion.imag.fr/Membres/Francois.Faure/doc/inventorToolmaker/sgi_html/ch02.html#id5444406 |
SoCoordinateElement.getInstance(state)
is meant to retrieve the coordinate data from the top of the scenegraph stack. But this doesn't seem to work in an event handler context. I'm trying to do something along these lines:But this results in
co_el == None
in the event callback. Am I doing something wrong? Or is there some other way to get the coordinate data in this context?The text was updated successfully, but these errors were encountered: