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.
Info
One and only one editor is active at any time.
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 corresponding SBGDataGraphNode GUI class, 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 Extension Generator and tutorials for more information about writing new editors for SAMSON.