The base class for plugins that interact with QtOpenGL::GLWidget.
More...
#include <avogadro/qtgui/toolplugin.h>
◆ name()
| virtual QString name |
( |
| ) |
const |
|
pure virtual |
The name of the tool, will be displayed in the user interface.
◆ description()
| virtual QString description |
( |
| ) |
const |
|
pure virtual |
A description of the tool, may be displayed in the user interface.
◆ priority()
| virtual unsigned char priority |
( |
| ) |
const |
|
pure virtual |
A priority of the tool for sorting in the user interface.
◆ activateAction()
| virtual QAction * activateAction |
( |
| ) |
const |
|
pure virtual |
- Returns
- The QAction that will cause this tool to become active.
◆ setIcon()
| virtual void setIcon |
( |
bool | darkTheme = false | ) |
|
|
pure virtual |
Set the tool icon (based on dark / light theme).
◆ toolWidget()
| virtual QWidget * toolWidget |
( |
| ) |
const |
|
pure virtual |
- Returns
- A QWidget that will be displayed to the user while this tool is active.
◆ mousePressEvent()
| virtual QUndoCommand * mousePressEvent |
( |
QMouseEvent * | e | ) |
|
|
virtual |
Respond to user-input events.
- Parameters
-
- Returns
- A QUndoCommand that can be used to undo any changes to the molecule. If no undoable change is made, the method may return nullptr.
◆ mouseReleaseEvent()
| virtual QUndoCommand * mouseReleaseEvent |
( |
QMouseEvent * | e | ) |
|
|
virtual |
Respond to user-input events.
- Parameters
-
- Returns
- A QUndoCommand that can be used to undo any changes to the molecule. If no undoable change is made, the method may return nullptr.
◆ mouseMoveEvent()
| virtual QUndoCommand * mouseMoveEvent |
( |
QMouseEvent * | e | ) |
|
|
virtual |
Respond to user-input events.
- Parameters
-
- Returns
- A QUndoCommand that can be used to undo any changes to the molecule. If no undoable change is made, the method may return nullptr.
◆ mouseDoubleClickEvent()
| virtual QUndoCommand * mouseDoubleClickEvent |
( |
QMouseEvent * | e | ) |
|
|
virtual |
Respond to user-input events.
- Parameters
-
- Returns
- A QUndoCommand that can be used to undo any changes to the molecule. If no undoable change is made, the method may return nullptr.
◆ wheelEvent()
| virtual QUndoCommand * wheelEvent |
( |
QWheelEvent * | e | ) |
|
|
virtual |
Respond to user-input events.
- Parameters
-
- Returns
- A QUndoCommand that can be used to undo any changes to the molecule. If no undoable change is made, the method may return nullptr.
◆ keyPressEvent()
| virtual QUndoCommand * keyPressEvent |
( |
QKeyEvent * | e | ) |
|
|
virtual |
Respond to user-input events.
- Parameters
-
- Returns
- A QUndoCommand that can be used to undo any changes to the molecule. If no undoable change is made, the method may return nullptr.
◆ keyReleaseEvent()
| virtual QUndoCommand * keyReleaseEvent |
( |
QKeyEvent * | e | ) |
|
|
virtual |
Respond to user-input events.
- Parameters
-
- Returns
- A QUndoCommand that can be used to undo any changes to the molecule. If no undoable change is made, the method may return nullptr.
◆ draw()
Override this method to add drawables to the scene graph.
◆ handleCommand()
| virtual bool handleCommand |
( |
const QString & | command, |
|
|
const QVariantMap & | options ) |
|
virtual |
Called by the app to handle a command registered by the plugin. (e.g., "renderMovie" or "drawAtom", etc.)
The app will turn the command into a string and pass it to the tool. and any options will go from a JSON dictionary to a QVariantMap.
- Returns
- true if the command was handled, false otherwise.
◆ registerCommands()
| virtual void registerCommands |
( |
| ) |
|
|
virtual |
Called by the app to tell the tool to register commands. If the tool has commands, it should emit the registerCommand signals.
◆ drawablesChanged
| void drawablesChanged |
( |
| ) |
|
|
signal |
Emitted when draw() needs to be called again due to updates.
◆ updateRequested
Emitted when something changed (camera, etc) and the molecule should be redrawn.
◆ registerCommand
| void registerCommand |
( |
QString | command, |
|
|
QString | description ) |
|
signal |
Register a new command with the application. The command will be available through scripting (e.g., "renderMovie" or "generateSurface", etc.)
- Parameters
-
| command | The name of the command to register. |
| description | A description of the command. |
- See also
- handleCommand
◆ requestActiveDisplayTypes
| void requestActiveDisplayTypes |
( |
QStringList | displayTypes | ) |
|
|
signal |
Request a specific display type (or types) are made active. This can be useful when loading a specific type of data that would be most readily viewed with a specialized view.
◆ commandStarted
Indicate that a command has been started, but is not yet finished – for example, work that handleCommand() handed to a background thread.
The application holds the caller's reply until the command completes. Once this is emitted, every code path must end in commandFinished() or commandFailed(), or the caller waits until the command times out.
- See also
- commandFinished, commandFailed
◆ commandFinished
| void commandFinished |
( |
const QString & | message = QString(), |
|
|
const QVariantMap & | result = QVariantMap() ) |
|
signal |
Indicate that a particular script command is finished. (e.g., from handleCommand)
- Parameters
-
| message | An optional message to the script or user |
| result | Optional results for the caller, e.g. an energy or a gradient. Only types with a JSON equivalent survive the trip to a script, so convert Eigen and Core::Array values to lists of numbers before adding them. |
◆ commandFailed
| void commandFailed |
( |
const QString & | message = QString() | ) |
|
|
signal |
Indicate that a command that was started cannot be completed.
- Parameters
-
| message | A message to the script or user explaining the failure |
- See also
- commandStarted
◆ setMolecule
Called when the current molecule changes.
◆ setGLWidget
Set the GLWidget used by the tool.
◆ setActiveWidget
| virtual void setActiveWidget |
( |
QWidget * | | ) |
|
|
virtualslot |
Set the active widget used by the tool, this can be anything derived from QWidget.
◆ setGLRenderer
Set the GLRenderer used by the tool.
The documentation for this class was generated from the following file: