Page 1 of 1

problem with tools in viewer app

Posted: Fri 3. Nov 2006, 14:30
by timh
I have a problem with tools in the ViewerApp: If the default scene is not created by the viewerapp itself, but via the Factory method and then handed into the viewerapp in the constructor the tools do not work (at least with macosx 10.4.8 intel). I have checked in a test (in the test folder as de.jreality.ui.viewerapp.ViewerAppFromScene).
Can anyone confirm the behaviour, or fix the problem, or hint me to what causes this? I could not find any possible reason for this...
Tim

Posted: Tue 7. Nov 2006, 20:26
by msommer
The problem is that scene.getSceneRoot() does return the scene graph's root node and not the scene node where the default tools are attached (when loading the default scene).

de.jreality.ui.viewerapp.ViewerAppFromScene works fine after replacing scene.getSceneRoot().addChild(sgc) by scene.getSceneRoot().getChildComponent(0).addChild(sgc).

Note that this is the case when JrSceneFactory.getDefaultDesktopScene() is used. Other scenes may have their tools attached to the root node.
Should we fix this in JrSceneFactory.getDefaultDesktopScene()?

Regards, Martin

Posted: Fri 10. Nov 2006, 17:20
by timh
Thanks. Works for me now. Maybe one should mention that bahaviour somewhere in the wiki.
Tim