Unload default tools

Have jReality programming problems or questions? Post them here.
Post Reply
Joe
Posts: 61
Joined: Fri 11. Jul 2008, 19:29

Unload default tools

Post by Joe » Sun 3. Aug 2008, 20:17

Hi,
how can I unload or deactivate the default tools "EncompassTool", "DraggingTool", "RotateTool" and / or "AnimatorTool"?

I found them during debugging in ViewerApp -> ToolSystem -> ToolManager -> ToolToPaths, but I don't know how to access them.

Many thanks.

Best regards, Joe

User avatar
gunn
Posts: 323
Joined: Thu 14. Dec 2006, 09:56
Location: TU Berlin
Contact:

Post by gunn » Wed 13. Aug 2008, 00:19

To remove tools from the ViewerApp application:

1. Turn on display of the Navigator panel.

2. Open the SceneGraphComponent named scene (it may have a different name depending how your scene was constructed) by clicking on the triangle to the left of its name.

3. Select one of the tools which you wish to remove by clicking on its name in the Navigator panel.

4. Using the right mouse context menu, select Remove.

5. Repeat for the other tools.
jReality core developer

Joe
Posts: 61
Joined: Fri 11. Jul 2008, 19:29

Post by Joe » Wed 13. Aug 2008, 21:09

Thanks for your reply. There's a misunderstanding. I want to remove the default tools via implementation, not by clicking in the GUI. I use jReality without its GUI, only the viewing functionalities. Therefore I'm looking for Java code lines to remove these tools.

User avatar
gunn
Posts: 323
Joined: Thu 14. Dec 2006, 09:56
Location: TU Berlin
Contact:

Post by gunn » Wed 13. Aug 2008, 22:14

These tools are added by ViewerApp to the top-level SceneGraphComponent containing the scene (not the root, but a child of the root). You'll need to know which SceneGraphComponent instance this is. (By default it's the child of the scene root named scene). Suppose it's named scene. Then invoke following methods to remove all tools in this component:

Code: Select all

List<Tool> tools = scene.getTools();
for (Tool t : tools) scene.removeTool(t);
It's possible to avoid having these tools added in the first place, by using the following constructor for ViewerApp:

Code: Select all

	ViewerApp va =  new ViewerApp(SceneGraphComponent root, SceneGraphPath cameraPath, SceneGraphPath emptyPick, SceneGraphPath avatar);
This requires that you create your own camera, and provide the paths shown. These paths can be null, but then some tools may not function as expected. It's probably easier to remove the tools by hand as indicated above.
jReality core developer

Joe
Posts: 61
Joined: Fri 11. Jul 2008, 19:29

Post by Joe » Thu 14. Aug 2008, 09:02

Thanks, it works.

Joe
Posts: 61
Joined: Fri 11. Jul 2008, 19:29

Post by Joe » Wed 10. Sep 2008, 19:32

Hups, I found one tool which isn't removed by this way. A "mouse wheel zoom tool" remains. Is it attached to another location in the scene graph? Can it also be removed? I want to redefine the mouse key and wheel behavior.

Joe
Posts: 61
Joined: Fri 11. Jul 2008, 19:29

Post by Joe » Wed 10. Sep 2008, 20:03

Hups again, I found it myself. It's directly in the scene root. Sorry.

Post Reply