problem with tools in viewer app

Core SceneGraph API, Utilities, Factories etc.
Post Reply
timh
Posts: 28
Joined: Wed 28. Jun 2006, 20:30
Contact:

problem with tools in viewer app

Post by timh » Fri 3. Nov 2006, 14:30

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

msommer
Posts: 3
Joined: Wed 28. Jun 2006, 11:18
Location: TU Berlin

Post by msommer » Tue 7. Nov 2006, 20:26

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

timh
Posts: 28
Joined: Wed 28. Jun 2006, 20:30
Contact:

Post by timh » Fri 10. Nov 2006, 17:20

Thanks. Works for me now. Maybe one should mention that bahaviour somewhere in the wiki.
Tim

Post Reply