This document is for OpenStructure version 1.1, the latest version is 2.8 !

Tools

OpenStructure has several Tool which are all listed in the toolbar close to the 3D window. A tool is activated upon selecting it in the toolbar. Input events are sent to the tool as long as the Ctrl key (Cmd on Mac) is pressed. For example the rigid body manipulator will rotate and shift the currently selected nodes in the scene win. Upon releasing Ctrl, the events are sent to the camera, making it possible to rapidly switch between adjusting the viewing angle of the camera and manipulating the position and orientation of scene objects.

../../_images/100208_Tools.png

The example Write a Tool in Python demonstrates how to add a simple tool (written in python) to OpenStructure.

class ost.gui.Tool

Parameters of the tool that are configurable should be implemented using the ToolOptions facility. This automatically takes care of remembering the used options over different sessions (in the future) and creates a widget to modify these options.

input_events Input Events

Tools receive input events when the Control key (Command on MacOS X) is pressed. This includes both keyboard events and mouse events such as mouse move events, clicks and Real clicks.

Tools only receive mouse move events when one of the mouse buttons is pressed.

CanOperateOn(nodes)

determines if the tool can manipulate a certain gfx.GfxNode. This method is used to enabled/disable certain actions (in the toolbar, for example).

Return True if the Tool can operate on all GfxNodes which are in the given list. Otherwise False

Parameters:nodes (NodePtrList) – List with gfx.GfxNode
Return type:bool
Click(event)

left mouse click

Parameters:event – object with the event information
DoubleClick(event)

double click

Parameters:event (MouseEvent) – object with the event information
GetIconPath()

Returns the path to an shiny icon. If no path is given, no icon will be displayed

Return type:str
GetName()

Returns the name of the Tool which will be displayed in the gui.

Return type:str
GetToolOptions()
Return type:ToolOptions

Search

Enter search terms or a module, class or function name.

Contents

Documentation is available for the following OpenStructure versions:

dev / 2.8 / 2.7 / 2.6 / 2.5 / 2.4 / 2.3.1 / 2.3 / 2.2 / 2.1 / 2.0 / 1.9 / 1.8 / 1.7.1 / 1.7 / 1.6 / 1.5 / 1.4 / 1.3 / 1.2 / 1.11 / 1.10 / (Currently viewing 1.1)

This documentation is still under heavy development!
If something is missing or if you need the C++ API description in doxygen style, check our old documentation for further information.