Class Avogadro::QtGui::ToolPlugin#

class Avogadro::QtGui::ToolPlugin : public QObject#

The base class for plugins that interact with QtOpenGL::GLWidget.

Author

Allison Vacanti

Unnamed Group

virtual QUndoCommand *mousePressEvent(QMouseEvent *e)#

Respond to user-input events.

Parameters

e – The QEvent object.

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.

virtual QUndoCommand *mouseReleaseEvent(QMouseEvent *e)#

Respond to user-input events.

Parameters

e – The QEvent object.

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.

virtual QUndoCommand *mouseMoveEvent(QMouseEvent *e)#

Respond to user-input events.

Parameters

e – The QEvent object.

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.

virtual QUndoCommand *mouseDoubleClickEvent(QMouseEvent *e)#

Respond to user-input events.

Parameters

e – The QEvent object.

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.

virtual QUndoCommand *wheelEvent(QWheelEvent *e)#

Respond to user-input events.

Parameters

e – The QEvent object.

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.

virtual QUndoCommand *keyPressEvent(QKeyEvent *e)#

Respond to user-input events.

Parameters

e – The QEvent object.

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.

virtual QUndoCommand *keyReleaseEvent(QKeyEvent *e)#

Respond to user-input events.

Parameters

e – The QEvent object.

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.

Public Functions

explicit ToolPlugin(QObject *parent = nullptr)#
~ToolPlugin() override#
virtual QString name() const = 0#

The name of the tool, will be displayed in the user interface.

virtual QString description() const = 0#

A description of the tool, may be displayed in the user interface.

virtual unsigned char priority() const = 0#

A priority of the tool for sorting in the user interface.

virtual QAction *activateAction() const = 0#
Returns

The QAction that will cause this tool to become active.

virtual QWidget *toolWidget() const = 0#
Returns

A QWidget that will be displayed to the user while this tool is active.

virtual void draw(Rendering::GroupNode &node)#

Override this method to add drawables to the scene graph.

Public Slots

virtual void setMolecule(QtGui::Molecule *mol) = 0#

Called when the current molecule changes.

inline virtual void setEditMolecule(QtGui::RWMolecule*)#
inline virtual void setGLWidget(QtOpenGL::GLWidget*)#

Set the GLWidget used by the tool.

inline virtual void setActiveWidget(QWidget*)#

Set the active widget used by the tool, this can be anything derived from QWidget.

inline virtual void setGLRenderer(Rendering::GLRenderer*)#

Set the GLRenderer used by the tool.

Signals

void drawablesChanged()#

Emitted when draw() needs to be called again due to updates.

void updateRequested()#

Emitted when something changed (camera, etc) and the molecule should be redrawn.