Editors

Editors are classes that receive user interaction events (e.g. mouse and keyboard events) from SAMSON, which may be used to provide potentially complex editing functionality. For example, an editor may be a nanotube generator that lets users create a new nanotube model in a few clicks, a tool for deforming molecular structures while preserving local rigidity, a rectangle selection tool, a tool to apply a rigid-body transform to a model, etc. At startup, SAMSON positions editors in the Edit menu and the Editors toolbar.

Important: One and only one editor is active at any time.

A nanotube generator editor

# The flow of events

The Qt events received by the SAMSON viewport (e.g. from the keyboard, the mouse, etc.) are processed as follows:

• If shift is pressed, the active camera is operated, the Qt event is accepted, and nothing more may happen.
• If shift is not pressed, the Qt event is passed to the active editor. If the active editor accepts the event, nothing more may happen.
• If the active editor ignores the Qt event, a data graph node is picked in the viewport. If the picked node has a SBGDataGraphNode GUI, then the Qt event is passed to this GUI.

If you want to start developing you own editors, please, refer to the documentation about the SAMSON Element generator and Tutorials for more information about writing new editors for SAMSON.